From 9c4d3650f9cdb04fdfde06ed9b37824b002df195 Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Wed, 13 May 2020 11:56:52 +0300 Subject: [PATCH] introduce djinns and postman questpass --- data/actions/actions.xml | 3 +++ .../actions/scripts/misc/djinn_quest_pass.lua | 26 +++++++++++++++++++ .../scripts/misc/postman_quest_pass.lua | 22 ++++++++++++++++ data/items792/items.srv | 11 ++++---- 4 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 data/actions/scripts/misc/djinn_quest_pass.lua create mode 100644 data/actions/scripts/misc/postman_quest_pass.lua diff --git a/data/actions/actions.xml b/data/actions/actions.xml index 6441a13..c2ee247 100644 --- a/data/actions/actions.xml +++ b/data/actions/actions.xml @@ -193,6 +193,9 @@ + + + diff --git a/data/actions/scripts/misc/djinn_quest_pass.lua b/data/actions/scripts/misc/djinn_quest_pass.lua new file mode 100644 index 0000000..9d0e134 --- /dev/null +++ b/data/actions/scripts/misc/djinn_quest_pass.lua @@ -0,0 +1,26 @@ +local greenDjinnItem = 6549 +local blueDjinnItem = 6551 + +function onUse(player, item, fromPosition, target, toPosition) + if player:getStorageValue(278) > 1 then + player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already finished one of the djinn quest or your quest is in-progress.") + return true + end + + if item:getId() == greenDjinnItem then + player:setStorageValue(278, 3) + player:setStorageValue(286, 3) + player:setStorageValue(287, 3) + player:setStorageValue(288, 3) + elseif item:getId() == blueDjinnItem then + player:setStorageValue(278, 2) + player:setStorageValue(280, 2) + player:setStorageValue(281, 2) + player:setStorageValue(282, 2) + player:setStorageValue(283, 3) + end + + item:getPosition():sendMagicEffect(3) + item:remove() + return true +end diff --git a/data/actions/scripts/misc/postman_quest_pass.lua b/data/actions/scripts/misc/postman_quest_pass.lua new file mode 100644 index 0000000..4aca817 --- /dev/null +++ b/data/actions/scripts/misc/postman_quest_pass.lua @@ -0,0 +1,22 @@ +function onUse(player, item, fromPosition, target, toPosition) + if player:getStorageValue(250) == 5 then + player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already finished The Postman Missions.") + return true + end + + player:setStorageValue(227, 6) + player:setStorageValue(228, 3) + player:setStorageValue(229, 4) + player:setStorageValue(230, 21) + player:setStorageValue(231, 3) + player:setStorageValue(233, 11) + player:setStorageValue(234, 8) + player:setStorageValue(242, 2) + player:setStorageValue(244, 3) + player:setStorageValue(245, 3) + player:setStorageValue(250, 5) + + item:getPosition():sendMagicEffect(CONST_ME_SOUND_GREEN) + item:remove() + return true +end diff --git a/data/items792/items.srv b/data/items792/items.srv index e8bc4ba..398f8df 100644 --- a/data/items792/items.srv +++ b/data/items792/items.srv @@ -14683,8 +14683,8 @@ Flags = {Take} Attributes = {Weight=70} TypeID = 3252 -Name = "the horn of sundering" -Description = "(This items has 2 charges left)" +Name = "the horn of postman" +Description = "The magical horn will grant you the trustworthy postman rank" Flags = {Take} Attributes = {Weight=2300} @@ -29724,7 +29724,8 @@ Flags = {Cumulative,Take} Attributes = {Weight=750} TypeID = 6549 -Name = "a green powder" +Name = "a green djinn powder" +Description = "The magical powder will bless you with the power to convince the green djinns" Flags = {Cumulative,Take} Attributes = {Weight=750} @@ -29735,8 +29736,8 @@ Flags = {Cumulative,Take} Attributes = {Weight=100} TypeID = 6551 -Name = "a blue powder" -Description = "Sun can be a merciless killer, but so can you" +Name = "a blue djinn powder" +Description = "The magical powder will bless you with the power to convince the blue djinns" Flags = {Cumulative,Take} Attributes = {Weight=100}