diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-08-29 00:09:02 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-08-29 00:09:02 -0300 |
commit | d6358d0d127ffac94f243d29eccc6793567e9c60 (patch) | |
tree | a32b4bb1fea289dc15fb8fa39e7aa12e9db12df3 /npc/017-1 | |
parent | a5d2385a5e752e751573ad9694e2f58fa6091835 (diff) | |
download | serverdata-d6358d0d127ffac94f243d29eccc6793567e9c60.tar.gz serverdata-d6358d0d127ffac94f243d29eccc6793567e9c60.tar.bz2 serverdata-d6358d0d127ffac94f243d29eccc6793567e9c60.tar.xz serverdata-d6358d0d127ffac94f243d29eccc6793567e9c60.zip |
Elenium Mines Instance Subsystem, quest register, MAP MAP MAP MAP MAP
Diffstat (limited to 'npc/017-1')
-rw-r--r-- | npc/017-1/townhall.txt | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/npc/017-1/townhall.txt b/npc/017-1/townhall.txt index 9b78463ce..61df25334 100644 --- a/npc/017-1/townhall.txt +++ b/npc/017-1/townhall.txt @@ -64,15 +64,54 @@ OnInit: .distance=1; end; } +///////////////////////////// +// Main Quest 6 +// LoF Arc +///////////////// +// Check instances and rebuild if needed +// Returns map name +// BarbaraInstCheck( {submap=mines} ) +// 0- Chamber ; 1 - Mines ; 2 - Hall ; 3 - Shrine +function script BarbaraInstCheck { + .@house=getarg(0, true); + + .@q2=getq2(LoFQuest_Barbara); + // Map name limit: 4 chars (sgt1) + .@map0$="brb0@"+getcharid(0); + .@map1$="brb1@"+getcharid(0); + .@map2$="brb2@"+getcharid(0); + .@map3$="brb3@"+getcharid(0); + if (!(isinstance(.@q2) && .@q2 != 0)) { + .@inst = instance_create("Forgotten Shrine "+getcharid(0), getcharid(3), IOT_CHAR); + instance_attachmap("018-6-0", .@inst, false, .@map0$); + instance_attachmap("018-6-1", .@inst, false, .@map1$); + //instance_attachmap("018-6-2", .@inst, false, .@map2$); + //instance_attachmap("018-6-3", .@inst, false, .@map3$); + // Instance lasts two hours + instance_set_timeout(7200, 7200, .@inst); + instance_init(.@inst); + setq2 LoFQuest_Barbara, .@inst; + } + + // It broke + if (getmapinfo(MAPINFO_SIZE_X, .@map1$) <= 0) { + setq2 LoFQuest_Barbara, 0; + // Infinite Loop? + return callfunc("BarbaraInstCheck", .@house); + } + + // Return map name + return getd(".@map"+.@house+"$"); +} 017-1,32,44,0 script #LoF_EleniumMines NPC_HIDDEN,{ end; OnTouch: // TODO: OnQuest: Instance - .@q=getq(General_Narrator); - if (.@q >= 17) { - warp "018-6-1", 80, 199; + .@q=getq(LoFQuest_Barbara); + if (.@q >= 1) { + warp BarbaraInstCheck(1), 80, 199; } else { warp "018-6-1", 80, 199; } |