finish nargor island quest

This commit is contained in:
ErikasKontenis
2019-12-13 16:58:01 +02:00
parent c908751ee7
commit 99b231124e
16 changed files with 153 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
local maps = {
[17528] = "You have successfully read plan A.",
[17529] = "You have successfully read plan B.",
[17530] = "You have successfully read plan C."
}
function onUse(player, item, fromPosition, target, toPosition)
local mapActionId = item:getActionId()
local map = maps[mapActionId]
if not map then
return false
end
local playerPosition = player:getPosition()
if player:getStorageValue(17520) < 8 then
player:say("You shouldn't touch these maps because someone might see you.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
return true
end
if player:getStorageValue(mapActionId) ~= 1 then
player:say(map, TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
player:setStorageValue(mapActionId, 1)
else
player:say("You have already read this map.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
end
return true
end

View File

@@ -0,0 +1,10 @@
function onUse(player, item, fromPosition, target, toPosition)
if player:getStorageValue(17526) < os.time() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a tortoise egg from Nargor.")
player:setStorageValue(17526, os.time() + 24 * 60 * 60) -- 24 hour
player:addItem(6125,1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You shoud not take any more today.")
end
return true
end

View File

@@ -1,4 +1,10 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(17520) == 5 and target.itemid == 5601 then
player:setStorageValue(17520, 6)
toPosition:sendMagicEffect(CONST_ME_FIREAREA)
return true
end
local random = math.random(10)
if random >= 4 then --success 6% chance
if target.itemid == 5465 then --Burn Sugar Cane