forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/missing-achievements
- Loading branch information
Showing
25 changed files
with
865 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
local addTitle = TalkAction("/addtitle") | ||
|
||
function addTitle.onSay(player, words, param) | ||
-- create log | ||
logCommand(player, words, param) | ||
|
||
if param == "" then | ||
player:sendCancelMessage("Command param required.") | ||
return true | ||
end | ||
|
||
local split = param:split(",") | ||
if not split[2] then | ||
player:sendCancelMessage("Insufficient parameters. Usage: /addtitle playerName, badgeID") | ||
return true | ||
end | ||
|
||
local target = Player(split[1]) | ||
if not target then | ||
player:sendCancelMessage("A player with that name is not online.") | ||
return true | ||
end | ||
|
||
split[2] = split[2]:trimSpace() | ||
local id = tonumber(split[2]) | ||
if target:addTitle(id) then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format('You added a title with ID "%i" to player "%s".', id, target:getName())) | ||
target:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("%s added a title to you.", player:getName())) | ||
end | ||
|
||
return true | ||
end | ||
|
||
addTitle:separator(" ") | ||
addTitle:groupType("god") | ||
addTitle:register() | ||
|
||
----------------------------------------- | ||
local setTitle = TalkAction("/settitle") | ||
|
||
function setTitle.onSay(player, words, param) | ||
-- create log | ||
logCommand(player, words, param) | ||
|
||
if param == "" then | ||
player:sendCancelMessage("Command param required.") | ||
return true | ||
end | ||
|
||
local split = param:split(",") | ||
if not split[2] then | ||
player:sendCancelMessage("Insufficient parameters. Usage: /settitle playerName, badgeID") | ||
return true | ||
end | ||
|
||
local target = Player(split[1]) | ||
if not target then | ||
player:sendCancelMessage("A player with that name is not online.") | ||
return true | ||
end | ||
|
||
split[2] = split[2]:trimSpace() | ||
local id = tonumber(split[2]) | ||
target:setCurrentTitle(id) | ||
return true | ||
end | ||
|
||
setTitle:separator(" ") | ||
setTitle:groupType("god") | ||
setTitle:register() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.