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.
Created tournament market custom, to buy items, outfits, mounts with …
…tournament coins (item used as tournament coins: gold of bar).
- Loading branch information
1 parent
0ba46fe
commit 24a6222
Showing
12 changed files
with
312 additions
and
50 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
17 changes: 17 additions & 0 deletions
17
data-otservbr-global/scripts/actions/custom/tournament_tokens.lua
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,17 @@ | ||
local token = Action() | ||
|
||
local tokenId = 14112 -- bar of gold (if you don't use custom item, you need to verify all drops in monsters) | ||
|
||
function token.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if player:getItemCount(tokenId) > 0 then | ||
local tournamentCoins = player:getItemCount(tokenId) | ||
db.query("UPDATE `accounts` SET `tournament_coins` = `tournament_coins` + '" .. tournamentCoins .. "' WHERE `id` = '" .. player:getAccountId() .. "';") | ||
player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You added %d %s to your account.", tournamentCoins, configManager.getString(configKeys.TOURNAMENT_COINS_NAME):lower())) | ||
player:removeItem(tokenId, tournamentCoins) | ||
player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) | ||
end | ||
return true | ||
end | ||
|
||
token:id(tokenId) | ||
token:register() |
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
Oops, something went wrong.