diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-02-26 03:18:58 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-02-26 03:18:58 -0300 |
commit | 6fdbb9c2bb8657ed641a06bc037dc54c5a302d03 (patch) | |
tree | d2ecc70484368121c4834decc697c3646ee32455 | |
parent | 44a48a94d5ad5549a35a227aad7f9d5387c4a552 (diff) | |
download | serverdata-6fdbb9c2bb8657ed641a06bc037dc54c5a302d03.tar.gz serverdata-6fdbb9c2bb8657ed641a06bc037dc54c5a302d03.tar.bz2 serverdata-6fdbb9c2bb8657ed641a06bc037dc54c5a302d03.tar.xz serverdata-6fdbb9c2bb8657ed641a06bc037dc54c5a302d03.zip |
Magic School Port should now be instanced for the event
But we need the trigger for the boss fight or this is for naught!
-rw-r--r-- | npc/003-0/recepcionist.txt | 1 | ||||
-rw-r--r-- | npc/003-1/magic.txt | 48 |
2 files changed, 47 insertions, 2 deletions
diff --git a/npc/003-0/recepcionist.txt b/npc/003-0/recepcionist.txt index 5700e0f68..182ea2064 100644 --- a/npc/003-0/recepcionist.txt +++ b/npc/003-0/recepcionist.txt @@ -122,6 +122,7 @@ OnTimer1000: domovestep; OnInit: +OnInstanceInit: .@npcId = getnpcid(.name$); setunitdata(.@npcId, UDT_HEADTOP, FancyHat); setunitdata(.@npcId, UDT_HEADMIDDLE, SorcererRobe); diff --git a/npc/003-1/magic.txt b/npc/003-1/magic.txt index 61b97c9c8..9fe18037b 100644 --- a/npc/003-1/magic.txt +++ b/npc/003-1/magic.txt @@ -12,9 +12,20 @@ OnTouch: mesc l("You cannot enter here while you have event weapons or a cart."), 1; close; } - // TODO: Main Quest Instance + // TODO: Main Quest Event Control if (LUA_ASKED_TO_SAVE_PROFESSOR) { - dispbottom "Runtime error."; + .@mapn$="0030@"+getcharid(0); + // Instance doesn't exists + if (!(isinstance(LUA_ASKED_TO_SAVE_PROFESSOR)) || instanceowner(LUA_ASKED_TO_SAVE_PROFESSOR) != getcharid(3)) { + .@inst = instance_create("Academy "+getcharid(0), getcharid(3), IOT_CHAR); + instance_attachmap("003-0", .@inst, false, .@mapn$); + // Instance lasts 15 minutes + instance_set_timeout(900, 900, .@inst); + instance_init(.@inst); + LUA_ASKED_TO_SAVE_PROFESSOR=.@inst; + } + warp .@mapn$, 48, 51; + end; } /* if (countitem(JesusalvaGrimorium) <= 0 || MAGIC_LVL < 2) { @@ -26,3 +37,36 @@ OnTouch: warp "003-0", 48, 51; end; } + +function script SaggyInstCheck { + .@house=getarg(0, true); + + .@q2=getq2(HurnscaldQuest_Sagratha); + // Map name limit: 4 chars (sgt1) + .@mapn$="sgt1@"+getcharid(0); + .@map2$="sgt2@"+getcharid(0); + if (!(isinstance(.@q2) && .@q2 != 0)) { + .@inst = instance_create("Sagratha House "+getcharid(0), getcharid(3), IOT_CHAR); + instance_attachmap("014-5-1", .@inst, false, .@mapn$); + //instance_attachmap("015-8", .@inst, false, .@mapn$); + instance_attachmap("015-8-1", .@inst, false, .@map2$); + // Instance lasts one hour + instance_set_timeout(3600, 3600, .@inst); + instance_init(.@inst); + setq2 HurnscaldQuest_Sagratha, .@inst; + } + + // It broke + if (getmapinfo(MAPINFO_SIZE_X, .@mapn$) <= 0) { + setq2 HurnscaldQuest_Sagratha, 0; + // Infinite Loop? + return callfunc("SaggyInstCheck", .@house); + } + + if (.@house) { + return .@mapn$; + } else { + return .@map2$; + } +} + |