summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-12-31 18:34:24 -0200
committerJesusaves <cpntb1@ymail.com>2018-12-31 18:34:24 -0200
commitcc6e06d3e75205ad56f6894694a4de06c49d15e4 (patch)
treebb563824ed0de89a1f595ed42f8bd2a0aa4772dd
parent9991fb5dcbeec733bbe06718b9dc1e8f919cd4d2 (diff)
downloadserverdata-cc6e06d3e75205ad56f6894694a4de06c49d15e4.tar.gz
serverdata-cc6e06d3e75205ad56f6894694a4de06c49d15e4.tar.bz2
serverdata-cc6e06d3e75205ad56f6894694a4de06c49d15e4.tar.xz
serverdata-cc6e06d3e75205ad56f6894694a4de06c49d15e4.zip
Rewrite entirely, Peter Script (along the quest)
-rw-r--r--npc/001-8/hub.txt5
-rw-r--r--npc/002-1/peter.txt376
-rw-r--r--npc/002-2/doors.txt2
-rw-r--r--npc/002-2/ratto.txt82
-rw-r--r--npc/002-3/elmo.txt2
-rw-r--r--npc/003-3/malindou.txt42
-rw-r--r--npc/functions/util.txt2
7 files changed, 207 insertions, 304 deletions
diff --git a/npc/001-8/hub.txt b/npc/001-8/hub.txt
index 145723e1c..4cd016ed7 100644
--- a/npc/001-8/hub.txt
+++ b/npc/001-8/hub.txt
@@ -406,6 +406,11 @@ OnPCLogoutEvent:
setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_MOVE, false);
setq HurnscaldQuest_BloodDonor, 0, gettimetick(2)+3600; // one hour penalty
}
+ // Logout/Death on Nard's ship hold
+ if (.@mapa$ ~= "002-2") {
+ setq2 ShipQuests_Peter, 0;
+ setq3 ShipQuests_Peter, -1;
+ }
@qhub_victor=0;
@qhub_died=0;
diff --git a/npc/002-1/peter.txt b/npc/002-1/peter.txt
index c129b7388..22c6cc797 100644
--- a/npc/002-1/peter.txt
+++ b/npc/002-1/peter.txt
@@ -1,12 +1,7 @@
-// TMW2 script need total rewrite.
-// Evol scripts.
-// Authors:
-// 4144
-// Ablu
-// Alastrim
-// Qwerty Dragon
-// Reid
-// Vasily_Makarov
+// TMW2 script
+// Author:
+// Jesusalva
+// Original evol script authors: 4144, Ablu, Alastrim, Qwerty Dragon, Reid, Vasily_Makarov
// Description:
// Rat hunter.
// 4+2 bits array:
@@ -15,113 +10,74 @@
// ShipQuests_Peter
// Values:
// 0 Doesn't know the quest.
-// 1 Task given.
-// 2 Task given and reward expected.
-// 3 Task completed without reward.
-// 4 Asked for reward after completion of the task.
-// 5 Task done and reward given.
-// 6 Did not start the quest.
+// & 1 Task given.
+// & 2 Task completed (easy level).
+// & 4 Task completed (medium level).
+// & 8 Task completed (hard level).
+// Setq2:
+// Number of killed Rattos:
+// & 1 - Ratto 1
+// & 2 - Ratto 2
+// & 4 - Ratto 3
+// & 8 - Ratto 4
+// = 15: All rattos killed
+// Setq3:
+// Instance ID (so we can destroy it later)
+//
// Others:
-// .@peter = Peter variable.
-// "002-2" - map with mobs.
-// "$@RAT_SAILOR_HELPER$" - Name of the participant.
-// "$@RAT_SAILOR_DEATHS - Number of deaths when the participant starts the fight.
-// "$@RAT_SAILOR_CONTROL" - Explanation of each index of the array.
-// "$@RAT_SAILOR_OLD_HELPER$" - Name of the participant.
-// "$@RAT_SAILOR_COUNTDOWN" - Seconds since the epoch of when the player done the quest.
-// [1] = Shows status of ratto number 1 (1 is dead and 0 is alive).
-// [2] = Shows status of ratto number 2 (1 is dead and 0 is alive).
-// [3] = Shows status of ratto number 3 (1 is dead and 0 is alive).
-// [4] = Shows status of ratto number 4 (1 is dead and 0 is alive).
-// [5] = Shows how many seconds passed since ratto number 1 died.
-// [6] = Shows how many seconds passed since ratto number 2 died.
-// [7] = Shows how many seconds passed since ratto number 3 died.
-// [8] = Shows how many seconds passed since ratto number 4 died.
-// [9] = Shows how many seconds passed since the player started the quest.
-// [10] = Shows how many seconds passed since the player done the quest.
-// Translation
-// FR Translated
-002-1,35,24,0 script AreaNPC NPC_HIDDEN,0,1,{
+// .@q = Peter variable.
+
+002-1,35,24,0 script AreaNPC#Peter NPC_HIDDEN,0,1,{
OnTouch:
+ .@q = getq(ShipQuests_Peter);
+ .@q2 = getq2(ShipQuests_Peter);
+ .@q3 = getq3(ShipQuests_Peter);
if (BaseLevel < 8) goto L_Stop;
- if ($@RAT_SAILOR_COUNTDOWN == 0) goto L_NoCountDown;
- if ((gettimetick(2) - $@RAT_SAILOR_COUNTDOWN) < 10) goto L_NoGoodTick;
- if (($@RAT_SAILOR_OLD_HELPER$ == strcharinfo(0)) && ((gettimetick(2) - $@RAT_SAILOR_COUNTDOWN) < 60)) goto L_NoGoodTick;
- $@RAT_SAILOR_COUNTDOWN = 0;
-
-L_NoCountDown:
- if ($@RAT_SAILOR_HELPER$ != "") goto L_Occupied;
- .@peter = getq(ShipQuests_Peter);
- if (.@peter < 1 || .@peter > 5) goto L_Task;
- if (.@peter == 1 || .@peter == 2) goto L_Rfail;
- if (.@peter == 3 || .@peter == 4) goto L_Rwin;
- if (.@peter > 5) goto L_SecondTime;
- doevent "Peter::OnReturnWin";
+
+ if (.@q && isinstance(.@q3)) goto L_Rfail;
+ doevent "Peter::OnGiveTask";
close;
L_Stop:
doevent "Peter::OnStop";
-
- close;
-
-L_Occupied:
- doevent "Peter::OnDontneedHelp";
-
- close;
-
-L_Task:
- doevent "Peter::OnGiveTask";
-
close;
L_Rfail:
doevent "Peter::OnReturnFail";
-
- close;
-
-L_Rwin:
- doevent "Peter::OnReturnWin";
-
- close;
-
-L_NoGoodTick:
- doevent "Peter::OnNoGoodTick";
-
close;
}
002-1,33,25,0 script Peter NPC_RATTO_SAILOR,{
+ .@q = getq(ShipQuests_Peter);
+ .@q2 = getq2(ShipQuests_Peter);
+ .@q3 = getq3(ShipQuests_Peter);
if (BaseLevel < 8) goto OnTooWeak;
- if ($@RAT_SAILOR_COUNTDOWN == 0) goto L_NoCountDown;
- if ((gettimetick(2) - $@RAT_SAILOR_COUNTDOWN) < 10) goto OnNoGoodTick;
- if (($@RAT_SAILOR_OLD_HELPER$ == strcharinfo(0)) && ((gettimetick(2) - $@RAT_SAILOR_COUNTDOWN) < 60)) goto OnNoGoodTick;
- $@RAT_SAILOR_COUNTDOWN = 0;
-L_NoCountDown:
- .@peter = getq(ShipQuests_Peter);
- if (.@peter == 1 || .@peter == 2) goto OnReturnFail;
- if (.@peter == 3 || .@peter == 4 || .@peter == 5) goto OnReturnWin;
+ if (!.@q || !isinstance(.@q3)) goto L_Task;
+ if (.@q2 < 4) goto L_ReturnFail;
+ dispbottom l("I am broken?! Please report! Debug data: @@ (@@)", .@q, .@q2);
+ close;
OnGiveTask:
- setq ShipQuests_Peter, 6;
- .@peter = getq(ShipQuests_Peter);
+L_Task:
+ if (!.@q)
+ setq ShipQuests_Peter, 1, 0, -1;
mesn;
mesq lg("Hey, girl!", "Hey, man!");
next;
- mesq l("I need somebody who can rid the hold of the ship of these rattos. Can you help me?");
+ mesq l("I need somebody who can rid the hold of the ship of these creatures. Can you help me?");
next;
menu
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!"), -;
mes "";
mesn;
mesq l("Hehe, hehe. Well, come back if you change your mind.");
- goto L_Quit;
+ close;
OnLowTime:
if (getmap() == "002-2")
@@ -131,8 +87,7 @@ OnLowTime:
OnTooWeak:
mesn;
mesq lg("I need someone to help me clean the edge of the ship, but you aren't strong enough for now.");
-
- goto L_Quit;
+ close;
OnStop:
slide 35, 26;
@@ -143,74 +98,62 @@ OnStop:
close;
OnReturnFail:
+L_ReturnFail:
+ instance_destroy(.@q3);
mesn;
- mesq l("I see it's not so easy to get rid of these rattos. Do you want to try again?");
+ mesq l("I see it's not so easy to get rid of the monsters. Do you want to try again?");
next;
menu
l("Yeah, but I would like to make sure I get a reward."), L_BonusTask,
- l("Why not, I need to train anyway."), L_Task,
l("No, they are way too dangerous for me!"), -;
mes "";
mesn;
mesq l("Hehe, hehe. Well, come back if you change your mind.");
- goto L_Quit;
-
-OnReturnWin:
- .@peter = getq(ShipQuests_Peter);
- mesn;
- mesq l("Thanks again for helping me. Drats these rattos for infesting our fair vessal!");
- next;
- mesq l("They are a permanent problem so I will always need your help to exterminate them in order to keep their number under control.");
- next;
- mesq l("Your help is very welcome indeed. Unfortunately, I can give you a reward for the first extermination only.");
- next;
-
- if (.@peter == 3 || .@peter == 4)
- menu
- l("Did you say reward? I want it!"), L_BonusTask,
- l("I am not worried about rewards. I just want to help."), L_Task,
- l("Sorry, I am not in the mood for another fight with these rattos."), -;
-
- if (.@peter == 5)
- menu
- l("No problem, I can help you anyway."), L_Task,
- l("Sorry, I am not in the mood for another fight with these rattos."), -;
-
- mes "";
- mesn;
- mesq l("Hehe, hehe. Well, come back if you change your mind.");
-
close;
L_BonusTask:
mes "";
mesn;
- mesq l("What if I give you 850 GP for that job, is it ok?");
+ mesq l("There are three kind of monsters which frequently attacks our fair vessel.");
+ next;
+ mesn;
+ .@q = getq(ShipQuests_Peter);
+ if (!(.@q & 2)) {
+ mes l("- I currently need your help with @@.", getmonsterlink(Piousse)); // 400 HP, 80 DMG, 1872 dps, 150 ms, ASS
+ mes l("I'll give you @@ GP for this job.", 350);
+ }
+ if (!(.@q & 4)) {
+ mes l("- I currently need your help with @@.", getmonsterlink(Ratto)); // 500 HP, 80 DMG, 1572 dps, 120 ms
+ mes l("I'll give you @@ GP for this job.", 550);
+ }
+ if (!(.@q & 8)) {
+ mes l("- I currently need your help with @@.", getmonsterlink(Croc)); // 1900 HP, 145 DMG, 1872 dps, 600 ms
+ mes l("I'll give you @@ GP for this job.", 1000);
+ }
+ if (.@q == 15) {
+ mes l("- I currently need your help with @@, but there's no reward.", getmonsterlink(Ratto));
+ }
next;
- menu
- lg("Okay, I'm ready to work!"), -,
- l("What? This reward is too small!"), L_Quit;
-
- .@peter = getq(ShipQuests_Peter);
- if ($@RAT_SAILOR_HELPER$ != "") goto OnDontneedHelp;
- if (.@peter == 6) setq ShipQuests_Peter, 2;
- if (.@peter == 3) setq ShipQuests_Peter, 4;
- .@peter = getq(ShipQuests_Peter);
+ select
+ l("I'm not feeling like it today... Sorry."),
+ rif(!(.@q & 2), l("I will take the @@ Bounty.", "Piousse")),
+ rif(!(.@q & 4), l("I will take the @@ Bounty.", "Ratto")),
+ rif(!(.@q & 8), l("I will take the @@ Bounty.", "Croc")),
+ rif(.@q == 15, l("Why not, I need to train anyway."));
+
+ if (@menu == 1)
+ close;
+
goto L_Start;
-L_Task:
- .@peter = getq(ShipQuests_Peter);
- if ($@RAT_SAILOR_HELPER$ != "") goto OnDontneedHelp;
- if (.@peter == 6) setq ShipQuests_Peter, 1;
- .@peter = getq(ShipQuests_Peter);
L_Start:
mes "";
- mesc l("Rattos are pretty strong. Do you need an explanation about hit'n'run?");
+ mesc l("Some of them are pretty strong. Do you need an explanation about hit'n'run and the monster you're about to face?");
if (askyesno() == ASK_YES) {
mes "";
mesc l(".:: Hit'n'Run Tactic ::.");
@@ -219,136 +162,83 @@ L_Start:
mesc l("The strategy is simple. When you hit the enemy, walk one or two tiles backwards.");
mesc l("If you miss, walk two or three tiles backwards. This way, you avoid being hit.");
next;
+ if (@menu == 2)
+ mesc l("Piousse are not healthy, but they aid one each other. Take utmost care.");
+ else if (@menu == 4)
+ mesc l("Crocs are dangerous and very healthy, but very slow. Use that on your advantage.");
+ else
+ mesc l("Rattos are very fast. They walk fast and attack fast. I advise bringing some healing items!");
+ next;
}
mes "";
mesn;
mesq l("Okay, you can start!");
+// Init Instance
OnStartOutside:
- if ($@RAT_SAILOR_HELPER$ != "") goto OnDontneedHelp;
- $@RAT_SAILOR_HELPER$ = strcharinfo(0);
- $@RAT_SAILOR_DEATHS = PC_DIE_COUNTER;
- initnpctimer;
- warp "002-2", 33, 24;
- addtimer(100000, "Peter::OnLowTime");
- doevent "RattosControl::OnSpawn";
-
- goto L_Quit;
-
-OnTimer2000:
- if (attachrid(getcharid(3, $@RAT_SAILOR_HELPER$)) == 0) goto L_Logoff;
- $@RAT_SAILOR_CONTROL[9] = $@RAT_SAILOR_CONTROL[9] + 2;
- if ($@RAT_SAILOR_CONTROL[9] > 120) goto L_Timeout;
- if (PC_DIE_COUNTER > $@RAT_SAILOR_DEATHS) goto L_Dead;
- if ($@RAT_SAILOR_CONTROL[1] && $@RAT_SAILOR_CONTROL[2] && $@RAT_SAILOR_CONTROL[3] && $@RAT_SAILOR_CONTROL[4]) goto L_Done;
- if (getmapusers("002-2") == 0) goto L_CleaningEnd;
- goto L_CheckRattos;
-
- end;
-
-L_CheckRattos:
- if ($@RAT_SAILOR_CONTROL[1]) $@RAT_SAILOR_CONTROL[5] = $@RAT_SAILOR_CONTROL[5] + 2;
- if ($@RAT_SAILOR_CONTROL[2]) $@RAT_SAILOR_CONTROL[6] = $@RAT_SAILOR_CONTROL[6] + 2;
- if ($@RAT_SAILOR_CONTROL[3]) $@RAT_SAILOR_CONTROL[7] = $@RAT_SAILOR_CONTROL[7] + 2;
- if ($@RAT_SAILOR_CONTROL[4]) $@RAT_SAILOR_CONTROL[8] = $@RAT_SAILOR_CONTROL[8] + 2;
- if ($@RAT_SAILOR_CONTROL[5] > 45) doevent "RattosControl::OnRatto1Respawn";
- if ($@RAT_SAILOR_CONTROL[6] > 45) doevent "RattosControl::OnRatto2Respawn";
- if ($@RAT_SAILOR_CONTROL[7] > 45) doevent "RattosControl::OnRatto3Respawn";
- if ($@RAT_SAILOR_CONTROL[8] > 45) doevent "RattosControl::OnRatto4Respawn";
-
-L_NotYet:
- setnpctimer 0;
+ .@ID=getcharid(0);
+ @MAP_NAME$="nard@"+str(.@ID); // Max 4 chars for map name
+ .@INSTID = instance_create("002-2@a"+(.@ID), getcharid(3), IOT_CHAR);
+ .@instanceMapName$ = instance_attachmap("002-2", .@INSTID, 0, @MAP_NAME$);
+ setq2 ShipQuests_Peter, 0;
+ setq3 ShipQuests_Peter, .@INSTID;
+
+ // It'll be self-destroyed when time runs out (2 minutes)
+ instance_set_timeout(120, 120, .@INSTID);
+ instance_init(.@INSTID);
+
+ // Save in a less reliable way the challenge you took
+ if (@menu == 2) {
+ @peter=2;
+ @pt_mob=Piousse;
+ } else if (@menu == 3) {
+ @peter=4;
+ @pt_mob=Ratto;
+ } else if (@menu == 4) {
+ @peter=8;
+ @pt_mob=Croc;
+ } else {
+ @peter=0;
+ @pt_mob=Ratto;
+ }
- end;
+ warp @MAP_NAME$, 33, 24;
+ addtimer(100000, "Peter::OnLowTime");
+ addtimer(120000, "Peter::OnTimeout");
-OnDontneedHelp:
- mesn;
- mesq l("I don't need your help right now, come back later.");
- next;
- mesq l("@@ is helping me.", $@RAT_SAILOR_HELPER$);
+ // Spawn the Monsters
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto1Death";
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto2Death";
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto3Death";
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto4Death";
- goto L_Quit;
+ close;
-L_Timeout:
+OnTimeout:
+ .@q3 = getq3(ShipQuests_Peter);
+ instance_destroy(.@q3);
mesn;
mesq l("Hey! Be careful. You can't stay in this basement for so long, you're going to get sick. Come outside and take a break, maybe you can try again later.");
- warp "002-1", 35, 26;
-
- goto L_CleaningClose;
-
-L_Logoff:
- goto L_CleaningEnd;
-
-L_Dead:
-// Warps the dead body outside, so it does not interfere with the getmapusers check.
- if (getmapusers("002-2") > 0) warp "002-1", 35, 26;
-
- goto L_CleaningEnd;
-
-L_Done:
- $@RAT_SAILOR_CONTROL[10] = $@RAT_SAILOR_CONTROL[10] + 2;
- if($@RAT_SAILOR_CONTROL[10] < 5) goto L_NotYet;
- .@peter = getq(ShipQuests_Peter);
- if (.@peter == 2 || .@peter == 4) goto L_Reward;
- warp "002-1", 35, 26;
-
- goto L_Thanks;
-
-L_CleaningEnd:
- stopnpctimer;
- $@RAT_SAILOR_HELPER$ = "";
- $@RAT_SAILOR_DEATHS = 0;
- cleararray $@RAT_SAILOR_CONTROL, 0, 11;
- killmonster "002-2", "RattosControl::OnRatto1Death";
- killmonster "002-2", "RattosControl::OnRatto2Death";
- killmonster "002-2", "RattosControl::OnRatto3Death";
- killmonster "002-2", "RattosControl::OnRatto4Death";
-
- end;
-
-L_CleaningClose:
- stopnpctimer;
- $@RAT_SAILOR_OLD_HELPER$ = $@RAT_SAILOR_HELPER$;
- $@RAT_SAILOR_HELPER$ = "";
- $@RAT_SAILOR_DEATHS = 0;
- cleararray $@RAT_SAILOR_CONTROL, 0, 11;
- killmonster "002-2", "RattosControl::OnRatto1Death";
- killmonster "002-2", "RattosControl::OnRatto2Death";
- killmonster "002-2", "RattosControl::OnRatto3Death";
- killmonster "002-2", "RattosControl::OnRatto4Death";
- $@RAT_SAILOR_COUNTDOWN = gettimetick(2);
-
+ warp "002-1@"+LOCATION$, 35, 26;
close;
-L_Reward:
- warp "002-1", 35, 26;
- setq ShipQuests_Peter, 5;
- .@peter = getq(ShipQuests_Peter);
- mesn;
- mesq l("Good job!") + " " + l("Here's your reward!");
- getexp 105, 0;
- Zeny = Zeny + 850;
- message strcharinfo(0), l("You receive @@ GP!", 850);
-
- goto L_CleaningClose;
+OnDone:
+ if (@peter)
+ setq ShipQuests_Peter, getq(ShipQuests_Peter)|@peter, 0, -1;
-L_Thanks:
+ warp "002-1@"+LOCATION$, 35, 26;
+ .@q = getq(ShipQuests_Peter);
mesn;
- mesq l("Thanks for helping me!");
- .@peter = getq(ShipQuests_Peter);
- if (.@peter == 1) setq ShipQuests_Peter, 3;
- .@peter = getq(ShipQuests_Peter);
-
- goto L_CleaningClose;
-
-L_Quit:
- .@peter = 0;
-
- close;
+ mesq l("Good job!") + " " + l("Here's your reward!");
+ getexp @peter*52, @peter;
+ switch (@peter) {
+ case 2: @peter=350; break;
+ case 4: @peter=550; break;
+ case 8: @peter=1000; break;
+ }
-OnNoGoodTick:
- mesn;
- mesq l("I don't need your help right now, come back later.");
+ Zeny = Zeny + @peter;
+ message strcharinfo(0), l("You receive @@ GP!", @peter);
close;
OnInit:
diff --git a/npc/002-2/doors.txt b/npc/002-2/doors.txt
index 51bfc1e89..7e1dcb7a1 100644
--- a/npc/002-2/doors.txt
+++ b/npc/002-2/doors.txt
@@ -17,7 +17,7 @@ OnTouch:
L_Warn:
.@q = getq(ShipQuests_Peter);
- if (.@q == 5) goto L_Warp;
+ if (.@q >= 4) goto L_Warp;
mesn "Narrator";
mesc l("There are still some rattos left! Do you want to abort the quest?");
diff --git a/npc/002-2/ratto.txt b/npc/002-2/ratto.txt
index 5a5933ef3..92dd857ef 100644
--- a/npc/002-2/ratto.txt
+++ b/npc/002-2/ratto.txt
@@ -1,69 +1,71 @@
-// TMW2 Script; midly modified by Jesusalva.
-// Evol scripts.
-// Authors:
-// Ablu
-// Alastrim
-// Reid
+// TMW2 Script.
+// Author:
+// Jesusalva
+// Originally an Evol script authored by: Ablu, Alastrim, Reid
// Description:
// Ratto killer.
-// $@RAT_SAILOR_CONTROL array explanation:
-// [1] = Shows status of ratto number 1 (1 is dead and 0 is alive).
-// [2] = Shows status of ratto number 2 (1 is dead and 0 is alive).
-// [3] = Shows status of ratto number 3 (1 is dead and 0 is alive).
-// [4] = Shows status of ratto number 4 (1 is dead and 0 is alive).
-// [5] = Shows how many seconds passed since ratto number 1 died.
-// [6] = Shows how many seconds passed since ratto number 2 died.
-// [7] = Shows how many seconds passed since ratto number 3 died.
-// [8] = Shows how many seconds passed since ratto number 4 died.
-// [9] = Shows how many seconds passed since the player started the quest.
-
002-2,0,0,0 script RattosControl NPC_HIDDEN,{
-
-OnSpawn:
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto1Death";
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto2Death";
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto3Death";
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto4Death";
- close;
+ end;
OnRatto1Respawn:
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto1Death";
- $@RAT_SAILOR_CONTROL[1] = 0;
- $@RAT_SAILOR_CONTROL[5] = 0;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2^1;
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto1Death";
end;
OnRatto2Respawn:
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto2Death";
- $@RAT_SAILOR_CONTROL[2] = 0;
- $@RAT_SAILOR_CONTROL[6] = 0;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2^2;
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto2Death";
end;
OnRatto3Respawn:
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto3Death";
- $@RAT_SAILOR_CONTROL[3] = 0;
- $@RAT_SAILOR_CONTROL[7] = 0;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2^4;
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto3Death";
end;
OnRatto4Respawn:
- areamonster "002-2", 23, 19, 57, 40, "Ratto", Ratto, 1, "RattosControl::OnRatto4Death";
- $@RAT_SAILOR_CONTROL[4] = 0;
- $@RAT_SAILOR_CONTROL[8] = 0;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2^8;
+ areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl::OnRatto4Death";
end;
OnRatto1Death:
- $@RAT_SAILOR_CONTROL[1] = 1;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2|1;
+ if (.@q2 == 15)
+ goto L_Victor;
+ addtimer(65000, "RattosControl::OnRatto1Respawn");
end;
OnRatto2Death:
- $@RAT_SAILOR_CONTROL[2] = 1;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2|2;
+ if (.@q2 == 15)
+ goto L_Victor;
+ addtimer(65000, "RattosControl::OnRatto2Respawn");
end;
OnRatto3Death:
- $@RAT_SAILOR_CONTROL[3] = 1;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2|4;
+ if (.@q2 == 15)
+ goto L_Victor;
+ addtimer(65000, "RattosControl::OnRatto3Respawn");
end;
OnRatto4Death:
- $@RAT_SAILOR_CONTROL[4] = 1;
+ .@q2=getq2(ShipQuests_Peter);
+ setq2 ShipQuests_Peter, .@q2|8;
+ if (.@q2 == 15)
+ goto L_Victor;
+ addtimer(65000, "RattosControl::OnRatto4Respawn");
+ end;
+
+L_Victor:
+ warp "002-1@"+LOCATION$, 35, 26;
+ doevent("Peter::OnDone");
end;
}
diff --git a/npc/002-3/elmo.txt b/npc/002-3/elmo.txt
index fcd20608e..a8db0b6ea 100644
--- a/npc/002-3/elmo.txt
+++ b/npc/002-3/elmo.txt
@@ -83,7 +83,7 @@ L_Candor:
.@q1=getq(ShipQuests_Dan);
.@q2=getq(ShipQuests_ChefGado);
.@q3=getq(ShipQuests_Peter);
- if (.@q1 < 3 || .@q2 < 2 || .@q3 != 5)
+ if (.@q1 < 3 || .@q2 < 2 || .@q3 < 7)
mes l("- Some sailors within this ship may need your help: Chef Gado, Dan, Peter... help them all and collect rewards!");
// Report in an abstract way to the player how good they are at getting travel
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index 1a1d64f7a..8f50e7c59 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -153,10 +153,7 @@ OnInit:
// Current UPDATE value: Sab Dez 15 21:45:15 -02 2018
// Upgrade every Wooden Sword in a Bug Slayer
if ($UPDATE < 1544917515) {
- query_sql("UPDATE `inventory` SET `nameid` = '"+BugSlayer+"' WHERE `inventory`.`nameid`='"+WoodenSword+"'");
- query_sql("UPDATE `storage` SET `nameid` = '"+BugSlayer+"' WHERE `storage`.`nameid`='"+WoodenSword+"'");
- query_sql("UPDATE `cart_inventory` SET `nameid` = '"+BugSlayer+"' WHERE `cart_inventory`.`nameid`='"+WoodenSword+"'");
- query_sql("UPDATE `guild_storage` SET `nameid` = '"+BugSlayer+"' WHERE `guild_storage`.`nameid`='"+WoodenSword+"'");
+ ReplaceItemFromEveryPlayer(WoodenSword, BugSlayer);
$UPDATE=1544917515;
debugmes "";
debugmes "* Replaced Wooden Swords with Bug Slayer";
@@ -167,16 +164,8 @@ OnInit:
if ($UPDATE < 1545061974) {
//query_sql("UPDATE `quest` SET `count1` = '3' WHERE `quest`.`quest_id`='0' AND `quest`.`count1` = '2' AND `quest`.`char_id` IN (SELECT `quest`.`char_id` WHERE `quest`.`quest_id` = '12' AND `quest`.`count1`>='1')");
- query_sql("UPDATE `inventory` SET `nameid` = '"+LEGACY_MiereCleaver+"' WHERE `inventory`.`nameid`='"+MiereCleaver+"'");
- query_sql("UPDATE `storage` SET `nameid` = '"+LEGACY_MiereCleaver+"' WHERE `storage`.`nameid`='"+MiereCleaver+"'");
- query_sql("UPDATE `cart_inventory` SET `nameid` = '"+LEGACY_MiereCleaver+"' WHERE `cart_inventory`.`nameid`='"+MiereCleaver+"'");
- query_sql("UPDATE `guild_storage` SET `nameid` = '"+LEGACY_MiereCleaver+"' WHERE `guild_storage`.`nameid`='"+MiereCleaver+"'");
-
- query_sql("UPDATE `inventory` SET `nameid` = '"+LEGACY_Broadsword+"' WHERE `inventory`.`nameid`='"+Broadsword+"'");
- query_sql("UPDATE `storage` SET `nameid` = '"+LEGACY_Broadsword+"' WHERE `storage`.`nameid`='"+Broadsword+"'");
- query_sql("UPDATE `cart_inventory` SET `nameid` = '"+LEGACY_Broadsword+"' WHERE `cart_inventory`.`nameid`='"+Broadsword+"'");
- query_sql("UPDATE `guild_storage` SET `nameid` = '"+LEGACY_Broadsword+"' WHERE `guild_storage`.`nameid`='"+Broadsword+"'");
-
+ ReplaceItemFromEveryPlayer(MiereCleaver, LEGACY_MiereCleaver);
+ ReplaceItemFromEveryPlayer(Broadsword, LEGACY_Broadsword);
$UPDATE=1545061974;
debugmes "";
debugmes "* Replaced Miere Cleaver and Broad Sword with a special version specific for old players";
@@ -201,6 +190,23 @@ OnInit:
debugmes "* Update Bows IDs";
debugmes "";
}
+ // Current UPDATE value: Seg Dez 31 11:45:35 -02 2018
+ // Update players position (002-x). Update Peter Quest
+ if ($UPDATE < 1546263935) {
+ query_sql("UPDATE `char` SET `last_x` = '53' WHERE `char`.`last_map`='002-1'");
+ query_sql("UPDATE `char` SET `last_y` = '38' WHERE `char`.`last_map`='002-1'");
+ query_sql("UPDATE `char` SET `last_x` = '53' WHERE `char`.`last_map`='002-3'");
+ query_sql("UPDATE `char` SET `last_y` = '38' WHERE `char`.`last_map`='002-3'");
+ query_sql("UPDATE `char` SET `last_x` = '53' WHERE `char`.`last_map`='002-4'");
+ query_sql("UPDATE `char` SET `last_y` = '38' WHERE `char`.`last_map`='002-4'");
+
+ query_sql("UPDATE `quest` SET `count1` = `2` WHERE `quest`.`quest_id`="+ShipQuests_Peter+" AND `count1` >= '3'");
+ $UPDATE=1546263935;
+ debugmes "";
+ debugmes "* Update players position (Nard's Ship)";
+ debugmes "* Update Peter Quest";
+ debugmes "";
+ }
@@ -221,15 +227,14 @@ OnInit:
htput($@CONTRIBUTORS, "polaczka", 700);
htput($@CONTRIBUTORS, "crazyfefe", 641);
htput($@CONTRIBUTORS, "4144", 550);
- htput($@CONTRIBUTORS, "mishana", 500); // Rather magic number based on precedents, tweak if needed.
+ htput($@CONTRIBUTORS, "mishana", 500);
htput($@CONTRIBUTORS, "soren", 450);
htput($@CONTRIBUTORS, "rakinorf", 400);
htput($@CONTRIBUTORS, "pookie", 360);
htput($@CONTRIBUTORS, "ayruss", 210);
htput($@CONTRIBUTORS, "dustman", 175);
- htput($@CONTRIBUTORS, "acsvln", 150);
+ htput($@CONTRIBUTORS, "acsvln", 250);
htput($@CONTRIBUTORS, "ichigoblack",100);
- htput($@CONTRIBUTORS, "acsvln", 100);
htput($@CONTRIBUTORS, "gnulinux", 80);
htput($@CONTRIBUTORS, "skydragon", 75);
htput($@CONTRIBUTORS, "guy of lieutnant dausen", 70);
@@ -237,10 +242,11 @@ OnInit:
htput($@CONTRIBUTORS, "msawis", 30);
htput($@CONTRIBUTORS, "dragonstar", 26);
htput($@CONTRIBUTORS, "demure", 12);
+ htput($@CONTRIBUTORS, "xtreem", 10);
htput($@CONTRIBUTORS, "aisen", 8);
- htput($@CONTRIBUTORS, "xtreem", 8);
htput($@CONTRIBUTORS, "john h", 2);
htput($@CONTRIBUTORS, "krists", 2);
+ htput($@CONTRIBUTORS, "filhote", 1);
//htput($@CONTRIBUTORS, "", 1);
end;
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index dfa178db5..ae6ada8ee 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -112,7 +112,7 @@ function script nard_reputation {
.@nr=.@nr+1;
// Peter Quest (+1 rep)
- if (getq(ShipQuests_Peter) == 3 || getq(ShipQuests_Peter) == 5)
+ if (getq(ShipQuests_Peter) >= 7)
.@nr=.@nr+1;
// Tulimshar Quests