Преглед на файлове

Merge pull request #36 from Akkarinage/master

Added iRO's Halloween Event 2013.
Removed unused flag in castle_db.txt.
Euphy преди 11 години
родител
ревизия
93c6386319
променени са 5 файла, в които са добавени 735 реда и са изтрити 244 реда
  1. 34 35
      db/castle_db.txt
  2. 1 0
      db/quest_db.txt
  3. 589 0
      npc/events/halloween_2013.txt
  4. 1 0
      npc/scripts_athena.conf
  5. 110 209
      src/map/guild.c

+ 34 - 35
db/castle_db.txt

@@ -8,39 +8,38 @@
 // 03. CastleName               Name of the castle (used by scripts and guardian name tags).
 // 04. OnGuildBreakEventName    NPC unique name to invoke ::OnGuildBreak on, when a occupied
 //                              castle is abandoned during guild break.
-// 05. Flag                     Switch flag (reserved as of athena-dev mod0796~0801, not used by server).
 
-0,aldeg_cas01,Neuschwanstein,Agit#aldeg_cas01,1		// kRO : Noisyubantian
-1,aldeg_cas02,Hohenschwangau,Agit#aldeg_cas02,1		// kRO : Hohensyubangawoo
-2,aldeg_cas03,Nuernberg,Agit#aldeg_cas03,1			// kRO : Nyirenverk
-3,aldeg_cas04,Wuerzburg,Agit#aldeg_cas04,1			// kRO : Byirtsburi
-4,aldeg_cas05,Rothenburg,Agit#aldeg_cas05,1		// kRO : Rotenburk
-5,gefg_cas01,Repherion,Agit#gefg_cas01,1			// kRO : Reprion
-6,gefg_cas02,Eeyolbriggar,Agit#gefg_cas02,1		// kRO : Yolbriger
-7,gefg_cas03,Yesnelph,Agit#gefg_cas03,1			// kRO : Isinlife
-8,gefg_cas04,Bergel,Agit#gefg_cas04,1			// kRO : Berigel
-9,gefg_cas05,Mersetzdeitz,Agit#gefg_cas05,1		// kRO : Melsedetsu
-10,payg_cas01,Bright Arbor,Agit#payg_cas01,1		// kRO : Mingting
-11,payg_cas02,Scarlet Palace,Agit#payg_cas02,1		// kRO : Tiantan
-12,payg_cas03,Holy Shadow,Agit#payg_cas03,1		// kRO : Fuying
-13,payg_cas04,Sacred Altar,Agit#payg_cas04,1		// kRO : Honglou
-14,payg_cas05,Bamboo Grove Hill,Agit#payg_cas05,1	// kRO : Zhulinxian
-15,prtg_cas01,Kriemhild,Agit#prtg_cas01,1			// kRO : Creamhilt
-16,prtg_cas02,Swanhild,Agit#prtg_cas02,1			// kRO : Sbanhealt
-17,prtg_cas03,Fadhgridh,Agit#prtg_cas03,1			// kRO : Lazrigees
-18,prtg_cas04,Skoegul,Agit#prtg_cas04,1			// kRO : Squagul
-19,prtg_cas05,Gondul,Agit#prtg_cas05,1			// kRO : Guindull
-20,nguild_alde,Earth,Agit_N01,2
-21,nguild_gef,Air,Agit_N02,2
-22,nguild_pay,Water,Agit_N03,2
-23,nguild_prt,Fire,Agit_N04,2
-24,schg_cas01,Himinn,Manager#schg_cas01,1			// kRO : Himinn
-25,schg_cas02,Andlangr,Manager#schg_cas02,1			// kRO : Andlangr
-26,schg_cas03,Viblainn,Manager#schg_cas03,1			// kRO : Viblainn
-27,schg_cas04,Hljod,Manager#schg_cas04,1			// kRO : Hljod
-28,schg_cas05,Skidbladnir,Manager#schg_cas05,1			// kRO : Skidbladnir
-29,arug_cas01,Mardol,Manager#arug_cas01,1			// kRO : Mardol
-30,arug_cas02,Cyr,Manager#arug_cas02,1			// kRO : Cyr
-31,arug_cas03,Horn,Manager#arug_cas03,1			// kRO : Horn
-32,arug_cas04,Gefn,Manager#arug_cas04,1			// kRO : Gefn
-33,arug_cas05,Bandis,Manager#arug_cas05,1			// kRO : Bandis
+0,aldeg_cas01,Neuschwanstein,Agit#aldeg_cas01		// kRO : Noisyubantian
+1,aldeg_cas02,Hohenschwangau,Agit#aldeg_cas02		// kRO : Hohensyubangawoo
+2,aldeg_cas03,Nuernberg,Agit#aldeg_cas03			// kRO : Nyirenverk
+3,aldeg_cas04,Wuerzburg,Agit#aldeg_cas04			// kRO : Byirtsburi
+4,aldeg_cas05,Rothenburg,Agit#aldeg_cas05		// kRO : Rotenburk
+5,gefg_cas01,Repherion,Agit#gefg_cas01			// kRO : Reprion
+6,gefg_cas02,Eeyolbriggar,Agit#gefg_cas02		// kRO : Yolbriger
+7,gefg_cas03,Yesnelph,Agit#gefg_cas03			// kRO : Isinlife
+8,gefg_cas04,Bergel,Agit#gefg_cas04			// kRO : Berigel
+9,gefg_cas05,Mersetzdeitz,Agit#gefg_cas05		// kRO : Melsedetsu
+10,payg_cas01,Bright Arbor,Agit#payg_cas01		// kRO : Mingting
+11,payg_cas02,Scarlet Palace,Agit#payg_cas02		// kRO : Tiantan
+12,payg_cas03,Holy Shadow,Agit#payg_cas03		// kRO : Fuying
+13,payg_cas04,Sacred Altar,Agit#payg_cas04		// kRO : Honglou
+14,payg_cas05,Bamboo Grove Hill,Agit#payg_cas05	// kRO : Zhulinxian
+15,prtg_cas01,Kriemhild,Agit#prtg_cas01			// kRO : Creamhilt
+16,prtg_cas02,Swanhild,Agit#prtg_cas02			// kRO : Sbanhealt
+17,prtg_cas03,Fadhgridh,Agit#prtg_cas03			// kRO : Lazrigees
+18,prtg_cas04,Skoegul,Agit#prtg_cas04			// kRO : Squagul
+19,prtg_cas05,Gondul,Agit#prtg_cas05			// kRO : Guindull
+20,nguild_alde,Earth,Agit_N01
+21,nguild_gef,Air,Agit_N02
+22,nguild_pay,Water,Agit_N03
+23,nguild_prt,Fire,Agit_N04
+24,schg_cas01,Himinn,Manager#schg_cas01			// kRO : Himinn
+25,schg_cas02,Andlangr,Manager#schg_cas02			// kRO : Andlangr
+26,schg_cas03,Viblainn,Manager#schg_cas03			// kRO : Viblainn
+27,schg_cas04,Hljod,Manager#schg_cas04			// kRO : Hljod
+28,schg_cas05,Skidbladnir,Manager#schg_cas05			// kRO : Skidbladnir
+29,arug_cas01,Mardol,Manager#arug_cas01			// kRO : Mardol
+30,arug_cas02,Cyr,Manager#arug_cas02			// kRO : Cyr
+31,arug_cas03,Horn,Manager#arug_cas03			// kRO : Horn
+32,arug_cas04,Gefn,Manager#arug_cas04			// kRO : Gefn
+33,arug_cas05,Bandis,Manager#arug_cas05			// kRO : Bandis

+ 1 - 0
db/quest_db.txt

@@ -2026,6 +2026,7 @@
 11337,0,0,0,0,0,0,0,"Dreaming boy"
 
 //11366,0,0,0,0,0,0,0,""
+11378,0,0,0,0,0,0,0,"Trick or treat" // Halloween Event 2013
 
 12000,0,0,0,0,0,0,0,"An old friend"
 12001,0,0,0,0,0,0,0,"Digotz, Maku's old friend"

+ 589 - 0
npc/events/halloween_2013.txt

