فهرست منبع

* Initial implementation of Octopus Cave instance.
* Changed encoding on new cli and msg_* files from r17152, r17153.
* Replaced a couple of characters in source files that caused encoding issues.
* Updated SQL database from r17157.

> Hercules merges:
* 915365b:
Updated official behavior of warp portal dealing with skill requirement and casting.

* 6c6fbf0:
Updated quest_db with some Port Malaya entries.

* adda8d7:
Updated SN_SIGHT to its RE behavior. True Sight stacks with skillratios now, instead of multiplying final damage.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17158 54d463be-8e91-2dee-dedb-b68131a5f0ec

euphyy 12 سال پیش
والد
کامیت
f24741fbd3
12فایلهای تغییر یافته به همراه1173 افزوده شده و 438 حذف شده
  1. 129 129
      conf/msg_conf/char_msg.conf
  2. 26 26
      conf/msg_conf/login_msg.conf
  3. 16 2
      db/quest_db.txt
  4. 713 0
      npc/re/instances/OctopusCave.txt
  5. 3 0
      npc/re/scripts_athena.conf
  6. 6 6
      sql-files/mob_db.sql
  7. 136 136
      src/common/cli.c
  8. 40 40
      src/common/cli.h
  9. 71 71
      src/common/msg_conf.c
  10. 20 20
      src/common/msg_conf.h
  11. 7 2
      src/map/battle.c
  12. 6 6
      src/map/skill.c

+ 129 - 129
conf/msg_conf/char_msg.conf

@@ -1,129 +1,129 @@
-// rAthena msg_athena.conf
-// Message Configuration of char-server
-// -----------------------
-0: Novice
-1: Swordsman
-2: Magician
-3: Archer
-4: Acolyte
-5: Merchant
-6: Thief
-7: Knight
-8: Priest
-9: Wizard
-10: Blacksmith
-11: Hunter
-12: Assassin
-13: Crusader
-14: Monk
-15: Sage
-16: Rogue
-17: Alchemist
-18: Bard
-19: Dancer
-20: Wedding
-21: Super Novice
-22: Gunslinger
-23: Ninja
-24: Christmas
-25: High Novice
-26: High Swordsman
-27: High Magician
-28: High Archer
-29: High Acolyte
-30: High Merchant
-31: High Thief
-32: Lord Knight
-33: High Priest
-34: High Wizard
-35: Whitesmith
-//35: Mastersmith //IRO name
-36: Sniper
-37: Assassin Cross
-38: Paladin
-39: Champion
-40: Professor
-//40: Scholar //IRO name
-41: Stalker
-42: Creator
-//42: Biochemist //IRO Name
-43: Clown
-//43: Minstrel //IRO Name
-44: Gypsy
-45: Baby Novice
-46: Baby Swordsman
-47: Baby Magician
-48: Baby Archer
-49: Baby Acolyte
-50: Baby Merchant
-51: Baby Thief
-52: Baby Knight
-53: Baby Priest
-54: Baby Wizard
-55: Baby Blacksmith
-56: Baby Hunter
-57: Baby Assassin
-58: Baby Crusader
-59: Baby Monk
-60: Baby Sage
-61: Baby Rogue
-62: Baby Alchemist
-63: Baby Bard
-64: Baby Dancer
-65: Super Baby
-66: Taekwon
-67: Star Gladiator
-68: Soul Linker
-//79: FREE
-//70: FREE
-71: Summer
-72: Gangsi
-73: Death Knight
-74: Dark Collector
-75: Rune Knight
-76: Warlock
-77: Ranger
-78: Arch Bishop
-79: Mechanic
-80: Guillotine Cross
-81: Royal Guard
-82: Sorcerer
-83: Minstrel
-//83: Maestro //IRO Name
-84: Wanderer
-85: Sura
-86: Genetic
-//86: Geneticist //IRO Name
-87: Shadow Chaser
-88: Baby Rune Knight
-89: Baby Warlock
-90: Baby Ranger
-91: Baby Arch Bishop
-92: Baby Mechanic
-93: Baby Guillotine Cross
-94: Baby Royal Guard
-95: Baby Sorcerer
-96: Baby Minstrel
-97: Baby Wanderer
-98: Baby Sura
-99: Baby Genetic
-100: Baby Shadow Chaser
-101: Expanded Super Novice
-102: Expanded Super Baby
-103: Kagerou
-104: Oboro
-105: Unknown Job
-
-//Auction
-200: Auction Manager
-201: Auction
-202: Thanks, you won the auction!.
-203: Payment for your auction!.
-204: No buyers have been found for your auction.
-205: Auction canceled.
-206: Auction closed.
-207: Auction winner.
-208: Someone has placed a higher bid.
-209: You have placed a higher bid.
-210: You have won the auction.
-211: Payment for your auction!.
+// rAthena msg_athena.conf
+// Message Configuration of char-server
+// -----------------------
+0: Novice
+1: Swordsman
+2: Magician
+3: Archer
+4: Acolyte
+5: Merchant
+6: Thief
+7: Knight
+8: Priest
+9: Wizard
+10: Blacksmith
+11: Hunter
+12: Assassin
+13: Crusader
+14: Monk
+15: Sage
+16: Rogue
+17: Alchemist
+18: Bard
+19: Dancer
+20: Wedding
+21: Super Novice
+22: Gunslinger
+23: Ninja
+24: Christmas
+25: High Novice
+26: High Swordsman
+27: High Magician
+28: High Archer
+29: High Acolyte
+30: High Merchant
+31: High Thief
+32: Lord Knight
+33: High Priest
+34: High Wizard
+35: Whitesmith
+//35: Mastersmith //IRO name
+36: Sniper
+37: Assassin Cross
+38: Paladin
+39: Champion
+40: Professor
+//40: Scholar //IRO name
+41: Stalker
+42: Creator
+//42: Biochemist //IRO Name
+43: Clown
+//43: Minstrel //IRO Name
+44: Gypsy
+45: Baby Novice
+46: Baby Swordsman
+47: Baby Magician
+48: Baby Archer
+49: Baby Acolyte
+50: Baby Merchant
+51: Baby Thief
+52: Baby Knight
+53: Baby Priest
+54: Baby Wizard
+55: Baby Blacksmith
+56: Baby Hunter
+57: Baby Assassin
+58: Baby Crusader
+59: Baby Monk
+60: Baby Sage
+61: Baby Rogue
+62: Baby Alchemist
+63: Baby Bard
+64: Baby Dancer
+65: Super Baby
+66: Taekwon
+67: Star Gladiator
+68: Soul Linker
+//79: FREE
+//70: FREE
+71: Summer
+72: Gangsi
+73: Death Knight
+74: Dark Collector
+75: Rune Knight
+76: Warlock
+77: Ranger
+78: Arch Bishop
+79: Mechanic
+80: Guillotine Cross
+81: Royal Guard
+82: Sorcerer
+83: Minstrel
+//83: Maestro //IRO Name
+84: Wanderer
+85: Sura
+86: Genetic
+//86: Geneticist //IRO Name
+87: Shadow Chaser
+88: Baby Rune Knight
+89: Baby Warlock
+90: Baby Ranger
+91: Baby Arch Bishop
+92: Baby Mechanic
+93: Baby Guillotine Cross
+94: Baby Royal Guard
+95: Baby Sorcerer
+96: Baby Minstrel
+97: Baby Wanderer
+98: Baby Sura
+99: Baby Genetic
+100: Baby Shadow Chaser
+101: Expanded Super Novice
+102: Expanded Super Baby
+103: Kagerou
+104: Oboro
+105: Unknown Job
+
+//Auction
+200: Auction Manager
+201: Auction
+202: Thanks, you won the auction!.
+203: Payment for your auction!.
+204: No buyers have been found for your auction.
+205: Auction canceled.
+206: Auction closed.
+207: Auction winner.
+208: Someone has placed a higher bid.
+209: You have placed a higher bid.
+210: You have won the auction.
+211: Payment for your auction!.

+ 26 - 26
conf/msg_conf/login_msg.conf

@@ -1,26 +1,26 @@
-// rAthena msg_athena.conf
-// Message Configuration of login-server
-// -----------------------
-0: Unregistered ID.
-1: Incorrect Password.
-2: Account Expired.
-3: Rejected from server.
-4: Blocked by GM.
-5: Not latest game EXE.
-6: Banned.
-7: Server Over-population.
-8: Account limit from company
-9: Ban by DBA
-10: Email not confirmed
-11: Ban by GM
-12: Working in DB
-13: Self Lock
-14: Not Permitted Group
-15: Not Permitted Group
-16: Account gone.
-17: Login info remains.
-18: Hacking investigation.
-19: Bug investigation.
-20: Deleting char.
-21: Deleting spouse char.
-22: Unknown Error.
+// rAthena msg_athena.conf
+// Message Configuration of login-server
+// -----------------------
+0: Unregistered ID.
+1: Incorrect Password.
+2: Account Expired.
+3: Rejected from server.
+4: Blocked by GM.
+5: Not latest game EXE.
+6: Banned.
+7: Server Over-population.
+8: Account limit from company
+9: Ban by DBA
+10: Email not confirmed
+11: Ban by GM
+12: Working in DB
+13: Self Lock
+14: Not Permitted Group
+15: Not Permitted Group
+16: Account gone.
+17: Login info remains.
+18: Hacking investigation.
+19: Bug investigation.
+20: Deleting char.
+21: Deleting spouse char.
+22: Unknown Error.

+ 16 - 2
db/quest_db.txt

@@ -465,6 +465,8 @@
 4195,0,1255,30,0,0,0,0,"Paradise: Neraid Handling"
 4196,0,1506,30,0,0,0,0,"Paradise: Disguise Handling"
 
+4197,10800,0,0,0,0,0,0,"Octopus"
+
 5000,0,0,0,0,0,0,0,"The Crow of the Fate - 7"
 
 5035,0,0,0,0,0,0,0,"Help the old man!"
@@ -878,6 +880,20 @@
 7345,0,0,0,0,0,0,0,"List of Errands"
 7346,0,0,0,0,0,0,0,"List of Errands"
 
