forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
94 additions
and
96 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
51 changes: 0 additions & 51 deletions
51
data-otservbr-global/scripts/quests/adventurers_guild/actions_treasure.lua
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
data-otservbr-global/scripts/quests/the_great_dragon_hunt_quest/actions_treasure.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,47 @@ | ||
local items = { | ||
{ description = "a platinum coins", items = { { id = ITEM_PLATINUM_COIN, count = 5 } } }, | ||
{ | ||
description = "some gems", | ||
items = { | ||
{ id = 3029, count = 1 }, | ||
{ id = 3032, count = 1 }, | ||
{ id = 3030, count = 1 }, | ||
}, | ||
}, | ||
{ description = "a life ring", items = { { id = 3089, count = 1 } } }, | ||
{ description = "a red gem", items = { { id = 3039, count = 1 } } }, | ||
{ description = "a mana potion", items = { { id = 237, count = 10 } } }, | ||
{ description = "a health potion", items = { { id = 236, count = 8 } } }, | ||
} | ||
|
||
local adventurersTreasure = Action() | ||
|
||
function adventurersTreasure.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter) >= 50 then | ||
local treasure = items[math.random(#items)] | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is impossible to take along all of the treasures here. But you pick out " .. treasure.description) | ||
for _, item in ipairs(treasure.items) do | ||
player:addItem(item.id, item.count) | ||
end | ||
|
||
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, 0) | ||
|
||
local times = player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement) | ||
if times < 0 then | ||
times = 0 | ||
end | ||
times = times + 1 | ||
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement, times) | ||
|
||
if times == 10 then | ||
player:addAchievement("Hoard of the Dragon") | ||
end | ||
else | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to pick a treasure, but you hear further dragons approaching. You should kill some more before picking out something.") | ||
end | ||
|
||
return true | ||
end | ||
|
||
adventurersTreasure:aid(50808) | ||
adventurersTreasure:register() |
9 changes: 5 additions & 4 deletions
9
...turers_guild/actions_warrior_skeleton.lua → ...n_hunt_quest/actions_warrior_skeleton.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
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