diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-12-25 22:19:08 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-12-25 22:24:03 +0100 |
commit | 41dddedebc7db56787eca38dcad84f6d255aa0f3 (patch) | |
tree | b135cbfe412929689e5c5c5ae8ebfe6aa5a70aba | |
parent | 98c1e9a8636051680db317cad3d488cc76b52780 (diff) | |
download | serverdata-41dddedebc7db56787eca38dcad84f6d255aa0f3.tar.gz serverdata-41dddedebc7db56787eca38dcad84f6d255aa0f3.tar.bz2 serverdata-41dddedebc7db56787eca38dcad84f6d255aa0f3.tar.xz serverdata-41dddedebc7db56787eca38dcad84f6d255aa0f3.zip |
Enhanced Peters quest
Rewrote peters quest.
Added conditional warp for check whether quest is done.
Corrected some tweaks.
-rw-r--r-- | npc/000-2-1/peter.txt | 119 | ||||
-rw-r--r-- | npc/000-2-2/_import.txt | 2 | ||||
-rw-r--r-- | npc/000-2-2/area.txt | 14 | ||||
-rw-r--r-- | npc/000-2-2/doors.txt | 40 |
4 files changed, 82 insertions, 93 deletions
diff --git a/npc/000-2-1/peter.txt b/npc/000-2-1/peter.txt index 6a89fcde..645d5faf 100644 --- a/npc/000-2-1/peter.txt +++ b/npc/000-2-1/peter.txt @@ -7,50 +7,27 @@ // 4 bits array: // ShipQuests // Variable: -// 1 +// ShipQuests_Peter // Values: -// 0+0+0 default -// 0+1+0 completed bonus task -// 0+2+0 got bonus task -// 0+3+0 got non-bonus task -// 1+3+0 got non-bonus task and bonus task was completed -// 0+2+3 was warped with bonus task -// 0+3+3 was warped with non-bonus task -// 1+3+3 was warped with non-bonus task and bonus task was completed +// 0 default +// 1 task given +// 2 task given + reward expected +// 3 task completed +// 4 task completed + reward to be given +// 5 task done + reward given // "000-2-2.gat" - map with mobs 000-2-1.gat,61,34,0,1 script AreaNPC 0,0,1,{ OnTouch: - //Stop when level less than 5 - if (BaseLevel < 5) goto l_Stop; - - set @q, geta4(ShipQuests, 1); - //If player got task, but wasn't warped - if (@q > 1 && @q < 5) goto l_Warp; - //If player was warped - if (@q > 4) goto l_Check; - //If map is full of mobs and helper is free - if (getmapmobs("000-2-2.gat") == 2 && $@RAT_SAILOR_HELPER$ == "") goto l_GiveTask; - //Otherway - doevent "Peter::OnDontNeedHelp"; + set @q, geta4(ShipQuests, ShipQuests_Peter); + // Only let play pass that finished Peters quest + if (@q < 5) goto l_Stop; + warp "000-2-1",61,36; close; l_Stop: doevent "Peter::OnStop"; close; - - l_Warp: - seta4 ShipQuests, 1, @q+3; - warp "000-2-2.gat", 48, 28; - close; - - l_Check: - doevent "Peter::OnCheck"; - close; - - l_GiveTask: - doevent "Peter::OnGiveTask"; - } 000-2-1.gat,60,35,0,1 script Peter 303,{ @@ -66,14 +43,14 @@ set @q, geta4(ShipQuests, ShipQuests_Peter); - //If player wasn't warped and player is helper - if (@q < 5 && $@RAT_SAILOR_HELPER$ == strcharinfo(0)) goto l_TaskWasGiven; - - //If player got task and helper is other or player was warped - if (@q > 1) goto l_Fail; + // If player is here but has not finished the quest he aborted it since he + // cannot come here before he finished the quest while not aborting the quest + if (@q == 1 || @q == 2) goto l_QuestAborted; + if (@q == 3 || @q == 4) goto l_QuestDone; + if (@q == 5) goto l_Thanks; //If map is full of mobs and helper is free - if (getmapmobs("000-2-2.gat") == 2 && $@RAT_SAILOR_HELPER$ == "") goto OnGiveTask; + if (getmapmobs("000-2-2.gat") == 4 && $@RAT_SAILOR_HELPER$ == "") goto OnGiveTask; goto OnDontNeedHelp; close; @@ -92,9 +69,8 @@ OnGiveTask: mesn; mesq l("I need somebody who can clean the bottom of the ship of these Ratto, can you help me?"); - set @q, geta4(ShipQuests, ShipQuests_Peter); menu - rif(@q == 0, l("Yeah, but what reward will I get?")), l_BonusTask, + l("Yeah, but what reward will I get?"), l_BonusTask, l("Why not, I need to train anyway."), l_Task, l("No, they are way too dangerous for me!"), -; mesq l("Ok, ok. Come back if you change your mind."); @@ -126,17 +102,11 @@ next; set @q, geta4(ShipQuests, ShipQuests_Peter); - if (getmapmobs("000-2-2.gat") || $@RAT_SAILOR_HELPER$ != strcharinfo(0)) goto l_Fail; + if (getmapmobs("000-2-2.gat") || $@RAT_SAILOR_HELPER$ != strcharinfo(0)) goto l_QuestAborted; set $@RAT_SAILOR_HELPER$, ""; - if (@q == 5) goto l_Reward; - - set @q, @q - 4; - if (@q > 1) set @q, @q - 2; - seta4 ShipQuests, ShipQuests_Peter, @q; - mesn; - mesq l("Good job!"); - close; + if (@q == 2 || @q == 4) goto l_Reward; + goto l_Thanks; l_TalkToJulia: mesn; @@ -144,7 +114,6 @@ close; l_BonusTask: - set @q, geta4(ShipQuests, 1); mesn; mesq l("I will give you @@gp.", 500); menu @@ -156,9 +125,23 @@ l_Task: if ($@RAT_SAILOR_HELPER != "") goto OnDontNeedHelp; - seta4 ShipQuests, ShipQuests_Peter, geta4(ShipQuests, ShipQuests_Peter) + 3; + seta4 ShipQuests, ShipQuests_Peter, 1; goto l_Start; + l_QuestDone: + stopnpctimer; + seta4 ShipQuests, ShipQuests_Peter, 5; + if (@q == 4) goto l_Reward; + goto l_Thanks; + + l_QuestAborted: + stopnpctimer; + seta4 ShipQuests, ShipQuests_Peter, 0; + set $@RAT_SAILOR_HELPER$, ""; + mesn; + mesq l("Too bad that you do not want to help me."); + close; + l_Start: mesn; mesq l("Okay, you can start!"); @@ -167,42 +150,22 @@ warp "000-2-2.gat", 48, 28; close; - l_TaskWasGiven: - mesn; - mesq l("You can start now."); - close; - - l_SetCollectDelay: - set $@RAT_SAILOR_COLLECT_DELAY, 1; - close; - - l_Fail: - mesn; - mesq g(l("You failed the task!#0"), l("You failed the task!#1")); - set $@RAT_SAILOR_HELPER$, ""; - set @q, geta4(ShipQuests, ShipQuests_Peter); - if (@q == 5 || @q == 2) goto l_FailBonusTask; - if (@q > 5) set @q, @q - 6; - if (@q > 2) set @q, @q - 3; - seta4 ShipQuests, ShipQuests_Peter, @q; - close; - l_KillHelper: set $@RAT_SAILOR_HELPER$, ""; close; - l_FailBonusTask: - seta4 ShipQuests, ShipQuests_Peter, 0; - close; - l_Reward: - seta4 ShipQuests, 1, 1; mesn; mesq l("Good job!") + " " + l("Here is your reward!"); getexp 100, 0; set zeny, zeny + 500; close; + l_Thanks: + mesn; + mesq l("Thanks for helping me!"); + close; + l_Close: close; diff --git a/npc/000-2-2/_import.txt b/npc/000-2-2/_import.txt index 653897f6..cf2e566a 100644 --- a/npc/000-2-2/_import.txt +++ b/npc/000-2-2/_import.txt @@ -1,4 +1,4 @@ map: 000-2-2.gat npc: npc/000-2-2/_mobs.txt npc: npc/000-2-2/_warps.txt -npc: npc/000-2-2/area.txt +npc: npc/000-2-2/doors.txt diff --git a/npc/000-2-2/area.txt b/npc/000-2-2/area.txt deleted file mode 100644 index afc2e9f3..00000000 --- a/npc/000-2-2/area.txt +++ /dev/null @@ -1,14 +0,0 @@ -// Evol scripts. -// Authors: -// Reid -// Description: -// Rat killer NPC - -000-2-2.gat,24,31,0,1 script AreaNPC 0,0,1,{ - -OnTouch: - - mesq l("This door seems locked"); - close; - -}
\ No newline at end of file diff --git a/npc/000-2-2/doors.txt b/npc/000-2-2/doors.txt new file mode 100644 index 00000000..912b3096 --- /dev/null +++ b/npc/000-2-2/doors.txt @@ -0,0 +1,40 @@ +// Evol scripts. +// Authors: +// Reid +// Description: +// Rat killer NPC + +000-2-2.gat,48,29,0,1 script DoorUpwards 0,0,0,{ + +OnTouch: + set @q, geta4(ShipQuests, ShipQuests_Peter); + if (@q == 1 || @q == 2) goto l_Check; + goto l_Warp; + +l_Check: + if (getmapmobs("000-2-2.gat") > 0) goto l_Warn; + seta4 ShipQuests, ShipQuests_Peter, @q+2; + goto l_Warp; + +l_Warn: + mesn; + mesq l("There are still some rats left! Do you want to abort the quest?"); + menu + l("Yes."), l_Warp, + l("No."), -; + warp "000-2-2", 48, 28; + close; + +l_Warp: + warp "000-2-1", 61, 35; + close; +} + +000-2-2.gat,24,31,0,1 script AreaNPC 0,0,1,{ + +OnTouch: + + mesq l("This door seems locked"); + close; + +} |