Explorar o código

Merge branch 'master' of https://github.com/rathena/rathena

Deadly Silence %!s(int64=11) %!d(string=hai) anos
pai
achega
489dda35cc

+ 2 - 0
.gitignore

@@ -23,6 +23,7 @@
 /Makefile.cache
 /map-server_sql
 /mapcache
+/nbproject
 
 # /3rdparty/libconfig/
 /3rdparty/libconfig/Makefile
@@ -34,6 +35,7 @@
 
 # /conf/
 /conf/import
+/conf/msg_conf/import
 
 # /log/
 /log/*.log

+ 2 - 2
db/packet_db.txt

@@ -1707,7 +1707,7 @@ packet_ver: 30
 0x089c,26,friendslistadd,2
 0x0885,5,hommenu,2:4
 0x0961,36,storagepassword,2:4:20
-0x0288,-1,cashshopbuy,2:4:6:10
+0x0288,-1,cashshopbuy,2:4:8:10
 0x091c,26,partyinvite2,2
 0x094b,19,wanttoconnection,2:6:10:14:18
 0x0369,7,actionrequest,2:6
@@ -1816,7 +1816,7 @@ packet_ver: 34
 0x0447,2,booking_playcancel,0
 0x044A,6,clientversion,2
 0x0844,2,cashshopopen,0
-0x0848,-1,cashshopbuy,2:4:6:10
+0x0848,-1,cashshopbuy,2:6:4:10
 0x084a,2,cashshopclose,0
 0x084b,19 //fallitem4
 0x085a,90,useskilltoposinfo,2:4:6:8:10

+ 1 - 1
db/re/instance_db.txt

@@ -14,4 +14,4 @@
 8,Buwaya Cave,3600,1@ma_c,35,57,1@ma_c
 9,Bakonawa Lake,7200,1@ma_b,64,51,1@ma_b
 //10,Wolfchev's Laboratory,14400,1@lhz,45,148,1@lhz
-//11,Old Glast Heim,3600,1@gl_k,150,20,1@gl_k,2@gl_k
+11,Old Glast Heim,3600,1@gl_k,150,20,1@gl_k,2@gl_k

+ 7 - 6
db/re/item_db.txt

@@ -4114,6 +4114,7 @@
 6583,3rd_Test_Pass,3rd Test Pass,3,0,,0,,,,,,,,,,,,,{},{},{}
 6593,Cryptura_Hair_Coupon,Cryptura Hair Coupon,3,0,,0,,,,,,,,,,,,,{},{},{}
 6606,P_Cart_C,P Cart C,3,0,,10,,,,,,,,,,,,,{},{},{}
+6608,Coagulated_Spell,Coagulated Spell,3,0,,10,,,,,,,,,,,,,{},{},{}
 6616,Lmtd_Manny_Card,Lmtd Manny Card,3,20,,10,,,,,,,,,,,,,{},{},{}
 6617,Lmtd_Sid_Card,Lmtd Sid Card,3,20,,10,,,,,,,,,,,,,{},{},{}
 6618,Lmtd_Diego_Card,Lmtd Diego Card,3,20,,10,,,,,,,,,,,,,{},{},{}
@@ -7758,17 +7759,17 @@
 16691,Scorpius_Scroll,Scorpius Scroll,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
 //
 16740,Ptotection_Seagod_Box,The Sea God's Call 23 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 6436,86400; },{},{}
-16741,Hairtail_Box1,Cutlass 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1198,86400; },{},{}
+16741,Hairtail_Box1,Cutlass 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1198,3600; },{},{}
 16742,Hairtail_Box2,Cutlass 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1198,604800; },{},{}
-16743,Spearfish_Box1,Marlin 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1489,86400; },{},{}
+16743,Spearfish_Box1,Marlin 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1489,3600; },{},{}
 16744,Spearfish_Box2,Marlin 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 1489,604800; },{},{}
-16745,Saurel_Box1,Pompano 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 13068,86400; },{},{}
+16745,Saurel_Box1,Pompano 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 13068,3600; },{},{}
 16746,Saurel_Box2,Pompano 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 13068,604800; },{},{}
-16747,Tuna_Box1,Tuna 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 16016,86400; },{},{}
+16747,Tuna_Box1,Tuna 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 16016,3600; },{},{}
 16748,Tuna_Box2,Tuna 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 16016,604800; },{},{}
-16749,Malang_Crab_Box1,Malangdo Crab 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18107,86400; },{},{}
+16749,Malang_Crab_Box1,Malangdo Crab 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18107,3600; },{},{}
 16750,Malang_Crab_Box2,Malangdo Crab 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18107,604800; },{},{}
-16751,Brindle_Eel_Box1,Zebra Eel 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18108,86400; },{},{}
+16751,Brindle_Eel_Box1,Zebra Eel 1 Hour Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18108,3600; },{},{}
 16752,Brindle_Eel_Box2,Zebra Eel 7 Day Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ rentitem 18108,604800; },{},{}
 16753,Unbreak_Weap_Box,Unbreakable Weapon Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 6438,1; },{},{}
 16754,F_Unbreak_Weap_Box,Unbreakable Weapon Box,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 6438,1; },{},{}

+ 16 - 13
db/re/mob_db.txt

@@ -1615,19 +1615,22 @@
 //2461,TREASURE_BOX_TE_9
 //2462,TREASURE_BOX_TE_10
 //2463,E_BOMBPORING
-//2464,MG_ZOMBIE
-//2465,MG_WRAITH
-//2466,MG_GHOUL
-//2467,MG_ARCLOUSE
-//2468,MG_RAYDRIC
-//2469,MG_RAYDRIC_ARCHER
-//2470,MG_KNIGHT_OF_ABYSS
-//2471,MG_KHALITZBURG
-//2472,MG_BLOODY_KNIGHT
-//2473,MG_M_UNDEAD_KNIGHT
-//2474,MG_F_UNDEAD_KNIGHT
-//2475,MG_CORRUPTION_ROOT
-//2476,MG_AMDARAIS
+
+// Old Glast Heim (currently placeholders)
+2464,MG_ZOMBIE,Zombie,Zombie,17,9340,1,117,87,1,38,50,20,3,15,8,17,0,15,0,10,12,1,1,29,0x3885,400,2612,912,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2465,MG_WRAITH,Wraith,Wraith,77,23168,1,1190,1191,1,335,396,80,40,62,26,30,55,76,5,10,12,2,1,89,0x3695,300,1816,576,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2466,MG_GHOUL,Ghoul,Ghoul,61,12614,1,583,656,1,216,245,78,5,56,12,19,11,27,10,10,12,1,1,49,0x3885,250,2456,912,504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2467,MG_ARCLOUSE,Arclouse,Arclouze,107,14020,1,1844,2607,1,269,309,101,36,60,73,45,35,140,15,10,12,1,4,42,0x3195,100,960,500,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2468,MG_RAYDRIC,Raydric,Raydric,115,25408,1,20770,2076,1,572,668,89,15,129,87,55,32,76,27,10,12,2,7,47,0x3095,150,824,780,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2469,MG_RAYDRIC_ARCHER,Raydric Archer,Raydric Archer,82,30370,1,1049,1332,9,377,395,63,40,53,24,40,15,112,30,10,12,1,6,47,0x2185,200,1152,1152,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2470,MG_KNIGHT_OF_ABYSS,Knight of Abyss,Abysmal Knight,122,332970,1,4779,4013,1,810,1002,102,50,121,55,68,70,97,37,10,12,2,7,87,0x3695,300,1500,500,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2471,MG_KHALITZBURG,Khalitzburg,Khalitzburg,118,109860,1,2862,2147,1,737,833,125,10,121,48,40,31,89,32,10,12,2,1,29,0x3695,350,528,1000,396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2472,MG_BLOODY_KNIGHT,Bloody Knight,Bloody Knight,116,285000,1,7348,6511,3,942,1065,122,50,132,59,70,57,98,45,10,12,2,0,87,0x3695,250,828,528,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2473,MG_M_UNDEAD_KNIGHT,Undead Knight,Undead Knight,133,500000,0,4500,3375,2,751,880,122,62,122,87,54,65,103,65,14,16,2,7,80,0x37B5,170,140,384,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2474,MG_F_UNDEAD_KNIGHT,Undead Knight,Undead Knight,133,500000,0,4500,3375,2,751,880,122,62,122,87,54,65,103,65,14,16,2,7,80,0x37B5,170,140,384,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2475,MG_CORRUPTION_ROOT,Root of Corruption,Root of Corruption,136,3190000,1,240120,187920,3,710,1762,213,123,86,89,120,131,101,92,14,12,2,7,62,0x1A4,170,854,2016,480,120060,607,5500,608,3500,732,5500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+2476,MG_AMDARAIS,Amdarias,Amdarias,143,3283990,1,74288,77950,2,8860,10022,32,66,140,159,30,109,300,90,10,12,2,2,63,0x37B5,200,1152,1152,576,37144,617,5500,617,5000,616,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+
 //2477,NG_WANDER_MAN
 //2478,NG_RIDEWORD
 //2479,NG_MIMIC

+ 42 - 0
db/re/mob_skill_db.txt

@@ -7999,3 +7999,45 @@
 2362,Nightmare Amon Ra@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,,
 2362,Nightmare Amon Ra@AL_TELEPORT,walk,26,1,5000,0,5000,yes,self,rudeattacked,,,,,,,,
 2362,Nightmare Amon Ra@AL_HEAL,idle,28,11,10000,0,10000,yes,self,myhpltmaxrate,50,,,,,,,
+
+// Old Glast Heim (currently placeholders)
+2464,MG Zombie@AL_HEAL,idle,28,10,10000,0,5000,yes,self,always,0,,,,,,,26
+2464,MG Zombie@NPC_UNDEADATTACK,chase,347,10,8000,1000,5000,yes,target,always,0,,,,,,,
+2465,MG Wraith@NPC_ENERGYDRAIN,attack,200,1,500,0,5000,yes,target,always,0,,,,,,,
+2466,MG Ghoul@NPC_UNDEADATTACK,chase,347,10,8000,1000,5000,yes,target,always,0,,,,,,,
+2467,MG Arclouse@NPC_GROUNDATTACK,attack,185,10,2000,0,5000,yes,target,always,0,,,,,,,
+2468,MG Raydric@BS_MAXIMIZE,attack,114,5,500,1000,5000,no,self,always,0,,,,,,,
+2468,MG Raydric@BS_MAXIMIZE,chase,114,5,500,1000,5000,no,self,always,0,,,,,,,
+2468,MG Raydric@NPC_EMOTION,chase,197,1,2000,0,5000,yes,self,always,0,0,,,,,,
+2468,MG Raydric@SM_MAGNUM,attack,7,9,500,500,5000,no,self,always,0,,,,,,6,
+2468,MG Raydric@CR_AUTOGUARD,chase,249,2,2000,0,300000,yes,self,longrangeattacked,,,,,,,,
+2468,MG Raydric@CR_AUTOGUARD,attack,249,2,500,0,300000,yes,self,always,0,,,,,,,
+2469,MG Raydric Archer@AC_CHARGEARROW,attack,148,1,500,0,5000,yes,target,always,0,,,,,,9,
+2469,MG Raydric Archer@NPC_DARKNESSATTACK,attack,190,10,500,500,5000,no,target,always,0,,,,,,9,
+2469,MG Raydric Archer@CR_AUTOGUARD,attack,249,2,500,0,300000,yes,self,always,0,,,,,,,
+2470,MG Knight of Abyss@AC_CHARGEARROW,chase,148,1,500,0,5000,yes,target,always,0,,,,,,,
+2470,MG Knight of Abyss@KN_BRANDISHSPEAR,attack,57,20,500,1000,5000,no,target,always,0,,,,,,9,
+2470,MG Knight of Abyss@NPC_DARKNESSATTACK,attack,190,5,500,500,5000,no,target,always,0,,,,,,9,
+2470,MG Knight of Abyss@CR_AUTOGUARD,chase,249,10,2000,0,300000,yes,self,longrangeattacked,,,,,,,,
+2470,MG Knight of Abyss@CR_AUTOGUARD,attack,249,10,500,0,300000,yes,self,always,0,,,,,,,
+2472,MG Bloody Knight@KN_BRANDISHSPEAR,attack,57,5,500,1000,5000,no,target,always,0,,,,,,9,
+2472,MG Bloody Knight@NPC_CHANGEFIRE,attack,164,1,10000,2000,600000,no,self,myhpltmaxrate,20,,,,,,,
+2472,MG Bloody Knight@NPC_DARKNESSATTACK,attack,190,2,500,500,5000,no,target,always,0,,,,,,9,
+2472,MG Bloody Knight@CR_SHIELDCHARGE,attack,250,5,500,0,5000,yes,target,always,0,,,,,,9,
+2472,MG Bloody Knight@WZ_METEOR,attack,83,5,2000,0,5000,no,target,myhpltmaxrate,20,,,,,,,
+2472,MG Bloody Knight@WZ_METEOR,chase,83,5,2000,0,5000,no,target,myhpltmaxrate,20,,,,,,,
+2472,MG Bloody Knight@NPC_WEAPONBRAKER,attack,343,5,500,0,30000,yes,target,always,0,,,,,,,
+2475,MG_CORRUPTION_ROOT@NPC_HELLJUDGEMENT,idle,662,10,10000,4000,100,no,self,always,0,,,,,,36,
+2475,MG_CORRUPTION_ROOT@NPC_HELLJUDGEMENT,attack,662,10,10000,1000,10000,no,self,always,0,,,,,,36,
+2475,MG_CORRUPTION_ROOT@NPC_DARKSTRIKE,attack,340,10,2000,0,5000,yes,target,always,0,,,,,,,
+2475,MG_CORRUPTION_ROOT@NPC_SILENCEATTACK,attack,178,10,2000,0,5000,no,target,always,0,,,,,,,
+2475,MG_CORRUPTION_ROOT@NPC_PETRIFYATTACK,attack,180,5,500,500,5000,no,target,always,0,,,,,,3,
+//2475,MG_CORRUPTION_ROOT@NPC_TALK,idle,682,10,10000,0,60000,no,self,myhpltmaxrate,100,,,,,,,41
+2476,MG_AMDARAIS@NPC_DRAGONFEAR,chase,659,5,10000,0,30000,no,self,always,0,,,,,,6,
+2476,MG_AMDARAIS@NPC_DRAGONFEAR,attack,659,5,2000,1000,20000,no,self,myhpltmaxrate,80,,,,,,32,
+2476,MG_AMDARAIS@NPC_CRITICALSLASH,attack,170,1,500,500,5000,no,target,always,0,,,,,,,
+2476,MG_AMDARAIS@NPC_FIREBREATH,attack,654,5,500,800,5000,no,target,always,0,,,,,,32,
+2476,MG_AMDARAIS@NPC_DARKBREATH,attack,202,5,500,800,5000,no,target,always,0,,,,,,36,
+2476,MG_AMDARAIS@NPC_WEAPONBRAKER,attack,343,10,500,0,30000,yes,target,always,0,,,,,,,
+2476,MG_AMDARAIS@MG_FIREBALL,chase,17,20,5000,500,1000,no,target,always,0,,,,,,,
+//2476,MG_AMDARAIS@NPC_TALK,idle,682,10,10000,0,60000,no,self,myhpltmaxrate,100,,,,,,,42

+ 2 - 2
db/re/skill_cast_db.txt

@@ -1305,9 +1305,9 @@
 //-- NC_MAGNETICFIELD
 2272,500:1000:1500,0,0,15000,0,20000:15000:10000,-1
 //-- NC_NEUTRALBARRIER
-2273,500:1000:1500,0,0,30000:45000:60000,0,20000:15000:10000,-1
+2273,0,0,0,30000:45000:60000,0,20000:15000:10000,500:1000:1500
 //-- NC_STEALTHFIELD
-2274,500:1000:1500,0,0,15000:20000:25000,0,20000:15000:10000,-1
+2274,0,0,0,15000:20000:25000,0,20000:15000:10000,500:1000:1500
 //-- NC_REPAIR
 2275,200:300:400:500:600,1000,0,0,0,0,-1
 

+ 2 - 2
db/re/skill_db.txt

@@ -841,8 +841,8 @@
 2270,0,6,4,0,0x3,7,1,1,yes,0,0,0,none,0,	NC_INFRAREDSCAN,Infrared Scan
 2271,9,6,1,0,0x1,0,3,1,yes,0,0,0,none,0,	NC_ANALYZE,Analyze
 2272,0,6,4,0,0x3,1:2:3,3,1,yes,0,0,0,none,0,	NC_MAGNETICFIELD,Magnetic Field
-2273,0,6,4,0,0x1,0,3,1,yes,0,0,0,none,0,	NC_NEUTRALBARRIER,Neutral Barrier
-2274,0,6,4,0,0x1,0,3,1,yes,0,0,0,none,0,	NC_STEALTHFIELD,Stealth Field
+2273,0,6,4,0,0x1,0,3,1,yes,0,0x2000,0,none,0,	NC_NEUTRALBARRIER,Neutral Barrier
+2274,0,6,4,0,0x1,0,3,1,yes,0,0x2000,0,none,0,	NC_STEALTHFIELD,Stealth Field
 2275,5,6,16,0,0x1,0,5,1,yes,0,0,0,magic,0,	NC_REPAIR,Repair
 2276,0,0,0,0,0,0,10,0,no,0,0,0,none,0,		NC_TRAININGAXE,Axe Training
 2277,0,0,0,0,0,0,5,0,no,0,0,0,none,0,		NC_RESEARCHFE,Research Fire/Earth

+ 2 - 2
db/re/skill_unit_db.txt

@@ -117,8 +117,8 @@
 2253,0xd6,    ,  0, 1,1000,enemy, 0x002	//RA_FIRINGTRAP
 2254,0xd7,    ,  0, 1,1000,enemy, 0x002	//RA_ICEBOUNDTRAP
 
-2273,0xe2,    ,  1, 0, 500,friend,0x000	//NC_NEUTRALBARRIER
-2274,0xe3,    ,  1, 0, 500,all,   0x000	//NC_STEALTHFIELD
+2273,0xe2,    ,  2, 0, 500,friend,0x000	//NC_NEUTRALBARRIER
+2274,0xe3,    ,  2, 0, 500,all,   0x000	//NC_STEALTHFIELD
 
 2299,0xcc,    ,  0, 1,1000,all,   0x006	//SC_MANHOLE
 2300,0xcd,    ,  0, 1,1000,all,   0x006	//SC_DIMENSIONDOOR

+ 6 - 4
npc/custom/warper.txt

@@ -414,8 +414,8 @@ G6: Go("schg_dun01",200,124);
 // --------------------------------------------------
 
 menu	"Bakonawa Lake",I1, "Bangungot Hospital 2F",I2, "Buwaya Cave",I3,
-	"Endless Tower",I4, "Hazy Forest",I5, "Malangdo Culvert",I6,
-	"Nidhoggur's Nest",I7, "Octopus Cave",I8, "Orc's Memory",I9, "Sealed Shrine",I10;
+	"Endless Tower",I4, "Hazy Forest",I5, "Malangdo Culvert",I6, "Nidhoggur's Nest",I7,
+	"Octopus Cave",I8, "Old Glast Heim",I9, "Orc's Memory",I10, "Sealed Shrine",I111;
 
 I1: Restrict("RE");
 	Go("ma_scene01",172,175);
@@ -431,8 +431,10 @@ I6: Restrict("RE");
 I7: Go("nyd_dun02",95,193);
 I8: Restrict("RE");
 	Go("mal_dun01",152,230);
-I9: Go("gef_fild10",240,198);
-I10: Go("monk_test",306,143);
+I9: Restrict("RE");
+	Go("glast_01",204,268);
+I10: Go("gef_fild10",240,198);
+I11: Go("monk_test",306,143);
 
 // --------------------------------------------------
 	Special:

+ 4 - 2
npc/jobs/2-2/dancer.txt

@@ -4,7 +4,7 @@
 //= Kalen - Original jAthena
 //= Fredzilla - Converted, Lupus
 //===== Current Version: ===================================== 
-//= 3.7
+//= 3.7a
 //===== Compatible With: ===================================== 
 //= rAthena SVN
 //===== Description: ========================================= 
@@ -20,6 +20,7 @@
 //= 3.6 Applied Correction bug with for loop. [L0ne_W0lf]
 //= 3.6a Fixed a little Exploit to bug the quest with a timeout. (bugreport:2252) [Samuray22]
 //= 3.7 Added Quest Log commands. [Kisuka]
+//= 3.7a Fixed a label execution. [Euphy]
 //============================================================
 
 comodo,180,153,4	script	Sonotora#1	90,{
@@ -1323,7 +1324,7 @@ OnDisable:
 
 // Backup Dancers
 //============================================================ 
-job_duncer,63,110,4	script	Backdancer#1::BackDancer	724,{
+job_duncer,63,110,4	script	Backdancer#1	724,{
 	end;
 
 OnSmile:
@@ -1400,3 +1401,4 @@ OnOmg:
 //=	Concentration' to 'Attention Concentrate' [Lupus]
 //= 3.0 Some optimization, typos, added missing dialogues (4Kb lighter) [Lupus]
 //= 3.1 Implemented JOBLVL as in other quests [Lupus]
+//============================================================

+ 2057 - 0
npc/re/instances/OldGlastHeim.txt

@@ -0,0 +1,2057 @@
+//===== rAthena Script ======================================= 
+//= Old Glast Heim
+//===== By: ================================================== 
+//= Ziu, Heris (translation)
+//===== Current Version: ===================================== 
+//= 1.0
+//===== Compatible With: ===================================== 
+//= rAthena SVN
+//===== Description: ========================================= 
+//= Discover the history of events that took place in the
+//= Glast Heim castle and how it ended up in ruins.
+//===== Additional Comments: ================================= 
+//= 1.0 First version. [Euphy]
+//============================================================ 
+
+glast_01,204,273,6	script	Hugin#ghinstance	755,{
+	mes "^ff0000This isn't considered a normal progression dungeon. Please note this point.^000000";
+	next;
+	mes "[Hugin]";
+	mes "Huh? You feel like you have seen me in different places? I see. What can I say?";
+	next;
+	set .@ghins_time, checkquest(12317,PLAYTIME);
+	if (.@ghins_time == -1) {
+
+		set .@party_id,getcharid(1);
+		set .@p_name$,getpartyname(.@party_id);
+		set .@md_name$,"Old Glast Heim";
+
+		if (!instance_check_party(.@party_id,2)) {
+			//custom
+			mes "[Hugin]";
+			mes "Where are your party members?";
+			close;
+		}
+
+		if (getcharid(0) == getpartyleader(.@party_id,2))
+			set .@menu$, "Create the time gap.:Enter the Old Glast Heim.:Cancel.";
+		else
+			set .@menu$, ":Enter the Old Glast Heim.:Cancel.";
+		switch(select(.@menu$)) {
+		case 1:
+			if (instance_create(.@md_name$) < 0) {
+				mes "Party Name: "+.@p_name$;
+				mes "Party Leader: "+strcharinfo(0);
+				mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!";
+				close;
+			}
+			mes "[Hugin]";
+			mes "The time gap was created. When you're ready, talk to me again.";
+			close;
+		case 2:
+			switch(instance_enter(.@md_name$)) {
+			case 3:
+				mes "An unknown error has occurred.";
+				close;
+			case 2:
+				mes "The memorial dungeon "+.@md_name$+" does not exist.";
+				mes "The party leader did not generate the dungeon yet.";
+				close;
+			case 1:
+				mes "Only the registered members can enter the instance "+.@md_name$+".";
+				close;
+			case 0:
+				mapannounce "glast_01",strcharinfo(0)+", member of the party "+.@p_name$+" entered the instance "+.@md_name$+".",bc_map,"0x00ff99";
+				setquest 12317;
+				setquest 12318;
+				//warp "1@gl_k",150,20;
+				close;
+			}
+		case 3:
+			close;
+		}
+	} else if (.@ghins_time == 0 || .@ghins_time == 1) {
+		mes "[Hugin]";
+		mes "Oh, geez.";
+		mes "Your body is still under the effects of time travel. In this state, you will not be able to travel again.";
+		next;
+		mes "[Hugin]";
+		mes "You should rest and come back later for more.";
+		close;
+	} else {
+		mes "^0000ffOld Glast Heim access trail has been cleared. It is now possible to talk to Hugin.^000000";
+		erasequest 12317;
+		if (checkquest(12318) > -1) erasequest 12318;
+		if (checkquest(12319) > -1) erasequest 12319;
+		close;
+	}
+}
+
+// Floor 1
+//============================================================
+1@gl_k,149,41,6	script	Varmunt#ghinstance1	654,{
+	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+		mes "Hey ^0000ffguys^000000, were you sent here to help me?";
+		npctalk "Hey guys, were you sent here to help me?";
+		cutin "gl_barmund1",2;
+		next;
+		select("Oh. Well, about that...");
+		mes "["+strcharinfo(0)+"]";
+		mes "Oh yeah, hahaha, we were told to meet someone called Varmunt.";
+		unittalk getcharid(3),"Oh yeah, hahaha, we were told to meet someone called Varmunt.";
+		next;
+		mes "[Varmunt]";
+		mes "We don't have time. We must tell Sir Heinrich about Himmelmez's invasion.";
+		npctalk "We don't have time. We must tell Sir Heinrich about Himmelmez's invasion.";
+		cutin "gl_barmund2",2;
+		next;
+		select("What Himmelmez...");
+		mes "["+strcharinfo(0)+"]";
+		mes "Himmelmez? Who the hell is she?";
+		unittalk getcharid(3),"Himmelmez? Who the hell is she?";
+		next;
+		mes "[Varmunt]";
+		mes "Didn't anybody give you the basic informations?";
+		npctalk "Didn't anybody give you the basic informations?";
+		cutin "gl_barmund3",2;
+		next;
+		mes "[Varmunt]";
+		mes "The Valkyrie of the dead. She's after the Ymir's Heart pieces hidden here.";
+		npctalk "The Valkyrie of the dead. She's after the Ymir's Heart pieces hidden here";
+		cutin "gl_barmund2",2;
+		next;
+		mes "[Varmunt]";
+		mes "She's capable of destroying the whole castle for this purpose.";
+		npctalk "She's capable of destroying the whole castle for this purpose.";
+		next;
+		mes "[Varmunt]";
+		mes "Hurry up! Inform Sir Heinrich that Himmelmez is coming. I will briefly explore the enchantments she made to this place!";
+		npctalk "Hurry up! Inform Sir Heinrich that Himmelmez is coming. I will briefly explore the enchantments she made to this place!";
+		close2;
+		cutin "gl_barmund2",255;
+		donpcevent instance_npcname("Varmunt#ghinstance1")+"::OnDisable2";
+		end;
+	} else {
+		mes "[Varmunt]";
+		mes "Where is he? We";
+		mes "need his help.";
+		cutin "gl_barmund2",2;
+		close2;
+		cutin "gl_barmund2",255;
+		end;
+	}
+OnInstanceInit:
+	donpcevent instance_npcname("Varmunt#ghinstance1")+"::OnEnable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Varmunt#ghinstance1");
+	end;
+OnDisable2:
+	hideonnpc instance_npcname("Varmunt#ghinstance1");
+
+	for(set .@i,1; .@i<=20; set .@i,.@i+4) {
+		hideoffnpc instance_npcname("Khalitzburg Crusader#"+.@i);
+		hideoffnpc instance_npcname("Khalitzburg Crusader#"+(.@i+1));
+		hideoffnpc instance_npcname("White Knight#"+(.@i+2));
+		hideoffnpc instance_npcname("White Knight#"+(.@i+3));
+	}
+	hideoffnpc instance_npcname("Khalitzburg Crusader#21");
+	hideoffnpc instance_npcname("Khalitzburg Crusader#22");
+
+	hideoffnpc instance_npcname("Heinrich#ghinstance1");
+	hideoffnpc instance_npcname("Varmunt#ghinstance2");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Varmunt#ghinstance1");
+	end;
+}
+
+1@gl_k,145,54,6	script	Khalitzburg Crusader#1	655,{
+	mes "["+strnpcinfo(1)+"]";
+	switch((atoi(strnpcinfo(2)) + 1) / 2) {
+		case 1: mes "Would I be recruited?"; break;
+		case 2: mes "May I help you?"; break;
+		case 3: mes "..."; break;
+		case 4: mes "I do not like to chit-chat during work."; break;
+		case 5: mes "The aura of the castle has changed, don't you think? Something like a presence seemed to appear a little while ago."; break;
+		case 6: mes "I wonder what commandant Varmunt is doing. I heard people are running away..."; break;
+		case 7: mes "Quiet please."; break;
+		case 8: mes "A fuss seems to be near."; break;
+		case 9: mes "A dream last night really bothered me. My mother used to say that these dreams may come true..."; break;
+		case 10: mes "Is Varmunt going with you? The commandant is waiting for you."; break;
+		case 11: mes "Soon it's time to change shifts. I wonder what happened to the other knights."; break;
+	}
+	close;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0))+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname(strnpcinfo(0));
+	end;
+OnEnable:
+	hideoffnpc instance_npcname(strnpcinfo(0));
+	end;
+}
+1@gl_k,154,54,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#2	655
+1@gl_k,145,59,6	duplicate(Khalitzburg Crusader#1)	White Knight#3	657
+1@gl_k,154,59,3	duplicate(Khalitzburg Crusader#1)	White Knight#4	657
+1@gl_k,145,64,6	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#5	655
+1@gl_k,154,64,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#6	655
+1@gl_k,145,69,6	duplicate(Khalitzburg Crusader#1)	White Knight#7	657
+1@gl_k,154,69,3	duplicate(Khalitzburg Crusader#1)	White Knight#8	657
+1@gl_k,145,74,6	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#9	655
+1@gl_k,154,74,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#10	655
+1@gl_k,145,79,6	duplicate(Khalitzburg Crusader#1)	White Knight#11	657
+1@gl_k,154,79,3	duplicate(Khalitzburg Crusader#1)	White Knight#12	657
+1@gl_k,145,84,6	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#13	655
+1@gl_k,154,84,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#14	655
+1@gl_k,145,89,6	duplicate(Khalitzburg Crusader#1)	White Knight#15	657
+1@gl_k,154,89,3	duplicate(Khalitzburg Crusader#1)	White Knight#16	657
+1@gl_k,145,94,6	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#17	655
+1@gl_k,154,94,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#18	655
+1@gl_k,145,99,6	duplicate(Khalitzburg Crusader#1)	White Knight#19	657
+1@gl_k,154,99,3	duplicate(Khalitzburg Crusader#1)	White Knight#20	657
+1@gl_k,145,104,6	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#21	655
+1@gl_k,154,104,3	duplicate(Khalitzburg Crusader#1)	Khalitzburg Crusader#22	655
+
+1@gl_k,149,100,6	script	Heinrich#ghinstance1	652,{
+	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+		cutin "gl_heinrich2",2;
+		select("Heinrich, about the castle...");
+		mes "["+strcharinfo(0)+"]";
+		mes "Do you know what is happening now in the castle, Heinrich?";
+		unittalk getcharid(3),"Do you know what is happening now in the castle, Heinrich?";
+		next;
+		mes "[Heinrich]";
+		mes "You are the adventurers who have come with Varmunt, right?";
+		npctalk "You are the adventurers who have come with Varmunt, right?";
+		next;
+		mes "[Heinrich]";
+		mes "What can I do for you? Is there something wrong?";
+		npctalk "What can I do for you? Is there something wrong?";
+		next;
+		select("The Ymir's Heart. Himmelmez...");
+		mes "["+strcharinfo(0)+"]";
+		mes "Himmelmez, the Valkyrie of the dead is looking to get a piece of the Ymir's heart hidden in the castle!";
+		unittalk getcharid(3),"Himmelmez, the Valkyrie of the dead is looking to get a piece of the Ymir's heart hidden in the castle";
+		next;
+		mes "[Heinrich]";
+		mes "Haha. That's a nice joke. Now tell me what brings you here.";
+		npctalk "Haha. That's a nice joke. Now tell me what brings you here.";
+		cutin "gl_heinrich1",2;
+		next;
+		mes "[Varmunt]";
+		mes "I am not joking Heinrich, Sir. Now, if my judgement is correct, she will be here soon.";
+		donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk1";
+		cutin "gl_barmund2",2;
+		next;
+		mes "[Varmunt]";
+		mes "I trust this guy following me. The Ymir's Heart pieces must be hidden in a safe place before Himmelmez takes them!";
+		donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk2";
+		next;
+		select("Even if you do not believe...");
+		mes "["+strcharinfo(0)+"]";
+		mes "Even if you don't believe it, do something. We do not have much time!";
+		unittalk getcharid(3),"Even if you don't believe it, do something. We do not have much time!";
+		cutin "gl_barmund2",255;
+		next;
+		mes "[Heinrich]";
+		mes "I will be glad if you give me two minutes, please. But now the king isn't in his room.";
+		npctalk "I will be glad if you give me two minutes, please. But now the king isn't in his room.";
+		cutin "gl_heinrich1",2;
+		next;
+		mes "[Heinrich]";
+		mes "But I think that with such a busy agenda, he won't be able to take care of this.";
+		npctalk "But I think that with such a busy agenda, he won't be able to take care of this.";
+		donpcevent instance_npcname("Heinrich#ghinstance1")+"::OnDisable";
+		donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnEnable";
+		donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnEnable";
+		donpcevent instance_npcname("#talkinstance1")+"::OnEnable";
+		mapannounce instance_mapname("1@gl_k"), "???? Shout: Ohohohoho~!",bc_map,"0xFFFF00";
+		close2;
+		cutin "gl_heinrich1",255;
+		end;
+	} else {
+		mes "[Heinrich]";
+		mes "Where is your representative?";
+		mes "I need to talk to him.";
+		cutin "gl_heinrich2",2;
+		close2;
+		cutin "gl_heinrich2",255;
+		end;
+	}
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance1")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance1");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance1");
+	end;
+}
+
+1@gl_k,152,97,3	script	Varmunt#ghinstance2	654,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Varmunt#ghinstance2");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Varmunt#ghinstance2");
+	end;
+OnTalk1:
+	npctalk "I am not joking Heinrich, Sir. Now, if my judgement is correct, she will be here soon.";
+	end;
+OnTalk2:
+	npctalk "I trust this guy following me. The Ymir's Heart pieces must be hidden in a safe place before Himmelmez takes them!";
+	end;
+OnTalk3:
+	npctalk "Himmelmez!! Through the cracks!";
+	end;
+OnTalk4:
+	npctalk "Unbelievable. My men are...This kind of thing is not possible!";
+	end;
+OnTalk5:
+	npctalk "Heinrich, Sir! I need a quick decision.";
+	end;
+OnTalk6:
+	npctalk "To prevent other attacks, go chase her!";
+	end;
+OnTalk7:
+	npctalk "Now, your help is desperately needed. I hopefully ask you.";
+	end;
+}
+
+1@gl_k,149,97,6	script	Heinrich#ghinstance2	652,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance2");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance2");
+	end;
+OnTalk1:
+	npctalk "Who?!";
+	end;
+OnTalk2:
+	npctalk "That who rules the dead? No doubt, a pretty story. Here, some tea will be served to entertain the ladies. Unfortunately, I do not...";
+	end;
+OnTalk3:
+	npctalk "What did you say?";
+	end;
+OnTalk4:
+	npctalk "The King responded to the invitation of the Rune Midgard's Royal Family and hasn't come back yet.";
+	end;
+OnTalk5:
+	npctalk "Just leave before you get in trouble. This is the King's will!";
+	end;
+OnTalk6:
+	npctalk "Damn! She has detected the position of the Ymir's Heart pieces.";
+	end;
+OnTalk7:
+	npctalk "Now, Khalitzburg Crusaders and White Knights, follow me...";
+	end;
+OnTalk8:
+	npctalk "Unbelievable. My men are...This kind of thing is not possible!";
+	end;
+OnTalk9:
+	npctalk "I'm sorry...";
+	end;
+OnTalk10:
+	npctalk "I'm sorry, my lord! Do not forgive me!";
+	end;
+}
+
+1@gl_k,149,100,6	script	Heinrich#ghinstance3	652,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance3");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance3");
+	end;
+OnTalk1:
+	npctalk "I cannot believe I killed my men with my own hands!";
+	end;
+OnTalk2:
+	npctalk "Varmunt is right about that. Now is not the time to regret.";
+	end;
+OnTalk3:
+	npctalk "People, gather around and follow my orders.";
+	end;
+OnTalk4:
+	npctalk "Himmelmez is turning into monsters all the people she put to sleep.";
+	end;
+OnTalk5:
+	npctalk "I don't know if there are survivors around here yet.";
+	end;
+OnTalk6:
+	npctalk "If there are survivors from this evil thing, please rescue them.";
+	end;
+OnTalk7:
+	npctalk "With Varmunt by my side, I'm going to chase Himmelmez down.";
+	end;
+OnTalk8:
+	npctalk "Hurry up Varmunt, let's chase her down.";
+	end;
+}
+
+1@gl_k,149,89,1	script	Himmelmez#ghinstance1	650,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Himmelmez#ghinstance1");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Himmelmez#ghinstance1");
+	end;
+OnTalk1:
+	npctalk "This~ Did I interrupt your conversation? The thing is, it's been too long since the last guests saw some sadness spread...";
+	end;
+OnTalk2:
+	npctalk "My name is Lisa Kahn Himmelmez. I am called the Valkyrie of the dead, master of the Dullahan.";
+	end;
+OnTalk3:
+	npctalk "There's no need to pretend to be so laid back. Don't bluff about the whereabouts of you Majesty and things will be alright.";
+	end;
+OnTalk4:
+	npctalk "Hohoho, do you have any questions? You're a really mysterious man.";
+	end;
+OnTalk5:
+	npctalk "Not coveting the king's throne, you're such a stupid man, only waiting for his return. Your innocence is true, I love it.";
+	end;
+Ontalk6:
+	npctalk "You make me wish we hadn't met in this situation. Too bad we did.";
+	end;
+Ontalk7:
+	npctalk "Well~ Today, with such a busy commandant, I won't be able to talk as much as I'd love for you to contemplate my explanation~";
+	end;
+OnTalk8:
+	npctalk "I gotta get my job done. Meanwhile why don't you meet my men? Hohoho.";
+	end;
+}
+
+// Control Timer
+//============================================================
+1@gl_k,0,0,0	script	#talkinstance1	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#talkinstance1")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#talkinstance1");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#talkinstance1");
+	initnpctimer;
+	end;
+OnTimer5000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk1";
+	end;
+OnTimer10000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk1";
+	end;
+OnTimer15000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk3";
+	end;
+OnTimer20000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk2";
+	end;
+OnTimer25000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk2";
+	end;
+OnTimer30000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk3";
+	end;
+OnTimer35000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk3";
+	end;
+OnTimer45000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk4";
+	end;	
+OnTimer50000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk5";
+	end;
+OnTimer55000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk6";
+	end;
+OnTimer60000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk4";
+	end;
+OnTimer65000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk5";
+	end;
+OnTimer70000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk7";
+	end;
+OnTimer75000:
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnTalk8";
+	end;
+OnTimer80000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk6";
+	donpcevent instance_npcname("Himmelmez#ghinstance1")+"::OnDisable";
+	end;
+OnTimer85000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk7";
+	hideonnpc instance_npcname("Varmunt#ghinstance1");
+
+	for(set .@i,1; .@i<=20; set .@i,.@i+4) {
+		hideonnpc instance_npcname("Khalitzburg Crusader#"+.@i);
+		hideonnpc instance_npcname("Khalitzburg Crusader#"+(.@i+1));
+		hideonnpc instance_npcname("White Knight#"+(.@i+2));
+		hideonnpc instance_npcname("White Knight#"+(.@i+3));
+	}
+	hideonnpc instance_npcname("Khalitzburg Crusader#21");
+	hideonnpc instance_npcname("Khalitzburg Crusader#22");
+
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#talkinstance1")+"::OnMyMobDead"; 
+	monster .@map$,145,59,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,154,59,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,145,69,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,154,69,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,145,79,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,154,79,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,145,89,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,154,89,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,145,99,"Abyss Knight",2470,1,.@label$;
+	monster .@map$,154,99,"Abyss Knight",2470,1,.@label$;
+
+	for(set .@i,1; .@i<=22; set .@i,.@i+1)
+		hideoffnpc instance_npcname(".#ghinstance"+.@i);
+
+	donpcevent instance_npcname(".#ghinstance22")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance21")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance18")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance17")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance14")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance13")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance10")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance9")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance6")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance5")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance2")+"::OnTalkK";
+	donpcevent instance_npcname(".#ghinstance1")+"::OnTalkK";
+	end;
+OnTimer88000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk8";
+
+	for(set .@i,1; .@i<=20; set .@i,.@i+4) {
+		hideonnpc instance_npcname(".#ghinstance"+.@i);
+		hideonnpc instance_npcname(".#ghinstance"+(.@i+1));
+		disablenpc instance_npcname(".#ghinstance"+(.@i+2));
+		disablenpc instance_npcname(".#ghinstance"+(.@i+3));
+	}
+	hideonnpc instance_npcname(".#ghinstance21");
+	hideonnpc instance_npcname(".#ghinstance22");
+
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#talkinstance1")+"::OnMyMobDead"; 
+	monster .@map$,145,54,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,54,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,145,64,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,64,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,145,74,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,74,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,145,84,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,84,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,145,94,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,94,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,145,104,"Khalitzburg",2471,1,.@label$;
+	monster .@map$,154,104,"Khalitzburg",2471,1,.@label$;
+	end;
+OnTimer93000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk4";
+	end;
+OnTimer97000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk9";
+	end;
+OnTimer105000:
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnTalk10";
+	mapannounce instance_mapname("1@gl_k"), "Heinrich's Shout: Dead men, dead men all over the place!",bc_map,"0xFFFF00";
+	end;
+OnTimer107000:
+	mapannounce instance_mapname("1@gl_k"), "Heinrich's Shout: Everybody! Go back!",bc_map,"0xFFFF00";
+	end;
+OnTimer110000:
+	donpcevent instance_npcname(".#ghinstance22")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance21")+"::OnEffect1";
+	end;
+OnTimer110500:
+	enablenpc instance_npcname(".#ghinstance20");
+	enablenpc instance_npcname(".#ghinstance19");
+	donpcevent instance_npcname(".#ghinstance20")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance19")+"::OnEffect1";
+	end;
+OnTimer111000:
+	donpcevent instance_npcname(".#ghinstance18")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance17")+"::OnEffect1";
+	end;
+OnTimer111500:
+	enablenpc instance_npcname(".#ghinstance16");
+	enablenpc instance_npcname(".#ghinstance15");
+	donpcevent instance_npcname(".#ghinstance16")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance15")+"::OnEffect1";
+	end;
+OnTimer112000:
+	donpcevent instance_npcname(".#ghinstance14")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance13")+"::OnEffect1";
+	end;
+OnTimer112500:
+	enablenpc instance_npcname(".#ghinstance12");
+	enablenpc instance_npcname(".#ghinstance11");
+	donpcevent instance_npcname(".#ghinstance12")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance11")+"::OnEffect1";
+	end;
+OnTimer113000:
+	donpcevent instance_npcname(".#ghinstance10")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance9")+"::OnEffect1";
+	end;
+OnTimer113500:
+	enablenpc instance_npcname(".#ghinstance8");
+	enablenpc instance_npcname(".#ghinstance7");
+	donpcevent instance_npcname(".#ghinstance8")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance7")+"::OnEffect1";
+	end;
+OnTimer114000:
+	donpcevent instance_npcname(".#ghinstance6")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance5")+"::OnEffect1";
+	end;
+OnTimer114500:
+	enablenpc instance_npcname(".#ghinstance4");
+	enablenpc instance_npcname(".#ghinstance3");
+	donpcevent instance_npcname(".#ghinstance4")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance3")+"::OnEffect1";
+	end;
+OnTimer114750: //custom time
+	disablenpc instance_npcname(".#ghinstance3");
+	disablenpc instance_npcname(".#ghinstance4");
+	disablenpc instance_npcname(".#ghinstance7");
+	disablenpc instance_npcname(".#ghinstance8");
+	disablenpc instance_npcname(".#ghinstance11");
+	disablenpc instance_npcname(".#ghinstance12");
+	disablenpc instance_npcname(".#ghinstance15");
+	disablenpc instance_npcname(".#ghinstance16");
+	disablenpc instance_npcname(".#ghinstance19");
+	disablenpc instance_npcname(".#ghinstance20");
+	end;
+OnTimer115000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnEnable";
+	donpcevent instance_npcname("Heinrich#ghinstance2")+"::OnDisable";
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk1";
+	donpcevent instance_npcname(".#ghinstance2")+"::OnEffect1";
+	donpcevent instance_npcname(".#ghinstance1")+"::OnEffect1";
+	killmonster instance_mapname("1@gl_k"),instance_npcname("#talkinstance1")+"::OnMyMobDead";
+	end;
+OnTimer120000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk5";
+	end;
+OnTimer125000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk6";
+	end;
+OnTimer130000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk2";
+	end;
+OnTimer135000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk3";
+	end;
+OnTimer140000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk4";
+	end;
+OnTimer145000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk5";
+	end;
+OnTimer150000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk6";
+	end;
+OnTimer155000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk7";
+	end;
+OnTimer160000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnTalk7";
+	end;
+OnTimer165000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnTalk8";
+	end;
+OnTimer167000:
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnDisable";
+	end;
+OnTimer168000:
+	donpcevent instance_npcname("Varmunt#ghinstance2")+"::OnDisable";
+	donpcevent instance_npcname("Heinrich#ghinstance3")+"::OnDisable";
+	stopnpctimer;
+	donpcevent instance_npcname("#ghinstancewarp1")+"::OnEnable";
+	donpcevent instance_npcname("#ghinstancewarp2")+"::OnEnable";
+	mapannounce instance_mapname("1@gl_k"), "9 o'clock warp leading to zone 2 is now open.",bc_map,"0xFFFF00";
+	donpcevent instance_npcname("#talkinstance1")+"::OnDisable";
+	donpcevent instance_npcname("#ghmemorialmob01")+"::OnEnable";
+	end;
+OnMyMobDead:
+	end;
+}
+
+1@gl_k,145,54,6	script	.#ghinstance1	2471,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0))+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname(strnpcinfo(0));
+	end;
+OnEnable:
+	hideoffnpc instance_npcname(strnpcinfo(0));
+	end;
+OnEffect1:
+	specialeffect EF_GRANDCROSS;
+	specialeffect EF_LEXAETERNA;
+	end;
+OnTalkK:
+	switch(atoi(replacestr(strnpcinfo(2),"ghinstance",""))) {
+		case 1: npctalk "I do not want to die."; break;
+		case 2: npctalk "Mom..."; break;
+		case 5: npctalk "Help."; break;
+		case 6: npctalk "My stomach hurts..."; break;
+		case 9: npctalk "Heinrich Sir, help!"; break;
+		case 10: npctalk "Ack... Ugh."; break;
+		case 13: npctalk "I'm thirsty."; break;
+		case 14: npctalk "Oh... No... I cannot die..."; break;
+		case 17: npctalk "This is so uncomfortable. Eww!"; break;
+		case 18: npctalk "Who am I..."; break;
+		case 21: npctalk "Uhh... My body."; break;
+		case 22: npctalk "I'm so thirsty!"; break;
+	}
+	end;
+}
+1@gl_k,154,54,3	duplicate(.#ghinstance1)	.#ghinstance2	2471
+1@gl_k,145,64,6	duplicate(.#ghinstance1)	.#ghinstance5	2471
+1@gl_k,154,64,3	duplicate(.#ghinstance1)	.#ghinstance6	2471
+1@gl_k,145,74,6	duplicate(.#ghinstance1)	.#ghinstance9	2471
+1@gl_k,154,74,3	duplicate(.#ghinstance1)	.#ghinstance10	2471
+1@gl_k,145,84,6	duplicate(.#ghinstance1)	.#ghinstance13	2471
+1@gl_k,154,84,3	duplicate(.#ghinstance1)	.#ghinstance14	2471
+1@gl_k,145,94,6	duplicate(.#ghinstance1)	.#ghinstance17	2471
+1@gl_k,154,94,3	duplicate(.#ghinstance1)	.#ghinstance18	2471
+1@gl_k,145,104,6	duplicate(.#ghinstance1)	.#ghinstance21	2471
+1@gl_k,154,104,3	duplicate(.#ghinstance1)	.#ghinstance22	2471
+
+1@gl_k,145,59,6	script	.#ghinstance3	111,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0))+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname(strnpcinfo(0));
+	end;
+OnEnable:
+	hideoffnpc instance_npcname(strnpcinfo(0));
+	end;
+OnEffect1:
+	specialeffect EF_GRANDCROSS;
+	specialeffect EF_LEXAETERNA;
+	end;
+}
+1@gl_k,154,59,3	duplicate(.#ghinstance3)	.#ghinstance4	111
+1@gl_k,145,69,6	duplicate(.#ghinstance3)	.#ghinstance7	111
+1@gl_k,154,69,3	duplicate(.#ghinstance3)	.#ghinstance8	111
+1@gl_k,145,79,6	duplicate(.#ghinstance3)	.#ghinstance11	111
+1@gl_k,154,79,3	duplicate(.#ghinstance3)	.#ghinstance12	111
+1@gl_k,145,89,6	duplicate(.#ghinstance3)	.#ghinstance15	111
+1@gl_k,154,89,3	duplicate(.#ghinstance3)	.#ghinstance16	111
+1@gl_k,145,99,6	duplicate(.#ghinstance3)	.#ghinstance19	111
+1@gl_k,154,99,3	duplicate(.#ghinstance3)	.#ghinstance20	111
+
+1@gl_k,96,80,0	script	#ghinstancewarp1	45,1,2,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0))+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname(strnpcinfo(0));
+	end;
+OnEnable:
+	enablenpc instance_npcname(strnpcinfo(0));
+	end;
+OnTouch:
+	set .@map1$, instance_mapname("1@gl_k");
+	set .@map2$, instance_mapname("2@gl_k");
+	switch(atoi(replacestr(strnpcinfo(2),"ghinstancewarp",""))) {
+		case 1: warp .@map1$,80,80; break;
+		case 2: warp .@map1$,105,80; break;
+		case 3: warp .@map1$,215,79; break;
+		case 4: warp .@map1$,195,79; break;
+		case 5: warp .@map1$,215,216; break;
+		case 6: warp .@map1$,235,216; break;
+		case 7: warp .@map2$,150,46; break;
+		case 8: warp .@map2$,126,123; break;
+		case 9: warp .@map2$,150,116; break;
+		case 10: warp .@map2$,174,101; break;
+		case 11: warp .@map2$,150,110; break;
+		case 12: warp .@map2$,150,179; break;
+	}
+	end;
+}
+1@gl_k,90,80,0	duplicate(#ghinstancewarp1)	#ghinstancewarp2	45,1,2
+1@gl_k,202,79,0	duplicate(#ghinstancewarp1)	#ghinstancewarp3	45,1,2
+1@gl_k,206,79,0	duplicate(#ghinstancewarp1)	#ghinstancewarp4	45,1,2
+1@gl_k,228,216,0	duplicate(#ghinstancewarp1)	#ghinstancewarp5	45,1,2
+1@gl_k,222,216,0	duplicate(#ghinstancewarp1)	#ghinstancewarp6	45,1,2
+1@gl_k,150,284,0	duplicate(#ghinstancewarp1)	#ghinstancewarp7	45,1,2
+2@gl_k,145,123,0	duplicate(#ghinstancewarp1)	#ghinstancewarp8	45,1,2
+2@gl_k,136,122,0	duplicate(#ghinstancewarp1)	#ghinstancewarp9	45,1,2
+2@gl_k,154,101,0	duplicate(#ghinstancewarp1)	#ghinstancewarp10	45,1,2
+2@gl_k,165,101,0	duplicate(#ghinstancewarp1)	#ghinstancewarp11	45,1,2
+2@gl_k,150,163,0	duplicate(#ghinstancewarp1)	#ghinstancewarp12	45,1,2
+
+
+// Sector 1 Mobs
+//============================================================
+1@gl_k,0,0,0	script	#ghmemorialmob01	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob01")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob01");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob01");
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob01")+"::OnMyMobDead";
+	areamonster .@map$,76,99,87,10,"Suffering Chamberlain",2466,15,.@label$;
+	areamonster .@map$,67,39,12,6,"Fallen Monk",2465,20,.@label$;
+	areamonster .@map$,67,39,12,6,"Suffering Chamberlain",2466,3,.@label$;
+	areamonster .@map$,32,75,51,58,"Decayed Butler",2464,6,.@label$;
+	areamonster .@map$,45,84,6,137,"Decayed Butler",2464,12,.@label$;
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob01")+"::OnMyMobDead";
+	set .@mob_dead_num, 56 - mobcount(.@map$,.@label$);
+	if (.@mob_dead_num > 35) {
+		mapannounce .@map$, "Seems like Himmelmez drains the dead's souls. They must be destroyed.",bc_map,"0xFFFFFF";
+		killmonster .@map$,.@label$;
+		donpcevent instance_npcname("Aspiring Butcher#clearGH")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob01")+"::OnDisable";
+	}
+	end;
+}
+
+1@gl_k,17,51,3	script	Aspiring Butcher#clearGH	706,{
+	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+		mes "[Aspiring Butcher]";
+		mes "Help me! Help me!!!";
+		next;
+		select("Hey, wake up! Are there any other survivors?");
+		mes "["+strcharinfo(0)+"]";
+		mes "Hey, wake up! Are you alone?";
+		unittalk getcharid(3),"Hey, wake up! Are you alone?";
+		next;
+		mes "[Aspiring Butcher]";
+		mes "The Chamberlain... the Monk... They've become monsters. I couldn't do anything.";
+		npctalk "The Chamberlain... the Monk... They've become monsters. I couldn't do anything.";
+		next;
+		mes "[Aspiring Butcher]";
+		mes "I just stood still... Nothing, I couldn't do anything...";
+		npctalk "I just stood still... Nothing, I couldn't do anything...";
+		next;
+		select("Wake up!");
+		mes "["+strcharinfo(0)+"]";
+		mes "Wake up kid! Go east along the central passage to the outside! The path is safe!";
+		unittalk getcharid(3),"Wake up kid! Go east along the central passage to the outside! The path is safe!";
+		next;
+		mes "[Aspiring Butcher]";
+		mes "East passage? Alone? How?";
+		npctalk "East passage? Alone? How?";
+		next;
+		select("I can guide you through the path.");
+		mes "["+strcharinfo(0)+"]";
+		mes "I will guide you, perhaps that will help. If you want to close your eyes try not to hit anything.";
+		unittalk getcharid(3),"I will guide you, perhaps that will help. If you want to close your eyes try not to hit anything.";
+		next;
+		mes "[Aspiring Butcher]";
+		mes "Aspiring Butcher: I know, I... I'm trying to.";
+		npctalk "Aspiring Butcher: I know, I... I'm trying to.";
+		donpcevent instance_npcname("Aspiring Butcher#clearGH")+"::OnDisable";
+		donpcevent instance_npcname("#ghmemorialmob02")+"::OnEnable";
+		close;
+	} else {
+		mes "[Aspiring Butcher]";
+		mes "Somebody help me, somebody help me, please.";
+		close;
+	}
+OnInstanceInit:
+	donpcevent instance_npcname("Aspiring Butcher#clearGH")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Aspiring Butcher#clearGH");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Aspiring Butcher#clearGH");
+	end;
+}
+
+// Sector 2 Mobs
+//============================================================
+1@gl_k,291,145,3	script	Hollgrehenn Destroyer	726,{
+	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+		mes "[Hollgrehenn Destroyer]";
+		mes "Yaaa!! Die!!!";
+		npctalk "Yaaa!! Die!!!";
+		specialeffect EF_CRASHEARTH;
+		next;
+		select("Don't worry!");
+		mes "["+strcharinfo(0)+"]";
+		mes "Don't worry! Mam. Are you alone? No other survivors?";
+		unittalk getcharid(3),"Don't worry! Mam. Are you alone? No other survivors?";
+		next;
+		mes "[Hollgrehenn Destroyer]";
+		mes "I'm the only survivor left";
+		npctalk "I'm the only survivor left";
+		next;
+		select("This is a very dangerous place.");
+		mes "["+strcharinfo(0)+"]";
+		mes "This is a very dangerous place. You know the central passage? Do you think you can move... and get to a safer place?";
+		unittalk getcharid(3),"This is a very dangerous place. You know the central passage? Do you think you can move... and get to a safer place?";
+		next;
+		mes "[Hollgrehenn Destroyer]";
+		mes "Yes, I am able to move. I'll move for my baby's sake.";
+		npctalk "Yes, I am able to move. I'll move for my baby's sake.";
+		next;
+		select("Survive the road...");
+		mes "["+strcharinfo(0)+"]";
+		mes "You and your baby will get out of here safely. But I'm sorry I can't help you more.";
+		unittalk getcharid(3),"You and your baby will get out of here safely. But I'm sorry I can't help you more.";
+		next;
+		mes "[Hollgrehenn Destroyer]";
+		mes "That's ok. Thank you for helping us. I'm good to go alone. Ah and good luck also.";
+		npctalk "That's ok. Thank you for helping us. I'm good to go alone. Ah and good luck also.";
+		donpcevent instance_npcname("Hollgrehenn Destroyer")+"::OnDisable";
+		donpcevent instance_npcname("#ghmemorialmob03")+"::OnEnable";
+		close;
+	} else {
+		mes "[Hollgrehenn Destroyer]";
+		mes "Somebody help me, somebody help me, please";
+		close;
+	}
+OnInstanceInit:
+	donpcevent instance_npcname("Hollgrehenn Destroyer")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Hollgrehenn Destroyer");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Hollgrehenn Destroyer");
+	end;
+}
+
+1@gl_k,0,0,0	script	#ghmemorialmob02	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob02")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob02");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob02");
+	donpcevent instance_npcname("#ghinstancewarp3")+"::OnEnable";
+	donpcevent instance_npcname("#ghinstancewarp4")+"::OnEnable";
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob02")+"::OnMyMobDead";
+	mapannounce .@map$,"3 o'clock warp leading to zone 3 is now open.",bc_map,"0xFFFF00";
+	areamonster .@map$,241,113,291,19,"Suffering Chamberlain",2466,12,.@label$;
+	areamonster .@map$,241,113,291,19,"Decayed Monk",2464,12,.@label$;
+	areamonster .@map$,227,217,291,135,"Suffering Chamberlain",2466,12,.@label$;
+	areamonster .@map$,227,217,291,135,"Decayed Monk",2464,12,.@label$;
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob02")+"::OnMyMobDead";
+	set .@mob_dead_num, 48 - mobcount(.@map$,.@label$);
+	if (.@mob_dead_num > 28) {
+		mapannounce .@map$, "Seems like Himmelmez drains the dead's souls. They must be destroyed.",bc_map,"0xFFFFFF";
+		killmonster .@map$,.@label$;
+		donpcevent instance_npcname("Hollgrehenn Destroyer")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob02")+"::OnDisable";
+	}
+	end;
+}
+
+// Tramp Mobs
+//============================================================
+1@gl_k,221,82,3	script	Breathless Man#GHtramp1	849,4,4,{
+	end;
+OnTouch:
+	set .@i, rand(1,10);
+	if (.@i == 1) set .@mobs,3;
+	else if (.@i == 2) set .@mobs,4;
+	else if (.@i == 3) set .@mobs,5;
+	else if (.@i < 7) set .@mobs,6;
+	else set .@mobs,7;
+	getmapxy(.@map$,.@x,.@y,1);
+	specialeffect EF_VENOMDUST;
+	monster .@map$,.@x,.@y,"Muck Worm",2467,.@mobs,instance_npcname(strnpcinfo(0))+"::OnMyMobDead";
+	disablenpc instance_npcname(strnpcinfo(0));
+	end;
+OnMyMobDead:
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0))+"::OnEnable";
+	end;
+OnEnable:
+	enablenpc instance_npcname(strnpcinfo(0));
+	end;
+OnDisable:
+	disablenpc instance_npcname(strnpcinfo(0));
+	end;
+}
+1@gl_k,213,63,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp2	849,4,4
+1@gl_k,230,50,2	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp3	849,4,4
+1@gl_k,222,39,2	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp4	849,4,4
+1@gl_k,214,27,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp5	849,4,4
+1@gl_k,223,17,2	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp6	849,4,4
+1@gl_k,235,16,4	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp7	849,4,4
+1@gl_k,251,20,5	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp8	849,4,4
+1@gl_k,240,43,5	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp9	849,4,4
+1@gl_k,271,19,1	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp10	849,4,4
+1@gl_k,246,62,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp11	849,4,4
+1@gl_k,282,48,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp12	849,4,4
+1@gl_k,285,81,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp13	849,4,4
+1@gl_k,241,86,5	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp14	849,4,4
+1@gl_k,249,101,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp15	849,4,4
+1@gl_k,276,106,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp16	849,4,4
+1@gl_k,252,120,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp17	849,4,4
+1@gl_k,258,150,1	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp18	849,4,4
+1@gl_k,255,157,6	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp19	849,4,4
+1@gl_k,261,164,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp20	849,4,4
+1@gl_k,269,173,7	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp21	849,4,4
+1@gl_k,280,167,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp22	849,4,4
+1@gl_k,293,161,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp23	849,4,4
+1@gl_k,226,96,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp24	849,4,4
+1@gl_k,222,119,5	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp25	849,4,4
+1@gl_k,233,123,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp26	849,4,4
+2@gl_k,147,203,5	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp27	849,4,4
+2@gl_k,141,222,1	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp28	849,4,4
+2@gl_k,167,225,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp29	849,4,4
+2@gl_k,145,236,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp30	849,4,4
+2@gl_k,143,260,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp31	849,4,4
+2@gl_k,173,258,3	duplicate(Breathless Man#GHtramp1)	Breathless Man#GHtramp32	849,4,4
+
+// Sector 3 Mobs
+//============================================================
+1@gl_k,0,0,0	script	#ghmemorialmob03	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob03")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob03");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob03");
+	donpcevent instance_npcname("#ghinstancewarp5")+"::OnEnable";
+	donpcevent instance_npcname("#ghinstancewarp6")+"::OnEnable";
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob03")+"::OnMyMobDead";
+	mapannounce .@map$,"12 o'clock warp leading to the zone 4 was opened.",bc_map,"0xFFFF00";
+	areamonster .@map$,17,259,53,180,"Decayed Guard",2468,11,.@label$;
+	areamonster .@map$,17,259,53,180,"Sharpshooter Ranger",2469,14,.@label$;
+	areamonster .@map$,62,281,73,186,"Decayed Guard",2468,11,.@label$;
+	areamonster .@map$,62,281,73,186,"Sharpshooter Ranger",2469,14,.@label$;
+	areamonster .@map$,74,251,109,224,"Decayed Guard",2468,11,.@label$;
+	areamonster .@map$,74,251,109,224,"Sharpshooter Ranger",2469,14,.@label$;
+	areamonster .@map$,108,281,231,234,"Decayed Guard",2468,11,.@label$;
+	areamonster .@map$,108,281,231,234,"Sharpshooter Ranger",2469,14,.@label$;
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("1@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob03")+"::OnMyMobDead";
+	set .@mob_dead_num, 100 - mobcount(.@map$,.@label$);
+	if (.@mob_dead_num > 85) {
+		mapannounce .@map$,"Himmelmez: Nice parry. I thought you were going to die slowly surrounded by the dead I summoned~",bc_map,"0xFFFFFF";
+		killmonster .@map$,.@label$;
+		donpcevent instance_npcname("#GHMclear3")+"::OnEnable";
+		donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnEnable";
+		donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnEnable";
+		donpcevent instance_npcname("Varmunt#ghinstance3")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob03")+"::OnDisable";
+	}
+	end;
+}
+
+// 1st MVP
+//============================================================
+1@gl_k,0,0,0	script	#ghmemorialmob04	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob04")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob04");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob04");
+	monster instance_mapname("1@gl_k"),150,258,"Root of Corruption",2475,1,instance_npcname("#ghmemorialmob04")+"::OnMyMobDead";
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("1@gl_k");
+	if (mobcount(.@map$,instance_npcname("#ghmemorialmob04")+"::OnMyMobDead") < 1) {
+		mapannounce .@map$, "12 o'clock warp leading to the Chivalry's Second Floor is now open.",bc_map,"0xFFFF00";
+		donpcevent instance_npcname("#ghinstancewarp7")+"::OnEnable";
+		donpcevent instance_npcname("Varmunt#ghinstance3")+"::OnTalk2";
+		donpcevent instance_npcname("#effectGH01")+"::OnEnable";
+		donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnEnable";
+		donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob04")+"::OnDisable";
+	}
+	end;
+}
+
+1@gl_k,150,257,3	script	#GHMclear3	111,9,9,{
+	end;
+OnTouch:
+	donpcevent instance_npcname("#controlGH3")+"::OnEnable";
+	specialeffect EF_BASH;
+	donpcevent instance_npcname("#GHMclear3")+"::OnDisable";
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("#GHMclear3")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#GHMclear3");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#GHMclear3");
+	initnpctimer;
+	end;
+OnTimer2000:
+	mapannounce instance_mapname("1@gl_k"), "Himmelmez: You got me tempted to go to the 2nd floor, come to the entrance. I'm curious about how far your luck goes.",bc_map,"0xFFFFFF";
+	stopnpctimer;
+	end;
+}
+
+1@gl_k,0,0,0	script	#controlGH3	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#controlGH3")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#controlGH3");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#controlGH3");
+	initnpctimer;
+	end;
+OnTimer3000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk1";
+	end;
+OnTimer6000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk2";
+	end;
+OnTimer9000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk3";
+	end;
+OnTimer12000:
+	donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnTalk1";
+	end;
+OnTimer15000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk4";
+	end;
+OnTimer18000:
+	donpcevent instance_npcname("Varmunt#ghinstance3")+"::OnTalk1";
+	end;
+OnTimer21000:
+	donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnTalk2";
+	end;
+OnTimer24000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk5";
+	end;
+OnTimer27000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnTalk6";
+	end;
+OnTimer28000:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnDisable";
+	end;
+OnTimer31000:
+	donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnTalk3";
+	end;
+OnTimer32000:
+	donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnDisable";
+	end;
+OnTimer35000:
+	mapannounce instance_mapname("1@gl_k"), "An eerie echo from the depths can be heard as you get closer.",bc_map,"0xFFFFFF";
+	end;
+OnTimer38000:
+	donpcevent instance_npcname("#ghmemorialmob04")+"::OnEnable";
+	stopnpctimer;
+	donpcevent instance_npcname("#controlGH3")+"::OnDisable";
+	end;
+}
+
+1@gl_k,144,258,6	script	Heinrich#ghinstance4	652,{
+	mes "[Heinrich]";
+	mes "Himmelmez... You made my men get killed and I will never forget that.";
+	cutin "gl_heinrich1",2;
+	close2;
+	cutin "gl_heinrich1",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance4")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance4");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance4");
+	end;
+OnTalk1:
+	npctalk "Himmelmez! I won't let you take even a single more step here.";
+	end;
+OnTalk2:
+	npctalk "What... is this?!";
+	end;
+OnTalk3:
+	npctalk "Varmunt Sir! Help the adventurers and I'll chase Himmelmez!";
+	end;
+}
+
+1@gl_k,150,257,3	script	Himmelmez#ghinstance2	650,{
+	mes "[Himmelmez]";
+	mes "No need to stare at me with so insecure eyes. Soon they'll become relaxed...";
+	cutin "gl_himel2",2;
+	close2;
+	cutin "gl_himel2",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Himmelmez#ghinstance2")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Himmelmez#ghinstance2");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Himmelmez#ghinstance2");
+	end;
+OnTalk1:
+	npctalk "What an awfully lucky, I flew all the way over here and just one of them is really powerful.";
+	end;
+OnTalk2:
+	npctalk "But it doesn't matter to me.";
+	end;
+OnTalk3:
+	npctalk "Now, all of you will die.";
+	end;
+OnTalk4:
+	npctalk "Hahaha, so you guys thought I would come alone?";
+	end;
+OnTalk5:
+	npctalk "This is my new toy to keep you at my feet. Why don't you guys play while I entertain?";
+	end;
+OnTalk6:
+	npctalk "Sincerely~, If I am given the opportunity I'd like to meet you again, Heinrich.";
+	end;
+}
+
+1@gl_k,156,259,3	script	Varmunt#ghinstance3	654,{
+	if (checkquest(12318,HUNTING) == 2) {
+		if (checkquest(12319,HUNTING) == -1) {
+			mes "[Varmunt]";
+			mes "There's something unusual about this thing's aura. Maybe someday we will be able to understand what is behind all of this.";
+			cutin "gl_barmund1",2;
+			getitem 6608,1; //Coagulated Spell
+			setquest 12319;
+			close2;
+			cutin "gl_barmund1",255;
+			end;
+		}
+	}
+	mes "[Varmunt]";
+	mes "Even after all this time, it is impossible to prevent from the will of the Transcendent.";
+	cutin "gl_barmund1",2;
+	close2;
+	cutin "gl_barmund2",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Varmunt#ghinstance3")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Varmunt#ghinstance3");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Varmunt#ghinstance3");
+	end;
+OnTalk1:
+	npctalk "Heinrich Sir! Something unknown holds an inexplicably powerful force!";
+	end;
+OnTalk2:
+	npctalk "From the monster I picked up some great stuff. People who are interested, talk to me.";
+	end;
+}
+
+// Floor 2
+//============================================================
+2@gl_k,148,67,1	script	Heinrich#ghinstance5	652,{
+	mes "[Heinrich]";
+	mes "Himmelmez's blocking spells";
+	mes "are everywhere around here...";
+	cutin "gl_heinrich1",2;
+	close2;
+	cutin "gl_heinrich1",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance5");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance5");
+	end;
+OnTalk1:
+	npctalk "These things have never been in the castle!";
+	end;
+OnTalk2:
+	npctalk "Trying to break this power with common weapons doesn't work. I tried it.";
+	end;
+OnTalk3:
+	npctalk "It is really unforgivable.";
+	end;
+OnTalk4:
+	npctalk "I, who already was a subordinate of genocide. How much more in the future...";
+	end;
+OnTalk5:
+	npctalk "...";
+	end;
+}
+
+2@gl_k,151,71,7	script	Varmunt#ghinstance4	654,{
+	mes "[Varmunt]";
+	mes "Why am I doing this again? Doesn't seem like the first time. I've seen this place repeatedly dozens of times in my dreams. This feeling...";
+	cutin "gl_barmund1",2;
+	close2;
+	cutin "gl_barmund1",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Varmunt#ghinstance4");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Varmunt#ghinstance4");
+	end;
+OnTalk2:
+	npctalk "Himmelmez's enchantment has completely blocked the passage to each section.";
+	end;
+OnTalk3:
+	npctalk "Get out of the way for a moment. I'll try to somehow break the spell with magical powers.";
+	end;
+OnTalk4:
+	npctalk "The enchantment seems to be broken.";
+	end;
+OnTalk5:
+	npctalk "I've never seen this spell before.";
+	end;
+OnTalk6:
+	npctalk "Himmelmez doesn't use a seal on a person's body to turn it into an undead.";
+	end;
+OnTalk7:
+	npctalk "She uses enchantment stones.This way, the spell is probably maintained.";
+	end;
+OnTalk8:
+	npctalk "We should kill the people who have the enchantment stones to break the spell.";
+	end;
+OnTalk9:
+	npctalk "However, we can't identify them. The purification can only be done randomly.";
+	end;
+OnTalk10:
+	npctalk "Commandant...";
+	end;
+OnTalk11:
+	npctalk "Commandant, it seems too loose.";
+	end;
+OnTalk12:
+	npctalk "We are related to all these people, not just a few.";
+	end;
+OnTalk13:
+	npctalk "We can't deny that it's not their fault for what is going on.";
+	end;
+OnTalk14:
+	npctalk "Well, let's do it then.";
+	end;
+OnTalk15:
+	npctalk "You guys are of a great help. Try to follow us.";
+	end;
+OnTalk16:
+	npctalk "There can be a tough fight. Hold on, and it would be nice to eat something.";
+	end;
+OnTalk17:
+	npctalk "Guys. It is time to depart, Heinrich Sir.";
+	end;
+}
+
+2@gl_k,150,67,0	script	#effectGH01	111,10,10,{
+	end;
+OnTouch:
+	specialeffect EF_BASH;
+	donpcevent instance_npcname("#controlGH4")+"::OnEnable";
+	donpcevent instance_npcname("#effectGH01")+"::OnDisable";
+	end;
+OnEffect:
+	specialeffect EF_LORD;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("#effectGH01")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#effectGH01");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#effectGH01");
+	end;
+}
+
+2@gl_k,0,0,0	script	#controlGH4	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#controlGH4")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#controlGH4");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#controlGH4");
+	initnpctimer;
+	end;
+OnTimer3000:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnTalk1";
+	donpcevent instance_npcname("#ghmemorialmob05")+"::OnEnable";
+	end;
+OnTimer6000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk2";
+	end;
+OnTimer9000:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnTalk2";
+	end;
+OnTimer12000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk3";
+	end;
+OnTimer15000:
+	donpcevent instance_npcname("#effectGH01")+"::OnEnable";
+	donpcevent instance_npcname("#effectGH01")+"::OnEffect";
+	end;
+OnTimer18000:
+	donpcevent instance_npcname("#effectGH01")+"::OnDisable";
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk4";
+	end;
+OnTimer21000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk5";
+	end;
+OnTimer24000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk6";
+	end;
+OnTimer27000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk7";
+	end;
+OnTimer30000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk8";
+	end;
+OnTimer33000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk9";
+	end;
+OnTimer36000:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnTalk3";
+	end;
+OnTimer39000:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnTalk4";
+	end;
+OnTimer42000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk10";
+	end;
+OnTimer45000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk11";
+	end;
+OnTimer48000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk12";
+	end;
+OnTimer51000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk13";
+	end;
+OnTimer54000:
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnTalk5";
+	end;
+OnTimer57000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk14";
+	end;
+OnTimer60000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk15";
+	end;
+OnTimer63000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk16";
+	end;
+OnTimer66000:
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnTalk17";
+	end;
+OnTimer69000:
+	mapannounce instance_mapname("2@gl_k"), "9 o'clock positioned warp leading to the 1st zone has been opened. Move from the central hallway. A being with an evil aura seems to be appearing in this region.",bc_map,"0xFFFF00";
+	donpcevent instance_npcname("#ghinstancewarp8")+"::OnEnable";
+	donpcevent instance_npcname("#ghinstancewarp9")+"::OnEnable";
+	donpcevent instance_npcname("#ghmemorialmob06")+"::OnEnable";
+	donpcevent instance_npcname("Varmunt#ghinstance4")+"::OnDisable";
+	donpcevent instance_npcname("Heinrich#ghinstance5")+"::OnDisable";
+	end;
+OnTimer70000:
+	stopnpctimer;
+	donpcevent instance_npcname("#controlGH4")+"::OnDisable";
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob05	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob05")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob05");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob05");
+	set .@map$, instance_mapname("2@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob05")+"::OnMyMobDead";
+	areamonster .@map$,124,20,31,162,"Decayed Guard",2468,8,.@label$;
+	areamonster .@map$,124,20,31,162,"Sharpshooter Ranger",2469,8,.@label$;
+	areamonster .@map$,124,20,31,162,"Fallen Abyss Knight",2470,8,.@label$;
+	areamonster .@map$,124,20,31,162,"Suffering Khalitzburg",2471,8,.@label$;
+	areamonster .@map$,124,20,31,162,"Swollen Knight",2472,8,.@label$;
+	set .MyMobs,80;
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("2@gl_k");
+	set .MyMobs, .MyMobs-1;
+	if (.MyMobs == 0) {
+		mapannounce .@map$, "A being with an evil aura seems to be appearing in this region.",bc_map,"0xFFFF00";
+		donpcevent instance_npcname("#ghmemorialmob06")+"::OnDisable2";
+		donpcevent instance_npcname("#ghmemorialmob07")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob05")+"::OnDisable";
+	} else {
+		set .@label$, instance_npcname("#ghmemorialmob05")+"::OnMyMobDead";
+		switch(rand(5)) {
+		case 0:
+			areamonster .@map$,124,20,31,162,"Decayed Guard",2468,1,.@label$;
+			break;
+		case 1:
+			areamonster .@map$,124,20,31,162,"Sharpshooter Ranger",2469,1,.@label$;
+			break;
+		case 2:
+			areamonster .@map$,124,20,31,162,"Fallen Abyss Knight",2470,1,.@label$;
+			break;
+		case 3:
+			areamonster .@map$,124,20,31,162,"Suffering Khalitzburg",2471,1,.@label$;
+			break;
+		case 4:
+			areamonster .@map$,124,20,31,162,"Swollen Knight",2472,1,.@label$;
+			break;
+		}
+	}
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob06	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob06")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob06");
+	end;
+OnDisable2:
+	stopnpctimer;
+	disablenpc instance_npcname("#ghmemorialmob06");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob06");
+	donpcevent instance_npcname("#ghmemorialmob06")+"::OnSpawn";
+	end;
+OnSpawn:
+	initnpctimer;
+	end;
+OnTimer90000:
+	set .@map$, instance_mapname("2@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob05")+"::OnMyMobDead";
+	setarray .@c[0],
+		114,141,118,139,
+		128,83,131,78,
+		88,53,93,48,
+		54,47,61,40,
+		58,83,63,78,
+		69,138,80,127,
+		34,143,39,138;
+	for(set .@i,0; .@i<getarraysize(.@c); set .@i,.@i+4) {
+		areamonster .@map$,.@c[.@i],.@c[.@i+1],.@c[.@i+2],.@c[.@i+3],"Decayed Guard",2468,1,.@label$;
+		areamonster .@map$,.@c[.@i],.@c[.@i+1],.@c[.@i+2],.@c[.@i+3],"Sharpshooter Ranger",2469,1,.@label$;
+		areamonster .@map$,.@c[.@i],.@c[.@i+1],.@c[.@i+2],.@c[.@i+3],"Fallen Abyss Knight",2470,1,.@label$;
+		areamonster .@map$,.@c[.@i],.@c[.@i+1],.@c[.@i+2],.@c[.@i+3],"Suffering Khalitzburg",2471,1,.@label$;
+		areamonster .@map$,.@c[.@i],.@c[.@i+1],.@c[.@i+2],.@c[.@i+3],"Swollen Knight",2472,1,.@label$;
+	}
+	end;
+OnTimer92000:
+	stopnpctimer;
+	donpcevent instance_npcname("#ghmemorialmob06")+"::OnSpawn";
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob07	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob07")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob07");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob07");
+	areamonster instance_mapname("2@gl_k"),124,20,31,162,"The Destruction of the First Captain",2473,1,instance_npcname("#ghmemorialmob07")+"::OnMyMobDead";
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("2@gl_k");
+	if (mobcount(.@map$,instance_npcname("#ghmemorialmob07")+"::OnMyMobDead") < 1) {
+		mapannounce .@map$, "3 o'clock positioned warp leading to the 2nd zone has been opened. Use the central hallway to get there.",bc_map,"0xFFFF00";
+		donpcevent instance_npcname("#ghinstancewarp10")+"::OnEnable";
+		donpcevent instance_npcname("#ghinstancewarp11")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob08")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob07")+"::OnDisable";
+	}
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob08	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob08")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob08");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob08");
+	set .@map$, instance_mapname("2@gl_k");
+	set .@label$, instance_npcname("#ghmemorialmob08")+"::OnMyMobDead";
+	areamonster .@map$,175,163,265,18,"Decayed Guard",2468,7,.@label$;
+	areamonster .@map$,175,163,265,18,"Sharpshooter Ranger",2469,7,.@label$;
+	areamonster .@map$,175,163,265,18,"Fallen Abyss Knight",2470,7,.@label$;
+	areamonster .@map$,175,163,265,18,"Suffering Khalitzburg",2471,7,.@label$;
+	areamonster .@map$,175,163,265,18,"Swollen Knight",2472,7,.@label$;
+	set .MyMobs,35;
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("2@gl_k");
+	set .MyMobs, .MyMobs-1;
+	if (.MyMobs == 0) {
+		mapannounce .@map$, "A being with an evil aura seems to be appearing in this region.",bc_map,"0xFFFF00";
+		donpcevent instance_npcname("#ghmemorialmob09")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob08")+"::OnDisable";
+	} else {
+		set .@label$, instance_npcname("#ghmemorialmob08")+"::OnMyMobDead";
+		switch(rand(5)) {
+		case 0:
+			areamonster .@map$,175,163,265,18,"Decayed Guard",2468,1,.@label$;
+			break;
+		case 1:
+			areamonster .@map$,175,163,265,18,"Sharpshooter Ranger",2469,1,.@label$;
+			break;
+		case 2:
+			areamonster .@map$,175,163,265,18,"Fallen Abyss Knight",2470,1,.@label$;
+			break;
+		case 3:
+			areamonster .@map$,175,163,265,18,"Suffering Khalitzburg",2471,1,.@label$;
+			break;
+		case 4:
+			areamonster .@map$,175,163,265,18,"Swollen Knight",2472,1,.@label$;
+			break;
+		}
+	}
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob09	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob09")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob09");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob09");
+	areamonster instance_mapname("2@gl_k"),175,163,265,18,"The Destruction of the Second Captain",2474,1,instance_npcname("#ghmemorialmob09")+"::OnMyMobDead";
+	end;
+OnMyMobDead:
+	set .@map$, instance_mapname("2@gl_k");
+	if (mobcount(.@map$,instance_npcname("#ghmemorialmob09")+"::OnMyMobDead") < 1) {
+		mapannounce .@map$, "12 o'clock positioned warp leading to the 3rd zone has been opened. Use the central hallway to get there.",bc_map,"0xFFFF00";
+		donpcevent instance_npcname("#ghinstancewarp12")+"::OnEnable";
+		donpcevent instance_npcname("#controlGH6")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob08")+"::OnDisable";
+		donpcevent instance_npcname("#ghmemorialmob09")+"::OnDisable";
+	}
+	end;
+}
+
+2@gl_k,0,0,0	script	#ghmemorialmob10	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#ghmemorialmob10")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#ghmemorialmob10");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#ghmemorialmob10");
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnDisable";
+	monster instance_mapname("2@gl_k"),158,255,"Amdarias",2476,1,instance_npcname("#ghmemorialmob10")+"::OnMyMobDead";
+	end;
+OnMyMobDead:
+	if (mobcount(instance_mapname("2@gl_k"),instance_npcname("#ghmemorialmob10")+"::OnMyMobDead") < 1) {
+		donpcevent instance_npcname("Hugin#ghinstance1")+"::OnEnable";
+		donpcevent instance_npcname("#ghmemorialmob10")+"::OnDisable";
+	}
+	end;
+}
+
+2@gl_k,155,250,7	script	Heinrich#ghinstance6	652,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Heinrich#ghinstance6");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Heinrich#ghinstance6");
+	end;
+OnTalk1:
+	npctalk "Gerhard!";
+	end;
+OnTalk2:
+	npctalk "What are you doing to my men, Himmelmez?!";
+	end;
+OnTalk3:
+	npctalk "Himmelmez! You don't need to make any more sacrifices!";
+	end;
+OnTalk4:
+	npctalk "Let him go! I don't want one more sacrifice!";
+	end;
+OnTalk5:
+	npctalk "I will not forgive you.";
+	end;
+OnTalk6:
+	npctalk "Just leave us alone, Himmelmez!!";
+	end;
+}
+
+2@gl_k,162,250,1	script	Varmunt#ghinstance5	654,{
+	mes "[Varmunt]";
+	mes "We can't escape this";
+	mes "eternal confinement...";
+	cutin "gl_barmund2",2;
+	close2;
+	cutin "gl_barmund2",255;
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Varmunt#ghinstance5")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Varmunt#ghinstance5");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Varmunt#ghinstance5");
+	end;
+OnTalk1:
+	npctalk "What? This cannot be. We must prevent Amdarias's attacks!";
+	end;
+}
+
+2@gl_k,158,252,3	script	Himmelmez#ghinstance4	650,4,4,{
+	end;	
+OnInstanceInit:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Himmelmez#ghinstance4");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Himmelmez#ghinstance4");
+	end;
+OnTalk1:
+	npctalk "Great~ I thought you wouldn't come near the end...";
+	end;
+OnTalk2:
+	npctalk "Huhu, I have already found a piece of Ymir's Heart, Heinrich.";
+	end;
+OnTalk3:
+	npctalk "It would've been faster if there were no distractions.";
+	end;
+OnTalk4:
+	npctalk "What do you think? Making it look like an accidental disease infected the king and the people around...";
+	end;
+OnTalk5:
+	npctalk "You want that?";
+	end;
+OnTalk6:
+	npctalk "This one is your final blow, Heinrich.";
+	end;
+OnTalk7:
+	npctalk "It is said that stopping me requires a skillfull person.";
+	end;
+OnTalk8:
+	npctalk "Seems like a perfect scenario to make my new monster, Amdarias.";
+	end;
+OnTalk9:
+	npctalk "Booh~ I'm scared.";
+	end;
+OnTalk10:
+	npctalk "Anyway, it was nice talking to you. Maybe we'll have the chance to meet again in the next story.";
+	end;
+OnTalk11:
+	npctalk "Well, make sure you will come back again.";
+	end;
+}
+
+2@gl_k,150,179,0	script	#controlGH6	111,2,2,{
+	end;
+OnTouch:
+	mapannounce instance_mapname("2@gl_k"), "???: Do not come! There are traps everywhere here... Aaaaack!!!!",bc_map,"0xFF0000";
+	specialeffect EF_BASH;
+	donpcevent instance_npcname("Himmelmez#ghinstance3")+"::OnEnable";
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnEnable";
+	donpcevent instance_npcname("Varmunt#ghinstance5")+"::OnEnable";
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEnable";
+	donpcevent instance_npcname("#controlGH6")+"::OnDisable";
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("#controlGH6")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("#controlGH6");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("#controlGH6");
+	end;
+}
+
+2@gl_k,158,252,1	script	Himmelmez#ghinstance3	650,7,7,{
+	end;
+OnTouch:
+	specialeffect EF_BASH;
+	donpcevent instance_npcname("#controlGH5")+"::OnEnable";
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnEnable";
+	donpcevent instance_npcname("Himmelmez#ghinstance3")+"::OnDisable";
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Himmelmez#ghinstance3")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("Himmelmez#ghinstance3");
+	end;
+OnEnable:
+	enablenpc instance_npcname("Himmelmez#ghinstance3");
+	end;
+}
+
+2@gl_k,158,255,3	script	Gerhard#ghinstance1	651,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnDisable";
+	end;
+OnDisable:
+	hideonnpc instance_npcname("Gerhard#ghinstance1");
+	end;
+OnEnable:
+	hideoffnpc instance_npcname("Gerhard#ghinstance1");
+	end;
+OnTalk1:
+	npctalk "Damn it! Run away! I can't withstand anymore!";
+	end;
+OnTalk2:
+	npctalk "Commandant... Come on, you need to run away from here... Ugh.";
+	end;
+OnTalk3:
+	npctalk "Even if you defile my body, I won't let you take my soul, Himmelmez!";
+	end;
+OnEffect1:
+	misceffect EF_BARRIER;
+	end;
+OnEffect2:
+	misceffect EF_CHAINCOMBO;
+	end;
+OnEffect3:
+	misceffect EF_MAPPILLAR2;
+	end;
+OnEffect4:
+	misceffect EF_MAPPILLAR;
+	end;
+OnEffect5:
+	specialeffect EF_LORD;
+	end;
+}
+
+2@gl_k,0,0,0	script	#controlGH5	-1,{
+OnInstanceInit:
+	donpcevent instance_npcname("#controlGH5")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("#controlGH5");
+	end;
+OnEnable:
+	enablenpc instance_npcname("#controlGH5");
+	initnpctimer;
+	end;
+OnTimer3000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk1";
+	end;
+OnTimer6000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnTalk1";
+	end;
+OnTimer9000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk1";
+	end;
+OnTimer12000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnTalk2";
+	end;
+OnTimer15000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk2";
+	end;
+OnTimer18000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk2";
+	end;
+OnTimer21000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk3";
+	end;
+OnTimer24000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnTalk3";
+	end;
+OnTimer27000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk4";
+	end;
+OnTimer30000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk3";
+	end;
+OnTimer33000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk4";
+	end;
+OnTimer36000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk5";
+	end;
+OnTimer39000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk6";
+	end;
+OnTimer42000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk7";
+	end;
+OnTimer45000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk8";
+	end;
+OnTimer48000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk5";
+	end;
+OnTimer51000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk9";
+	end;
+OnTimer54000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk10";
+	end;
+OnTimer57000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnTalk11";
+	end;
+OnTimer60000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect1";
+	end;
+OnTimer63000:
+	donpcevent instance_npcname("Himmelmez#ghinstance4")+"::OnDisable";
+	end;
+OnTimer65000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect3";
+	end;
+OnTimer66000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect2";
+	end;
+OnTimer67000:
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnTalk6";
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect4";
+	end;
+OnTimer70000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect3";
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect4";
+	donpcevent instance_npcname("Heinrich#ghinstance6")+"::OnDisable";
+	donpcevent instance_npcname("Varmunt#ghinstance5")+"::OnTalk1";
+	end;
+OnTimer73000:
+	mapannounce instance_mapname("2@gl_k"), "Leads toward Gerhard's body.",bc_map,"0xFFFFFF";
+	end;
+OnTimer76000:
+	donpcevent instance_npcname("Gerhard#ghinstance1")+"::OnEffect5";
+	end;
+OnTimer80000:
+	donpcevent instance_npcname("#ghmemorialmob10")+"::OnEnable";
+	stopnpctimer;
+	donpcevent instance_npcname("#controlGH5")+"::OnDisable";
+	end;
+}
+
+2@gl_k,158,241,1	script	Hugin#ghinstance1	755,{
+	if (checkquest(12319,HUNTING) == 2) {
+		mes "[Hugin]";
+		mes "Well, you are pretty ridiculous. Beginners shouldn't get the loot Amdarias drops.";
+		erasequest 12318;
+		erasequest 12319;
+		getitem 6608,1; //Coagulated Spell
+		next;
+		mes "[Hugin]";
+		mes "Varmunt, I have arbitrarily stopped time. And soon, the time gap will be gone.";
+		specialeffect2 EF_BLIND,AREA;
+		soundeffect "_blind.wav",0;
+		next;
+		mes "[Hugin]";
+		mes "Poor time travelers.";
+		mes "They will endlessly retry to prevent the tragedy that affected this city.";
+		next;
+		mes "[Hugin]";
+		mes "But the beggining of these time travels won't redempt your actions.";
+		mes "This will continue forever...";
+		next;
+		mes "[Hugin]";
+		mes "Now, I may erase your memory again. Perhaps you will have a different fate next time.";
+		specialeffect2 EF_FREEZE;
+		close2;
+		getmapxy(.@map$,.@x,.@y,0);
+		warp .@map$,.@x,.@y;
+		end;
+	} else {
+		mes "[Hugin]";
+		mes "The gap of time is almost distorted.";
+		mes "Done. There you go. Come!";
+		mes "I have to get out!";
+		next;
+		select("Bah... Soon after you...");
+		mes "[Hugin]";
+		mes "Soon after me? Anyways...";
+		mes "Doesn't matter, soon the gap of time will be closed, I have to get out of here.";
+		next;
+		switch(select("Since I'm here, let's explore more.:Please, send me out.")) {
+		case 1:
+			mes "[Hugin]";
+			mes "..................";
+			close;
+		case 2:
+			close2;
+			warp "glast_01",204,270;
+			end;
+		}
+	}
+OnInstanceInit:
+	donpcevent instance_npcname("Hugin#ghinstance1")+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("Hugin#ghinstance1");
+	end;
+OnEnable:
+	enablenpc instance_npcname("Hugin#ghinstance1");
+	end;
+}

+ 2 - 2
npc/re/merchants/enchan_mora.txt

@@ -457,7 +457,7 @@ mora,99,93,5	script	Artifact Crafter#pa0829	495,{
 		break;
 	}
 	set .@item, .@items[(.@select-2)%4];
-	if (countitem(6380) == 0 || countitem(.@item) == 0) {
+	if (countitem(6380) < 2 || countitem(.@item) == 0) {
 		mes "[Artifact Crafter]";
 		mes "You have to have 2 Mora Coins and an item to be reinforced before I can do my work.";
 		close;
@@ -634,7 +634,7 @@ mora,148,98,3	script	Artifact Researcher#new	521,{
 	}
 	if (Zeny < 100000 || countitem(6380) == 0) {
 		mes "[Artifact Researcher]";
-		mes "I'm not giving these services out for free pal. 100,000 zeny or 1 Mora Coin. Is that too much to ask?";
+		mes "I'm not giving these services out for free pal. 100,000 zeny and 1 Mora Coin. Is that too much to ask?";
 		close;
 	}
 	mes "[Artifact Researcher]";

+ 32 - 2
npc/re/quests/quests_dicastes.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= Gennosuke Kouga, Muad_Dib
 //===== Current Version: =====================================
-//= 2.0
+//= 2.1
 //===== Compatible With: =====================================
 //= rAthena SVN
 //===== Description: =========================================
@@ -30,6 +30,7 @@
 //= 1.9 Updated "Fish Tails" with RE coordinates.
 //= 1.9a Minor fix. [Joseph]
 //= 2.0 Fixed variables. [Joseph]
+//= 2.1 Added reset option to "Kareka". [Euphy]
 //============================================================
 
 // Entrance
@@ -6924,8 +6925,37 @@ dic_in01,42,264,3	script	Adventurer Clerk#ep133	453,{
 			mes "[Kareka]";
 			mes "Do you want to upgrade the ^990099Light of El Dicastes^000000 again?";
 			next;
+
+			// The reset feature was disabled in previous versions.
+			//mes "[Kareka]";
+			//mes "Ha ha ha, that is out of the question. This item is very rare and valuable so I cannot give you a new one.";
+			//close;
+
 			mes "[Kareka]";
-			mes "Ha ha ha, that is out of the question. This item is very rare and valuable so I cannot give you a new one.";
+			mes "That will cost ^9900996 Sapha Certifications^000000 in order to retry.";
+			mes "And note this, your current Light of El Dicastes will be destroyed along with all of its enchantments.";
+			next;
+			mes "[Kareka]";
+			mes "Are you sure you want to do this?";
+			next;
+			if(select("No, let me think about it.:Take my Light of El Dicastes.") == 2) {
+				if (countitem(2844) == 0 || countitem(6304) < 6) {
+					mes "[Kareka]";
+					mes "You need to bring the Light of El Dicastes and 6 Sapha Certifications!";
+					mes "Don't try to cheat me!";
+					close;
+				}
+				mes "[Kareka]";
+				mes "Ok, let's get this started.";
+				mes "I'm going to remove all enchantments from your Light of El Dicastes.";
+				mes "Haaap--!";
+				specialeffect2 EF_REPAIRWEAPON;
+				progressbar "ffff00",3;
+				delitem 6304,6; //Sapa_Feat_Cert
+				delitem 2844,1; //El_Dicastes_Light
+				getitem 2844,1; //El_Dicastes_Light
+				set ep13_3_ring2,0;
+			}
 			close;
 		}
 		if (countitem(6304) < 1) {

+ 1 - 0
npc/re/scripts_athena.conf

@@ -53,6 +53,7 @@ npc: npc/re/instances/BuwayaCave.txt
 npc: npc/re/instances/HazyForest.txt
 npc: npc/re/instances/MalangdoCulvert.txt
 npc: npc/re/instances/OctopusCave.txt
+npc: npc/re/instances/OldGlastHeim.txt
 
 // ---------------- Kafras & Cool Event Corp. -------------------
 npc: npc/re/kafras/kafras.txt

+ 61 - 11
npc/re/warps/cities/malaya.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= Chilly
 //===== Current Version: =====================================
-//= 1.1
+//= 1.2
 //===== Compatible With: =====================================
 //= rAthena SVN
 //===== Description: =========================================
@@ -11,9 +11,11 @@
 //===== Additional Comments: =================================
 //= 1.0 First Version.
 //= 1.1 Updated to match official scripts. [Masao]
+//= 1.2 Added official Jeepney warp scripts. [Euphy]
 //============================================================
 
 // Town Warps
+//============================================================
 ma_in01,86,16,0	warp	mal_in_ws	1,1,malaya,115,212
 ma_in01,24,77,0	warp	mal_in_inn	1,1,malaya,178,208
 malaya,370,277,0	warp	malaya_mal_fild01	1,1,ma_fild01,40,272
@@ -31,6 +33,7 @@ ma_fild01,251,190,0	warp	mf_minga_mf_in_minga	1,1,ma_in01,108,160
 ma_in01,105,160,0	warp	mf_in_minga_mf_minga	1,1,ma_fild01,248,190
 
 // Locked Warps
+//============================================================
 malaya,178,211,0	script	malaya_inn	45,1,1,{
 	end;
 OnTouch:
@@ -86,13 +89,60 @@ OnTouch:
 	end;
 }
 
-// Car Warps
-ma_zif01,30,22,0	warp	malaya_car0001	1,1,malaya,241,238
-ma_zif02,30,22,0	warp	malaya_car0002	1,1,malaya,71,43
-ma_zif03,30,22,0	warp	malaya_car0003	1,1,malaya,284,129
-ma_zif04,30,22,0	warp	malaya_car0004	1,1,malaya,134,247
-ma_zif05,30,22,0	warp	malaya_car0005	1,1,malaya,341,150
-ma_zif06,30,22,0	warp	malaya_car0006	1,1,malaya,294,293
-ma_zif07,30,22,0	warp	malaya_car0007	1,1,malaya,239,221
-ma_zif08,30,22,0	warp	malaya_car0008	1,1,malaya,59,246
-ma_zif09,30,22,0	warp	malaya_car0009	1,1,malaya,254,68
+// Jeepney Warps
+//============================================================
+function	script	F_Malaya_Warp	{
+	mes "Where would you like to go?";
+	next;
+	set .@i$, getarg(select("Back outside",getarg(1)+" Jeepney",getarg(2)+" Jeepney") - 1);
+	close2;
+	switch(getarg(3)) {
+	case 1: // 12 passenger
+		if (.@i$ == "Center")
+			warp "malaya",241,238;
+		if (.@i$ == "Southwest")
+			warp "malaya",71,43;
+		else if (.@i$ == "Southeast")
+			warp "malaya",284,129;
+		break;
+	case 2: // 30 passenger
+		if (.@i$ == "Northwest")
+			warp "malaya",134,247;
+		else if (.@i$ == "Southeast")
+			warp "malaya",341,150;
+		else if (.@i$ == "Northeast")
+			warp "malaya",294,293;
+		break;
+	case 3: // 60 passenger
+		if (.@i$ == "Center")
+			warp "malaya",239,221;
+		else if (.@i$ == "Northwest")
+			warp "malaya",59,246;
+		else if (.@i$ == "Southeast")
+			warp "malaya",254,68;
+		break;
+	}
+	end;
+}
+
+ma_zif01,30,22,0	script	Town Warp#zif01	45,1,1,{ callfunc "F_Malaya_Warp","Center","Southwest","Southeast",1; }
+ma_zif02,30,22,0	script	Town Warp#zif02	45,1,1,{ callfunc "F_Malaya_Warp","Southwest","Center","Southeast",1; }
+ma_zif03,30,22,0	script	Town Warp#zif03	45,1,1,{ callfunc "F_Malaya_Warp","Southeast","Center","Southwest",1; }
+
+ma_zif04,30,22,0	script	Town Warp#zif04	45,1,1,{ callfunc "F_Malaya_Warp","Northwest","Southeast","Northeast",2; }
+ma_zif05,30,22,0	script	Town Warp#zif05	45,1,1,{ callfunc "F_Malaya_Warp","Southeast","Northwest","Northeast",2; }
+ma_zif06,30,22,0	script	Town Warp#zif06	45,1,1,{ callfunc "F_Malaya_Warp","Northeast","Northwest","Southeast",2; }
+
+ma_zif07,30,22,0	script	Town Warp#zif07	45,1,1,{ callfunc "F_Malaya_Warp","Center","Northwest","Southeast",3; }
+ma_zif08,30,22,0	script	Town Warp#zif08	45,1,1,{ callfunc "F_Malaya_Warp","Northwest","Center","Southeast",3; }
+ma_zif09,30,22,0	script	Town Warp#zif09	45,1,1,{ callfunc "F_Malaya_Warp","Southeast","Center","Northwest",3; }
+
+//ma_zif01,30,22,0	warp	malaya_car0001	1,1,malaya,241,238
+//ma_zif02,30,22,0	warp	malaya_car0002	1,1,malaya,71,43
+//ma_zif03,30,22,0	warp	malaya_car0003	1,1,malaya,284,129
+//ma_zif04,30,22,0	warp	malaya_car0004	1,1,malaya,134,247
+//ma_zif05,30,22,0	warp	malaya_car0005	1,1,malaya,341,150
+//ma_zif06,30,22,0	warp	malaya_car0006	1,1,malaya,294,293
+//ma_zif07,30,22,0	warp	malaya_car0007	1,1,malaya,239,221
+//ma_zif08,30,22,0	warp	malaya_car0008	1,1,malaya,59,246
+//ma_zif09,30,22,0	warp	malaya_car0009	1,1,malaya,254,68

+ 7 - 6
sql-files/item_db_re.sql

@@ -4145,6 +4145,7 @@ REPLACE INTO `item_db_re` VALUES (6581,'Holy_Amulet','Holy Amulet',3,20,NULL,10,
 REPLACE INTO `item_db_re` VALUES (6583,'3rd_Test_Pass','3rd Test Pass',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (6593,'Cryptura_Hair_Coupon','Cryptura Hair Coupon',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (6606,'P_Cart_C','P Cart C',3,0,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (6608,'Coagulated_Spell','Coagulated Spell',3,0,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (6616,'Lmtd_Manny_Card','Lmtd Manny Card',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (6617,'Lmtd_Sid_Card','Lmtd Sid Card',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (6618,'Lmtd_Diego_Card','Lmtd Diego Card',3,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -7789,17 +7790,17 @@ REPLACE INTO `item_db_re` VALUES (16688,'RWC2010_SuitcaseB','RWC2010 SuitcaseB',
 REPLACE INTO `item_db_re` VALUES (16691,'Scorpius_Scroll','Scorpius Scroll',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 #
 REPLACE INTO `item_db_re` VALUES (16740,'Ptotection_Seagod_Box','The Sea God\'s Call 23 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 6436,86400;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16741,'Hairtail_Box1','Cutlass 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16741,'Hairtail_Box1','Cutlass 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16742,'Hairtail_Box2','Cutlass 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1198,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16743,'Spearfish_Box1','Marlin 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16743,'Spearfish_Box1','Marlin 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16744,'Spearfish_Box2','Marlin 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 1489,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16745,'Saurel_Box1','Pompano 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16745,'Saurel_Box1','Pompano 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16746,'Saurel_Box2','Pompano 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 13068,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16747,'Tuna_Box1','Tuna 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16747,'Tuna_Box1','Tuna 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16748,'Tuna_Box2','Tuna 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 16016,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16749,'Malang_Crab_Box1','Malangdo Crab 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16749,'Malang_Crab_Box1','Malangdo Crab 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16750,'Malang_Crab_Box2','Malangdo Crab 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18107,604800;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16751,'Brindle_Eel_Box1','Zebra Eel 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,86400;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16751,'Brindle_Eel_Box1','Zebra Eel 1 Hour Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,3600;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16752,'Brindle_Eel_Box2','Zebra Eel 7 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'rentitem 18108,604800;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16753,'Unbreak_Weap_Box','Unbreakable Weapon Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 6438,1;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16754,'F_Unbreak_Weap_Box','Unbreakable Weapon Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 6438,1;',NULL,NULL);

+ 16 - 13
sql-files/mob_db_re.sql

@@ -1681,19 +1681,22 @@ REPLACE INTO `mob_db` VALUES (2380,'XMAS_SMOKEY_GIFT','Smokey Gift','Smokey Gift
 #2461,TREASURE_BOX_TE_9
 #2462,TREASURE_BOX_TE_10
 #2463,E_BOMBPORING
-#2464,MG_ZOMBIE
-#2465,MG_WRAITH
-#2466,MG_GHOUL
-#2467,MG_ARCLOUSE
-#2468,MG_RAYDRIC
-#2469,MG_RAYDRIC_ARCHER
-#2470,MG_KNIGHT_OF_ABYSS
-#2471,MG_KHALITZBURG
-#2472,MG_BLOODY_KNIGHT
-#2473,MG_M_UNDEAD_KNIGHT
-#2474,MG_F_UNDEAD_KNIGHT
-#2475,MG_CORRUPTION_ROOT
-#2476,MG_AMDARAIS
+
+# Old Glast Heim (currently placeholders)
+REPLACE INTO `mob_db` VALUES (2464,'MG_ZOMBIE','Zombie','Zombie',17,9340,1,117,87,1,38,50,20,3,15,8,17,0,15,0,10,12,1,1,29,0x3885,400,2612,912,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2465,'MG_WRAITH','Wraith','Wraith',77,23168,1,1190,1191,1,335,396,80,40,62,26,30,55,76,5,10,12,2,1,89,0x3695,300,1816,576,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2466,'MG_GHOUL','Ghoul','Ghoul',61,12614,1,583,656,1,216,245,78,5,56,12,19,11,27,10,10,12,1,1,49,0x3885,250,2456,912,504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2467,'MG_ARCLOUSE','Arclouse','Arclouze',107,14020,1,1844,2607,1,269,309,101,36,60,73,45,35,140,15,10,12,1,4,42,0x3195,100,960,500,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2468,'MG_RAYDRIC','Raydric','Raydric',115,25408,1,20770,2076,1,572,668,89,15,129,87,55,32,76,27,10,12,2,7,47,0x3095,150,824,780,420,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2469,'MG_RAYDRIC_ARCHER','Raydric Archer','Raydric Archer',82,30370,1,1049,1332,9,377,395,63,40,53,24,40,15,112,30,10,12,1,6,47,0x2185,200,1152,1152,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2470,'MG_KNIGHT_OF_ABYSS','Knight of Abyss','Abysmal Knight',122,332970,1,4779,4013,1,810,1002,102,50,121,55,68,70,97,37,10,12,2,7,87,0x3695,300,1500,500,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2471,'MG_KHALITZBURG','Khalitzburg','Khalitzburg',118,109860,1,2862,2147,1,737,833,125,10,121,48,40,31,89,32,10,12,2,1,29,0x3695,350,528,1000,396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2472,'MG_BLOODY_KNIGHT','Bloody Knight','Bloody Knight',116,285000,1,7348,6511,3,942,1065,122,50,132,59,70,57,98,45,10,12,2,0,87,0x3695,250,828,528,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2473,'MG_M_UNDEAD_KNIGHT','Undead Knight','Undead Knight',133,500000,0,4500,3375,2,751,880,122,62,122,87,54,65,103,65,14,16,2,7,80,0x37B5,170,140,384,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2474,'MG_F_UNDEAD_KNIGHT','Undead Knight','Undead Knight',133,500000,0,4500,3375,2,751,880,122,62,122,87,54,65,103,65,14,16,2,7,80,0x37B5,170,140,384,288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2475,'MG_CORRUPTION_ROOT','Root of Corruption','Root of Corruption',136,3190000,1,240120,187920,3,710,1762,213,123,86,89,120,131,101,92,14,12,2,7,62,0x1A4,170,854,2016,480,120060,607,5500,608,3500,732,5500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2476,'MG_AMDARAIS','Amdarias','Amdarias',143,3283990,1,74288,77950,2,8860,10022,32,66,140,159,30,109,300,90,10,12,2,2,63,0x37B5,200,1152,1152,576,37144,617,5500,617,5000,616,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+
 #2477,NG_WANDER_MAN
 #2478,NG_RIDEWORD
 #2479,NG_MIMIC

+ 42 - 0
sql-files/mob_skill_db_re.sql

@@ -8027,3 +8027,45 @@ REPLACE INTO `mob_skill_db` VALUES (2362,'Nightmare Amon Ra@AL_TELEPORT','idle',
 REPLACE INTO `mob_skill_db` VALUES (2362,'Nightmare Amon Ra@AL_TELEPORT','walk',26,1,5000,0,5000,'yes','self','rudeattacked',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `mob_skill_db` VALUES (2362,'Nightmare Amon Ra@AL_HEAL','idle',28,11,10000,0,10000,'yes','self','myhpltmaxrate','50',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 
+# Old Glast Heim (currently placeholders)
+REPLACE INTO `mob_skill_db` VALUES (2464,'MG Zombie@AL_HEAL','idle',28,10,10000,0,5000,'yes','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,'26');
+REPLACE INTO `mob_skill_db` VALUES (2464,'MG Zombie@NPC_UNDEADATTACK','chase',347,10,8000,1000,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2465,'MG Wraith@NPC_ENERGYDRAIN','attack',200,1,500,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2466,'MG Ghoul@NPC_UNDEADATTACK','chase',347,10,8000,1000,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2467,'MG Arclouse@NPC_GROUNDATTACK','attack',185,10,2000,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@BS_MAXIMIZE','attack',114,5,500,1000,5000,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@BS_MAXIMIZE','chase',114,5,500,1000,5000,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@NPC_EMOTION','chase',197,1,2000,0,5000,'yes','self','always','0',0,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@SM_MAGNUM','attack',7,9,500,500,5000,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,'6',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@CR_AUTOGUARD','chase',249,2,2000,0,300000,'yes','self','longrangeattacked',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2468,'MG Raydric@CR_AUTOGUARD','attack',249,2,500,0,300000,'yes','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2469,'MG Raydric Archer@AC_CHARGEARROW','attack',148,1,500,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2469,'MG Raydric Archer@NPC_DARKNESSATTACK','attack',190,10,500,500,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2469,'MG Raydric Archer@CR_AUTOGUARD','attack',249,2,500,0,300000,'yes','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2470,'MG Knight of Abyss@AC_CHARGEARROW','chase',148,1,500,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2470,'MG Knight of Abyss@KN_BRANDISHSPEAR','attack',57,20,500,1000,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2470,'MG Knight of Abyss@NPC_DARKNESSATTACK','attack',190,5,500,500,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2470,'MG Knight of Abyss@CR_AUTOGUARD','chase',249,10,2000,0,300000,'yes','self','longrangeattacked',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2470,'MG Knight of Abyss@CR_AUTOGUARD','attack',249,10,500,0,300000,'yes','self','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@KN_BRANDISHSPEAR','attack',57,5,500,1000,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@NPC_CHANGEFIRE','attack',164,1,10000,2000,600000,'no','self','myhpltmaxrate','20',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@NPC_DARKNESSATTACK','attack',190,2,500,500,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@CR_SHIELDCHARGE','attack',250,5,500,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,'9',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@WZ_METEOR','attack',83,5,2000,0,5000,'no','target','myhpltmaxrate','20',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@WZ_METEOR','chase',83,5,2000,0,5000,'no','target','myhpltmaxrate','20',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2472,'MG Bloody Knight@NPC_WEAPONBRAKER','attack',343,5,500,0,30000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_HELLJUDGEMENT','idle',662,10,10000,4000,100,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,'36',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_HELLJUDGEMENT','attack',662,10,10000,1000,10000,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,'36',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_DARKSTRIKE','attack',340,10,2000,0,5000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_SILENCEATTACK','attack',178,10,2000,0,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_PETRIFYATTACK','attack',180,5,500,500,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'3',NULL);
+#REPLACE INTO `mob_skill_db` VALUES (2475,'MG_CORRUPTION_ROOT@NPC_TALK','idle',682,10,10000,0,60000,'no','self','myhpltmaxrate','100',NULL,NULL,NULL,NULL,NULL,NULL,'41');
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_DRAGONFEAR','chase',659,5,10000,0,30000,'no','self','always','0',NULL,NULL,NULL,NULL,NULL,'6',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_DRAGONFEAR','attack',659,5,2000,1000,20000,'no','self','myhpltmaxrate','80',NULL,NULL,NULL,NULL,NULL,'32',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_CRITICALSLASH','attack',170,1,500,500,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_FIREBREATH','attack',654,5,500,800,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'32',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_DARKBREATH','attack',202,5,500,800,5000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,'36',NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_WEAPONBRAKER','attack',343,10,500,0,30000,'yes','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@MG_FIREBALL','chase',17,20,5000,500,1000,'no','target','always','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+#REPLACE INTO `mob_skill_db` VALUES (2476,'MG_AMDARAIS@NPC_TALK','idle',682,10,10000,0,60000,'no','self','myhpltmaxrate','100',NULL,NULL,NULL,NULL,NULL,NULL,'42');
+

+ 11 - 4
src/map/atcommand.c

@@ -6823,10 +6823,17 @@ ACMD_FUNC(mobinfo)
 					continue;
 				if (mob->mvpitem[i].p > 0) {
 					j++;
-					if (j == 1)
-						sprintf(atcmd_output2, " %s  %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100);
-					else
-						sprintf(atcmd_output2, " - %s  %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100);
+					if (j == 1) {
+						if (item_data->slot)
+							sprintf(atcmd_output2, " %s[%d]  %02.02f%%", item_data->jname, item_data->slot, (float)mob->mvpitem[i].p / 100);
+						else
+							sprintf(atcmd_output2, " %s  %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100);
+					} else {
+						if (item_data->slot)
+							sprintf(atcmd_output2, " - %s[%d]  %02.02f%%", item_data->jname, item_data->slot, (float)mob->mvpitem[i].p / 100);
+						else
+							sprintf(atcmd_output2, " - %s  %02.02f%%", item_data->jname, (float)mob->mvpitem[i].p / 100);
+					}
 					strcat(atcmd_output, atcmd_output2);
 				}
 			}

+ 44 - 23
src/map/battle.c

@@ -894,7 +894,8 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
 		if(sc->data[SC_TATAMIGAESHI] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG)
 			return 0;
 
-		if( sc->data[SC_NEUTRALBARRIER] && (flag&(BF_MAGIC|BF_LONG)) == (BF_MAGIC|BF_LONG) ) {
+		// TODO: Find out whether Neutral Barrier really blocks all splash damage or just specific cases (Earthquake)
+		if( sc->data[SC_NEUTRALBARRIER] && ((flag&(BF_MAGIC|BF_LONG)) == BF_LONG || (skill_id && skill_get_splash(skill_id,skill_lv))) ) {
 			d->dmg_lv = ATK_MISS;
 			return 0;
 		}
@@ -1991,6 +1992,9 @@ static bool is_attack_hitting(struct Damage wd, struct block_list *src, struct b
 	else if (nk&NK_IGNORE_FLEE)
 		return true;
 
+	if( sc && (sc->data[SC_NEUTRALBARRIER] || sc->data[SC_NEUTRALBARRIER_MASTER]) && wd.flag&BF_LONG )
+		return false;
+
 	flee = tstatus->flee;
 #ifdef RENEWAL
 	hitrate = 0; //Default hitrate
@@ -3586,11 +3590,11 @@ static int battle_calc_skill_constant_addition(struct Damage wd, struct block_li
 				atk = (30*pc_checkskill(sd, RA_TOOTHOFWUG));
 			break;
 		case SR_GATEOFHELL:
-			atk =  (sstatus->max_hp - status_get_hp(src));
-			if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE){
-				atk =  ( ((int64)sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) );
-			}else{
-				atk =  ( ((int64)sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src) );
+			atk = (sstatus->max_hp - status_get_hp(src));
+			if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE) {
+				atk +=  ( ((int64)sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) );
+			} else {
+				atk +=  ( ((int64)sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src) );
 			}
 			break;
 		case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target Base Level x 40)
@@ -4787,21 +4791,34 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
 						if( mflag&ELE_DARK ){ skillratio *= 4; s_ele = ELE_DARK; }
 						skillratio /= 5;
 						break;
-					case WL_COMET: {
-						struct status_change * sc = status_get_sc(src);
-						if( sc )
-							i = distance_xy(target->x, target->y, sc->comet_x, sc->comet_y);
-						else
-							i = 8;
-						if( i < 2 ) skillratio = 2500 + 500 * skill_lv;
-						else
-						if( i < 4 ) skillratio = 1600 + 400 * skill_lv;
+					case WL_COMET:
+						i = ( sc ? distance_xy(target->x, target->y, sc->comet_x, sc->comet_y) : 8 );
+						if( i <= 3 ) 
+							skillratio += 2400 + 500 * skill_lv; // 7 x 7 cell
+						else if( i <= 5 ) 
+							skillratio += 1900 + 500 * skill_lv; // 11 x 11 cell
+						else if( i <= 7 ) 
+							skillratio += 1400 + 500 * skill_lv; // 15 x 15 cell
 						else
-						if( i < 6 ) skillratio = 1200 + 300 * skill_lv;
-						else
-						skillratio = 800 + 200 * skill_lv;
+							skillratio += 900 + 500 * skill_lv; // 19 x 19 cell
+
+						if( sd && sd->status.party_id ){
+							struct map_session_data* psd;
+							int p_sd[5] = {0, 0, 0, 0, 0}, c; // just limit it to 5
+
+							c = 0;
+							memset (p_sd, 0, sizeof(p_sd));
+							party_foreachsamemap(skill_check_condition_char_sub, sd, 3, &sd->bl, &c, &p_sd, skill_id);
+							c = ( c > 1 ? rand()%c : 0 );
+
+							if( (psd = map_id2sd(p_sd[c])) && pc_checkskill(psd,WL_COMET) > 0 ){
+								skillratio = skill_lv * 400; //MATK [{( Skill Level x 400 ) x ( Caster's Base Level / 120 )} + 2500 ] %
+								RE_LVL_DMOD(120);
+								skillratio += 2500;
+								status_zap(&psd->bl, 0, skill_get_sp(skill_id, skill_lv) / 2);
+							}
 						}
-						break;
+					break;
 					case WL_CHAINLIGHTNING_ATK:
 						skillratio += 100 + 300 * skill_lv;
 						RE_LVL_DMOD(100);
@@ -6164,14 +6181,18 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 			}
 			break;
 		case BL_MOB:
-			if(((((TBL_MOB*)target)->special_state.ai == AI_SPHERE || //Marine Spheres
-				(((TBL_MOB*)target)->special_state.ai == AI_FLORA && battle_config.summon_flora&1)) && //Floras
-				s_bl->type == BL_PC && src->type != BL_MOB) || (((TBL_MOB*)target)->special_state.ai == AI_ZANZOU && t_bl->id != s_bl->id)) //Zanzoe
-			{	//Targettable by players
+		{
+			struct mob_data *md = ((TBL_MOB*)target);
+			if(((md->special_state.ai == AI_SPHERE || //Marine Spheres
+				(md->special_state.ai == AI_FLORA && battle_config.summon_flora&1)) && s_bl->type == BL_PC && src->type != BL_MOB) || //Floras
+				(md->special_state.ai == AI_ZANZOU && t_bl->id != s_bl->id) || //Zanzoe
+				(md->special_state.ai == AI_FAW && (t_bl->id != s_bl->id || (s_bl->type == BL_PC && src->type != BL_MOB)))
+			){	//Targettable by players
 				state |= BCT_ENEMY;
 				strip_enemy = 0;
 			}
 			break;
+		}
 		case BL_SKILL:
 		{
 			TBL_SKILL *su = (TBL_SKILL*)target;

+ 14 - 21
src/map/clif.c

@@ -14523,13 +14523,13 @@ void clif_cashshop_ack(struct map_session_data* sd, int error)
 	WFIFOSET(fd, packet_len(0x289));
 }
 
-// TODO: find a more accurate date for this
-#if PACKETVER < 20130320
 /// Request to buy item(s) from cash shop (CZ_PC_BUY_CASH_POINT_ITEM).
 /// 0288 <name id>.W <amount>.W
 /// 0288 <name id>.W <amount>.W <kafra points>.L (PACKETVER >= 20070711)
 /// 0288 <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W }.4B*count (PACKETVER >= 20100803)
+/// 0848 <packet len>.W <count>.W <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W <tab>.W }.6B*count (PACKETVER >= 20130000)
 void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){
+
 	int fail = 0;
 	struct s_packet_db* info;
 
@@ -14547,23 +14547,30 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){
 
 		fail = npc_cashshop_buy(sd, nameid, amount, points);
 #else
+	#if PACKETVER < 20130000 //found accurate date
+		int s_itl = 6;
+	#else
+		int s_itl = 4;//item _list size
+	#endif
 		int len    = RFIFOW(fd,info->pos[0]);
 		int points = RFIFOL(fd,info->pos[1]);
 		int count  = RFIFOW(fd,info->pos[2]);
 		unsigned short* item_list = (unsigned short*)RFIFOP(fd,info->pos[3]);
-
-		if( len < 10 || len != 10 + count * 4)
-		{
-			ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * 4);
+	
+		if( len < 10 || len != 10 + count * s_itl){
+			ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * s_itl);
 			return;
 		}
+	#if PACKETVER < 20130000
 		fail = npc_cashshop_buylist(sd,points,count,item_list);
+	#else PACKETVER >= 20130000
+		cashshop_buylist( sd, points, count, item_list);
+	#endif
 #endif
 	}
 
 	clif_cashshop_ack(sd,fail);
 }
-#endif
 
 /// Adoption System
 ///
@@ -16506,21 +16513,7 @@ void clif_parse_cashshop_list_request( int fd, struct map_session_data* sd ){
 	clif_cashshop_list( fd );
 }
 
-// TODO: find a more accurate date for this
-#if PACKETVER >= 20130320
-void clif_parse_cashshop_buy( int fd, struct map_session_data *sd ){
-	struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
-	uint16 length = RFIFOW( fd, info->pos[0] );
-	uint16 count = RFIFOW( fd, info->pos[1] );
-
-	if( length < 10 || length < ( 10 + count * 6 ) ){
-		return;
-	}
 
-	cashshop_buylist( sd, RFIFOL( fd, info->pos[2] ),
-	    count, (uint16 *)RFIFOP( fd, info->pos[3] ) );
-}
-#endif
 
 void clif_cashshop_result( struct map_session_data *sd, uint16 item_id, uint16 result ){
 	WFIFOHEAD( sd->fd, 16 );

+ 1 - 0
src/map/map.h

@@ -312,6 +312,7 @@ enum mob_ai {
 	AI_FLORA,
 	AI_ZANZOU,
 	AI_LEGION,
+	AI_FAW,
 	AI_MAX
 };
 

+ 16 - 6
src/map/script.c

@@ -8809,11 +8809,11 @@ BUILDIN_FUNC(guildchangegm)
 BUILDIN_FUNC(monster)
 {
 	const char* mapn	= script_getstr(st,2);
-	int x				= script_getnum(st,3);
-	int y				= script_getnum(st,4);
+	int x			= script_getnum(st,3);
+	int y			= script_getnum(st,4);
 	const char* str		= script_getstr(st,5);
-	int class_			= script_getnum(st,6);
-	int amount			= script_getnum(st,7);
+	int class_		= script_getnum(st,6);
+	int amount		= script_getnum(st,7);
 	const char* event	= "";
 	unsigned int size	= SZ_SMALL;
 	unsigned int ai		= AI_NONE;
@@ -8836,7 +8836,7 @@ BUILDIN_FUNC(monster)
 
 	if (script_hasdata(st, 10)) {
 		ai = script_getnum(st, 10);
-		if (ai > 4) {
+		if (ai >= AI_MAX) {
 			ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
 			return 1;
 		}
@@ -11065,6 +11065,7 @@ BUILDIN_FUNC(emotion)
 	return 0;
 }
 
+
 static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list ap)
 {
 	int16 m=va_arg(ap,int);
@@ -11076,7 +11077,7 @@ static int buildin_maprespawnguildid_sub_pc(struct map_session_data* sd, va_list
 	if(
 		(sd->status.guild_id == g_id && flag&1) || //Warp out owners
 		(sd->status.guild_id != g_id && flag&2) || //Warp out outsiders
-		(sd->status.guild_id == 0)	// Warp out players not in guild [Valaris]
+		(sd->status.guild_id == 0 && flag&2)	// Warp out players not in guild
 	)
 		pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
 	return 1;
@@ -11092,6 +11093,15 @@ static int buildin_maprespawnguildid_sub_mob(struct block_list *bl,va_list ap)
 	return 0;
 }
 
+/*
+ * Function to kickout guildies out of a map. (Put them back into thei save point)
+ * (mob are being killed)
+ * m : mapid
+ * g_id : owner guild id
+ * flag & 1 : Warp out owners
+ * flag & 2 : Warp out outsider
+ * flag & 4 : reserved for mob
+ * */
 BUILDIN_FUNC(maprespawnguildid)
 {
 	const char *mapname=script_getstr(st,2);

+ 37 - 15
src/map/skill.c

@@ -10445,6 +10445,10 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
 	 **/
 	case NC_NEUTRALBARRIER:
 	case NC_STEALTHFIELD:
+		if( (sc->data[SC_NEUTRALBARRIER_MASTER] && skill_id == NC_NEUTRALBARRIER) || (sc->data[SC_STEALTHFIELD_MASTER] && skill_id == NC_STEALTHFIELD) ) {
+			skill_clear_unitgroup(src);
+			return 0;
+		}
 		skill_clear_unitgroup(src); // To remove previous skills - cannot used combined
 		if( (sg = skill_unitsetting(src,skill_id,skill_lv,src->x,src->y,0)) != NULL ) {
 			sc_start2(src,src,skill_id == NC_NEUTRALBARRIER ? SC_NEUTRALBARRIER_MASTER : SC_STEALTHFIELD_MASTER,100,skill_lv,sg->group_id,skill_get_time(skill_id,skill_lv));
@@ -10461,7 +10465,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
 			if( md )
 			{
 				md->master_id = src->id;
-				md->special_state.ai = AI_FLORA;
+				md->special_state.ai = AI_FAW;
 				if( md->deletetimer != INVALID_TIMER )
 					delete_timer(md->deletetimer, mob_timer_delete);
 				md->deletetimer = add_timer (gettick() + skill_get_time(skill_id, skill_lv), mob_timer_delete, md->bl.id, 0);
@@ -12557,7 +12561,7 @@ int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int dam
 /*==========================================
  *
  *------------------------------------------*/
-static int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
+int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
 {
 	int *c, skill_id;
 	struct block_list *src;
@@ -15135,18 +15139,17 @@ static int skill_cell_overlap(struct block_list *bl, va_list ap)
 				skill_delunit(unit);
 				return 1;
 			}
-			if( !(skill_get_inf2(unit->group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP)) || unit->group->skill_id == WZ_FIREPILLAR ) { //It deletes everything except songs/dances and traps
+			//It deletes everything except traps and barriers
+			if( !(skill_get_inf2(unit->group->skill_id)&(INF2_TRAP|INF2_NOLP)) || unit->group->skill_id == WZ_FIREPILLAR ) {
 				skill_delunit(unit);
 				return 1;
 			}
 			break;
 		case HW_GANBANTEIN:
 		case LG_EARTHDRIVE:
-			if( !(unit->group->state.song_dance&0x1) ) {// Don't touch song/dance.
-				skill_delunit(unit);
-				return 1;
-			}
-			break;
+			// Officially songs/dances are removed
+			skill_delunit(unit);
+			return 1;
 		case SA_VOLCANO:
 		case SA_DELUGE:
 		case SA_VIOLENTGALE:
@@ -15209,7 +15212,7 @@ static int skill_cell_overlap(struct block_list *bl, va_list ap)
 			break;
 	}
 
-	if (unit->group->skill_id == SA_LANDPROTECTOR && !(skill_get_inf2(skill_id)&(INF2_SONG_DANCE|INF2_TRAP))) {	//It deletes everything except songs/dances/traps
+	if (unit->group->skill_id == SA_LANDPROTECTOR && !(skill_get_inf2(skill_id)&(INF2_TRAP|INF2_NOLP))) { //It deletes everything except traps and barriers
 		(*alive) = 0;
 		return 1;
 	}
@@ -15844,7 +15847,7 @@ int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap) {
 
 	nullpo_ret(group);
 
-	if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP|INF2_NOLP)) && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) )
+	if( !(skill_get_inf2(group->skill_id)&(INF2_TRAP|INF2_NOLP)) && group->skill_id != NC_NEUTRALBARRIER && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) )
 		return 0; //AoE skills are ineffective. [Skotlex]
 
 	if( battle_check_target(&unit->bl,bl,group->target_flag) <= 0 )