+// Port Malaya
+7350,0,0,0,0,0,0,0,"Cautious Village"
+7351,0,0,0,0,0,0,0,"Better than My Old Button"
+7352,0,0,0,0,0,0,0,"Sailor Wants a Button"
+7353,0,0,0,0,0,0,0,"Old Man Wants a Button"
+7354,0,0,0,0,0,0,0,"Young Man Wants a Button"
+7355,0,0,0,0,0,0,0,"Merchant Wants a Button"
+7356,0,0,0,0,0,0,0,"Little Kid Wants a Button"
+7357,0,0,0,0,0,0,0,"Middle-aged Guy Wants a Button"
+7358,0,0,0,0,0,0,0,"Why do they want my Buttons?"
+7360,0,0,0,0,0,0,0,"Deliver Holy Item to Old Man"
+7363,0,0,0,0,0,0,0,"Deliver Holy Item to Little Kid"
+7364,0,0,0,0,0,0,0,"Deliver Holy Item to Middle-aged Man"
+
 8000,0,0,0,0,0,0,0,"Quitting Job Change"
 8001,0,0,0,0,0,0,0,"Job Change to Assassin"
 8002,0,0,0,0,0,0,0,"Job Change to Assassin"
@@ -2283,8 +2299,6 @@
 1115,0,0,0,0,0,0,0,"Ropewa & Yuridi - Song of the Abyss"
 1116,0,0,0,0,0,0,0,"Ropewa & Yuridi - Dead Man's Song"
 1117,0,0,0,0,0,0,0,"Ropewa & Yuridi - Eternal Promise, Broken Ring"
-
-// Ropewa Clue Quest
 1118,0,0,0,0,0,0,0,"Neighborhood Knight - I Need Clues"
 
 // Researcher's Quest

+ 713 - 0
npc/re/instances/OctopusCave.txt

