From 529456b33aafda550cb97ffb13c10e5fc81a54c0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 28 Apr 2022 16:21:45 -0300 Subject: Minimum testing so it barely works --- npc/014-2-2/gemini.txt | 13 ++++++------- npc/014-2-2/valia.txt | 9 ++++++--- npc/034-1/gemini.txt | 24 +++++++++++++----------- npc/034-2/gemini.txt | 7 ++++--- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/npc/014-2-2/gemini.txt b/npc/014-2-2/gemini.txt index 898d12e9e..26317f297 100644 --- a/npc/014-2-2/gemini.txt +++ b/npc/014-2-2/gemini.txt @@ -11,12 +11,10 @@ OnCoreInit: debugmes "CORE INIT, Inst = %d", instance_id(); .@p = getcharid(1); instance_attach($@VALIA_INST[.@p]); - debugmes "Attached to %d", $@VALIA_INST[.@p]; - debugmes "New Inst = %d", instance_id(); @mystatus = 0; sleep2(200); - if (!'STATUS) - 'STATUS = 1; + if (!$@VALIA_STATUS[.@p]) + $@VALIA_STATUS[.@p] = 1; // FALLTHROUGH OnCore: if (!compare(getmap(), "val")) end; @@ -24,10 +22,11 @@ OnCore: instance_attach($@VALIA_INST[.@p]); // Always true on first interaction // This handles new stages for person - if (@mystatus != 'STATUS) { - switch ('STATUS) { + if (@mystatus != $@VALIA_STATUS[.@p]) { + // No retroaction! + @mystatus = $@VALIA_STATUS[.@p]; + switch ($@VALIA_STATUS[.@p]) { case 1: // Quest initiated - @mystatus = 1; // Spawn monsters areamonster("val1@"+.@p, 20, 20, 60, 60, strmobinfo(1, GreenSlime), GreenSlime, (BaseLevel/15), "Valia::OnGSlime"); areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, LogHead), LogHead, (BaseLevel/15), "Valia::OnLHead"); diff --git a/npc/014-2-2/valia.txt b/npc/014-2-2/valia.txt index 5d02af384..622240dad 100644 --- a/npc/014-2-2/valia.txt +++ b/npc/014-2-2/valia.txt @@ -24,15 +24,18 @@ function script GeminiCheck { // You killed a mob function script GeminiKill { if (!compare(getmap(), "val")) end; - switch ('STATUS) { + .@p=getcharid(1); + debugmes "Gemini Kill! ID: %d", killedrid; + switch ($@VALIA_STATUS[.@p]) { case 1: // Quest initiated break; case 2: // Looking for a runestone if (killedrid == GreenSlime) { + debugmes "It was a Green Slime!"; if (!rand2(40)) { getexp 8132, 657; dispbottom l("You found the Runestone! You gave it to the party leader."); - 'STATUS = 3; + $@VALIA_STATUS[.@p] = 3; } } break; @@ -257,7 +260,7 @@ OnKey3: OnLord: .@p = getcharid(1); if (mobcount("val2@"+.@p, "Valia::OnLord")) { - 'STATUS = 8; + $@VALIA_STATUS[.@p] = 8; Zeny+=15000; dispbottom l("This lord dropped a key and a stash of gold!"); } diff --git a/npc/034-1/gemini.txt b/npc/034-1/gemini.txt index 0f43acd0f..6831fd564 100644 --- a/npc/034-1/gemini.txt +++ b/npc/034-1/gemini.txt @@ -7,22 +7,23 @@ 034-1,67,48,0 script Fake Manastone NPC_MANA_STONE,{ if (instance_id() < 0 || getcharid(1) < 1) end; GeminiCheck(1); + .@p=getcharid(1); mesc l("This is a weird stone. It looks like a Mana Stone from afar, but anyone can tell it is fake."); - if (strcharinfo(0) != getpartyleader(getcharid(1))) { - mesc l("It may be dangerous. I better ask %s to check it instead.", getpartyleader(getcharid(1))); + if (strcharinfo(0) != getpartyleader(.@p)) { + mesc l("It may be dangerous. I better ask %s to check it instead.", getpartyleader(.@p)); close; } - switch ('STATUS) { + switch ($@VALIA_STATUS[.@p]) { case 1: case 2: mesc l("It seems to be a mechanism of some kind, but it is missing a Runestone."); mesc l("Maybe one of the slimes dropped it."); - 'STATUS = 2; + $@VALIA_STATUS[.@p] = 2; break; case 3: mesc l("You insert the Runestone on it and hear a sound."); mesc l("Something changed; We should see what is."); - 'STATUS = 4; + $@VALIA_STATUS[.@p] = 4; break; default: mesc l("I already did everything I could with this. What am I waiting for?"); @@ -41,7 +42,8 @@ OnInstanceInit: OnTouch: if (instance_id() < 0 || getcharid(1) < 1) end; GeminiCheck(1); - if ('STATUS < 4) { + .@p=getcharid(1); + if ($@VALIA_STATUS[.@p] < 4) { dispbottom l("There seems to be sort of lock preventing you from passing."); end; } @@ -55,20 +57,21 @@ OnTouch: OnTouch: if (instance_id() < 0 || getcharid(1) < 1) end; GeminiCheck(4); - if ('STATUS < 6) { + .@p=getcharid(1); + if ($@VALIA_STATUS[.@p] < 6) { if (countitem(SealedSoul) >= 7) { mesc l("Do you want to use the souls to unlock the passage?"), 1; next; if (askyesno() == ASK_YES) { delitem SealedSoul, 7; closeclientdialog; - if ('STATUS == 4) { + if ($@VALIA_STATUS[.@p] == 4) { .@u=monster(getmap(), 163, 26, strmobinfo(1, JackO), JackO, 1); unittalk(.@u, "Souls... Feed me Souls... Nooooooooowwww!!!!"); - 'STATUS=5; + $@VALIA_STATUS[.@p]=5; } else { dispbottom l("The waterfall open, and you may now pass."); - 'STATUS=6; + $@VALIA_STATUS[.@p]=6; close; } } @@ -77,7 +80,6 @@ OnTouch: dispbottom l("A powerful magic barrier prevents passage. %d %s should suffice to dispel... Maybe.", 7, getitemlink(SealedSoul)); end; } - .@p=getcharid(1); warp "val2@"+.@p, 24, 59; end; } diff --git a/npc/034-2/gemini.txt b/npc/034-2/gemini.txt index c19cc5558..a6a09ac36 100644 --- a/npc/034-2/gemini.txt +++ b/npc/034-2/gemini.txt @@ -19,7 +19,8 @@ OnTouch: OnTouch: if (instance_id() < 0 || getcharid(1) < 1) end; GeminiCheck(7); - if ('STATUS < 8) { + .@p=getcharid(1); + if ($@VALIA_STATUS[.@p] < 8) { dispbottom l("One of the bandits locked this door; We need to find the key!"); end; } @@ -69,8 +70,8 @@ OnTouch: unitkill(.@b2); areawarp(.@m$, 30, 92, 33, 95, .@m$, 57, 101, 66, 104); // First ambush, set some stuff up - if ('STATUS == 6) { - 'STATUS=7; + if ($@VALIA_STATUS[.@p] == 6) { + $@VALIA_STATUS[.@p]=7; .@mob=monster("val2@"+.@p, 57, 104, strmobinfo(1, CopperSlime), CopperSlime, 1, "Valia::OnKey1"); setunitdata(.@mob, UDT_LEVEL, 1); -- cgit v1.2.3-70-g09d2