-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
1 parent
ea4c6e8
commit 85cffa5
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
data-otservbr-global/scripts/actions/rookgaard/rapier_quest.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,20 @@ | ||
local rapierQuest = Action() | ||
local reward = 3272 | ||
function rapierQuest.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
local itemType = ItemType(reward) | ||
local itemWeight = itemType:getWeight() | ||
if player:getFreeCapacity() >= itemType:getWeight() then | ||
if not player:questKV("rapier"):get("completed") then | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a rapier.") | ||
player:addItem(reward, 1) | ||
player:questKV("rapier"):set("completed", true) | ||
else | ||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The box is empty.") | ||
end | ||
else | ||
player:sendTextMessage(MESSAGE_LOOK, "You have found a " .. itemType:getName() .. " weighing " .. (itemWeight/ 100) .. " oz, but it's too heavy.") | ||
end | ||
return true | ||
end | ||
rapierQuest:uid(14042) | ||
rapierQuest: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