@@ -0,0 +1,713 @@
+//===== rAthena Script ======================================= 
+//= Octopus Cave 
+//===== By: ================================================== 
+//= Muad_Dib
+//===== Current Version: ===================================== 
+//= 1.0
+//===== Compatible With: ===================================== 
+//= rAthena SVN
+//===== Description: ========================================= 
+//= [Official Conversion]
+//= Defeat the Disgusting Octopus.
+//===== Additional Comments: ================================= 
+//= 1.0 First version. [Euphy]
+//============================================================ 
+
+mal_dun01,151,235,5	script	Starfish	551,{
+
+	set .@party_id,getcharid(1);
+	set .@md_name$,"Octopus Cave";
+
+	if (!.@party_id) {
+		mes "[Starfish]";
+		mes "You alone is powerless, hehe!";
+		mes "Better get someone to help you out.";
+		mes "Make a party, and come back later.";
+		close;
+	}
+	if (getcharid(0) != getpartyleader(.@party_id,2)) {
+		mes "[Starfish]";
+		mes "Where is your leader, hehe.";
+		mes "I don't talk to some random people.";
+		mes "Bring your boss to me.";
+		close;
+	}
+	mes "[Starfish]";
+	mes "I am guarding here, hehe!";
+	mes "It is just roughly blocked for now.";
+	mes "But someday this cave must be sealed forever, hehe!";
+	next;
+	while (1) {
+		switch(select("Ask what's going on.:Ask to open the gate.:Go to other location.")) {
+		case 1:
+			mes "[Starfish]";
+			mes "Lately, our Starfish lady is";
+			mes "suffering with some issues, ooh ooh.";
+			mes "Something bad happen in this";
+			mes "peaceful place, hehe!";
+			next;
+			mes "[Starfish]";
+			mes "Weird looking limbs came out";
+			mes "from the hole there,";
+			mes "tried to kidnap our lady Starfish.";
+			mes "Ooh Ooh.";
+			next;
+			mes "[Starfish]";
+			mes "It seems those limbs belong to";
+			mes "that ugly octopus.";
+			mes "That monster should be taken care of,";
+			mes "but it's hard for ourselves only to make it happen, hehe.";
+			next;
+			mes "[Starfish]";
+			mes "I want to find someone special,";
+			mes "and ask to punish this ugly octopus.";
+			mes "I hope this octopus won't ever";
+			mes "harass our lady, hehe.";
+			next;
+			mes "[Starfish]";
+			mes "Go catch that octopus and stick it to this pick.";
+			mes "If you bring back the pick, I will";
+			mes "open this gate for a while.";
+			mes "You should challenge if you are interested, hehe.";
+			next;
+			break;
+		case 2:
+			set .@playtime, checkquest(4197,PLAYTIME);
+			if (.@playtime == 0 || .@playtime == 1) {
+				mes "[Starfish]";
+				mes "Octopus is not around now, hehe.";
+				mes "Please come back later.";
+				close;
+			}
+			if (.@playtime == 2) erasequest 4197;
+			if (countitem(6442)) {
+				set .@instance, instance_create(.@md_name$,.@party_id);
+				if (.@instance < 0) {
+					mes "[Starfish]";
+					mes "Party name is... "+getpartyname(.@party_id)+".";
+					mes "Party leader is... "+strcharinfo(0)+".";
+					mes "^0000ff"+.@md_name$+"^000000, I cannot open now, hehe.";
+					mes "Now is not the time, please wait.";
+					close;
+				}
+				if (instance_attachmap("1@cash",.@instance) == "") {
+					mes "^0000ff"+.@md_name$+"^000000 - Reservation Failed!";
+					instance_destroy(.@instance);
+					close;
+				}
+				instance_attach(.@instance);
+				instance_set_timeout 3600,300,.@instance;
+				instance_init(.@instance);
+
+				donpcevent instance_npcname("oct_enter", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_enter_broad", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot_4", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot1", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot_exit1", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot2", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot_exit2", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot3", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot_exit3", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot4", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_foot_exit4", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_mob_con", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_backattack1", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_backattack2", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_backattack3", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_backattack4", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_boss_con", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_boss_foot", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_boss_warp", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_exit_1", instance_id())+"::OnInstanceInit";
+				donpcevent instance_npcname("oct_exit_2", instance_id())+"::OnInstanceInit";
+
+				mes "[Starfish]";
+				mes "I will open the gate for a while to ^0000ff"+.@md_name$+"^000000.";
+				mes "Please catch that pervert octopus,";
+				mes "and come back with it sticked to the pick, hehe.";
+				close;
+			}
+			mes "[Starfish]";
+			mes "Prepare a pick first,";
+			mes "so you can thread that octopus";
+			mes "with that pick.";
+			mes "Then, I will let you in for a while, hehe.";
+			close;
+		case 3:
+			mes "[Starfish]";
+			mes "This is not a good location, check someplace else.";
+			close;
+		}
+	}
+}
+
+mal_dun01,153,237,5	script	Weird Entrance	844,{
+	mes "There is a strange entrance";
+	mes "blocked roughly with some boards.";
+	next;
+	switch(select("Go in.:Stop.")) {
+	case 1:
+		if (countitem(6442)) {
+			// TODO: Add official MD_Enter cases.
+			if (has_instance("1@cash") == "") {
+				if (checkquest(4197,PLAYTIME) == 0 || checkquest(4197,PLAYTIME) == 1) {
+					mes "[Starfish]";
+					mes "Ah, now is not the time...";
+					mes "Would you come back later? Hehe.";
+					close;
+				}
+				mes "[Starfish]";
+				mes "Shhh... Weird aura is";
+				mes "coming from that entrance.";
+				mes "Big trouble is waiting, if you go in now.";
+				close;
+			}
+			mapannounce "mal_dun01", getpartyname(getcharid(1))+" party's "+strcharinfo(0)+" member started to hunt the Octopus!",bc_map,"0x00ff99";
+			if (checkquest(4197) == -1) setquest 4197;
+			warp "1@cash",199,99;
+			close;
+		}
+		mes "[Starfish]";
+		mes "You should definitely prepare";
+		mes "hunting stick if you want to";
+		mes "punish the Octopus.";
+		mes "Or I will not let you in! Hehe.";
+		close;
+	case 2:
+		mes "[Starfish]";
+		mes "Yes Yes, you better quit.";
+		close;
+	}
+}
+
+1@cash,199,99,0	script	oct_enter	139,4,4,{
+	end;
+OnInstanceInit:
+	enablenpc instance_npcname("oct_enter", instance_id());
+	end;
+OnTouch:
+	donpcevent instance_npcname("oct_enter_broad", instance_id())+"::OnEnable";
+	specialeffect EF_BASH;
+	disablenpc instance_npcname("oct_enter", instance_id());
+	end;
+}
+
+1@cash,1,1,0	script	oct_enter_broad	-1,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("oct_enter_broad", instance_id())+"::OnDisable";
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_enter_broad", instance_id());
+	donpcevent instance_npcname("oct_foot_4", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_mob_con", instance_id())+"::OnEnable";
+	initnpctimer;
+	end;
+OnDisable:
+	disablenpc instance_npcname("oct_enter_broad", instance_id());
+	end;
+OnTimer1000:
+	instance_announce 0,"Pervert Octopus : How dare you to come inside of my place!",bc_map,"0xFFFF00";
+	end;
+OnTimer4000:
+	instance_announce 0,"Pervert Octopus : But I blocked all the cave gates!! There is nothing you can do!",bc_map,"0xFFFF00";
+	end;
+OnTimer7000:
+	instance_announce 0,"Pervert Octopus : My juniors~ There is your toy! Play with it~ kakaka",bc_map,"0xFFFF00";
+	stopnpctimer;
+	donpcevent instance_npcname("oct_enter_broad", instance_id())+"::OnDisable";
+	end;
+}
+
+1@cash,3,3,0	script	oct_foot_4	-1,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("oct_foot_4", instance_id())+"::OnDisable";
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_foot_4", instance_id());
+	donpcevent instance_npcname("oct_foot1", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_foot2", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_foot3", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_foot4", instance_id())+"::OnEnable";
+	monster "1@cash",20,114,"Octopus Leg#1",2193,1,instance_npcname("oct_foot_4", instance_id())+"::OnMyMobDead";
+	monster "1@cash",88,190,"Octopus Leg#2",2193,1,instance_npcname("oct_foot_4", instance_id())+"::OnMyMobDead";
+	monster "1@cash",307,215,"Octopus Leg#3",2193,1,instance_npcname("oct_foot_4", instance_id())+"::OnMyMobDead";
+	monster "1@cash",372,131,"Octopus Leg#4",2193,1,instance_npcname("oct_foot_4", instance_id())+"::OnMyMobDead";
+	end;
+OnDisable:
+	disablenpc instance_npcname("oct_foot_4", instance_id());
+	end;
+OnMyMobDead:
+	if (mobcount("1@cash",instance_npcname("oct_foot_4", instance_id())+"::OnMyMobDead") < 1) {
+		donpcevent instance_npcname("oct_boss_con", instance_id())+"::OnEnable";
+		instance_announce 0,"Hey you!! I'll personally take care of you all! Let's bring it on!",bc_map,"0x00ff99";
+		enablenpc instance_npcname("oct_boss_warp", instance_id());
+		instance_warpall "1@cash",199,99;
+		end;
+	}
+	instance_announce 0,"Arrgg!! That hurts!!! I need another strategy...",bc_map,"0x00ff99";
+	end;
+}
+
+1@cash,20,114,0	script	oct_foot1	139,6,6,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname(strnpcinfo(0), instance_id())+"::OnDisable";
+	end;
+OnEnable:
+	enablenpc instance_npcname(strnpcinfo(0), instance_id());
+	set .@label$, instance_npcname(strnpcinfo(0), instance_id())+"::OnMyMobDead";
+	set .@i, atoi(charat(strnpcinfo(0),8));
+	switch(.@i) {
+	case 1:
+		areamonster "1@cash",34,96,38,100,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",39,90,41,92,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",38,76,40,78,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",39,58,41,60,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",50,38,56,44,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",68,32,72,36,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",83,26,85,28,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",107,28,109,30,"Octopus's Henchman",2192,1,.@label$;
+		areamonster "1@cash",123,28,125,30,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",134,31,138,35,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",142,39,146,43,"Octopus's Henchman",2192,2,.@label$;
+		break;
+	case 2:
+		areamonster "1@cash",139,113,143,117,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",135,104,137,106,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",123,93,127,97,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",113,90,115,92,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",103,89,105,91,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",89,90,91,92,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",74,104,76,106,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",74,120,76,122,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",83,131,87,135,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",92,142,94,144,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",98,159,100,161,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",94,180,98,184,"Octopus's Henchman",2192,5,.@label$;
+		break;
+	case 3:
+		areamonster "1@cash",299,209,303,213,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",292,203,296,207,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",291,186,293,188,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",292,166,294,168,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",293,151,295,153,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",299,137,303,141,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",300,123,304,127,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",300,104,304,108,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",279,101,281,103,"Octopus's Henchman",2192,2,.@label$;
+		monster "1@cash",260,103,"Octopus's Henchman",2192,1,.@label$;
+		break;
+	case 4:
+		areamonster "1@cash",363,123,367,127,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",364,108,368,112,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",363,93,367,97,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",364,72,366,74,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",364,58,366,60,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",355,44,359,48,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",346,36,350,40,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",319,28,325,34,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",305,27,307,29,"Octopus's Henchman",2192,2,.@label$;
+		areamonster "1@cash",276,29,280,33,"Octopus's Henchman",2192,5,.@label$;
+		areamonster "1@cash",258,37,262,41,"Octopus's Henchman",2192,2,.@label$;
+		break;
+	}
+	end;
+OnDisable:
+	killmonster "1@cash",instance_npcname(strnpcinfo(0), instance_id())+"::OnMyMobDead"; // Not in official script.
+	disablenpc instance_npcname(strnpcinfo(0), instance_id());
+	end;
+OnTouch:
+	if (getd("."+strnpcinfo(0)+instance_id())) end;
+	setd "."+strnpcinfo(0)+instance_id(),1;
+	hideonnpc instance_npcname(strnpcinfo(0), instance_id());
+	instance_announce 0,"Come out all my babies and help me out!",bc_map,"0xFFFF00";
+	initnpctimer;
+	end;
+OnTimer5000:
+	instance_announce 0,"Let's give them a lesson!",bc_map,"0xFFFF00";
+	set .@label$, instance_npcname(strnpcinfo(0), instance_id())+"::OnMyMobDead";
+	set .@i, atoi(charat(strnpcinfo(0),8));
+	switch(.@i) {
+	case 1:
+		areamonster "1@cash",18,112,22,116,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",18,112,22,116,"Octopus's Henchman",2192,3,.@label$;
+		break;
+	case 2:
+		areamonster "1@cash",86,188,90,192,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",96,98,100,102,"Octopus's Henchman",2192,3,.@label$;
+		break;
+	case 3:
+		areamonster "1@cash",305,213,309,217,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",305,213,309,217,"Octopus's Henchman",2192,3,.@label$;
+		break;
+	case 4:
+		areamonster "1@cash",370,129,374,133,"Octopus's Henchman",2192,3,.@label$;
+		areamonster "1@cash",370,129,374,133,"Octopus's Henchman",2192,3,.@label$;
+		break;
+	}
+	end;
+OnTimer30000:
+	setd "."+strnpcinfo(0)+instance_id(),0;
+	stopnpctimer;
+	set .@i, atoi(charat(strnpcinfo(0),8));
+	donpcevent instance_npcname("oct_foot_exit"+.@i, instance_id())+"::OnEnable";
+	donpcevent instance_npcname(strnpcinfo(0), instance_id())+"::OnDisable";
+	end;
+OnMyMobDead:
+	if (mobcount("1@cash",instance_npcname(strnpcinfo(0), instance_id())+"::OnMyMobDead") < 1) {
+		instance_announce 0,"You hurt my babies!!? You'll have to pay for this!!!",bc_map,"0x00ff99";
+		setd "."+strnpcinfo(0)+instance_id(),0;
+		stopnpctimer;
+		set .@i, atoi(charat(strnpcinfo(0),8));
+		donpcevent instance_npcname("oct_foot_exit"+.@i, instance_id())+"::OnEnable";
+		donpcevent instance_npcname(strnpcinfo(0), instance_id())+"::OnDisable";
+		end;
+	}
+	end;
+}
+1@cash,88,190,0	duplicate(oct_foot1)	oct_foot2	139,6,6
+1@cash,307,215,0	duplicate(oct_foot1)	oct_foot3	139,6,6
+1@cash,372,131,0	duplicate(oct_foot1)	oct_foot4	139,6,6
+
+1@cash,16,117,0	script	oct_foot_exit1	45,2,2,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname(strnpcinfo(0), instance_id());
+	end;
+OnEnable:
+	enablenpc instance_npcname(strnpcinfo(0), instance_id());
+	end;
+OnTouch:
+	warp "1@cash",198,99;
+	end;
+}
+1@cash,77,193,0	duplicate(oct_foot_exit1)	oct_foot_exit2	45,2,2
+1@cash,312,214,0	duplicate(oct_foot_exit1)	oct_foot_exit3	45,2,2
+1@cash,370,139,0	duplicate(oct_foot_exit1)	oct_foot_exit4	45,2,2
+
+1@cash,15,15,0	script	oct_mob_con	-1,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("oct_mob_con", instance_id())+"::OnDisable";
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_mob_con", instance_id());
+	monster "1@cash",32,94,"Hydra",1068,1;
+	monster "1@cash",41,101,"Hydra",1068,1;
+	monster "1@cash",35,78,"Hydra",1068,1;
+	monster "1@cash",35,62,"Hydra",1068,1;
+	monster "1@cash",49,54,"Hydra",1068,1;
+	monster "1@cash",70,28,"Hydra",1068,1;
+	monster "1@cash",83,22,"Hydra",1068,1;
+	monster "1@cash",99,23,"Hydra",1068,1;
+	monster "1@cash",115,23,"Hydra",1068,1;
+	monster "1@cash",132,25,"Hydra",1068,1;
+	monster "1@cash",100,185,"Hydra",1068,1;
+	monster "1@cash",92,178,"Hydra",1068,1;
+	monster "1@cash",92,162,"Hydra",1068,1;
+	monster "1@cash",70,121,"Hydra",1068,1;
+	monster "1@cash",70,105,"Hydra",1068,1;
+	monster "1@cash",105,85,"Hydra",1068,1;
+	monster "1@cash",121,84,"Hydra",1068,1;
+	monster "1@cash",292,209,"Hydra",1068,1;
+	monster "1@cash",303,206,"Hydra",1068,1;
+	monster "1@cash",290,163,"Hydra",1068,1;
+	monster "1@cash",299,150,"Hydra",1068,1;
+	monster "1@cash",308,141,"Hydra",1068,1;
+	monster "1@cash",308,125,"Hydra",1068,1;
+	monster "1@cash",295,97,"Hydra",1068,1;
+	monster "1@cash",279,97,"Hydra",1068,1;
+	monster "1@cash",370,111,"Hydra",1068,1;
+	monster "1@cash",370,110,"Hydra",1068,1;
+	monster "1@cash",371,96,"Hydra",1068,1;
+	monster "1@cash",371,80,"Hydra",1068,1;
+	monster "1@cash",367,55,"Hydra",1068,1;
+	monster "1@cash",343,29,"Hydra",1068,1;
+	monster "1@cash",327,24,"Hydra",1068,1;
+	monster "1@cash",311,22,"Hydra",1068,1;
+	monster "1@cash",295,22,"Hydra",1068,1;
+	monster "1@cash",279,22,"Hydra",1068,1;
+	areamonster "1@cash",30,67,50,87,"Stapo",1784,1;
+	areamonster "1@cash",102,19,122,39,"Stapo",1784,1;
+	areamonster "1@cash",89,138,109,158,"Stapo",1784,1;
+	areamonster "1@cash",112,83,132,103,"Stapo",1784,1;
+	areamonster "1@cash",283,168,303,188,"Stapo",1784,1;
+	areamonster "1@cash",292,97,312,117,"Stapo",1784,1;
+	areamonster "1@cash",355,64,375,84,"Stapo",1784,1;
+	areamonster "1@cash",317,17,337,37,"Stapo",1784,1;
+	donpcevent instance_npcname("oct_backattack1", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_backattack2", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_backattack3", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_backattack4", instance_id())+"::OnEnable";
+	donpcevent instance_npcname("oct_mob_con", instance_id())+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("oct_mob_con", instance_id());
+	end;
+}
+
+1@cash,45,53,0	script	oct_backattack1	139,3,3,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname("oct_backattack1", instance_id());
+	end;
+OnTouch:
+	monster "1@cash",39,59,"Hydra",1068,1;
+	monster "1@cash",40,59,"Hydra",1068,1;
+	monster "1@cash",41,59,"Hydra",1068,1;
+	monster "1@cash",47,50,"Hydra",1068,1;
+	monster "1@cash",48,50,"Hydra",1068,1;
+	monster "1@cash",49,50,"Hydra",1068,1;
+	monster "1@cash",41,53,"Octopus's Henchman",2192,1;
+	instance_announce 0,"Don't let them break through, stop them!!!",bc_map,"0x00ff99";
+	specialeffect EF_BASH;
+	disablenpc instance_npcname("oct_backattack1", instance_id());
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_backattack1", instance_id());
+	end;
+}
+
+1@cash,78,99,0	script	oct_backattack2	139,3,3,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname("oct_backattack2", instance_id());
+	end;
+OnTouch:
+	if (getd("."+instance_id())) end;
+	setd "."+instance_id(),1;
+	initnpctimer;
+	monster "1@cash",71,105,"Octopus's Henchman ",2192,1;
+	instance_announce 0,"Headquarters are empty, GO!!!",bc_map,"0x00ff99";
+	hideonnpc instance_npcname("oct_backattack2", instance_id());
+	end;
+OnTimer2000:
+	monster "1@cash",71,105,"Octopus's Henchman ",2192,1;
+	instance_announce 0,"Run, RUN! Go, GO!!!",bc_map,"0x00ff99";
+	end;
+OnTimer4000:
+	monster "1@cash",71,105,"Octopus's Henchman ",2192,1;
+	instance_announce 0,"No time, come out fast!",bc_map,"0x00ff99";
+	end;
+OnTimer6000:
+	monster "1@cash",71,105,"Octopus's Henchman ",2192,3;
+	instance_announce 0,"Let's take over the headquarters!!!",bc_map,"0x00ff99";
+	end;
+OnTimer8000:
+	monster "1@cash",71,105,"Octopus's Henchman ",2192,1;
+	instance_announce 0,"There is no time to lose, hurry up!!!",bc_map,"0x00ff99";
+	stopnpctimer;
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_backattack2", instance_id());
+	end;
+}
+
+1@cash,299,144,0	script	oct_backattack3	139,3,3,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname("oct_backattack2", instance_id());
+	end;
+OnTouch:
+	if (getd("."+instance_id())) end;
+	setd "."+instance_id(),1;
+	monster "1@cash",293,153,"Octopus's Henchman ",2192,1;
+	monster "1@cash",294,152,"Octopus's Henchman ",2192,1;
+	monster "1@cash",292,153,"Octopus's Henchman ",2192,1;
+	monster "1@cash",293,151,"Octopus's Henchman ",2192,1;
+	monster "1@cash",293,152,"Octopus's Henchman ?",2175,1;
+	instance_announce 0,"Kakaka! Suprised??!!",bc_map,"0x00ff99";
+	initnpctimer;
+	hideonnpc instance_npcname("oct_backattack3", instance_id());
+	end;
+OnTimer5000:
+	instance_announce 0,"... Looks like we have a spy among us.",bc_map,"0x00ff99";
+	stopnpctimer;
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_backattack3", instance_id());
+	end;
+}
+
+1@cash,336,36,0	script	oct_backattack4	139,3,3,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname("oct_backattack2", instance_id());
+	end;
+OnTouch:
+	if (getd("."+instance_id())) end;
+	setd "."+instance_id(),1;
+	monster "1@cash",332,37,"Octopus's Henchman ",2192,1;
+	monster "1@cash",332,36,"Octopus's Henchman ",2192,1;
+	monster "1@cash",332,35,"Octopus's Henchman ",2192,1;
+	monster "1@cash",332,34,"Octopus's Henchman ",2192,1;
+	monster "1@cash",341,37,"Octopus's Henchman ",2192,1;
+	monster "1@cash",341,36,"Octopus's Henchman ",2192,1;
+	monster "1@cash",341,35,"Octopus's Henchman ",2192,1;
+	monster "1@cash",341,34,"Octopus's Henchman ",2192,1;
+	monster "1@cash",260,40,"Mercenary Squid",2175,1;
+	monster "1@cash",260,41,"Mercenary Squid",2175,1;
+	monster "1@cash",260,39,"Mercenary Squid",2175,1;
+	monster "1@cash",259,40,"Mercenary Squid",2175,1;
+	monster "1@cash",261,40,"Mercenary Squid",2175,1;
+	instance_announce 0,"What a successful pincer tactic! The enemy is strong! Let's not lose yourselves! Anyway, where are all the mercenaries??",bc_map,"0x00ff99";
+	initnpctimer;
+	hideonnpc instance_npcname("oct_backattack4", instance_id());
+	end;
+OnTimer5000:
+	instance_announce 0,"Mercenary Squid : eh...eh... wrong direction. No enemies are shown in this direction.",bc_map,"0x00ff99";
+	end;
+OnTimer7000:
+	instance_announce 0,"Pervert Octopus : Fools! Can't you read the map??!! Useless!!",bc_map,"0x00ff99";
+	stopnpctimer;
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_backattack4", instance_id());
+	end;
+}
+
+1@cash,2,2,0	script	oct_boss_con	-1,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("oct_boss_con", instance_id())+"::OnDisable";
+	end;
+OnDisable:
+	disablenpc instance_npcname("oct_boss_con", instance_id());
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_boss_con", instance_id());
+	donpcevent instance_npcname("oct_boss_foot", instance_id())+"::OnEnable";
+	monster "1@cash",199,188,"Disgusting Octopus",2194,1,instance_npcname("oct_boss_con", instance_id())+"::OnMyMobDead";
+	initnpctimer;
+	end;
+OnTimer7000:
+	callsub OnAnnounce,
+		"You won't attack the one man.",
+		"I got fired from ink manufacturer last week.",
+		"Disgusting Octopus : Arghhhhh, come on!";
+	end;
+OnTimer14000:
+	callsub OnAnnounce,
+		"Why... why can't you know my heart!",
+		"Do you know how hard it is to live these days because there are not many new adventurers?",
+		"You.. I'll destroy you all...!";
+	end;
+OnTimer21000:
+	callsub OnAnnounce,
+		"What? I'm a disgusting octopus? You're sadists.",
+		"Let's not do this and how about we look for the best solution, huh??",
+		"Even if I fail here, I will keep coming back, forever!!!";
+	end;
+OnTimer28000:
+	callsub OnAnnounce,
+		"Instinct of mating is for males, what did I do wrong?",
+		"Do you really want to solve the problem between humans by violence?? Ah, I'm an octopus...",
+		"That's enough! Back off!";
+	end;
+OnTimer35000:
+	callsub OnAnnounce,
+		"Do I have to spend Christmas alone again...",
+		"Youth unemployment became a big issue these days... You won't get a job if you keep playing with me here.",
+		"This is as far as I can go!";
+	end;
+OnTimer42000:
+	callsub OnAnnounce,
+		"Hand on your heart and think if you come onto anyone...",
+		"Let's not do this here and follow the law!",
+		"You'll keep on doing this til the end, is that it?";
+	end;
+OnTimer49000:
+	callsub OnAnnounce,
+		"errrrrrrrrrrrrrrrrrrrrrrrr... Cough! Cough!",
+		"Disgusting Octopus : Violence cannot be justified in any case.",
+		"This is my place!!!";
+	stopnpctimer;
+	initnpctimer;
+	end;
+OnAnnounce:
+	instance_announce 0,"Disgusting Octopus : "+getarg(rand(3)),bc_map,"0xFFFF00";
+	return;
+OnMyMobDead:
+	if (mobcount("1@cash",instance_npcname("oct_boss_con", instance_id())+"::OnMyMobDead") < 1) {
+		instance_announce 0,"Disgusting Octopus : That's it for the today! Next time, I will play with you badly!",bc_map,"0xFFFF00";
+		enablenpc instance_npcname("oct_exit_1", instance_id());
+		enablenpc instance_npcname("oct_exit_2", instance_id());
+		donpcevent instance_npcname("oct_boss_foot", instance_id())+"::OnDisable";
+		stopnpctimer;
+		donpcevent instance_npcname("oct_boss_con", instance_id())+"::OnDisable";
+		end;
+	}
+	end;
+}
+
+1@cash,4,4,0	script	oct_boss_foot	-1,{
+	end;
+OnInstanceInit:
+	donpcevent instance_npcname("oct_boss_foot", instance_id())+"::OnDisable";
+	end;
+OnEnable:
+	enablenpc instance_npcname("oct_boss_foot", instance_id());
+	initnpctimer;
+	end;
+OnCall:
+	if (mobcount("1@cash",instance_npcname("oct_boss_foot", instance_id())+"::OnMyMobDead") < 100) {
+		switch(rand(2)) {
+		case 0:
+			instance_announce 0,"Disgusting Octopus : Do you know how many legs octopus have? It doesn't matter, I have unlimited legs!!",bc_map,"0xFFFF00";
+			areamonster "1@cash",192,181,206,195,"Octopus Leg",2193,1,instance_npcname("oct_boss_foot", instance_id())+"::OnMyMobDead";
+			break;
+		case 1:
+			instance_announce 0,"Disgusting Octopus : I...cannot..hold anymore, my babies~ please come out and fight!",bc_map,"0xFFFF00";
+			areamonster "1@cash",192,181,206,195,"Octopus's Henchman ",2192,5,instance_npcname("oct_boss_foot", instance_id())+"::OnMyMobDead";
+			break;
+		}
+	}
+	initnpctimer;
+	end;
+OnTimer10000:
+	stopnpctimer;
+	donpcevent instance_npcname("oct_boss_foot", instance_id())+"::OnCall";
+	end;
+OnDisable:
+	stopnpctimer;
+	killmonster "1@cash",instance_npcname("oct_boss_foot", instance_id())+"::OnMyMobDead"; // Not in official script.
+	disablenpc instance_npcname("oct_boss_foot", instance_id());
+	end;
+}
+
+1@cash,198,116,0	script	oct_boss_warp	45,2,2,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname("oct_boss_warp", instance_id());
+	end;
+OnTouch:
+	warp "1@cash",210,172;
+	end;
+}
+
+1@cash,190,208,0	script	oct_exit_1	45,2,2,{
+	end;
+OnInstanceInit:
+	disablenpc instance_npcname(strnpcinfo(0), instance_id());
+	end;
+OnTouch:
+	mes "Do you want to go out from the octopus dungeon?";
+	next;
+	if(select("No!:Yes!") == 2)
+		warp "mal_dun01",153,233;
+	close;
+}
+1@cash,198,82,0	duplicate(oct_exit_1)	oct_exit_2	45,2,2
+// This is never enabled in the official script.
+//1@cash,200,161,0	duplicate(oct_exit_1)	oct_exit_3	45,2,2
+
+1@cash,193,82,0	warp	oct_door1	2,2,1@cash,151,48
+1@cash,154,53,0	warp	oct_door2	2,2,1@cash,197,87
+1@cash,187,99,0	warp	oct_door3	2,2,1@cash,148,128
+1@cash,153,133,0	warp	oct_door4	2,2,1@cash,197,99
+1@cash,209,100,0	warp	oct_door5	2,2,1@cash,250,111
+1@cash,244,118,0	warp	oct_door6	2,2,1@cash,199,100
+1@cash,209,83,0	warp	oct_door7	2,2,1@cash,252,46
+1@cash,246,53,0	warp	oct_door8	2,2,1@cash,203,83