@@ -0,0 +1,589 @@
+//===== rAthena Script =======================================
+//= Official iRO Halloween Event 2013
+//===== By: ==================================================
+//= Akkarin
+//===== Current Version: =====================================
+//= 1.0
+//===== Compatible With: =====================================
+//= rAthena
+//===== Description: =========================================
+//= This event ran on iRO from 16th Oct to 6th Nov (3 weeks)
+//===== Additional Comments: =================================
+//= 1.0 Conversion from official script -> rAthena. [Akkarin]
+//============================================================
+
+prontera,154,136,5	script	suspicious coffin#2013HE	801,{
+	if (eve_bs < 1) {
+		mes "- the coffin seems very suspicious -";
+		next;
+		switch (select("leave it:knock-knock.")) {
+		case 1:
+			mes "- you left though with doubt. -";
+			close;
+			break;
+		case 2:
+			mes "- tap tap tap -";
+			next;
+			mes "[???]";
+			mes "awwww!!!";
+			mes "W......Who are you!!!";
+			next;
+			mes "- chunk -";
+			mes "- thump -";
+			next;
+			mes "[???]";
+			mes "ouch, my head!!!";
+			next;
+			mes "[???]";
+			mes "are you okay? Trick?";
+			next;
+			mes "[Trick]";
+			mes "i'm fine!";
+			mes "This is not a big deal!";
+			mes "Treat.";
+			next;
+			mes "[Treat]";
+			mes "Your head is pumping out strawberry jam!";
+			mes "Trick.";
+			next;
+			mes "[Trick]";
+			mes "Awwww!";
+			mes "ugh!!!!";
+			mes "i'm gonna die!!!";
+			mes "Oh, no...!!!";
+			next;
+			mes "[Trick]";
+			mes "koff, koff...";
+			mes "i was happy with you.....though it was short time...";
+			mes "Treat....";
+			next;
+			mes "[Trick]";
+			mes "I die.......";
+			next;
+			mes "[Treat]";
+			mes "...";
+			next;
+			mes "[Treat]";
+			mes "Trick.";
+			next;
+			mes "[Treat]";
+			mes "we never die...";
+			mes "we'd died before.";
+			next;
+			mes "[Trick]";
+			mes "yipee, yeah, that's true!";
+			next;
+			mes "[Trick]";
+			mes "i forget everytime as i died for a long time ago.";
+			next;
+			mes "[Trick]";
+			mes "yow!!!";
+			mes "by the way!!!!";
+			mes "we are not supposed to waste time like this!";
+			mes "Treat.";
+			next;
+			mes "[Trick]";
+			mes "we will die if we dont get back to master with ^ff9000'that'^000000...";
+			next;
+			mes "[Treat]";
+			mes "we are dead already...";
+			mes "Trick.";
+			next;
+			mes "[Treat]";
+			mes "we will be bothered by him until we lose his temper at the most.";
+			next;
+			mes "[Trick]";
+			mes "Ah...no...";
+			mes "hurry!";
+			mes "let's go fid 'that' !";
+			mes "Treat.";
+			next;
+			mes "[Treat]";
+			mes "now...";
+			next;
+			mes "[Trick]";
+			mes "^ff9000Ugh, awww, hik, heck!!!!!!!!^000000";
+			next;
+			mes "[Treat]";
+			mes "we gonna die with sun burn if we leave now.";
+			mes "Trick.";
+			next;
+			mes "[Trick]";
+			mes "you MUST say that much important thing in advance!!!!!!!!!";
+			next;
+			mes "[Treat]";
+			mes "this world was good only we were alive.";
+			next;
+			mes "[Trick]";
+			mes "Hey!";
+			mes "You!";
+			next;
+			mes "[Trick]";
+			mes "you are the first man made my head pump out strawberry jam.";
+			mes "would you love..me...?";
+			next;
+			mes "- Crash! -";
+			next;
+			mes "- there is more jam coming out under the coffin. -";
+			next;
+			mes "[Treat]";
+			mes "he is little bit strange as for the jam he bleeded.";
+			mes "Trick..";
+			next;
+			mes "[Trick]";
+			mes "no,treat.";
+			mes "now i feel very refreshed, would you put down that club??.";
+			next;
+			mes "[Trick]";
+			mes "hey you!";
+			mes "i don't blame you for making my head like this but would you help us?";
+			next;
+			mes "[Trick]";
+			mes "don't feel pressured.";
+			mes "the strawberry thing will be recovered after few days of illness.";
+			next;
+			switch (select("help them.:leave it.")) {
+			case 1:
+				mes "[Trick]";
+				mes "haha!";
+				mes "Thanks!";
+				next;
+				switch (select("listen their story.")) {
+				case 1:
+					break;
+				}
+				mes "[Trick]";
+				mes "it is secret...";
+				mes "well, we are dead.";
+				next;
+				mes "- kaboom! -";
+				next;
+				mes "[Trick]";
+				mes "it hurts.";
+				mes "Treat.";
+				next;
+				mes "[Trick]";
+				mes "I will explain properly, just put that down.";
+				next;
+				mes "[Trick]";
+				mes "we are from  ^ff9000'town of the dead' NIffleheim^000000.";
+				next;
+				mes "[Trick]";
+				mes "^ff9000the pumpkins for halloween event on niffleheim^000000 were all disappeared.";
+				next;
+				mes "[Trick]";
+				mes "first we are preparing another cake but Sir, Hell loves pumpkin cake.......halloween without pumpkin cake is like vampire without fang...";
+				next;
+				mes "[Trick]";
+				mes "we came to search pumpkin as our chef is too busy to do with other things,";
+				next;
+				mes "[Trick]";
+				mes "far from searching them, we are at risk for leaving this coffin...";
+				next;
+				mes "[Trick]";
+				mes "^ff9000pumpkins are any of field. please collect organic or non-organic pumpkins for 30 people and bring them to chef. candycon at Niffleheim.^000000";
+				next;
+				mes "[Trick]";
+				mes "organic pumpkin has more valuable,";
+				mes "it is triple times useful!";
+				set eve_bs, 1;
+				setquest 11378;
+				close;
+				break;
+			case 2:
+				mes "[Trick]";
+				mes "Ooops!";
+				mes "well, then we have to go out Treat!";
+				next;
+				mes "[Treat]";
+				mes "Don't worry treat.";
+				mes "we just will be sent back to Niffleheim in the worst case. ";
+				close;
+				break;
+			}
+			break;
+		}
+	} else if (eve_bs == 1) {
+		mes "[Trick]";
+		mes "we are from  ^ff9000'town of the dead' NIffleheim^000000.";
+		next;
+		mes "[Trick]";
+		mes "^ff9000the pumpkins for halloween event on niffleheim^000000 were all disappeared.";
+		next;
+		mes "[Trick]";
+		mes "first we are preparing another cake but Sir, Hell loves pumpkin cake.......halloween without pumpkin cake is like vampire without fang...";
+		next;
+		mes "[Trick]";
+		mes "we came to search pumpkin as our chef is too busy to do with other things,";
+		next;
+		mes "[Trick]";
+		mes "far from searching them, we are at risk for leaving this coffin...";
+		next;
+		mes "[Trick]";
+		mes "^ff9000pumpkins are any of field. please collect organic or non-organic pumpkins for 30 people and bring them to chef. candycon at Niffleheim.^000000";
+		next;
+		mes "[Trick]";
+		mes "organic pumpkin has more valuable,";
+		mes "it is triple times useful!";
+		close;
+	} else if (eve_bs == 2) {
+		if (isbegin_quest(11378) > 0) {
+			mes "[Trick]";
+			mes "^ff9000pumpkins are any of field. please collect organic or non-organic pumpkins for 30 people and bring them to chef. candycon at Niffleheim.^000000";
+			next;
+			mes "[Trick]";
+			mes "organic pumpkin has more valuable,";
+			mes "it is triple times useful!";
+			close;
+		} else {
+			mes "[Trick]";
+			mes "thanks! we won't die for sun burn!";
+			next;
+			mes "[Treat]";
+			mes "Thanks.";
+			next;
+			mes "[Trick]";
+			mes "and if you don't mind, would you please help more?";
+			mes "pumpkin cake is still deficient.";
+			next;
+			mes "[Trick]";
+			mes "last time when i visited there, i saw piled up pumpkin cake which was taller than castle...how much should we make more?";
+			next;
+			switch (select("help them:leave it.")) {
+			case 1:
+				mes "[Trick]";
+				mes "^ff9000pumpkins are any of field. please collect organic or non-organic pumpkins for 30 people and bring them to chef. candycon at Niffleheim.^000000";
+				next;
+				mes "[Trick]";
+				mes "organic pumpkin has more valuable,";
+				mes "it is triple times useful!";
+				setquest 11378;
+				close;
+				break;
+			case 2:
+				mes "[Trick]";
+				mes "Ooops!";
+				mes "well, then we have to go out Treat!";
+				next;
+				mes "[Treat]";
+				mes "Don't worry treat.";
+				mes "we just will be sent back to Niffleheim in the worst case. ";
+				close;
+				break;
+			}
+		}
+	} else {
+	}
+}
+
+niflheim,181,173,5	script	Chef Candycon#2013HE	796,{
+	set .@o_pum, countitem(6804);
+	set .@i_pum, countitem(6805);
+	set .@oo_pum, .@o_pum * 3;
+	set .@pumpum, .@i_pum + .@oo_pum;
+	if (eve_bs == 1) {
+		if (.@pumpum > 29) {
+			mes "[Chef Candycon]";
+			mes "clang~clang~!";
+			next;
+			mes "[Chef Candycon]";
+			mes "Phew... when is the end of making this cake? ...feel like eternal";
+			next;
+			mes "[Chef Candycon]";
+			mes "holy mother! i will hang anyone who suggest to make pumpkin cake on tree from next time.";
+			next;
+			mes "[Chef Candycon]";
+			mes "Though Sir, Hell like this but he doesn't care what pumpkin used. he said he is good with normal but";
+			next;
+			mes "[Chef Candycon]";
+			mes "ALWAYS saying this pumpkin is not good....only the organic is good...what the heck, are you a cook!? if you know cooking that much why you don't you do by yourself!!";
+			next;
+			mes "[Chef Candycon]";
+			mes "and never helped me for escaping pumpkins and pretend busy? UGH! tut";
+			next;
+			mes "[Chef Candycon]";
+			mes "my lord!!!";
+			mes "Hu....Human!!";
+			mes "hub~ (deep breath)..";
+			next;
+			mes "[Chef Candycon]";
+			mes "li.....ving....h....u.... m....a....n....";
+			next;
+			mes "[Chef Candycon]";
+			mes "how...........do....you......come......";
+			mes "to.....town.......... of......... the dead.......";
+			mes "Ni....ffle.......he...im........";
+			next;
+			mes "[Chef Candycon]";
+			mes "he....re....";
+			mes "is.........not........";
+			mes "for..................";
+			mes "li..ving....crea...ture.......";
+			next;
+			switch (select("tell him about pumpkin.")) {
+			case 1:
+				break;
+			}
+			mes "[Chef Candycon]";
+			mes ".....Pu...........m............ki....n.....";
+			next;
+			mes "[Chef Candycon]";
+			mes "It...has...been....";
+			mes "O.....ver....but....";
+			mes "ca...me......a...gain....";
+			next;
+			mes "[" + strcharinfo(0) + "]";
+			mes "Why don't you speak normally.";
+			next;
+			mes "[Chef Candycon]";
+			mes "......";
+			next;
+			mes "[Chef Candycon]";
+			mes "May....may i??";
+			next;
+			mes "[Chef Candycon]";
+			mes "ah...i'm not supposed to speak like this...we also have image making issue....";
+			next;
+			mes "[Chef Candycon]";
+			mes "speaking like this is way better to scare people...heww..however, i can't bare it as it is too stuffy.";
+			next;
+			mes "[Chef Candycon]";
+			mes "anyway! it won't be delayed if those pumpkins didn't escape to midgards.";
+			next;
+			mes "[Chef Candycon]";
+			mes "obviouslt, we are dead so we are pretty weak at sun. we would be a pile of ash if we searched on day time.";
+			next;
+			mes "[Trick]";
+			mes "did you know?! how could you send us to seach pumpkin?!";
+			next;
+			mes "[Chef Candycon]";
+			mes "what? you can walk around after sunset. and you got wings and night vision... and what? ultra sonic..?!!!!";
+			next;
+			mes "[Treat]";
+			mes "so i didn't leave coffin.";
+			next;
+			mes "[Trick]";
+			mes "ah...?!";
+			next;
+			mes "[Chef Candycon]";
+			mes "gosh. how fortune we are for your effort, considering the process after bringing pumpkins";
+			next;
+			switch (select("give pumpkins.")) {
+			case 1:
+				break;
+			}
+			mes "[Chef Candycon]";
+			mes "let me see! correct? yeah that's it! hold on a sec.";
+			next;
+			mes "[Chef Candycon]";
+			mes "well, ^ff9000i need all the pumpkin^000000!";
+			mes "if we dont' work fast, we will late for festival.";
+			next;
+			mes "^ff9000*****WARNING*****^000000";
+			mes "^ff9000you will give all of pumpkin, [ALL]^000000";
+			mes "^ff9000would you proceed?^000000";
+			switch (select("give all of pumpkin.:cancel")) {
+			case 1:
+				if (.@pumpum > 29){
+					if (.@i_pum > 0) { // Inorganic Pumpkin
+						delitem 6805,.@i_pum;
+					}
+					if (.@o_pum > 0) { // Organic Pumpkin
+						delitem 6804,.@o_pum;	
+					}
+					set eve_bs,2;	
+					getitem 22669,1; // Halloween Gift Box
+					erasequest 11378;	
+					mes "[Chef Candycon]";
+					mes "Okay! dig out the inside of pumpkin and like this~ and that~!";
+					next;
+					mes "[Chef Candycon]";
+					mes "Cool! pumpkin has been carved just in shape? this is it for halloween! Halloween without Jack'o lantern can't be real halloween!";
+					next;
+					mes "[Chef Candycon]";
+					mes "take this, it's a reward for bringing pumpkins! Open it, there might be some fun stuff..";
+					close;
+				} else {
+					mes "[Chef Candycon]";
+					mes "Ooops where is pumpkin? escaped again?";
+					mes "Oh, boy...no... you should go to get them again..";
+					close;
+				}
+				break;
+			case 2:
+				mes "[Chef Candycon]";
+				mes "eeh~~ You have no use of those pumpkins~~";
+				close;
+				break;
+			}
+		} else {
+			mes "[Chef Candycon]";
+			mes "li.....ving....h....u.... m....a....n....";
+			next;
+			mes "[Chef Candycon]";
+			mes "how...........do....you......come......";
+			mes "to.....town.......... of......... the dead.......";
+			mes "Ni....ffle.......he...im........";
+			next;
+			mes "[Chef Candycon]";
+			mes "he....re....";
+			mes "is.........not........";
+			mes "for..................";
+			mes "li..ving....crea...ture.......";
+			close;
+		}
+	} else if (eve_bs == 2) {
+		if (isbegin_quest(11378) > 0) {
+			mes "[Chef Candycon]";
+			mes "eh! more pumpkins??";
+			mes "heck.. seriously...how many more left?..";
+			next;
+			mes "[Chef Candycon]";
+			mes "well, ^ff9000i need all the pumpkin^000000!";
+			mes "if we dont' work fast, we will late for festival.";
+			next;
+			mes "^ff9000*****WARNING*****^000000";
+			mes "^ff9000you will give all of pumpkin, [ALL]^000000";
+			mes "^ff9000would you proceed?^000000";
+			switch (select("give all of pumpkin.:cancel")) {
+			case 1:
+				if (.@pumpum > 29){
+					if (.@i_pum > 0) { // Inorganic Pumpkin
+						delitem 6805,.@i_pum;
+					}
+					if (.@o_pum > 0) { // Organic Pumpkin
+						delitem 6804,.@o_pum;
+					}
+					getitem 22669,1;
+					erasequest 11378;
+					mes "[Chef Candycon]";
+					mes "Okay! dig out the inside of pumpkin and like this~ and that~!";
+					next;
+					mes "[Chef Candycon]";
+					mes "Cool! pumpkin has been carved just in shape? this is it for halloween! Halloween without Jack'o lantern can't be real halloween!";
+					next;
+					mes "[Chef Candycon]";
+					mes "take this, it's a reward for bringing pumpkins! Open it, there might be some fun stuff..";
+					close;
+				} else {
+					mes "[Chef Candycon]";
+					mes "Ooops where is pumpkin? escaped again?";
+					mes "Oh, boy...no... you should go to get them again..";
+					close;
+				}
+				break;
+			case 2:
+				mes "[Chef Candycon]";
+				mes "eeh~~ You have no use of those pumpkins~~";
+				close;
+				break;
+			}
+		} else {
+			mes "[Chef Candycon]";
+			mes "Yo! thanks to your delivery, baking cake day and night.";
+			mes "laying on the tomb will not garantee eternal sleeping. T.T ";
+			close;
+		}
+	} else {
+		mes "[Chef Candycon]";
+		mes "li.....ving....h....u.... m....a....n....";
+		next;
+		mes "[Chef Candycon]";
+		mes "how...........do....you......come......";
+		mes "to.....town.......... of......... the dead.......";
+		mes "Ni....ffle.......he...im........";
+		next;
+		mes "[Chef Candycon]";
+		mes "he....re....";
+		mes "is.........not........";
+		mes "for..................";
+		mes "li..ving....crea...ture.......";
+		close;
+	}
+	end;
+}
+
+niflheim,182,177,3	script	Trick#2013HE	799,{
+	if (eve_bs == 1) {
+		mes "[Trick]";
+		mes "it's really fresh, outside of coffin?";
+		mes "have you got 30 pumpkins?";
+		next;
+		mes "[Trick]";
+		mes "If you brought all, deliver them to the chef there.";
+		close;
+	} else if (eve_bs > 1) {
+		mes "[Trick]";
+		mes "what would happen without your help?~";
+		next;
+		mes "[Treat]";
+		mes "maybe, Sir, Hell would have grilled bat, instead of pumpkin cake.";
+		next;
+		mes "[Trick]";
+		mes "Gosh....";
+		close;
+	} else {
+		mes "[Trick]";
+		mes "I don't need sweets!!";
+		mes "as i will just mess up everything! wahahahaa!";
+		close;
+	}
+	end;
+}
+
+niflheim,183,176,3	script	Treat#2013HE	799,{
+	if (eve_bs == 1) {
+		mes "[Treat]";
+		mes "......";
+		close;
+	} else if (eve_bs > 1) {
+		mes "[Treat]";
+		mes "doing good...?";
+		close;
+	} else {
+		mes "[Treat]";
+		mes "-giggle-";
+		close;
+	}
+	end;
+}
+
+niflheim,179,168,5	script	Kentucky#2013HE	800,{
+	mes "[Kentucky]";
+	mes "ho.. these seeds has really deep taste";
+	mes "i will be able to have this kind of seeds no matter how much.";
+	close;
+}
+
+niflheim,177,166,8	script	Chicken#2013HE	800,{
+	mes "[Chicken]";
+	mes "Hey kentucky!!";
+	mes "you are eating alone too much!";
+	close;
+}
+
+niflheim,198,175,5	script	Wandering soul#2013HE	802,{
+	mes "[Wandering soul]";
+	mes "-giggle-";
+	mes "the festival is about to begin...";
+	close;
+}
+
+niflheim,191,180,3	script	Wandering soul#2013HE2	802,{
+	mes "[Wandering soul]";
+	mes "living creatures can't participate in the festival of Niffleheim -giggle- ";
+	close;
+}
+
+niflheim,181,181,5	script	Wandering soul#2013HE3	802,{
+	mes "[Wandering soul]";
+	mes "the festival brought vitality to 'city of the dead'....";
+	mes "doesn't it seem something wrong??";
+	close;
+}
+
+niflheim,183,162,5	script	Wandering soul#2013HE4	802,{
+	mes "[Wandering soul]";
+	mes "soon, the festivel of soul will be here!";
+	close;
+}