@@ -17069,20 +17072,28 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
 	x = sd->sc.comet_x;
 	y = sd->sc.comet_y;
 	sd->sc.comet_x = sd->sc.comet_y = 0;
-	sd->menuskill_val = 0;
-
-	class_ = (nameid == 990 || nameid == 991) ? 2043 + nameid - 990 : (nameid == 992) ? 2046 : 2045;
 
+	// Item picked decides the mob class
+	switch(nameid) {
+		case 990: class_ = 2043; break;
+		case 991: class_ = 2044; break;
+		case 992: class_ = 2046; break;
+		default: class_ = 2045; break;
+	}
 
 	md =  mob_once_spawn_sub(&sd->bl, sd->bl.m, x, y, sd->status.name, class_, "", SZ_SMALL, AI_NONE);
 	if( md ) {
+		struct unit_data *ud = unit_bl2ud(&md->bl);
 		md->master_id = sd->bl.id;
-		md->special_state.ai = AI_FLORA;
+		md->special_state.ai = AI_FAW;
+		if(ud) {
+			ud->skill_id = NC_MAGICDECOY;
+			ud->skill_lv = skill;
+		}
 		if( md->deletetimer != INVALID_TIMER )
 			delete_timer(md->deletetimer, mob_timer_delete);
 		md->deletetimer = add_timer (gettick() + skill_get_time(NC_MAGICDECOY,skill), mob_timer_delete, md->bl.id, 0);
 		mob_spawn(md);
-		md->status.matk_min = md->status.matk_max = 250 + (50 * skill);
 	}
 
 	return 0;
