-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
data-otxserver/scripts/actions/other/others/quest_system_old.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,30 @@ | ||
local questSystemOld = Action() | ||
|
||
function questSystemOld.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if item.uid <= 100 or item.uid >= 44613 then | ||
return false | ||
end | ||
|
||
local itemType = ItemType(item.uid) | ||
if itemType:getId() == 0 then | ||
return false | ||
end | ||
|
||
local itemWeight = itemType:getWeight() | ||
local playerCap = player:getFreeCapacity() | ||
if player:getStorageValue(item.uid) == -1 then | ||
if playerCap >= itemWeight then | ||
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.') | ||
player:addItem(item.uid, 1) | ||
player:setStorageValue(item.uid, 1) | ||
else | ||
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.') | ||
end | ||
else | ||
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.") | ||
end | ||
return true | ||
end | ||
|
||
questSystemOld:id(2472, 2478, 2480, 2481, 2482, 4073, 4077, 5674, 5675, 7160, 7161) | ||
questSystemOld:register() |