+ 3 - 0
npc/re/scripts_athena.conf

@@ -41,6 +41,9 @@ npc: npc/re/guides/guides_rachel.txt
 npc: npc/re/guides/guides_umbala.txt
 npc: npc/re/guides/guides_veins.txt
 
+// ------------------------ Instances ---------------------------
+npc: npc/re/instances/OctopusCave.txt
+
 // ---------------- Kafras & Cool Event Corp. -------------------
 npc: npc/re/kafras/kafras_izl.txt
 npc: npc/re/kafras/kafras_brasilis.txt

+ 6 - 6
sql-files/mob_db.sql

@@ -108,7 +108,7 @@ REPLACE INTO `mob_db` VALUES (1035,'HUNTER_FLY','Hunter Fly','Hunter Fly',42,524
 REPLACE INTO `mob_db` VALUES (1036,'GHOUL','Ghoul','Ghoul',40,5418,0,1088,622,1,420,500,5,20,1,20,29,0,45,20,10,12,1,1,49,0x3885,250,2456,912,504,0,0,0,0,0,0,0,958,6000,756,110,509,700,511,800,2609,60,934,150,1260,1,0,0,0,0,4110,1);
 REPLACE INTO `mob_db` VALUES (1037,'SIDE_WINDER','Side Winder','Side Winder',43,4929,0,1996,993,1,240,320,5,10,38,43,40,15,115,20,10,12,1,2,25,0x3095,200,1576,576,576,0,0,0,0,0,0,0,954,5335,912,1400,756,134,1120,2,937,2500,926,5000,509,1000,0,0,0,0,4117,1);
 REPLACE INTO `mob_db` VALUES (1038,'OSIRIS','Osiris','Osiris',78,415400,0,71500,28600,1,780,2880,10,25,1,75,30,37,86,40,10,12,1,1,89,0x37B5,100,1072,672,384,35750,603,4000,608,3000,751,500,617,2000,1232,150,2235,200,1255,600,1009,1000,5053,150,1285,100,0,0,0,0,4144,1);
-REPLACE INTO `mob_db` VALUES (1039,'BAPHOMET','Baphomet','Baphomet',81,668000,0,107250,37895,2,3220,4040,35,45,1,152,30,85,120,95,10,12,2,6,67,0x37B5,100,768,768,576,53625,607,2000,750,500,923,5000,1466,200,2256,200,1476,50,714,500,5160,10,985,5432,984,4171,0,0,0,0,4147,1);
+REPLACE INTO `mob_db` VALUES (1039,'BAPHOMET','Baphomet','Baphomet',81,668000,0,107250,37895,2,3220,4040,35,45,1,152,30,85,120,95,10,12,2,6,67,0x37B5,100,768,768,576,53625,607,2000,750,500,923,5000,1466,400,2256,300,1476,50,714,500,5160,10,985,5432,984,4171,0,0,0,0,4147,1);
 REPLACE INTO `mob_db` VALUES (1040,'GOLEM','Golem','Golem',25,3900,0,465,94,1,175,187,40,0,1,15,25,0,15,0,10,12,2,0,60,0x91,300,1608,816,396,0,0,0,0,0,0,0,999,150,953,9000,912,220,757,70,1003,210,715,200,998,350,0,0,0,0,4072,1);
 REPLACE INTO `mob_db` VALUES (1041,'MUMMY','Mummy','Mummy',37,5176,0,800,602,1,305,360,0,10,28,19,32,0,63,20,10,12,1,1,49,0x3885,300,1772,72,384,0,0,0,0,0,0,0,930,9000,756,100,934,550,2604,1,2611,10,525,250,508,850,0,0,0,0,4106,1);
 REPLACE INTO `mob_db` VALUES (1042,'STEEL_CHONCHON','Steel Chonchon','Steel Chonchon',17,530,0,109,71,1,54,65,15,0,1,43,17,5,33,10,10,12,0,4,24,0x118B,150,1076,576,480,0,0,0,0,0,0,0,992,90,999,30,910,2400,935,9000,943,30,998,200,1002,300,0,0,0,0,4042,1);
@@ -259,7 +259,7 @@ REPLACE INTO `mob_db` VALUES (1186,'WHISPER_BOSS','Giant Whisper','Giant Whisper
 REPLACE INTO `mob_db` VALUES (1187,'SWITCH','Switch','Switch',1,2,0,1,1,1,1,2,0,0,1,1,1,0,1,0,1,12,1,0,20,0x0,1,1,1,1,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 (1188,'BON_GUN','Bongun','Bongun',32,3520,0,424,242,1,220,260,0,0,45,15,36,10,48,15,10,12,1,1,29,0x3095,200,1720,500,420,0,0,0,0,0,0,0,1094,5500,7014,40,618,60,5046,1,609,15,508,1000,508,1250,0,0,0,0,4212,1);
 REPLACE INTO `mob_db` VALUES (1189,'ORC_ARCHER','Orc Archer','Orc Archer',49,7440,0,1729,1787,9,310,390,10,5,1,44,25,20,125,20,10,12,1,7,22,0x3095,300,1960,620,480,0,0,0,0,0,0,0,1063,4656,1753,1000,1756,2500,1755,2500,1734,2,507,1400,509,900,0,0,0,0,4256,1);
-REPLACE INTO `mob_db` VALUES (1190,'ORC_LORD','Orc Lord','Orc Lord',74,783000,0,62205,8580,1,3700,4150,40,5,85,82,30,70,110,85,10,12,2,7,82,0x37B5,100,1248,500,360,31102,968,5500,617,2000,0,0,1363,200,2601,500,5007,150,1371,400,617,1000,985,4268,16000,100,0,0,0,0,4135,1);
+REPLACE INTO `mob_db` VALUES (1190,'ORC_LORD','Orc Lord','Orc Lord',74,783000,0,62205,8580,1,3700,4150,40,5,85,82,30,70,110,85,10,12,2,7,82,0x37B5,100,1248,500,360,31102,968,5500,617,2000,0,0,1363,400,2621,400,5007,400,1371,400,617,1000,985,4268,16000,3100,0,0,0,0,4135,1);
 REPLACE INTO `mob_db` VALUES (1191,'MIMIC','Mimic','Mimic',51,6120,182,165,165,1,150,900,10,40,44,121,1,60,75,110,10,12,1,0,60,0x3095,100,972,500,288,0,0,0,0,0,0,0,617,5,603,45,1065,1200,611,3000,714,3,2626,1,757,270,0,0,0,0,4205,1);
 REPLACE INTO `mob_db` VALUES (1192,'WRAITH','Wraith','Wraith',53,10999,0,2199,1099,1,580,760,5,30,1,95,30,65,95,35,10,12,2,1,89,0x3695,300,1816,576,240,0,0,0,0,0,0,0,1059,5820,2206,10,2506,2,716,650,602,1300,2505,10,731,5,0,0,0,0,4190,1);
 REPLACE INTO `mob_db` VALUES (1193,'ALARM','Alarm','Alarm',58,10647,0,3987,2300,1,480,600,15,15,1,62,72,10,85,45,10,12,1,0,60,0x3695,300,1020,500,768,0,0,0,0,0,0,0,1095,5335,2607,1,7005,1500,611,1300,984,105,7026,20,912,1500,0,0,0,0,4244,1);
@@ -329,7 +329,7 @@ REPLACE INTO `mob_db` VALUES (1258,'GOBLIN_ARCHER','Goblin Archer','Goblin Arche
 REPLACE INTO `mob_db` VALUES (1259,'GRYPHON','Gryphon','Gryphon',72,27800,0,5896,4400,1,880,1260,35,35,68,95,78,65,115,75,10,12,2,2,84,0x37B5,100,704,504,432,0,0,0,0,0,0,0,7048,2500,7054,5335,7063,120,1452,1500,1417,1,984,185,996,150,0,0,0,0,4163,1);
 REPLACE INTO `mob_db` VALUES (1260,'DARK_FRAME','Dark Frame','Dark Frame',59,7500,0,3652,3271,1,960,1210,10,45,1,72,42,45,85,25,10,12,1,6,67,0x3795,200,920,720,200,0,0,0,0,0,0,0,7054,4656,734,1000,2505,30,0,0,0,0,1000,80,747,3,0,0,0,0,4170,1);
 REPLACE INTO `mob_db` VALUES (1261,'WILD_ROSE','Wild Rose','Wild Rose',38,2980,0,1113,688,1,315,360,0,15,65,85,15,35,65,80,10,12,0,2,24,0x83,100,964,864,288,0,0,0,0,0,0,0,7053,5335,748,50,5037,120,1767,3000,624,35,528,600,2244,2,0,0,0,0,4257,1);
-REPLACE INTO `mob_db` VALUES (1262,'MUTANT_DRAGON','Mutant Dragon','Mutant Dragonoid',65,62600,0,4730,3536,4,2400,3400,15,20,75,47,30,68,45,35,10,12,2,9,43,0x37B5,250,1280,1080,240,0,0,0,0,0,0,0,7054,4850,1035,500,1036,500,930,500,1559,400,7296,1500,2527,50,0,0,0,0,4203,1);
+REPLACE INTO `mob_db` VALUES (1262,'MUTANT_DRAGON','Mutant Dragon','Mutant Dragonoid',65,62600,0,4730,3536,4,2400,3400,15,20,75,47,30,68,45,35,10,12,2,9,43,0x37B5,250,1280,1080,240,0,0,0,0,0,0,0,7054,4850,1035,500,1036,500,930,500,1559,100,7296,1500,2527,50,0,0,0,0,4203,1);
 REPLACE INTO `mob_db` VALUES (1263,'WIND_GHOST','Wind Ghost','Wind Ghost',51,4820,0,2424,1488,2,489,639,0,45,1,89,15,90,85,25,10,12,1,6,64,0x3795,150,1056,1056,336,0,0,0,0,0,0,0,912,4559,932,6000,7005,500,693,100,1611,8,996,100,1615,1,0,0,0,0,4264,1);
 REPLACE INTO `mob_db` VALUES (1264,'MERMAN','Merman','Merman',53,14690,0,4500,3000,2,482,964,10,35,72,45,46,35,60,55,10,12,1,7,61,0x3695,220,916,816,336,0,0,0,0,0,0,0,1054,1300,523,300,568,400,720,40,995,35,1460,3,756,203,0,0,0,0,4199,1);
 REPLACE INTO `mob_db` VALUES (1265,'COOKIE','Cookie','Cookie',25,950,0,310,188,1,130,145,0,25,1,35,20,53,37,90,10,12,0,7,60,0x1089,200,1036,936,240,0,0,0,0,0,0,0,538,1000,530,150,979,1,11002,50,2402,30,12001,100,529,320,0,0,0,0,4293,1);
@@ -339,7 +339,7 @@ REPLACE INTO `mob_db` VALUES (1268,'BLOODY_KNIGHT','Bloody Knight','Bloody Knigh
 REPLACE INTO `mob_db` VALUES (1269,'CLOCK','Clock','Clock',60,11050,0,3410,2904,1,720,909,15,10,1,70,50,25,90,50,10,12,1,0,42,0x91,200,1092,792,480,0,0,0,0,0,0,0,1095,5335,1019,800,509,1900,568,320,7026,30,7027,30,985,163,0,0,0,0,4299,1);
 REPLACE INTO `mob_db` VALUES (1270,'C_TOWER_MANAGER','Clock Tower Manager','Clock Tower Manager',63,18600,0,4378,2850,3,880,1180,35,30,1,75,20,64,75,60,10,12,2,0,80,0x91,200,1072,672,384,0,0,0,0,0,0,0,1095,5335,7054,5335,999,500,520,850,2109,1,7026,2000,7027,2000,0,0,0,0,4229,1);
 REPLACE INTO `mob_db` VALUES (1271,'ALLIGATOR','Alligator','Alligator',42,6962,0,1379,866,1,315,360,2,5,1,45,50,10,69,65,10,12,1,2,21,0x91,200,1100,900,480,0,0,0,0,0,0,0,912,1000,1099,600,7003,2000,608,50,0,0,0,0,756,129,0,0,0,0,4252,1);
-REPLACE INTO `mob_db` VALUES (1272,'DARK_LORD','Dark Lord','Dark Lord',80,720000,0,65780,45045,2,2800,3320,30,70,1,120,30,118,99,60,10,12,2,6,89,0x37B5,100,868,768,480,32890,7005,6000,5093,500,617,2000,1615,800,2004,100,1237,300,2334,300,2507,100,985,5141,984,3977,0,0,0,0,4168,1);
+REPLACE INTO `mob_db` VALUES (1272,'DARK_LORD','Dark Lord','Dark Lord',80,720000,0,65780,45045,2,2800,3320,30,70,1,120,30,118,99,60,10,12,2,6,89,0x37B5,100,868,768,480,32890,7005,6000,5093,500,617,2000,1615,800,2004,100,1237,300,2334,300,2507,100,985,5141,5162,10,0,0,0,0,4168,1);
 REPLACE INTO `mob_db` VALUES (1273,'ORC_LADY','Orc Lady','Orc Lady',31,2000,0,644,407,1,135,170,10,10,35,42,25,15,69,55,10,12,1,7,42,0x3695,200,1050,900,288,0,0,0,0,0,0,0,7053,4656,998,300,2602,1,2206,1,12127,10,7477,3,2338,1,0,0,0,0,4255,1);
 REPLACE INTO `mob_db` VALUES (1274,'MEGALITH','Megalith','Megalith',45,5300,0,1758,1075,9,264,314,50,25,1,45,60,5,95,5,10,12,2,0,80,0x84,200,1332,1332,672,0,0,0,0,0,0,0,912,100,7049,1000,617,1,0,0,0,0,985,61,757,207,0,0,0,0,4200,1);
 REPLACE INTO `mob_db` VALUES (1275,'ALICE','Alice','Alice',62,10000,221,3583,2400,1,550,700,5,5,64,64,42,85,100,130,10,12,1,7,60,0x91,200,502,2304,480,0,0,0,0,0,0,0,7047,2500,637,40,2407,3,739,30,5085,1,12128,10,12002,100,0,0,0,0,4253,1);
@@ -848,7 +848,7 @@ REPLACE INTO `mob_db` VALUES (1749,'G_MEDUSA','Medusa','Medusa',79,22408,0,0,0,1
 REPLACE INTO `mob_db` VALUES (1750,'G_RED_PLANT','Red Plant','Red Plant',1,100,0,0,0,1,100,200,100,99,0,0,0,0,0,100,7,12,0,3,22,0x40,2000,1,1,1,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);
 
 # Odin monsters
-REPLACE INTO `mob_db` VALUES (1751,'RANDGRIS','Valkyrie Randgris','Valkyrie Randgris',99,3567200,0,2854900,3114520,3,5560,9980,25,42,100,120,30,120,220,210,10,12,2,8,86,0x37B5,100,576,576,480,1427450,617,5500,603,5000,616,2000,7510,5000,2357,1600,2524,1500,2421,1500,2229,2500,7024,2500,0,0,0,0,0,0,4407,1);
+REPLACE INTO `mob_db` VALUES (1751,'RANDGRIS','Valkyrie Randgris','Valkyrie Randgris',99,3567200,0,2854900,3114520,3,5560,9980,25,42,100,120,30,120,220,210,10,12,2,8,86,0x37B5,100,576,576,480,1427450,617,5500,603,5000,616,2000,7510,5000,2357,1600,2524,3000,2421,3000,2229,5000,7024,2500,0,0,0,0,0,0,4407,1);
 REPLACE INTO `mob_db` VALUES (1752,'SKOGUL','Skogul','Skogul',70,87544,0,27620,10,2,1110,1930,20,15,1,69,70,50,67,52,10,12,1,6,67,0x3395,190,720,384,480,0,0,0,0,0,0,0,7511,3500,7054,1000,716,1000,739,500,2609,100,757,500,1271,5,0,0,0,0,4404,1);
 REPLACE INTO `mob_db` VALUES (1753,'FRUS','Frus','Frus',69,83422,0,20620,10,2,1110,1780,20,15,1,69,60,50,76,52,10,12,1,6,67,0x3395,150,480,576,432,0,0,0,0,0,0,0,7511,3500,7054,1000,716,1000,2622,3,2308,10,757,500,0,0,0,0,0,0,4405,1);
 REPLACE INTO `mob_db` VALUES (1754,'SKEGGIOLD','Skeggiold','Skeggiold',81,295200,0,91100,10,1,1400,2020,12,24,80,100,50,72,90,50,10,12,0,8,46,0x37B5,250,672,780,480,0,0,0,0,0,0,0,7511,6000,2254,1,7063,1000,2001,25,7511,1000,2322,100,2353,100,0,0,0,0,4406,1);
@@ -1142,7 +1142,7 @@ REPLACE INTO `mob_db` VALUES (2019,'ANCIENT_TREE','Ancient Tree','Ancient Tree',
 REPLACE INTO `mob_db` VALUES (2020,'RHYNCHO','Rhyncho','Rhyncho',85,18900,0,2040,6000,1,350,2300,5,19,1,56,12,35,89,10,10,12,1,0,61,0x308D,240,576,660,420,0,0,0,0,0,0,0,7326,5000,972,5,6087,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
 REPLACE INTO `mob_db` VALUES (2021,'PHYLLA','Phylla','Phylla',85,23880,0,3040,6600,10,350,2550,8,22,1,59,15,25,99,10,10,12,1,0,61,0x2085,240,360,780,432,0,0,0,0,0,0,0,7326,5000,971,5,6088,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
 REPLACE INTO `mob_db` VALUES (2022,'S_NYDHOG','Nidhoggr\'s Shadow','Nidhoggr\'s Shadow',117,3450000,0,4800000,3900000,2,17000,49000,60,75,1,34,62,236,188,34,10,12,2,9,87,0x37B5,150,1596,1620,864,2400000,0,0,0,0,0,0,6091,5000,7444,5000,2610,5000,1484,500,1170,500,1417,500,2554,2000,0,0,0,0,0,0);
-REPLACE INTO `mob_db` VALUES (2023,'DARK_SHADOW','Dark Shadow','Dark Shadow',114,42900,0,21000,14000,1,10000,15000,35,44,1,23,12,145,102,60,10,12,0,0,47,0x3195,220,768,1776,648,0,0,0,0,0,0,0,7205,5000,2609,1000,13038,5,6089,1000,2783,5,1385,10,0,0,0,0,0,0,0,0);
+REPLACE INTO `mob_db` VALUES (2023,'DARK_SHADOW','Dark Shadow','Dark Shadow',114,42900,0,21000,14000,1,10000,15000,35,44,1,23,12,145,102,60,10,12,0,0,47,0x3195,220,768,1776,648,0,0,0,0,0,0,0,7205,5000,2609,1000,13038,5,6089,1000,2783,5,1385,10,0,0,0,0,0,0,4449,1);
 REPLACE INTO `mob_db` VALUES (2024,'BRADIUM_GOLEM','Bradium Golem','Bradium Golem',101,45200,0,14000,18920,1,12000,13000,78,22,0,10,82,25,60,12,10,12,2,0,42,0x3295,300,1008,1200,540,0,0,0,0,0,0,0,7067,3000,953,5000,6090,500,2138,10,0,0,0,0,0,0,0,0,0,0,0,0);
 # REPLACE INTO `mob_db` VALUES (2025,'MYSTCASE_EVENT','Mystcase','Mystcase',10,15,0,0,0,1,160,360,99,99,65,50,25,5,48,75,10,12,1,0,20,0x120,400,1248,1248,432,0,0,0,0,0,0,0,14550,5000,14546,5000,12355,50,6092,2000,7175,2000,7174,2000,529,3000,0,0,0,0,530,3000);
 REPLACE INTO `mob_db` VALUES (2026,'DANDELION_','Runaway Dandelion Member','Runaway Dandelion Member',90,552000,0,50000,25000,1,3050,4300,25,35,1,66,66,45,88,66,10,12,1,7,27,0x3695,230,1772,72,384,0,0,0,0,0,0,0,7031,5000,579,500,7016,2000,581,3000,12125,500,511,5000,7032,3000,0,0,0,0,902,2000);

+ 136 - 136
src/common/cli.c

@@ -1,137 +1,137 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "cbasetypes.h"
-#include "showmsg.h"
-#include "core.h"
-#include "cli.h"
-
-char* MAP_CONF_NAME;
-char* INTER_CONF_NAME;
-char* LOG_CONF_NAME;
-char* BATTLE_CONF_FILENAME;
-char* ATCOMMAND_CONF_FILENAME;
-char* SCRIPT_CONF_NAME;
-char* GRF_PATH_FILENAME;
-//char
-char* CHAR_CONF_NAME;
-char* SQL_CONF_NAME;
-//login
-char* LOGIN_CONF_NAME;
-//common
-char* LAN_CONF_NAME; //char-login
-char* MSG_CONF_NAME; //all
-
-bool opt_has_next_value(const char* option, int i, int argc)
-{
-    if (i >= argc - 1) {
-	ShowWarning("Missing value for option '%s'.\n", option);
-	return false;
-    }
-
-    return true;
-}
-
-/*======================================================
- * Servers Version Screen [MC Cameri]
- *------------------------------------------------------*/
-void display_versionscreen(bool do_exit)
-{
-    ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision());
-    ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n");
-    ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n");
-    ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
-    if (do_exit)
-	exit(EXIT_SUCCESS);
-}
-
-int cli_get_options(int argc, char ** argv)
-{
-    int i = 0;
-    for (i = 1; i < argc; i++) {
-	const char* arg = argv[i];
-
-	if (arg[0] != '-' && (arg[0] != '/' || arg[1] == '-')) {// -, -- and /
-	    ShowError("Unknown option '%s'.\n", argv[i]);
-	    exit(EXIT_FAILURE);
-	} else if ((++arg)[0] == '-') {// long option
-	    arg++;
-
-	    if (strcmp(arg, "help") == 0) {
-		display_helpscreen(true);
-	    } else if (strcmp(arg, "version") == 0) {
-		display_versionscreen(true);
-	    } else if (strcmp(arg, "msg-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			MSG_CONF_NAME = argv[++i];
-	    } else if (strcmp(arg, "run-once") == 0) // close the map-server as soon as its done.. for testing [Celest]
-	    {
-		runflag = CORE_ST_STOP;
-	    } else if (SERVER_TYPE & (ATHENA_SERVER_LOGIN | ATHENA_SERVER_CHAR)) { //login or char
-		if (strcmp(arg, "lan-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			LAN_CONF_NAME = argv[++i];
-		} else if (SERVER_TYPE == ATHENA_SERVER_LOGIN) { //login
-		    if (strcmp(arg, "login-config") == 0) {
-			if (opt_has_next_value(arg, i, argc))
-			    LOGIN_CONF_NAME = argv[++i];
-		    } else {
-			ShowError("Unknown option '%s'.\n", argv[i]);
-			exit(EXIT_FAILURE);
-		    }
-		} else if (SERVER_TYPE == ATHENA_SERVER_CHAR) { //char
-		    if (strcmp(arg, "char-config") == 0) {
-			if (opt_has_next_value(arg, i, argc))
-			    CHAR_CONF_NAME = argv[++i];
-		    } else if (strcmp(arg, "inter-config") == 0) {
-			if (opt_has_next_value(arg, i, argc))
-			    INTER_CONF_NAME = argv[++i];
-		    } else {
-			ShowError("Unknown option '%s'.\n", argv[i]);
-			exit(EXIT_FAILURE);
-		    }
-		}
-	    } else if (SERVER_TYPE == ATHENA_SERVER_MAP) { //map
-		if (strcmp(arg, "map-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			MAP_CONF_NAME = argv[++i];
-		} else if (strcmp(arg, "battle-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			BATTLE_CONF_FILENAME = argv[++i];
-		} else if (strcmp(arg, "atcommand-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			ATCOMMAND_CONF_FILENAME = argv[++i];
-		} else if (strcmp(arg, "script-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			SCRIPT_CONF_NAME = argv[++i];
-		} else if (strcmp(arg, "grf-path-file") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			GRF_PATH_FILENAME = argv[++i];
-		} else if (strcmp(arg, "inter-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			INTER_CONF_NAME = argv[++i];
-		} else if (strcmp(arg, "log-config") == 0) {
-		    if (opt_has_next_value(arg, i, argc))
-			LOG_CONF_NAME = argv[++i];
-		}
-		else {
-		    ShowError("Unknown option '%s'.\n", argv[i]);
-		    exit(EXIT_FAILURE);
-		}
-	    }
-	} else switch (arg[0]) {// short option
-	    case '?':
-	    case 'h':
-		display_helpscreen(true);
-		break;
-	    case 'v':
-		display_versionscreen(true);
-		break;
-	    default:
-		ShowError("Unknown option '%s'.\n", argv[i]);
-		exit(EXIT_FAILURE);
-	    }
-    }
-    return 1;
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "cbasetypes.h"
+#include "showmsg.h"
+#include "core.h"
+#include "cli.h"
+
+char* MAP_CONF_NAME;
+char* INTER_CONF_NAME;
+char* LOG_CONF_NAME;
+char* BATTLE_CONF_FILENAME;
+char* ATCOMMAND_CONF_FILENAME;
+char* SCRIPT_CONF_NAME;
+char* GRF_PATH_FILENAME;
+//char
+char* CHAR_CONF_NAME;
+char* SQL_CONF_NAME;
+//login
+char* LOGIN_CONF_NAME;
+//common
+char* LAN_CONF_NAME; //char-login
+char* MSG_CONF_NAME; //all
+
+bool opt_has_next_value(const char* option, int i, int argc)
+{
+    if (i >= argc - 1) {
+	ShowWarning("Missing value for option '%s'.\n", option);
+	return false;
+    }
+
+    return true;
+}
+
+/*======================================================
+ * Servers Version Screen [MC Cameri]
+ *------------------------------------------------------*/
+void display_versionscreen(bool do_exit)
+{
+    ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision());
+    ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n");
+    ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n");
+    ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
+    if (do_exit)
+	exit(EXIT_SUCCESS);
+}
+
+int cli_get_options(int argc, char ** argv)
+{
+    int i = 0;
+    for (i = 1; i < argc; i++) {
+	const char* arg = argv[i];
+
+	if (arg[0] != '-' && (arg[0] != '/' || arg[1] == '-')) {// -, -- and /
+	    ShowError("Unknown option '%s'.\n", argv[i]);
+	    exit(EXIT_FAILURE);
+	} else if ((++arg)[0] == '-') {// long option
+	    arg++;
+
+	    if (strcmp(arg, "help") == 0) {
+		display_helpscreen(true);
+	    } else if (strcmp(arg, "version") == 0) {
+		display_versionscreen(true);
+	    } else if (strcmp(arg, "msg-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			MSG_CONF_NAME = argv[++i];
+	    } else if (strcmp(arg, "run-once") == 0) // close the map-server as soon as its done.. for testing [Celest]
+	    {
+		runflag = CORE_ST_STOP;
+	    } else if (SERVER_TYPE & (ATHENA_SERVER_LOGIN | ATHENA_SERVER_CHAR)) { //login or char
+		if (strcmp(arg, "lan-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			LAN_CONF_NAME = argv[++i];
+		} else if (SERVER_TYPE == ATHENA_SERVER_LOGIN) { //login
+		    if (strcmp(arg, "login-config") == 0) {
+			if (opt_has_next_value(arg, i, argc))
+			    LOGIN_CONF_NAME = argv[++i];
+		    } else {
+			ShowError("Unknown option '%s'.\n", argv[i]);
+			exit(EXIT_FAILURE);
+		    }
+		} else if (SERVER_TYPE == ATHENA_SERVER_CHAR) { //char
+		    if (strcmp(arg, "char-config") == 0) {
+			if (opt_has_next_value(arg, i, argc))
+			    CHAR_CONF_NAME = argv[++i];
+		    } else if (strcmp(arg, "inter-config") == 0) {
+			if (opt_has_next_value(arg, i, argc))
+			    INTER_CONF_NAME = argv[++i];
+		    } else {
+			ShowError("Unknown option '%s'.\n", argv[i]);
+			exit(EXIT_FAILURE);
+		    }
+		}
+	    } else if (SERVER_TYPE == ATHENA_SERVER_MAP) { //map
+		if (strcmp(arg, "map-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			MAP_CONF_NAME = argv[++i];
+		} else if (strcmp(arg, "battle-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			BATTLE_CONF_FILENAME = argv[++i];
+		} else if (strcmp(arg, "atcommand-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			ATCOMMAND_CONF_FILENAME = argv[++i];
+		} else if (strcmp(arg, "script-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			SCRIPT_CONF_NAME = argv[++i];
+		} else if (strcmp(arg, "grf-path-file") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			GRF_PATH_FILENAME = argv[++i];
+		} else if (strcmp(arg, "inter-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			INTER_CONF_NAME = argv[++i];
+		} else if (strcmp(arg, "log-config") == 0) {
+		    if (opt_has_next_value(arg, i, argc))
+			LOG_CONF_NAME = argv[++i];
+		}
+		else {
+		    ShowError("Unknown option '%s'.\n", argv[i]);
+		    exit(EXIT_FAILURE);
+		}
+	    }
+	} else switch (arg[0]) {// short option
+	    case '?':
+	    case 'h':
+		display_helpscreen(true);
+		break;
+	    case 'v':
+		display_versionscreen(true);
+		break;
+	    default:
+		ShowError("Unknown option '%s'.\n", argv[i]);
+		exit(EXIT_FAILURE);
+	    }
+    }
+    return 1;
 }

+ 40 - 40
src/common/cli.h

@@ -1,40 +1,40 @@
-/*
- * File:   cli.h
- * Author: lighta
- *
- * Created on February 21, 2013, 6:15 PM
- */
-
-#ifndef CLI_H
-#define	CLI_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-//map
- extern char* MAP_CONF_NAME;
- extern char* INTER_CONF_NAME;
- extern char* LOG_CONF_NAME;
- extern char* BATTLE_CONF_FILENAME;
- extern char* ATCOMMAND_CONF_FILENAME;
- extern char* SCRIPT_CONF_NAME;
- extern char* GRF_PATH_FILENAME;
-//char
- extern char* CHAR_CONF_NAME;
- extern char* SQL_CONF_NAME;
-//login
- extern char* LOGIN_CONF_NAME;
-//common
- extern char* LAN_CONF_NAME; //char-login
- extern char* MSG_CONF_NAME; //all
-
-extern void display_helpscreen(bool exit);
-int cli_get_options(int argc, char ** argv);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* CLI_H */
-
+/*
+ * File:   cli.h
+ * Author: lighta
+ *
+ * Created on February 21, 2013, 6:15 PM
+ */
+
+#ifndef CLI_H
+#define	CLI_H
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+//map
+ extern char* MAP_CONF_NAME;
+ extern char* INTER_CONF_NAME;
+ extern char* LOG_CONF_NAME;
+ extern char* BATTLE_CONF_FILENAME;
+ extern char* ATCOMMAND_CONF_FILENAME;
+ extern char* SCRIPT_CONF_NAME;
+ extern char* GRF_PATH_FILENAME;
+//char
+ extern char* CHAR_CONF_NAME;
+ extern char* SQL_CONF_NAME;
+//login
+ extern char* LOGIN_CONF_NAME;
+//common
+ extern char* LAN_CONF_NAME; //char-login
+ extern char* MSG_CONF_NAME; //all
+
+extern void display_helpscreen(bool exit);
+int cli_get_options(int argc, char ** argv);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* CLI_H */
+

+ 71 - 71
src/common/msg_conf.c

@@ -1,72 +1,72 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "malloc.h"
-#include "msg_conf.h"
-#include "showmsg.h"
-
-//-----------------------------------------------------------
-// Return the message string of the specified number by [Yor]
-//-----------------------------------------------------------
-
-const char* _msg_txt(int msg_number,int size, char ** msg_table)
-{
-    if (msg_number >= 0 && msg_number < size &&
-	    msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
-	return msg_table[msg_number];
-
-    return "??";
-}
-
-/*==========================================
- * Read Message Data
- *------------------------------------------*/
-int _msg_config_read(const char* cfgName,int size, char ** msg_table)
-{
-    int msg_number;
-    char line[1024], w1[1024], w2[1024];
-    FILE *fp;
-    static int called = 1;
-
-    if ((fp = fopen(cfgName, "r")) == NULL) {
-	ShowError("Messages file not found: %s\n", cfgName);
-	return 1;
-    }
-
-    if ((--called) == 0)
-	memset(msg_table, 0, sizeof (msg_table[0]) * size);
-
-    while (fgets(line, sizeof (line), fp)) {
-	if (line[0] == '/' && line[1] == '/')
-	    continue;
-	if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
-	    continue;
-
-	if (strcmpi(w1, "import") == 0)
-	    _msg_config_read(w2,size,msg_table);
-	else {
-	    msg_number = atoi(w1);
-	    if (msg_number >= 0 && msg_number < size) {
-		if (msg_table[msg_number] != NULL)
-		    aFree(msg_table[msg_number]);
-		msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char));
-		strcpy(msg_table[msg_number], w2);
-	    }
-	}
-    }
-
-    fclose(fp);
-    ShowInfo("Finished reading %s.\n",cfgName);
-
-    return 0;
-}
-
-/*==========================================
- * Cleanup Message Data
- *------------------------------------------*/
-void _do_final_msg(int size, char ** msg_table){
-    int i;
-    for (i = 0; i < size; i++)
-	aFree(msg_table[i]);
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "malloc.h"
+#include "msg_conf.h"
+#include "showmsg.h"
+
+//-----------------------------------------------------------
+// Return the message string of the specified number by [Yor]
+//-----------------------------------------------------------
+
+const char* _msg_txt(int msg_number,int size, char ** msg_table)
+{
+    if (msg_number >= 0 && msg_number < size &&
+	    msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
+	return msg_table[msg_number];
+
+    return "??";
+}
+
+/*==========================================
+ * Read Message Data
+ *------------------------------------------*/
+int _msg_config_read(const char* cfgName,int size, char ** msg_table)
+{
+    int msg_number;
+    char line[1024], w1[1024], w2[1024];
+    FILE *fp;
+    static int called = 1;
+
+    if ((fp = fopen(cfgName, "r")) == NULL) {
+	ShowError("Messages file not found: %s\n", cfgName);
+	return 1;
+    }
+
+    if ((--called) == 0)
+	memset(msg_table, 0, sizeof (msg_table[0]) * size);
+
+    while (fgets(line, sizeof (line), fp)) {
+	if (line[0] == '/' && line[1] == '/')
+	    continue;
+	if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
+	    continue;
+
+	if (strcmpi(w1, "import") == 0)
+	    _msg_config_read(w2,size,msg_table);
+	else {
+	    msg_number = atoi(w1);
+	    if (msg_number >= 0 && msg_number < size) {
+		if (msg_table[msg_number] != NULL)
+		    aFree(msg_table[msg_number]);
+		msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char));
+		strcpy(msg_table[msg_number], w2);
+	    }
+	}
+    }
+
+    fclose(fp);
+    ShowInfo("Finished reading %s.\n",cfgName);
+
+    return 0;
+}
+
+/*==========================================
+ * Cleanup Message Data
+ *------------------------------------------*/
+void _do_final_msg(int size, char ** msg_table){
+    int i;
+    for (i = 0; i < size; i++)
+	aFree(msg_table[i]);
 }

+ 20 - 20
src/common/msg_conf.h

@@ -1,20 +1,20 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#ifndef MSG_CONF_H
-#define	MSG_CONF_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-const char* _msg_txt(int msg_number,int size, char ** msg_table);
-int _msg_config_read(const char* cfgName,int size, char ** msg_table);
-void _do_final_msg(int size, char ** msg_table);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* MSG_CONF_H */
-
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#ifndef MSG_CONF_H
+#define	MSG_CONF_H
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+const char* _msg_txt(int msg_number,int size, char ** msg_table);
+int _msg_config_read(const char* cfgName,int size, char ** msg_table);
+void _do_final_msg(int size, char ** msg_table);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* MSG_CONF_H */
+

+ 7 - 2
src/map/battle.c

@@ -2978,7 +2978,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
 					skillratio += -100 + 100 * skill_lv;
 					break;
 			}
-
+#ifdef RENEWAL
+			if( sc && sc->data[SC_TRUESIGHT] )
+				skillratio += 2*sc->data[SC_TRUESIGHT]->val1;
+#endif
 			ATK_RATE(skillratio);
 
 			//Constant/misc additions from skills
@@ -3073,8 +3076,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
 
 		//The following are applied on top of current damage and are stackable.
 		if ( sc ) {
+#ifndef RENEWAL
 			if( sc->data[SC_TRUESIGHT] )
 				ATK_ADDRATE(2*sc->data[SC_TRUESIGHT]->val1);
+#endif
 			if( sc->data[SC_GLOOMYDAY_SK] &&
 				( skill_id == LK_SPIRALPIERCE || skill_id == KN_BRANDISHSPEAR ||
 				  skill_id == CR_SHIELDBOOMERANG || skill_id == PA_SHIELDCHAIN ||
@@ -5204,7 +5209,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 		case BL_MOB:
 			if(((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres
 				(((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras
-				s_bl->type == BL_PC && src->type != BL_MOB) || ((TBL_MOB*)target)->special_state.ai == 4 && t_bl->id != src->id) //Zanzoe
+				s_bl->type == BL_PC && src->type != BL_MOB) || ((TBL_MOB*)target)->special_state.ai == 4 && t_bl->id != s_bl->id) //Zanzoe
 			{	//Targettable by players
 				state |= BCT_ENEMY;
 				strip_enemy = 0;

+ 6 - 6
src/map/skill.c

@@ -397,7 +397,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
 		#ifdef RENEWAL
             /**
              * Renewal Heal Formula
-             * Formula: ( [(Base Level + INT) / 5] × 30 ) × (Heal Level / 10) × (Modifiers) + MATK
+             * Formula: ( [(Base Level + INT) / 5] x 30 ) x (Heal Level / 10) x (Modifiers) + MATK
              **/
             hp = (status_get_lv(src) + status_get_int(src)) / 5 * 30  * skill_lv / 10;
 		#else
@@ -842,7 +842,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
 					sc_start(src,SC_COMBO, 15, TK_TURNKICK,
 						(2000 - 4*sstatus->agi - 2*sstatus->dex)))
 					; //Stance triggered
-                    else if (sc->data[SC_READYCOUNTER]) { //additional chance from SG_FRIEND [Komurka]
+				else if (sc->data[SC_READYCOUNTER]) { //additional chance from SG_FRIEND [Komurka]
 					rate = 20;
 					if (sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == TK_COUNTER) {
 						rate += rate*sc->data[SC_SKILLRATE_UP]->val2/100;
@@ -8620,7 +8620,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 
 	case SO_ARRULLO:
 		{
-			// [(15 + 5 * Skill Level) + ( Caster’s INT / 5 ) + ( Caster’s Job Level / 5 ) - ( Target’s INT / 6 ) - ( Target’s LUK / 10 )] %
+			// [(15 + 5 * Skill Level) + ( Caster's INT / 5 ) + ( Caster's Job Level / 5 ) - ( Target's INT / 6 ) - ( Target's LUK / 10 )] %
 			int rate = (15 + 5 * skill_lv) + status_get_int(src)/5 + (sd ? sd->status.job_level : 0);
 			rate -= status_get_int(bl)/6 - status_get_luk(bl)/10;
 			clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
@@ -8630,7 +8630,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 
 	case WM_LULLABY_DEEPSLEEP:
 		if( flag&1 ){
-			//[(Skill Level x 4) + (Voice Lessons Skill Level x 2) + (Caster’s Base Level / 15) + (Caster’s Job Level / 5)] %
+			//[(Skill Level x 4) + (Voice Lessons Skill Level x 2) + (Caster's Base Level / 15) + (Caster's Job Level / 5)] %
 			int rate = (4 * skill_lv) + ( (sd) ? pc_checkskill(sd,WM_LESSON)*2 + sd->status.job_level/5 : 0 ) + status_get_lv(src) / 15;
 			if( bl != src )
 				sc_start(bl,type,rate,skill_lv,skill_get_time(skill_id,skill_lv));
@@ -9527,7 +9527,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
 
 		if( sd )
 		{
-			if( !skill_check_condition_castend(sd, ud->skill_id, ud->skill_lv) )
+			if( ud->skill_id != AL_WARP && !skill_check_condition_castend(sd, ud->skill_id, ud->skill_lv) )
 				break;
 			else
 				skill_consume_requirement(sd,ud->skill_id,ud->skill_lv,1);
@@ -9551,7 +9551,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
 
 		if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
 			ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv);
-        if (sd) { //Cooldown application
+		if (sd) { //Cooldown application
 			int i, cooldown = skill_get_cooldown(ud->skill_id, ud->skill_lv);
 			for (i = 0; i < ARRAYLENGTH(sd->skillcooldown) && sd->skillcooldown[i].id; i++) { // Increases/Decreases cooldown of a skill by item/card bonuses.
 				if (sd->skillcooldown[i].id == ud->skill_id){