From 5e0ff0cc3c030251ffbddb8ce648058006b16f4c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 28 Apr 2022 12:47:57 -0300 Subject: More useless code --- npc/014-2-2/valia.txt | 119 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 115 insertions(+), 4 deletions(-) (limited to 'npc/014-2-2') diff --git a/npc/014-2-2/valia.txt b/npc/014-2-2/valia.txt index e0968bc9b..1f42e6635 100644 --- a/npc/014-2-2/valia.txt +++ b/npc/014-2-2/valia.txt @@ -4,9 +4,15 @@ // Description: // Gemini Sisters Quest - Valia Gemini +034-1 mapflag zone MMO +034-2 mapflag zone MMO +034-3 mapflag zone MMO +034-4 mapflag zone MMO + +// Check if you can do this action or not (hero) function script GeminiCheck { .@st = getarg(0, 0); - if (getq(General_Narrator) < 16 || getq(HurnscaldQuest_Gemini) < .@st) { + if (getq(General_Narrator) < 16 || @mystatus < .@st) { warp "Save", 0, 0; dispbottom l("You don't feel so well... And then, you're dead."); die(); @@ -14,6 +20,34 @@ function script GeminiCheck { } } +// You killed a mob +function script GeminiKill { + if (!compare(getmap(), "val")) end; + switch ('STATUS) { + case 1: // Quest initiated + break; + case 2: // Looking for a runestone + if (killedrid == GreenSlime) { + if (!rand2(40)) { + getexp 8132, 657; + dispbottom l("You found the Runestone! You gave it to the party leader."); + 'STATUS = 3; + } + } + break; + case 3: // Has runestone + break; + } + return; +} + +// Janitor +function script GeminiFail { + .@id=getarg(0, 0); + return; +} + + // Valia Gemini 014-2-2,36,22,0 script Valia NPC_RED_WIZARD_F,{ GeminiCheck(); @@ -67,12 +101,41 @@ function script GeminiCheck { } // Alright. mesq l("Good. I hope you have stocked everything. The time limit is 4 hours."); + + // Only first attempt is free - all others are charged + if (getq(HurnscaldQuest_Gemini)) { + next; + mesn; + mesq l("Actually, I need help with reagents this time. Bring me a %s and a %s and I'll gladly warp you... again.", getitemlink(GemPowder), getitemlink(EverburnPowder)); + if (!countitem(GemPowder) || !countitem(EverburnPowder)) close; + next; + } mesc l("Are you and your party ready?"), 1; if (askyesno() != ASK_YES) close; + // Not eligible for free lunch + if (getq(HurnscaldQuest_Gemini)) { + delitem GemPowder, 1; + delitem EverburnPowder, 1; + } + + // Handle first attempt mesn; - mesq l("Good. Here, take this key and hide it."); + mesq l("Good. Here, take this key and hide it. I will quickly brief you:"); + mes ""; + mesc l(".:: GEMINI ASSASSINS QUEST ::."), 3; + mesc ("Recommended Level: %d+", 85); + mes ""; + mes l("- The goal is to rescue Luvia from Isabamuth. She has been ##Bbrainwashed##b."); + mes l("- Luvia is a powerful mage and Isbamuth is watching, so teleporting directly would be risky."); + mes l("- Instead, the party will be teleported ##Bto a forest.##b"); + mes l("- Find a path to the island where she is hiding herself!"); + if (!getq(HurnscaldQuest_Gemini)) + mesc l("- If you fail, you'll need to pay me ingredients to try again!"), 1; + mes ""; + mesc l("Good luck!"); + compareandsetq HurnscaldQuest_Gemini, 0, 1; // Create instance @@ -99,10 +162,58 @@ function script GeminiCheck { instance_init(.@inst); // Warp everyone and add timers - //partytimer("008-0", 1000, "Party Master::OnStart", getcharid(1)); + partytimer("014-2-2", 1000, "Valia::OnCoreInit", getcharid(1)); warpparty("val1@"+.@p, 24, 24, getcharid(1), "014-2-2", true); - close; + +// Macros +OnCoreInit: + @mystatus = 0; + if (!'STATUS) + 'STATUS = 1; +OnCore: + .@p = getcharid(1); + // Always true on first interaction + // This handles new stages for person + if (@mystatus != 'STATUS) { + switch ('STATUS) { + 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"); + areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, ForestMushroom), ForestMushroom, (BaseLevel/12), "Valia::OnFShroom"); + areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, RedMushroom), RedMushroom, 1+(BaseLevel/30), "Valia::OnRShroom"); + break; + case 2: // Looking for a runestone + break; + case 3: // Has runestone + break; + } + } + addtimer(5000, "Valia::OnCoreInit"); + end; + +OnGSlime: + fix_mobkill(GreenSlime); + areamonster("val1@"+.@p, 20, 20, 60, 60, strmobinfo(1, GreenSlime), GreenSlime, 1, "Valia::OnGSlime"); + end; + +OnLHead: + fix_mobkill(LogHead); + areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, LogHead), LogHead, 1, "Valia::OnLHead"); + end; + +OnFShroom: + fix_mobkill(ForestMushroom); + areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, ForestMushroom), ForestMushroom, 1, "Valia::OnFShroom"); + end; + +OnRShroom: + fix_mobkill(RedMushroom); + areamonster("val1@"+.@p, 20, 20, 70, 60, strmobinfo(1, RedMushroom), RedMushroom, 1, "Valia::OnRShroom"); + end; + OnInit: .distance=4; end; -- cgit v1.2.3-60-g2f50