From 99b231124ea2bb5564c2842e033f163d0345695d Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Fri, 13 Dec 2019 16:58:01 +0200 Subject: [PATCH] finish nargor island quest --- data/actions/actions.xml | 6 ++- .../scripts/meriana_quest/pirate_map.lua | 28 ++++++++++++++ .../scripts/meriana_quest/tortoise_egg.lua | 10 +++++ data/actions/scripts/misc/fire_bug.lua | 6 +++ data/items/items.srv | 4 +- data/movements/scripts/misc/floorchange.lua | 2 +- data/npc/duncan.npc | 13 +++++++ data/npc/klaus.npc | 12 +++++- data/npc/ocelus.npc | 2 +- data/npc/raymondstriker.npc | 36 +++++++++++++++++- data/npc/sandra.npc | 7 ++++ data/npc/sebastianmeriana.npc | 1 + data/npc/vulturenose.npc | 4 +- data/world/map.otbm | Bin 79804071 -> 79804087 bytes src/behaviourdatabase.cpp | 28 ++++++++++++++ src/behaviourdatabase.h | 2 + 16 files changed, 153 insertions(+), 8 deletions(-) create mode 100644 data/actions/scripts/meriana_quest/pirate_map.lua create mode 100644 data/actions/scripts/meriana_quest/tortoise_egg.lua diff --git a/data/actions/actions.xml b/data/actions/actions.xml index 762710b..6fed2ba 100644 --- a/data/actions/actions.xml +++ b/data/actions/actions.xml @@ -84,7 +84,10 @@ - + + + + @@ -280,6 +283,7 @@ + diff --git a/data/actions/scripts/meriana_quest/pirate_map.lua b/data/actions/scripts/meriana_quest/pirate_map.lua new file mode 100644 index 0000000..58dfd2c --- /dev/null +++ b/data/actions/scripts/meriana_quest/pirate_map.lua @@ -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 diff --git a/data/actions/scripts/meriana_quest/tortoise_egg.lua b/data/actions/scripts/meriana_quest/tortoise_egg.lua new file mode 100644 index 0000000..b407e8a --- /dev/null +++ b/data/actions/scripts/meriana_quest/tortoise_egg.lua @@ -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 diff --git a/data/actions/scripts/misc/fire_bug.lua b/data/actions/scripts/misc/fire_bug.lua index b9708a4..dd57a02 100644 --- a/data/actions/scripts/misc/fire_bug.lua +++ b/data/actions/scripts/misc/fire_bug.lua @@ -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 diff --git a/data/items/items.srv b/data/items/items.srv index 47a803e..b55aa76 100644 --- a/data/items/items.srv +++ b/data/items/items.srv @@ -27805,9 +27805,9 @@ Attributes = {Weight=1100} TypeID = 6125 Name = "a tortoise egg from Nargor" -Description = "Handle with care and don't try to eat it" # TODO: Make it eatable and implement from quest details +Description = "Handle with care and don't try to eat it" Flags = {Take} -Attributes = {Weight=30} +Attributes = {Nutrition=8,Weight=30} TypeID = 6126 Name = "a peg leg" diff --git a/data/movements/scripts/misc/floorchange.lua b/data/movements/scripts/misc/floorchange.lua index d579515..8847fdc 100644 --- a/data/movements/scripts/misc/floorchange.lua +++ b/data/movements/scripts/misc/floorchange.lua @@ -74,7 +74,7 @@ local list = { [5258] = {x = 0, y = -1, z = -1}, [5259] = {x = -1, y = 0, z = -1}, [5544] = {x = 0, y = 0, z = 1}, - [5691] = {x = 0, y = 0, z = 1}, + [5691] = {x = 1, y = 0, z = 1}, [5731] = {x = 0, y = 0, z = 1}, [5763] = {x = 0, y = 0, z = 1}, } diff --git a/data/npc/duncan.npc b/data/npc/duncan.npc index 0e0f087..ff3efa3 100644 --- a/data/npc/duncan.npc +++ b/data/npc/duncan.npc @@ -35,5 +35,18 @@ Topic=2,"yes",Count(Type)>=Amount -> "Indeed, what a fine work... the book I mea Topic=2,"yes" -> "Sorry, you do not have it." Topic=2 -> "Maybe another time." +"mission",QuestValue(17525)=0,QuestValue(17520)>4 -> "You did some impressive things. I think people here start considering you as one of us. But these are dire times and everyone of us is expected to give his best and even exceed himself. Do you think you can handle that?", Topic=3 +Topic=3,"yes" -> "I am glad to hear this. Please listen. The pirates on Nargor are breeding tortoises. They think eating tortoises makes a hard man even harder. ...", + "However I am quite fond of tortoises and can't stand the thought of them being eaten. So I convinced Captain Striker that I can train them to help us. As a substitute for rafts and such ...", + "All I need is one tortoise egg from Nargor. This is the opportunity to save a tortoise from a gruesome fate! ...", + "I will ask Sebastian to bring you there. Travel to Nargor, find their tortoise eggs and bring me at least one of them.", SetQuestValue(17525,1) +Topic=3 -> "Maybe another time." + +"mission",QuestValue(17525)=1 -> Type=6125, Amount=1, "Did you rescue one of those poor soon-to-be baby tortoises from Nargor?", Topic=4 +"egg",QuestValue(17525)=1 -> * +Topic=4,"yes",Count(Type)>=Amount -> "A real tortoise egg ... I guess you are more accustomed to rescue some noblewoman in distress but you did something good today.", Delete(Type), SetQuestValue(17525,2) +Topic=4,"yes" -> "Sorry, you do not have it." +Topic=4 -> "Maybe another time." + "mission" -> "Sorry, I don't have any missions for you." } diff --git a/data/npc/klaus.npc b/data/npc/klaus.npc index 4b9b986..6cfd4cc 100644 --- a/data/npc/klaus.npc +++ b/data/npc/klaus.npc @@ -12,7 +12,7 @@ ADDRESS,! -> Idle BUSY,"hello$",! -> "Wait a moment, %N. I'll be here soon.", Queue BUSY,"hi$",! -> * BUSY,! -> NOP -VANISH,! -> "Arrr!" +VANISH,! -> "Whenever your throat is dry, you know where to find my tavern." "bye" -> "Whenever your throat is dry, you know where to find my tavern.", Idle "farewell" -> * @@ -51,4 +51,14 @@ Topic=5,"no" -> "Oh come on, don't be a child." Topic=4,"yes",CountMoney>=100,Amount=6 -> Price=100, Type=5792, Amount=1, "Ok, here we go ... 6! You have won a dice, congratulations. One more game?", DeleteMoney, Create(Type), EffectMe(27), Topic=5 Topic=4,"yes",CountMoney>=100 -> Price=100, "Ok, here we go ... %A! You have lost. Har Har Har. One more game?", DeleteMoney, EffectMe(27), Topic=5 Topic=4,"yes" -> "You don't have so much money." + +"mission",QuestValue(17520)=9,QuestValue(17531)=0 -> "Hmm, you look like a seasoned seadog. Kill Captain Ray Striker, bring me his lucky pillow as a proof and you are our hero!", SetQuestValue(17531,1) + +"mission",QuestValue(17531)=1 -> Type=6105, Amount=1, "Do you have Striker's pillow?", Topic=7 +"pillow",QuestValue(17531)=1 -> * +Topic=7,"yes",Count(Type)>=Amount -> "You DID it!!! Incredible! Boys, lets have a PAAAAAARTY!!!!", Delete(Type), SetQuestValue(17531,2) +Topic=7,"yes" -> "No you not!" +Topic=7 -> "Maybe another time." + +"mission" -> "Sorry, I don't have any missions for you." } diff --git a/data/npc/ocelus.npc b/data/npc/ocelus.npc index ab33199..aaa3131 100644 --- a/data/npc/ocelus.npc +++ b/data/npc/ocelus.npc @@ -27,7 +27,7 @@ VANISH,! -> "Farewell, human." "king" -> "Human kings come and go. Djinns are not such short-lived creatures and don't care much about humans." "thais" -> "The noisy human cities are of absolutely no interest for me." "raymond striker" -> "Now that Marina and me have arranged a date, I hope this human is forgotten soon." -"marina" -> "Marina and I have arranged a date already, I am so excited." +"marina",QuestValue(17502)>12 -> "Marina and I have arranged a date already, I am so excited." "pirates" -> "Many humans sail the seas, I can't tell them apart. You humans look all the same to me." "voodoo" -> "Some humans are tapping the energy of these isles with some strange results. Perhaps that explains the voodoo we've heard about." diff --git a/data/npc/raymondstriker.npc b/data/npc/raymondstriker.npc index 4ad6a95..54aea70 100644 --- a/data/npc/raymondstriker.npc +++ b/data/npc/raymondstriker.npc @@ -38,9 +38,43 @@ Topic=1,"mermaid" -> "The mermaid is the most beautiful creatu # Meriana_Quest "mission",QuestValue(17502)>12,QuestValue(17520)=0 -> "Ask around in the settlement where you can help out. If you have proven your worth I might have some missions for you.", SetQuestValue(17520,1) -"mission",QuestValue(17520)=1 -> "Ask around in the settlement where you can help out. If you have proven your worth I might have some missions for you." "mission",QuestValue(17520)=1,QuestValue(17521)=4,QuestValue(17522)=3,QuestValue(17523)=2,QuestValue(17524)=6 -> "Indeed, I could use some help. The evil pirates of Nargor have convinced an alchemist from Edron to supply them with a substance called Fafnar's Fire ...", "It can burn even on water and is a threat to us all. I need you to travel to Edron and pretend to the alchemist Sandra that you are the one whom the other pirates sent to get the fire ...", "When she asks for a payment, tell her 'Your continued existence is payment enough'. That should enrage any member of the Edron academy enough to refuse any further deals with the pirates.", SetQuestValue(17520,2) +"mission",QuestValue(17520)=1 -> "Ask around in the settlement where you can help out. If you have proven your worth I might have some missions for you." "mission",QuestValue(17520)=2 -> "I am still waiting news from you about Fafnar's Fire from alchemist Sandra." +"mission",QuestValue(17520)=3 -> "I think that means 'mission accomplished'. Hehe. I guess that will put an end to their efforts to buy any alchemical substance from Edron.", SetQuestValue(17520,4) +"mission",QuestValue(17520)=4 -> "The mission on which I will send you is vital to our cause. It is a sabotage mission. Nargor is guarded by several heavy catapults. ...", + "I need you to sabotage the most dangerous of those catapults which can be found right in their harbour, aiming at ships passing by the entrance. ...", + "Get a fire bug - you can buy them in Liberty Bay - and set this catapult on fire. ...", + "Make sure to use the bug on the left part of the catapult where its lever is. That is where it's most vulnerable. ...", + "If you see a short explosion, you will know that it worked. I will tell Sebastian to bring you to Nargor, but beware. ...", + "Of course, he can't drop you off directly in the pirate's base. However, we have discovered a secret way into the Howling Grotto. ...", + "Try to make your way through the caves of Nargor to reach their harbour. This is where you will find the catapult in question.", SetQuestValue(17520,5) +"mission",QuestValue(17520)=5 -> "Sail with Sebastian to Nargor and make your way to the pirate's harbour. Once arrived there, find the catapult and use a fire bug on the left part. ...", + "A small explosion will show you that you have succeeded. Afterwards, report to me about your mission. Good luck!" + +"mission",QuestValue(17520)=6 -> "You did it! Excellent!", SetQuestValue(17520,7) +"mission",QuestValue(17520)=7,QuestValue(17525)<2 -> "I have heard that Duncan has a mission for you this time." +"mission",QuestValue(17520)=7 -> "If you manage to accomplish this vital mission you will prove yourself to be a worthy member of our community. I might even grant you your own ship and pirate clothing! ...", + "So listen to the first step of my plan. I want you to infiltrate their base. Try to enter their tavern, which means that you have to get past the guard. ...", + "You will probably have to deceive him somehow, so that he thinks you are one of them. ...", + "In the tavern, the pirates feel safe and plan their next strikes. Study ALL of their maps and plans lying around ...", + "Afterwards, return here and report to me about your mission.", SetQuestValue(17520,8) + +"mission",QuestValue(17520)=8,QuestValue(17528)=1,QuestValue(17529)=1,QuestValue(17530)=1 -> "Well done, my friend. That will help us a lot. Of course there are other things to be done though. ...", + "I learned that Klaus, the owner of the tavern, wants me dead. He is offering any of those pirates a mission to kill me....", + "If we could convince him that you fulfilled that mission, the pirates will have the party of their lives. This would be our chance for a sneak attack to damage their boats and steal their plunder! ...", + "Obtain this mission from him and learn what he needs as a proof. Then return to me and report to me about your mission so we can formulate an appropriate plan.", SetQuestValue(17520,9) +"mission",QuestValue(17520)=8 -> "I am waiting for the information about the pirate plans my friend." + +"mission",QuestValue(17520)=9 -> "Still planning to go to Klaus right?" +"mission",QuestValue(17520)=9,QuestValue(17531)=1 -> Type=6105, Amount=1, "My pillow?? They know me all too well... I've owned it since my childhood. However. Here, take it and convince him that I am dead.", Create(Type), SetQuestValue(17520,10) +"mission",QuestValue(17520)=10 -> "Pillow is already yours. Just go to Klaus and convince him that I am dead." +"mission",QuestValue(17520)=10,QuestValue(17531)=2 -> Type=2994, Amount=1, "Incredible! You did what no other did even dare to think about! You are indeed a true hero to our cause ...", + "Sadly I have no ship that lacks a captain, else you would of course be our first choice. I am still true to my word as best as I am able. ...", + "So take this as your very own ship. Oh, and remind me about the pirate outfit sometime.", Create(Type), SetQuestValue(17520,11) +"mission" -> "Sorry, I don't have any missions for you." + +"outfit",QuestValue(17520)=11 -> "Ah, right! The pirate outfit! Here you go, now you are truly one of us.", AddOutfit(155), AddOutfit(151), SetQuestValue(17520,12) } diff --git a/data/npc/sandra.npc b/data/npc/sandra.npc index 90ead83..de113d9 100644 --- a/data/npc/sandra.npc +++ b/data/npc/sandra.npc @@ -59,4 +59,11 @@ Topic=2 -> "Hmm, but next time." Topic=3,"yes",Count(2874)>0 -> Amount=Count(2874), Price=Amount*5, "Here you are ... %P gold.", Delete(2874), CreateMoney Topic=3,"yes" -> "You don't have any empty vials." Topic=3 -> "Hmm, but please keep Tibia litter free." + +"mission",QuestValue(17520)=2 -> "Pssht, not that loud. So they have sent you to get... the stuff?", Topic=4 +"fafnar","fire",QuestValue(17520)=2 -> * +Topic=4,"yes" -> "Finally. You have no idea how difficult it is to keep something secret here. And you brought me all the crystal coins I demanded?", Topic=5 +Topic=4 -> "How do you even know about the stuff then..." +Topic=5,"Your","continued","existence","is","payment","enough" -> "What?? How dare you?! I am a sorcerer of the most reknown academy on the face of this world. Do you think some lousy pirates could scare me? Get lost! Now! I will have no further dealings with the likes of you!", SetQuestValue(17520,3) +Topic=5 -> "I see no deal with you then." } diff --git a/data/npc/sebastianmeriana.npc b/data/npc/sebastianmeriana.npc index cff33fb..944b765 100644 --- a/data/npc/sebastianmeriana.npc +++ b/data/npc/sebastianmeriana.npc @@ -23,6 +23,7 @@ VANISH,! -> "Hm." "meriana" -> "Yes. We are in Meriana." "liberty bay" -> Price=50, "Do you seek a passage to Liberty Bay for %P?", Topic=1 +"nargor",QuestValue(17520)<4 -> "Sorry, but you have to get permission from the Raymond Striker if you wan't to sail to Nargor." "nargor" -> Price=50, "Do you seek a passage to Nargor for %P?", Topic=2 Topic=1,"yes",PZBlock,! -> "First get rid of those blood stains! You are not going to ruin my vehicle!" diff --git a/data/npc/vulturenose.npc b/data/npc/vulturenose.npc index e4451fa..520fe5c 100644 --- a/data/npc/vulturenose.npc +++ b/data/npc/vulturenose.npc @@ -17,7 +17,6 @@ VANISH,! -> "Get lost." "bye" -> "Get lost.", Idle "farewell" -> * "what" -> "I guard this door. I won't let anyone pass who is not supposed to enter." -"enter" -> "YOU WILL NOT PASS! Erm ... I mean you don't look like a true pirate to me. You won't get in." "pirate" -> "Yoho, a pirate's life for me!" "name" -> "They call me Vulturenose." "rum" -> "You won't bribe old Vulturenose with some rum. No way." @@ -31,4 +30,7 @@ VANISH,! -> "Get lost." "thais" -> "Thais is a town full of wimps." "carlin" -> "A city full of women? That calls for plunder. Sadly, a bit far away. Ho Ho Ho." +"enter",QuestValue(17527)=1 -> "Hey, I rarely see a dashing pirate like you! Get in, matey!" +"enter",QuestValue(17527)=0,SlotItem(1)=6096,SlotItem(4)=6095,SlotItem(7)=5918,SlotItem(8)=5461 -> "Hey, I rarely see a dashing pirate like you! Get in, matey!", SetQuestValue(17527,1) +"enter",QuestValue(17527)=0 -> "YOU WILL NOT PASS! Erm ... I mean you don't look like a true pirate to me. You won't get in." } diff --git a/data/world/map.otbm b/data/world/map.otbm index bdb0d731ba229c46ea6f7d1029b0c083752f1a50..d17ebd3f48acd21b94882de99536766aa6237167 100644 GIT binary patch delta 3922 zcmXBNWv~_m6Ncg0-504tBi%?!NK4m2xbjJZK6u~a+PAu%= zWBq>YHP7rbv%B-gypktw&rBCrH&1vPzr)jdI#2HzJfkOhCeQ3yJgaB(?4HAO`kkK3 zb9)}o>-jvt7x02!$P0TBFY3j-xZmX^yrh@%(q6{P`rTg6%XM8nqJFmdmXRq^}N0}@P^*V8+)=h@%y}~H}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k#Yq8mElY#u?+R@w9QyIB#4ql8uYTCF8R3jPa~- z#dywm-gv=y(Rj(YYP@W`Vq7y`HC{7bH{LMbG~P1aHr_GbHQqDcH$E^vG(IvuHa;;v zH9j*wH@+~wG`=#vHm)1r7~dM-8Q&W}7(W^}jGv63jbDtL#;?XL;N>yFEqxJRZSbC4y- z8e|Ky2loXzf}BCFAa{@_$Q#@rp`dV3Bq$mb3yKFNf|5b0pmb0sC>uNw zlncrS6@rRErJ!<9C3rBX8dM9a2Q`A4L9L*6P$#Gx)C(R8>IV&ihC!pCanK}a8Z--< z2Q7k!gO)+7pmoqDcqC{Wv9UpkQz?Bp4bD3x)?Hf|0?fV017h7#oZW#s?FEiNT~`axf*B8cYkO2Qz}1!K`3* zFei8{m>YO7FPI-J2o?s5g2lm-fM98`ELa|_2v!EGg4MyAU~RB2SRXtdJP|w@YzQ_6 zn}W?jQm`f18ax$j3$_P4f}O#xV0W-5*ctype = BEHAVIOUR_TYPE_ADDOUTFITADDON; searchType = BEHAVIOUR_PARAMETER_TWO; + } else if (identifier == "addoutfit") { + action->type = BEHAVIOUR_TYPE_ADDOUTFIT; + searchType = BEHAVIOUR_PARAMETER_ONE; } else if (identifier == "poison") { action->type = BEHAVIOUR_TYPE_POISON; searchType = BEHAVIOUR_PARAMETER_TWO; @@ -544,6 +547,10 @@ NpcBehaviourNode* BehaviourDatabase::readValue(ScriptReader& script) node = new NpcBehaviourNode(); node->type = BEHAVIOUR_TYPE_RANDOM; searchType = BEHAVIOUR_PARAMETER_TWO; + } else if (identifier == "slotitem") { + node = new NpcBehaviourNode(); + node->type = BEHAVIOUR_TYPE_SLOTITEM; + searchType = BEHAVIOUR_PARAMETER_ONE; } if (searchType == BEHAVIOUR_PARAMETER_ONE) { @@ -942,6 +949,12 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl player->addOutfit(lookType, addon); break; } + case BEHAVIOUR_TYPE_ADDOUTFIT: { + int32_t lookType = evaluate(action->expression, player, message); + + player->addOutfit(lookType, 0); + break; + } case BEHAVIOUR_TYPE_TELEPORT: { Position pos; pos.x = evaluate(action->expression, player, message); @@ -1110,6 +1123,21 @@ int32_t BehaviourDatabase::evaluate(NpcBehaviourNode* node, Player* player, cons player->getStorageValue(questNumber, questValue); return questValue; } + case BEHAVIOUR_TYPE_SLOTITEM: { + int32_t slot = evaluate(node->left, player, message); + + Thing* thing = player->getThing(slot); + if (!thing) { + return 0; + } + + Item* item = thing->getItem(); + if (!item) { + return 0; + } + + return item->getID(); + } case BEHAVIOUR_TYPE_EXPIRINGQUESTVALUE: { int32_t questNumber = evaluate(node->left, player, message); int32_t questValue; diff --git a/src/behaviourdatabase.h b/src/behaviourdatabase.h index b429325..356615b 100644 --- a/src/behaviourdatabase.h +++ b/src/behaviourdatabase.h @@ -87,8 +87,10 @@ enum NpcBehaviourType_t BEHAVIOUR_TYPE_TOWN, // change player town BEHAVIOUR_TYPE_DRUNK, // get/set drunk (set not done) BEHAVIOUR_TYPE_ADDOUTFITADDON, // Add Outfit Addon + BEHAVIOUR_TYPE_ADDOUTFIT, // Add Outfit BEHAVIOUR_TYPE_DELETEAMOUNT, // deletes an item according specified amount BEHAVIOUR_TYPE_EXPIRINGQUESTVALUE, // get/set expiring quest value + BEHAVIOUR_TYPE_SLOTITEM, // get slot item }; enum NpcBehaviourOperator_t