From 6ddb821be7f36a964f1cf6cfcabe5f3aaacc18b7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 1 Jun 2019 19:23:30 -0300 Subject: Add some RPG features to Sagratha's Cave (still unused) --- npc/015-8/_import.txt | 1 + npc/015-8/_mobs.txt | 1 + npc/015-8/sealedshrine.txt | 438 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 440 insertions(+) create mode 100644 npc/015-8/sealedshrine.txt (limited to 'npc/015-8') diff --git a/npc/015-8/_import.txt b/npc/015-8/_import.txt index f2d5e9e92..0318c3fd1 100644 --- a/npc/015-8/_import.txt +++ b/npc/015-8/_import.txt @@ -1,3 +1,4 @@ // Map 015-8: Ancient Hideout // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/015-8/_mobs.txt", +"npc/015-8/sealedshrine.txt", diff --git a/npc/015-8/_mobs.txt b/npc/015-8/_mobs.txt index a7e57ad05..82cdf2492 100644 --- a/npc/015-8/_mobs.txt +++ b/npc/015-8/_mobs.txt @@ -6,3 +6,4 @@ 015-8,97,57,62,46 monster Old Snake 1199,12,20000,20000 015-8,67,94,34,79 monster Red Slime 1092,16,20000,20000 015-8,100,56,48,36 monster Vampire Bat 1063,14,30000,22000 +015-8,103,95,69,81 monster Cave Maggot 1027,32,20000,20000 diff --git a/npc/015-8/sealedshrine.txt b/npc/015-8/sealedshrine.txt new file mode 100644 index 000000000..9ddf02f4c --- /dev/null +++ b/npc/015-8/sealedshrine.txt @@ -0,0 +1,438 @@ +// TMW2 scripts. +// Author: +// Jesusalva +// Description: +// SEALED SHRINE submodule - Sagratha's Cave - 015-8 +// Uses setq3 - setq1 stage 3 + +// Check for validity +function script SaggySealCheck { + .@q=getq(HurnscaldQuest_Sagratha); + .@q3=getq3(HurnscaldQuest_Sagratha); + // Cheater Detected + if (!MAGIC_LVL || .@q < 3) { + setq HurnscaldQuest_Sagratha, 0, 0, 0; + sc_end SC_CASH_PLUSEXP; + sc_end SC_OVERLAPEXPUP; + sc_start SC_OVERLAPEXPUP, 300000, -20; + warp "Save", 0, 0; + return false; + } + + // Okay, if it is not stage 3, we don't need to unseal + if (.@q != 3) + return false; + return true; +} + +// Main menu +// ( .name$ ) +function script SaggySealInit { + mesc l("Attempt to break the seal?"); + mesc l("Warning: This will drain mana and spawn monsters. You shall not leave this cave section!"); + if (askyesno() == ASK_YES) { + npctalk3 l("You started the seal break sequence. Please stand by."); + addtimer(1000, getarg(0)+"::OnBreakSeal01"); + } + return; +} + +// Seal Spawn +// (name, seal x, seal y, stageId, {seal map}) +function script SaggySealInit { + .@n$=getarg(0); + .@x=getarg(1); + .@y=getarg(2); + .@z=getarg(3); + .@m$=getarg(4, "018-5"); + + // Do nothing if @SaggySeal$ is busy - we will NOT begin another unsealing. + if (@SaggySeal$ != "" && .@z) + end; + else + @SaggySeal$=.@n$; + + // Drain some Mana + // Max wave is 9... So it should cap at 10% + .@val=7+(.@z/3); + + if (Sp < MaxSp/100*.@val) { + npctalk l("You don't have enough mana to continue. The seal remains active."); + @SaggySeal$=""; + end; + } + percentheal 0, -(.@val); + + // BaseLevel: 37 + monster .@m$, .@x, .@y, "Seal Guardian", MagicGoblin, (.@z/2)+1; + + switch (.@z) { + case 0: + .@mobId=any(HouseMaggot,SlimeBlast); break; + case 1: + .@mobId=AngryScorpion; break; + case 2: + .@mobId=AngryBat; break; + case 3: + .@mobId=RedSlime; break; + case 4: + .@mobId=AngryRedScorpion; break; + case 5: + .@mobId=Bandit; break; + case 6: + .@mobId=Skeleton; break; + case 7: + .@mobId=BlueSlime; break; + case 8: + .@mobId=RedMushroom; break; + case 9: + .@mobId=BlackSlime; break; + default: + Exception("ERROR, INVALID Z VALUE FOR SAGRATHA SEAL: "+.@z, RB_DEFAULT|RB_IRCBROADCAST); + .@mobId=WickedMushroom; break; + } + + monster .@m$, .@x, .@y, "Seal Guardian", .@mobId, 1; + + // Schedule next sequence + if (.@z+1 < 10) + .@nx$="0"+(.@z+1); + else + .@nx$=str(.@z+1); + // 3.5s each wave, giving you ~1s to kill/endure each "boss" + .@t=3500+(.@z*980); + + addtimer2(.@t, .@n$+"::OnBreakSeal"+.@nx$); + return; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +018-5,0,0,0 script #SaggySeal1 NPC_SUMMONING_CIRC,0,0,{ + end; + +OnTouch: + .@q=getq(HurnscaldQuest_Sagratha); + .@q3=getq3(HurnscaldQuest_Sagratha); + // Check if it can be operated + if (!SaggySealCheck()) + end; + + // Check if this seal is ok + if (.@q3 & .sealId) { + npctalkonce l("This seal was already broken, proceed to the next seal!"); + end; + } + + // It is stage 3, so we will write to setq3 that the seal is open... Soon. + SaggySealInit(.name$, .x, .y, 0); + close; + +OnBreakSeal01: + SaggySealInit(.name$, .x, .y, 1); + end; + +OnBreakSeal02: + SaggySealInit(.name$, .x, .y, 2); + end; + +OnBreakSeal03: + SaggySealInit(.name$, .x, .y, 3); + end; + +OnBreakSeal04: + SaggySealInit(.name$, .x, .y, 4); + end; + +OnBreakSeal05: + SaggySealInit(.name$, .x, .y, 5); + end; + +OnBreakSeal06: + SaggySealInit(.name$, .x, .y, 6); + end; + +OnBreakSeal07: + SaggySealInit(.name$, .x, .y, 7); + end; + +OnBreakSeal08: + SaggySealInit(.name$, .x, .y, 8); + end; + +OnBreakSeal09: + SaggySealInit(.name$, .x, .y, 9); + end; + +OnBreakSeal10: + .@q3=getq3(HurnscaldQuest_Sagratha); + npctalk3 l("The seal was broken!"); + @SaggySeal$=""; + setq3 HurnscaldQuest_Sagratha, .@q3 | .sealId; + end; + +OnInit: + .sealId=1; + + setarray .xpos, 115, 119, 116, 121, 126, 125, 137, 136, 115; + setarray .ypos, 117, 117, 119, 122, 125, 115, 117, 123, 118; + .@z=rand(getarraysize(.xpos)); + movenpc .name$, .xpos[.@z], .ypos[.@z], 0; + end; +} + + + + + + + + + + + + + + +018-5,0,0,0 script #SaggySeal2 NPC_SUMMONING_CIRC,0,0,{ + end; + +OnTouch: + .@q=getq(HurnscaldQuest_Sagratha); + .@q3=getq3(HurnscaldQuest_Sagratha); + // Check if it can be operated + if (!SaggySealCheck()) + end; + + // Check if this seal is ok + if (.@q3 & .sealId) { + npctalkonce l("This seal was already broken, proceed to the next seal!"); + end; + } + + // It is stage 3, so we will write to setq3 that the seal is open... Soon. + SaggySealInit(.name$, .x, .y, 0); + close; + +OnBreakSeal01: + SaggySealInit(.name$, .x, .y, 1); + end; + +OnBreakSeal02: + SaggySealInit(.name$, .x, .y, 2); + end; + +OnBreakSeal03: + SaggySealInit(.name$, .x, .y, 3); + end; + +OnBreakSeal04: + SaggySealInit(.name$, .x, .y, 4); + end; + +OnBreakSeal05: + SaggySealInit(.name$, .x, .y, 5); + end; + +OnBreakSeal06: + SaggySealInit(.name$, .x, .y, 6); + end; + +OnBreakSeal07: + SaggySealInit(.name$, .x, .y, 7); + end; + +OnBreakSeal08: + SaggySealInit(.name$, .x, .y, 8); + end; + +OnBreakSeal09: + SaggySealInit(.name$, .x, .y, 9); + end; + +OnBreakSeal10: + .@q3=getq3(HurnscaldQuest_Sagratha); + npctalk3 l("The seal was broken!"); + @SaggySeal$=""; + setq3 HurnscaldQuest_Sagratha, .@q3 | .sealId; + end; + +OnInit: + .sealId=2; + + setarray .xpos, 39, 33, 43, 53, 51, 55, 60, 68, 63, 56; + setarray .ypos, 120, 130, 134, 132, 119, 121, 122, 120, 129, 124; + .@z=rand(getarraysize(.xpos)); + movenpc .name$, .xpos[.@z], .ypos[.@z], 0; + end; +} + + + + + + + + + + + + + + +018-5,0,0,0 script #SaggySeal3 NPC_SUMMONING_CIRC,0,0,{ + end; + +OnTouch: + .@q=getq(HurnscaldQuest_Sagratha); + .@q3=getq3(HurnscaldQuest_Sagratha); + // Check if it can be operated + if (!SaggySealCheck()) + end; + + // Check if this seal is ok + if (.@q3 & .sealId) { + npctalkonce l("This seal was already broken, proceed to the next seal!"); + end; + } + + // It is stage 3, so we will write to setq3 that the seal is open... Soon. + SaggySealInit(.name$, .x, .y, 0); + close; + +OnBreakSeal01: + SaggySealInit(.name$, .x, .y, 1); + end; + +OnBreakSeal02: + SaggySealInit(.name$, .x, .y, 2); + end; + +OnBreakSeal03: + SaggySealInit(.name$, .x, .y, 3); + end; + +OnBreakSeal04: + SaggySealInit(.name$, .x, .y, 4); + end; + +OnBreakSeal05: + SaggySealInit(.name$, .x, .y, 5); + end; + +OnBreakSeal06: + SaggySealInit(.name$, .x, .y, 6); + end; + +OnBreakSeal07: + SaggySealInit(.name$, .x, .y, 7); + end; + +OnBreakSeal08: + SaggySealInit(.name$, .x, .y, 8); + end; + +OnBreakSeal09: + SaggySealInit(.name$, .x, .y, 9); + end; + +OnBreakSeal10: + .@q3=getq3(HurnscaldQuest_Sagratha); + npctalk3 l("The seal was broken!"); + @SaggySeal$=""; + setq3 HurnscaldQuest_Sagratha, .@q3 | .sealId; + end; + +OnInit: + .sealId=4; + + setarray .xpos, 140, 143, 146, 147, 145, 143; + setarray .ypos, 140, 141, 139, 144, 147, 143; + .@z=rand(getarraysize(.xpos)); + movenpc .name$, .xpos[.@z], .ypos[.@z], 0; + end; +} + + + + + + + +// Sagratha Seals Eletronic Barriers +018-5,120,130,0 script #SaggySealBarrier1 NPC_HIDDEN,0,4,{ +OnTouch: + if (@SaggySeal$ != "") { + npctalk3 l("The seal retaliates! It was super effective. You are dead!"); + @SaggySeal$=""; + percentheal -100, -100; + end; + } + end; +} + +018-5,74,142,0 script #SaggySealBarrier2 NPC_HIDDEN,0,4,{ +OnTouch: + if (@SaggySeal$ != "") { + npctalk3 l("The seal retaliates! It was super effective. You are dead!"); + @SaggySeal$=""; + percentheal -100, -100; + end; + } + end; +} + +018-5,137,154,0 script #SaggySealBarrier3 NPC_HIDDEN,0,5,{ +OnTouch: + if (@SaggySeal$ != "") { + npctalk3 l("The seal retaliates! It was super effective. You are dead!"); + @SaggySeal$=""; + percentheal -100, -100; + end; + } + end; +} + -- cgit v1.2.3-60-g2f50