@@ -17908,6 +17919,17 @@ int skill_disable_check(struct status_change *sc, uint16 skill_id)
 		case RA_CAMOUFLAGE:
 			if( sc->data[status_skill2sc(skill_id)] )
 				return 1;
+			break;
+
+		// These 2 skills contain a master and are not correctly pulled using skill2sc
+		case NC_NEUTRALBARRIER:
+			if( sc->data[SC_NEUTRALBARRIER_MASTER] )
+				return 1;
+			break;
+		case NC_STEALTHFIELD:
+			if( sc->data[SC_STEALTHFIELD_MASTER] )
+				return 1;
+			break;
 	}
 
 	return 0;

+ 1 - 0
src/map/skill.h

@@ -312,6 +312,7 @@ int skill_delayfix( struct block_list *bl, uint16 skill_id, uint16 skill_lv);
 // Skill conditions check and remove [Inkfish]
 int skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 int skill_check_condition_castend(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+int skill_check_condition_char_sub (struct block_list *bl, va_list ap);
 int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
 struct skill_condition skill_get_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 int skill_disable_check(struct status_change *sc, uint16 skill_id);

+ 66 - 44
src/map/status.c

@@ -603,7 +603,7 @@ void initChangeTables(void) {
 	set_sc( NC_INFRAREDSCAN		, SC_INFRAREDSCAN	, SI_INFRAREDSCAN	, SCB_FLEE );
 	set_sc( NC_ANALYZE		, SC_ANALYZE		, SI_ANALYZE		, SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 );
 	set_sc( NC_MAGNETICFIELD	, SC_MAGNETICFIELD	, SI_MAGNETICFIELD	, SCB_NONE );
-	set_sc( NC_NEUTRALBARRIER	, SC_NEUTRALBARRIER	, SI_NEUTRALBARRIER	, SCB_NONE );
+	set_sc( NC_NEUTRALBARRIER	, SC_NEUTRALBARRIER	, SI_NEUTRALBARRIER	, SCB_DEF|SCB_MDEF );
 	set_sc( NC_STEALTHFIELD		, SC_STEALTHFIELD	, SI_STEALTHFIELD	, SCB_NONE );
 	/**
 	 * Royal Guard
@@ -1764,8 +1764,6 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
 			if( tsc ) {
 				if( tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)))
 					return 0;
-				if( tsc->data[SC_STEALTHFIELD] && !(status->mode&MD_BOSS) )
-					return 0;
 			}
 	}
 	return 1;
@@ -1895,11 +1893,8 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct
 	// equation, hinting that perhaps non-players should use this for batk.
 	// [Skotlex]
 #ifdef RENEWAL
-	if (bl->type == BL_HOM) {
-		// str = ((rstr + dex + status->luk) / 3) + (((TBL_HOM*)bl)->homunculus.level / 10);
-		str = (((rstr + dex + status->luk) / 3) + (((TBL_HOM*)bl)->homunculus.level / 10))*2; //Because Renewal ATK isn't implemented we adjust the actual ATK until it is
-		return cap_value(str, 0, USHRT_MAX);
-	}
+	if (bl->type == BL_HOM)
+		str = floor((rstr + dex + status->luk) / 3) + floor(((TBL_HOM*)bl)->homunculus.level / 10);
 #endif
 	dstr = str/10;
 	str += dstr*dstr;
@@ -2063,39 +2058,6 @@ int status_calc_mob_(struct mob_data* md, bool first)
 			status->speed = 2;
 	}
 
-	if (flag&16 && mbl)
-	{	//Max HP setting from Summon Flora/marine Sphere
-		struct unit_data *ud = unit_bl2ud(mbl);
-		//Remove special AI when this is used by regular mobs.
-		if (mbl->type == BL_MOB && !((TBL_MOB*)mbl)->special_state.ai)
-			md->special_state.ai = AI_NONE;
-		if (ud)
-		{	// different levels of HP according to skill level
-			switch(ud->skill_id){
-				case AM_SPHEREMINE:
-					status->max_hp = 2000 + 400*ud->skill_lv;
-					break;
-				case KO_ZANZOU:
-					status->max_hp = 3000 + 3000 * ud->skill_lv;
-					break;
-				case AM_CANNIBALIZE:
-					status->max_hp = 1500 + 200*ud->skill_lv + 10*status_get_lv(mbl);
-					status->mode|= MD_CANATTACK|MD_AGGRESSIVE;
-					break;
-				case MH_SUMMON_LEGION:{
-					int homblvl = status_get_lv(mbl);
-					status->max_hp = 10 * (100 * (ud->skill_lv + 2) + homblvl);
-					status->batk = 100 * (ud->skill_lv+5) / 2;
-					status->def = 10 * (100 * (ud->skill_lv+2) + homblvl);
-					//status->aspd_rate = 10 * (2 * (20 - ud->skill_lv) - homblvl/10);
-					//status->aspd_rate = max(100,status->aspd_rate);
-					break;
-				}
-			}
-			status->hp = status->max_hp;
-		}
-	}
-
 	if (flag&1)
 	{	// increase from mobs leveling up [Valaris]
 		int diff = md->level - md->db->lv;
@@ -2178,6 +2140,60 @@ int status_calc_mob_(struct mob_data* md, bool first)
 		}
 	}
 
+	if (flag&16 && mbl)
+	{	//Max HP setting from Summon Flora/marine Sphere
+		struct unit_data *ud = unit_bl2ud(mbl);
+		//Remove special AI when this is used by regular mobs.
+		if (mbl->type == BL_MOB && !((TBL_MOB*)mbl)->special_state.ai)
+			md->special_state.ai = AI_NONE;
+		if (ud)
+		{	// different levels of HP according to skill level
+			if(!ud->skill_id) // FIXME: We lost the unit data for magic decoy in somewhere before this
+				ud->skill_id = ((TBL_PC*)mbl)->menuskill_id;
+			switch(ud->skill_id){
+				case AM_SPHEREMINE:
+					status->max_hp = 2000 + 400*ud->skill_lv;
+					break;
+				case KO_ZANZOU:
+					status->max_hp = 3000 + 3000 * ud->skill_lv;
+					break;
+				case AM_CANNIBALIZE:
+					status->max_hp = 1500 + 200*ud->skill_lv + 10*status_get_lv(mbl);
+					status->mode|= MD_CANATTACK|MD_AGGRESSIVE;
+					break;
+				case MH_SUMMON_LEGION:
+				{
+					int homblvl = status_get_lv(mbl);
+					status->max_hp = 10 * (100 * (ud->skill_lv + 2) + homblvl);
+					status->batk = 100 * (ud->skill_lv+5) / 2;
+					status->def = 10 * (100 * (ud->skill_lv+2) + homblvl);
+					//status->aspd_rate = 10 * (2 * (20 - ud->skill_lv) - homblvl/10);
+					//status->aspd_rate = max(100,status->aspd_rate);
+					break;
+				}
+				case NC_SILVERSNIPER:
+				{
+					struct status_data *mstatus = status_get_status_data(mbl);
+					if(!mstatus)
+						break;
+					status->max_hp = (1000 * ud->skill_lv) + (mstatus->hp / 3) + (status_get_lv(mbl) * 12);
+					status->batk = (((ud->skill_lv > 3)?300:100) + (200 * ud->skill_lv));
+					break;
+				}
+				case NC_MAGICDECOY:
+				{
+					struct status_data *mstatus = status_get_status_data(mbl);
+					if(!mstatus)
+						break;
+					status->max_hp = (1000 * ((TBL_PC*)mbl)->menuskill_val) + (mstatus->hp * 4) + (status_get_lv(mbl) * 12);
+					status->matk_min = status->matk_max = 250 + 50*((TBL_PC*)mbl)->menuskill_val;
+					break;
+				}
+			}
+			status->hp = status->max_hp;
+		}
+	}
+
 	if( first ) //Initial battle status
 		memcpy(&md->status, status, sizeof(struct status_data));
 
@@ -3508,9 +3524,11 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
 		regen->flag = 0;
 
 	if (
-		sc->data[SC_DANCING] || sc->data[SC_OBLIVIONCURSE] || sc->data[SC_MAXIMIZEPOWER]
-		|| (
-			(bl->type == BL_PC && ((TBL_PC*)bl)->class_&MAPID_UPPERMASK) == MAPID_MONK &&
+		sc->data[SC_DANCING] || sc->data[SC_OBLIVIONCURSE] ||
+#ifdef RENEWAL
+		sc->data[SC_MAXIMIZEPOWER] ||
+#endif
+			( (bl->type == BL_PC && ((TBL_PC*)bl)->class_&MAPID_UPPERMASK) == MAPID_MONK &&
 			(sc->data[SC_EXTREMITYFIST] || (sc->data[SC_EXPLOSIONSPIRITS] && (!sc->data[SC_SPIRIT] || sc->data[SC_SPIRIT]->val2 != SL_MONK)))
 			)
 	)	//No natural SP regen
@@ -5016,6 +5034,8 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc,
 		def -= def * ( 14 * sc->data[SC_ANALYZE]->val1 ) / 100;
 	if( sc->data[SC_FORCEOFVANGUARD] )
 		def += def * 2 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100;
+	if( sc->data[SC_NEUTRALBARRIER] )
+		def += def * (10 + sc->data[SC_NEUTRALBARRIER]->val1 * 5) / 100;
 	if(sc->data[SC_SATURDAYNIGHTFEVER])
 		def -= def * (10 + 10 * sc->data[SC_SATURDAYNIGHTFEVER]->val1) / 100;
 	if(sc->data[SC_EARTHDRIVE])
@@ -5127,6 +5147,8 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc,
 		mdef += 25*mdef/100;
 	if(sc->data[SC_FREEZE])
 		mdef += 25*mdef/100;
+	if( sc->data[SC_NEUTRALBARRIER] )
+		mdef += mdef * (10 + sc->data[SC_NEUTRALBARRIER]->val1 * 5) / 100;
 	if( sc->data[SC_MARSHOFABYSS] )
 		mdef -= mdef * ( 6 + 6 * sc->data[SC_MARSHOFABYSS]->val3/10 + (bl->type == BL_MOB ? 5 : 3) * sc->data[SC_MARSHOFABYSS]->val2/36 ) / 100;
 	if(sc->data[SC_ANALYZE])