+ 1 - 0
npc/scripts_athena.conf

@@ -93,6 +93,7 @@ npc: npc/events/god_se_festival.txt
 //npc: npc/events/halloween_2006.txt
 //npc: npc/events/halloween_2008.txt
 //npc: npc/events/halloween_2009.txt
+//npc: npc/events/halloween_2013.txt
 // - Official idRO Idul Fitri Event
 //npc: npc/events/idul_fitri.txt
 // - Official Lunar New Year (2008) Event (iRO)

+ 110 - 209
src/map/guild.c

@@ -73,8 +73,7 @@ unsigned short guild_flags_count;
 /*==========================================
  * Retrieves and validates the sd pointer for this guild member [Skotlex]
  *------------------------------------------*/
-static TBL_PC* guild_sd_check(int guild_id, int account_id, int char_id)
-{
+static TBL_PC* guild_sd_check(int guild_id, int account_id, int char_id) {
 	TBL_PC* sd = map_id2sd(account_id);
 
 	if (!(sd && sd->status.char_id == char_id))
@@ -90,8 +89,7 @@ static TBL_PC* guild_sd_check(int guild_id, int account_id, int char_id)
 }
 
  // Modified [Komurka]
-int guild_skill_get_max (int id)
-{
+int guild_skill_get_max (int id) {
 	if (id < GD_SKILLBASE || id >= GD_SKILLBASE+MAX_GUILDSKILL)
 		return 0;
 	return guild_skill_tree[id-GD_SKILLBASE].max;
@@ -109,15 +107,13 @@ int guild_checkskill(struct guild *g, int id) {
 /*==========================================
  * guild_skill_tree.txt reading - from jA [Komurka]
  *------------------------------------------*/
-static bool guild_read_guildskill_tree_db(char* split[], int columns, int current)
-{// <skill id>,<max lv>,<req id1>,<req lv1>,<req id2>,<req lv2>,<req id3>,<req lv3>,<req id4>,<req lv4>,<req id5>,<req lv5>
+static bool guild_read_guildskill_tree_db(char* split[], int columns, int current) {// <skill id>,<max lv>,<req id1>,<req lv1>,<req id2>,<req lv2>,<req id3>,<req lv3>,<req id4>,<req lv4>,<req id5>,<req lv5>
 	int k, id, skill_id;
 
 	skill_id = atoi(split[0]);
 	id = skill_id - GD_SKILLBASE;
 
-	if( id < 0 || id >= MAX_GUILDSKILL )
-	{
+	if( id < 0 || id >= MAX_GUILDSKILL ) 	{
 		ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skill_id);
 		return false;
 	}
@@ -125,13 +121,11 @@ static bool guild_read_guildskill_tree_db(char* split[], int columns, int curren
 	guild_skill_tree[id].id = skill_id;
 	guild_skill_tree[id].max = atoi(split[1]);
 
-	if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 )
-	{// enable guild's glory when required for emblems
+	if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 ) 	{// enable guild's glory when required for emblems
 		guild_skill_tree[id].max = 1;
 	}
 
-	for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ )
-	{
+	for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ ) 	{
 		guild_skill_tree[id].need[k].id = atoi(split[k*2+2]);
 		guild_skill_tree[id].need[k].lv = atoi(split[k*2+3]);
 	}
@@ -142,8 +136,7 @@ static bool guild_read_guildskill_tree_db(char* split[], int columns, int curren
 /*==========================================
  * Guild skill check - from jA [Komurka]
  *------------------------------------------*/
-int guild_check_skill_require(struct guild *g,int id)
-{
+int guild_check_skill_require(struct guild *g,int id) {
 	int i;
 	int idx = id-GD_SKILLBASE;
 
@@ -162,8 +155,7 @@ int guild_check_skill_require(struct guild *g,int id)
 	return 1;
 }
 
-static bool guild_read_castledb(char* str[], int columns, int current)
-{// <castle id>,<map name>,<castle name>,<castle event>[,<reserved/unused switch flag>]
+static bool guild_read_castledb(char* str[], int columns, int current) {// <castle id>,<map name>,<castle name>,<castle event>[,<reserved/unused switch flag>]
 	struct guild_castle *gc;
 	int mapindex = mapindex_name2id(str[1]);
 
@@ -181,19 +173,16 @@ static bool guild_read_castledb(char* str[], int columns, int current)
 }
 
 /// lookup: guild id -> guild*
-struct guild* guild_search(int guild_id)
-{
+struct guild* guild_search(int guild_id) {
 	return (struct guild*)idb_get(guild_db,guild_id);
 }
 
 /// lookup: guild name -> guild*
-struct guild* guild_searchname(char* str)
-{
+struct guild* guild_searchname(char* str) {
 	struct guild* g;
 	DBIterator *iter = db_iterator(guild_db);
 
-	for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) )
-	{
+	for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) 	{
 		if( strcmpi(g->name, str) == 0 )
 			break;
 	}
@@ -203,19 +192,16 @@ struct guild* guild_searchname(char* str)
 }
 
 /// lookup: castle id -> castle*
-struct guild_castle* guild_castle_search(int gcid)
-{
+struct guild_castle* guild_castle_search(int gcid) {
 	return (struct guild_castle*)idb_get(castle_db,gcid);
 }
 
 /// lookup: map index -> castle*
-struct guild_castle* guild_mapindex2gc(short mapindex)
-{
+struct guild_castle* guild_mapindex2gc(short mapindex) {
 	struct guild_castle* gc;
 	DBIterator *iter = db_iterator(castle_db);
 
-	for( gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter) )
-	{
+	for( gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter) ) 	{
 		if( gc->mapindex == mapindex )
 			break;
 	}
@@ -225,13 +211,11 @@ struct guild_castle* guild_mapindex2gc(short mapindex)
 }
 
 /// lookup: map name -> castle*
-struct guild_castle* guild_mapname2gc(const char* mapname)
-{
+struct guild_castle* guild_mapname2gc(const char* mapname) {
 	return guild_mapindex2gc(mapindex_name2id(mapname));
 }
 
-struct map_session_data* guild_getavailablesd(struct guild* g)
-{
+struct map_session_data* guild_getavailablesd(struct guild* g) {
 	int i;
 
 	nullpo_retr(NULL, g);
@@ -241,8 +225,7 @@ struct map_session_data* guild_getavailablesd(struct guild* g)
 }
 
 /// lookup: player AID/CID -> member index
-int guild_getindex(struct guild *g,int account_id,int char_id)
-{
+int guild_getindex(struct guild *g,int account_id,int char_id) {
 	int i;
 
 	if( g == NULL )
@@ -253,8 +236,7 @@ int guild_getindex(struct guild *g,int account_id,int char_id)
 }
 
 /// lookup: player sd -> member position
-int guild_getposition(struct guild* g, struct map_session_data* sd)
-{
+int guild_getposition(struct guild* g, struct map_session_data* sd) {
 	int i;
 
 	if( g == NULL && (g=sd->guild) == NULL )
@@ -265,8 +247,7 @@ int guild_getposition(struct guild* g, struct map_session_data* sd)
 }
 
 //Creation of member information
-void guild_makemember(struct guild_member *m,struct map_session_data *sd)
-{
+void guild_makemember(struct guild_member *m,struct map_session_data *sd) {
 	nullpo_retv(sd);
 
 	memset(m,0,sizeof(struct guild_member));
@@ -317,8 +298,7 @@ int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
 	return 0;
 }
 
-int guild_payexp_timer(int tid, unsigned int tick, int id, intptr_t data)
-{
+int guild_payexp_timer(int tid, unsigned int tick, int id, intptr_t data) {
 	guild_expcache_db->clear(guild_expcache_db,guild_payexp_timer_sub);
 	return 0;
 }
@@ -327,22 +307,20 @@ int guild_payexp_timer(int tid, unsigned int tick, int id, intptr_t data)
  * Taken from party_send_xy_timer_sub. [Skotlex]
  * @see DBApply
  */
-int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
-{
+int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
 	struct guild *g = db_data2ptr(data);
 	int i;
 
 	nullpo_ret(g);
 
-	if( !g->connect_member )
-	{// no members connected to this guild so do not iterate
+	if( !g->connect_member ) {
+		// no members connected to this guild so do not iterate
 		return 0;
 	}
 
 	for(i=0;i<g->max_member;i++){
 		struct map_session_data* sd = g->member[i].sd;
-		if( sd != NULL && sd->fd && (sd->guild_x != sd->bl.x || sd->guild_y != sd->bl.y) && !sd->bg_id )
-		{
+		if( sd != NULL && sd->fd && (sd->guild_x != sd->bl.x || sd->guild_y != sd->bl.y) && !sd->bg_id ) {
 			clif_guild_xy(sd);
 			sd->guild_x = sd->bl.x;
 			sd->guild_y = sd->bl.y;
@@ -352,22 +330,19 @@ int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
 }
 
 //Code from party_send_xy_timer [Skotlex]
-static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data)
-{
+static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data) {
 	guild_db->foreach(guild_db,guild_send_xy_timer_sub,tick);
 	return 0;
 }
 
-int guild_send_dot_remove(struct map_session_data *sd)
-{
+int guild_send_dot_remove(struct map_session_data *sd) {
 	if (sd->status.guild_id)
 		clif_guild_xy_remove(sd);
 	return 0;
 }
 //------------------------------------------------------------------------
 
-int guild_create(struct map_session_data *sd, const char *name)
-{
+int guild_create(struct map_session_data *sd, const char *name) {
 	char tname[NAME_LENGTH];
 	struct guild_member m;
 	nullpo_ret(sd);
@@ -378,13 +353,13 @@ int guild_create(struct map_session_data *sd, const char *name)
 	if( !tname[0] )
 		return 0; // empty name
 
-	if( sd->status.guild_id )
-	{// already in a guild
+	if( sd->status.guild_id ) {
+		// already in a guild
 		clif_guild_created(sd,1);
 		return 0;
 	}
-	if( battle_config.guild_emperium_check && pc_search_inventory(sd,ITEMID_EMPERIUM) == -1 )
-	{// item required
+	if( battle_config.guild_emperium_check && pc_search_inventory(sd,ITEMID_EMPERIUM) == -1 ) {
+		// item required
 		clif_guild_created(sd,3);
 		return 0;
 	}
@@ -396,8 +371,7 @@ int guild_create(struct map_session_data *sd, const char *name)
 }
 
 //Whether or not to create guild
-int guild_created(int account_id,int guild_id)
-{
+int guild_created(int account_id,int guild_id) {
 	struct map_session_data *sd=map_id2sd(account_id);
 
 	if(sd==NULL)
@@ -415,24 +389,20 @@ int guild_created(int account_id,int guild_id)
 }
 
 //Information request
-int guild_request_info(int guild_id)
-{
+int guild_request_info(int guild_id) {
 	return intif_guild_request_info(guild_id);
 }
 
 //Information request with event
-int guild_npc_request_info(int guild_id,const char *event)
-{
-	if( guild_search(guild_id) )
-	{
+int guild_npc_request_info(int guild_id,const char *event) {
+	if( guild_search(guild_id) ) {
 		if( event && *event )
 			npc_event_do(event);
 
 		return 0;
 	}
 
-	if( event && *event )
-	{
+	if( event && *event ) {
 		struct eventlist *ev;
 		DBData prev;
 		ev=(struct eventlist *)aCalloc(sizeof(struct eventlist),1);
@@ -446,8 +416,7 @@ int guild_npc_request_info(int guild_id,const char *event)
 }
 
 //Confirmation of the character belongs to guild
-int guild_check_member(struct guild *g)
-{
+int guild_check_member(struct guild *g) {
 	int i;
 	struct map_session_data *sd;
 	struct s_mapiterator* iter;
@@ -455,8 +424,7 @@ int guild_check_member(struct guild *g)
 	nullpo_ret(g);
 
 	iter = mapit_getallusers();
-	for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
-	{
+	for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) ) {
 		if( sd->status.guild_id != g->guild_id )
 			continue;
 
@@ -474,8 +442,7 @@ int guild_check_member(struct guild *g)
 }
 
 //Delete association with guild_id for all characters
-int guild_recv_noinfo(int guild_id)
-{
+int guild_recv_noinfo(int guild_id) {
 	struct map_session_data *sd;
 	struct s_mapiterator* iter;
 
@@ -490,8 +457,7 @@ int guild_recv_noinfo(int guild_id)
 }
 
 //Get and display information for all member
-int guild_recv_info(struct guild *sg)
-{
+int guild_recv_info(struct guild *sg) {
 	struct guild *g,before;
 	int i,bm,m;
 	DBData data;
@@ -636,8 +602,7 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
 
 /// Guild invitation reply.
 /// flag: 0:rejected, 1:accepted
-int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
-{
+int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag) {
 	struct map_session_data* tsd;
 
 	nullpo_ret(sd);
@@ -650,33 +615,28 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
 	//NOTE: this can be NULL because the person might have logged off in the meantime
 	tsd = map_id2sd(sd->guild_invite_account);
 
-	if ( sd->status.guild_id > 0 ) // [Paradox924X]
-	{ // Already in another guild.
+	if ( sd->status.guild_id > 0 ) {
+	// [Paradox924X]
+	 // Already in another guild.
 		if ( tsd ) clif_guild_inviteack(tsd,0);
 		return 0;
-	}
-	else if( flag == 0 )
-	{// rejected
+	} else if( flag == 0 ) {// rejected
 		sd->guild_invite = 0;
 		sd->guild_invite_account = 0;
 		if( tsd ) clif_guild_inviteack(tsd,1);
-	}
-	else
-	{// accepted
+	} else {// accepted
 		struct guild_member m;
 		struct guild* g;
 		int i;
 
-		if( (g=guild_search(guild_id)) == NULL )
-		{
+		if( (g=guild_search(guild_id)) == NULL ) {
 			sd->guild_invite = 0;
 			sd->guild_invite_account = 0;
 			return 0;
 		}
 
 		ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 );
-		if( i == g->max_member )
-		{
+		if( i == g->max_member ) {
 			sd->guild_invite = 0;
 			sd->guild_invite_account = 0;
 			if( tsd ) clif_guild_inviteack(tsd,3);
@@ -695,8 +655,7 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
 //- If guild is not in memory, it is requested
 //- Otherwise sd pointer is set up.
 //- Player must be authed and must belong to a guild before invoking this method
-void guild_member_joined(struct map_session_data *sd)
-{
+void guild_member_joined(struct map_session_data *sd) {
 	struct guild* g;
 	int i;
 	g=guild_search(sd->status.guild_id);
@@ -726,8 +685,7 @@ void guild_member_joined(struct map_session_data *sd)
 /*==========================================
  * Add a player to a given guild_id
  *----------------------------------------*/
-int guild_member_added(int guild_id,int account_id,int char_id,int flag)
-{
+int guild_member_added(int guild_id,int account_id,int char_id,int flag) {
 	struct map_session_data *sd= map_id2sd(account_id),*sd2;
 	struct guild *g;
 
@@ -774,8 +732,7 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
 /*==========================================
  * Player request leaving a given guild_id
  *----------------------------------------*/
-int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
-{
+int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) {
 	struct guild *g;
 
 	nullpo_ret(sd);
@@ -797,8 +754,7 @@ int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int c
 /*==========================================
  * Request remove a player to a given guild_id
  *----------------------------------------*/
-int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
-{
+int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) {
 	struct map_session_data *tsd;
 	struct guild *g;
 	int i,ps;
@@ -830,8 +786,7 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i
 	return 0;
 }
 
-int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, const char* name, const char* mes)
-{
+int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, const char* name, const char* mes) {
 	int i;
 	struct guild* g = guild_search(guild_id);
 	struct map_session_data* sd = map_charid2sd(char_id);
@@ -864,8 +819,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
 	clif_guild_memberlist(online_member_sd);
 
 	// update char, if online
-	if(sd != NULL && sd->status.guild_id == guild_id)
-	{
+	if(sd != NULL && sd->status.guild_id == guild_id) {
 		// do stuff that needs the guild_id first, BEFORE we wipe it
 		if (sd->state.storage_flag == 2) //Close the guild storage.
 			storage_guild_storageclose(sd);
@@ -882,8 +836,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
 }
 
 #ifdef BOUND_ITEMS
-void guild_retrieveitembound(int char_id,int aid,int guild_id)
-{
+void guild_retrieveitembound(int char_id,int aid,int guild_id) {
 	TBL_PC *sd = map_id2sd(aid);
 	if(sd){ //Character is online
 		int idxlist[MAX_INVENTORY];
@@ -899,8 +852,7 @@ void guild_retrieveitembound(int char_id,int aid,int guild_id)
 			}
 			storage_guild_storageclose(sd); //Close and save the storage
 		}
-	}
-	else { //Character is offline, ask char server to do the job
+	} else { //Character is offline, ask char server to do the job
 		struct guild_storage* stor = guild2storage2(guild_id);
 		struct guild *g = guild_search(guild_id);
 		nullpo_retv(g);
@@ -917,8 +869,7 @@ void guild_retrieveitembound(int char_id,int aid,int guild_id)
 }
 #endif
 
-int guild_send_memberinfoshort(struct map_session_data *sd,int online)
-{ // cleaned up [LuzZza]
+int guild_send_memberinfoshort(struct map_session_data *sd,int online) { // cleaned up [LuzZza]
 	struct guild *g;
 
 	nullpo_ret(sd);
@@ -941,8 +892,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 		return 0;
 	}
 
-	if(sd->state.connect_new)
-	{	//Note that this works because it is invoked in parse_LoadEndAck before connect_new is cleared.
+	if(sd->state.connect_new) {	//Note that this works because it is invoked in parse_LoadEndAck before connect_new is cleared.
 		clif_guild_belonginfo(sd,g);
 		clif_guild_notice(sd,g);
 		sd->guild_emblem_id = g->emblem_id;
@@ -950,8 +900,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 	return 0;
 }
 
-int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
-{ // cleaned up [LuzZza]
+int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_) { // cleaned up [LuzZza]
 
 	int i,alv,c,idx=-1,om=0,oldonline=-1;
 	struct guild *g = guild_search(guild_id);
@@ -1016,8 +965,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
 /*====================================================
  * Send a message to whole guild
  *---------------------------------------------------*/
-int guild_send_message(struct map_session_data *sd,const char *mes,int len)
-{
+int guild_send_message(struct map_session_data *sd,const char *mes,int len) {
 	nullpo_ret(sd);
 
 	if(sd->status.guild_id==0)
@@ -1034,8 +982,7 @@ int guild_send_message(struct map_session_data *sd,const char *mes,int len)
 /*====================================================
  * Guild receive a message, will be displayed to whole member
  *---------------------------------------------------*/
-int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
-{
+int guild_recv_message(int guild_id,int account_id,const char *mes,int len) {
 	struct guild *g;
 	if( (g=guild_search(guild_id))==NULL)
 		return 0;
@@ -1046,16 +993,14 @@ int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
 /*====================================================
  * Member changing position in guild
  *---------------------------------------------------*/
-int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx)
-{
+int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx) {
 	return intif_guild_change_memberinfo(guild_id,account_id,char_id,GMI_POSITION,&idx,sizeof(idx));
 }
 
 /*====================================================
  * Notification of new position for member
  *---------------------------------------------------*/
-int guild_memberposition_changed(struct guild *g,int idx,int pos)
-{
+int guild_memberposition_changed(struct guild *g,int idx,int pos) {
 	nullpo_ret(g);
 
 	g->member[idx].position=pos;
@@ -1071,8 +1016,7 @@ int guild_memberposition_changed(struct guild *g,int idx,int pos)
  * Change guild title or member
  *---------------------------------------------------*/
 int guild_change_position(int guild_id,int idx,
-	int mode,int exp_mode,const char *name)
-{
+	int mode,int exp_mode,const char *name) {
 	struct guild_position p;
 
 	exp_mode = cap_value(exp_mode, 0, battle_config.guild_exp_limit);
@@ -1087,8 +1031,7 @@ int guild_change_position(int guild_id,int idx,
 /*====================================================
  * Notification of member has changed his guild title
  *---------------------------------------------------*/
-int guild_position_changed(int guild_id,int idx,struct guild_position *p)
-{
+int guild_position_changed(int guild_id,int idx,struct guild_position *p) {
 	struct guild *g=guild_search(guild_id);
 	int i;
 	if(g==NULL)
@@ -1106,8 +1049,7 @@ int guild_position_changed(int guild_id,int idx,struct guild_position *p)
 /*====================================================
  * Change guild notice
  *---------------------------------------------------*/
-int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2)
-{
+int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2) {
 	nullpo_ret(sd);
 
 	if(guild_id!=sd->status.guild_id)
@@ -1118,8 +1060,7 @@ int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes
 /*====================================================
  * Notification of guild has changed his notice
  *---------------------------------------------------*/
-int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
-{
+int guild_notice_changed(int guild_id,const char *mes1,const char *mes2) {
 	int i;
 	struct guild *g=guild_search(guild_id);
 	if(g==NULL)
@@ -1139,8 +1080,7 @@ int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
 /*====================================================
  * Change guild emblem
  *---------------------------------------------------*/
-int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
-{
+int guild_change_emblem(struct map_session_data *sd,int len,const char *data) {
 	struct guild *g;
 	nullpo_ret(sd);
 
@@ -1156,8 +1096,7 @@ int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
 /*====================================================
  * Notification of guild emblem changed
  *---------------------------------------------------*/
-int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
-{
+int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data) {
 	int i;
 	struct map_session_data *sd;
 	struct guild *g=guild_search(guild_id);
@@ -1217,8 +1156,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
 /**
  * @see DBCreateData
  */
-static DBData create_expcache(DBKey key, va_list args)
-{
+static DBData create_expcache(DBKey key, va_list args) {
 	struct guild_expcache *c;
 	struct map_session_data *sd = va_arg(args, struct map_session_data*);
 
@@ -1233,8 +1171,7 @@ static DBData create_expcache(DBKey key, va_list args)
 /*====================================================
  * Return taxed experience from player sd to guild
  *---------------------------------------------------*/
-unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
-{
+unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp) {
 	struct guild *g;
 	struct guild_expcache *c;
 	int per;
@@ -1269,8 +1206,7 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp)
  * Add this experience to guild exp
  * [Celest]
  *---------------------------------------------------*/
-int guild_getexp(struct map_session_data *sd,int exp)
-{
+int guild_getexp(struct map_session_data *sd,int exp) {
 	struct guild_expcache *c;
 	nullpo_ret(sd);
 
@@ -1288,8 +1224,7 @@ int guild_getexp(struct map_session_data *sd,int exp)
 /*====================================================
  * Ask to increase guildskill skill_id
  *---------------------------------------------------*/
-int guild_skillup(TBL_PC* sd, uint16 skill_id)
-{
+int guild_skillup(TBL_PC* sd, uint16 skill_id) {
 	struct guild* g;
 	int idx = skill_id - GD_SKILLBASE;
 	int max = guild_skill_get_max(skill_id);
@@ -1312,8 +1247,7 @@ int guild_skillup(TBL_PC* sd, uint16 skill_id)
 /*====================================================
  * Notification of guildskill skill_id increase request
  *---------------------------------------------------*/
-int guild_skillupack(int guild_id,uint16 skill_id,int account_id)
-{
+int guild_skillupack(int guild_id,uint16 skill_id,int account_id) {
 	struct map_session_data *sd=map_id2sd(account_id);
 	struct guild *g=guild_search(guild_id);
 	int i;
@@ -1368,8 +1302,7 @@ void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id, uint1
  *	0 = allied
  *	1 = enemy
  *---------------------------------------------------*/
-int guild_get_alliance_count(struct guild *g,int flag)
-{
+int guild_get_alliance_count(struct guild *g,int flag) {
 	int i,c;
 
 	nullpo_ret(g);
@@ -1383,8 +1316,7 @@ int guild_get_alliance_count(struct guild *g,int flag)
 }
 
 // Blocks all guild skills which have a common delay time.
-void guild_block_skill(struct map_session_data *sd, int time)
-{
+void guild_block_skill(struct map_session_data *sd, int time) {
 	uint16 skill_id[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL };
 	int i;
 	for (i = 0; i < 4; i++)
@@ -1398,8 +1330,7 @@ void guild_block_skill(struct map_session_data *sd, int time)
  *	1 = enemy
  * Returns true if yes.
  *---------------------------------------------------*/
-int guild_check_alliance(int guild_id1, int guild_id2, int flag)
-{
+int guild_check_alliance(int guild_id1, int guild_id2, int flag) {
 	struct guild *g;
 	int i;
 
@@ -1414,12 +1345,11 @@ int guild_check_alliance(int guild_id1, int guild_id2, int flag)
 /*====================================================
  * Player sd, asking player tsd an alliance between their 2 guilds
  *---------------------------------------------------*/
-int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
-{
+int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd) {
 	struct guild *g[2];
 	int i;
 
-	if(agit_flag || agit2_flag)	{	// Disable alliance creation during woe [Valaris]
+	if(agit_flag || agit2_flag) {	// Disable alliance creation during woe [Valaris]
 		clif_displaymessage(sd->fd,msg_txt(sd,676)); //"Alliances cannot be made during Guild Wars!"
 		return 0;
 	}	// end addition [Valaris]
@@ -1440,7 +1370,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
 	if(sd->status.guild_id == tsd->status.guild_id)
 		return 0;
 
-	if( guild_get_alliance_count(g[0],0) >= battle_config.max_guild_alliance )	{
+	if( guild_get_alliance_count(g[0],0) >= battle_config.max_guild_alliance ) {
 		clif_guild_allianceack(sd,4);
 		return 0;
 	}
@@ -1472,8 +1402,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
 /*====================================================
  * Player sd, answer to player tsd (account_id) for an alliance request
  *---------------------------------------------------*/
-int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
-{
+int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag) {
 	struct map_session_data *tsd;
 
 	nullpo_ret(sd);
@@ -1533,8 +1462,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
 /*====================================================
  * Player sd asking to break alliance with guild guild_id
  *---------------------------------------------------*/
-int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
-{
+int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) {
 	nullpo_ret(sd);
 
 	if(agit_flag || agit2_flag)	{	// Disable alliance breaking during woe [Valaris]
@@ -1549,8 +1477,7 @@ int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
 /*====================================================
  * Player sd, asking player tsd a formal enemy relation between their 2 guilds
  *---------------------------------------------------*/
-int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
-{
+int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd) {
 	struct guild *g;
 	int i;
 
@@ -1623,13 +1550,10 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
 	}
 
 	if (!(flag & 0x08)) { // new relationship
-		for(i=0;i<2-(flag&1);i++)
-		{
-			if(g[i]!=NULL)
-			{
+		for(i=0;i<2-(flag&1);i++) {
+			if(g[i]!=NULL) {
 				ARR_FIND( 0, MAX_GUILDALLIANCE, j, g[i]->alliance[j].guild_id == 0 );
-				if( j < MAX_GUILDALLIANCE )
-				{
+				if( j < MAX_GUILDALLIANCE ) {
 					g[i]->alliance[j].guild_id=guild_id[1-i];
 					memcpy(g[i]->alliance[j].name,guild_name[1-i],NAME_LENGTH);
 					g[i]->alliance[j].opposition=flag&1;
@@ -1637,10 +1561,8 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
 			}
 		}
 	} else { // remove relationship
-		for(i=0;i<2-(flag&1);i++)
-		{
-			if(g[i]!=NULL)
-			{
+		for(i=0;i<2-(flag&1);i++) {
+			if(g[i]!=NULL) {
 				for(j=0;j<g[i]->max_member;j++) channel_pcquit(g[i]->member[j].sd,2); //leave all alliance chan
 				ARR_FIND( 0, MAX_GUILDALLIANCE, j, g[i]->alliance[j].guild_id == guild_id[1-i] && g[i]->alliance[j].opposition == (flag&1) );
 				if( j < MAX_GUILDALLIANCE )
@@ -1677,8 +1599,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
  * Notification for the guild disbanded
  * @see DBApply
  */
-int guild_broken_sub(DBKey key, DBData *data, va_list ap)
-{
+int guild_broken_sub(DBKey key, DBData *data, va_list ap) {
 	struct guild *g = db_data2ptr(data);
 	int guild_id=va_arg(ap,int);
 	int i,j;
@@ -1723,8 +1644,7 @@ int castle_guild_broken_sub(DBKey key, DBData *data, va_list ap)
 }
 
 //Invoked on /breakguild "Guild name"
-int guild_broken(int guild_id,int flag)
-{
+int guild_broken(int guild_id,int flag) {
 	struct guild *g = guild_search(guild_id);
 	int i;
 
@@ -1754,8 +1674,7 @@ int guild_broken(int guild_id,int flag)
 }
 
 //Changes the Guild Master to the specified player. [Skotlex]
-int guild_gm_change(int guild_id, struct map_session_data *sd)
-{
+int guild_gm_change(int guild_id, struct map_session_data *sd) {
 	struct guild *g;
 	nullpo_ret(sd);
 
@@ -1775,8 +1694,7 @@ int guild_gm_change(int guild_id, struct map_session_data *sd)
 }
 
 //Notification from Char server that a guild's master has changed. [Skotlex]
-int guild_gm_changed(int guild_id, int account_id, int char_id)
-{
+int guild_gm_changed(int guild_id, int account_id, int char_id) {
 	struct guild *g;
 	struct guild_member gm;
 	int pos, i;
@@ -1815,10 +1733,8 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
 	}
 
 	// announce the change to all guild members
-	for( i = 0; i < g->max_member; i++ )
-	{
-		if( g->member[i].sd && g->member[i].sd->fd )
-		{
+	for( i = 0; i < g->max_member; i++ ) {
+		if( g->member[i].sd && g->member[i].sd->fd ) {
 			clif_guild_basicinfo(g->member[i].sd);
 			clif_guild_memberlist(g->member[i].sd);
 		}
@@ -1830,8 +1746,7 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
 /*====================================================
  * Guild disbanded
  *---------------------------------------------------*/
-int guild_break(struct map_session_data *sd,char *name)
-{
+int guild_break(struct map_session_data *sd,char *name) {
 	struct guild *g;
 	int i;
 #ifdef BOUND_ITEMS
@@ -1873,8 +1788,7 @@ int guild_break(struct map_session_data *sd,char *name)
  * Creates a list of guild castle IDs to be requested
  * from char-server.
  */
-void guild_castle_map_init(void)
-{
+void guild_castle_map_init(void) {
 	int num = db_size(castle_db);
 
 	if (num > 0) {
@@ -1903,8 +1817,7 @@ void guild_castle_map_init(void)
  * @param index Type of data to change
  * @param value New value
  */
-int guild_castledatasave(int castle_id, int index, int value)
-{
+int guild_castledatasave(int castle_id, int index, int value) {
 	struct guild_castle *gc = guild_castle_search(castle_id);
 
 	if (gc == NULL) {
@@ -1964,8 +1877,7 @@ int guild_castledatasave(int castle_id, int index, int value)
 	return 0;
 }
 
-void guild_castle_reconnect_sub(void *key, void *data, va_list ap)
-{
+void guild_castle_reconnect_sub(void *key, void *data, va_list ap) {
 	int castle_id = GetWord((int)__64BPRTSIZE(key), 0);
 	int index = GetWord((int)__64BPRTSIZE(key), 1);
 	intif_guild_castle_datasave(castle_id, index, *(int *)data);
@@ -1977,8 +1889,7 @@ void guild_castle_reconnect_sub(void *key, void *data, va_list ap)
  * disconnected.
  * On reconnect pushes all changes to char-server for saving.
  */
-void guild_castle_reconnect(int castle_id, int index, int value)
-{
+void guild_castle_reconnect(int castle_id, int index, int value) {
 	static struct linkdb_node *gc_save_pending = NULL;
 
 	if (castle_id < 0) { // char-server reconnected
@@ -1993,8 +1904,7 @@ void guild_castle_reconnect(int castle_id, int index, int value)
 }
 
 // Load castle data then invoke OnAgitInit* on last
-int guild_castledataloadack(int len, struct guild_castle *gc)
-{
+int guild_castledataloadack(int len, struct guild_castle *gc) {
 	int i;
 	int n = (len-4) / sizeof(struct guild_castle);
 	int ev;
@@ -2008,10 +1918,8 @@ int guild_castledataloadack(int len, struct guild_castle *gc)
 	if( ev < 0 ) { //No castles owned, invoke OnAgitInit as it is.
 		npc_event_doall("OnAgitInit");
 		npc_event_doall("OnAgitInit2");
-	}
-	else // load received castles into memory, one by one
-	for( i = 0; i < n; i++, gc++ )
-	{
+	} else // load received castles into memory, one by one
+	for( i = 0; i < n; i++, gc++ ) {
 		struct guild_castle *c = guild_castle_search(gc->castle_id);
 		if (!c) {
 			ShowError("guild_castledataloadack: castle id=%d not found.\n", gc->castle_id);
@@ -2021,8 +1929,7 @@ int guild_castledataloadack(int len, struct guild_castle *gc)
 		// update map-server castle data with new info
 		memcpy(&c->guild_id, &gc->guild_id, sizeof(struct guild_castle) - offsetof(struct guild_castle, guild_id));
 
-		if( c->guild_id )
-		{
+		if( c->guild_id ) {
 			if( i != ev )
 				guild_request_info(c->guild_id);
 			else { // last owned one
@@ -2038,8 +1945,7 @@ int guild_castledataloadack(int len, struct guild_castle *gc)
 /*====================================================
  * Start normal woe and triggers all npc OnAgitStart
  *---------------------------------------------------*/
-void guild_agit_start(void)
-{	// Run All NPC_Event[OnAgitStart]
+void guild_agit_start(void) {	// Run All NPC_Event[OnAgitStart]
 	int c = npc_event_doall("OnAgitStart");
 	ShowStatus("NPC_Event:[OnAgitStart] Run (%d) Events by @AgitStart.\n",c);
 }
@@ -2047,8 +1953,7 @@ void guild_agit_start(void)
 /*====================================================
  * End normal woe and triggers all npc OnAgitEnd
  *---------------------------------------------------*/
-void guild_agit_end(void)
-{	// Run All NPC_Event[OnAgitEnd]
+void guild_agit_end(void) {	// Run All NPC_Event[OnAgitEnd]
 	int c = npc_event_doall("OnAgitEnd");
 	ShowStatus("NPC_Event:[OnAgitEnd] Run (%d) Events by @AgitEnd.\n",c);
 }
@@ -2056,8 +1961,7 @@ void guild_agit_end(void)
 /*====================================================
  * Start woe2 and triggers all npc OnAgitStart2
  *---------------------------------------------------*/
-void guild_agit2_start(void)
-{	// Run All NPC_Event[OnAgitStart2]
+void guild_agit2_start(void) {	// Run All NPC_Event[OnAgitStart2]
 	int c = npc_event_doall("OnAgitStart2");
 	ShowStatus("NPC_Event:[OnAgitStart2] Run (%d) Events by @AgitStart2.\n",c);
 }
@@ -2065,15 +1969,13 @@ void guild_agit2_start(void)
 /*====================================================
  * End woe2 and triggers all npc OnAgitEnd2
  *---------------------------------------------------*/
-void guild_agit2_end(void)
-{	// Run All NPC_Event[OnAgitEnd2]
+void guild_agit2_end(void) {	// Run All NPC_Event[OnAgitEnd2]
 	int c = npc_event_doall("OnAgitEnd2");
 	ShowStatus("NPC_Event:[OnAgitEnd2] Run (%d) Events by @AgitEnd2.\n",c);
 }
 
 // How many castles does this guild have?
-int guild_checkcastles(struct guild *g)
-{
+int guild_checkcastles(struct guild *g) {
 	int nb_cas = 0;
 	struct guild_castle* gc = NULL;
 	DBIterator *iter = db_iterator(castle_db);
@@ -2088,8 +1990,7 @@ int guild_checkcastles(struct guild *g)
 }
 
 // Are these two guilds allied?
-bool guild_isallied(int guild_id, int guild_id2)
-{
+bool guild_isallied(int guild_id, int guild_id2) {
 	int i;
 	struct guild* g = guild_search(guild_id);
 	nullpo_ret(g);
@@ -2206,7 +2107,7 @@ void do_init_guild(void) {
 		char* dbsubpath1 = aMalloc(n1+1);
 		safesnprintf(dbsubpath1,n1+1,"%s/%s",db_path,dbsubpath[i]);
 		
-		sv_readdb(dbsubpath1, "castle_db.txt", ',', 4, 5, -1, &guild_read_castledb, i);
+		sv_readdb(dbsubpath1, "castle_db.txt", ',', 4, 4, -1, &guild_read_castledb, i);
 		sv_readdb(dbsubpath1, "guild_skill_tree.txt", ',', 2+MAX_GUILD_SKILL_REQUIRE*2, 2+MAX_GUILD_SKILL_REQUIRE*2, -1, &guild_read_guildskill_tree_db, i); //guild skill tree [Komurka]
 		
 		aFree(dbsubpath1);