summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/battlegrounds.conf101
-rw-r--r--db/quest_db.txt14
-rw-r--r--doc/script_commands.txt122
-rw-r--r--npc/instances/EndlessTower.txt447
-rw-r--r--npc/instances/NydhoggsNest.txt82
-rw-r--r--npc/instances/OrcsMemory.txt88
-rw-r--r--npc/instances/SealedShrine.txt76
-rw-r--r--npc/other/poring_war.txt23
-rw-r--r--npc/quests/skills/novice_skills.txt4
-rw-r--r--npc/re/guides/guides_mora.txt215
-rw-r--r--npc/re/merchants/quivers.txt121
-rw-r--r--npc/re/mobs/fields/bifrost.txt25
-rw-r--r--npc/re/quests/eden/56-70.txt1395
-rw-r--r--npc/re/quests/quests_mora.txt5315
-rw-r--r--npc/re/quests/skills/sage_skills.txt53
-rw-r--r--npc/re/scripts.conf5
-rw-r--r--npc/re/warps/fields/bif_fild.txt42
-rw-r--r--src/char/char.c46
-rw-r--r--src/char/char.h2
-rw-r--r--src/common/console.c6
-rw-r--r--src/common/malloc.c102
-rw-r--r--src/common/malloc.h2
-rw-r--r--src/common/mmo.h7
-rw-r--r--src/common/socket.c60
-rw-r--r--src/common/socket.h14
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/battleground.c508
-rw-r--r--src/map/battleground.h66
-rw-r--r--src/map/chrif.c7
-rw-r--r--src/map/clif.c253
-rw-r--r--src/map/clif.h41
-rw-r--r--src/map/guild.c10
-rw-r--r--src/map/instance.c484
-rw-r--r--src/map/instance.h76
-rw-r--r--src/map/intif.c2
-rw-r--r--src/map/irc-bot.c6
-rw-r--r--src/map/map.c467
-rw-r--r--src/map/map.h37
-rw-r--r--src/map/mob.c7
-rw-r--r--src/map/npc.c327
-rw-r--r--src/map/npc.h12
-rw-r--r--src/map/packets.h5
-rw-r--r--src/map/packets_struct.h62
-rw-r--r--src/map/party.c107
-rw-r--r--src/map/party.h3
-rw-r--r--src/map/path.c36
-rw-r--r--src/map/pc.c148
-rw-r--r--src/map/pc.h15
-rw-r--r--src/map/script.c713
-rw-r--r--src/map/script.h38
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c19
-rw-r--r--src/map/unit.c37
53 files changed, 9295 insertions, 2562 deletions
diff --git a/conf/battlegrounds.conf b/conf/battlegrounds.conf
new file mode 100644
index 000000000..b43899dd7
--- /dev/null
+++ b/conf/battlegrounds.conf
@@ -0,0 +1,101 @@
+//====================================================
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
+//= | | | | __/ | | (__| |_| | | __/\__ \
+//= \_| |_/\___|_| \___|\__,_|_|\___||___/
+//=
+//= http://hercules.ws/board/
+//====================================================
+//= Link~u! <description> <link to wiki/topic>
+//= http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/
+battlegrounds: (
+{
+ /* feature is not complete */
+ feature_off:true
+ /* character variable for global bg delay */
+ global_delay_var: "BG_Delay_Tick"
+ /* how many seconds to consider a player "afk" and kick him out? */
+ maximum_afk_seconds: 30
+
+ /* one can add as many as he wishes */
+ /* for custom ones, need to edit "lua files/entryqueue/entryqueuelist.lua" [Ind/Hercules] */
+ arenas: ({
+ name: "Tierra Gorge" //must match the name in client files
+ event: "Tierra_BG2::OnPlayerListReady"
+ minLevel: 80
+ maxLevel: 150
+ reward: {/* amount of badges awarded on each case */
+ win: 3
+ loss: 1
+ draw: 1
+ }
+ minPlayers: 6 /* minimum amount of players to start */
+ maxPlayers: 60 /* maximum amount of players */
+ minTeamPlayers: 6 /* minimum amount of team members required for a team (party or guild) to join */
+ delay_var: "Tierra_BG_Tick" /* npc variable name that will store the delay for this match */
+ maxDuration: 30 /* maximum duration in minutes, if reached game ends and highest score wins (or calls a draw if scores are equal) */
+ },{
+ name: "Flavius" //must match the name in client files
+ event: "Flavius_BG1::OnPlayerListReady"
+ minLevel: 80
+ maxLevel: 150
+ reward: {/* amount of badges awarded on each case */
+ win: 9
+ loss: 3
+ draw: 3
+ }
+ minPlayers: 6 /* minimum amount of players to start */
+ maxPlayers: 60 /* maximum amount of players */
+ minTeamPlayers: 6 /* minimum amount of team members required for a team (party or guild) to join */
+ delay_var: "Flavius_BG_Tick" /* npc variable name that will store the delay for this match */
+ maxDuration: 30 /* maximum duration in minutes, if reached game ends and highest score wins (or calls a draw if scores are equal) */
+ },{
+ name: "KVM (Level 80 and up)" //must match the name in client files
+ event: "KvM03_BG::OnPlayerListReady"
+ minLevel: 80
+ maxLevel: 150
+ reward: {/* amount of badges awarded on each case */
+ win: 5
+ loss: 1
+ draw: 1
+ }
+ minPlayers: 4 /* minimum amount of players to start */
+ maxPlayers: 60 /* maximum amount of players */
+ minTeamPlayers: 5 /* minimum amount of team members required for a team (party or guild) to join */
+ delay_var: "KVM_BG_Tick" /* npc variable name that will store the delay for this match */
+ maxDuration: 30 /* maximum duration in minutes, if reached game ends and highest score wins (or calls a draw if scores are equal) */
+ },{
+ name: "KVM (Level 60~79)" //must match the name in client files
+ event: "KvM03_BG::OnPlayerListReady"
+ minLevel: 60
+ maxLevel: 79
+ reward: {/* amount of badges awarded on each case */
+ win: 2
+ loss: 0
+ draw: 1
+ }
+ minPlayers: 4 /* minimum amount of players to start */
+ maxPlayers: 60 /* maximum amount of players */
+ minTeamPlayers: 5 /* minimum amount of team members required for a team (party or guild) to join */
+ delay_var: "KVM_BG_Tick" /* npc variable name that will store the delay for this match */
+ maxDuration: 30 /* maximum duration in minutes, if reached game ends and highest score wins (or calls a draw if scores are equal) */
+ },{
+ name: "KVM (Level 59 and below)" //must match the name in client files
+ event: "KvM03_BG::OnPlayerListReady"
+ minLevel: 1
+ maxLevel: 59
+ reward: {/* amount of badges awarded on each case */
+ win: 1
+ loss: 0
+ draw: 0
+ }
+ minPlayers: 4 /* minimum amount of players to start */
+ maxPlayers: 60 /* maximum amount of players */
+ minTeamPlayers: 5 /* minimum amount of team members required for a team (party or guild) to join */
+ delay_var: "KVM_BG_Tick" /* npc variable name that will store the delay for this match */
+ maxDuration: 30 /* maximum duration in minutes, if reached game ends and highest score wins (or calls a draw if scores are equal) */
+ }
+ )
+}) \ No newline at end of file
diff --git a/db/quest_db.txt b/db/quest_db.txt
index dc3b87d2d..025a9e6ec 100644
--- a/db/quest_db.txt
+++ b/db/quest_db.txt
@@ -33,6 +33,7 @@
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"
+1119,82800,0,0,0,0,0,0,"Neighborhood Knight - Cooldown"
1145,0,0,0,0,0,0,0,"Help the poor cat"
1146,0,0,0,0,0,0,0,"Help the poor cat"
@@ -419,7 +420,7 @@
3256,0,0,0,0,0,0,0,"Request - Ready for waiting summer"
3257,0,1170,30,0,0,0,0,"Request - A grudge of women"
3258,0,0,0,0,0,0,0,"Request - A material of delicacy"
-3259,0,1143,30,0,0,0,0,"Request - A agony of a doll maste"
+3259,0,1143,30,0,0,0,0,"Request - A agony of a doll master"
3260,0,1035,30,0,0,0,0,"Request - Tiresome flies"
3261,0,1026,30,0,0,0,0,"Request - Unclean girl"
3262,0,0,0,0,0,0,0,"Request - Queer hobby"
@@ -527,6 +528,11 @@
5028,43200,0,0,0,0,0,0,"Inspection of the Sample"
5029,3600,0,0,0,0,0,0,"Unidentified Creature"
+5030,0,0,0,0,0,0,0,"The creature's family"
+5031,0,0,0,0,0,0,0,"The creature's family"
+5032,0,0,0,0,0,0,0,"The creature's family"
+5033,0,0,0,0,0,0,0,"The creature's family"
+5034,0,0,0,0,0,0,0,"News from the family"
5035,0,0,0,0,0,0,0,"Help the old man!"
5036,0,0,0,0,0,0,0,"Help the old man!"
5037,0,0,0,0,0,0,0,"Help the old man!"
@@ -854,7 +860,7 @@
// New Sapha's Honor Quest
7206,0,0,0,0,0,0,0,"New Day for Cheshire"
7207,0,0,0,0,0,0,0,"Cheshire's Box"
-7208,82800,0,0,0,0,0,0,"Wait for Cheshire?"
+7208,86400,0,0,0,0,0,0,"Wait for Cheshire?"
// Misty Forest Labyrinth
7211,9000,0,0,0,0,0,0,"Misty Forest Labyrinth Exploration"
@@ -1683,8 +1689,8 @@
//Mora Quests
// == Roast Beef Quest
-11182,180,0,0,0,0,0,0,"Teohre's Report"
-11183,0,0,0,0,0,0,0,"Teohre's Favor"
+11182,60,0,0,0,0,0,0,"Theore's Report"
+11183,0,0,0,0,0,0,0,"Theore's Favor"
// == Theo
11184,0,0,0,0,0,0,0,"Runaway Laphine"
11185,0,0,0,0,0,0,0,"Pouch"
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 26801c07c..47b2c5db6 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -7623,10 +7623,9 @@ This will open a book item at the specified page.
========================
---------------------------------------
-*instance_create("<instance name>",<party id>);
+*instance_create("<instance name>",<owner id>{,<optional owner_type>});
-Create an instance using the name "<instance name>" for the Party of
-<party id>.
+Create an instance using the name "<instance name>" for the <owner_id> of owner_type (when not provided, defaults to IOT_PARTY)
Most instance_* commands are used in conjunction with this command and
depend on the ID this command returns.
@@ -7657,30 +7656,32 @@ Example:
*instance_destroy {<instance id>};
Destroys instance with the ID <instance id>. If no ID is specified, the
-instance the script is attached to is used. If the script is not attached
-to an instance, the instance of the currently attached player's party is
-used. If no player is currently attached, the command fails and causes the
-script to halt.
+instance the script is attached to is used. If in the end no instance_id,
+is found the command halts the script execution.
---------------------------------------
-*instance_attachmap("<map name>",<instance id>{,<use base name>});
+*instance_attachmap("<map name>",<instance id>{,<use base name>{,"<new map name>"}});
Attaches the map "<map name>" to the instance specified with
<instance id>. The optional parameter specifies, whether a map requires
-emulation for instancing (1) or not (0 = default).
+emulation for instancing (1) or not (0 = default). if use base name is specified,
+and "<new map name>" too the server will instance the map under the "<new map name>",
+name.
Returns the resulting map name on success or an empty string on failure.
+Example:
+ instance_attachmap("prontera", .@instance_id,1,"via");
+^ the above creates a instance (or clone) of prontera, on a map called "via"
+
---------------------------------------
*instance_detachmap "<map name>"{,<instance id>};
Detach the map "<map name>" to the instance with the <instance id>. If no
-ID is specified, the instance the script is attached to is used. If the
-script is not attached to an instance, the instance of the currently
-attached player's party is used. If no player is currently attached, the
-command fails and causes the script to halt.
+ID is specified, the instance the script is attached to is used. If in the
+end no instance_id is found the command halts the script execution.
---------------------------------------
@@ -7694,10 +7695,8 @@ the source maps to the instanced maps.
*instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};
Works like announce, but has the <instance id> parameter. If instance id
-is 0, the instance the script is attached to is used. If the script is not
-attached to an instance, the instance of the currently attached player's
-party is used. If no player is currently attached, the command fails and
-causes the script to halt.
+is -1, the instance the script is attached to is used. If in the
+end no instance_id is found the command halts the script execution.
---------------------------------------
@@ -7711,10 +7710,8 @@ Attaches the current script to the instance given by <instance id>.
Retrieves the unique name given to a copy of an NPC given by "<npc name>"
in an instance specified <instance id>. If no ID is specified, the
-instance the script is attached to is used. If the script is not attached
-to an instance, the instance of the currently attached player's party is
-used. If no player is currently attached, the command fails and causes the
-script to halt.
+instance the script is attached to is used. If in the end no instance_id,
+is found the command halts the script execution.
---------------------------------------
@@ -7722,22 +7719,18 @@ script to halt.
Checks whether or not the given map belongs to specified instance. If no
ID is specified, the instance the script is attached to is used. If the
-script is not attached to an instance, the instance of the currently
-attached player's party is used. If no player is currently attached, the
-command fails and causes the script to halt.
+script is not attached to an instance, it'll try to check whether the,
+player attached to the script possesses an instance with a map matching
+"<map name>". If in the end no instance_id is found the command halts the,
+script execution.
Returns name of the instanced map on success, otherwise an empty string.
---------------------------------------
-*instance_id({<type>});
+*instance_id();
-Retrieves the instance id, depending on <type>. If type is not given, it
-defaults to 0.
-
-Type:
- 0 - Instance ID the script is attached to.
- 1 - Instance ID of the currently attached player's party.
+Retrieves the instance id of the script it is being run on.
---------------------------------------
@@ -7745,19 +7738,16 @@ Type:
Warps all players in the instance <instance id> to <map name> at given
coordinates. If no ID is specified, the instance the script is attached to
-is used. If the script is not attached to an instance, the instance of the
-currently attached player's party is used. If no player is currently
-attached, the command fails and causes the script to halt.
+is used. If in the end no instance_id is found the command halts the,
+script execution.
---------------------------------------
*instance_set_timeout <alive timeout>,<idle timeout>{,<instance id>};
Sets the timeout values for an instance given by <instance id>. If no ID
-is specified, the instance the script is attached to is used. If the
-script is not attached to an instance, the instance of the currently
-attached player's party is used. If no player is currently attached, the
-command fails and causes the script to halt.
+is specified, the instance the script is attached to is used. If in the end,
+no instance_id is found the command halts the script execution.
Parameter <alive timeout> specifies the total amount of time the instance
will exist. Parameter <idle timeout> specifies how long players have, when
@@ -8093,3 +8083,59 @@ If the character does not have a mercenary, the command returns ""
for name and 0 for all other types.
----------------------------------------
+
+==========================
+|11.- Queue Commands .|
+==========================
+---------------------------------------
+Queue Author's note: the following sucks, probably breaks formatting, please fix if you're willing to (you may remove this note)
+---------------------------------------
+*queue()
+creates a new queue instance, returns created queue id
+
+---------------------------------------
+*queuesize(<queue_id>)
+returns the amount of entries in queue instance of <queue_id>.
+
+---------------------------------------
+*queueadd(<queue_id>,<var_id>)
+adds <var_id> to queue of <queue_id>, returns 1 if <var_id> is already present in the queue, 0 otherwise.
+
+---------------------------------------
+*queueremove(<queue_id>,<var_id>)
+removes <var_id> from queue of <queue_id>, returns 1 if <var_id> is not present in the queue, 0 otherwise.
+
+---------------------------------------
+*queueopt(<queue_id>,<optionType>,{Optional <option val>})
+modifies <queue_id>'s <optionType>, when <option val> is not present, <optionType> is removed from <queue_id>, when present it modifies <queue_id>'s <optionType> with the new <option val> value.
+Currently 3 options are available, HQO_OnDeath (0), HQO_OnLogout (1), HQO_OnMapChange (2) (the constant names are not final).
+
+Example:
+ queueopt(.@queue_id,0,"MyNPC::MyOnQueueMemberDeathEventName");
+
+---------------------------------------
+*queuedel(<queue_id>)
+deletes <queue_id> returns 1 when <queue_id> is not found, 0 otherwise.
+
+---------------------------------------
+*queueiterator(<queue_id>)
+creates a new queue iterator instance, a queue iterator is not a reference to a queue's actual members, it copies the queues members when initialized, this way you can loop through them even if you remove them from the queue
+
+---------------------------------------
+*qicheck(<queue_iterator_id>)
+checks whether there is a next member in the iterator's queue, 1 when it does, 0 otherwise.
+
+---------------------------------------
+*qiget(<queue_iterator_id>)
+obtains the next member in the iterator's queue, returns the next member's id or 0 when it doesnt exist.
+
+Example:
+ for( set .@elem,qiget(.@queue_iterator_id); qicheck(.@queue_iterator_id); set .@elem,qiget(.@queue_iterator_id) ) {
+ //Do something
+ }
+
+---------------------------------------
+*qiclear(<queue_iterator_id>)
+deletes a queue iterator from memory, returns 1 when it fails, 0 otherwise.
+
+---------------------------------------
diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt
index 7edbc618f..a6c330e69 100644
--- a/npc/instances/EndlessTower.txt
+++ b/npc/instances/EndlessTower.txt
@@ -202,7 +202,8 @@ alberta,214,77,6 script Captain Janssen 709,{
}
}
-e_tower,81,105,0 script Tower Protection Stone 406,{
+//e_tower,81,105,0 script Tower Protection Stone 406,{
+prontera,150,150,0 script Tower Protection Stone 952,{
set .@party_id,getcharid(1);
set .@ins_mas,getpartyleader(.@party_id,2);
@@ -481,7 +482,7 @@ e_tower,151,185,4 script Purification Stone#et2 844,{
}
else {
delitem 6000,1; //Dark_Ashes
- instance_announce 0, .@move_name$ + ". You will be warped to the 26th Level.",bc_map,"0x00ff99";
+ instance_announce -1, .@move_name$ + ". You will be warped to the 26th Level.",bc_map,"0x00ff99";
warp "2@tower",52,354;
}
break;
@@ -493,7 +494,7 @@ e_tower,151,185,4 script Purification Stone#et2 844,{
}
else {
delitem 6000,2; //Dark_Ashes
- instance_announce 0, .@move_name$ + ". You will be warped to the 51st Level.",bc_map,"0x00ff99";
+ instance_announce -1, .@move_name$ + ". You will be warped to the 51st Level.",bc_map,"0x00ff99";
warp "3@tower",52,354;
}
break;
@@ -505,7 +506,7 @@ e_tower,151,185,4 script Purification Stone#et2 844,{
}
else {
delitem 6000,3; //Dark_Ashes
- instance_announce 0, .@move_name$ + ". You will be warped to the 76th Level.",bc_map,"0x00ff99";
+ instance_announce -1, .@move_name$ + ". You will be warped to the 76th Level.",bc_map,"0x00ff99";
warp "4@tower",52,354;
}
break;
@@ -532,11 +533,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 1
}
else
- instance_announce 0, "Remaining Monsters on the 1st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 1st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 1st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("1FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -567,11 +568,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 2
}
else
- instance_announce 0, "Remaining Monsters on the 2nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 2nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 2nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 2nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("2FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -605,11 +606,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 3
}
else
- instance_announce 0, "Remaining Monsters on the 3rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 3rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 3rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 3rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("3FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -643,11 +644,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 4
}
else
- instance_announce 0, "Remaining Monsters on the 4th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 4th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 4th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 4th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("4FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -680,11 +681,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 5
}
else
- instance_announce 0, "Remaining Monsters on the 5th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 5th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 5th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 5th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("5FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -716,11 +717,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 6
}
else
- instance_announce 0, "Remaining Monsters on the 6th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 6th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 6th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 6th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("6FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -752,11 +753,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 7
}
else
- instance_announce 0, "Remaining Monsters on the 7th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 7th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 7th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 7th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("7FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -786,11 +787,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 8
}
else
- instance_announce 0, "Remaining Monsters on the 8th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 8th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 8th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 8th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("8FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -821,11 +822,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 9
}
else
- instance_announce 0, "Remaining Monsters on the 9th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 9th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 9th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 9th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("9FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -856,11 +857,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 10
}
else
- instance_announce 0, "Remaining Monsters on the 10th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 10th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 10th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 10th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("10FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -892,11 +893,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 11
}
else
- instance_announce 0, "Remaining Monsters on the 11th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 11th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 11th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 11th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("11FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -926,11 +927,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 12
}
else
- instance_announce 0, "Remaining Monsters on the 12th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 12th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 12th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 12th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("12FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -961,11 +962,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 13
}
else
- instance_announce 0, "Remaining Monsters on the 13th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 13th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 13th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 13th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("13FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -998,11 +999,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 14
}
else
- instance_announce 0, "Remaining Monsters on the 14th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 14th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 14th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 14th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("14FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1037,11 +1038,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 15
}
else
- instance_announce 0, "Remaining Monsters on the 15th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 15th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 15th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 15th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("15FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1073,11 +1074,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 16
}
else
- instance_announce 0, "Remaining Monsters on the 16th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 16th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 16th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 16th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("16FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1109,11 +1110,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 17
}
else
- instance_announce 0, "Remaining Monsters on the 17th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 17th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 17th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 17th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("17FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1143,11 +1144,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 18
}
else
- instance_announce 0, "Remaining Monsters on the 18th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 18th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 18th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 18th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("18FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1179,11 +1180,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 19
}
else
- instance_announce 0, "Remaining Monsters on the 19th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 19th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 19th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 19th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("19FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1213,11 +1214,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 20
}
else
- instance_announce 0, "Remaining Monsters on the 20th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 20th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 20th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 20th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("20FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1250,11 +1251,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 21
}
else
- instance_announce 0, "Remaining Monsters on the 21st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 21st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 21st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 21st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("21FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1288,11 +1289,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 22
}
else
- instance_announce 0, "Remaining Monsters on the 22nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 22nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 22nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 22nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("22FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1325,11 +1326,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 23
}
else
- instance_announce 0, "Remaining Monsters on the 23rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 23rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 23rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 23rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("23FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1360,11 +1361,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 24
}
else
- instance_announce 0, "Remaining Monsters on the 24th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 24th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 24th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 24th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("24FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1395,11 +1396,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 25
}
else
- instance_announce 0, "Remaining Monsters on the 25th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 25th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 25th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 25th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("25FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1487,11 +1488,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 26
}
else
- instance_announce 0, "Remaining Monsters on the 26th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 26th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 26th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 26th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("26FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1525,11 +1526,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 27
}
else
- instance_announce 0, "Remaining Monsters on the 27th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 27th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 27th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 27th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("27FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1561,11 +1562,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 28
}
else
- instance_announce 0, "Remaining Monsters on the 28th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 28th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 28th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 28th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("28FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1599,11 +1600,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 29
}
else
- instance_announce 0, "Remaining Monsters on the 29th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 29th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 29th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 29th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("29FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1633,11 +1634,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 30
}
else
- instance_announce 0, "Remaining Monsters on the 30th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 30th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 30th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 30th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("30FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1669,11 +1670,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 31
}
else
- instance_announce 0, "Remaining Monsters on the 31st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 31st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 31st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 31st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("31FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1708,11 +1709,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 32
}
else
- instance_announce 0, "Remaining Monsters on the 32nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 32nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 32nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 32nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("32FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1745,11 +1746,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 33
}
else
- instance_announce 0, "Remaining Monsters on the 33rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 33rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 33rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 33rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("33FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1780,11 +1781,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 34
}
else
- instance_announce 0, "Remaining Monsters on the 34th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 34th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 34th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 34th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("34FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1817,11 +1818,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 35
}
else
- instance_announce 0, "Remaining Monsters on the 35th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 35th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 35th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 35th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("35FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1852,11 +1853,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 36
}
else
- instance_announce 0, "Remaining Monsters on the 36th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 36th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 36th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 36th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("36FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1887,11 +1888,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 37
}
else
- instance_announce 0, "Remaining Monsters on the 37th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 37th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 37th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 37th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("37FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1921,11 +1922,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 38
}
else
- instance_announce 0, "Remaining Monsters on the 38th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 38th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 38th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 38th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("38FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1958,11 +1959,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 39
}
else
- instance_announce 0, "Remaining Monsters on the 39th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 39th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 39th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 39th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("39FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -1996,11 +1997,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 40
}
else
- instance_announce 0, "Remaining Monsters on the 40th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 40th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 40th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 40th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("40FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2029,11 +2030,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 41
}
else
- instance_announce 0, "Remaining Monsters on the 41st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 41st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 41st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 41st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("41FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2066,11 +2067,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 42
}
else
- instance_announce 0, "Remaining Monsters on the 42nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 42nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 42nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 42nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("42FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2102,11 +2103,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 43
}
else
- instance_announce 0, "Remaining Monsters on the 43rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 43rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 43rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 43rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("43FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2139,11 +2140,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 44
}
else
- instance_announce 0, "Remaining Monsters on the 44th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 44th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 44th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 44th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("44FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2175,11 +2176,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 45
}
else
- instance_announce 0, "Remaining Monsters on the 45th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 45th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 45th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 45th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("45FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2209,11 +2210,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 46
}
else
- instance_announce 0, "Remaining Monsters on the 46th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 46th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 46th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 46th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("46FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2245,11 +2246,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 47
}
else
- instance_announce 0, "Remaining Monsters on the 47 Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 47 Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 47th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 47th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("47FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2280,11 +2281,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 48
}
else
- instance_announce 0, "Remaining Monsters on the 48th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 48th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 48th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 48th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("48FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2317,11 +2318,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 49
}
else
- instance_announce 0, "Remaining Monsters on the 49th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 49th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 49th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 49th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("49FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2354,11 +2355,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 50
}
else
- instance_announce 0, "Remaining Monsters on the 50th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 50th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 50th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 50th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("50FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2444,11 +2445,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 51
}
else
- instance_announce 0, "Remaining Monsters on the 51st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 51st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 51st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 51st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("51FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2482,11 +2483,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 52
}
else
- instance_announce 0, "Remaining Monsters on the 52nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 52nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 52nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 52nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("52FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2516,11 +2517,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 53
}
else
- instance_announce 0, "Remaining Monsters on the 53rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 53rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 53rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 53rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("53FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2551,11 +2552,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 54
}
else
- instance_announce 0, "Remaining Monsters on the 54th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 54th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 54th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 54th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("54FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2587,11 +2588,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 55
}
else
- instance_announce 0, "Remaining Monsters on the 55th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 55th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 55th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 55th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("55FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2624,11 +2625,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 56
}
else
- instance_announce 0, "Remaining Monsters on the 56th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 56th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 56th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 56th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("56FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2665,11 +2666,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 57
}
else
- instance_announce 0, "Remaining Monsters on the 57th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 57th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 57th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 57th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("57FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2702,11 +2703,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 58
}
else
- instance_announce 0, "Remaining Monsters on the 58th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 58th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 58th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 58th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("58FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2737,11 +2738,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 59
}
else
- instance_announce 0, "Remaining Monsters on the 59th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 59th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 59th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 59th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("59FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2777,11 +2778,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 60
}
else
- instance_announce 0, "Remaining Monsters on the 60th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 60th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 60th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 60th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("60FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2815,11 +2816,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 61
}
else
- instance_announce 0, "Remaining Monsters on the 61st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 61st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 61st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 61st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("61FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2848,11 +2849,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 62
}
else
- instance_announce 0, "Remaining Monsters on the 62nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 62nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 62nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 62nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("62FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2885,11 +2886,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 63
}
else
- instance_announce 0, "Remaining Monsters on the 63rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 63rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 63rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 63rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("63FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2923,11 +2924,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 64
}
else
- instance_announce 0, "Remaining Monsters on the 64th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 64th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 64th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 64th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("64FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2957,11 +2958,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 65
}
else
- instance_announce 0, "Remaining Monsters on the 65th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 65th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 65th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 65th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("65FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -2992,11 +2993,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 66
}
else
- instance_announce 0, "Remaining Monsters on the 66th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 66th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 66th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 66th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("66FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3029,11 +3030,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 67
}
else
- instance_announce 0, "Remaining Monsters on the 67th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 67th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 67th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 67th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("67FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3066,11 +3067,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 68
}
else
- instance_announce 0, "Remaining Monsters on the 68th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 68th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 68th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 68th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("68FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3103,11 +3104,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 69
}
else
- instance_announce 0, "Remaining Monsters on the 69th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 69th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 69th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 69th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("69FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3138,11 +3139,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 70
}
else
- instance_announce 0, "Remaining Monsters on the 70th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 70th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 70th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 70th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("70FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3174,11 +3175,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 71
}
else
- instance_announce 0, "Remaining Monsters on the 71st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 71st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 71st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 71st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("71FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3210,11 +3211,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 72
}
else
- instance_announce 0, "Remaining Monsters on the 72nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 72nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 72nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 72nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("72FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3248,11 +3249,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 73
}
else
- instance_announce 0, "Remaining Monsters on the 73rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 73rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 73rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 73rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("73FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3289,11 +3290,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 74
}
else
- instance_announce 0, "Remaining Monsters on the 74th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 74th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 74th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 74th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("74FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3325,11 +3326,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 75
}
else
- instance_announce 0, "Remaining Monsters on the 75th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1, "Remaining Monsters on the 75th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0, "All Monsters on the 75th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1, "All Monsters on the 75th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("75FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3415,11 +3416,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 76
}
else
- instance_announce 0,"Remaining Monsters on the 76th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 76th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 76th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 76th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("76FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3452,11 +3453,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 77
}
else
- instance_announce 0,"Remaining Monsters on the 77th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 77th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 77th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 77th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("77FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3489,11 +3490,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 78
}
else
- instance_announce 0,"Remaining Monsters on the 78th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 78th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the Level 78th have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the Level 78th have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("78FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3526,11 +3527,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 79
}
else
- instance_announce 0,"Remaining Monsters on the 79th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 79th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 79th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 79th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("79FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3560,11 +3561,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 80
}
else
- instance_announce 0,"Remaining Monsters on the 80th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 80th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 80th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 80th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("80FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3595,11 +3596,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 81
}
else
- instance_announce 0,"Remaining Monsters on the 81st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 81st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 81st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 81st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("81FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3632,11 +3633,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 82
}
else
- instance_announce 0,"Remaining Monsters on the 82nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 82nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 82nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 82nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("82FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3668,11 +3669,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 83
}
else
- instance_announce 0,"Remaining Monsters on the 83rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 83rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 83rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 83rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("83FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3705,11 +3706,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 84
}
else
- instance_announce 0,"Remaining Monsters on the 84th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 84th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 84th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 84th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("84FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3738,11 +3739,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 85
}
else
- instance_announce 0,"Remaining Monsters on the 85th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 85th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 85th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 85th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("85FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3774,11 +3775,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 86
}
else
- instance_announce 0,"Remaining Monsters on the 86th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 86th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 86th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 86th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("86FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3810,11 +3811,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 87
}
else
- instance_announce 0,"Remaining Monsters on the 87th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 87th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 87th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 87th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("87FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3847,11 +3848,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 88
}
else
- instance_announce 0,"Remaining Monsters on the 88th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 88th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 88th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 88th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("88FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3883,11 +3884,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 89
}
else
- instance_announce 0,"Remaining Monsters on the 89th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 89th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 89th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 89th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("89FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3919,11 +3920,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 90
}
else
- instance_announce 0,"Remaining Monsters on the 90th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 90th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 90th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 90th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("90FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3954,11 +3955,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 91
}
else
- instance_announce 0,"Remaining Monsters on the 91st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 91st Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 91st Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 91st Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("91FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -3991,11 +3992,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 92
}
else
- instance_announce 0,"Remaining Monsters on the 92nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 92nd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 92nd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 92nd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("92FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4027,11 +4028,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 93
}
else
- instance_announce 0,"Remaining Monsters on the 93rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 93rd Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 93rd Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 93rd Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("93FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4061,11 +4062,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 94
}
else
- instance_announce 0,"Remaining Monsters on the 94th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 94th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 94th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 94th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("94FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4098,11 +4099,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 95
}
else
- instance_announce 0,"Remaining Monsters on the 95th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 95th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 95th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 95th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("95FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4133,11 +4134,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 96
}
else
- instance_announce 0,"Remaining Monsters on the 96th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 96th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 96th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 96th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("96FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4169,11 +4170,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 97
}
else
- instance_announce 0,"Remaining Monsters on the 97th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 97th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 97th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 97th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("97FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4207,11 +4208,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 98
}
else
- instance_announce 0,"Remaining Monsters on the 98th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 98th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 98th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 98th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("98FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4302,11 +4303,11 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 99
}
else
- instance_announce 0,"Remaining Monsters on the 99th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Monsters on the 99th Level - " + .@mob_dead_num,bc_map,"0x00ff99";
end;
OnTimer5000:
- instance_announce 0,"All Monsters on the 99th Level have been defeated.",bc_map,"0xffff00";
+ instance_announce -1,"All Monsters on the 99th Level have been defeated.",bc_map,"0xffff00";
donpcevent instance_npcname("99FGate102tower", instance_id())+"::OnEnable";
stopnpctimer;
end;
@@ -4488,7 +4489,7 @@ OnInstanceInit:
OnMyMobDead:
set .@mob_dead_num,mobcount("5@tower",instance_npcname("#102FShadowDust1", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Mysterious Voice: Who are you to dare intrude upon my sanctuary?!",bc_map,"0xffff00";
+ instance_announce -1, "Mysterious Voice: Who are you to dare intrude upon my sanctuary?!",bc_map,"0xffff00";
donpcevent instance_npcname("#102FShadowDust", instance_id())+"::OnDisable";
donpcevent instance_npcname("Lucid Crystal#102", instance_id())+"::OnEnable";
//SetItemPartyInMap in_102floor 100
@@ -4633,23 +4634,23 @@ OnEnable:
end;
OnTimer500:
- instance_announce 0,"Guests, huh? I hope you've come here knowing that you'll be buried in this place. If you didn't know, well... it's too late!",bc_map,"0x00ffcc";
+ instance_announce -1,"Guests, huh? I hope you've come here knowing that you'll be buried in this place. If you didn't know, well... it's too late!",bc_map,"0x00ffcc";
end;
OnTimer5500:
- instance_announce 0,"This is why you adventurers always end up dead.",bc_map,"0x00ffcc";
+ instance_announce -1,"This is why you adventurers always end up dead.",bc_map,"0x00ffcc";
end;
OnTimer10500:
- instance_announce 0,"I may applaud you for your courage... Of course, I intend to play with you a little bit first.",bc_map,"0x00ffcc";
+ instance_announce -1,"I may applaud you for your courage... Of course, I intend to play with you a little bit first.",bc_map,"0x00ffcc";
end;
OnTimer15500:
- instance_announce 0,"You know, I like watching humans running around in fear.",bc_map,"0x00ffcc";
+ instance_announce -1,"You know, I like watching humans running around in fear.",bc_map,"0x00ffcc";
end;
OnTimer20500:
- instance_announce 0,"Let's see who runs fastest. Are you ready?",bc_map,"0x00ffcc";
+ instance_announce -1,"Let's see who runs fastest. Are you ready?",bc_map,"0x00ffcc";
stopnpctimer;
areamonster "6@tower",151,66,153,106,"Bone Guardian",1152,50,instance_npcname("#1st Beeper", instance_id())+"::OnMyMobDead";
areamonster "6@tower",158,66,160,106,"Bone Guardian",1152,50,instance_npcname("#1st Beeper", instance_id())+"::OnMyMobDead";
@@ -4662,7 +4663,7 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 101
}
else
- instance_announce 0,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
end;
}
@@ -4674,15 +4675,15 @@ OnEnable:
end;
OnTimer500:
- instance_announce 0,"Well, I guess they aren't too challenging for you.",bc_map,"0x00ffcc";
+ instance_announce -1,"Well, I guess they aren't too challenging for you.",bc_map,"0x00ffcc";
end;
OnTimer5500:
- instance_announce 0,"Let's speed up a little bit, shall we?",bc_map,"0x00ffcc";
+ instance_announce -1,"Let's speed up a little bit, shall we?",bc_map,"0x00ffcc";
end;
OnTimer10500:
- instance_announce 0,"I demand an encore!",bc_map,"0x00ffcc";
+ instance_announce -1,"I demand an encore!",bc_map,"0x00ffcc";
stopnpctimer;
areamonster "6@tower",151,66,153,106,"Wind Guardian",1263,30,instance_npcname("#2nd Beeper", instance_id())+"::OnMyMobDead";
areamonster "6@tower",158,66,160,106,"Wind Guardian",1263,30,instance_npcname("#2nd Beeper", instance_id())+"::OnMyMobDead";
@@ -4695,7 +4696,7 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 102
}
else
- instance_announce 0,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
end;
}
@@ -4707,15 +4708,15 @@ OnEnable:
end;
OnTimer500:
- instance_announce 0,"Yes, this is getting exciting!",bc_map,"0x00ffcc";
+ instance_announce -1,"Yes, this is getting exciting!",bc_map,"0x00ffcc";
end;
OnTimer5500:
- instance_announce 0,"I'll remember you as one of a few that have managed to entertain me.",bc_map,"0x00ffcc";
+ instance_announce -1,"I'll remember you as one of a few that have managed to entertain me.",bc_map,"0x00ffcc";
end;
OnTimer10500:
- instance_announce 0,"How would you like to play one more round?",bc_map,"0x00ffcc";
+ instance_announce -1,"How would you like to play one more round?",bc_map,"0x00ffcc";
stopnpctimer;
areamonster "6@tower",151,66,153,106,"Sword Edge Guardian",1132,20,instance_npcname("#3rd Beeper", instance_id())+"::OnMyMobDead";
areamonster "6@tower",158,66,160,106,"Sword Edge Guardian",1132,20,instance_npcname("#3rd Beeper", instance_id())+"::OnMyMobDead";
@@ -4728,7 +4729,7 @@ OnMyMobDead:
//SetItemPartyInMap in_102floor 103
}
else
- instance_announce 0,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
+ instance_announce -1,"Remaining Targets " + .@mob_dead_num + "ea",bc_map,"0x00ff99";
end;
}
@@ -4740,15 +4741,15 @@ OnEnable:
end;
OnTimer500:
- instance_announce 0,"Okay, the time has come to make my appearance!",bc_map,"0x00ffcc";
+ instance_announce -1,"Okay, the time has come to make my appearance!",bc_map,"0x00ffcc";
end;
OnTimer5500:
- instance_announce 0,"Do you want to know who I am?",bc_map,"0x00ffcc";
+ instance_announce -1,"Do you want to know who I am?",bc_map,"0x00ffcc";
end;
OnTimer10500:
- instance_announce 0,"You'll soon know. Mine is the face of death!",bc_map,"0x00ffcc";
+ instance_announce -1,"You'll soon know. Mine is the face of death!",bc_map,"0x00ffcc";
stopnpctimer;
monster "6@tower",156,147,"Nacht Sieger",1956,1,instance_npcname("#4th Beeper", instance_id())+"::OnMyMobDead";
end;
@@ -4825,15 +4826,15 @@ OnEnable:
end;
OnTimer500:
- instance_announce 0,"This... This can't be happening! I can't be defeated!",bc_map,"0xffff00";
+ instance_announce -1,"This... This can't be happening! I can't be defeated!",bc_map,"0xffff00";
end;
OnTimer5500:
- instance_announce 0,"Nooo! My soul... My shell...! Nooo~!",bc_map,"0xffff00";
+ instance_announce -1,"Nooo! My soul... My shell...! Nooo~!",bc_map,"0xffff00";
end;
OnTimer10500:
- instance_announce 0,"Nacht Sieger's body has turned into dark ashes that scattered in the wind.",bc_map,"0x00ffcc";
+ instance_announce -1,"Nacht Sieger's body has turned into dark ashes that scattered in the wind.",bc_map,"0x00ffcc";
stopnpctimer;
end;
}
diff --git a/npc/instances/NydhoggsNest.txt b/npc/instances/NydhoggsNest.txt
index 4898bb6c3..2d48d0341 100644
--- a/npc/instances/NydhoggsNest.txt
+++ b/npc/instances/NydhoggsNest.txt
@@ -1811,7 +1811,7 @@ OnEnable:
monster "1@nyd",255,255,"Nidhoggur's Guardian#10",2021,1,instance_npcname("nyd_call_mon_1", instance_id())+"::OnMyMobDead";
monster "1@nyd",225,245,"Nidhoggur's Guardian#11",2021,1,instance_npcname("nyd_call_mon_1", instance_id())+"::OnMyMobDead";
monster "1@nyd",230,280,"Nidhoggur's Guardian#12",2021,1,instance_npcname("nyd_call_mon_1", instance_id())+"::OnMyMobDead";
- instance_announce 0, "Nidhoggur's Guardian : Protect the Guardian's Sanctuary. Get rid of the intruders.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Guardian : Protect the Guardian's Sanctuary. Get rid of the intruders.",bc_map,"0x00ff99";
end;
OnDisable:
@@ -1822,7 +1822,7 @@ OnDisable:
OnMyMobDead:
set .@mob_dead_num,mobcount("1@nyd", instance_npcname("nyd_call_mon_1", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "All of Nidhoggur's Guardians have been defeated!",bc_map,"0x00ff99";
+ instance_announce -1, "All of Nidhoggur's Guardians have been defeated!",bc_map,"0x00ff99";
donpcevent instance_npcname("ins_nyd_1f_timer", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_to2f_warp", instance_id())+"::OnEnable";
set 'ins_nyd2,2;
@@ -1848,23 +1848,23 @@ OnDisable:
end;
OnTimer900000:
- instance_announce 0, "World Tree Yggdrasil : There's not much time left. Please hurry.",bc_map,"0xFFFF00";
+ instance_announce -1, "World Tree Yggdrasil : There's not much time left. Please hurry.",bc_map,"0xFFFF00";
end;
OnTimer1200000:
- instance_announce 0, "World Tree Yggdrasil : My powers are slowly disappearing. Please hurry.",bc_map,"0xFFFF00";
+ instance_announce -1, "World Tree Yggdrasil : My powers are slowly disappearing. Please hurry.",bc_map,"0xFFFF00";
end;
OnTimer1500000:
- instance_announce 0, "World Tree Yggdrasil : I'm... almost at my limit... please hurry up." ,bc_map,"0xFFFF00";
+ instance_announce -1, "World Tree Yggdrasil : I'm... almost at my limit... please hurry up." ,bc_map,"0xFFFF00";
end;
OnTimer1800000:
- instance_announce 0, "World Tree Yggdrasil : You've failed... but I will use what power I have left... to send you out of here.",bc_map,"0xFFFF00";
+ instance_announce -1, "World Tree Yggdrasil : You've failed... but I will use what power I have left... to send you out of here.",bc_map,"0xFFFF00";
end;
OnTimer1830000:
- instance_announce 0, "Opening of the Gate has failed.",bc_map,"0xFFFF00";
+ instance_announce -1, "Opening of the Gate has failed.",bc_map,"0xFFFF00";
end;
OnTimer1850000:
@@ -1933,15 +1933,15 @@ OnDisable:
end;
OnTimer12000:
- instance_announce 0, "Nidhoggur's Shadow : No more...I can't stand this anymore...",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : No more...I can't stand this anymore...",bc_map,"0xFFFF00";
end;
OnTimer15000:
- instance_announce 0, "Nidhoggur's Shadow : I need...I need the World Tree Yggdrasil's powers...",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I need...I need the World Tree Yggdrasil's powers...",bc_map,"0xFFFF00";
end;
OnTimer18000:
- instance_announce 0, "Nidhoggur's Shadow : Destroy...everything...",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Destroy...everything...",bc_map,"0xFFFF00";
end;
/*
stopnpctimer;
@@ -1983,7 +1983,7 @@ OnInstanceInit:
OnEnable:
enablenpc instance_npcname("nyd_2f_boss_enter_call", instance_id());
monster "2@nyd",199,327,"Nidhoggur's Shadow#",2022,1,instance_npcname("nyd_2f_boss_enter_call", instance_id())+"::OnMyMobDead";
- instance_announce 0, "Nidhoggur's Shadow : I will devour all of you...you and the World Tree Yggdrasil.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : I will devour all of you...you and the World Tree Yggdrasil.",bc_map,"0x00ff99";
//donpcevent instance_npcname("nyd_2f_boss_enter_call", instance_id())+"::Ongo";
initnpctimer;
end;
@@ -1996,7 +1996,7 @@ OnDisable:
OnTimer180000:
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2005,7 +2005,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2014,7 +2014,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2023,7 +2023,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
@@ -2037,7 +2037,7 @@ OnTimer180000:
OnMyMobDead:
set .@mob_dead_num,mobcount("2@nyd",instance_npcname("nyd_2f_boss_enter_call", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Nidhoggur's Shadow : World Tree Yggdrasil's guardian... his powers are disappearing...",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : World Tree Yggdrasil's guardian... his powers are disappearing...",bc_map,"0x00ff99";
donpcevent instance_npcname("World Tree Yggdrasil#2F", instance_id())+"::OnEnable";
donpcevent instance_npcname("nyd_2f_boss_enter_call", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_boss_enter_logic", instance_id())+"::OnDisable";
@@ -2070,7 +2070,7 @@ OnDisable:
OnTimer180000:
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2079,7 +2079,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2088,7 +2088,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2097,7 +2097,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
@@ -2150,7 +2150,7 @@ OnInstanceInit:
OnEnable:
enablenpc instance_npcname("World Tree Yggdrasil#2F", instance_id());
- instance_announce 0, "World Tree Yggdrasil : You did good. Have everyone go to the Magic Circle in the middle, and get ready for the destruction of the nest.",bc_map,"0x00ff99";
+ instance_announce -1, "World Tree Yggdrasil : You did good. Have everyone go to the Magic Circle in the middle, and get ready for the destruction of the nest.",bc_map,"0x00ff99";
end;
OnDisable:
@@ -2209,7 +2209,7 @@ OnEnable:
OnMyMobDead:
set .@mob_dead_num,mobcount("2@nyd",instance_npcname("nyd_2f_red_c", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
donpcevent instance_npcname("nyd_2f_red_c", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_boss_enter_logic", instance_id())+"::OnEnable";
end;
@@ -2227,7 +2227,7 @@ OnTimer180000:
stopnpctimer;
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2236,7 +2236,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2245,7 +2245,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2254,7 +2254,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
@@ -2369,7 +2369,7 @@ OnEnable:
OnMyMobDead:
set .@mob_dead_num,mobcount("2@nyd",instance_npcname("nyd_2f_white_c", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
donpcevent instance_npcname("nyd_2f_white_c", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_boss_enter_logic", instance_id())+"::OnEnable";
end;
@@ -2387,7 +2387,7 @@ OnTimer180000:
stopnpctimer;
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2396,7 +2396,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2405,7 +2405,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2414,7 +2414,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
@@ -2530,7 +2530,7 @@ OnEnable:
OnMyMobDead:
set .@mob_dead_num,mobcount("2@nyd",instance_npcname("nyd_2f_yellow_c", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Nidhoggur's Shadow : You're not bad...but I will be your opponent this time.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : You're not bad...but I will be your opponent this time.",bc_map,"0x00ff99";
donpcevent instance_npcname("nyd_2f_yellow_c", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_boss_enter_logic", instance_id())+"::OnEnable";
end;
@@ -2555,7 +2555,7 @@ OnTimer180000:
stopnpctimer;
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2564,7 +2564,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2573,7 +2573,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2582,7 +2582,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
@@ -2697,7 +2697,7 @@ OnEnable:
OnMyMobDead:
set .@mob_dead_num,mobcount("2@nyd",instance_npcname("nyd_2f_green_c", instance_id())+"::OnMyMobDead");
if (.@mob_dead_num < 1) {
- instance_announce 0, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
+ instance_announce -1, "Nidhoggur's Shadow : You're not bad... but I will be your opponent this time.",bc_map,"0x00ff99";
donpcevent instance_npcname("nyd_2f_green_c", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_boss_enter_logic", instance_id())+"::OnEnable";
end;
@@ -2722,7 +2722,7 @@ OnTimer180000:
stopnpctimer;
set .@rullet,rand(1,4);
if (.@rullet == 1) {
- instance_announce 0, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : In this chaos... your blood is just what I need.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2731,7 +2731,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 2) {
- instance_announce 0, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I will freeze every last drop of your blood.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2740,7 +2740,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 3) {
- instance_announce 0, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : Sleep for eternity in an empty illusion.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_green", instance_id())+"::OnDisable";
@@ -2749,7 +2749,7 @@ OnTimer180000:
end;
}
else if (.@rullet == 4) {
- instance_announce 0, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
+ instance_announce -1, "Nidhoggur's Shadow : I'll let you enjoy the pain of dying slowly.",bc_map,"0xFFFF00";
donpcevent instance_npcname("nyd_2f_red", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_white", instance_id())+"::OnDisable";
donpcevent instance_npcname("nyd_2f_yellow", instance_id())+"::OnDisable";
diff --git a/npc/instances/OrcsMemory.txt b/npc/instances/OrcsMemory.txt
index a23499d7e..325b1a739 100644
--- a/npc/instances/OrcsMemory.txt
+++ b/npc/instances/OrcsMemory.txt
@@ -309,19 +309,19 @@ OnMyMobDead:
else if ((.@mob_ran > 28) && (.@mob_ran < 30)) {
monster "1@orcs",0,0,"High Orc",1213,.@mob_dead_num,instance_npcname("#Resurrect Monsters1", instance_id())+"::OnMyMobDead";
if (rand(1,10) == 9) {
- instance_announce 0, "High Orc: We need more defenses! Get more people here!",bc_map,"0xff4444";
+ instance_announce -1, "High Orc: We need more defenses! Get more people here!",bc_map,"0xff4444";
}
}
else if ((.@mob_ran > 26) && (.@mob_ran < 29)) {
areamonster "1@orcs",41,91,51,81,"High Orc",1213,.@mob_dead_num,instance_npcname("#Resurrect Monsters1", instance_id())+"::OnMyMobDead";
if (rand(1,10) == 9) {
- instance_announce 0, "Where are the High Orcs!? Get them to stop the enemies!",bc_map,"0xff4444";
+ instance_announce -1, "Where are the High Orcs!? Get them to stop the enemies!",bc_map,"0xff4444";
}
}
else {
areamonster "1@orcs",17,187,27,177,"High Orc",1213,.@mob_dead_num,instance_npcname("#Resurrect Monsters1", instance_id())+"::OnMyMobDead";
if (rand(1,5) == 3) {
- instance_announce 0, "Caution: The army's starting to concentrate at Zone No. 4.",bc_map,"0x77ff77";
+ instance_announce -1, "Caution: The army's starting to concentrate at Zone No. 4.",bc_map,"0x77ff77";
}
if (rand(1,100) == 50) {
initnpctimer;
@@ -331,11 +331,11 @@ OnMyMobDead:
end;
OnTimer10:
- instance_announce 0, "Shouts of the Chief Orc of Safeguards: Looks like this will take longer than expected. Summon the Stalactic Golems!",bc_map,"0xff4444";
+ instance_announce -1, "Shouts of the Chief Orc of Safeguards: Looks like this will take longer than expected. Summon the Stalactic Golems!",bc_map,"0xff4444";
end;
OnTimer4010:
- instance_announce 0, "Stalactic Golems are digging out of the deep underground.",bc_map,"0x77ff77";
+ instance_announce -1, "Stalactic Golems are digging out of the deep underground.",bc_map,"0x77ff77";
areamonster "1@orcs",17,187,27,177,"Stalactic Golem",1278,20,instance_npcname("#Resurrect Monsters1", instance_id())+"::OnMyMobDead";
stopnpctimer;
end;
@@ -432,7 +432,7 @@ OnMyMobDead:
if (.@mob_dead_num > 0) {
areamonster "1@orcs",43,155,47,159,"Orc Archer",1189,.@mob_dead_num,instance_npcname("#Resurrect Monsters3", instance_id())+"::OnMyMobDead";
if (rand(1,3) == 3) {
- instance_announce 0, "High Orc: Attack them from behind! Cut off their support!",bc_map,"0xff4444";
+ instance_announce -1, "High Orc: Attack them from behind! Cut off their support!",bc_map,"0xff4444";
}
}
}
@@ -490,39 +490,39 @@ OnEnable:
end;
OnTimer10:
- instance_announce 0, "Kruger: Damn... What took you so long!! I don't have all day!!",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: Damn... What took you so long!! I don't have all day!!",bc_map,"0xffff00";
end;
OnTimer5710:
- instance_announce 0, "Kruger: My plan was to let our comrades open the gate, but it's all ruined since I got busted by the Orc Shaman.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: My plan was to let our comrades open the gate, but it's all ruined since I got busted by the Orc Shaman.",bc_map,"0xffff00";
end;
OnTimer14610:
- instance_announce 0, "Shouts of the Chief Orc of Safeguards: I smell a rat.. Send some patrols to the entrance!!",bc_map,"0xff4444";
+ instance_announce -1, "Shouts of the Chief Orc of Safeguards: I smell a rat.. Send some patrols to the entrance!!",bc_map,"0xff4444";
end;
OnTimer20210:
- instance_announce 0, "Kruger: Darn it.. They'll be here any minute. Ok. Listen to me now.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: Darn it.. They'll be here any minute. Ok. Listen to me now.",bc_map,"0xffff00";
end;
OnTimer24910:
- instance_announce 0, "Kruger: The Orc Shaman has sealed the 1st basement by dividing it into 4 zones. Each zone has one Enchanted Orc who has the power to unseal the next zone.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: The Orc Shaman has sealed the 1st basement by dividing it into 4 zones. Each zone has one Enchanted Orc who has the power to unseal the next zone.",bc_map,"0xffff00";
end;
OnTimer34310:
- instance_announce 0, "Kruger: Find those Enchanted Orcs and get rid of them to move to the next zone.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: Find those Enchanted Orcs and get rid of them to move to the next zone.",bc_map,"0xffff00";
end;
OnTimer39710:
- instance_announce 0, "Kruger: Try to avoid encountering Orcs other then the Enchanted ones. Everytime you kill a normal Orc, High Orcs will gather at the last path to the 2nd floor.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: Try to avoid encountering Orcs other then the Enchanted ones. Everytime you kill a normal Orc, High Orcs will gather at the last path to the 2nd floor.",bc_map,"0xffff00";
end;
OnTimer49210:
- instance_announce 0, "Kruger: In the worst case, the path to the 2nd floor could be completely blocked. For your own sake, you should be as sneaky as possible.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger: In the worst case, the path to the 2nd floor could be completely blocked. For your own sake, you should be as sneaky as possible.",bc_map,"0xffff00";
end;
OnTimer56310:
- instance_announce 0, "Mission: Sneak in and get rid of the 'Enchanted Orcs'. Avoiding battles with other Orcs is the best way of getting into the 2nd floor.",bc_map,"0x44ffff";
+ instance_announce -1, "Mission: Sneak in and get rid of the 'Enchanted Orcs'. Avoiding battles with other Orcs is the best way of getting into the 2nd floor.",bc_map,"0x44ffff";
donpcevent instance_npcname("#Resurrect Monsters1", instance_id())+"::OnEnable";
donpcevent instance_npcname("#Resurrect Monsters2", instance_id())+"::OnEnable";
donpcevent instance_npcname("#Resurrect Monsters3", instance_id())+"::OnEnable";
@@ -556,11 +556,11 @@ OnContinue:
end;
OnTimer10300:
- instance_announce 0, "Kruger's Whisper: The Orcs here used to be my companions. They just lost their will ever since the Orc Shaman started to control them with her magic.",bc_map,"0xff4499";
+ instance_announce -1, "Kruger's Whisper: The Orcs here used to be my companions. They just lost their will ever since the Orc Shaman started to control them with her magic.",bc_map,"0xff4499";
end;
OnTimer18700:
- instance_announce 0, "Kruger's Whisper: There's nothing we can do but to defeat the Orc Shaman if we want to save the remaining tribes.",bc_map,"0xff4499";
+ instance_announce -1, "Kruger's Whisper: There's nothing we can do but to defeat the Orc Shaman if we want to save the remaining tribes.",bc_map,"0xff4499";
stopnpctimer;
end;
}
@@ -585,11 +585,11 @@ OnContinue:
end;
OnTimer30300:
- instance_announce 0, "Kruger's Whisper: I saw the bodies of our tribe. It seems that the Orc Shaman used those Orcs for her rituals.",bc_map,"0xff4499";
+ instance_announce -1, "Kruger's Whisper: I saw the bodies of our tribe. It seems that the Orc Shaman used those Orcs for her rituals.",bc_map,"0xff4499";
end;
OnTimer37600:
- instance_announce 0, "Kruger's Whisper: ... It all has to do with me. I am responsible for this evil.",bc_map,"0xff4499";
+ instance_announce -1, "Kruger's Whisper: ... It all has to do with me. I am responsible for this evil.",bc_map,"0xff4499";
stopnpctimer;
end;
}
@@ -614,11 +614,11 @@ OnContinue:
end;
OnTimer30300:
- instance_announce 0, "Please, hang in there!",bc_map,"0xff4499";
+ instance_announce -1, "Please, hang in there!",bc_map,"0xff4499";
end;
OnTimer32700:
- instance_announce 0, "We'll get some rest when we get to the 2nd basement after passing through here.",bc_map,"0xff4499";
+ instance_announce -1, "We'll get some rest when we get to the 2nd basement after passing through here.",bc_map,"0xff4499";
stopnpctimer;
end;
}
@@ -724,13 +724,13 @@ OnMyMobDead:
else if ((.@mob_ran > 26) && (.@mob_ran < 29)) {
areamonster "2@orcs",157,112,167,122,"High Orc",1213,.@mob_dead_num,instance_npcname("#2Resurrect Monsters1", instance_id())+"::OnMyMobDead";
if (rand(1,10) == 9) {
- instance_announce 0, "Warning: High Orcs are gathering near area 3.",bc_map,"0xff4444";
+ instance_announce -1, "Warning: High Orcs are gathering near area 3.",bc_map,"0xff4444";
}
}
else {
areamonster "2@orcs",173,13,183,23,"High Orc",1213,.@mob_dead_num,instance_npcname("#2Resurrect Monsters1", instance_id())+"::OnMyMobDead";
if (rand(1,5) == 3) {
- instance_announce 0, "Caution: The Forces have started to concentrate at the Shaman's Altar.",bc_map,"0x77ff77";
+ instance_announce -1, "Caution: The Forces have started to concentrate at the Shaman's Altar.",bc_map,"0x77ff77";
}
if (rand(1,70) == 50) {
initnpctimer;
@@ -740,11 +740,11 @@ OnMyMobDead:
end;
OnTimer10:
- instance_announce 0, "Voice from somewhere: Foolish... Do you really think the altar would fall like that?",bc_map,"0xff4444";
+ instance_announce -1, "Voice from somewhere: Foolish... Do you really think the altar would fall like that?",bc_map,"0xff4444";
end;
OnTimer4010:
- instance_announce 0, "[ Wraiths were summoned by an unknown power ]",bc_map,"0x77ff77";
+ instance_announce -1, "[ Wraiths were summoned by an unknown power ]",bc_map,"0x77ff77";
areamonster "2@orcs",167,25,177,35,"Wraith",1475,30,instance_npcname("#2Resurrect Monsters1", instance_id())+"::OnMyMobDead";
stopnpctimer;
end;
@@ -790,7 +790,7 @@ OnMyMobDead:
if (.@mob_dead_num > 0) {
areamonster "2@orcs",168,10,184,26,"Orc Archer",1189,.@mob_dead_num,instance_npcname("#2Resurrect Monsters3", instance_id())+"::OnMyMobDead";
if (rand(1,15) == 3) {
- instance_announce 0, "Warning: Orc Archer teams are gathering near the altar.",bc_map,"0xff4444";
+ instance_announce -1, "Warning: Orc Archer teams are gathering near the altar.",bc_map,"0xff4444";
}
}
}
@@ -848,27 +848,27 @@ OnEnable:
end;
OnTimer10:
- instance_announce 0, "Kruger's Whisper: I'll tell you how to get to the Shaman's altar.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger's Whisper: I'll tell you how to get to the Shaman's altar.",bc_map,"0xffff00";
end;
OnTimer3510:
- instance_announce 0, "Kruger's Whisper: Do you see the braziers that light the path? Unseal the next zone by strengthening their flames.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger's Whisper: Do you see the braziers that light the path? Unseal the next zone by strengthening their flames.",bc_map,"0xffff00";
end;
OnTimer10710:
- instance_announce 0, "Kruger's Whisper: Of course those monsters won't let you touch the braziers that easily.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger's Whisper: Of course those monsters won't let you touch the braziers that easily.",bc_map,"0xffff00";
end;
OnTimer16310:
- instance_announce 0, "Kruger's Whisper: But still, try keep the battles not too noticable so the Shaman won't guard the altar with her army squad.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger's Whisper: But still, try keep the battles not too noticable so the Shaman won't guard the altar with her army squad.",bc_map,"0xffff00";
end;
OnTimer21910:
- instance_announce 0, "Kruger's Whisper: Only the Party Leader can strengthen the flames, so protect your leader.",bc_map,"0xffff00";
+ instance_announce -1, "Kruger's Whisper: Only the Party Leader can strengthen the flames, so protect your leader.",bc_map,"0xffff00";
end;
OnTimer23910:
- instance_announce 0, "Mission: Unseal the zone by lighting the braziers. They can only be lit in a certain order, so be careful.",bc_map,"0x4444ff";
+ instance_announce -1, "Mission: Unseal the zone by lighting the braziers. They can only be lit in a certain order, so be careful.",bc_map,"0x4444ff";
donpcevent instance_npcname("#2Resurrect Monsters1", instance_id())+"::OnEnable";
donpcevent instance_npcname("#2Resurrect Monsters3", instance_id())+"::OnEnable";
donpcevent instance_npcname("Torch#1-1", instance_id())+"::OnEnable";
@@ -987,7 +987,7 @@ OnInstanceInit:
OnEnable:
monster "2@orcs",109,156,"Safeguard Chief",1981,1,instance_npcname("#Mobs Control", instance_id())+"::OnMyMobDead1";
- instance_announce 0, "The Chief Orc of Safeguards: Oh!! Looks like I have company. Defeat me if you can!!",bc_map,"0xff8888";
+ instance_announce -1, "The Chief Orc of Safeguards: Oh!! Looks like I have company. Defeat me if you can!!",bc_map,"0xff8888";
end;
OnContinue:
@@ -1108,7 +1108,7 @@ OnInstanceInit:
OnEnable:
monster "2@orcs",67,64,"Orc Sniper",1982,1,instance_npcname("#Mobs Control", instance_id())+"::OnMyMobDead2";
- instance_announce 0, "Orc Sniper: Hah! Pretty impressive that you made it this far, but your foolish little trip ends here...",bc_map,"0xff8888";
+ instance_announce -1, "Orc Sniper: Hah! Pretty impressive that you made it this far, but your foolish little trip ends here...",bc_map,"0xff8888";
end;
OnContinue:
@@ -1229,7 +1229,7 @@ OnInstanceInit:
OnEnable:
monster "2@orcs",152,147,"Depraved Orc Spirit",1983,1,instance_npcname("#Mobs Control", instance_id())+"::OnMyMobDead3";
- instance_announce 0, "Depraved Orc Spirit: I smell flesh! Hungry! Wanna try some human meat!!",bc_map,"0xff8888";
+ instance_announce -1, "Depraved Orc Spirit: I smell flesh! Hungry! Wanna try some human meat!!",bc_map,"0xff8888";
end;
OnContinue:
@@ -1240,19 +1240,19 @@ OnContinue:
end;
OnTimer10:
- instance_announce 0, "Shaman Cargalache: Hahaha!! So, you finally made it here. The assassin you sent was just terrible. That stupid Orc is getting cold under my feet.",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: Hahaha!! So, you finally made it here. The assassin you sent was just terrible. That stupid Orc is getting cold under my feet.",bc_map,"0xffff00";
end;
OnTimer6810:
- instance_announce 0, "Shaman Cargalache: My loyal slave, go get those intruders!",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: My loyal slave, go get those intruders!",bc_map,"0xffff00";
end;
OnTimer10310:
- instance_announce 0, "Depraved Orc Hero: Whatever you say, my lord.",bc_map,"0xff7777";
+ instance_announce -1, "Depraved Orc Hero: Whatever you say, my lord.",bc_map,"0xff7777";
end;
OnTimer13110:
- instance_announce 0, "Caution: You have been discovered by Shaman Cargalache. Kruger's plan to assassinate the Shaman has failed. You must defeat Cargalache and find traces of Kruger.",bc_map,"0x8888ff";
+ instance_announce -1, "Caution: You have been discovered by Shaman Cargalache. Kruger's plan to assassinate the Shaman has failed. You must defeat Cargalache and find traces of Kruger.",bc_map,"0x8888ff";
stopnpctimer;
end;
@@ -1278,19 +1278,19 @@ OnMyMobDead:
donpcevent instance_npcname("Kruger#", instance_id())+"::OnEnable";
set .@mob_ran,rand(1,5);
if (.@mob_ran == 1) {
- instance_announce 0, "Shaman Cargalache: How... How could this be... How could someone like you...!!",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: How... How could this be... How could someone like you...!!",bc_map,"0xffff00";
}
else if (.@mob_ran == 2) {
- instance_announce 0, "Shaman Cargalache: How is it that I've been overpowered by mere humans!",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: How is it that I've been overpowered by mere humans!",bc_map,"0xffff00";
}
else if (.@mob_ran == 3) {
- instance_announce 0, "Shaman Cargalache: This... This can't be the end...",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: This... This can't be the end...",bc_map,"0xffff00";
}
else if (.@mob_ran == 4) {
- instance_announce 0, "Shaman Cargalache: I... Can't die... Yet...!",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: I... Can't die... Yet...!",bc_map,"0xffff00";
}
else {
- instance_announce 0, "Shaman Cargalache: Defeated by these fools... It can't be happening...!",bc_map,"0xffff00";
+ instance_announce -1, "Shaman Cargalache: Defeated by these fools... It can't be happening...!",bc_map,"0xffff00";
}
donpcevent instance_npcname("#2Resurrect Monsters1", instance_id())+"::OnDisable";
donpcevent instance_npcname("#2Resurrect Monsters3", instance_id())+"::OnDisable";
diff --git a/npc/instances/SealedShrine.txt b/npc/instances/SealedShrine.txt
index fe376c688..b893a1816 100644
--- a/npc/instances/SealedShrine.txt
+++ b/npc/instances/SealedShrine.txt
@@ -263,8 +263,6 @@ monk_test,306,151,3 script Grave of Baphomet#edq 111,{
switch(select("Touch the stone.:Step back.")) {
case 1:
set .@party_id,getcharid(1);
- set .@instance, instance_id(1);
- instance_attach(.@instance);
// 12 hour cooldown
set .@ins_bapho_check,checkquest(3040,PLAYTIME);
@@ -726,7 +724,7 @@ OnDisable:
OnMyMobDead:
if (mobcount("1@cata",instance_npcname("ins_baphomet_lotto3", instance_id())+"::OnMyMobDead") < 1) {
- instance_announce 0, "All apostles of Baphomet are dead!",bc_map,"0x00ff99";
+ instance_announce -1, "All apostles of Baphomet are dead!",bc_map,"0x00ff99";
}
getitem 6002,1; //Token_Of_Apostle
end;
@@ -807,7 +805,7 @@ OnMyMobDead:
mes "[Voice of the Gravestone]";
mes "Now I can substantialize my soul. I'll wait for you in front of the altar of fire located at the center of this grave. Let's meet there.";
next;
- instance_announce 0, "Ancient Hero's Soul : I'll wait for you in front of the altar of fire located at the center",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : I'll wait for you in front of the altar of fire located at the center",bc_map,"0xFFFF00";
mes "I can feel the voice becoming faint.";
close;
}
@@ -1023,7 +1021,7 @@ OnTouch:
mes "[Ancient Hero's Soul]";
mes "Go ahead, warriors.";
cutin "",255;
- instance_announce 0, "Ancient Hero's Soul : Now you can go to the Main Altar's gate. It is located in the Southeast",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Now you can go to the Main Altar's gate. It is located in the Southeast",bc_map,"0xFFFF00";
close;
}
else if ('ins_baphomet == 4) {
@@ -1178,23 +1176,23 @@ OnDisable:;
end;
OnTimer1800000:
- instance_announce 0, "Ancient Hero's Soul : We don't have enough time! Hurry up!",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : We don't have enough time! Hurry up!",bc_map,"0xFFFF00";
end;
OnTimer2400000:
- instance_announce 0, "Ancient Hero's Soul : My body is disappearing... Hurry up!",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : My body is disappearing... Hurry up!",bc_map,"0xFFFF00";
end;
OnTimer3000000:
- instance_announce 0, "Ancient Hero's Soul : Everything is over... There is no other way but to wait for the next chance...",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Everything is over... There is no other way but to wait for the next chance...",bc_map,"0xFFFF00";
end;
OnTimer3050000:
- instance_announce 0, "Ancient Hero's Soul : We failed... However... We still have a chance. I hope you will train yourselves until the time comes.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : We failed... However... We still have a chance. I hope you will train yourselves until the time comes.",bc_map,"0xFFFF00";
end;
OnTimer3100000:
- instance_announce 0, "You've failed to open the seal of main altar.",bc_map,"0xFFFF00";
+ instance_announce -1, "You've failed to open the seal of main altar.",bc_map,"0xFFFF00";
end;
OnTimer3500000:
@@ -1221,19 +1219,19 @@ OnDisable:
end;
OnTimer10000:
- instance_announce 0, "Baphomet : Humans... interfering again...",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : Humans... interfering again...",bc_map,"0xdb7093";
end;
OnTimer13000:
- instance_announce 0, "Apostle of Baphomet : Humans! Humans have invaded our sanctum!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Humans! Humans have invaded our sanctum!",bc_map,"0xFFFF00";
end;
OnTimer16000:
- instance_announce 0, "Apostle of Baphomet : Kill the humans! Do not stop the revival of our Master!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Kill the humans! Do not stop the revival of our Master!",bc_map,"0xFFFF00";
end;
OnTimer18000:
- instance_announce 0, "Apostle of Baphomet : Hurry up and release the seals of the altars! Our Master's return is upon us!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Hurry up and release the seals of the altars! Our Master's return is upon us!",bc_map,"0xFFFF00";
stopnpctimer;
disablenpc instance_npcname("ins_2f_enter_broad", instance_id());
end;
@@ -1242,7 +1240,7 @@ OnTimer18000:
2@cata,50,67,0 script slave_left -1,5,5,{
OnTouch:
disablenpc instance_npcname("slave_left", instance_id());
- instance_announce 0, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
monster "2@cata",55,67,"Apostle of Baphomet",1869,1;
monster "2@cata",51,67,"Apostle of Baphomet",1291,1;
monster "2@cata",58,67,"Apostle of Baphomet",1292,1;
@@ -1265,7 +1263,7 @@ OnTouch:
2@cata,109,67,0 script slave_right -1,5,5,{
OnTouch:
disablenpc instance_npcname("slave_right", instance_id());
- instance_announce 0, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
monster "2@cata",105,67,"Apostle of Baphomet",1869,1;
monster "2@cata",104,67,"Apostle of Baphomet",1291,1;
monster "2@cata",107,67,"Apostle of Baphomet",1869,1;
@@ -1288,7 +1286,7 @@ OnTouch:
2@cata,79,39,0 script slave_down -1,5,5,{
OnTouch:
disablenpc instance_npcname("slave_down", instance_id());
- instance_announce 0, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
+ instance_announce -1, "Apostle of Baphomet : Kill the humans! Don't let them interrupt the revival of our Master!",bc_map,"0xFFFF00";
monster "2@cata",78,41,"Apostle of Baphomet",1869,1;
monster "2@cata",79,42,"Apostle of Baphomet",1291,1;
monster "2@cata",78,46,"Apostle of Baphomet",1869,1;
@@ -1330,7 +1328,7 @@ OnTouch:
percentheal -50,0;
sc_start Eff_Stone,20000,0;
setquest 3041;
- instance_announce 0, "The seal activated by putting magical power into the altar.",bc_map,"0x87ceeb";
+ instance_announce -1, "The seal activated by putting magical power into the altar.",bc_map,"0x87ceeb";
mes "I can feel the power of the altar came back by adding magical power.";
next;
mes "But you can't use your magic for 3 minutes because you used your SP on the altar.";
@@ -1414,27 +1412,27 @@ OnDisable:
end;
OnTimer3000:
- instance_announce 0, "Ancient Hero's Soul : My God! The seal of the Main Altar is weakening!",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : My God! The seal of the Main Altar is weakening!",bc_map,"0xFFFF00";
end;
OnTimer6000:
- instance_announce 0, "Ancient Hero's Soul : My descendants... Listen carefully to what I'm going to say.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : My descendants... Listen carefully to what I'm going to say.",bc_map,"0xFFFF00";
end;
OnTimer9000:
- instance_announce 0, "Ancient Hero's Soul : The altars that control the Main Altar's power are located in the Northeast, Southeast, Southwest and Northwest corners of this room.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The altars that control the Main Altar's power are located in the Northeast, Southeast, Southwest and Northwest corners of this room.",bc_map,"0xFFFF00";
end;
OnTimer12000:
- instance_announce 0, "Ancient Hero's Soul : Find these altars and activate their seals before Baphomet revives.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Find these altars and activate their seals before Baphomet revives.",bc_map,"0xFFFF00";
end;
OnTimer15000:
- instance_announce 0, "Baphomet : It's too late, weaklings... Now, you'll feel the despair of death!",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : It's too late, weaklings... Now, you'll feel the despair of death!",bc_map,"0xdb7093";
end;
OnTimer17000:
- instance_announce 0, "Baphomet : No one can harm me here. You will be my first sacrifice.",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : No one can harm me here. You will be my first sacrifice.",bc_map,"0xdb7093";
donpcevent instance_npcname("control_baphomet", instance_id())+"::OnEnable";
donpcevent instance_npcname("ins_2f_hero_broad2", instance_id())+"::OnEnable";
stopnpctimer;
@@ -1457,7 +1455,7 @@ OnMyMobDead:
if (mobcount("2@cata",instance_npcname("control_baphomet", instance_id())+"::OnMyMobDead") < 1) {
set 'ins_baphomet,7;
erasequest 3041;
- instance_announce 0, "Baphomet : No! Nonono! How dare these weaklings defeat me!... No!!...",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : No! Nonono! How dare these weaklings defeat me!... No!!...",bc_map,"0xdb7093";
enablenpc instance_npcname("Ancient Hero's Soul#2F", instance_id());
disablenpc instance_npcname("slave_down", instance_id());
disablenpc instance_npcname("slave_left", instance_id());
@@ -1486,31 +1484,31 @@ OnDisable:
end;
OnTimer8000:
- instance_announce 0, "Ancient Hero's Soul : Don't be discouraged, Baphomet can still be defeated!",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Don't be discouraged, Baphomet can still be defeated!",bc_map,"0xFFFF00";
end;
OnTimer11000:
- instance_announce 0, "Ancient Hero's Soul : Go to the altars and activate their seals.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Go to the altars and activate their seals.",bc_map,"0xFFFF00";
end;
OnTimer13000:
- instance_announce 0, "Ancient Hero's Soul : Once the seals recover their power, Baphomet will be vulnerable.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : Once the seals recover their power, Baphomet will be vulnerable.",bc_map,"0xFFFF00";
end;
OnTimer16000:
- instance_announce 0, "Ancient Hero's Soul : You should lure Baphomet to the unsealed Altars. Otherwise, your efforts will be futile.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : You should lure Baphomet to the unsealed Altars. Otherwise, your efforts will be futile.",bc_map,"0xFFFF00";
end;
OnTimer19000:
- instance_announce 0, "Ancient Hero's Soul : We have only 1 hour to stop Baphomet. If time runs out, the power of the seals will be useless.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : We have only 1 hour to stop Baphomet. If time runs out, the power of the seals will be useless.",bc_map,"0xFFFF00";
end;
OnTimer22000:
- instance_announce 0, "Baphomet : It's useless. Make more seals. I'll crush them all. None of you will survive!",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : It's useless. Make more seals. I'll crush them all. None of you will survive!",bc_map,"0xdb7093";
end;
OnTimer26000:
- instance_announce 0, "Ancient Hero's Soul : The magical power of the central seal is running out. Go to the central seal and put the magical power.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The magical power of the central seal is running out. Go to the central seal and put the magical power.",bc_map,"0xFFFF00";
enablenpc instance_npcname("Magical Seal#0", instance_id());
disablenpc instance_npcname("Magical Seal#2", instance_id());
disablenpc instance_npcname("Magical Seal#4", instance_id());
@@ -1586,11 +1584,11 @@ OnDisable:
end;
OnTimer3600000:
- instance_announce 0, "Baphomet : krrrr... Now you can't stop me with the seals. All you can do is wait for death!",bc_map,"0xdb7093";
+ instance_announce -1, "Baphomet : krrrr... Now you can't stop me with the seals. All you can do is wait for death!",bc_map,"0xdb7093";
end;
OnTimer3605000:
- instance_announce 0, "Ancient Hero's Soul : We can't stop Baphomet with the magical power of the seals anymore. Now everything depends on God...",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : We can't stop Baphomet with the magical power of the seals anymore. Now everything depends on God...",bc_map,"0xFFFF00";
donpcevent instance_npcname("ins_2f_hero_pattern_c", instance_id())+"::OnDisable";
end;
}
@@ -1609,7 +1607,7 @@ OnDisable:
OnTimer70000:
switch(rand(1,5)) {
case 1:
- instance_announce 0, "Ancient Hero's Soul : The seal of the Main Altar is running out. Strengthen the Main Altar's seal!",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The seal of the Main Altar is running out. Strengthen the Main Altar's seal!",bc_map,"0xFFFF00";
enablenpc instance_npcname("Magical Seal#0", instance_id());
disablenpc instance_npcname("Magical Seal#2", instance_id());
disablenpc instance_npcname("Magical Seal#4", instance_id());
@@ -1617,7 +1615,7 @@ OnTimer70000:
disablenpc instance_npcname("Magical Seal#10", instance_id());
break;
case 2:
- instance_announce 0, "Ancient Hero's Soul : The magical power of the seal at 2 o'clock is running out. Go to 2 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The magical power of the seal at 2 o'clock is running out. Go to 2 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
disablenpc instance_npcname("Magical Seal#0", instance_id());
enablenpc instance_npcname("Magical Seal#2", instance_id());
disablenpc instance_npcname("Magical Seal#4", instance_id());
@@ -1625,7 +1623,7 @@ OnTimer70000:
disablenpc instance_npcname("Magical Seal#10", instance_id());
break;
case 3:
- instance_announce 0, "Ancient Hero's Soul : The magical power of the seal at 4 o'clock is running out. Go to 4 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The magical power of the seal at 4 o'clock is running out. Go to 4 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
disablenpc instance_npcname("Magical Seal#0", instance_id());
disablenpc instance_npcname("Magical Seal#2", instance_id());
enablenpc instance_npcname("Magical Seal#4", instance_id());
@@ -1633,7 +1631,7 @@ OnTimer70000:
disablenpc instance_npcname("Magical Seal#10", instance_id());
break;
case 4:
- instance_announce 0, "Ancient Hero's Soul : The magical power of the seal at 8 o'clock is running out. Go to 8 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The magical power of the seal at 8 o'clock is running out. Go to 8 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
disablenpc instance_npcname("Magical Seal#0", instance_id());
disablenpc instance_npcname("Magical Seal#2", instance_id());
disablenpc instance_npcname("Magical Seal#4", instance_id());
@@ -1641,7 +1639,7 @@ OnTimer70000:
disablenpc instance_npcname("Magical Seal#10", instance_id());
break;
case 5:
- instance_announce 0, "Ancient Hero's Soul : The magical power of the seal at 10 o'clock is running out. Go to 10 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
+ instance_announce -1, "Ancient Hero's Soul : The magical power of the seal at 10 o'clock is running out. Go to 10 o'clock and put the magical power in the seal.",bc_map,"0xFFFF00";
disablenpc instance_npcname("Magical Seal#0", instance_id());
disablenpc instance_npcname("Magical Seal#2", instance_id());
disablenpc instance_npcname("Magical Seal#4", instance_id());
diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt
index f81b54f89..95a17d241 100644
--- a/npc/other/poring_war.txt
+++ b/npc/other/poring_war.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Kisuka
//===== Current Version: =====================================
-//= 1.1b
+//= 1.2
//===== Description: =========================================
//= [Aegis Conversion]
//= Poring War
@@ -12,6 +12,7 @@
//= 1.1 Fixed some typos/bugs. [CalciumKid]
//= 1.1a Fixed Waiting rooms witht he default MAX_LEVEL [Slim]
//= 1.1b Fixed incorrect label calls. [Euphy]
+//= 1.2 Added missing barrier resets, credits to Zopokx. [Euphy]
//============================================================
// Poring War Recruiter
@@ -929,23 +930,23 @@ OnStop:
end;
OnAngelingWin:
- removemapflag "poring_w02",mf_partylock;
- removemapflag "poring_w02",mf_pvp;
- removemapflag "poring_w02",mf_pvp_noguild;
- removemapflag "poring_w02",mf_pvp_nocalcrank;
- mapannounce "poring_w02","Mr. Doppel: Angeling Team of party " + getpartyname($@wop_team_a) + " won the battle!",0,0xf08080;
- donpcevent "Deviruchi#wop_endmaster::OnEnable";
- stopnpctimer;
- end;
-
+ set .@i,1;
OnDevilingWin:
removemapflag "poring_w02",mf_partylock;
removemapflag "poring_w02",mf_pvp;
removemapflag "poring_w02",mf_pvp_noguild;
removemapflag "poring_w02",mf_pvp_nocalcrank;
- mapannounce "poring_w02","Mr. Doppel: Deviling Team of party " + getpartyname($@wop_team_d) + " won the battle!",0,0xf08080;
+ if (.@i)
+ mapannounce "poring_w02","Mr. Doppel: Angeling Team of party " + getpartyname($@wop_team_a) + " won the battle!",0,0xf08080;
+ else
+ mapannounce "poring_w02","Mr. Doppel: Deviling Team of party " + getpartyname($@wop_team_d) + " won the battle!",0,0xf08080;
donpcevent "Deviruchi#wop_endmaster::OnEnable";
stopnpctimer;
+ // Reset Barriers
+ donpcevent "#aroom_ingate_wop::OnDisable";
+ donpcevent "#aroom_outgate_wop::OnDisable";
+ donpcevent "#droom_ingate_wop::OnDisable";
+ donpcevent "#droom_outgate_wop::OnDisable";
end;
OnTimer5000:
diff --git a/npc/quests/skills/novice_skills.txt b/npc/quests/skills/novice_skills.txt
index 92cc797e6..17a670eed 100644
--- a/npc/quests/skills/novice_skills.txt
+++ b/npc/quests/skills/novice_skills.txt
@@ -15,7 +15,7 @@
//============================================================
prt_in,234,133,4 script Nami 66,{
- if ((Class == Job_Novice) && (JobLevel > 3 || BaseLevel > 11) && (skill_nov < 3)) {
+ if ((Class == Job_Novice || Class == Job_Baby) && (JobLevel > 3 || BaseLevel > 11) && (skill_nov < 3)) {
mes "[Nami]";
mes "Hello!";
mes "I want to be a nurse so bad!";
@@ -189,7 +189,7 @@ prt_in,234,133,4 script Nami 66,{
}
prt_in,73,87,4 script Chivalry Member 65,{
- if ((Class == Job_Novice) && (JobLevel > 6) && ((skill_nov >= 3) && (skill_nov <= 5))) {
+ if ((Class == Job_Novice || Class == Job_Baby) && (JobLevel > 6) && ((skill_nov >= 3) && (skill_nov <= 5))) {
mes "[Bulma]";
mes "Yeah. . . I look great. . .";
mes "I am a knight in the knight's";
diff --git a/npc/re/guides/guides_mora.txt b/npc/re/guides/guides_mora.txt
new file mode 100644
index 000000000..0cb0db35d
--- /dev/null
+++ b/npc/re/guides/guides_mora.txt
@@ -0,0 +1,215 @@
+//===== rAthena Script =======================================
+//= Mora Guides
+//===== By: ==================================================
+//= Euphy
+//===== Current Version: =====================================
+//= 1.0
+//===== Compatible With: =====================================
+//= rAthena SVN
+//===== Description: =========================================
+//= Guides for the city of Mora.
+//===== Additional Comments: =================================
+//= 1.0 First version. [Euphy]
+//============================================================
+
+mora,25,158,5 script Raffle Guide#north 516,{
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "Welcome to the Village of Mora.";
+ mes "I can tell you whatever you want to know about the village~!";
+ next;
+ switch(select("[ Inn ]:[ Residences ]:[ Stores ]:[ Warehouse ]:Remove markers from the mini-map:Quit")) {
+ case 1:
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "We have an inn but we can't make travelers sleep like Raffles...";
+ mes "Get some rest!";
+ viewpoint 1,44,134,0,0x0A82FF;
+ close;
+ case 2:
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "This is where Raffles' houses are...";
+ mes "But keep the noise down because people are asleep~!";
+ viewpoint 1,119,170,1,0xAAFF00;
+ close;
+ case 3:
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "If you are looking for souvenirs, you can buy some in this district.";
+ viewpoint 1,112,110,2,0xDA70D6;
+ close;
+ case 4:
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "This is where they keep all kinds of packages and groceries.";
+ mes "There are many things that don't belong to the Raffles, so be careful!";
+ viewpoint 1,182,161,3,0xFF1493;
+ close;
+ case 5:
+ mes "[Raffoh]";
+ mes "Laoh~! I'm removing them all~!";
+ viewpoint 2,1,1,0,0xFFFF00;
+ viewpoint 2,1,1,1,0xFFFF00;
+ viewpoint 2,1,1,2,0xFFFF00;
+ viewpoint 2,1,1,3,0xFFFF00;
+ close;
+ case 6:
+ mes "[Raffoh]";
+ mes "Laoh~!";
+ mes "What kinds of sports are popular in your homeland?";
+ close;
+ }
+}
+
+mora,167,76,3 script Raffle Guide#east 522,{
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "This, this is the Village of Mora.";
+ mes "Uh... which place do you want to know about?";
+ next;
+ switch(select("[ Inn ]:[ Residences ]:[ Stores ]:[ Warehouse ]:Remove markers from the mini-map:Quit")) {
+ case 1:
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "Are, are you sleepy?";
+ mes "You can sleep here uh!! Put your stuff down uh! And-- and---";
+ viewpoint 1,44,134,0,0x0A82FF;
+ close;
+ case 2:
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "Why are you trying to find out where I live--?";
+ mes "Uh, no... I'd like to live with my friends--";
+ viewpoint 1,119,170,1,0xAAFF00;
+ close;
+ case 3:
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "There are a lot of things in those stores-- oh, there is a hot spring also uh!";
+ viewpoint 1,112,110,2,0xDA70D6;
+ close;
+ case 4:
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "You can't just march into the warehouse, or you'll be in trouble--";
+ mes "Many of the things there are from outside the village-- Raffuh has been in trouble several times--";
+ viewpoint 1,182,161,3,0xFF1493;
+ close;
+ case 5:
+ mes "[Raffuh]";
+ mes "Are you sure you want them removed?";
+ viewpoint 2,1,1,0,0xFFFF00;
+ viewpoint 2,1,1,1,0xFFFF00;
+ viewpoint 2,1,1,2,0xFFFF00;
+ viewpoint 2,1,1,3,0xFFFF00;
+ close;
+ case 6:
+ mes "[Raffuh]";
+ mes "Uh...";
+ mes "Being a guide doesn't help much with my social phobia--";
+ close;
+ }
+}
+
+mora,115,138,5 script Raffle Guide#center 524,{
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "Welcome to the Village of Mora la!";
+ mes "If you need to know anything about the village, just ask me la!";
+ next;
+ switch(select("[ Inn ]:[ Residences ]:[ Stores ]:[ Warehouse ]:Remove markers from the mini-map:Quit.")) {
+ case 1:
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "This is where travelers can rest la!";
+ mes "The innkeeper is very kind, so try to talk to him a lot la!";
+ viewpoint 1,44,134,0,0x0A82FF;
+ close;
+ case 2:
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "This is where Raffles live la!";
+ mes "Head over there la!";
+ viewpoint 1,119,170,1,0xAAFF00;
+ close;
+ case 3:
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "So you want to buy something la?";
+ mes "There are a lot of stores and cafes, so check them out la!";
+ viewpoint 1,112,110,2,0xDA70D6;
+ close;
+ case 4:
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "The warehouse is where you keep your valuables la!";
+ mes "Be careful so you don't get robbed la!";
+ viewpoint 1,182,161,3,0xFF1493;
+ close;
+ case 5:
+ mes "[Raffla]";
+ mes "Okay, I'll remove all the markers from the map la!";
+ viewpoint 2,1,1,0,0xFFFF00;
+ viewpoint 2,1,1,1,0xFFFF00;
+ viewpoint 2,1,1,2,0xFFFF00;
+ viewpoint 2,1,1,3,0xFFFF00;
+ close;
+ case 6:
+ mes "[Raffla]";
+ mes "Lala!";
+ mes "I really don't know how my family ends up doing these things la!";
+ close;
+ }
+}
+
+mora,72,51,3 script Raffle Guide#south 518,{
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "Welcome to the Village of Mora.";
+ mes "If you need to know anything about the village, just ask me.";
+ next;
+ switch(select("[ Inn ]:[ Residences ]:[ Stores ]:[ Warehouse ]:Remove markers from the mini-map:Quit")) {
+ case 1:
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "This is where travelers can rest.";
+ mes "The innkeeper is very kind, so get to know him.";
+ viewpoint 1,44,134,0,0x0A82FF;
+ close;
+ case 2:
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "This is where Raffles live.";
+ mes "Are you coming to Raffli's house li? I'm so happy.";
+ viewpoint 1,119,170,1,0xAAFF00;
+ close;
+ case 3:
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "There are a lot of things I want to buy.";
+ mes "You can find tons of places to eat and shop, and tons of things to buy.";
+ viewpoint 1,112,110,2,0xDA70D6;
+ close;
+ case 4:
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "The warehouse is where you keep your valuables.";
+ mes "But don't get robbed.";
+ viewpoint 1,182,161,3,0xFF1493;
+ close;
+ case 5:
+ mes "[Raffli]";
+ mes "I'll remove all the markers.";
+ viewpoint 2,1,1,0,0xFFFF00;
+ viewpoint 2,1,1,1,0xFFFF00;
+ viewpoint 2,1,1,2,0xFFFF00;
+ viewpoint 2,1,1,3,0xFFFF00;
+ close;
+ case 6:
+ mes "[Raffli]";
+ mes "Lali?";
+ mes "Brother seems to be upset today li. Did I do anything wrong?";
+ close;
+ }
+}
diff --git a/npc/re/merchants/quivers.txt b/npc/re/merchants/quivers.txt
new file mode 100644
index 000000000..45e44401a
--- /dev/null
+++ b/npc/re/merchants/quivers.txt
@@ -0,0 +1,121 @@
+//===== rAthena Script =======================================
+//= Arrow Quivers
+//===== By: ==================================================
+//= Muad_Dib (Prometheus Project); L0ne_W0lf
+//===== Current Version: =====================================
+//= 1.1
+//===== Compatible With: =====================================
+//= rAthena SVN
+//===== Description: =========================================
+//= Turns arrows into Arrow Quivers.
+// Breakdown of Subroutine "S_BuyQuiver"
+// arg(0): Type of Arrow to be packaged (item ID).
+// arg(1): How many of each 'getarg(0)' arrow per quiver.
+// arg(2): The cost of making a 'getarg(0)' quiver.
+// arg(3): The quiver given by the NPC (item ID).
+//===== Additional Comments: =================================
+//= 1.0 Added Mora NPC. [Euphy]
+//= 1.1 Updated to match the official scripts. [Euphy]
+//============================================================
+
+mora,106,117,3 script Quiver Maker#mora 516,{
+ if (checkweight(1201,1) == 0) {
+ mes "[Quiver Maker]";
+ mes "You have too many things with you.";
+ mes "Make some space in your inventory and come back. I'll tell you something interesting.";
+ close;
+ }
+ if (MaxWeight - Weight < 2000) {
+ mes "[Quiver Maker]";
+ mes "You seem worn out with all that stuff.";
+ mes "Make some space in your inventory and come back. I'll tell you something interesting.";
+ close;
+ }
+ mes "[Quiver Maker]";
+ mes "Mora villagers ask what good quivers are. They just don't know how the world works.";
+ mes "No wonder they don't know a thing about quivers - spreading jam over leaves all day long.";
+ next;
+ switch(select("Please make me a quiver.:What's a quiver?")) {
+ case 1:
+ mes "[Quiver Maker]";
+ mes "At last someone appreciates a quiver!";
+ mes "I can make Elven Quivers and Hunting Quivers.";
+ mes "Which do you need?";
+ next;
+ switch(select("An Elven Quiver:A Hunting Quiver:I don't need a quiver.")) {
+ case 1: callsub S_BuyQuiver,1773,500,500,12575; //Arrow_Of_Elf_Cntr
+ case 2: callsub S_BuyQuiver,1774,500,500,12576; //Hunting_Arrow_Cntr
+ case 3:
+ mes "[Quiver Maker]";
+ mes "You can buy arrows off the tool merchant next to me.";
+ close;
+ }
+ case 2:
+ mes "[Quiver Maker]";
+ mes "An arrow may be thin and light, but carrying hundreds and thousands of arrows is like carrying a whole log.";
+ next;
+ mes "[Quiver Maker]";
+ mes "But when you have quivers, you can put arrows in them and save weight and space.";
+ mes "If you're interested in one, I'll stitch one up for you.";
+ close;
+ }
+ end;
+
+S_BuyQuiver:
+ if (countitem(getarg(0)) < getarg(1)) {
+ mes "[Quiver Maker]";
+ mes "Bring more than "+getarg(1)+" "+getitemname(getarg(0))+" and I'll make you a quiver.";
+ close;
+ }
+ mes "[Quiver Maker]";
+ mes "Oh, I see you have "+getitemname(getarg(0))+" in your hand!";
+ mes "Are you interested in using a quiver? It's really convenient!";
+ mes "If you're interested, I can trade "+getarg(1)+" of those arrows for one of these quivers for ^FF3131"+getarg(2)+" zeny^000000.";
+ next;
+ switch(select("Trade all the arrows you have:Get only one quiver:Don't trade")) {
+ case 1:
+ set .@arrows, countitem(getarg(0));
+ set .@quiver, .@arrows / getarg(1);
+ set .@arrows_used, .@quiver * getarg(1);
+ set .@arrow_zeny01, .@quiver * getarg(2);
+ mes "The number of arrows you have : ^3131FF"+.@arrows+"^000000";
+ mes "The number of quivers available : ^3131FF"+.@quiver+"^000000";
+ mes "Zeny needed for trade : ^3131FF"+.@arrow_zeny01+" zeny^000000";
+ next;
+ mes "Trade?";
+ next;
+ if(select("Trade:Don't trade") == 2) {
+ mes "[Quiver Maker]";
+ mes "Hey, you don't doubt my skills, do you?";
+ close;
+ }
+ break;
+ case 2:
+ set .@quiver, 1;
+ set .@arrows_used, getarg(1);
+ set .@arrow_zeny01, getarg(2);
+ set .@zeny_mes,1;
+ break;
+ case 3:
+ mes "[Quiver Maker]";
+ mes "Hey, you don't doubt my skills, do you?";
+ close;
+ }
+ if (Zeny < .@arrow_zeny01) {
+ mes "[Quiver Maker]";
+ if (.@zeny_mes == 1)
+ mes "I said I'd accept human coins just for you, and you still don't want to spend the money?";
+ else
+ mes "You really don't expect to get your hands on a masterpiece for nothing, do you?";
+ close;
+ }
+ mes "[Quiver Maker]";
+ mes "Hey, here you are.";
+ mes "There is ^3131FFsomething you need to know^000000 - try to remember it.";
+ mes "^FF0000You can't use quivers when your encumbrance is over 70%.^000000";
+ mes "You'd better keep that in mind, or you might be in trouble later.";
+ set Zeny, Zeny-.@arrow_zeny01;
+ delitem getarg(0),.@arrows_used;
+ getitem getarg(3),.@quiver;
+ close;
+}
diff --git a/npc/re/mobs/fields/bifrost.txt b/npc/re/mobs/fields/bifrost.txt
index b8c28bf49..04667acb0 100644
--- a/npc/re/mobs/fields/bifrost.txt
+++ b/npc/re/mobs/fields/bifrost.txt
@@ -9,27 +9,28 @@
//===== Additional Comments: =================================
//= 1.0 First Release
//= 1.1 Added more accurate 1@mist monsters
+//= 1.2 Renewal spawn update. [Euphy]
//============================================================
//==================================================
// bif_fild01 - Bifrost South
//==================================================
-bif_fild01,0,0,0,0 monster Luciola Vespa 1994,25,0,0,0
-bif_fild01,0,0,0,0 monster Cornus 1992,15,0,0,0
-bif_fild01,0,0,0,0 monster Pom Spider 2132,5,0,0,0
-bif_fild01,0,0,0,0 monster Angra Mantis 2133,5,0,0,0
-bif_fild01,0,0,0,0 monster Little Fatum 2136,30,0,0,0
-bif_fild01,0,0,0,0 monster Miming 2137,50,0,0,0
+bif_fild01,0,0,0,0 monster Luciola Vespa 1994,29,5000,0,0
+bif_fild01,0,0,0,0 monster Cornus 1992,17,5000,0,0
+bif_fild01,0,0,0,0 monster Miming 2137,58,5000,0,0
+bif_fild01,0,0,0,0 monster Little Fatum 2136,34,5000,0,0
+bif_fild01,0,0,0,0 monster Angra Mantis 2133,5,5000,0,0
+bif_fild01,0,0,0,0 monster Pom Spider 2132,5,5000,0,0
//==================================================
// bif_fild02 - Bifrost North
//==================================================
-bif_fild02,0,0,0,0 monster Luciola Vespa 1994,25,0,0,0
-bif_fild02,0,0,0,0 monster Cornus 1992,15,0,0,0
-bif_fild02,0,0,0,0 monster Pom Spider 2132,5,0,0,0
-bif_fild02,0,0,0,0 monster Angra Mantis 2133,5,0,0,0
-bif_fild02,0,0,0,0 monster Little Fatum 2136,50,0,0,0
-bif_fild02,0,0,0,0 monster Miming 2137,30,0,0,0
+bif_fild02,0,0,0,0 monster Luciola Vespa 1994,27,5000,0,0
+bif_fild02,0,0,0,0 monster Cornus 1992,16,5000,0,0
+bif_fild02,0,0,0,0 monster Miming 2137,33,5000,0,0
+bif_fild02,0,0,0,0 monster Little Fatum 2136,55,5000,0,0
+bif_fild02,0,0,0,0 monster Angra Mantis 2133,5,5000,0,0
+bif_fild02,0,0,0,0 monster Pom Spider 2132,5,5000,0,0
//==================================================
// 1@mist - Forest Maze of Mists
diff --git a/npc/re/quests/eden/56-70.txt b/npc/re/quests/eden/56-70.txt
index d4599c557..c503a274b 100644
--- a/npc/re/quests/eden/56-70.txt
+++ b/npc/re/quests/eden/56-70.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= L0ne_W0lf
//===== Current Version: =====================================
-//= 1.4
+//= 2.1
//===== Description: =========================================
//= Repetable Quests for Players between Baselevel 56 - 70.
//===== Additional Comments: =================================
@@ -12,1076 +12,355 @@
//= 1.2 Added checkquest confirmation for -1. [Euphy]
//= 1.3 Fixed Puppet Master's Agony Quest (12217 -> 3259). [Joseph]
//= 1.4 Fixed invalid check (Magic Wand Quest). [Joseph]
+//= 2.0 Optimised [Zopokx]
+//= 2.1 Fixed some errors using Euphy's reference [Zopokx]
//============================================================
moc_para01,42,38,3 script Mission [56 - 70] 857,{
- if (checkquest(12217) > -1) erasequest 12217;
- if (countitem(6219)) {
- mes "Here is the list of various adventures for level 55~70 adventurers.";
- next;
- mes "Lots of missions such as a Monster Hunting, Delivery Goods, Finding People.";
- next;
- switch (select("Mission Numbers 1~5:Mission Numbers 6~10:Mission Numbers 11~15")) {
+ if (countitem(6219) < 1) {
+ mes "To get these missions, I need to Join the Eden Group first. I must find Secretary Lime Evenor and become a member.";
+ close;
+ }
+ mes "Here is the list of various adventures for level 56~70 adventurers.";
+ next;
+ mes "Lots of missions such as a Monster Hunting, Delivery Goods, Finding People.";
+ next;
+ switch (select("Mission Numbers 1~5:Mission Numbers 6~10:Mission Numbers 11~15")) {
case 1:
switch (select("What is this Bandage?:Dangerous Alligators.:That wasn't a mermaid...:My country is calling me!")) {
- case 1:
- if (checkquest(3250) <= 0) {
- mes "This mission is assigned by the Rekenber corporation from Lighthalzen. Below are the details.";
- next;
- mes "Rekenber corporation is about to launch a new project called 'Green Medical Center'. For the first product of the project, we are preparing well-being Bandages.";
- next;
- mes "Regarding the project, we need to research monster's reactions when they are wrapped with Rotten Bandages.";
- next;
- mes "If you are interested, please hunt 30 Mummies and bring 30 Rotten Bandages. You can find them in the Pyramid West of Morroc.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "- Rekenber corporation chief director 'Julie E Delph' -";
- next;
- mes " ";
- next;
- mes "Would you like to accept this mission?";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3250;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3250,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the Rekenber corporation from Lighthalzen. Below are the details.";
- next;
- mes "Rekenber corporation is about to launch a new project called 'Green Medical Center'. For the first product of the project, we are preparing well-being Bandages.";
- next;
- mes "Regarding the project, we need to research monster's reactions when they are wrapped with Rotten Bandages.";
- next;
- mes "If you are interested, please hunt 30 Mummies and bring 30 Rotten Bandages. You can find them in the Pyramid West of Morroc.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "- Rekenber corporation chief director 'Julie E Delph' -";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3250,HUNTING) == 2) && (countitem(930) > 19)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 930,20; //Rotten_Bandage
- getexp 15000,5000;
- erasequest 3250;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 2:
- if (checkquest(3251) <= 0) {
- mes "This mission is assigned by the Comodo cooperative society. Below are the details.";
- next;
- mes "Alligators have gone wild these days, they attack women and drunken people who hang out near the beach.";
- next;
- mes "This is a very shameful situation for us, the most wonderful vacation spot in Rune-Midgard.";
- next;
- mes "So, it would be very helpful if you hunt 30 Alligators to clean out this situation.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes " ";
- next;
- mes "Would you like to accept this mission?";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3251;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3251,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the Comodo cooperative society. Below are the details.";
- next;
- mes "Alligators have gone wild these days, they attack women and drunken people who hang out near the beach.";
- next;
- mes "This is a very shameful situation for us, the most wonderful vacation spot in Rune-Midgard.";
- next;
- mes "So, it would be very helpful if you hunt 30 Alligators to clean out this situation.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3251,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 16000,6000;
- erasequest 3251;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 3:
- if (checkquest(3252) <= 0) {
- mes "This mission is assigned by an unknown client from Izlude.";
- next;
- mes "I have admired the beach of Izlude, ever since I was born.";
- next;
- mes "When I was young, I found a mysterious creature in the Izlude dungeon, I had never seen something like that before...";
- next;
- mes "I instantly thought it was a mermaid. I was so supprised, I have studied about mermaids in whole my life.";
- next;
- mes "But, as I studied harder, I found that the creature was not a mermaid... yes, It wasn't beautiful at all like other mermaids...";
- next;
- mes "I finally tracked down the fact that it was a Merman, not a Mermaid!";
- next;
- mes "Merman... I have wasted my life studying this monster! So please hunt 30 Mermans to make me feel better.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Izlude 'The Lost dream mermaid' --";
- next;
- mes " ";
- next;
- mes "Would you like to accept this mission?";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3252;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3252,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by an unknown client from Izlude.";
- next;
- mes "I have admired the beach of Izlude, ever since I was born.";
- next;
- mes "When I was young, I found a mysterious creature in the Izlude dungeon, I had never seen something like that before.";
- next;
- mes "I instantly thought it was a mermaid. I was so supprised, I have studied about mermaids in whole my life.";
- next;
- mes "But, as I studied harder, I found that the creature was not a mermaid... yes, It wasn't beautiful at all like other mermaids...";
- next;
- mes "I finally tracked down the fact that it was a Merman, not a Mermaid!";
- next;
- mes " Merman... I have wasted my life studying this monster! So please hunt 30 Mermans to make me feel better.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Izlude 'The Lost dream mermaid' --";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3252,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 17000,8000;
- erasequest 3252;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 4:
- if (checkquest(3254) <= 0) {
- mes "This mission is assigned by the government officer of the Rune-Midgarts Kingdom.";
- next;
- mes "To prevent a flood in Prontera, we decided to build a huge dam to regulate the water supply.";
- next;
- mes "But, we are shorthanded on supplies and we need to collect Fine Sand and Grit.";
- next;
- mes "So, we would like to ask for help. People, please bring us 10 Fine Sand and 30 Grit each so we can build the dam.";
- next;
- mes "You can get those materials from Sand Man, I wish you good luck!";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Government officer of the Rune-Midgarts Kingdom, Dufre Kent --";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3254;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3254) == 1) && (countitem(7043) < 10) && (countitem(1056) < 30)) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the government officer of the Rune-Midgarts Kingdom.";
- next;
- mes "To prevent a flood in Prontera, we decided to build a huge dam to regulate the water supply.";
- next;
- mes "But, we are shorthanded on supplies and we need to collect Fine Sand and Grit.";
- next;
- mes "So, we would like to ask for help. People, please bring us 10 Fine Sand and 30 Grit each so we can build the dam.";
- next;
- mes "You can get those materials from Sand Man, I wish you good luck!";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Government officer of the Rune-Midgarts Kingdom, Dufre Kent --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3254) == 1) && (countitem(7043) > 9) && (countitem(1056) > 29)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 7043,10; //Fine_Sand
- delitem 1056,30; //Grit
- getexp 18000,8000;
- erasequest 3254;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3254) == 2) {
- mes "This mission is assigned by the government officer of the Rune-Midgarts Kingdom.";
- next;
- mes "To prevent a flood in Prontera, we decided to build a huge dam to regulate the water supply.";
- next;
- mes "But, we are shorthanded on supplies and we need to collect Fine Sand and Grit.";
- next;
- mes "So, we would like to ask for help. People, please bring us 10 Fine Sand and 30 Grit each so we can build the dam.";
- next;
- mes "You can get those materials from Sand Man, I wish you good luck!";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Government officer of the Rune-Midgarts Kingdom, Dufre Kent --";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3254;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- close;
+ case 1: callsub L_HuntingQuest,3250,15000,5000,930,30;
+ case 2: callsub L_HuntingQuest,3251,16000,6000;
+ case 3: callsub L_HuntingQuest,3252,17000,8000;
+ case 4: callsub L_Quest,3254,18000,8000,7043,10,1056,30;
}
+ break;
case 2:
switch (select("Hunt Wild Boar:Preparing the Summer:A Woman's Grudge:Special ingredients:Puppet Master's Agony")) {
- case 1:
- if (checkquest(3255) <= 0) {
- mes "This mission is assigned by the Payon town hall.";
- next;
- mes "Wild animals are always annoyances to farmers.";
- next;
- mes "They attack our farm and ruin whole crops!! We can't stand it anymore!";
- next;
- mes "So, we would like to ask for the help from brave adventurers.";
- next;
- mes "Please, hunt 30 Savages to save our crops!";
- next;
- mes "You can easily find those monsters around our town and field.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Payon town hall members --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3255;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3255,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the Payon town hall.";
- next;
- mes "Wild animals are always an annoyance to farmers.";
- next;
- mes "They attack our farm and ruin whole crops!! We can't stand it anymore!";
- next;
- mes "So, we would like to ask for the help from brave adventurers.";
- next;
- mes "Please, hunt 30 Savages to save our crops!";
- next;
- mes "You can easily find those monsters around our town and field.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Payon town hall members --";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3255,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 16000,7000;
- erasequest 3255;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 2:
- if (checkquest(3256) <= 0) {
- mes "This mission is assigned by the Morroc blacksmith Aragham.";
- next;
- mes "Hello~~~~, Adventurers! This is Aragham, the hottest blacksmith in Morroc!";
- next;
- mes "Anyway, I have a son named Aragam Junior, the cute one. Haha.";
- next;
- mes "He will be attending summer camp this summer, but he doesn't know how to swim.";
- next;
- mes "I want to teach him, but as you know I am a blacksmith, a far cry from swimming! Hehe.";
- next;
- mes "But, I figured that if I make swim fins, it will be great for his confidence~!";
- next;
- mes "To make it, I need 30 Sticky Webfoots from a Roda Frog. Can you bring them to me?";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "PS. Do not compare me with Hollgrehenn or Antonio!!!!";
- next;
- mes "-- The hottest blacksmith, Morroc blacksmith Aragham --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3256;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3256) == 1) && (countitem(918) < 30)) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the Morroc blacksmith Aragham.";
- next;
- mes "Hello~~~~, Adventurers! This is Aragham, the hottest blacksmith in Morroc!";
- next;
- mes "Anyway, I have a son named Aragam Junior, the cute one. Haha.";
- next;
- mes "He will be attending summer camp this summer, but he doesn't know how to swim.";
- next;
- mes "I want to teach him, but as you know I am a blacksmith, a far cry from swimming! Hehe.";
- next;
- mes "But, I figured that if I make swim fins, it will be great for his confidence~!";
- next;
- mes "To make it, I need 30 Sticky Webfoots from a Roda Frog. Can you bring them to me?";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "PS. Do not compare me with Hollgrehenn or Antonio!!!!";
- next;
- mes "-- The hottest blacksmith, Morroc blacksmith Aragham --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3256) == 1) && (countitem(918) > 29)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 918,30; //Sticky_Webfoot
- getexp 15000,5000;
- erasequest 3256;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3256) == 2) {
- mes "This mission is assigned by the Morroc blacksmith Aragham.";
- next;
- mes "Hello~~~~, Adventurers! This is Aragham, the hottest blacksmith in Morroc!";
- next;
- mes "Anyway, I have a son named Aragam Junior, the cute one. Haha.";
- next;
- mes "He will be attending summer camp this summer, but he doesn't know how to swim.";
- next;
- mes "I want to teach him, but as you know I am a blacksmith, a far cry from swimming! Hehe.";
- next;
- mes "But, I figured that if I make swim fins, it will be great for his confidence~!";
- next;
- mes "To make it, I need 30 Sticky Webfoots from a Roda Frog. Can you bring them to me?";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "PS. Do not compare me with Hollgrehenn or Antonio!!!!";
- next;
- mes "-- The hottest blacksmith, Morroc blacksmith Aragham --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3256;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- close;
- case 3:
- if (checkquest(3257) <= 0) {
- mes "This mission is assigned by an inventor Dorian from Izlude.";
- next;
- mes "Have you heard the story that if women have a grudge on their mind, it will bring natural disasters.";
- next;
- mes "Wow, so guys must watch out for those sensitive women! Make sure they don't have any grudges on you.";
- next;
- mes "Women can bring strange phenomenons with them!";
- next;
- mes "I am so intrigued with that story that I'm trying to prove that it can be true.";
- next;
- mes "So I need to make women upset! Haha, I know what a mean idea, right?";
- next;
- mes "But this is seriously just for studying... So please hunt 30 Sohee's who seems to be revived from victimized souls.";
- next;
- mes "So I can keep observing the case.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Elegance inventor Dorian --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3257;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3257,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by an inventor Dorian from Izlude.";
- next;
- mes "Have you heard the story that if women have a grudge on their mind, it will bring natural disasters.";
- next;
- mes "Wow, so guys must watch out for those sensitive women! Make sure they don't have any grudges on you.";
- next;
- mes "Women can bring strange phenomenons with them!";
- next;
- mes "I am so intrigued with that story that I'm trying to prove that it can be true.";
- next;
- mes "So I need to make women upset! Haha, I know what a mean idea, right?";
- next;
- mes "But this is seriously just for studying... So please hunt 30 Sohee's who seems to be revived from victimized souls.";
- next;
- mes "So I can keep observing the case.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Elegance inventor Dorian --";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3257,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 17000,8000;
- erasequest 3257;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 4:
- if (checkquest(3258) <= 0) {
- mes "This mission is assigned by Wallah from Payon.";
- next;
- mes "Hello, adventurer. How are you? How is your health?";
- next;
- mes "I am a pharmacist and I am having a hard time getting special ingredients lately.";
- next;
- mes "Because I am a little sensitive girl, how can I possibly get those things by myself.";
- next;
- mes "So, please help me. Just bring 40 Huge Leafs to me, that will be enough to complete my special medicine!";
- next;
- mes "Please bring it as soon as possible, people need my medicine.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Wallah --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3258;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3258) == 1) && (countitem(7198) < 40)) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by Wallah from Payon.";
- next;
- mes "Hello, adventurer. How are you? How is your health?";
- next;
- mes "I am a pharmacist and I am having a hard time getting special ingredients lately.";
- next;
- mes "Because I am a little sensitive girl, how can I possibly get those things by myself.";
- next;
- mes "So, please help me. Just bring 40 Huge Leafs to me, that will be enough to complete my special medicine!";
- next;
- mes "Please bring it as soon as possible, people need my medicine.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Wallah --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3258) == 1) && (countitem(7198) > 39)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 7198,40; //Great_Leaf
- getexp 16000,7000;
- erasequest 3258;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3258) == 2) {
- mes "This mission is assigned by Wallah from Payon.";
- next;
- mes "Hello, adventurer. How are you? How is your health?";
- next;
- mes "I am a pharmacist and I am having a hard time getting special ingredients lately.";
- next;
- mes "Because I am a little sensitive girl, how can I possibly get those things by myself.";
- next;
- mes "So, please help me. Just bring 40 Huge Leafs to me, that will be enough to complete my special medicine!";
- next;
- mes "Please bring it as soon as possible, people need my medicine.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Wallah --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3258;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- close;
- case 5:
- if (checkquest(3259) <= 0) {
- mes "This mission is assigned by puppet master Woonute from Geffen.";
- next;
- mes "You know being a puppet master is kind of a hard job to satisfy people.";
- next;
- mes "People can search and see so many different things on their own thesedays.";
- next;
- mes "Their expectations are getting high, I can't satisfy them anymore.";
- next;
- mes "But if I can make new toy concepts, like living toys, it will be ground breaking.";
- next;
- mes "I heard that there are live dolls called Marionettes. Can you hunt 30 Marionettes for me? And also bring 30 Golden Hair, those will be great materials for the new toys.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Puppet Master Woonute --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3259;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3259,HUNTING) == 1) && (countitem(1060) < 30)) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by puppet master Woonute from Geffen.";
- next;
- mes "You know being a puppet master is kind of a hard job to satisfy people.";
- next;
- mes "People can search and see so many different things on their own thesedays.";
- next;
- mes "Their expectations are getting high, I can't satisfy them anymore.";
- next;
- mes "But if I can make new toy concepts, like living toys, it will be ground breaking.";
- next;
- mes "I heard that there are live dolls called Marionettes. Can you hunt 30 Marionettes for me? And also bring 30 Golden Hair, those will be great materials for the new toys.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Puppet Master Woonute --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3259,HUNTING) == 2) && (countitem(1060) > 29)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 1060,30; //Golden_Hair
- getexp 17000,7000;
- erasequest 3259;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
+ case 1: callsub L_HuntingQuest,3255,16000,7000;
+ case 2: callsub L_Quest,3256,15000,5000,918,30;
+ case 3: callsub L_HuntingQuest,3257,17000,8000;
+ case 4: callsub L_Quest,3258,16000,7000,7198,40;
+ case 5: callsub L_HuntingQuest,3259,17000,7000,1060,30;
}
+ break;
case 3:
switch (select("Tiresome Flies:Dangerous Munak:Make the World green:Magic Wand")) {
- case 1:
- if (checkquest(3260) <= 0) {
- mes "This mission is assigned by an exterminator from Prontera.";
- next;
- mes "As the weather gets warmer, insects multiply more and more. It is already out of control.";
- next;
- mes "People in Prontera cannot sleep because of all the bugs in their house.";
- next;
- mes "So, please help us, hunt 30 Hunter Flies. Then the flies can be reduced slowly.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- The Prontera exterminator --";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3260;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3260,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by an exterminator from Prontera.";
- next;
- mes "As the weather gets warmer, insects multiply more and more. It is already out of control.";
- next;
- mes "People in Prontera cannot sleep because of all the bugs in their house.";
- next;
- mes "So, please help us, hunt 30 Hunter Flies. Then the flies can be reduced slowly.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- The Prontera exterminator --";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3260,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 16000,6000;
- erasequest 3260;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 2:
- if (checkquest(3261) <= 0) {
- mes "This mission is assigned by Cheese Dongja from Payon.";
- next;
- mes "Have you heard about Munak?";
- next;
- mes "The ugly monster Munak is threatening people in Payon.";
- next;
- mes "So we need brave adventurers like you!";
- next;
- mes "Please hunt 30 Munaks then Payon will be in peace.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "- Payon Cheese Dongja -";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3261;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3261,HUNTING) == 1) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by Cheese Dongja from Payon.";
- next;
- mes "Have you heard about Munak?";
- next;
- mes "The ugly monster Munak is threatening people in Payon.";
- next;
- mes "So we need brave adventurers like you!";
- next;
- mes "Please hunt 30 Munaks then Payon will be in peace.";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "- Payon Cheese Dongja -";
- close;
- case 2:
- close;
- }
- }
- if (checkquest(3261,HUNTING) == 2) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- getexp 16000,7000;
- erasequest 3261;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 3:
- if (checkquest(3262) <= 0) {
- mes "This mission is assigned by a gem dealer, Ibraham from Morroc.";
- next;
- mes "A small beautiful flower in the barren desert... What an incredible scene it would be!";
- next;
- mes "Planting flowers can make the world green and it will be so pretty everywhere.";
- next;
- mes "I plan to plant strong flowers in the Morroc desert so the soil gets better.";
- next;
- mes "I need 40 Maneater Blossom from Flora, I know Maneater Blossom is an ugly flower, but still it is a plant.";
- next;
- mes "I hope you can hunt Flora and get me 40 Maneater Blossoms. You are making the world green! Be proud!";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Morroc Ibraham --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3262;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3262) == 1) && (countitem(1032) < 40)) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by a gem dealer, Ibraham from Morroc.";
- next;
- mes "A small beautiful flower in the barren desert... What an incredible scene it would be!";
- next;
- mes "Planting flowers can make the world green and it will be so pretty everywhere.";
- next;
- mes "I plan to plant strong flowers in the Morroc desert so the soil gets better.";
- next;
- mes "I need 40 Maneater Blossom from Flora, I know Maneater Blossom is an ugly flower, but still it is a plant.";
- next;
- mes "I hope you can hunt Flora and get me 40 Maneater Blossoms. You are making the world green! Be proud!";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Morroc Ibraham --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3262) == 1) && (countitem(1032) > 39)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 1032,40; //Blossom_Of_Maneater
- getexp 17000,7000;
- erasequest 3262;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
- case 4:
- if (checkquest(3263) <= 0) {
- mes "This mission is assigned by the Payon blacksmith Antonio.";
- next;
- mes "Magic wand! Have you heard about it? It is an incredible wand!";
- next;
- mes "If you say the magic words and swing the wand, it will make your wishes come true.";
- next;
- mes "So, I decided to make it by myself. Then I will be rich and powerful~! Haha!!";
- next;
- mes "To make the wand, I need some special materials.";
- next;
- mes "Please bring me 30 Dokebi Horns and 30 Bamboo Cut. If you do so, I will lend you my magic wand once. Haha, good deal?";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Payon blacksmith Antonio --";
- next;
- mes " ";
- next;
- switch (select("Accept the mission.:Do not accept the mission.")) {
- case 1:
- if ((BaseLevel > 54) && (BaseLevel < 71)) {
- setquest 3263;
- mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
- next;
- mes "This mission doesn't have time limits.";
- close;
- }
- mes "These missions are not fit for my level. I should look for other missions.";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3263) == 1) && ((countitem(1021) < 30) || (countitem(7150) < 30))) {
- mes "You have an on-going mission. Would you like to check the details?";
- next;
- switch (select("Check the details.:Cancel.")) {
- case 1:
- mes "This mission is assigned by the Payon blacksmith Antonio.";
- next;
- mes "Magic wand! Have you heard about it? It is an incredible wand!";
- next;
- mes "If you say the magic words and swing the wand, it will make your wishes come true.";
- next;
- mes "So, I decided to make it by myself. Then I will be rich and powerful~! Haha!!";
- next;
- mes "To make the wand, I need some special materials.";
- next;
- mes "Please bring me 30 Dokebi Horns and 30 Bamboo Cut. If you do so, I will lend you my magic wand once. Haha, good deal?";
- next;
- mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
- next;
- mes "-- Payon blacksmith Antonio --";
- close;
- case 2:
- close;
- }
- }
- if ((checkquest(3263) == 1) && (countitem(1021) > 29) && (countitem(7150) > 29)) {
- mes "I have done pretty well for the mission. Should I report it now?";
- next;
- switch (select("Report the mission.:Do not report it yet.")) {
- case 1:
- delitem 1021,30; //Dokkaebi_Horn
- delitem 7150,30; //Bamboo_Cut
- getexp 18000,8000;
- erasequest 3263;
- mes "You have completed the mission. Get rewards.";
- close;
- case 2:
- close;
- }
- }
+ case 1: callsub L_HuntingQuest,3260,16000,6000;
+ case 2: callsub L_HuntingQuest,3261,16000,7000;
+ case 3: callsub L_Quest,3262,17000,7000,1032,40;
+ case 4: callsub L_Quest,3263,18000,8000,1021,30,7150,30;
+ }
+ break;
+ }
+ end;
+
+L_Quest:
+ if (checkquest(getarg(0)) <= 0) {
+ callsub L_CheckDetails, getarg(0);
+ mes " ";
+ next;
+ mes "Would you like to accept this mission?";
+ next;
+ if(select("Accept the mission.:Do not accept the mission.") == 1) {
+ if ((BaseLevel < 56) || (BaseLevel > 70)) {
+ mes "These missions are not fit for my level. I should look for other missions.";
+ close;
+ }
+ setquest getarg(0);
+ mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
+ next;
+ mes "This mission doesn't have time limits.";
+ }
+ close;
+ }
+ if (checkquest(getarg(0)) == 1) {
+ if (getargcount() > 5) {
+ if ((countitem(getarg(3)) >= getarg(4)) && (countitem(getarg(5)) >= getarg(6))) { set .@complete, 1; }
+ else { set .@complete, 0; }
+ } else {
+ if (countitem(getarg(3)) >= getarg(4)) { set .@complete, 1; }
+ else { set .@complete, 0; }
+ }
+ if (.@complete) {
+ mes "I have done pretty well for the mission. Should I report it now?";
+ next;
+ if(select("Report the mission.:Do not report it yet.") == 2) { close; }
+ delitem getarg(3),getarg(4);
+ if (getarg(5,0) > 0) { delitem getarg(5),getarg(6); }
+ getexp getarg(1),getarg(2);
+ erasequest getarg(0);
+ mes "You have completed the mission. Get rewards.";
+ } else {
+ mes "You have an on-going mission. Would you like to check the details?";
+ next;
+ if(select("Check the details.:Cancel.") == 1)
+ callsub L_CheckDetails, getarg(0);
+ }
+ }
+ close;
+ end;
+
+L_HuntingQuest:
+ if (checkquest(getarg(0)) <= 0) {
+ callsub L_CheckDetails, getarg(0);
+ next;
+ mes " ";
+ next;
+ mes "Would you like to accept this mission?";
+ next;
+ if(select("Accept the mission.:Do not accept the mission.") == 1) {
+ if ((BaseLevel < 56) || (BaseLevel > 70)) {
+ mes "These missions are not fit for my level. I should look for other missions.";
+ close;
}
+ setquest getarg(0);
+ mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
+ next;
+ mes "This mission doesn't have time limits.";
+ }
+ }
+ else if (checkquest(getarg(0),HUNTING) == 1) {
+ mes "You have an on-going mission. Would you like to check the details?";
+ next;
+ if(select("Check the details.:Cancel.") == 1)
+ callsub L_CheckDetails, getarg(0);
+ }
+ else if (checkquest(getarg(0),HUNTING) == 2) {
+ if (getargcount() > 3) {
+ if (countitem(getarg(3)) >= getarg(4)) { set .@complete, 1; }
+ else { set .@complete, 0; }
+ } else { set .@complete, 1; }
+ if (.@complete) {
+ mes "I have done pretty well for the mission. Should I report it now?";
+ next;
+ if(select("Report the mission.:Do not report it yet.") == 2) { close; }
+ if (getarg(3,0) > 0) { delitem getarg(3),getarg(4); }
+ getexp getarg(1),getarg(2);
+ erasequest getarg(0);
+ mes "You have completed the mission. Get rewards.";
+ } else {
+ mes "I don't have enough "+getitemname(getarg(3))+".";
+ mes "I need to gather "+getarg(4)+" "+getitemname(getarg(3))+" to complete this mission.";
}
}
- mes "To get these missions, I need to Join the Eden Group first. I must find Secretary Lime Evenor and become a member.";
close;
+ end;
+
+L_CheckDetails:
+ switch(getarg(0)){
+ case 3250:
+ mes "This mission is assigned by the Rekenber corporation from Lighthalzen. Below are the details.";
+ next;
+ mes "Rekenber corporation is about to launch a new project called 'Green Medical Center'. For the first product of the project, we are preparing well-being Bandages.";
+ next;
+ mes "Regarding the project, we need to research monster's reactions when they are wrapped with Rotten Bandages.";
+ next;
+ mes "If you are interested, please hunt 30 Mummies and bring 30 Rotten Bandages. You can find them in the Pyramid West of Morroc.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "- Rekenber corporation chief director 'Julie E Delph' -";
+ break;
+ case 3251:
+ mes "This mission is assigned by the Comodo cooperative society. Below are the details.";
+ next;
+ mes "Alligators have gone wild these days, they attack women and drunken people who hang out near the beach.";
+ next;
+ mes "This is a very shameful situation for us, the most wonderful vacation spot in Rune-Midgard.";
+ next;
+ mes "So, it would be very helpful if you hunt 30 Alligators to clean out this situation.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ break;
+ case 3252:
+ mes "This mission is assigned by an unknown client from Izlude.";
+ next;
+ mes "I have admired the beach of Izlude, ever since I was born.";
+ next;
+ mes "When I was young, I found a mysterious creature in the Izlude dungeon, I had never seen something like that before...";
+ next;
+ mes "I instantly thought it was a mermaid. I was so supprised, I have studied about mermaids in whole my life.";
+ next;
+ mes "But, as I studied harder, I found that the creature was not a mermaid... yes, It wasn't beautiful at all like other mermaids...";
+ next;
+ mes "I finally tracked down the fact that it was a Merman, not a Mermaid!";
+ next;
+ mes "Merman... I have wasted my life studying this monster! So please hunt 30 Mermans to make me feel better.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Izlude 'The Lost dream mermaid' --";
+ break;
+ case 3254:
+ mes "This mission is assigned by the government officer of the Rune-Midgarts Kingdom.";
+ next;
+ mes "To prevent a flood in Prontera, we decided to build a huge dam to regulate the water supply.";
+ next;
+ mes "But, we are shorthanded on supplies and we need to collect Fine Sand and Grit.";
+ next;
+ mes "So, we would like to ask for help. People, please bring us 10 Fine Sand and 30 Grit each so we can build the dam.";
+ next;
+ mes "You can get those materials from Sand Man, I wish you good luck!";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Government officer of the Rune-Midgarts Kingdom, Dufre Kent --";
+ break;
+ case 3255:
+ mes "This mission is assigned by the Payon town hall.";
+ next;
+ mes "Wild animals are always annoyances to farmers.";
+ next;
+ mes "They attack our farm and ruin whole crops!! We can't stand it anymore!";
+ next;
+ mes "So, we would like to ask for the help from brave adventurers.";
+ next;
+ mes "Please, hunt 30 Savages to save our crops!";
+ next;
+ mes "You can easily find those monsters around our town and field.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Payon town hall members --";
+ break;
+ case 3256:
+ mes "This mission is assigned by the Morroc blacksmith Aragham.";
+ next;
+ mes "Hello~~~~, Adventurers! This is Aragham, the hottest blacksmith in Morroc!";
+ next;
+ mes "Anyway, I have a son named Aragam Junior, the cute one. Haha.";
+ next;
+ mes "He will be attending summer camp this summer, but he doesn't know how to swim.";
+ next;
+ mes "I want to teach him, but as you know I am a blacksmith, a far cry from swimming! Hehe.";
+ next;
+ mes "But, I figured that if I make swim fins, it will be great for his confidence~!";
+ next;
+ mes "To make it, I need 30 Sticky Webfoots from a Roda Frog. Can you bring them to me?";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "PS. Do not compare me with Hollgrehenn or Antonio!!!!";
+ next;
+ mes "-- The hottest blacksmith, Morroc blacksmith Aragham --";
+ break;
+ case 3257:
+ mes "This mission is assigned by an inventor Dorian from Izlude.";
+ next;
+ mes "Have you heard the story that if women have a grudge on their mind, it will bring natural disasters.";
+ next;
+ mes "Wow, so guys must watch out for those sensitive women! Make sure they don't have any grudges on you.";
+ next;
+ mes "Women can bring strange phenomenons with them!";
+ next;
+ mes "I am so intrigued with that story that I'm trying to prove that it can be true.";
+ next;
+ mes "So I need to make women upset! Haha, I know what a mean idea, right?";
+ next;
+ mes "But this is seriously just for studying... So please hunt 30 Sohee's who seems to be revived from victimized souls.";
+ next;
+ mes "So I can keep observing the case.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Elegance inventor Dorian --";
+ break;
+ case 3258:
+ mes "This mission is assigned by Wallah from Payon.";
+ next;
+ mes "Hello, adventurer. How are you? How is your health?";
+ next;
+ mes "I am a pharmacist and I am having a hard time getting special ingredients lately.";
+ next;
+ mes "Because I am a little sensitive girl, how can I possibly get those things by myself.";
+ next;
+ mes "So, please help me. Just bring 40 Huge Leafs to me, that will be enough to complete my special medicine!";
+ next;
+ mes "Please bring it as soon as possible, people need my medicine.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Wallah --";
+ break;
+ case 3259:
+ mes "This mission is assigned by puppet master Woonute from Geffen.";
+ next;
+ mes "You know being a puppet master is kind of a hard job to satisfy people.";
+ next;
+ mes "People can search and see so many different things on their own thesedays.";
+ next;
+ mes "Their expectations are getting high, I can't satisfy them anymore.";
+ next;
+ mes "But if I can make new toy concepts, like living toys, it will be ground breaking.";
+ next;
+ mes "I heard that there are live dolls called Marionettes. Can you hunt 30 Marionettes for me? And also bring 30 Golden Hair, those will be great materials for the new toys.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Puppet Master Woonute --";
+ break;
+ case 3260:
+ mes "This mission is assigned by an exterminator from Prontera.";
+ next;
+ mes "As the weather gets warmer, insects multiply more and more. It is already out of control.";
+ next;
+ mes "People in Prontera cannot sleep because of all the bugs in their house.";
+ next;
+ mes "So, please help us, hunt 30 Hunter Flies. Then the flies can be reduced slowly.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- The Prontera exterminator --";
+ break;
+ case 3261:
+ mes "This mission is assigned by Cheese Dongja from Payon.";
+ next;
+ mes "Have you heard about Munak?";
+ next;
+ mes "The ugly monster Munak is threatening people in Payon.";
+ next;
+ mes "So we need brave adventurers like you!";
+ next;
+ mes "Please hunt 30 Munaks then Payon will be in peace.";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "- Payon Cheese Dongja -";
+ break;
+ case 3262:
+ mes "This mission is assigned by a gem dealer, Ibraham from Morroc.";
+ next;
+ mes "A small beautiful flower in the barren desert... What an incredible scene it would be!";
+ next;
+ mes "Planting flowers can make the world green and it will be so pretty everywhere.";
+ next;
+ mes "I plan to plant strong flowers in the Morroc desert so the soil gets better.";
+ next;
+ mes "I need 40 Maneater Blossom from Flora, I know Maneater Blossom is an ugly flower, but still it is a plant.";
+ next;
+ mes "I hope you can hunt Flora and get me 40 Maneater Blossoms. You are making the world green! Be proud!";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Morroc Ibraham --";
+ break;
+ case 3263:
+ mes "This mission is assigned by the Payon blacksmith Antonio.";
+ next;
+ mes "Magic wand! Have you heard about it? It is an incredible wand!";
+ next;
+ mes "If you say the magic words and swing the wand, it will make your wishes come true.";
+ next;
+ mes "So, I decided to make it by myself. Then I will be rich and powerful~! Haha!!";
+ next;
+ mes "To make the wand, I need some special materials.";
+ next;
+ mes "Please bring me 30 Dokebi Horns and 30 Bamboo Cut. If you do so, I will lend you my magic wand once. Haha, good deal?";
+ next;
+ mes "Please confirm it to us after you complete the mission, then we will give you proper rewards.";
+ next;
+ mes "-- Payon blacksmith Antonio --";
+ break;
+ }
+ return;
}
diff --git a/npc/re/quests/quests_mora.txt b/npc/re/quests/quests_mora.txt
new file mode 100644
index 000000000..f1d8e5784
--- /dev/null
+++ b/npc/re/quests/quests_mora.txt
@@ -0,0 +1,5315 @@
+//===== rAthena Script =======================================
+//= Mora Quest NPCs
+//===== By: ==================================================
+//= Euphy
+//===== Current Version: =====================================
+//= 1.0
+//===== Compatible With: =====================================
+//= rAthena SVN
+//===== Description: =========================================
+//= Quest NPCs related to Mora:
+//== Theore's Request, Chesire's New Day,
+//== Helping Lope and Euridi, Mora Daily Quests,
+//== Find the Research Tools, Knights of the Neighborhood
+//===== Additional Comments: =================================
+//= 0.1 NPCs are currently placeholders. [Euphy]
+//= 1.0 Implemented all official quests. [Euphy]
+//============================================================
+
+// Theore's Request :: bs
+//============================================================
+mid_camp,148,222,4 script Theore#ep14_1_bs 982,3,3,{
+ if (BaseLevel < 100) {
+ mes "- A person with a white gown -";
+ mes "- is pulling at his hair. -";
+ close;
+ }
+ if (ep14_1_bs == 0) {
+ mes "[Theore]";
+ mes "Aaaarrrggghh!!!";
+ mes "Darn it!!!!";
+ mes "I'm finished!!!";
+ next;
+ mes "[Theore]";
+ mes "How am I supposed to submit a report that's so bad!!! A 5-year-old could do better!!!";
+ mes "Noooo!!!";
+ set ep14_1_bs,1;
+ close;
+ } else if (ep14_1_bs == 1) {
+ mes "- A person with a white gown -";
+ mes "- is pulling at his hair. -";
+ next;
+ if(select("Try talking to him.:How noisy.") == 2) {
+ mes "[Theore]";
+ mes "Oh, of course, I'm sorry.";
+ mes "I'll keep it down.";
+ close;
+ }
+ mes "["+strcharinfo(0)+"]";
+ mes "Sir... Are you okay?";
+ mes "You will lose all your hair like that.";
+ mes "Calm down.";
+ next;
+ mes "[Theore]";
+ mes "Sob.......";
+ next;
+ mes "[Theore]";
+ mes ".......";
+ next;
+ mes "[Theore]";
+ mes "Odin!!!";
+ mes "Freyja!!!!";
+ mes "Sazarim!!!";
+ mes "Thank you!!";
+ mes "It's not all over!!";
+ next;
+ mes "[Theore]";
+ mes "There's always hope! I, Theore, will persevere and go on!!";
+ next;
+ mes "[Theore]";
+ mes "Dear Adventurer!!!";
+ mes "No, no, dear Warrior!!!!";
+ mes "Are you busy at the moment?";
+ mes "If you spare me a little time, I will see to it that you're rewarded handsomely!";
+ next;
+ switch(select("I'm busy.:Listen to him more.")) {
+ case 1:
+ mes "[Theore]";
+ mes ".......";
+ mes "I see, I suppose it can't be helped.";
+ mes "I'll probably lose all my hair and be on the ad for hair growth solutions. But I won't hold it against you, Warrior.";
+ next;
+ mes "[Theore]";
+ mes "Dear God! My luck ends here. *sob*";
+ mes "Even though the world is turning its back on me, I won't blame anyone!!!";
+ close;
+ case 2:
+ mes "[Theore]";
+ mes "Ahhh!";
+ mes "I feel like I was saved.";
+ mes "So the thing is.......";
+ next;
+ mes "[Theore]";
+ mes "Oh! Oh dear!";
+ mes "How rude of me, I haven't even introduced myself.";
+ mes "My name is Theore, and I work for 'Bazett Teablack's Institute of Culture of the Other World.' ";
+ next;
+ mes "[Theore]";
+ mes "I'm currently working on researching Laphines in the Splendide Basecamp.";
+ mes "Might be because I've been working soooo hard, but these days the Laphines all run away as soon as they see me.";
+ next;
+ mes "[Theore]";
+ mes "The deadline is approaching, and I still haven't figured out the most critical part. ";
+ mes "My professor will be very disappointed .......";
+ next;
+ mes "[Theore]";
+ mes "So won't you give me a hand?!";
+ mes "Your help will be acknowledged fully - I will tell the professor myself!";
+ next;
+ switch(select("Help.:Don't help.")) {
+ case 1:
+ mes "[Theore]";
+ mes "Sob sob Warrior, you're the best!";
+ mes "I will not forget this!!!";
+ mes "I'm going to write about it in my diary!!";
+ mes "And in the report!!!";
+ mes "And in a letter I'm sending home!!";
+ next;
+ mes "[Theore]";
+ mes "I'll tell my buddies at the lab!!!";
+ mes "I'll tell Lugen!!!";
+ mes "I'll write it in the bulletin board!!!";
+ mes "Let's see!!! Where else?";
+ next;
+ mes "- The man seems to be in a manic state. -";
+ mes "- Wait until he calms down -";
+ mes "- and try speaking to him again. -";
+ set ep14_1_bs,2;
+ setquest 11182;
+ close;
+ case 2:
+ mes "[Theore]";
+ mes ".......";
+ mes "You bad person, making me all worked up.";
+ mes "*sob*";
+ close;
+ }
+ }
+ } else if (ep14_1_bs == 2) {
+ if (checkquest(11182,PLAYTIME) < 2) {
+ mes "[Theore]";
+ mes "......";
+ switch(rand(1,4)) {
+ case 1:
+ mes "I must tell my next-door neighbor Pico!!!";
+ mes "And Kachua!!!";
+ break;
+ case 2:
+ mes "Tell the merchant across the street!!!";
+ mes "And also tell the administrator!!!";
+ break;
+ case 3:
+ mes "Tell Mr. Holgren!!!";
+ mes "Write up a report for the King!!!";
+ break;
+ case 4:
+ mes "Tell the people around here!!!";
+ mes "Shout it out loud from the observatory so the whole world hears!!!";
+ break;
+ }
+ next;
+ mes "- He is still manic. -";
+ mes "- Wait until he calms down -";
+ mes "- and try speaking to him again. -";
+ close;
+ }
+ mes "[Theore]";
+ mes "My apologies.";
+ mes "I got a little excited.";
+ mes "I do apologize.";
+ next;
+ mes "[Theore]";
+ mes "I'm usually a calm and rational person, but it feels like I've been everywhere - heaven AND hell - today!";
+ next;
+ mes "[Theore]";
+ mes "To the point: what I would like to ask you is not a hard task.";
+ next;
+ mes "[Theore]";
+ mes "As you probably know, the Laphines are at war with the Saphas.";
+ mes "Until recently, they attacked the Saphas mercilessly.";
+ next;
+ mes "[Theore]";
+ mes "But lately, the frequency of attacks has decreased significantly.";
+ mes "I can't figure out why, they are single-minded creatures and it's not likely that they just took pity on the Saphas' situation.";
+ next;
+ mes "[Theore]";
+ mes "Also, there are rumors of unarmed Laphines flying through the fields.";
+ next;
+ mes "[Theore]";
+ mes "I have seen it once, but he ran away as soon as he spotted me and I didn't get a chance to ask him.";
+ mes "I'm sure that he went back to the village. But as desperately as I want to ask, I was banned from entering the Splendide Basecamp.";
+ next;
+ select("Banned?");
+ mes "[Theore]";
+ mes "Well...";
+ mes "I got so excited after the professor assigned me to this research project.......";
+ mes "that I combed through Splendide night and day, and they finally kicked me out.";
+ mes "Ha ha ha!";
+ next;
+ mes "[Theore]";
+ mes "The Laphines may look cute, but they are combat specialists.......";
+ mes "So here I am, without the courage to sneak in, but with the report half-finished.......";
+ next;
+ mes "[Theore]";
+ mes "Tell me, is there a life more unfortunate than mine?";
+ mes "*chuckle*";
+ next;
+ mes "[Theore]";
+ mes "So Warrior, would you please find the Laphines who are coming to the Splendide field, and find out what they're up to?";
+ next;
+ mes "[Theore]";
+ mes "They may run away if you try to speak to them, so pay close attention when you find one.";
+ next;
+ mes "[Theore]";
+ mes "The Laphines are such a rowdy crew, and it's very unsettling to see how quiet they've been - almost like a period of calm before a giant thunderstorm.";
+ set ep14_1_bs,3;
+ changequest 11182,11183;
+ close;
+ } else if (ep14_1_bs == 3) {
+ mes "[Theore]";
+ mes "So Warrior, would you please find the Laphines who are coming to the Splendide field, and ask them what they're up to?";
+ next;
+ mes "[Theore]";
+ mes "They may run away if you try to speak to them, so pay close attention when you find one.";
+ next;
+ mes "[Theore]";
+ mes "The Laphines are such a rowdy crew, and it's very unsettling to see how quiet they've been - almost like a period of calm before a giant thunderstorm.";
+ close;
+ } else if (ep14_1_bs < 10) {
+ if (ep14_1_bs2 == 0) {
+ mes "- He is in no state for conversations. You should take the pouch to Splendide and look for its owner. -";
+ close;
+ } else if (ep14_1_bs2 < 4) {
+ mes "[Theore]";
+ mes "Hmm...... They were rummaging through the bushes?";
+ mes "Hmm... Hmm...";
+ next;
+ mes "[Theore]";
+ mes "They may have left a clue, can you please look around the area?";
+ mes "If they were looking through the bushes, they may have been looking for something they've lost.";
+ mes "Or they may have left something behind.";
+ close;
+ } else if (ep14_1_bs2 < 7) {
+ if (countitem(6390) == 0) {
+ mes "[Theore]";
+ mes "They may have left a clue, can you please look around the area?";
+ mes "If they were looking through the bushes, they may have been looking for something they've lost.";
+ mes "Or they may have left something behind.";
+ close;
+ }
+ mes "[Theore]";
+ mes "A pouch that a Laphine dropped as it fled?";
+ mes "Hmm... Hmm... A soft leather pouch with a string made by soaking dried vines in oil.... too small for humans or Saphas to use...";
+ next;
+ mes "[Theore]";
+ mes "Could... Could it be??!!";
+ mes "that object?!";
+ mes "that I've only heard about, but never came across!!!";
+ next;
+ mes "[Theore]";
+ mes "In the ancient times, Laphines used to carry fairy dust - such as the flying dust, minimizing dust - in a small pouch like this.";
+ next;
+ mes "[Theore]";
+ mes "They usually enjoy extravagant designs, but this 'fairy dust pouch' is something that they always carry around, and it is made simply without extravagant ornaments, keeping in line with tradition.";
+ next;
+ mes "[Theore]";
+ mes "I'm not sure what it'll be like nowadays, but if this is the 'fairy dust pouch,' the owner should be anxious to find it.";
+ next;
+ mes "[Theore]";
+ mes "We can't give it back for free though. In exchange for some information - that's a fair deal!";
+ next;
+ mes "[Theore]";
+ mes "And perhaps they won't be too upset if we look inside the pouch!";
+ mes "Wooow!!";
+ mes "I always believed when I was little that a fairy would come and sprinkle me with flying dust to make me fly!!!";
+ next;
+ mes "- Before I can stop him, -";
+ mes "- he opened the small pouch. -";
+ next;
+ mes "[Theore]";
+ mes ".......";
+ next;
+ mes "[Theore]";
+ mes "Oh...";
+ mes "Berries......and leaves?";
+ mes ".......";
+ next;
+ mes "[Theore]";
+ mes "......What about the flying dust?";
+ mes "Noooo!";
+ mes "My poor innocent imagination!!!!";
+ next;
+ mes "- He is in no state for conversations. You should take the pouch to Splendide and look for its owner. -";
+ set ep14_1_bs2, ep14_1_bs2+3; //4,5,6 -> 7,8,9
+ changequest 11185,11186;
+ close;
+ } else {
+ mes "- He is in no state for conversations. You should take the pouch to Splendide and look for its owner. -";
+ close;
+ }
+ } else if (ep14_1_bs < 18) {
+ mes "- He appears to be busy. You should finish the task at hand and come back. -";
+ close;
+ } else if (ep14_1_bs == 18) {
+ mes "[Theore]";
+ mes "At last, you're back!!!!";
+ mes "How did the investigation go?!";
+ next;
+ mes "[Theore]";
+ mes "Wow!!!";
+ mes "Incredible!!!!!!";
+ mes "Unbelievable!!!";
+ next;
+ mes "[Theore]";
+ mes "The best!!!!";
+ mes "This is surely enough to write an excellent report on!!";
+ mes "All thanks to you, Warrior!!";
+ next;
+ mes "[Theore]";
+ mes "I'll never, EVER forget what you've done for me!";
+ mes "No!!";
+ mes "My grandchildren's grandchildren will remember!!!!";
+ mes "*Sob*";
+ next;
+ mes "[Theore]";
+ mes "Then I'm off to put the finishing touches on the report!!!!!!!";
+ mes "Oh yeah!!!!";
+ set ep14_1_bs,19;
+ getexp 0,200000;
+ getitem 6380,5; //Mora_Coin
+ close;
+ } else if (ep14_1_bs > 18) {
+ mes "[Theore]";
+ mes "I'll write the report with lightning speed!!!!!!!";
+ mes "Oh yeah!!!!";
+ close;
+ }
+ end;
+OnTouch:
+ if (BaseLevel > 99) {
+ if (ep14_1_bs == 0) {
+ mes "[Theore]";
+ mes "Aaaarrrggghh!!!";
+ mes "Darn it!!!!";
+ mes "I'm finished!!!";
+ next;
+ mes "[Theore]";
+ mes "How am I supposed to submit a report that's so bad!!! A 5-year-old could do better!!!";
+ mes "Noooo!!!";
+ set ep14_1_bs,1;
+ close;
+ }
+ }
+ end;
+}
+
+- script #mora_bush -1,{
+ if (ep14_1_bs != 3 || rand(5)) {
+ mes "- It's just an ordinary bush. -";
+ close;
+ }
+ set .@i, atoi(charat(strnpcinfo(2),9));
+ set .@rand, rand(1,3);
+ mes "[Unarmed Laphine]";
+ mes "Aaaarrrrrggggghhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ donpcevent "Fairy#cmd"+.@i+.@rand+"::OnEnable";
+ set ep14_1_bs, .@i+3;
+ set ep14_1_bs2, .@rand;
+ changequest 11183,11184;
+ next;
+ mes "- You try to talk to the Laphine, -";
+ mes "- who is looking around the bushes, -";
+ mes "- but it flew away -";
+ mes "- while yelling fearfully. -";
+ next;
+ mes "- What was the fairy doing? -";
+ mes "- You decide to look around. -";
+ donpcevent "Bush"+.@i+"Timer::OnEnable";
+ close;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ donpcevent "Bush"+charat(strnpcinfo(2),9)+"Timer::OnDisable";
+ end;
+OnDisable:
+ disablenpc strnpcinfo(0);
+ end;
+}
+
+- script #mora_pouch -1,{
+ end;
+OnTouch:
+ set .@i, atoi(charat(strnpcinfo(2),9));
+ if (ep14_1_bs == .@i+3) {
+ if (countitem(6390) == 0) {
+ if (checkweight(1201,1) == 0) {
+ mes " - Hang on there !! -";
+ mes " - You are carrying too many kinds of items - ";
+ mes " - to receive any more items. - ";
+ mes " - Please lighten your load - ";
+ mes " - and try again. - ";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes " - Hang on there !! -";
+ mes " - You are carrying too much weight - ";
+ mes " - Please lighten your load - ";
+ mes " - and try again. - ";
+ close;
+ }
+ mes "- Jumble Fumble -";
+ mes "- Rustle Bustle -";
+ next;
+ if (rand(1,5) == 4) {
+ mes "- You've found a Small pouch. -";
+ if (ep14_1_bs2 > 0 && ep14_1_bs2 < 4)
+ set ep14_1_bs2, ep14_1_bs2+3;
+ changequest 11184,11185;
+ getitem 6390,1; //Small_Pocket
+ close;
+ } else {
+ mes "- You didn't find anything. -";
+ close;
+ }
+ }
+ }
+ end;
+}
+
+- script #mora_fairy -1,{
+ end;
+OnInit:
+ disablenpc strnpcinfo(0);
+ end;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ initnpctimer;
+ end;
+OnDisable:
+ disablenpc strnpcinfo(0);
+ stopnpctimer;
+ end;
+OnTimer5000:
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ stopnpctimer;
+ end;
+}
+
+spl_fild02,79,104,0 duplicate(#mora_bush) Bush#ep14_1_bs1 111
+spl_fild02,79,104,0 duplicate(#mora_pouch) #ep14_1_bs1 139,2,2
+spl_fild02,79,104,6 duplicate(#mora_fairy) Fairy#cmd11 440
+spl_fild02,79,104,6 duplicate(#mora_fairy) Fairy#cmd12 445
+spl_fild02,79,104,6 duplicate(#mora_fairy) Fairy#cmd13 439
+
+spl_fild02,103,344,0 duplicate(#mora_bush) Bush#ep14_1_bs2 111
+spl_fild02,103,344,0 duplicate(#mora_pouch) #ep14_1_bs2 139,2,2
+spl_fild02,103,344,6 duplicate(#mora_fairy) Fairy#cmd21 440
+spl_fild02,103,344,6 duplicate(#mora_fairy) Fairy#cmd22 445
+spl_fild02,103,344,6 duplicate(#mora_fairy) Fairy#cmd23 439
+
+spl_fild02,261,323,0 duplicate(#mora_bush) Bush#ep14_1_bs3 111
+spl_fild02,261,323,0 duplicate(#mora_pouch) #ep14_1_bs3 139,2,2
+spl_fild02,261,323,6 duplicate(#mora_fairy) Fairy#cmd31 440
+spl_fild02,261,323,6 duplicate(#mora_fairy) Fairy#cmd32 445
+spl_fild02,261,323,6 duplicate(#mora_fairy) Fairy#cmd33 439
+
+spl_fild02,137,305,0 duplicate(#mora_bush) Bush#ep14_1_bs4 111
+spl_fild02,137,305,0 duplicate(#mora_pouch) #ep14_1_bs4 139,2,2
+spl_fild02,137,305,6 duplicate(#mora_fairy) Fairy#cmd41 440
+spl_fild02,137,305,6 duplicate(#mora_fairy) Fairy#cmd42 445
+spl_fild02,137,305,6 duplicate(#mora_fairy) Fairy#cmd43 439
+
+spl_fild02,23,196,0 duplicate(#mora_bush) Bush#ep14_1_bs5 111
+spl_fild02,23,196,0 duplicate(#mora_pouch) #ep14_1_bs5 139,2,2
+spl_fild02,23,196,6 duplicate(#mora_fairy) Fairy#cmd51 440
+spl_fild02,23,196,6 duplicate(#mora_fairy) Fairy#cmd52 445
+spl_fild02,23,196,6 duplicate(#mora_fairy) Fairy#cmd53 439
+
+spl_fild02,186,260,0 duplicate(#mora_bush) Bush#ep14_1_bs6 111
+spl_fild02,186,260,0 duplicate(#mora_pouch) #ep14_1_bs6 139,2,2
+spl_fild02,186,260,6 duplicate(#mora_fairy) Fairy#cmd61 440
+spl_fild02,186,260,6 duplicate(#mora_fairy) Fairy#cmd62 445
+spl_fild02,186,260,6 duplicate(#mora_fairy) Fairy#cmd63 439
+
+- script #mora_bush_timer -1,{
+ end;
+OnInit:
+ disablenpc strnpcinfo(0);
+ end;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ initnpctimer;
+ end;
+OnDisable:
+ stopnpctimer;
+ disablenpc strnpcinfo(0);
+ end;
+OnTimer1000:
+ donpcevent "Bush#ep14_1_bs"+charat(strnpcinfo(0),4)+"::OnDisable";
+ end;
+OnTimer600000:
+ donpcevent "Bush#ep14_1_bs"+charat(strnpcinfo(0),4)+"::OnEnable";
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+}
+spl_fild02,180,1,0 duplicate(#mora_bush_timer) Bush1Timer 440
+spl_fild02,181,1,0 duplicate(#mora_bush_timer) Bush2Timer 440
+spl_fild02,182,1,0 duplicate(#mora_bush_timer) Bush3Timer 440
+spl_fild02,183,1,0 duplicate(#mora_bush_timer) Bush4Timer 440
+spl_fild02,184,1,0 duplicate(#mora_bush_timer) Bush5Timer 440
+spl_fild02,186,1,0 duplicate(#mora_bush_timer) Bush6Timer 440
+
+/*
+spl_fild02,187,1,0 script Field Bush Switch 440,{
+ donpcevent "Bush#ep14_1_bs1::OnEnable";
+ end;
+}
+*/
+
+splendide,183,117,4 script Tired-looking Fairy 438,{
+ if (!isequipped(2782)) {
+ mes "[Tired-looking Fairy]";
+ mes "VeOsaRiveh No ModAsh";
+ next;
+ mes "- You can't understand the fairy's words. -";
+ mes "- You need something to help you interpret them. -";
+ close;
+ }
+ if (ep14_1_bs < 4) {
+ mes "[Tired-looking Fairy]";
+ mes "I'm tired, don't talk to me.";
+ close;
+ } else if (ep14_1_bs < 10) {
+ if (checkquest(11187) == -1) {
+ mes "[Tired-looking Fairy]";
+ mes "I'm tired, don't talk to me.";
+ next;
+ select("Show the pouch.");
+ mes "[Tired-looking Fairy]";
+ mes "Huh?!";
+ mes "Where did you get this from?!";
+ next;
+ select("I found it in the bushes.");
+ mes "[Tired-looking Fairy]";
+ mes "It may not look like much, but it is an important object for us. I suppose I should say thanks.";
+ next;
+ mes "[Tired-looking Fairy]";
+ mes "But it won't be easy to find its owner with just the pouch...";
+ changequest 11186,11187;
+ next;
+ if(select("I think I saw a fairy that might be the owner.:I'll think about it.") == 2) {
+ mes "[Tired-looking Fairy]";
+ mes "Then tell me if you remember anything.";
+ close;
+ }
+ } else if (checkquest(11187) == 2) {
+ mes "[Tired-looking Fairy]";
+ mes "I hope you can find the owner.";
+ close;
+ }
+ mes "[Tired-looking Fairy]";
+ mes "Do you remember how the fairy looked?";
+ next;
+
+ setarray .@Hair$[0],"blonde","grassy-green","woody-brown","sea-blue";
+ setarray .@Skin$[0],"dark","light";
+ setarray .@Clothing$[0],"snow-white","grape","sky-blue","grassy-green";
+ setarray .@Wings$[0],"round","two pairs of","characteristic";
+
+ setarray .@i[1],
+ select("Blonde hair:Grassy-green hair:Woody-brown hair:Sea-blue hair"),
+ select("Dark-skinned:Light-skinned"),
+ select("Snow-white clothing:Grape clothing:Sky-blue clothing:Grassy-green clothing"),
+ select("Round wings:Two pairs of wings:Characteristic Wings");
+
+ set .@i[0], (1 << .@i[1]) | (1 << (.@i[2]+4)) | (1 << (.@i[3]+6)) | (1 << (.@i[4]+10));
+
+ mes "[Tired-looking Fairy]";
+ mes "A "+.@Skin$[.@i[2]-1]+"-skinned fairy with "+.@Hair$[.@i[1]-1]+" hair and "+.@Wings$[.@i[4]-1]+" wings, dressed in "+.@Clothing$[.@i[3]-1]+" clothing.......";
+ switch(.@i[0]) {
+ case 4418: // Kusmi: blonde hair, light skin, grape clothing, two pairs of wings
+ mes "Hmm...... That must be Kusmi.";
+ next;
+ mes "[Tired-looking Fairy]";
+ mes "Kusmi must be roaming the area southeast of the village.";
+ mes "Go see if she has lost her pouch.";
+ if (ep14_1_bs2 == 7)
+ set ep14_1_bs2,10;
+ close;
+ case 2212: // Theodore: grassy-green hair, dark skin, snow-white clothing, round wings
+ mes "Hmm......That must be Theodore.";
+ next;
+ mes "[Tired-looking Fairy]";
+ mes "Theodore must be roaming the area northeast of the village.";
+ mes "Go see if he has lost his pouch.";
+ if (ep14_1_bs2 == 8)
+ set ep14_1_bs2,11;
+ close;
+ case 9264: // Pauchon: sea-blue hair, dark skin, grassy-green clothing, characteristic wings
+ mes "Hmm......That must be Pauchon.";
+ next;
+ mes "[Tired-looking Fairy]";
+ mes "Pauchon must be roaming the area north of the village.";
+ mes "Go see if she has lost her pouch.";
+ if (ep14_1_bs2 == 9)
+ set ep14_1_bs2,12;
+ close;
+ default:
+ next;
+ mes "[Tired-looking Fairy]";
+ mes "Hmm...";
+ mes "I don't remember seeing such a fairy.";
+ mes "Are you sure you're not mistaken?";
+ mes "Try to remember it again.";
+ close;
+ }
+ }
+ mes "[Tired-looking Fairy]";
+ mes "What's up?";
+ mes "Did you find the owner of the pouch?";
+ close;
+}
+
+splendide,119,138,4 script Kusmi#ep14_1_bs 440,{
+ if (!isequipped(2782)) {
+ mes "[Kusmi]";
+ mes "DimFusTal Mu Lars";
+ mes "ModAnduLo";
+ mes "Mod";
+ mes "DorDuMe U NohLarsFulo Mu Fus";
+ next;
+ mes "- You can't understand the fairy's words. -";
+ mes "- You need something to help you interpret them. -";
+ close;
+ }
+ if (ep14_1_bs > 3 && ep14_1_bs < 10) {
+ mes "[Kusmi]";
+ mes "And who mayy you be?";
+ next;
+ select("Show the pouch.");
+ if (countitem(6390) == 0) {
+ mes "[Kusmi]";
+ mes "What is it that you want to show mee?";
+ close;
+ }
+ if (ep14_1_bs2 == 10) {
+ mes "[Kusmi]";
+ mes "Ahh!!";
+ mes "My pouch!!!!!";
+ mes "Thank you sirr!!!!!";
+ mes "I've been looking for it all overr!";
+ next;
+ select("Ask about the rumor.");
+ mes "[Kusmi]";
+ mes "That's a difficult questionn!";
+ mes "But you've returned my pouch, so I'll have to answerr......";
+ next;
+ mes "[Kusmi]";
+ mes "Promise me you won't tell anyonee!";
+ mes "If you can promise, please talk to me againn.";
+ delitem 6390,1; //Small_Pocket
+ set ep14_1_bs,10;
+ changequest 11187,11188;
+ close;
+ } else {
+ mes "[Kusmi]";
+ mes "Hmm I don't know who, but must be a slobb to be dropping his pouch like soo.";
+ mes "Huh? Mine??";
+ mes "No, mine is right here safelyy?";
+ next;
+ mes "[Kusmi]";
+ mes "It's a precious object so I hope you'll find the owner itt.";
+ close;
+ }
+ }
+ if (ep14_1_bs2 == 10) {
+ if (ep14_1_bs == 10) {
+ mes "[Kusmi]";
+ mes "You can't say this to anybody okayy~?";
+ mes "Recently,";
+ mes "the supplies from our the mainland have been cutt!";
+ mes "Or rather, the supply route is being blocked and we can't get our suppliess?";
+ next;
+ mes "[Kusmi]";
+ mes "We need to find enough food before we run out of stored goods, that's why we've been rummaging the bushess.";
+ next;
+ mes "[Kusmi]";
+ mes "But this cursed frozen land has no good foods.";
+ mes "We're barely keeping it green using magic, but it takes too much power to make fruit.";
+ next;
+ mes "[Kusmi]";
+ mes "The energy spent in making food is probably twice as much as the energy gained from eatingg.";
+ mes "Those higher up don't want to admit it, but it's going to become a serious problem soonn.";
+ next;
+ mes "[Kusmi]";
+ mes "We can't leave the battleground because we're in war, so we can't go checkk.";
+ mes "I am curiousss.......";
+ next;
+ mes "[Kusmi]";
+ mes "Not just me, but many Laphines are worriedd.";
+ mes "Well that's the situation, so if you meet a Laphine in the bushes please don't talk to himm.";
+ mes "It's embarrassingg!!!";
+ next;
+ mes "[Kusmi]";
+ mes "Oh, and you must never ever tell anyone about what happened todayy!";
+ mes "Unless that person wanted to help uss... spreading the word won't do Splendide any goood.";
+ set ep14_1_bs,11;
+ completequest 11188;
+ setquest 11189;
+ close;
+ } else if (ep14_1_bs == 11) {
+ mes "[Kusmi]";
+ mes "Eh?";
+ mes "You stilll want to talk?";
+ next;
+ select("Supply route from the mainland?");
+ mes "[Kusmi]";
+ mes "Well if you hear that you'll have to helpp!";
+ mes "Still want to knoww?!";
+ next;
+ switch(select("Yes.:No.")) {
+ case 1:
+ mes "[Kusmi]";
+ mes "It's not a special road or anythingg.";
+ mes "Just an old roadd.";
+ mes "Some say it connects different continents. It also connects the Splendide Basecamp and Alfheim through the backk.";
+ next;
+ mes "[Kusmi]";
+ mes "If you're headed that way, please go see that all's okayy.";
+ set ep14_1_bs,12;
+ changequest 11189,11190;
+ close;
+ case 2:
+ mes "[Kusmi]";
+ mes "Thank you for finding my pouchh.";
+ mes "I would give you some fairy dust, but there is none leftt.";
+ close;
+ }
+ } else if (ep14_1_bs == 12) {
+ mes "[Kusmi]";
+ mes "It's not a special road or anythingg.";
+ mes "Just an old roadd.";
+ mes "Some say it connects different continents. It also connects the Splendide Basecamp and Alfheim through the backk.";
+ next;
+ mes "[Kusmi]";
+ mes "If you're headed that way, please go see that all's okayy.";
+ close;
+ } else if (ep14_1_bs == 13) {
+ mes "[Kusmi]";
+ mes "A crevicee?";
+ mes "That's why we couldn't contact the mainland.";
+ mes "Urggg.......";
+ mes "It would be good to know what's going on up theree.";
+ next;
+ mes "[Kusmi]";
+ mes "If you happen to go through Bifrost, please figure out what's going onn.";
+ mes "In the middle of Bifrost is a small village called 'Mora.' All the supplies from the mainland come through that villagee.";
+ next;
+ mes "[Kusmi]";
+ mes "If you go to the warehouse in Mora Village, the manager will tell you moree.";
+ mes "Also, on the way back, will you check to see that my friend Rondo is in Mora Villagee?";
+ next;
+ mes "[Kusmi]";
+ mes "He always used to visit Splendide around this time, but the situation is no good now. I'll have to tell him to come another time.";
+ set ep14_1_bs,14;
+ changequest 11191,11192;
+ close;
+ } else if (ep14_1_bs == 14) {
+ mes "[Kusmi]";
+ mes "If you happen to go through Bifrost, please figure out what's going onn.";
+ mes "In the middle of Bifrost is a small village called 'Mora.' All the supplies from the mainland come through that villagee.";
+ next;
+ mes "[Kusmi]";
+ mes "If you go to the warehouse in Mora Village, the manager will tell you moree.";
+ if (checkquest(11193) > -1 && checkquest(11193) < 2)
+ close;
+ mes "Also, on the way back, will you check to see that my friend Rondo is in Mora Villagee?";
+ next;
+ mes "[Kusmi]";
+ mes "He always used to visit Splendide around this time, but the situation is no good now. I'll have to tell him to come another time.";
+ close;
+ } else if (ep14_1_bs > 14) {
+ if (checkquest(11193) == -1) {
+ mes "[Kusmi]";
+ mes "Will you check to see that my friend Rondo is in Mora Villagee?";
+ next;
+ mes "[Kusmi]";
+ mes "He always used to visit Splendide around this time, but the situation is no good now. I'll have to tell him to come another time.";
+ close;
+ }
+ mes "[Kusmi]";
+ mes "Heee!";
+ mes "You really went through the fog of the Maze of the Hazy Forest?";
+ mes "Wow!!!";
+ mes "That's very impressivee.";
+ next;
+ mes "[Kusmi]";
+ mes "Thank you soooo much.";
+ mes "I hope we'll be able to go through Bifrost againn.";
+ mes "I want to meet Rondo and talk to him againn.";
+ if (ep14_1_bs == 17) {
+ next;
+ mes "[Kusmi]";
+ mes "Oh, And Daphrer is in northwest Splendide.";
+ }
+ if (checkquest(11193) < 2) {
+ completequest 11192;
+ completequest 11193;
+ }
+ close;
+ }
+ }
+ mes "[Kusmi]";
+ mes "This place is always coldd.";
+ mes "So different from my heavenly hometownn.";
+ close;
+}
+
+splendide,304,295,4 script Theodore#ep14_1_bs 445,{
+ if (!isequipped(2782)) {
+ mes "[Theodore]";
+ mes "DimFusTal Mu Lars";
+ mes "ModAnduLo";
+ mes "Mod";
+ mes "DorDuMe U NohLarsFulo Mu Fus";
+ next;
+ mes "- You can't understand the fairy's words. -";
+ mes "- You need something to help you interpret them. -";
+ close;
+ }
+ if (ep14_1_bs > 3 && ep14_1_bs < 10) {
+ mes "[Theodore]";
+ mes "Who are you!";
+ next;
+ select("Show the pouch.");
+ if (countitem(6390) == 0) {
+ mes "[Theodore]";
+ mes "Hmm? What do you mean?";
+ close;
+ }
+ if (ep14_1_bs2 == 11) {
+ mes "[Theodore]";
+ mes "Ahh!!";
+ mes "My pouch!!!!!";
+ mes "I've been looking for it all over the place.";
+ mes "Thanks!";
+ next;
+ select("Ask about the rumor.");
+ mes "[Theodore]";
+ mes "Hrm!!";
+ mes "What a penetrating question!";
+ next;
+ mes "[Theodore]";
+ mes "If you really want to hear the answer, talk to me again.";
+ mes "I need time to think.";
+ delitem 6390,1; //Small_Pocket
+ set ep14_1_bs,10;
+ changequest 11187,11194;
+ close;
+ } else {
+ mes "[Theodore]";
+ mes "What is that dirty pouch!";
+ mes "It is definitely not mine.";
+ next;
+ mes "[Theodore]";
+ mes "But I hope you find its rightful owner.";
+ close;
+ }
+ }
+ if (ep14_1_bs2 == 11) {
+ if (ep14_1_bs == 10) {
+ mes "[Theodore]";
+ mes "You are not to tell anyone what I'm about to tell you.";
+ next;
+ mes "[Theodore]";
+ mes "Recently, there's a big problem in Splendide.";
+ mes "There is no communication with the mainland.";
+ mes "Not just communication, but supplies have been cut off also. People act indifferent but actually there is deep panic.";
+ next;
+ mes "[Theodore]";
+ mes "This frozen land is no use for collecting food, but to farm it would be too much work.";
+ next;
+ mes "[Theodore]";
+ mes "In fact, just maintaining the green is costing an incredible amount of magic power.";
+ mes "No word has come from higher up, but from the rumors it's not an easily fixable problem.";
+ next;
+ mes "[Theodore]";
+ mes "And because there is no easy fix, everybody is worried sick.";
+ mes "By military law, our soldiers cannot leave the battlefield during war, so it's impossible to get more information.";
+ next;
+ mes "[Theodore]";
+ mes "Therefore, if you happen to run into a Laphine, please don't mention any of this.";
+ mes "Everybody is trying as hard as they can, but we are still a proud race.";
+ next;
+ mes "[Theodore]";
+ mes "And as I said before, what I told you is a secret and you must not tell anyone.";
+ mes "We do need help, but we are cornered and we don't want others to know.";
+ set ep14_1_bs,11;
+ completequest 11194;
+ setquest 11195;
+ close;
+ } else if (ep14_1_bs == 11) {
+ mes "[Theodore]";
+ mes "You have further business with me?";
+ next;
+ select("Supply route from the mainland?");
+ mes "[Theodore]";
+ mes "Hmm... if you hear that, you might just have to help us out?";
+ mes "Do you still want to know?";
+ next;
+ switch(select("Yes.:No.")) {
+ case 1:
+ mes "[Theodore]";
+ mes "The supply route comes through Bifrost, and you can get to it from the back of the Splendide Basecamp.";
+ mes "That is why we set up the basecamp here.";
+ mes "The origin of the route is unclear, but it has been known for a long time to be a bridge that connects continents.";
+ next;
+ mes "[Theodore]";
+ mes "If you happen to venture there, please ask a guard what things are like there.";
+ set ep14_1_bs,12;
+ changequest 11195,11196;
+ close;
+ case 2:
+ mes "[Theodore]";
+ mes "Thank you for getting the pouch back to me.";
+ mes "Fairy dust? I don't carry around such a thing.";
+ close;
+ }
+ } else if (ep14_1_bs == 12) {
+ mes "[Theodore]";
+ mes "The supply route comes through Bifrost, and you can get to it from the back of the Splendide Basecamp.";
+ mes "That is why we set up the basecamp here.";
+ mes "The origin of the route is unclear, but it has been known for a long time to be a bridge that connects continents.";
+ next;
+ mes "[Theodore]";
+ mes "If you happen to venture there, please ask a guard what things are like there.";
+ close;
+ } else if (ep14_1_bs == 13) {
+ mes "[Theodore]";
+ mes "A crevice?";
+ mes "So that was why we couldn't reach the mainland.";
+ mes "It would be good to know what's going on up there.";
+ next;
+ mes "[Theodore]";
+ mes "Hmm...";
+ mes "I can't leave here, but you would be able to, no?";
+ mes "The supplies from the mainland come through 'Mora' Village, which is located in the middle of Bifrost.";
+ next;
+ mes "[Theodore]";
+ mes "If you speak to the Warehouse Manager of Mora Village, you'd be able to get more information.";
+ mes "If you're willing, will you go to Bifrost's 'Mora' Village and meet the Warehouse Manager?";
+ next;
+ mes "[Theodore]";
+ mes "And if it's not too much trouble, you could drop by my friend Lilitia's also...";
+ set ep14_1_bs,14;
+ changequest 11197,11198;
+ close;
+ } else if (ep14_1_bs == 14) {
+ mes "[Theodore]";
+ mes "If you speak to the Warehouse Manager of Mora Village, you'd be able to get more information.";
+ mes "If you're willing, will you go to Bifrost's 'Mora' Village and meet the Warehouse Manager?";
+ if (checkquest(11199) > -1 && checkquest(11199) < 2)
+ close;
+ next;
+ mes "[Theodore]";
+ mes "And if it's not too much trouble, you could drop by my friend Lilitia's also...";
+ close;
+ } else if (ep14_1_bs > 14) {
+ if (checkquest(11199) == -1) {
+ mes "[Theodore]";
+ mes "And if it's not too much trouble, you could drop by my friend Lilitia's also...";
+ close;
+ }
+ mes "[Theodore]";
+ mes "Wow!!!";
+ mes "So you went through the Maze of the Hazy Forest and returned from Mora Village.";
+ mes "I made the right decision by asking you!";
+ next;
+ mes "[Theodore]";
+ mes "Thank you.";
+ mes "I hope this gets resolved soon...";
+ mes "I don't want to further upset Lilitia...";
+ if (ep14_1_bs == 17) {
+ next;
+ mes "[Theodore]";
+ mes "Oh, And Daphrer is in northwest Splendide.";
+ }
+ if (checkquest(11199) < 2) {
+ completequest 11198;
+ completequest 11199;
+ }
+ close;
+ }
+ }
+ mes "[Theodore]";
+ mes "Sometimes, I sense a painful beauty in this frozen earth, quite different from the beauty of my hometown.";
+ mes "But this is a difficult environment for us to live in, certainly.";
+ close;
+}
+
+splendide,168,301,4 script Pauchon#ep14_1_bs 439,{
+ if (!isequipped(2782)) {
+ mes "[Pauchon]";
+ mes "DimFusTal Mu Lars";
+ mes "ModAnduLo";
+ mes "Mod";
+ mes "DorDuMe U NohLarsFulo Mu Fus";
+ next;
+ mes "- You can't understand the fairy's words. -";
+ mes "- You need something to help you interpret them. -";
+ close;
+ }
+ if (ep14_1_bs > 3 && ep14_1_bs < 10) {
+ mes "[Pauchon]";
+ mes "What can I do for you, sir?";
+ next;
+ select("Show the pouch.");
+ if (countitem(6390) == 0) {
+ mes "[Pauchon]";
+ mes "Huh? Do you see something?";
+ mes "I don't see anything...";
+ close;
+ }
+ if (ep14_1_bs2 == 12) {
+ mes "[Pauchon]";
+ mes "Good heavens...!";
+ mes "I think this is mine!";
+ mes "Thank you.";
+ mes "I've been worried since I lost it, you lifted a burden off of my mind.";
+ next;
+ select("Ask about the rumor.");
+ mes "[Pauchon]";
+ mes "That's not easy for me to answer...";
+ mes "I do appreciate you finding my pouch.... Hmm...";
+ mes "Please give me some time to think..";
+ delitem 6390,1; //Small_Pocket
+ set ep14_1_bs,10;
+ changequest 11187,11200;
+ close;
+ } else {
+ mes "[Pauchon]";
+ mes "Oh dear. It's not mine.";
+ mes "But to carelessly drop such an important object!";
+ mes "I don't know who it is, but that Laphine needs a lesson!";
+ close;
+ }
+ }
+ if (ep14_1_bs2 == 12) {
+ if (ep14_1_bs == 10) {
+ mes "[Pauchon]";
+ mes "What I'm about to tell you is top secret!";
+ mes "We don't even talk about it amongst ourselves!";
+ mes "How would we say that the supply from the mainland's been cut off like that!";
+ next;
+ mes "[Pauchon]";
+ mes "Ugh?!";
+ mes "Oh boy... I've done it....";
+ mes "It's really a top secret!!";
+ mes "Don't tell anybody!";
+ next;
+ mes "[Pauchon]";
+ mes "Well since I spilled the beans already... oh well, too late.";
+ mes "So it's been a while since we received supplies from the mainland.";
+ next;
+ mes "[Pauchon]";
+ mes "We're not starving, but we're receiving less and less food.";
+ mes "I was hungry so I went to go pick fruit, but in this cold climate there are no fruit trees.";
+ next;
+ mes "[Pauchon]";
+ mes "And the people higher up only tell us to wait... I'm so tired of waiting!";
+ mes "But the instant I leave this place, I'll end up going to prison....";
+ next;
+ mes "[Pauchon]";
+ mes "So I'm stuck here, and I'll be stuck here, suffering from hunger.... *sob*";
+ next;
+ mes "[Pauchon]";
+ mes "I'd eat the bark off of that tree if I could.";
+ mes "If only somebody could help. *sob*";
+ set ep14_1_bs,11;
+ completequest 11200;
+ setquest 11201;
+ close;
+ } else if (ep14_1_bs == 11) {
+ mes "[Pauchon]";
+ mes "What?";
+ mes "What do you want... I'm hungry, don't have energy to talk...";
+ next;
+ select("Supply route from the mainland?");
+ mes "[Pauchon]";
+ mes "Are you going to help me if I tell you?";
+ mes "If not, I won't tell.";
+ next;
+ switch(select("Yes.:No.")) {
+ case 1:
+ mes "[Pauchon]";
+ mes "A giant road leads away from the back of Splendide.";
+ mes "I don't know if it's related to legends and what not, but I've heard that the road's been there forever.";
+ next;
+ mes "[Pauchon]";
+ mes "Oh! The guard there might know something.";
+ mes "If you're headed that way, please go find out what's up.";
+ set ep14_1_bs,12;
+ changequest 11201,11202;
+ close;
+ case 2:
+ mes "[Pauchon]";
+ mes "Thank you for finding the pouch.";
+ mes "Ugh... I'm starving... I suppose I'll have to eat these bitter berries...";
+ close;
+ }
+ } else if (ep14_1_bs == 12) {
+ mes "[Pauchon]";
+ mes "A giant road leads away from the back of Splendide.";
+ mes "I don't know if it's related to legends and what not, but I've heard that the road's been there forever.";
+ next;
+ mes "[Pauchon]";
+ mes "Oh! The guard there might know something.";
+ mes "If you're headed that way, please go find out what's up.";
+ close;
+ } else if (ep14_1_bs == 13) {
+ mes "[Pauchon]";
+ mes "Crevice?!?";
+ mes "Hmm I have heard that crevices are creeping up here and there, but it even infiltrated Bifrost....";
+ mes "It appears to be more serious than I had imagined.";
+ next;
+ mes "[Pauchon]";
+ mes "If you can, would you go to 'Mora' Village in Bifrost and figure out what's going on?";
+ next;
+ mes "[Pauchon]";
+ mes "The supplies from the mainland come through the Village. If you go speak to the Warehouse Manager, he'll be able to tell you something.";
+ mes "Also, please pay a visit to my friend Humming.";
+ next;
+ mes "[Pauchon]";
+ mes "He's such a flighty guy, might have already left, but we were supposed to meet up in Mora Village.";
+ set ep14_1_bs,14;
+ changequest 11203,11204;
+ close;
+ } else if (ep14_1_bs == 14) {
+ mes "[Pauchon]";
+ mes "If you can, would you go to 'Mora' Village in Bifrost and figure out what's going on?";
+ next;
+ mes "[Pauchon]";
+ mes "The supplies from the mainland come through the Village. If you go speak to the Warehouse Manager, he'll be able to tell you something.";
+ if (checkquest(11205) > -1 && checkquest(11205) < 2)
+ close;
+ mes "Also, please pay a visit to my friend Humming.";
+ next;
+ mes "[Pauchon]";
+ mes "He's such a flighty guy, might have already left, but we were supposed to meet up in Mora Village.";
+ close;
+ } else if (ep14_1_bs > 14) {
+ if (checkquest(11205) == -1) {
+ mes "[Pauchon]";
+ mes "Please pay a visit to my friend Humming.";
+ mes "He's such a flighty guy, might have already left, but we were supposed to meet up in Mora Village.";
+ close;
+ }
+ mes "[Pauchon]";
+ mes "I had my doubts...But you really did cross the legendary Maze of the Hazy Forest...";
+ mes "I'm very impressed.";
+ next;
+ mes "[Pauchon]";
+ mes "I really appreciate your help.";
+ mes "I hope this gets resolved soon.";
+ mes "What I'm really afraid of... is hunger. More than war.";
+ if (ep14_1_bs == 17) {
+ next;
+ mes "[Pauchon]";
+ mes "Oh, And Daphrer is in northwest Splendide.";
+ }
+ if (checkquest(11205) < 2) {
+ completequest 11204;
+ completequest 11205;
+ }
+ close;
+ }
+ }
+ mes "[Pauchon]";
+ mes "Ah... I'm hungry.";
+ mes "When I get back to the mainland I'm going to stuff my belly until it bursts.";
+ close;
+}
+
+splendide,262,376,4 script Laphine Soldier#ep14_1 447,{
+ if (!isequipped(2782)) {
+ mes "[Laphine Soldier]";
+ mes "DielFarmar Di RiniIyazser Ha mahAgolAsh U U ";
+ mes "TurNohnar Di DurNeiFar Ra AnuVerNoth Ha AshRivehDor Ha BurWehLars Ur RinimanMod";
+ next;
+ mes "- You can't understand the fairy's words. -";
+ mes "- You need something to help you interpret them. -";
+ close;
+ }
+ mes "[Laphine Soldier]";
+ mes "This is Bifrost, which leads to Alfheim.";
+ mes "Please note that entry is forbidden due to a crevice caused by an unidentified source.";
+ if (ep14_1_bs != 12)
+ close;
+ next;
+ mes "[Laphine Soldier]";
+ mes "The other way leads to the Maze of the Hazy Forest.";
+ next;
+ mes "[Laphine Soldier]";
+ mes "You can get to Alfheim by making it through the Maze of the Hazy Forest. However, nobody has ever come back from the Maze of the Hazy Forest.";
+ if (checkquest(11190) > -1 && checkquest(11190) < 2) {
+ set ep14_1_bs,13;
+ changequest 11190,11191;
+ } else if (checkquest(11196) > -1 && checkquest(11196) < 2) {
+ set ep14_1_bs,13;
+ changequest 11196,11197;
+ } else if (checkquest(11202) > -1 && checkquest(11202) < 2) {
+ set ep14_1_bs,13;
+ changequest 11202,11203;
+ }
+ close;
+}
+
+mora,185,163,2 script Warehouse Manager#ep14_1 516,{
+ if (ep14_1_bs < 15) {
+ mes "[Warehouse Manager]";
+ mes "No, sir!";
+ mes "You cannot enter at will.";
+ mes "This is a warehouse. If you need something, please ask the staff outside.";
+ if (ep14_1_bs < 14)
+ close;
+ next;
+ select("Supplies for Laphine?");
+ mes "[Warehouse Manager]";
+ mes "Ah!";
+ mes "You're from Splendide?";
+ mes "Let's see...";
+ mes "All the supplies from over there to there are destined for Splendide.";
+ next;
+ mes "[Warehouse Manager]";
+ mes "We are quite worried too because the crevice in Bifrost has made it impossible to deliver these goods.";
+ next;
+ mes "[Warehouse Manager]";
+ mes "And the travelers who were heading down are also stuck here. The increasing number of customers is both a blessing and a curse..";
+ next;
+ mes "[Warehouse Manager]";
+ mes "If you plan to go back to Splendide, pay a visit to Jones at the Inn.";
+ mes "He has something that needs to be urgently delivered to the army of Splendide.";
+ set ep14_1_bs,15;
+ setquest 11206;
+ close;
+ } else if (ep14_1_bs == 15) {
+ mes "[Warehouse Manager]";
+ mes "If you plan to go back to Splendide, pay a visit to Jones at the Inn.";
+ mes "He has something that needs to be urgently delivered to the army of Splendide.";
+ close;
+ } else {
+ mes "[Warehouse Manager]";
+ mes "We are quite worried too because the crevice in Bifrost has made it impossible to deliver these goods.";
+ next;
+ mes "[Warehouse Manager]";
+ mes "And the travelers who were heading down are also stuck here. The increasing number of customers is both a blessing and a curse...";
+ close;
+ }
+ end;
+}
+
+mora,35,119,4 script Rondo#ep14_1_bs 513,{
+ mes "[Rondo]";
+ mes "Mora is such a mysterious place.";
+ mes "You can understand any language.";
+ next;
+ mes "[Rondo]";
+ mes "Of course, when we leave this area I won't be able to understand what you say, but I'll be able to remember the conversations we had. And I'll look forward to the day we meet again, here.";
+ if (ep14_1_bs > 13 && ep14_1_bs2 == 10) {
+ next;
+ mes "[Rondo]";
+ mes "Please tell Kusmi";
+ mes "that if he wants to meet, we can meet any time. There is nothing to worry about.";
+ if (checkquest(11193) == -1)
+ setquest 11193;
+ }
+ close;
+}
+
+mora,98,66,4 script Lilitia#ep14_1_bs 518,{
+ if (ep14_1_bs > 13 && ep14_1_bs2 == 11) {
+ mes "[Lilitia]";
+ mes "Boo!!!";
+ mes "He broke his promise again!!!";
+ next;
+ mes "[Lilitia]";
+ mes "He said he'd be here this time for sure!!!";
+ mes "That place is too cold for me to visit!!!!!";
+ mes "My precious leaves will wither there.";
+ next;
+ mes "[Lilitia]";
+ mes "What? Theodore sent you?";
+ mes "Please tell him that I'm so mad!!";
+ if (checkquest(11199) == -1)
+ setquest 11199;
+ close;
+ }
+ mes "[Lilitia]";
+ mes "I really hate the cold.";
+ mes "That's why Mora is a lovely place to live.";
+ next;
+ mes "[Lilitia]";
+ mes "The leaves are always fresh here. And, the stress about languages just disappears.";
+ close;
+}
+
+mora,139,102,2 script Humming#ep14_1_bs 515,{
+ if (ep14_1_bs > 13 && ep14_1_bs2 == 12) {
+ mes "[Humming]";
+ mes "Oh!";
+ mes "You're here because Pauchon sent you?";
+ next;
+ mes "[Humming]";
+ mes "It must've been hard for you to get here. I'm impressed.";
+ mes "The Maze of the Hazy Forest~ It fuels my adventurous spirit!";
+ next;
+ mes "[Humming]";
+ mes "If you reach Splendide before me, please tell Pauchon";
+ mes "that I'm going through the Maze of the Hazy Forest.";
+ if (checkquest(11205) == -1)
+ setquest 11205;
+ close;
+ }
+ mes "[Humming]";
+ mes "I heard that a crevice crept in between Jotunheim and Midgard, so I wanted to check it out. But I got stuck here.";
+ mes "I was looking forward to seeing a new place.";
+ next;
+ mes "[Humming]";
+ mes "Are you from Midgard?";
+ mes "What is it like there?";
+ mes "I've always wanted to see a creature called Poring.";
+ close;
+}
+
+mora,55,124,2 script Jones#ep14_1_bs 495,{
+ if (ep14_1_bs < 15) {
+ mes "[Jones]";
+ mes "Oh.... Darn.......";
+ mes "I can't go down, and I can't go back. My credibility that I've worked so hard on is just crumbling into dust.";
+ close;
+ } else if (ep14_1_bs == 15) {
+ mes "[Jones]";
+ mes "Ah, are you the traveler who came through the Maze of the Hazy Forest from Splendide?";
+ mes "If you plan to go back, can you please deliver this to the Splendide army?";
+ next;
+ mes "[Jones]";
+ mes "A person high up requested it, but I can't cross Bifrost.";
+ next;
+ mes "[Jones]";
+ mes "Deliveries to other places have all stopped also. Ah, my credibility is suffering....";
+ next;
+ switch(select("Yes.:No.")) {
+ case 1:
+ mes "[Jones]";
+ mes "Thank you.";
+ set ep14_1_bs,16;
+ changequest 11206,11207;
+ close;
+ case 2:
+ mes "[Jones]";
+ mes "I'm a bit embarrassed to ask this of a stranger...... Ha ha!";
+ close;
+ }
+ } else if (ep14_1_bs == 16) {
+ if (checkweight(1201,1) == 0) {
+ mes "[Jones]";
+ mes "You have too many kinds of items. Please lighten your load and come back.";
+ close;
+ }
+ if (MaxWeight - Weight < 3500) {
+ mes "[Jones]";
+ mes "You are carrying too much weight. Please lighten your load and come back.";
+ close;
+ }
+ mes "[Jones]";
+ mes "Please take good care of it.";
+ mes "It's for Daphrer in Splendide.";
+ set ep14_1_bs,17;
+ getitem 6391,1; //Splendid_Supply_Kit
+ changequest 11207,11208;
+ close;
+ } else if (ep14_1_bs == 17) {
+ mes "[Jones]";
+ mes "Please take good care of it.";
+ mes "It's for Daphrer in Splendide.";
+ close;
+ } else if (ep14_1_bs > 17) {
+ mes "[Jones]";
+ mes "Thanks to you, the job is well done.";
+ mes "Hehe, I see potential in you as a delivery man.";
+ mes "Interested in the career of delivery?";
+ close;
+ } else {
+ mes "[Jones]";
+ mes "Hehe, I see potential in you as a delivery man.";
+ mes "Interested in the career of delivery?";
+ close;
+ }
+ end;
+}
+
+splendide,121,260,4 script Daphrer#ep14_1_bs 435,{
+ if (!isequipped(2782)) {
+ mes "[Daphrer]";
+ mes "DRHSfhsdfGSDH FGkkmvoifk DFG DFHshfeksmn fgg FDbbd fjnnvk n skncki dfgd F FHdfkdfjkmv";
+ close;
+ }
+ if (countitem(6391)) {
+ mes "[Daphrer]";
+ mes "Oh....";
+ mes "I've been waiting for you.";
+ next;
+ mes "[Daphrer]";
+ mes "This was urgently needed so thank you for bringing it here, I hope I haven't caused you too much trouble..";
+ next;
+ mes "[Daphrer]";
+ mes "This is probably too small to be a reward, but please accept this as a sign of my gratitude.";
+ delitem 6391,1; //Splendid_Supply_Kit
+ if (ep14_1_bs == 17) {
+ set ep14_1_bs,18;
+ completequest 11208;
+ getexp 0,500000;
+ getitem 6380,5; //Mora_Coin
+ } else
+ getitem 6380,2; //Mora_Coin
+ close;
+ }
+ if (ep14_1_bs == 17) {
+ mes "[Daphrer]";
+ mes "Oh....";
+ mes "So you lost the item on the way.";
+ next;
+ mes "[Daphrer]";
+ mes "I knew that it was probably a stretch......";
+ mes "Perhaps I've been unrealistic.";
+ mes "But I thank you for your trouble anyway. Please accept this as a sign of my gratitude.";
+ set ep14_1_bs,18;
+ completequest 11208;
+ getexp 0,200000;
+ getitem 6380,2; //Mora_Coin
+ close;
+ }
+ mes "[Daphrer]";
+ mes "For me, a drop of water to make a flower blossom is more important than a sword for war.";
+ close;
+}
+
+// Chesire's New Day :: cheshir2
+//============================================================
+dic_in01,262,191,0 script #ep14_1_xq02 139,0,3,{
+ end;
+OnTouch:
+ if (ep13_3_secret > 22 && checkquest(7206) == -1) {
+ enablenpc "Cheshire#ep14_1_xq01";
+ cutin "ep13_cheshire_h",1;
+ mes "[Cheshire]";
+ mes "Oh, wait!";
+ mes "There's another thing I'd like you to do.";
+ mes "There's not enough time to go into details...";
+ next;
+ mes "- Cheshire glanced at the guard standing close to you, and leaned close and whispered into your ear.-";
+ next;
+ mes "[Cheshire]";
+ mes "You'll find cat caravans in the middle of ^4d4dffKamidal Tunnel^000000.";
+ mes "There is ^4d4dffa marked box among the caravans' goods to the west of the entrance to the Scaraba Hole^000000.";
+ next;
+ mes "[Cheshire]";
+ mes "I'd like you to bring it to me.";
+ mes "You'll see where you should bring it by looking at the box.";
+ mes "This is an important matter.";
+ next;
+ mes "[Cheshire]";
+ mes "I have something to get done in advance...";
+ mes "Good luck!";
+ setquest 7206;
+ close2;
+ disablenpc "Cheshire#ep14_1_xq01";
+ cutin "",255;
+ }
+ end;
+}
+
+dic_in01,260,194,4 script Cheshire#ep14_1_xq01 498,{
+ end;
+OnInit:
+ disablenpc "Cheshire#ep14_1_xq01";
+ end;
+}
+
+dic_dun01,274,114,0 script Stacked Boxes of Goods 844,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 1000) {
+ mes "- You have too many items to do this quest. -";
+ close;
+ }
+ set .@playtime, checkquest(7208,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "Boxes with all kinds of goods in them are stacked to the ceiling.";
+ mes "The marked box Cheshire was talking about doesn't seem to be here yet.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "Boxes with all kinds of goods in them are stacked to the ceiling.";
+ mes "Looking closely, you find a box with a small piece of paper stuck to it.";
+ mes "You've found the box of goods Cheshire was talking about.";
+ next;
+ switch(select("Move the box.:Give up.")) {
+ case 1:
+ mes "You promised to take the box of Bradium to Cheshire, who will be waiting for you near the Crevice of Bifrost.";
+ erasequest 7208;
+ setquest 7210;
+ getitem 6392,1; //Bradium_Box
+ close;
+ case 2:
+ mes "You decided to give up delivering the box.";
+ mes "You left the box as it is.";
+ erasequest 7208;
+ close;
+ }
+ } else {
+ if (checkquest(7207) == -1) {
+ if (checkquest(7206) > -1) {
+ mes "Boxes with all kinds of goods in them are stacked to the ceiling.";
+ mes "Looking closely, you find a box with a small piece of paper stuck to it.";
+ next;
+ mes "The piece of paper is marked with some mysterious symbol, and below it is written ^4d4dffTo: The Crevice of Bifrost^000000 in small letters.";
+ next;
+ mes "This must the box Cheshire was talking about.";
+ mes "You decide to take it to the location shown on the piece of paper.";
+ completequest 7206;
+ setquest 7207;
+ getitem 6392,1; //Bradium_Box
+ close;
+ }
+ } else if (checkquest(7207) < 2) {
+ mes "You've already obtained the box Cheshire was talking about.";
+ mes "Now you only have to take it to the Crevice of Bifrost.";
+ close;
+ }
+ mes "Boxes with all kinds of goods in them are stacked to the ceiling.";
+ close;
+ }
+ end;
+}
+
+bif_fild01,335,168,3 script Cheshire#ep14_1_xq04 497,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 1000) {
+ mes "- You have too many items to do this quest. -";
+ close;
+ }
+ cutin "ep13_cheshire",1;
+ if (checkquest(7209) > -1) {
+ if (countitem(6090) < 20) {
+ mes "[Cheshire]";
+ mes "Bring me 20 pieces of refined Bradium.";
+ mes "In exchange for the box, which you carelessly and irresponsibly sold to somebody.";
+ mes "Have I made myself clear?!";
+ close2;
+ cutin "",255;
+ end;
+ }
+ mes "[Cheshire]";
+ mes "So you've brought it?";
+ mes "The amount is less than it was, but I guess I can't help it.";
+ mes "Next time, you must bring the box to me intact.";
+ next;
+ mes "- Cheshire threw the Bradium into the Crevice. -";
+ next;
+ mes "[Cheshire]";
+ mes "You made a mistake of losing the box, you have to be content with this.";
+ mes "And starting tomorrow, get the box here intact.";
+ mes "Every day.";
+ delitem 6090,20; //Purified_Bradium
+ erasequest 7209;
+ setquest 7208;
+ getitem 6304,1; //Sapa_Feat_Cert
+ close2;
+ cutin "",255;
+ end;
+ }
+ callsub L_CheckPlaytime;
+ if (checkquest(7210) > -1) {
+ if (countitem(6392) == 0)
+ callsub L_LostQuest,7210;
+ else {
+ mes "[Cheshire]";
+ mes "You've come at just the right time.";
+ mes "And I see the box is intact!";
+ mes "Well done.";
+ next;
+ mes "[Cheshire]";
+ mes "Well, I'll be counting on you, tomorrow as well.";
+ mes "Get it?";
+ mes "Now, leave this place before the Laphines grow suspicious.";
+ erasequest 7210;
+ setquest 7208;
+ delitem 6392,1; //Bradium_Box
+ getitem 6304,1; //Sapa_Feat_Cert
+ getexp 50000,40000;
+ close2;
+ cutin "",255;
+ end;
+ }
+ }
+ if (ep13_3_secret > 22) {
+ if (checkquest(7207) == -1) {
+ if (checkquest(7206) == -1) {
+ mes "[Cheshire]";
+ mes "...Hmm? Huh?";
+ mes "It's "+strcharinfo(0)+"!";
+ mes "What are you doing here?";
+ next;
+ select("Huh? Cheshire?");
+ mes "[Cheshire]";
+ mes "What makes you so surprised?";
+ mes "Does it surprise you to see me here?";
+ next;
+ select("Nothing, it's just the hood...");
+ mes "[Cheshire]";
+ mes "Oh... This. Because it's bothersome.";
+ mes "And here, I don't have to mind others.";
+ mes "Oh, and well met!";
+ mes "I was going to put you to work when you came to Diel.";
+ next;
+ mes "[Cheshire]";
+ mes ".......What? Why are you staring at me like that?";
+ mes "his is all for Ahat's good.";
+ next;
+ switch(select("I guess I have no choice.:I have a lot of things to do!")) {
+ case 1:
+ mes "["+strcharinfo(0)+"]";
+ mes "(He will be suspicious if I refuse to do it... I guess I should play along for now.)";
+ mes "Okay.";
+ mes "I'll do anything for Ahat's pleasure.";
+ mes "So, what do you need me for?";
+ next;
+ break;
+ case 2:
+ mes "[Cheshire]";
+ mes "Things to do?";
+ mes "What things?";
+ mes "This is one of the things you must do.";
+ mes "Don't forget you're are loyal to Ahat.";
+ next;
+ break;
+ }
+ mes "[Cheshire]";
+ mes "Great! Now I will tell you what to do.";
+ mes "You know there is an entrance to Scaraba Hole in the middle of Kamidal Tunnel?";
+ mes "You will find cat caravans around there who sell supplies and some simple tools.";
+ next;
+ mes "[Cheshire]";
+ mes "There is a marked box among the goods stacked there.";
+ mes "I'd like you to bring the box to me.";
+ next;
+ mes "[Cheshire]";
+ mes "It's a simple job of picking up and delivering a box.";
+ mes "Do it ^4d4dff quickly and quietly, without being noticed^000000.";
+ setquest 7206;
+ next;
+ mes "[Cheshire]";
+ mes "Now, move!";
+ close2;
+ cutin "",255;
+ end;
+ } else {
+ mes "[Cheshire]";
+ mes "Bring the box from Kamidal Tunnel.";
+ mes "Quickly and quietly!";
+ mes "No, get a move on!";
+ close2;
+ cutin "",255;
+ end;
+ }
+ } else if (checkquest(7207) < 2) {
+ if (countitem(6392) == 0)
+ callsub L_LostQuest,7207;
+ else {
+ mes "[Cheshire]";
+ mes "........That box!";
+ mes "Oh, yes. It's the right one!";
+ mes "You've done a good job.";
+ mes "This is very important.";
+ mes "Ahat will be pleased.";
+ next;
+ mes "[Cheshire]";
+ mes "The boxes will be at the same place every day.";
+ mes "I'll leave the job to you.";
+ next;
+ select("Why don't you do it yourself?");
+ mes "[Cheshire]";
+ mes "........ Hmm...";
+ mes "It's only you humans that have free access to any place.";
+ mes "Plus, this place is Laphine territory.";
+ next;
+ mes "[Cheshire]";
+ mes "I don't attract their attention much, looking like this,";
+ mes "but what would Saphas think?";
+ mes "To see Ahat's man in a Laphine territory?";
+ next;
+ mes "[Cheshire]";
+ mes "They will grow suspicious.";
+ mes "But you humans are free from such troubles, so that's why you're the right one for the job.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "(... I don't buy his story, but he believes I'm on his side, so I guess I should play along.)";
+ mes "What happens to this Bradium, then?";
+ next;
+ mes "[Cheshire]";
+ mes "That thing?";
+ mes "Hand it to me.";
+ next;
+ mes "- Cheshire opened the box, checked the Bradium in it, threw them into the Crevice,";
+ mes "and looked back, dusting his hands off, and with a triumphant look on his face. -";
+ next;
+ mes "[Cheshire]";
+ mes "This is what happens.";
+ mes "*laugh* Beyond the Crevice lies a path unknown to you.";
+ next;
+ mes "[Cheshire]";
+ mes "Well, I'll leave the matter to you.";
+ mes "Try to bring the box to me every day.";
+ mes "Okay?";
+ delitem 6392,1; //Bradium_Box
+ completequest 7207;
+ setquest 7208;
+ getitem 6304,1; //Sapa_Feat_Cert
+ getexp 50000,40000;
+ next;
+ mes "[Cheshire]";
+ mes "In compensation for your efforts, I'll give you an Exploit Certification of Sapha and a little cash.";
+ mes "Now, leave this place before the Laphines grow suspicious.";
+ close2;
+ cutin "",255;
+ end;
+ }
+ } else {
+ callsub L_CheckPlaytime;
+ mes "[Cheshire]";
+ mes "Huh? What's up?";
+ mes "You haven't brought the box today?";
+ next;
+ mes "[Cheshire]";
+ mes "Hmm, this is unexpected...";
+ mes "Well, I have no choice then.";
+ mes "I'll have another guy do it today.";
+ mes "But you must do it starting tomorrow, okay?";
+ setquest 7208;
+ close2;
+ cutin "",255;
+ end;
+ }
+ } else if (ep13_3_secret > 15) {
+ mes "[Cheshire]";
+ mes "... Huh? I think I've seen you somewhere...";
+ mes "..........Oh!";
+ mes strcharinfo(0)+"...?!";
+ mes "What brings you here?";
+ next;
+ mes "[Cheshire]";
+ mes "You say you've forgotten what to do?";
+ mes "You're not supposed to be here.";
+ mes "You're supposed to be at the crevice to the south of Dicastes.";
+ next;
+ mes "[Cheshire]";
+ mes "Whoa.";
+ mes "What was Ahat thinking when he sent such an idiot to me?";
+ mes "Now, get a move on and do your job.";
+ close2;
+ cutin "",255;
+ end;
+ }
+ mes "[Cheshire]";
+ mes "...Why isn't this fellow showing up?";
+ mes "Should be here by now...";
+ mes "Lost the way back perhaps...?";
+ mes "....? Eh? Who, who are you? How long have you been standing here?";
+ next;
+ select("A cat?!");
+ mes "[Cheshire]";
+ mes "Who... who's a cat?!";
+ mes "Get lost!";
+ close2;
+ cutin "",255;
+ end;
+L_LostQuest:
+ mes "[Cheshire]";
+ mes "Oh, have you been there?";
+ mes "What happened to the box?";
+ mes "Why are you empty-handed?";
+ next;
+ switch(select("I'll look for it again!:I lost it...")) {
+ case 1:
+ mes "[Cheshire]";
+ mes "Make sure you do a good job!";
+ mes "And keep looking for it.";
+ mes "You must not lose it.";
+ break;
+ case 2:
+ mes "[Cheshire]";
+ mes "Where?";
+ mes "Which merchant did you sell it to?";
+ mes "Can't you distinguish between what to sell and what not to sell?";
+ mes "Were you asleep when you made the deal?";
+ next;
+ mes "[Cheshire]";
+ mes "This is utterly ridiculous.";
+ mes "Make up for what you lost!";
+ mes "^4d4dff20 pieces of refined Bradium^000000!!!";
+ erasequest getarg(0);
+ setquest 7209;
+ break;
+ }
+ close2;
+ cutin "",255;
+ end;
+L_CheckPlaytime:
+ set .@playtime, checkquest(7208,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "[Cheshire]";
+ mes "Each day, one of these boxes is sent to Kamidal Tunnel.";
+ mes "It's smuggled in among other items.";
+ next;
+ mes "[Cheshire]";
+ mes "Sneak into the place on time, and bring the box to me. The boxes will be at the same place every day.";
+ mes "You'll be doing it every day.";
+ close2;
+ cutin "",255;
+ end;
+ } else if (.@playtime == 2) {
+ mes "[Cheshire]";
+ mes "It's about time.";
+ mes "Now go get the box.";
+ mes "It should be lying near the entrance to Scaraba Hole in the Kamidal Tunnel.";
+ mes "You've done this before, so you must be familiar with it?";
+ close2;
+ cutin "",255;
+ end;
+ } else
+ return;
+}
+
+dicastes02,125,192,0 script #call_cheshir_ep14 139,0,3,{
+ end;
+OnTouch:
+ if (ep13_3_secret > 22) {
+ if (rand(2)) {
+ emotion e_ho,1;
+ mes "..........?";
+ mes "You sense someone moving around.";
+ mes "There must be someone down there.";
+ if ($@cheshire_on == 0) {
+ donpcevent "Cheshire#ep14_extra::OnEnable";
+ set $@cheshire_on,1;
+ }
+ close;
+ }
+ }
+ end;
+}
+
+dicastes02,103,190,3 script Cheshire#ep14_extra 497,{
+ if (ep13_3_secret > 22) {
+ cutin "ep13_cheshire",1;
+ mes "[Cheshire]";
+ mes "...Eh?";
+ mes "What a surprise. What are you doing here?";
+ next;
+ switch(select("And what are YOU doing here?:Those ears...?")) {
+ case 1:
+ mes "[Cheshire]";
+ mes "Out for a walk?";
+ mes "I came out with Ahat, but he went back in to take care of an urgent matter.";
+ next;
+ mes "[Cheshire]";
+ mes ".. ..............";
+ next;
+ select("....:Wha... What a pretty tree.");
+ mes "[Cheshire]";
+ mes "This tree... it's white, transparent, and shiny.";
+ mes "It's a Sapha's body.";
+ next;
+ mes "[Cheshire]";
+ mes "You know Saphas slowly turn to stone throughout their lives.";
+ mes "So when they die, they turn to stony trees.";
+ mes "This forest is... their cemetery, so to speak.";
+ next;
+ mes "[Cheshire]";
+ mes "....... Look closely, and you can make out his arms and legs.";
+ mes "Interesting, isn't it?";
+ next;
+ mes "[Cheshire]";
+ mes "... .. ...";
+ next;
+ mes "[Cheshire]";
+ mes "Oh, this is so annoying.";
+ mes "I'm off!";
+ next;
+ mes "- Cheshire stormed off... -";
+ break;
+ case 2:
+ mes "[Cheshire]";
+ mes "What? The ears?";
+ mes "Well, it's no wonder because I'm a beastman.";
+ mes "... Why... Why are you staring me like that?";
+ next;
+ select("Are you responsible for the report?!");
+ mes "[Cheshire]";
+ mes "What are you talking about?";
+ mes "I don't know such a thing!";
+ next;
+ mes "- Cheshire ran away... -";
+ break;
+ }
+ disablenpc "Cheshire#ep14_extra";
+ stopnpctimer;
+ close2;
+ cutin "",255;
+ end;
+ }
+ mes "A boy dressed in unusual clothing is standing, with a fierce look in his eyes.";
+ mes "You guess you'd better leave him alone.";
+ close;
+OnInit:
+ disablenpc "Cheshire#ep14_extra";
+ end;
+OnEnable:
+ enablenpc "Cheshire#ep14_extra";
+ initnpctimer;
+ end;
+OnDisable:
+ disablenpc "Cheshire#ep14_extra";
+ stopnpctimer;
+ end;
+OnTimer600000:
+ disablenpc "Cheshire#ep14_extra";
+ set $@cheshire_on,0;
+ stopnpctimer;
+ end;
+}
+
+// Helping Lope and Euridi :: rofe
+//============================================================
+mora,117,66,3 script Euridi#pa 521,{
+ if (BaseLevel < 100) {
+ mes "[Euridi]";
+ mes "You are very delicate.";
+ mes "It's true that I need help,";
+ mes "but I don't think you can help.";
+ close;
+ }
+ if (ep14_1_rope == 0) {
+ mes "[Euridi]";
+ mes "I hear you passed through the Hazy Forest.";
+ mes "Did you...";
+ mes "Did you happen to see";
+ mes "Lope, my fiance, there?";
+ next;
+ switch(select("Yes, I did.:No, I didn't.")) {
+ case 1:
+ mes "[Euridi]";
+ mes "Are you sure? Where did you see him?";
+ mes "Take me there, quick!";
+ mes "...";
+ next;
+ mes "[Euridi]";
+ mes "What?";
+ mes "You're kidding...?";
+ mes "How could you?";
+ close;
+ case 2:
+ mes "[Euridi]";
+ mes "Please find my Lope.";
+ mes "I came here to the Village of Mora";
+ mes "after asking all around,";
+ mes "but there is nothing more I can do.";
+ next;
+ mes "[Euridi]";
+ mes "My heart aches at the thought of Lope...";
+ mes "He will be desperately looking for me...";
+ next;
+ switch(select("Sorry, I'm busy!:I'll help you!")) {
+ case 1:
+ mes "[Euridi]";
+ mes "How heartless!";
+ close;
+ case 2:
+ mes "[Euridi]";
+ mes "I heard that he had gone into the Hazy Forest,";
+ mes "while guiding tourists around the village.";
+ mes "One of the tourists who went with Lope";
+ mes "must still be at the inn.";
+ next;
+ mes "[Euridi]";
+ mes "He wouldn't see me and locked himself in the room.";
+ mes "But he might be willing to see you, because you've been to the Hazy Forest.";
+ setquest 1109;
+ set ep14_1_rope,1;
+ close;
+ }
+ }
+ } else if (ep14_1_rope == 1) {
+ mes "[Euridi]";
+ mes "The tourist is at the inn,";
+ mes "not in front of me!";
+ close;
+ } else if (ep14_1_rope == 2) {
+ mes "[Euridi]";
+ mes "So you've seen Pitt!";
+ mes "I knew he would be willing to see you.";
+ mes "What did he say?";
+ next;
+ mes "[Euridi]";
+ mes "...No way....!";
+ mes "That is utter nonsense.";
+ mes "To blame Lope for it!";
+ mes "I found this piece of paper";
+ mes "near the Hazy Forest.";
+ mes "I'm sure it's Lope's.";
+ next;
+ mes "[Euridi]";
+ mes "If you find the rest of ^0000FFLope's Clues^000000,";
+ mes "you'll be able to find out";
+ mes "where he is.";
+ mes "I'm counting on you, "+strcharinfo(0)+".";
+ changequest 1110,1111;
+ set ep14_1_rope,3;
+ close;
+ } else if (ep14_1_rope == 3) {
+ mes "[Euridi]";
+ mes "If you come across a ^0000FFLope's Clue^000000, please show it to Pitt.";
+ mes "I hope he will tell the truth soon.";
+ close;
+ } else if (ep14_1_rope == 4) {
+ mes "[Euridi]";
+ mes "I don't understand it.";
+ mes "I'm now suspicious of his motives.";
+ mes "Why is he trying so hard to accuse Lope?";
+ mes "Wait... those clues...";
+ next;
+ mes "[Euridi]";
+ mes "Those seem to be more than simple notes.";
+ mes "Can I have a look at them?";
+ mes "...";
+ mes "These fit together like a puzzle.";
+ mes "... Oh!... This is...";
+ next;
+ mes "[Lope's Letter]";
+ mes "...We've been wandering around the Forest for days.";
+ mes "...So we're not protecting the tourists,";
+ mes "I got sick from deadly poison, and became a burden to everyone.";
+ mes "How pathetic...";
+ next;
+ mes "[Lope's Letter]";
+ mes "No wonder I was kicked out of";
+ mes "the Splendide Expedition.";
+ mes "...But I managed to protect at least one tourist.";
+ mes "He will deliver this letter and the ring to you.";
+ next;
+ mes "[Lope's Letter]";
+ mes "...I wanted to propose to you";
+ mes "as a proud member of the Expedition.";
+ mes "I'm sorry, Euridi.";
+ mes "See you soon.";
+ next;
+ mes "Having read the letter,";
+ mes "Euridi is standing staring blankly like someone who wasn't all there.";
+ mes "Let's go show the letter to Pitt.";
+ changequest 1112,1113;
+ delitem 6383,30; //Clue_Of_Lope
+ set ep14_1_rope,5;
+ close;
+ } else if (ep14_1_rope == 5) {
+ mes "[Euridi]";
+ mes "No, Lope must be safe.";
+ mes "He will come back no matter what...";
+ close;
+ } else if (ep14_1_rope == 6) {
+ mes "[Euridi]";
+ mes "......";
+ next;
+ mes "You hear a song coming from the girl who is hanging her head low.";
+ mes "Her friend seems to have something to say.";
+ close;
+ } else if (ep14_1_rope == 7 || ep14_1_rope == 8) {
+ mes "You hear a quiet singing voice.";
+ mes "You can't make the words out.";
+ close;
+ } else if (ep14_1_rope == 9) {
+ mes "[Euridi]";
+ mes "Have you found Lope?";
+ mes "Is he safe?";
+ next;
+ switch(select("Tell her you can't possibly find him.:Tell her he is dead.")) {
+ case 1:
+ mes "[Euridi]";
+ mes "I'll go look for him myself.";
+ mes "Hopefully... it's not too late, yet.";
+ mes "Let me go, there's no time to lose!";
+ close;
+ case 2:
+ mes "[Euridi]";
+ mes "I don't believe it.";
+ mes "He told me he would come back soon...";
+ mes "He told me to hang on.";
+ mes "It can't be... It just can't be...";
+ next;
+ mes "You hand her Lope's Ring, which Pitt gave you.";
+ mes "With the ring in her hand, Euridi bursts into tears.";
+ mes "She starts to sing in a strained voice, still crying.";
+ changequest 1116,1117;
+ set ep14_1_rope,10;
+ delitem 6384,1; //Ring_Of_Lope
+ close;
+ }
+ } else if (ep14_1_rope > 9) {
+ mes "You stand frozen.";
+ mes "You hear a quiet singing voice.";
+ close;
+ }
+}
+
+mora,115,68,3 script Euridi's Friend#pa 520,{
+ if (ep14_1_rope < 2) {
+ mes "[Euridi's Friend]";
+ mes "Please stop Euridi.";
+ mes "She is desperate to find her missing fiance.";
+ close;
+ } else if (ep14_1_rope == 2) {
+ mes "[Euridi's Friend]";
+ mes "Pitt is definitely suspicious.";
+ mes "I think he is avoiding Euridi...";
+ mes "He must be hiding something.";
+ close;
+ } else if (ep14_1_rope == 3) {
+ mes "[Euridi's Friend]";
+ mes "To tell the truth, I don't think";
+ mes "that Lope is alive.";
+ mes "I'm just worried about Euridi.";
+ next;
+ mes "[Euridi]";
+ mes "Aaarrrggghhh!!!!!!!!";
+ next;
+ mes "[Euridi's Friend]";
+ mes "...";
+ mes "To tell the truth, I really believe";
+ mes "that Lope is alive.";
+ mes "...";
+ mes "*sigh*";
+ close;
+ } else if (ep14_1_rope == 4) {
+ mes "[Euridi's Friend]";
+ mes "How's Pitt doing?";
+ mes "I think I should go visit him";
+ mes "and make him feel worse!";
+ mes "He's so disgusting!";
+ close;
+ } else if (ep14_1_rope == 5) {
+ mes "[Euridi's Friend]";
+ mes "Go to Pitt, quick.";
+ close;
+ } else if (ep14_1_rope == 6) {
+ mes "[Euridi's Friend]";
+ mes "Euridi is singing a song of healing";
+ mes "to protect her weakened body and mind.";
+ mes "At this rate, something's going to happen to her too.";
+ next;
+ mes "[Euridi's Friend]";
+ mes "Oh, I remember a traveler telling me";
+ mes "that he had seen a suspicious man";
+ mes "near the entrance to the Hazy Forest.";
+ next;
+ mes "[Euridi's Friend]";
+ mes "The traveler says he looked creepy standing there staring blankly,";
+ mes "but he couldn't see clearly";
+ mes "because of the thick fog.";
+ mes "I think it's worth investigating.";
+ changequest 1114,1115;
+ set ep14_1_rope,7;
+ close;
+ } else if (ep14_1_rope == 7) {
+ mes "[Euridi's Friend]";
+ mes "I hear that a suspicious man was seen";
+ mes "near the entrance to the Hazy Forest.";
+ mes "The traveler says he looked creepy standing there staring blankly,";
+ mes "but he couldn't see clearly";
+ mes "because of the thick fog.";
+ mes "I think it's worth investigating.";
+ close;
+ } else if (ep14_1_rope == 8 || ep14_1_rope == 9) {
+ mes "[Euridi's Friend]";
+ mes "Your face is dark.";
+ mes "Bad news?";
+ close;
+ } else if (ep14_1_rope == 10) {
+ mes "[Euridi's Friend]";
+ mes "There is a Laphine saying that";
+ mes "desperation invites disaster.";
+ mes "Maybe we're responsible";
+ mes "for what happened.";
+ next;
+ if (checkweight(6380,1) == 0) {
+ mes "[Euridi's Friend]";
+ mes "You have too many things with you.";
+ mes "Can you throw out some of them?";
+ close;
+ }
+ mes "[Euridi's Friend]";
+ mes "Lope will be able to rest in peace now.";
+ mes "Thank you. I won't forget what you've done for me.";
+ completequest 1117;
+ set ep14_1_rope,11;
+ getexp 1000000,2000000;
+ getitem 6380,10; //Mora_Coin
+ close;
+ } else if (ep14_1_rope > 10) {
+ mes "[Euridi's Friend]";
+ mes "Thank you. I won't forget your help.";
+ close;
+ }
+}
+
+mora,65,145,3 script Pitt#pa 519,{
+ if (ep14_1_rope == 0) {
+ mes "[Pitt]";
+ mes "So you're quite good,";
+ mes "since you passed through the Hazy Forest alive.";
+ mes "I'm completely messed up, you see,";
+ mes "so I can't afford to listen to the tales of your exploits.";
+ mes "Now leave.";
+ close;
+ } else if (ep14_1_rope == 1) {
+ mes "[Pitt]";
+ mes "You have a knack for pestering people, don't you?";
+ mes "Euridi sent you, eh?";
+ mes "The Laphine couple is";
+ mes "anxious to kill me.";
+ next;
+ mes "[Pitt]";
+ mes "Go and tell her!";
+ mes "That the stupid guide";
+ mes "pushed us reluctant tourists into the forest,";
+ mes "and ran off to save his own skin!";
+ next;
+ mes "[Pitt]";
+ mes "So you're sorry that it's me, not him, that's here?";
+ mes "He will be alive somewhere,";
+ mes "so go and try to find him! Just stop bothering me!";
+ changequest 1109,1110;
+ set ep14_1_rope,2;
+ close;
+ } else if (ep14_1_rope == 2) {
+ mes "[Pitt]";
+ mes "This is all because of";
+ mes "the stupid guide!";
+ mes "I hate Laphines!";
+ close;
+ } else if (ep14_1_rope == 3) {
+ if (countitem(6383) < 30) {
+ mes "[Pitt]";
+ mes "This is all because of";
+ mes "the stupid guide!";
+ mes "I hate Laphines!";
+ close;
+ }
+ mes "[Pitt]";
+ mes "That thing you have in your hand...";
+ mes "It looks very strange.";
+ mes "I've never seen such a thing before.";
+ mes "You'd better not keep that.";
+ mes "Can I have it?";
+ next;
+ switch(select("Give it to him.:Don't give it to him.")) {
+ case 1:
+ mes "[Pitt]";
+ mes "So I swallow it like this,";
+ mes "and voila! Evidence gone!";
+ mes "Now I can sleep soundly, thank you!";
+ delitem 6383,5; //Clue_Of_Lope
+ close;
+ case 2:
+ mes "[Pitt]";
+ mes "Why are you showing me such a thing?";
+ mes "I don't know anything! I'm the victim here!";
+ mes "I'm a victim of the schemes of the Laphine couple.";
+ mes "It's unfair...";
+ next;
+ mes "It's no use trying to talk to him any more.";
+ mes "Try talking to Euridi.";
+ changequest 1111,1112;
+ set ep14_1_rope,4;
+ close;
+ }
+ } else if (ep14_1_rope == 4) {
+ mes "[Pitt]";
+ mes "This is unfair!";
+ mes "This is so totally unfair!";
+ close;
+ } else if (ep14_1_rope == 5) {
+ if (checkweight(6384,1) == 0) {
+ mes "[Pitt]";
+ mes "What are you, a professional mover?";
+ mes "Stomping about with a ton of stuff on your back!";
+ mes "I can't rest because of the noise!";
+ mes "Throw away all that stuff!";
+ close;
+ }
+ mes "[Pitt]";
+ mes "I never imagined you'd find them all";
+ mes "and piece them together.";
+ mes "Is this a divine punishment...?";
+ mes "Or Laphines' curse?";
+ mes "Whew...";
+ next;
+ mes "[Pitt]";
+ mes "That guide fellow,";
+ mes "he opened the gate out";
+ mes "when he was hit hard";
+ mes "by the poison.";
+ next;
+ mes "[Pitt]";
+ mes "When I was hesitating whether to take him with me,";
+ mes "he handed me that letter and the ring.";
+ mes "Laphines' jewelry...";
+ mes "It's rumored that nobody could ever have it except Laphines,";
+ mes "including the Gods themselves.";
+ next;
+ mes "[Pitt]";
+ mes "So I had in my hands";
+ mes "a treasure among treasures!";
+ mes "How...! Just how on earth";
+ mes "could I have let it pass through!";
+ next;
+ mes "[Pitt]";
+ mes "I was going to leave this place";
+ mes "as soon as I pulled myself together.";
+ mes "But now I'm stuck here,";
+ mes "affected by the poison myself.";
+ next;
+ mes "[Pitt]";
+ mes "I'll give you the ring back,";
+ mes "so please leave me alone!";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Then where could Lope...?";
+ next;
+ mes "[Pitt]";
+ mes "If he died near the exit of the forest,";
+ mes "he must be somewhere around there,";
+ mes "in whatever form he might be in.";
+ changequest 1113,1114;
+ set ep14_1_rope,6;
+ getitem 6384,1; //Ring_Of_Lope
+ close;
+ } else if (ep14_1_rope == 6 || ep14_1_rope == 7) {
+ mes "[Pitt]";
+ mes "I'm a victim, too!";
+ mes "So leave me alone! I beg you!";
+ close;
+ } else if (ep14_1_rope == 8) {
+ mes "[Pitt]";
+ mes "...";
+ close;
+ } else if (ep14_1_rope > 8) {
+ mes "He's sleeping.";
+ mes "He seems to be in a very deep sleep.";
+ close;
+ }
+}
+
+bif_fild01,132,338,3 script Lope#pa 461,2,2,{
+ if (ep14_1_rope < 8) {
+ mes "[Suspicious Man]";
+ mes "......";
+ close;
+ } else if (ep14_1_rope == 8) {
+ donpcevent "Lope#pa::OnEnable";
+ mes "[Suspicious Man]";
+ mes "Aaaarrrrrggggghhhh!!!!!!";
+ mes "I can't see anything.";
+ mes "Who's there?";
+ mes "Answer, or I'll take you as an enemy and kill you.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Euridi is looking for you.";
+ next;
+ mes "[Suspicious Man]";
+ mes "......";
+ next;
+ mes "[Lope]";
+ mes "Wraith, how can you be so harsh to me?";
+ mes "I asked you to wipe the name off my mind";
+ mes "in return for bearing the curse!";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Will you please calm down and listen to...";
+ next;
+ mes "[Lope]";
+ mes "My desire to help";
+ mes "led me to my death,";
+ mes "And my desire to survive and take revenge";
+ mes "led me to my rebirth.";
+ mes "I will not side with life any more.";
+ next;
+ mes "[Lope]";
+ mes "As soon as my transformation is over,";
+ mes "I will punish you all with the bloody confusion of the Hazy Forest,";
+ mes "which saved my life!";
+ next;
+ mes "You put the letter Euridi pieced together in Lope's hands.";
+ next;
+ mes "[Lope]";
+ mes "...This is!";
+ mes "I feel Euridi's touch.";
+ mes "So the letter... was delivered to Euridi?";
+ mes "This is unbelievable...";
+ next;
+ mes "[Lope]";
+ mes "Deformed as I am now,";
+ mes "I'm not her love any more.";
+ mes "Go back, and tell her that Lope turned to dust";
+ mes "on the ground of the Hazy Forest long ago.";
+ next;
+ mes "[Lope]";
+ mes "Now go!";
+ mes "This is my last request as a Laphine called Lope...";
+ set ep14_1_rope,9;
+ changequest 1115,1116;
+ close;
+ } else {
+ mes "[Lope]";
+ mes "Deformed as I am now,";
+ mes "I'm not her love any more.";
+ mes "Go back, and tell her that Lope turned to dust";
+ mes "on the ground of the Hazy Forest long ago.";
+ next;
+ mes "[Lope]";
+ mes "Now go!";
+ mes "This is my last request as a Laphine called Lope...";
+ next;
+ mes "You see a ring glowing faintly on his left hand.";
+ close;
+ }
+ end;
+OnEnable:
+ setnpcdisplay "Lope#pa",999;
+ end;
+OnDisable:
+ disablenpc "Lope#pa";
+ initnpctimer;
+ end;
+OnReset:
+ setnpcdisplay "Lope#pa",461;
+ enablenpc "Lope#pa";
+ end;
+OnTimer2000:
+ donpcevent "Lope#pa::OnReset";
+ stopnpctimer;
+ end;
+OnTouch:
+ mes "I see a suspicious man. Should I try talking to him?";
+ next;
+ switch(select("Leave him alone.:Talk to him.")) {
+ case 1:
+ donpcevent "Lope#pa::OnDisable";
+ mes "[Suspicious Man]";
+ mes "......";
+ close;
+ case 2:
+ donpcevent "Lope#pa::OnDisable";
+ if (ep14_1_rope == 7) {
+ mes "[Suspicious Man]";
+ mes ".";
+ mes "...";
+ mes "........!!!";
+ next;
+ mes "[Suspicious Man]";
+ mes "Aaaaarrrrrggghh!!!!!";
+ set ep14_1_rope,8;
+ close;
+ } else {
+ mes "[Suspicious Man]";
+ mes "......";
+ close;
+ }
+ }
+}
+
+// Find the Research Tools :: muk
+//============================================================
+mora,31,138,6 script Raffle Researcher#ep14 522,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 500) {
+ mes "^FF0000- Warning message -";
+ mes "- Hang on there!! -";
+ mes "- You have too many items -";
+ mes "- to receive any more items. -";
+ mes "- Please lighten your load -";
+ mes "- and try again. -^000000";
+ close;
+ }
+ // NPC disabled from 12am ~ 5am.
+ if (gettime(3) >= 0 && gettime(3) < 5) {
+ if (ep14_1_muk > 0) {
+ mes "[Raffle Researcher]";
+ mes "Don't humans sleep?";
+ mes "People should be sleeping at this hour.";
+ mes "Why on earth are you bothering me?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I can't get any sleep because of you.";
+ mes "I have to sleep for my research tomorrow.";
+ mes "You should go sleep too.";
+ close;
+ } else {
+ mes "Z z Z z";
+ next;
+ mes "^FF0000He appears to be asleep.^000000";
+ close;
+ }
+ }
+ if (ep14_1_muk == 0) {
+ mes "[Raffle Researcher]";
+ mes "Oh no~ My research tools...";
+ mes "What...... What was it?";
+ emotion e_sob;
+ next;
+ select("What is your business here?");
+ mes "[Raffle Researcher]";
+ mes "Hmm?";
+ emotion e_what;
+ next;
+ mes "[Raffle Researcher]";
+ mes "You're human...? Are you human...?";
+ mes "You... came from the underworld?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Human beings are incredible...";
+ mes "You survived the crevice and made it here.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "... ... ...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "You, come here for a minute.";
+ mes "It's a simple experiment, so there's no need to be afraid.";
+ emotion e_gg;
+ next;
+ if(select("What a crazy Raffle. I must run away.:... ...") == 1) {
+ mes "[Raffle Researcher]";
+ mes "You said you had made it up from the Crevice,";
+ mes "so I was wondering what race you were,";
+ mes "but a mere human? How did you get up here?";
+ emotion e_lv;
+ close;
+ }
+ if (BaseLevel < 100) {
+ mes "[Raffle Researcher]";
+ mes "What... I thought a human who made it up from the Crevice";
+ mes "would be extraordinary,";
+ mes "but you're no more than a kid.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Go hunt more ^000000Porings^000000";
+ mes "and come back when your level is in the triple digits kid!";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "... ... ...";
+ emotion e_dots;
+ next;
+ mes "[Raffle Researcher]";
+ mes "You... You're not like the other humans.";
+ mes "You're not running away...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "You've got some serious guts...";
+ mes "Now I really want to do some experiments on you...";
+ next;
+ select("Well... that's... um...");
+ mes "[Raffle Researcher]";
+ mes "Ha ha... Just kidding...";
+ mes "I'm a Raffle researcher,";
+ mes "but I don't research humans.";
+ mes "Actually, I have no idea";
+ mes "what to research";
+ mes "about humans...";
+ next;
+ select("Glad to hear that...");
+ mes "[Raffle Researcher]";
+ mes "That's that. You're not busy, are you?";
+ mes "I'd like you to give me a hand...";
+ next;
+ select("Help him.:Help willingly.:Although you feel a little embarrassed, help anyhow.:Help with conviction.:Help adorably.:You're suspicious, but help anyhow.:You have no choice. Help him.");
+ mes "[Raffle Researcher]";
+ mes "I haven't met many humans";
+ mes "but you clearly care about";
+ mes "another person's hardship.";
+ mes "You must be an ^FF0000extremely^000000 nice human.";
+ emotion e_no1;
+ next;
+ mes "[Raffle Researcher]";
+ mes "I'll save my thanks for time's sake.";
+ mes "It's important, so please take care of it quickly.";
+ mes "I can't proceed with the research because of it.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Here at the Mora Inn,";
+ mes "there's a very famous bath.";
+ mes "If anybody, not just us Raffles,";
+ mes "goes into the bath water";
+ mes "their wounds will be healed instantly...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "So being a great researcher, I went into the bath";
+ mes "to check it out further";
+ mes "and... unfortunately...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I was attacked by a mysterious creature,";
+ mes "and I lost consciousness.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "When I woke up, I realized that";
+ mes "my important research tools were missing...";
+ mes "So I was at a loss for what to do.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "And here you are, a human,";
+ mes "a brave, heroic human that arrived at Mora Village from the Crevice.";
+ mes "Your willingness to help has really taken this load off of my mind.";
+ next;
+ select("... ... ...");
+ mes "[Raffle Researcher]";
+ mes "Please go to the bath house and retrieve my research tools.";
+ mes "The sooner you get them back,";
+ mes "the sooner I can get back to my research.";
+ setquest 5016;
+ set ep14_1_muk,1;
+ next;
+ mes "[Raffle Researcher]";
+ mes "Have a safe trip.";
+ emotion e_paper;
+ close;
+ } else if (ep14_1_muk == 1) {
+ if (checkquest(5016) > -1 && countitem(6385) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You're back? Where are my research tools?";
+ emotion e_what;
+ next;
+ mes "[Raffle Researcher]";
+ mes "You still haven't found the research tools?";
+ mes "I'm disappointed. Get yourself to the bath";
+ mes "and quickly retrieve my research tools";
+ mes "taken away from me.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "Wow!! You found the research tools...?";
+ mes "You're quite capable.";
+ mes "I really like how you handle your work.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I like you.";
+ mes "Do you want to work on my research with me?";
+ mes "I could use your help here and there,";
+ mes "until I'm done with this research.";
+ next;
+ select("As you wish.");
+ mes "[Raffle Researcher]";
+ mes "Great. Thanks, and when we're done,";
+ mes "I'll pay you handsomely.";
+ mes "Also, for every research project that's completed,";
+ mes "I'll also give you some pocket money.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Young Raffles these days... they are just plain stupid.";
+ mes "I've always wanted a capable research assistant,";
+ mes "but it hasn't been easy to find one.";
+ next;
+ if (checkweight(6380,1) == 0) {
+ mes "[Raffle Researcher]";
+ mes "By the way... Was it that difficult to";
+ mes "reclaim the research tools?";
+ mes "You're carrying some very heavy looking equipment.";
+ mes "Go lighten your load, and I'll pay you for your work.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "It must've been hard work to retrieve the tools.";
+ mes "Why don't you take this and go to the inn";
+ mes "and rest up? There's nothing for you to do right now.";
+ delitem 6385,1; //Research_Tool_Bag
+ set ep14_1_muk,2;
+ getitem 6380,1; //Mora_Coin
+ erasequest 5016;
+ close;
+ } else if (ep14_1_muk == 2) {
+ // Unofficial check, but it's needed here.
+ if (checkquest(5029,PLAYTIME) == 0 || checkquest(5029,PLAYTIME) == 1) {
+ mes "[Raffle Researcher]";
+ mes "It must've been hard work to retrieve the tools.";
+ mes "Why don't you take this and go to the inn";
+ mes "and rest up? There's nothing for you to do right now.";
+ close;
+ }
+ switch(rand(1,5)) {
+ case 1:
+ mes "[Raffle Researcher]";
+ mes "I'm still preparing for the research.";
+ mes "Unfortunately a few research tools";
+ mes "were damaged.";
+ emotion e_an;
+ close;
+ case 2:
+ mes "[Raffle Researcher]";
+ mes "Come to think of it, I don't think";
+ mes "I told you my name.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "My name is Inffle. If anybody";
+ mes "asks you who you are working with,";
+ mes "you can say ^0000FFI'm working with Researcher Inffle.^000000";
+ mes "That's why I'm telling you my name.";
+ emotion e_ok;
+ close;
+ case 3:
+ mes "[Raffle Researcher]";
+ mes "Why? The inn is closed?";
+ mes "That's strange, it shouldn't be.";
+ mes "Why don't you go try again?";
+ emotion e_what;
+ close;
+ case 4:
+ break;
+ case 5:
+ mes "[Raffle Researcher]";
+ mes "Darn, I get more worked up the more I think about it.";
+ mes "It's not like I went with bad intentions...";
+ mes "I just wanted to do some research...";
+ mes "Can't believe I got attacked...";
+ mes "I just can't believe it...";
+ mes "What do you think?";
+ emotion e_an;
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "Good thing you're here.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I've been thinking about";
+ mes "the unidentified creature in the bath.";
+ mes "He's quite the little devil, to take research tools,";
+ mes "which are as important to a researcher as his life...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "A research assistant's job";
+ mes "is to make sure that the researcher can focus on his research";
+ mes "And not have to worry about anything else... VERY! Important.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I'd like you to take my revenge";
+ mes "on the unidentified creature for me...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I don't even want anything that drastic.";
+ mes "3 times! Go bully him for just 3 times.";
+ mes "You can draw on his face,";
+ mes "pinch him, tickle him,";
+ mes "whatever you want. Just bully him 3 times.";
+ set ep14_1_muk,3;
+ setquest 5017;
+ close;
+ } else if (ep14_1_muk < 6) {
+ mes "[Raffle Researcher]";
+ mes "How's the work going?";
+ mes "An assistant has to work swiftly and effectively.";
+ mes "Could it be that you have forgotten";
+ mes "what your task is?";
+ next;
+ select("Exactly. What should I do?");
+ mes "[Raffle Researcher]";
+ mes "Go bully the unidentified creature";
+ mes "just 3 times.";
+ mes "You can draw on his face,";
+ mes "pinch him, tickle him, or whatever.";
+ mes "Bully him 3 times.";
+ emotion e_gg;
+ close;
+ } else if (ep14_1_muk == 6) {
+ mes "[Raffle Researcher]";
+ mes "So you taught him a lesson? Great. I feel avenged!";
+ emotion e_heh;
+ next;
+ mes "[Raffle Researcher]";
+ mes "For a while, I couldn't sleep";
+ mes "because I couldn't stop thinking about the lost research tools.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "That's that! We need to begin the bath research now.";
+ mes "I need to finish the research quickly,";
+ mes "so that I can start on a new topic.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Go to the bath water";
+ mes "with the sample tube that I give you,";
+ mes "and gather some samples.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Look around the bath water,";
+ mes "and you will find an area emitting a distinct aura.";
+ mes "You can collect the samples";
+ mes "from that area.";
+ next;
+ if (MaxWeight - Weight < 100 || checkweight(1092,10) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You are carrying too much weight.";
+ mes "I can't give you the sample tube.";
+ mes "Why don't you lighten your load and come back?";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "Here is the sample tube for collecting.";
+ mes "Go and collect 10 samples!";
+ set ep14_1_muk,7;
+ getitem 1092,10; //Empty_Cylinder
+ erasequest 5018;
+ setquest 5019;
+ close;
+ } else if (ep14_1_muk == 7) {
+ if (checkquest(5019) > -1 && countitem(6386) < 10) {
+ mes "[Raffle Researcher]";
+ mes "Have you collected the samples yet?";
+ mes "Please hurry up.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Look around the bath water,";
+ mes "and you will find an area emitting a distinct aura.";
+ mes "You can collect the samples";
+ mes "from that area.";
+ close;
+ }
+ if (checkweight(6380,1) == 0) {
+ mes "[Raffle Researcher]";
+ mes "I know that you've done a lot...";
+ mes "but you are carrying too many things.";
+ mes "Even though I want to give you pocket money, I can't.";
+ mes "Could you lighten your load and come back?";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You got the bath water sample. Great job.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I'll have to run a few tests";
+ mes "with the bath water samples.";
+ mes "It usually takes about 24 hours.";
+ mes "Why don't you come back then?";
+ delitem 6386,10; //Bathtub_R_Sample
+ getitem 6380,1; //Mora_Coin
+ set ep14_1_muk,8;
+ erasequest 5019;
+ setquest 5020;
+ close;
+ } else if (ep14_1_muk == 8) {
+ if (checkquest(5020,PLAYTIME) == 0 || checkquest(5020,PLAYTIME) == 1) {
+ mes "[Raffle Researcher]";
+ mes "The basic tests have not been completed yet.";
+ mes "There's nothing for you to do now.";
+ mes "Go for a walk.";
+ mes "Spend some money that I gave you.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "The basic tests are done.";
+ mes "As I thought...";
+ mes "There were many interesting substances in the bath water.";
+ emotion e_ho;
+ next;
+ mes "[Raffle Researcher]";
+ mes "The most notable is this unidentifiable DNA.";
+ mes "I didn't have a chance to compare it to a lot of DNA samples,";
+ mes "but I'm pretty sure that this DNA";
+ mes "has been transformed by the mysterious substances of the bath.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "After much thought,";
+ mes "I concluded that this DNA probably belongs to";
+ mes "the unidentified creature that attacked me.";
+ next;
+ if (rand(2)) {
+ set .@str$,"teeth";
+ set .@quest,5021;
+ } else {
+ set .@str$,"scales";
+ set .@quest,5022;
+ }
+ mes "[Raffle Researcher]";
+ mes "I'd better compare the two.";
+ mes "Please return to the bath";
+ mes "and look for the creature's "+.@str$+".";
+ mes "If you can, please bring me 10 of them.";
+ set ep14_1_muk,9;
+ erasequest 5020;
+ setquest .@quest;
+ close;
+ } else if (ep14_1_muk == 9) {
+ if (checkquest(5021) > -1 || checkquest(5022) > -1) {
+ if (checkquest(5021) > -1) {
+ set .@quest,5021;
+ set .@item,6387; //Teeth_Sample
+ setarray .@str$[0],"tooth","teeth";
+ } else {
+ set .@quest,5022;
+ set .@item,6388; //Scale_Sample
+ setarray .@str$[0],"scale","scales";
+ }
+ if (countitem(.@item) < 10) {
+ mes "[Raffle Researcher]";
+ mes "Haven't you found the unidentified creature's "+.@str$[1]+" yet?";
+ mes "Look carefully!";
+ mes "I'm certain that the creature";
+ mes "dropped his "+.@str$[1]+" somewhere.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You've collected all the "+.@str$[0]+" samples, finally.";
+ mes "As humans say,";
+ mes "I've been waiting forever for them.";
+ next;
+ if (checkweight(6380,1) == 0) {
+ mes "[Raffle Researcher]";
+ mes "I know that you've done a lot...";
+ mes "but you are carrying too many things.";
+ mes "Even though I want to give you pocket money, I can't.";
+ mes "Could you lighten your load and come back?";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "OK, I'll get to work right away.";
+ mes "If you have any business to attend to, do so.";
+ mes "The DNA analysis takes about 6 hours.";
+ mes "Why don't you go for a walk";
+ mes "and come back then?";
+ delitem .@item,10;
+ getitem 6380,1; //Mora_Coin
+ erasequest .@quest;
+ setquest 5023;
+ close;
+ } else if (checkquest(5023,PLAYTIME) == 0 || checkquest(5023,PLAYTIME) == 1) {
+ mes "[Raffle Researcher]";
+ mes "I'm still analyzing the DNA.";
+ mes "The DNA analysis takes about 6 hours.";
+ mes "Why don't you go for a walk and come back then?";
+ close;
+ } else {
+ switch(rand(1,6)) {
+ case 1:
+ case 3:
+ set .@quest,5021;
+ set .@item,6387; //Teeth_Sample
+ setarray .@str$[0],"tooth","teeth";
+ break;
+ case 2:
+ case 4:
+ set .@quest,5022;
+ set .@item,6388; //Scale_Sample
+ setarray .@str$[0],"scale","scales";
+ break;
+ case 5:
+ case 6:
+ break;
+ }
+ if (.@quest) {
+ mes "[Raffle Researcher]";
+ mes "This is not it.";
+ mes "The samples that you collected belonged to a normal species.";
+ emotion e_swt2;
+ next;
+ mes "[Raffle Researcher]";
+ mes "Must be because so many species of creatures";
+ mes "have been in the bath.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I'm sorry, but please re-collect the samples.";
+ mes "This time, the "+.@str$[1]+"... Yes.";
+ mes "Please bring the "+.@str$[0]+" samples.";
+ erasequest 5023;
+ setquest .@quest;
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "Great! These samples are surely";
+ mes "from the mysterious creature.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "According to the analysis,";
+ mes "The DNA is a mutant form of fish DNA.";
+ mes "I'm not sure how long this creature";
+ mes "has lived in the bath,";
+ mes "but this DNA is 70% evolved";
+ mes "from the original fish DNA.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Where did this fish come from?";
+ mes "How can it survive in the warm bath water?";
+ mes "After the DNA analysis,";
+ mes "my head is filled with even more questions.";
+ next;
+ mes "... ... ... ... ...";
+ emotion e_dots;
+ emotion e_dots,1;
+ next;
+ mes "[Raffle Researcher]";
+ mes "The village elders say";
+ mes "that the bath water comes from";
+ mes "the puddles around the village.";
+ next;
+ callsub L_CheckWeight;
+ mes "[Raffle Researcher]";
+ mes "If you get me a sample from the puddle";
+ mes "to the east, at 2 o'clock from here,";
+ mes "I'll tell you what to do next.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "You probably don't need to run around";
+ mes "like you did collecting";
+ mes "the bath water samples.";
+ set ep14_1_muk,10;
+ getitem 1092,1; //Empty_Cylinder
+ erasequest 5023;
+ setquest 5024;
+ next;
+ mes "[Raffle Researcher]";
+ mes "If you get all 4 puddle samples at once";
+ mes "it may be more convenient. However,";
+ mes "there's the risk of samples being damaged or mixed up.";
+ mes "Therefore, I'm going to send you one place at a time. Good luck.";
+ close;
+ }
+ } else if (ep14_1_muk == 10) {
+ if (countitem(6389) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You still haven't gone to collect the puddle sample?";
+ mes "Go to the puddle to the east of the village,";
+ mes "and collect a sample.";
+ mes "It's going to be at 2 o'clock from here.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You have the sample from the puddle to the east?";
+ mes "Great job, but it's no time to rest -";
+ mes "the research is almost done.";
+ next;
+ callsub L_CheckWeight;
+ mes "[Raffle Researcher]";
+ mes "Get me a sample from the puddle from the west.";
+ mes "It's not completely to the west...";
+ mes "The puddle should be at 7 o'clock";
+ mes "from the village.";
+ delitem 6389,1; //Puddle_R_Sample
+ set ep14_1_muk,11;
+ getitem 1092,1; //Empty_Cylinder
+ changequest 5024,5025;
+ next;
+ mes "[Raffle Researcher]";
+ mes "Take care not to damage the sample.";
+ mes "Good luck!";
+ close;
+ } else if (ep14_1_muk == 11) {
+ if (countitem(6389) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You still haven't gone to collect the puddle sample?";
+ mes "Go to the puddle to the west of the village,";
+ mes "and collect a sample.";
+ mes "It's going to be at 7 o'clock from here.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You have the sample from the puddle to the west?";
+ mes "Great job, but it's no time to rest -";
+ mes "the research is almost done.";
+ next;
+ callsub L_CheckWeight;
+ mes "[Raffle Researcher]";
+ mes "Get me a sample from the puddle from the south.";
+ mes "The puddle to the south";
+ mes "should be... at 6 o'clock from here.";
+ delitem 6389,1; //Puddle_R_Sample
+ set ep14_1_muk,12;
+ getitem 1092,1; //Empty_Cylinder
+ changequest 5025,5026;
+ next;
+ mes "[Raffle Researcher]";
+ mes "I can't emphasize this enough, even if I did it 1000000000000000000000 times.";
+ mes "Please take care that";
+ mes "the sample is not damaged.";
+ close;
+ } else if (ep14_1_muk == 12) {
+ if (countitem(6389) == 0) {
+ mes "You still haven't gone to collect the puddle sample?";
+ mes "Get me a sample from the puddle from the south.";
+ mes "The puddle to the south is located";
+ mes "at 6 o'clock from here.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "You know what I'm going to say?";
+ mes "Be careful.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You have the sample from the puddle to the south?";
+ mes "Now only the puddle to the north";
+ mes "remains to be sampled.";
+ next;
+ callsub L_CheckWeight;
+ mes "[Raffle Researcher]";
+ mes "Please get me the sample from the puddle to the north.";
+ mes "It's not completely to the north.";
+ mes "it's at 11 o'clock from the village.";
+ delitem 6389,1; //Puddle_R_Sample
+ set ep14_1_muk,13;
+ getitem 1092,1; //Empty_Cylinder
+ changequest 5026,5027;
+ next;
+ mes "[Raffle Researcher]";
+ mes "You know what I'm going to say?";
+ mes "Be careful.";
+ close;
+ } else if (ep14_1_muk == 13) {
+ if (countitem(6389) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You still haven't gone to collect the puddle sample?";
+ mes "Please get me a sample from the puddle to the north.";
+ mes "It's not exactly north of the village.";
+ mes "The puddle should be located at 11 o'clock";
+ mes "from the village.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You brought the last sample from the puddle from the north.";
+ mes "Great work. You've done really well.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Now, I'm going to do some research";
+ mes "with these samples,";
+ mes "looking at the relationship between";
+ mes "these puddles and the bath.";
+ next;
+ if (checkweight(6380,4) == 0) {
+ mes "[Raffle Researcher]";
+ mes "I know that you've done a lot...";
+ mes "but you are carrying too many things.";
+ mes "Even though I want to give you pocket money, I can't.";
+ mes "Could you lighten your load and come back?";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "If I finish this experiment...";
+ mes "There's probably nothing else to do. While I run the experiment,";
+ mes "why don't you go and entertain yourself?";
+ delitem 6389,1; //Puddle_R_Sample
+ set ep14_1_muk,14;
+ getitem 6380,4; //Mora_Coin
+ erasequest 5027;
+ setquest 5028;
+ next;
+ mes "[Raffle Researcher]";
+ mes "Comparison of the samples and the bath water";
+ mes "will take about 12 hours.";
+ close;
+ } else if (ep14_1_muk == 14) {
+ if (checkquest(5028,PLAYTIME) == 0 || checkquest(5028,PLAYTIME) == 1) {
+ mes "[Raffle Researcher]";
+ mes "What? You're here? Well...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "But the sample studies have not been finished.";
+ mes "This is an experiment for the final result,";
+ mes "so don't be too hasty.";
+ mes "I think the research will take about 12 hours.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Come back then.";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "You're here? Finally,";
+ mes "the experiment results are all in.";
+ mes "Do you want to look at the results?";
+ next;
+ switch(select("Actually, I don't want to.:Look at the results.")) {
+ case 1:
+ mes "[Raffle Researcher]";
+ mes "Good thinking. Actually, it may hurt";
+ mes "regular people's brains to look at it.";
+ mes "I suppose it's time for your reward";
+ mes "for helping me out so much.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Did I talk to you about the reward before the experiment?";
+ mes "That you won't be sorry that you helped out...";
+ next;
+ break;
+ case 2:
+ mes "[Raffle Researcher]";
+ mes "You're curious about the results? Really???";
+ mes "OK, here it is.";
+ next;
+ callsub L_ShowReport;
+ mes "[Raffle Researcher]";
+ mes "There are no volcanoes around the area";
+ mes "and no record of volcanoes in the past,";
+ mes "but the water temperature is that high...";
+ mes "Isn't it surprising?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "The ingredients are... yes.";
+ mes "There are certainly substances that are beneficial for you humans.";
+ mes "But, there are also substances";
+ mes "that are fatal to us Raffles,";
+ mes "or other races.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "And if you look at the electric conductivity,";
+ mes "it is quite higher than that of the average water.";
+ mes "My theory is that";
+ mes "this must be the cause of the mysterious power.";
+ mes "That's what I'm thinking about.";
+ mes "Anyhow.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "There is something at work that science cannot explain";
+ mes "in the bath water...";
+ mes "Take the unidentified creature, for instance.";
+ mes "How strange is it that a fish can live";
+ mes "in such warm water?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I'm not satisfied with the research results and conclusions.";
+ mes "I guess in the end,";
+ mes "it will remain a mystery...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I suppose it's time for your reward";
+ mes "for helping me out so much.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Did I talk to you about the reward before the experiment?";
+ mes "That you won't be sorry that you helped out...";
+ next;
+ break;
+ }
+ mes "[Raffle Researcher]";
+ mes "I was thinking about what you would want";
+ mes "for your reward... and I felt";
+ mes "a little... sad.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "... ... ... ...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "During our short time here together working on these projects,";
+ mes "I sent you all over the place.";
+ mes "It must've been hard, but you didn't complain at all.";
+ mes "And unlike some of the other guys I've had,";
+ mes "you never skipped work.";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I suppose I've grown fond of you,";
+ mes "so that it saddens me to say goodbye...";
+ next;
+ mes "[Raffle Researcher]";
+ mes "But thank you anyhow. I've been researching for a while,";
+ mes "but I've never met such an excellent research assistant as you.";
+ next;
+ if (MaxWeight - Weight < 100 || checkweight(1092,1) == 0) {
+ mes "[Raffle Researcher]";
+ mes "Hmm? By the way...";
+ mes "You are carrying too much weight.";
+ mes "Could it be because you are also sad";
+ mes "about parting ways?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "With this weight, I can't give you a reward!";
+ close;
+ }
+ mes "[Raffle Researcher]";
+ mes "The best research assistant in my life...";
+ mes "is you, "+strcharinfo(0)+"!!!";
+ set ep14_1_muk,15;
+ completequest 5028;
+ getexp 1000000,4000000;
+ getitem 6380,30; //Mora_Coin
+ next;
+ mes "[Raffle Researcher]";
+ mes "If we happen to run into each other again,";
+ mes "let's work on a research project once more.";
+ close;
+ } else if (ep14_1_muk == 15) {
+ mes "[Raffle Researcher]";
+ mes "Hmm? No?... What are you doing here?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "Could it be that you suddenly want to look at";
+ mes "the research report???";
+ next;
+ switch(select("Look at the report.:I came to say hello.")) {
+ case 1:
+ mes "[Raffle Researcher]";
+ mes "Haven't I shown it to you before?";
+ next;
+ mes "[Raffle Researcher]";
+ mes "... ... ... ...";
+ emotion e_dots;
+ next;
+ mes "[Raffle Researcher]";
+ mes "Maybe I haven't shown you.";
+ mes "Sorry about that. So you wanted to see it so badly";
+ mes "that you came back to see me?";
+ mes "Great! Here it is.";
+ next;
+ while(1) {
+ callsub L_ShowReport;
+ mes "[Raffle Researcher]";
+ mes "This concludes the report of";
+ mes "Mora Village's mysterious bath.";
+ mes "You want to look again?";
+ emotion e_what;
+ next;
+ switch(select("Look again.:Don't look again.")) {
+ case 1:
+ mes "[Raffle Researcher]";
+ mes "Sure... As you wish!!";
+ next;
+ break;
+ case 2:
+ mes "[Raffle Researcher]";
+ mes "Goodbye. Come by any time,";
+ mes "if you want to look at the results again.";
+ mes "You're always welcome here.";
+ close;
+ }
+ }
+ case 2:
+ mes "[Raffle Researcher]";
+ mes "Oh, You came to say hi. I see.";
+ mes "Long time no see, "+strcharinfo(0)+".";
+ next;
+ mes "[Raffle Researcher]";
+ mes "I've been telling you that I lucked out in picking you as my research assistant.";
+ mes "Come by any time,";
+ mes "if you want to look at the results again.";
+ mes "You're always welcome here.";
+ close;
+ }
+ } else {
+ mes "[Raffle Researcher]";
+ mes "Hmm? I'm Researcher Inffle.";
+ mes "Who are you?";
+ close;
+ }
+ end;
+L_ShowReport:
+ mes "[Experimental Results]";
+ mes "*** Researcher - Inffle";
+ mes "*** Research Assistant - "+strcharinfo(0);
+ mes "¡¡";
+ mes "<Research topic>";
+ mes "*** Bath of Mora Village";
+ mes "¡¡";
+ mes "<Aim>";
+ mes "To investigate the mysterious power of the bath water";
+ mes "and to find out ways to better utilize";
+ mes "the water.";
+ mes "¡¡";
+ mes "<Methods>";
+ mes "1. Obtained an unidentified DNA sample.";
+ mes "Obtained a sample of an unidentified DNA,";
+ mes "and collected more samples to look further into it.";
+ mes "¡¡";
+ mes "2. A comparison analysis on the unidentified DNA";
+ mes "Concluded that the DNA belongs to";
+ mes "an unidentified creature living in the bath water.";
+ mes "combine and result in";
+ mes "from the swordfish DNA.";
+ mes "¡¡";
+ mes "3. Research on the puddles around the village";
+ mes "From the four puddles around the village,";
+ mes "confirmed that the testing substances were";
+ mes "distributed evenly across the puddles.";
+ mes "It is thought that the four puddles";
+ mes "combine and result in";
+ mes "the mysterious power.";
+ mes "¡¡";
+ mes "<Material analysis>";
+ mes "*** Temperature ***** 33.5° ";
+ mes "*** PH ************ 9.8";
+ mes "*** Solid residues *** 176";
+ mes "*** K+ ************ 0,23";
+ mes "*** Ca++ ********** 1.83";
+ mes "*** Cl- *********** 26.2";
+ mes "*** HCO3- ********* 31.0";
+ mes "*** H2S *********** 1.7";
+ mes "*** Na++ ********** 51.9";
+ mes "*** Mg+ *********** 0.03";
+ mes "*** SO4- ********** 5.0";
+ mes "*** F ************* 12.8";
+ mes "*** SiO2 ********** 23.9";
+ mes "*** Li ************ 0.06";
+ mes "*** CO3+ ********** 22.8";
+ mes "*** Sr ************ 0.04";
+ mes "*** Ge ************ 0.004";
+ mes "*** T-solids ****** 165";
+ mes "*** Electric conductivity **** 500";
+ mes "*** Longitude ********** 4.6";
+ next;
+ return;
+L_CheckWeight:
+ if (MaxWeight - Weight < 100 || checkweight(1092,1) == 0) {
+ mes "[Raffle Researcher]";
+ mes "You are carrying too much weight.";
+ mes "I can't give you the sample tube.";
+ mes "Why don't you lighten your load and come back?";
+ close;
+ }
+ return;
+}
+
+mora,114,79,0 script Black Shadow#ep14_muk 844,{
+ if (checkweight(1201,1) == 0 || MaxWeight - Weight < 500) {
+ mes "^FF0000- Warning message -";
+ mes "- Hang on there!! -";
+ mes "- You have too many items -";
+ mes "- to receive any more items. -";
+ mes "- Please lighten your load -";
+ mes "- and try again. -^000000";
+ close;
+ }
+ if (BaseLevel < 100) {
+ mes "Something looks at you from head to toe, and disappears, mocking you.";
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ set .@playtime, checkquest(5029,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "You see a dark hole. As you show interest, something disappears quickly into the dark hole.";
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ } else if (.@playtime == 2)
+ erasequest 5029;
+ if (ep14_1_goki == 30) {
+ if (checkquest(5030) == -1 && checkquest(5031) == -1 && checkquest(5032) == -1 && checkquest(5033) == -1 && checkquest(5034) == -1) {
+ mes "[Unidentified creature]";
+ mes "Arrgghh!!!";
+ mes "Why you bother me.";
+ mes "You stop bullying me.";
+ next;
+ if(select("Bully anyway.:I'll stop.") == 1) {
+ emotion e_sob;
+ set ep14_1_goki,0;
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ mes "[Unidentified creature]";
+ mes "You... Good.";
+ mes "Everybody calls me monster.";
+ mes "Hit me. Bully. Me tired.";
+ next;
+ mes "[Fishee]";
+ mes "My name Fishee.";
+ mes "Dad name me.";
+ next;
+ mes "... ... ... ... ...";
+ next;
+ mes "He appears to be rambling.";
+ next;
+ mes "[Fishee]";
+ mes "Bully. Fun. Every day.";
+ mes "I talk. Still bully.";
+ next;
+ mes "[Fishee]";
+ mes "You... Good. Help Fishee?";
+ next;
+ if(select("Don't help.:Help.") == 1) {
+ emotion e_sob;
+ set ep14_1_goki,0;
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ mes "[Fishee]";
+ mes "You good. Good!";
+ next;
+ mes "[Fishee]";
+ mes "Me didn't live here.";
+ mes "Me lived puddle.";
+ mes "Puddle. Live there.";
+ next;
+ mes "[Fishee]";
+ mes "Me sleep weird.";
+ mes "Wake up one day.";
+ mes "Here, bath.";
+ next;
+ mes "[Fishee]";
+ mes "Don't know how go home.";
+ mes "Me just live here.";
+ mes "Grow big. Hole small.";
+ mes "Can't get in.";
+ next;
+ mes "[Fishee]";
+ mes "Me miss family. Me want to see family.";
+ mes "You good. How my family do.";
+ mes "Bring me. Good.";
+ next;
+ select("How would I know who is your family?");
+ mes "[Fishee]";
+ mes "Us fish stupid.";
+ mes "Stupid. But know family name.";
+ next;
+ mes "[Fishee]";
+ mes "Family know name Fishee. Family come.";
+ next;
+ mes "[Fishee]";
+ mes "Please. In puddle.";
+ mes "You tell me my family do okay.";
+ setquest 5030+rand(4); //5030,5031,5032,5033
+ close;
+ } else if (checkquest(5030) > -1 || checkquest(5031) > -1 || checkquest(5032) > -1 || checkquest(5033) > -1) {
+ mes "[Fishee]";
+ mes "Please. In puddle.";
+ mes "You tell me my family do okay.";
+ next;
+ mes "[Fishee]";
+ mes "You forgot me name?";
+ next;
+ if(select("Please tell me your name again!:I know your name.") == 1) {
+ mes "[Fishee]";
+ mes "Your memory, like fish.";
+ mes "Stupid. I talk.";
+ mes "My name Fishee, Fishee!!";
+ next;
+ }
+ mes "[Fishee]";
+ mes "Please. In puddle.";
+ mes "You tell me my family do okay.";
+ close;
+ } else if (checkquest(5034) > -1 && checkquest(5034) < 2) {
+ if (MaxWeight - Weight < 100 || checkweight(5792,1) == 0) {
+ mes "[Fishee]";
+ mes "You have lots.";
+ mes "I give. To you.";
+ mes "Empty bag. Come back.";
+ close;
+ }
+ mes "[Fishee]";
+ mes "You told me my family ok. Thank you.";
+ mes "I know thank you. Fish.";
+ mes "Re... Don't know word.";
+ next;
+ select("Perhaps... Reward??");
+ mes "[Fishee]";
+ mes "Yes. That. You good.";
+ mes "Smart. Give you reward.";
+ mes "I know thank you. Fish.";
+ next;
+ mes "[Fishee]";
+ mes "This, I got from bath.";
+ mes "No. Someone left it.";
+ mes "... ... Good guy. I give you.";
+ completequest 5034;
+ getitem 5792,1; //Fish_Pin
+ close;
+ } else if (checkquest(5034) == 2) {
+ mes "[Fishee]";
+ mes "You... I saw. Feeling. I saw. Feeling.";
+ mes "You... Name?";
+ next;
+ input .@inputstr$;
+ mes "[Fishee]";
+ mes .@inputstr$+" do.";
+ mes "No know. No remember..";
+ mes "Who.. you... are?";
+ close;
+ }
+ }
+ set .@weapon$, ((getequipisequiped(EQI_HAND_R))?getequipname(EQI_HAND_R):"Bare handed");
+ set .@pc_hp, 200;
+ set .@npc_hp, 200;
+ setarray .@skills$[0],"Midsection punch","Headbutt","Wiggle wiggle","Screw punch","Mumble muble";
+ mes "The unidentified creature is attacking. What will you do?";
+ next;
+ while(1) {
+ switch(select("Attack with a weapon.:Attack using a skill.:Attack using teeth.:Run away in fear.")) {
+ case 1: // Weapon
+ set .@p_damage,10;
+ set .@pc_attack, rand(1,10);
+ mes "["+strcharinfo(0)+"'s Attack]";
+ switch(.@pc_attack) {
+ // Miss.
+ case 3:
+ mes "You attempt to attack with your recent expensive purchase ^FF0000["+.@weapon$+"]^000000, but the unidentified creature rapidly dodged.";
+ break;
+ case 6:
+ mes "By mistake, you use ^FF0000["+.@weapon$+"]^000000 that Holgren has thrown your way to attack the unidentified creature, but the creature foresaw the attack and dodged.";
+ break;
+ case 9:
+ mes "You use your precious ^FF0000[+"+.@weapon$+"+]^000000 to attack the unidentified creature, but the creature pulled back and dodged your attack.";
+ break;
+ // Hit.
+ default:
+ specialeffect EF_HIT1;
+ set .@npc_hp, .@npc_hp - .@p_damage;
+ switch(.@pc_attack) {
+ case 1: set .@str$,"With your precious ^FF0000["+.@weapon$+"]^000000, you attacked the unidentified creature. The weapon pierced the creature's body."; break;
+ case 2: set .@str$,"By mistake, you use ^FF0000["+.@weapon$+"]^000000 that Holgren has thrown your way to attack the unidentified creature. With a thud, the unidentified creature's body is swaying."; break;
+ case 4: set .@str$,"You attempt to attack with your recent expensive purchase ^FF0000["+.@weapon$+"]^000000. You hit the unidentified creature's body with a thud."; break;
+ case 5: set .@str$,"You use a borrowed ^FF0000["+.@weapon$+"]^000000 to attack the unidentified creature, but the weapon slipped. But the weapon flies off and pierces the creature's body."; break;
+ case 7: set .@str$,"With your precious ^FF0000["+.@weapon$+"]^000000, you attacked the unidentified creature. It was as if the weapon was part of your body."; break;
+ case 8: set .@str$,"You use your lucky ^FF0000["+.@weapon$+"]^000000 to attack the unidentified creature."; break;
+ case 10: set .@str$,"You use a friend's ^FF0000["+.@weapon$+"]^000000 to attack the unidentified creature."; break;
+ }
+ mes .@str$+" ^FF0000["+.@p_damage+"]^000000 damage inflicted.";
+ break;
+ }
+ next;
+ break;
+ case 2: // Skill
+ set .@p_damage,20;
+ set .@pc_attack, rand(1,6);
+ set .@skillname$, .@skills$[rand(5)];
+ mes "["+strcharinfo(0)+"'s Attack]";
+ switch(.@pc_attack) {
+ // Miss.
+ case 2:
+ mes "You use skill ^0000FF["+.@skillname$+"]^000000 but you couldn't concentrate, and failed to use the skill properly.";
+ break;
+ case 4:
+ mes "You use skill ^0000FF["+.@skillname$+"]^000000 with all your might, but the unidentified creature dodged lightly and mocked you.";
+ break;
+ case 6:
+ mes "You use skill ^0000FF["+.@skillname$+"]^000000 to attack the creature, but he got out of sight and you failed to use the skill.";
+ break;
+ // Hit.
+ default:
+ specialeffect EF_BASH;
+ set .@npc_hp, .@npc_hp - .@p_damage;
+ switch(.@pc_attack) {
+ case 1: set .@str$, "With an attack so fast and furious, the creature is too stunned to move."; break;
+ case 3: set .@str$, "The creature dodged, but you foresaw his movements and targeted accurately."; break;
+ case 5: set .@str$, "Your skill flew in a perfect parabola and hit the creature exactly."; break;
+ }
+ mes "You use skill ^0000FF["+.@skillname$+"]^000000 to attack the unidentified creature. "+.@str$+" ^FF0000["+.@p_damage+"]^000000 damage inflicted.";
+ break;
+ }
+ next;
+ break;
+ case 3: // Tooth
+ set .@p_damage,50;
+ set .@pc_attack, rand(1,10);
+ mes "["+strcharinfo(0)+"'s Attack]";
+ if (.@pc_attack == 4 || .@pc_attack == 7) {
+ specialeffect EF_HIT1;
+ set .@npc_hp, .@npc_hp - .@p_damage;
+ mes "You use your well-groomed teeth to bite the unidentified creature hard until your teeth sink into its flesh. ^FF0000["+.@p_damage+"]^000000 damage inflicted.";
+ } else
+ mes "You use your steel-like teeth to bite the unidentified creature, but the frightened creature dodged. He stares at you with strange eyes.";
+ next;
+ break;
+ case 4: // Run
+ mes "You get scared of the unidentified creature, and attempt to run.";
+ next;
+ mes "["+strcharinfo(0)+"'s Escape]";
+ if (rand(1,2) == 1) {
+ mes "Fortunately, the unidentified creature did not come after you.";
+ close;
+ } else {
+ mes "When you attempt to run away, the unidentified creature sees you and attacks. You fail to escape.";
+ next;
+ specialeffect2 EF_HIT1;
+ mes "The creature slams you with its tail. It's so painful that a tear rolls out of your eyes. ^FF000010^000000 damaged received.";
+ set .@pc_hp, .@pc_hp - 10;
+ next;
+ // Unofficial check, but it's needed here.
+ callsub L_CheckPCAlive, .@pc_hp;
+ }
+ break;
+ }
+ if (.@npc_hp <= 0) {
+ mes "You won. The unidentified creature is unconscious.";
+ next;
+ if (checkquest(5016) > -1 && countitem(6385) == 0) {
+ mes "What will you do?";
+ next;
+ select("Look for the research tools.");
+ if (checkweight(6385,1) == 0) {
+ mes "You attempted to look for the research tools,";
+ mes "but you are carrying too many things.";
+ mes "You'd better lighten your load";
+ mes "and come back.";
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ mes "Found Researcher Raffle's ^0000FF Research tool ^000000.";
+ set ep14_1_goki, ep14_1_goki+1;
+ getitem 6385,1; //Research_Tool_Bag
+ setquest 5029;
+ next;
+ mes "The creature wakes up and disappears into the dark hole.";
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ } else if (checkquest(5017) > -1) {
+ mes "How will you bully the creature?";
+ next;
+ input .@inputstr$;
+ mes "You do ^0000FF"+.@inputstr$+"^000000 to bully the unidentified creature.";
+ next;
+ setquest 5029;
+ switch(ep14_1_muk) {
+ case 3:
+ mes "You bully the unidentified creature. This is kind of fun.";
+ break;
+ case 4:
+ mes "You bully the unidentified creature for the second time. It's definitely entertaining.";
+ break;
+ case 5:
+ mes "You bully the unidentified creature for the third time. It's fun, but now it is time to stop.";
+ changequest 5017,5018;
+ break;
+ }
+ set ep14_1_muk, ep14_1_muk+1;
+ set ep14_1_goki, ep14_1_goki+1;
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ } else {
+ mes "What will you do?";
+ next;
+ if(select("Check the body of the unidentified creature.:Leave.") == 2) {
+ setquest 5029;
+ set ep14_1_goki, ep14_1_goki+1;
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ if (rand(1,30) == 7) {
+ if (checkweight(6380,1) == 0) {
+ mes "While you were checking the body of the unidentified creature, your fingers touch something. You got lucky, but due to your heavy load you failed to obtain a ^0000FF Mora Coin^000000.";
+ set ep14_1_goki, ep14_1_goki+1;
+ setquest 5029;
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ mes "While you were checking the body of the unidentified creature, your fingers touch something. Lucky. Obtained a ^0000FF Mora Coin^000000.";
+ set ep14_1_goki, ep14_1_goki+1;
+ getitem 6380,1; //Mora_Coin
+ setquest 5029;
+ next;
+ mes "The creature wakes up and disappears into the dark hole.";
+ } else {
+ mes "As soon as you touch the creature's body, it wakes up and disappears into the dark hole.";
+ set ep14_1_goki, ep14_1_goki+1;
+ setquest 5029;
+ }
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ end;
+ }
+ }
+ mes "[ Current Progress ]";
+ mes strcharinfo(0)+" HP = "+.@pc_hp;
+ mes "Unidentified Creature HP = "+.@npc_hp;
+ next;
+ mes "[Attack of the unidentified creature]";
+ set .@npc_attack, rand(1,3);
+ switch(.@npc_attack) {
+ case 1:
+ set .@n_damage,10;
+ mes "The unidentified creature shoots a stream of bath water.";
+ break;
+ case 2:
+ set .@n_damage,20;
+ mes "The unidentified creature dashes at you with great speed. It appears to be attempting a headbutt.";
+ break;
+ case 3:
+ set .@n_damage,50;
+ mes "The unidentified creature runs at you with its teeth bared. It appears to be attempting to bite.";
+ break;
+ }
+ next;
+ mes "What will you do?";
+ next;
+ switch(select("... ... ...:Dodge.:Block.:It's too much. Run away.")) {
+ case 1:
+ switch(.@npc_attack) {
+ case 1:
+ specialeffect2 EF_ICEARROW;
+ mes "You stand still. The stream of water hits your face squarely. Your mind is clear in an instant. ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ case 2:
+ specialeffect2 EF_BASH;
+ mes "You stand still. The creature headbutts you squarely. Your mind is clear in an instant. ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ case 3:
+ specialeffect2 EF_HIT1;
+ mes "You stand still. While you were standing stupidly, the creature comes near and bites you mercilessly. Your mind is clear in an instant. ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ }
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ next;
+ break;
+ case 2:
+ switch(.@npc_attack) {
+ case 1:
+ set .@miss, rand(1,5);
+ mes "[Attack of the unidentified creature]";
+ switch(.@miss) {
+ // Miss.
+ case 1:
+ mes "The unidentified creature shoots a stream of water at you, but you dodge it easily by tilting your body.";
+ break;
+ case 3:
+ mes "The unidentified creature shoots a stream of water at you, but you dodge it while picking your nose.";
+ break;
+ // Hit.
+ default:
+ specialeffect2 EF_ICEARROW;
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ switch(.@miss) {
+ case 2: set .@str$,"face"; break;
+ case 4: set .@str$,"stomach"; break;
+ case 5: set .@str$,"arm"; break;
+ }
+ mes "The stream of water hits your "+.@str$+" squarely. ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ }
+ next;
+ break;
+ case 2:
+ set .@miss, rand(1,10);
+ mes "[Attack of the unidentified creature]";
+ switch(.@miss) {
+ // Miss.
+ case 1:
+ mes "The unidentified creature dashes at you attempting a headbutt, but you are not the one to succumb to such an attack.";
+ break;
+ case 3:
+ mes "The unidentified creature dashes at you attempting a headbutt, but you move slightly to dodge the attack.";
+ break;
+ case 5:
+ mes "The unidentified creature dashes at you attempting a headbutt, but you dodge the attack while picking your nose.";
+ break;
+ case 7:
+ mes "The unidentified creature dashes at you attempting a headbutt, but you dodge the attack easily.";
+ break;
+ // Hit.
+ default:
+ specialeffect2 EF_BASH;
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ switch(.@miss) {
+ case 2: set .@str$,"With a thud, you can feel intense pain."; break;
+ case 4: set .@str$,"*thud* Your back seems to give way."; break;
+ case 6: set .@str$,"The creature's attack hits you in the shoulder."; break;
+ case 8: set .@str$,"The attack is like an arrow."; break;
+ case 9: set .@str$,"The attack was fast and accurate."; break;
+ case 10: set .@str$,"It hits your hand with a thud."; break;
+ }
+ mes "The unidentified creature dashes at you and headbutts. "+.@str$+" ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ }
+ next;
+ break;
+ case 3:
+ set .@miss, rand(1,10);
+ mes "[Attack of the unidentified creature]";
+ switch(.@miss) {
+ // Miss.
+ case 1:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack sneering.";
+ break;
+ case 3:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack by moving slightly.";
+ break;
+ case 5:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack while stretching.";
+ break;
+ case 7:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack while counting Zenies.";
+ break;
+ case 8:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack lightly.";
+ break;
+ case 9:
+ mes "The unidentified creature runs at you with its teeth bared, but you dodge the attack sneering.";
+ break;
+ // Hit.
+ default:
+ specialeffect2 EF_HIT1;
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ switch(.@miss) {
+ case 2: set .@str$,"leg. Its sharp teeth penetrate your legs."; break;
+ case 4: set .@str$,"arm. Its sharp teeth penetrate your arm."; break;
+ case 6: set .@str$,"toe. You feel like your toe is being cut off."; break;
+ case 10: set .@str$,"finger. You feel like your finger is being cut off."; break;
+ }
+ mes "The unidentified creature runs at you with its teeth bared, and bites your "+.@str$+" ^FF0000["+.@n_damage+"]^000000 damage received.";
+ break;
+ }
+ next;
+ break;
+ }
+ break;
+ case 3:
+ set .@defend, rand(1,10);
+ switch(.@npc_attack) {
+ case 1:
+ if (.@defend == 3 || .@defend == 6) {
+ set .@n_damage, .@n_damage / 2;
+ specialeffect2 EF_GUARD;
+ } else
+ specialeffect2 EF_ICEARROW;
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ mes "[Defense of "+strcharinfo(0)+"]";
+ switch(.@defend) {
+ // Blocked.
+ case 3: set .@str$,"You block the stream of water with your strong butt. Feels refreshing. HP reduced only by half."; break;
+ case 6: set .@str$,"You block the stream of water with your strong hands. Your hands sting a little. HP reduced only by half."; break;
+ // Not blocked.
+ case 1: set .@str$,"You try to block the stream of water with your strong butt, but it's too late."; break;
+ case 2: set .@str$,"You try to block the stream of water with your big gut, but to no avail."; break;
+ case 4: set .@str$,"You try to block the stream of water with your gathered hands, but the creature targets a different place."; break;
+ case 5: set .@str$,"You try to block the stream of water with your strong hands, but you fail."; break;
+ case 7: set .@str$,"You try to block the stream of water with arms crossed, but you fold them wrong."; break;
+ case 8: set .@str$,"You try to block the stream of water with your rock-like head, but it was not possible."; break;
+ case 9: set .@str$,"You try to block the stream of water with your solid muscles, but it was not possible."; break;
+ case 10: set .@str$,"You try to block the stream of water with your strong feet, but your effort was wasted."; break;
+ }
+ mes .@str$+" ^FF0000["+.@n_damage+"]^000000 damage received.";
+ next;
+ break;
+ case 2:
+ if (.@defend == 1 || .@defend == 3 || .@defend == 5 || .@defend == 7) {
+ set .@n_damage, .@n_damage / 2;
+ specialeffect2 EF_GUARD;
+ } else
+ specialeffect2 EF_BASH;
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ mes "[Defense of "+strcharinfo(0)+"]";
+ switch(.@defend) {
+ // Blocked.
+ case 1: set .@str$,"You block the dash attack with your fat butt. Your butt is world class. HP reduced only by half."; break;
+ case 3: set .@str$,"You block the dash attack with your big gut. Your gut is world class. HP reduced only by half."; break;
+ case 5: set .@str$,"You block the dash attack with your strong hands. Your hands are world class. HP reduced only by half."; break;
+ case 7: set .@str$,"The unidentified creature dashed with lightning speed, but you easily block the attack with your big gut. Your gut is world class. HP reduced only by half."; break;
+ // Not blocked.
+ case 2: set .@str$,"You try to block the dash attack with your fat butt, but miss and get hit in an unmentionable place."; break;
+ case 4: set .@str$,"You try to block the dash attack with your big gut, but your gut isn't big enough to absorb the impact."; break;
+ case 6: set .@str$,"You try to block the dash attack with arms crossed, but you feel an incredible force."; break;
+ case 8: set .@str$,"You try to block the dash attack, to no avail."; break;
+ case 9: set .@str$,"You try to block the dash attack with your strong hands, to no avail."; break;
+ case 10: set .@str$,"You try to block the dash attack with your durable feet, but the pain woke you up."; break;
+ }
+ mes .@str$+" ^FF0000["+.@n_damage+"]^000000 damage received.";
+ next;
+ break;
+ case 3:
+ if (.@defend == 2 || .@defend == 4 || .@defend == 6 || .@defend == 8) {
+ set .@n_damage, .@n_damage / 2;
+ specialeffect2 EF_GUARD;
+ }
+ set .@pc_hp, .@pc_hp - .@n_damage;
+ mes "[Defense of "+strcharinfo(0)+"]";
+ switch(.@defend) {
+ // Blocked.
+ case 2: set .@str$,"but you block its attack with a branch nearby. HP reduced only by half."; break;
+ case 4: set .@str$,"but you block its attack with a weapon. HP reduced only by half."; break;
+ case 6: set .@str$,"but you block its attack using skill ^0000FFFriend Shield^000000. HP reduced only by half."; break;
+ case 8: set .@str$,"but you block its attack using a book you always carry around. HP reduced only by half."; break;
+ // Not blocked.
+ case 1: set .@str$,"and bites your arm."; break;
+ case 3: set .@str$,"and bites your leg."; break;
+ case 5: set .@str$,"and bites your shoulder."; break;
+ case 7: set .@str$,"and bites your finger."; break;
+ case 9: set .@str$,"and bites your finger."; break;
+ case 10: set .@str$,"and bites your toe."; break;
+ }
+ mes "The unidentified creature runs at you with its teeth bared, "+.@str$+" ^FF0000["+.@n_damage+"]^000000 damage received.";
+ next;
+ break;
+ }
+ break;
+ case 4:
+ mes "You get scared of the unidentified creature, and attempt to run.";
+ next;
+ mes "["+strcharinfo(0)+"'s Escape]";
+ if (rand(1,2) == 1) {
+ mes "Fortunately ^BF2C15Unidentified creature^000000";
+ mes "did not come after you.";
+ close;
+ } else {
+ mes "When you attempt to run away, the unidentified creature sees you and attacks.";
+ mes "You fail to escape.";
+ next;
+ mes "The creature slams you with its tail. It's so painful that a tear rolls out of your eyes. ^FF000010^000000 damaged received.";
+ set .@pc_hp, .@pc_hp - 10;
+ next;
+ }
+ break;
+ }
+ callsub L_CheckPCAlive, .@pc_hp;
+ mes "[ Current Progress ]";
+ mes strcharinfo(0)+" HP = "+.@pc_hp;
+ mes "Unidentified Creature HP = "+.@npc_hp;
+ next;
+ }
+ end;
+L_CheckPCAlive:
+ if (getarg(0) <= 0) {
+ mes "You lost to the unidentified creature. Your mind goes blank and you faint.";
+ next;
+ mes "You leave the bath with somebody's help.";
+ percentheal -99,0;
+ donpcevent "Black Shadow#ep14_muk::OnDisable";
+ warp "mora",31,132;
+ end;
+ }
+ return;
+OnInit:
+ disablenpc "Black Shadow#ep14_muk";
+ end;
+OnEnable:
+ enablenpc "Black Shadow#ep14_muk";
+ disablenpc "???#ep14_muk01";
+ disablenpc "???#ep14_muk02";
+ disablenpc "???#ep14_muk03";
+ disablenpc "???#ep14_muk04";
+ disablenpc "???#ep14_muk05";
+ end;
+OnDisable:
+ disablenpc "Black Shadow#ep14_muk";
+ donpcevent "Black Shadow#ep14_muk::OnFullon";
+ mapannounce "mora","You can now use the mysterious power of bath water.",bc_map,"0xFFFF00"; //FW_NORMAL 12 0 0
+ end;
+OnFullon:
+ donpcevent "???#ep14_muk01::OnReset";
+ donpcevent "???#ep14_muk02::OnReset";
+ donpcevent "???#ep14_muk03::OnReset";
+ donpcevent "???#ep14_muk04::OnReset";
+ donpcevent "???#ep14_muk05::OnReset";
+ end;
+}
+
+- script ???#mora -1,{
+ if (checkquest(5019) > -1) {
+ mes "You find an area emitting a distinct aura.";
+ mes "You may be able to collect bath water samples.";
+ mes "What will you do?";
+ next;
+ if(select("Collect samples.:Leave.") == 2) {
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ if (countitem(6386) >= 10) {
+ mes "You will not need additional samples.";
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ if (countitem(1092) == 0) {
+ mes "To obtain a sample, you need a sample tube.";
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ mes "Collecting samples.";
+ next;
+ progressbar "ffff00",3;
+ if (!rand(3)) {
+ if (checkweight(6386,1) == 0) {
+ mes "You have so many items";
+ mes "that it is difficult to collect samples.";
+ mes "You will have to lighten your load and come back.";
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ mes "Bath water sample collection complete.";
+ delitem 1092,1; //Empty_Cylinder
+ getitem 6386,1; //Bathtub_R_Sample
+ } else {
+ mes "Bath water sample collection failed.";
+ percentheal 5,5;
+ }
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ } else if (checkquest(5021) > -1 || checkquest(5022) > -1) {
+ if (checkquest(5021) > -1) {
+ set .@str$,"tooth";
+ set .@item,6387; //Teeth_Sample
+ } else {
+ set .@str$,"scale";
+ set .@item,6388; //Scale_Sample
+ }
+ mes "Something is shining in the water.";
+ mes "You may be able to collect the unidentified creature's "+.@str$+" samples.";
+ mes "What do you want to do?";
+ next;
+ if(select("Look further.:Leave.") == 2) {
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ if (countitem(.@item) >= 10) {
+ mes "You will not need additional samples.";
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ }
+ progressbar "ffff00",3;
+ if (!rand(3)) {
+ if (checkweight(.@item,1) == 0) {
+ mes "You have so many items";
+ mes "that it is difficult to collect samples.";
+ mes "You will have to lighten your load and come back.";
+ close;
+ }
+ mes "Obtained a "+.@str$+" sample";
+ mes "of the unidentified creature.";
+ getitem .@item,1;
+ } else
+ mes "You thought you saw it on the ground, but it was an illusion.";
+ close2;
+ donpcevent strnpcinfo(0)+"::OnDisable";
+ end;
+ } else {
+ mes "???";
+ next;
+ select("???");
+ mes "???";
+ close;
+ }
+ end;
+OnEnable:
+ enablenpc strnpcinfo(0);
+ stopnpctimer;
+ end;
+OnDisable:
+ disablenpc strnpcinfo(0);
+ initnpctimer;
+ end;
+OnReset:
+ if (rand(2))
+ donpcevent strnpcinfo(0)+"::OnEnable";
+ else
+ initnpctimer;
+ end;
+OnTimer10000:
+OnTimer20000:
+OnTimer30000:
+OnTimer40000:
+OnTimer50000:
+ if (rand(2))
+ donpcevent strnpcinfo(0)+"::OnEnable";
+ end;
+OnTimer60000:
+ donpcevent strnpcinfo(0)+"::OnEnable";
+ end;
+OnTouch:
+ if (checkquest(5034) == 2 || ep14_1_muk == 0 || rand(5)) {
+ percentheal 5,5;
+ end;
+ }
+ set .@playtime, checkquest(5029,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ percentheal 5,5;
+ end;
+ } else if (.@playtime == 2) {
+ erasequest 5029;
+ end;
+ } else {
+ mapannounce "mora","You can no longer use the mysterious power of the bath water.",bc_map,"0xFFFF00"; //FW_NORMAL 12 0 0
+ mes "^FF0000Something appeared.^000000";
+ mes "^FFFF00You cannot use the mysterious power of the bath water.^000000";
+ close2;
+ donpcevent "Black Shadow#ep14_muk::OnEnable";
+ end;
+ }
+}
+mora,108,86,0 duplicate(???#mora) ???#ep14_muk01 844,2,2
+mora,107,82,0 duplicate(???#mora) ???#ep14_muk02 844,2,2
+mora,113,84,0 duplicate(???#mora) ???#ep14_muk03 844,2,2
+mora,116,81,0 duplicate(???#mora) ???#ep14_muk04 844,2,2
+mora,118,86,0 duplicate(???#mora) ???#ep14_muk05 844,2,2
+
+- script #mora_puddle -1,{
+ set .@i, atoi(charat(strnpcinfo(2),9));
+
+ // This script has a lot of checks,
+ // so arrays are only set when used.
+ setarray .@quest1[1],5024,5025,5026,5027;
+ setarray .@dir$[1],"east","west","south","north";
+
+ if (checkquest(.@quest1[.@i]) > -1) {
+ if (countitem(6389) == 0) {
+ mes "This appears to be the puddle to the "+.@dir$[.@i];
+ mes "that the researcher talked about.";
+ mes "Will you collect a sample?";
+ next;
+ if(select("Collect a sample.:Don't collect a sample.") == 2)
+ close;
+ if (countitem(1092) == 0) {
+ mes "You have no empty sample tubes.";
+ close;
+ }
+ progressbar "ffff00",5;
+ if (checkweight(6389,1) == 0) {
+ mes "You have so many items";
+ mes "that it is difficult to collect samples.";
+ mes "You will have to lighten your load and come back.";
+ close;
+ }
+ mes "You have collected a sample from the puddle to the "+.@dir$[.@i]+".";
+ delitem 1092,1; //Empty_Cylinder
+ getitem 6389,1; //Puddle_R_Sample
+ close;
+ } else {
+ mes "You already have a sample.";
+ close;
+ }
+ }
+
+ set .@quest1[0], .@quest1[.@i];
+ set .@dir$[0], .@dir$[.@i];
+ deletearray .@quest1[.@i],1;
+ deletearray .@dir$[.@i],1;
+
+ if (checkquest(.@quest1[1]) > -1 || checkquest(.@quest1[2]) > -1 || checkquest(.@quest1[3]) > -1) {
+ for(set .@j,1; .@j<=3; set .@j,.@j+1) {
+ if (checkquest(.@quest1[.@j]) > -1)
+ break;
+ }
+ mes "This is not the puddle to the "+.@dir$[.@j]+".";
+ close;
+ }
+
+ setarray .@quest2[1],5030,5031,5032,5033;
+ set .@quest2[0], .@quest2[.@i];
+ deletearray .@quest2[.@i],1;
+
+ if (ep14_1_goki == 30 && checkquest(.@quest2[0]) > -1) {
+ mes "You arrived at the puddle to the "+.@dir$[0]+".";
+ mes "You should look for the unidentified creature's family.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Fish~ Fish~";
+ next;
+ mes "When you called out, an answer came";
+ mes "from the puddle.";
+ next;
+ mes "[???]";
+ mes "Who? Fisher? Go!";
+ next;
+ select("I'm looking for a particular fish's family.");
+ mes "[???]";
+ mes "Family? What be that fish name?";
+ next;
+ mes "What was the name of the unidentified creature?";
+ next;
+ input .@inputstr$;
+ if (.@inputstr$ != "Fishee") {
+ mes "[???]";
+ mes "No Family. "+.@inputstr$+" No.";
+ mes "You go.";
+ next;
+ mes "It appears that the unidentified creature's family is not here.";
+ close;
+ }
+ mes "[???]";
+ mes .@inputstr$+"? Oh... How...";
+ mes "Husband here come. Your son.";
+ mes "News here.";
+ next;
+ mes "Another creature from the puddle spoke to you.";
+ next;
+ mes "[????]";
+ mes "What? Missing son news?";
+ next;
+ mes "The two fish were very excited,";
+ mes "and their conversation was hard to follow.";
+ mes "You waited for them to calm down";
+ mes "and told them the full story.";
+ next;
+ mes "[Fishee's Dad]";
+ mes "Yes... At night, son";
+ mes "gone... Night fishers.";
+ mes "Son stupid. Caught. Dead. OK.";
+ next;
+ mes "[Fishee's Mom]";
+ mes "Fishee alive. Great. Great.";
+ next;
+ mes "[Fishee's Dad]";
+ mes "Yes... Human give son news.";
+ mes "Thanks. Son,";
+ mes "We okay. Happy. Here. You tell son.";
+ changequest .@quest2[0],5034;
+ close;
+ } else if (checkquest(5034) > -1 && checkquest(5034) < 2) {
+ mes "[Fishee's Dad]";
+ mes "Yes... Human give son news.";
+ mes "Thanks. Son,";
+ mes "We okay. Happy. Here. You tell son.";
+ close;
+ } else if (checkquest(.@quest2[1]) > -1 || checkquest(.@quest2[2]) > -1 || checkquest(.@quest2[3]) > -1) {
+ mes "You arrived at the puddle to the "+.@dir$[0]+".";
+ mes "You should look for the unidentified creature's family.";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Fish~ Fish~";
+ next;
+ mes "You yelled out loud for fish,";
+ mes "but there is no response.";
+ mes "I don't think anybody lives";
+ mes "in this puddle.";
+ close;
+ }
+ mes "You see a puddle with a calm surface.";
+ close;
+}
+bif_fild02,315,285,0 duplicate(#mora_puddle) Puddle#ep14_muk01 844
+bif_fild02,65,109,0 duplicate(#mora_puddle) Puddle#ep14_muk02 844
+bif_fild02,223,71,0 duplicate(#mora_puddle) Puddle#ep14_muk03 844
+bif_fild02,113,340,0 duplicate(#mora_puddle) Puddle#ep14_muk04 844
+
+// Mora Daily Quests :: dealer
+//============================================================
+mora,133,80,6 script Elephantine#pa0829 509,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Elephantine]";
+ mes "Hmm, you don't look reliable enough to perform tasks for me.";
+ close;
+ }
+ if (BaseLevel < 135) {
+ mes "[Elephantine]";
+ mes "Why don't you come back when you've grown stronger? I can't give you tasks when you're in your current state.";
+ close;
+ }
+ set .@playtime, checkquest(12230,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "[Elephantine]";
+ mes "I have no additional tasks available now. If I get some, I'll let you know when you come back.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[Elephantine]";
+ mes "Will you please check with ^990099Hotcha^000000";
+ mes "on the details of the previous task?";
+ close;
+ }
+ mes "[Elephantine]";
+ mes "Welcome.";
+ mes "I have some tasks for you - will you take a look at them?";
+ next;
+ if(select("What kind of tasks do you have for me?:Tell me about today's task.") == 1) {
+ mes "[Elephantine]";
+ mes "I'm the Head of the Volunteer Patrol of the Village of Mora. It didn't used to be like this, he he.";
+ next;
+ mes "[Elephantine]";
+ mes "Each day, I'll be giving you a quest to kill off monsters in the surrounding area.";
+ next;
+ mes "[Elephantine]";
+ mes "You might get a task that's far too difficult for you to take care of alone - in that case, try to get help from your fellow adventurers.";
+ close;
+ }
+ mes "[Elephantine]";
+ mes "Let me see what tasks we've got today... Hmm...";
+ next;
+ mes "[Elephantine]";
+ mes "How about this one?";
+ next;
+ switch(rand(1,5)) {
+ case 1:
+ setquest 12225;
+ setquest 12230;
+ mes "[Elephantine]";
+ mes "Strange insects that carry fruit on their backs roam this area - you must've seen them.";
+ next;
+ mes "[Elephantine]";
+ mes "I'd like you to take them out as you see them, before they try to sell anything to the adventurers lost in the forest.";
+ set .@n$,"Fruit-Carrying Insects";
+ break;
+ case 2:
+ setquest 12226;
+ setquest 12230;
+ mes "[Elephantine]";
+ mes "There have been a lot of reports lately about mantises disguised as flowers attacking creatures passing by.";
+ next;
+ mes "[Elephantine]";
+ mes "No casualties have been reported yet, but it wouldn't hurt to take precautions. Please deal with them appropriately.";
+ set .@n$,"Flowery Hunters";
+ break;
+ case 3:
+ setquest 12227;
+ setquest 12230;
+ mes "[Elephantine]";
+ mes "An adventurer was reported to have been attacked by little birds while gathering resources in the vicinity of Bifrost.";
+ next;
+ mes "[Elephantine]";
+ mes "They didn't look so ferocious... but the adventurer has asked me to get rid of them, so you'll have to do it.";
+ set .@n$,"Small but Ferocious...";
+ break;
+ case 4:
+ setquest 12228;
+ setquest 12230;
+ mes "[Elephantine]";
+ mes "I have qualms about this one, but somebody anonymously asked me to hunt down the naughty fairies.";
+ next;
+ mes "[Elephantine]";
+ mes "I don't know what grudge he has against the fairies, but a request is a request.";
+ set .@n$,"An Unknown Grudge";
+ break;
+ case 5:
+ setquest 12229;
+ setquest 12230;
+ mes "[Elephantine]";
+ mes "Would you believe it if I said there are balls of blonde hair rolling around? You wouldn't, would you?";
+ next;
+ mes "[Elephantine]";
+ mes "They don't seem so dangerous, but they are reported to steal books and sweets from adventurers. Please deal with them appropriately.";
+ set .@n$,"Blondie Ann";
+ break;
+ }
+ next;
+ mes "You have received the task ^005500"+.@n$+"^000000. Open and see the quest window for the details.";
+ close;
+}
+
+mora,115,98,8 script Hotcha#pa0829 509,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Hotcha]";
+ mes "Hmm, you don't look reliable enough for Elephantine's tasks.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[Hotcha]";
+ mes "This place is like a paradise for adventurers. Not for weak ones like you, though.";
+ close;
+ }
+ set .@playtime, checkquest(12230,PLAYTIME);
+ if (.@playtime == -1) {
+ mes "[Hotcha]";
+ mes "I see you haven't received";
+ mes "any tasks yet.";
+ mes "Go talk to Elephantine,";
+ mes "and Elephantine will give you";
+ mes "one of the countless tasks.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[Hotcha]";
+ mes "The time is up to complete the existing tasks.";
+ next;
+ mes "[Hotcha]";
+ mes "If you have any unfinished tasks in your quest log, they are considered 'failed' and removed from the log.";
+ next;
+ mes "[Hotcha]";
+ mes "Once they are removed, go talk to Elephantine and you can receive new tasks.";
+ for(set .@i,12225; .@i<=12229; set .@i,.@i+1) {
+ if (checkquest(.@i) > -1)
+ erasequest .@i;
+ }
+ erasequest 12230;
+ close;
+ }
+ mes "[Hotcha]";
+ mes "Welcome.";
+ mes "How may I help you?";
+ next;
+ select("I have completed a task.");
+ mes "Oh.";
+ mes "Have you?";
+ mes "Please wait a minute while I check the documents.";
+ next;
+
+ for(set .@i,12225; .@i<=12229; set .@i,.@i+1) {
+ if (checkquest(.@i,HUNTING) == 2) {
+ mes "[Hotcha]";
+ mes "Yes, I see you've completed the task. It has been confirmed as completed.";
+ erasequest .@i;
+ specialeffect2 EF_STEAL;
+ if (BaseLevel > 99)
+ getexp 0, ((JobLevel < 50)?JobLevel * JobLevel * (110/100) * 50:0);
+ else
+ getexp 0, ((JobLevel < 70)?JobLevel * JobLevel * (110/100) * 10:0);
+ getitem 6380,3; //Mora_Coin
+ close;
+ }
+ }
+
+ mes "[Hotcha]";
+ mes "Hmm... "+strcharinfo(0)+".";
+ mes "It may be a documentation error, but according to the documents, you have nothing to do with the tasks.";
+ close;
+}
+
+mora,119,103,4 script Bow-wow#pa0829 513,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Bow-wow]";
+ mes "I try to give tasks only to reliable people. You are......... no, never mind.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[Bow-wow]";
+ mes "You really have no clue. What could you do with such a weak body?";
+ close;
+ }
+ set .@playtime, checkquest(12241,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "[Bow-wow]";
+ mes "I have no additional tasks available now. If I get some, I'll let you know when you come back.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[Bow-wow]";
+ mes "Will you please check with the ^990099General Goods Dealer^000000";
+ mes "on the details of the previous task?";
+ close;
+ }
+ mes "[Bow-wow]";
+ mes "Welcome.";
+ mes "I have some tasks for you - will you take a look at them?";
+ next;
+ if(select("What kind of tasks do you have for me?:Tell me about today's task.") == 1) {
+ mes "[Bow-wow]";
+ mes "Here, we make all kinds of supplies for adventurers.";
+ next;
+ mes "[Bow-wow]";
+ mes "We accept raw materials for the supplies once a day.";
+ next;
+ mes "[Bow-wow]";
+ mes "Sometimes, we might ask for materials that are very difficult to obtain. In that case, try to get help from your fellow adventurers.";
+ close;
+ }
+ mes "[Bow-wow]";
+ mes "Let me see... what supplies are we making today...?";
+ next;
+ mes "[Bow-wow]";
+ mes "How about this one?";
+ next;
+ switch(rand(1,5)) {
+ case 1:
+ setquest 12231;
+ setquest 12241;
+ mes "[Bow-wow]";
+ mes "The adventurers here make sure to bring with them, on their exploration to dungeons, a preservative to keep their food fresh. Do you know what the preservative is made from?";
+ next;
+ mes "[Bow-wow]";
+ mes "*grin* None other than... Insect Feelers! The General Goods Dealer there asked me to get four of them. I personally would not eat it for all the world...";
+ set .@n$,"Material for the Preservative";
+ break;
+ case 2:
+ setquest 12232;
+ setquest 12241;
+ mes "[Bow-wow]";
+ mes "These days, it's common for adventurers here to make talismans to protect themselves on their dangerous adventures. Like a kind of insurance.";
+ next;
+ mes "[Bow-wow]";
+ mes "Immortal Hearts seem to be all the rage lately. The General Goods Merchant asked me to get five of them.";
+ set .@n$,"A Symbol of Resistance";
+ break;
+ case 3:
+ setquest 12233;
+ setquest 12241;
+ mes "[Bow-wow]";
+ mes "They need tons of Rotten Bandages for making first aid bandages. They must have run out of new materials.";
+ next;
+ mes "[Bow-wow]";
+ mes "The client is the General Goods Merchant over there. Three bunches of them will be enough.";
+ set .@n$,"Material for First Aid Kits";
+ break;
+ case 4:
+ setquest 12234;
+ setquest 12241;
+ mes "[Bow-wow]";
+ mes "Symbols of strong warriors give adventurers great support on their journeys. That's why Orcish Vouchers sell like hotcakes.";
+ next;
+ mes "[Bow-wow]";
+ mes "The General Goods Dealer asked me to get three Orcish Vouchers, which are to be used to make symbols of courage.";
+ set .@n$,"Symbols of Courage";
+ break;
+ case 5:
+ setquest 12235;
+ setquest 12241;
+ mes "[Bow-wow]";
+ mes "It seems to be rumored among adventurers that drinking powdered bones mixed with water helps boost their stamina.";
+ next;
+ mes "[Bow-wow]";
+ mes "The General Goods Dealer asked me to get three Skel-Bones, which are to be used to make tonic.";
+ set .@n$,"Good for Stamina...";
+ break;
+ }
+ next;
+ mes "You have received the task ^880088"+.@n$+"^000000. Open and see the quest window for the details.";
+ close;
+}
+
+mora,119,118,4 script General Good Dealer#pa0 516,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[General Good Dealer]";
+ mes "Hmm, you don't look reliable enough for Bow-wow's tasks.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[General Good Dealer]";
+ mes "What could you do with that fragile body? Go get some exercise.";
+ close;
+ }
+ set .@playtime, checkquest(12241,PLAYTIME);
+ if (.@playtime == -1) {
+ mes "[General Good Dealer]";
+ mes "I see you haven't received";
+ mes "any tasks yet.";
+ mes "Go talk to Bow-wow,";
+ mes "and Bow-wow will give you";
+ mes "one of the countless tasks.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[General Good Dealer]";
+ mes "The time is up to complete the existing tasks.";
+ next;
+ mes "[General Good Dealer]";
+ mes "If you have any unfinished tasks in your quest log, they are considered 'failed' and removed from the log.";
+ next;
+ mes "[General Good Dealer]";
+ mes "Once they are removed, go talk to Bow-wow and you can receive new tasks.";
+ for(set .@i,12231; .@i<=12235; set .@i,.@i+1) {
+ if (checkquest(.@i) > -1)
+ erasequest .@i;
+ }
+ erasequest 12241;
+ close;
+ }
+ mes "[General Good Dealer]";
+ mes "Welcome.";
+ mes "How may I help you?";
+ next;
+ select("I have completed a task.");
+ mes "[General Good Dealer]";
+ mes "Oh.";
+ mes "Have you?";
+ mes "Please wait a minute while I check the documents.";
+ next;
+
+ callsub L_CheckQuest,12231,928,4; //Insect_Feeler
+ callsub L_CheckQuest,12232,929,5; //Immortal_Heart
+ callsub L_CheckQuest,12233,930,1; //Rotten_Bandage
+ callsub L_CheckQuest,12234,931,3; //Orcish_Voucher
+ callsub L_CheckQuest,12235,932,3; //Skel_Bone
+
+ mes "[General Good Dealer]";
+ mes "Hmm... "+strcharinfo(0)+".";
+ mes "It may be a documentation error, but according to the documents, you have nothing to do with the tasks.";
+ close;
+
+L_CheckQuest:
+ if (checkquest(getarg(0)) > -1) {
+ if (countitem(getarg(1)) < getarg(2)) {
+ mes "[General Good Dealer]";
+ mes "The amount is not enough...";
+ close;
+ }
+ mes "[General Good Dealer]";
+ mes "I've received the items all right. It will be some time before I have another task for you, so why don't you visit the hot spring and relax?";
+ delitem getarg(1),getarg(2);
+ erasequest getarg(0);
+ specialeffect2 EF_STEAL;
+ if (BaseLevel > 99)
+ getexp 0, ((JobLevel < 50)?JobLevel * JobLevel * (110/100) * 50:0);
+ else
+ getexp 0, ((JobLevel < 70)?JobLevel * JobLevel * (110/100) * 10:0);
+ getitem 6380,1; //Mora_Coin
+ close;
+ }
+ return;
+}
+
+mora,124,108,7 script Woof-grrr#pa0829 514,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Woof-grrr]";
+ mes "Can you please keep away from me? You're getting in the way.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[Woof-grrr]";
+ mes "This place is not a nursery. Grow up and come back, and I'll gladly give you tasks.";
+ close;
+ }
+ set .@playtime, checkquest(12242,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "[Woof-grrr]";
+ mes "I have no additional tasks available now. If I get some, I'll let you know when you come back.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[Woof-grrr]";
+ mes "Will you please check with the ^990099Commodities Dealer^000000, standing across from me,";
+ mes "on the details of the previous task?";
+ close;
+ }
+ mes "[Woof-grrr]";
+ mes "Nice to see you.";
+ mes "I have some tasks for you - will you take a look at them?";
+ next;
+ if(select("What kind of tasks do you have for me?:Tell me about today's task.") == 1) {
+ mes "[Woof-grrr]";
+ mes "Bow-wow and I are in the same industry.";
+ next;
+ mes "[Woof-grrr]";
+ mes "We are a manufacturer of adventurers' supplies.";
+ next;
+ mes "[Woof-grrr]";
+ mes "My tasks won't be easy - you'd better prepare yourself.";
+ close;
+ }
+ mes "[Woof-grrr]";
+ mes "Hmm... What tasks are at hand today?";
+ next;
+ mes "[Woof-grrr]";
+ mes "Oh. This one looks good.";
+ next;
+ switch(rand(1,5)) {
+ case 1:
+ setquest 12236;
+ setquest 12242;
+ mes "[Woof-grrr]";
+ mes "Some people just hang their talismans around their necks, but more people choose to seal them in special cases and carry them on their bodies.";
+ next;
+ mes "[Woof-grrr]";
+ mes "Mementos serve as inspirations for designers of those cases. The Commodities Dealer across from me asked me to get two of them.";
+ set .@n$,"The Latest Trend in Talismans";
+ break;
+ case 2:
+ setquest 12237;
+ setquest 12242;
+ mes "[Woof-grrr]";
+ mes "Adventurers make sure to keep their talismans safe, because they could save their lives.";
+ next;
+ mes "[Woof-grrr]";
+ mes "The Commodities Dealer across from me seems to make protective cases out of Shells. I was asked to get three of them.";
+ set .@n$,"Keep Your Valuables Safe";
+ break;
+ case 3:
+ setquest 12238;
+ setquest 12242;
+ mes "[Woof-grrr]";
+ mes "Adventurers that go into the bushes of the Maze of the Hazy Forest always wear knee protectors.";
+ next;
+ mes "[Woof-grrr]";
+ mes "The Commodities Dealer across from me asked me to get three Scale Shells, which are to be used to make knee protectors.";
+ set .@n$,"Material for Knee Protectors";
+ break;
+ case 4:
+ setquest 12239;
+ setquest 12242;
+ mes "[Woof-grrr]";
+ mes "I have a task for you at hand, making a vaccine for possible poisonous insects.";
+ next;
+ mes "[Woof-grrr]";
+ mes "The Commodities Dealer across from me asked me to get two Venom Canines, which are to be used in the research of the substance.";
+ set .@n$,"Poison for Poison...";
+ break;
+ case 5:
+ setquest 12240;
+ setquest 12242;
+ mes "[Woof-grrr]";
+ mes "It seems they have run out of the material for adding non-slip soles to shoes.";
+ next;
+ mes "[Woof-grrr]";
+ mes "The Commodities Dealer across from me commissioned me to get five globs of Sticky Mucus.";
+ set .@n$,"Don't Slip and Fall";
+ break;
+ }
+ next;
+ mes "You have received the task ^880088"+.@n$+"^000000. Open and see the quest window for the details.";
+ close;
+}
+
+mora,127,112,4 script Commodities Dealer#pa08 518,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Commodities Dealer]";
+ mes "Well, Woof-grrr can't have given a weakling like you tasks.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[Commodities Dealer]";
+ mes "Go away! I can't concentrate on cataloging with you hanging around like that...";
+ close;
+ }
+ set .@playtime, checkquest(12242,PLAYTIME);
+ if (.@playtime == -1) {
+ mes "[Commodities Dealer]";
+ mes "I see you haven't received";
+ mes "any tasks yet.";
+ mes "Go talk to Woof-grrr,";
+ mes "and Woof-grrr will give you";
+ mes "one of the countless tasks.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "[Commodities Dealer]";
+ mes "The time is up to complete the existing tasks.";
+ next;
+ mes "[Commodities Dealer]";
+ mes "If you have any unfinished tasks in your quest log, they are considered 'failed' and removed from the log.";
+ next;
+ mes "[Commodities Dealer]";
+ mes "Once they are removed, go talk to Woof-grrr and you can receive new tasks.";
+ for(set .@i,12236; .@i<=12240; set .@i,.@i+1) {
+ if (checkquest(.@i) > -1)
+ erasequest .@i;
+ }
+ erasequest 12242;
+ close;
+ }
+ mes "[Commodities Dealer]";
+ mes "Welcome.";
+ mes "How may I help you?";
+ next;
+ select("I have completed a task.");
+ mes "[Commodities Dealer]";
+ mes "Oh.";
+ mes "Have you?";
+ mes "Please wait a minute while I check the documents.";
+ next;
+
+ callsub L_CheckQuest,12236,934,2; //Mementos
+ callsub L_CheckQuest,12237,935,3; //Shell
+ callsub L_CheckQuest,12238,936,3; //Scales_Shell
+ callsub L_CheckQuest,12239,937,2; //Posionous_Canine
+ callsub L_CheckQuest,12240,938,5; //Sticky_Mucus
+
+ mes "[Commodities Dealer]";
+ mes "Hmm... "+strcharinfo(0)+".";
+ mes "It may be a documentation error, but according to the documents, you have nothing to do with the tasks.";
+ close;
+
+L_CheckQuest:
+ if (checkquest(getarg(0)) > -1) {
+ if (countitem(getarg(1)) < getarg(2)) {
+ mes "[Commodities Dealer]";
+ mes "The amount is not enough...";
+ close;
+ }
+ mes "[Commodities Dealer]";
+ mes "I've received the items all right. I look forward to working with you again.";
+ delitem getarg(1),getarg(2);
+ erasequest getarg(0);
+ specialeffect2 EF_STEAL;
+ if (BaseLevel > 99)
+ getexp 0, ((JobLevel < 50)?JobLevel * JobLevel * (110/100) * 50:0);
+ else
+ getexp 0, ((JobLevel < 70)?JobLevel * JobLevel * (110/100) * 10:0);
+ getitem 6380,1; //Mora_Coin
+ close;
+ }
+ return;
+}
+
+mora,170,101,4 script Soul Guide#pa0829 515,{
+ if (checkweight(1201,1) == 0) {
+ mes "You have too many kinds of things with you to do that. Throw out some of them and try again.";
+ close;
+ }
+ if (MaxWeight - Weight < 1000) {
+ mes "You are carrying too much weight to do that. Reduce the weight and try again.";
+ close;
+ }
+ if (ep14_1_mistwoods < 10) {
+ mes "[Soul Guide]";
+ mes "Reliability is the primary quality needed in looking for lost souls. You don't look so reliable to me.";
+ close;
+ }
+ if (BaseLevel < 97) {
+ mes "[Soul Guide]";
+ mes "You need to have a strong spirit to do this task. I think you need a lot more discipline.";
+ close;
+ }
+ set .@playtime, checkquest(12253,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "You still have marks of the haunting souls on your body.";
+ next;
+ mes "You'll have to come back when the marks have disappeared.";
+ close;
+ } else if (.@playtime == 2) {
+ mes "You feel your mind has calmed down once again. You now have enough energy to go look for other souls, so talk to the Guide again.";
+ for(set .@i,12243; .@i<=12252; set .@i,.@i+1) {
+ if (checkquest(.@i) > -1)
+ erasequest .@i;
+ }
+ erasequest 12253;
+ close;
+ }
+ mes "[Soul Guide]";
+ mes "Welcome.";
+ mes "Are you ready?";
+ next;
+ if(select("What kind of tasks do you have for me?:Tell me about today's task.") == 1) {
+ mes "[Soul Guide]";
+ mes "My job is to gather the remains of the souls haunting the forest and put them to rest.";
+ next;
+ mes "[Soul Guide]";
+ mes "There are countless souls trapped in the Maze.";
+ next;
+ mes "[Soul Guide]";
+ mes "Help them get their long-deserved rest.";
+ close;
+ }
+ mes "[Soul Guide]";
+ mes "I'll show you the details of one of the lost souls.";
+ next;
+ switch(rand(1,10)) {
+ case 1:
+ setquest 12243;
+ setquest 12253;
+ mes "^660066Age 32. Comes from Midgard. Has been missing for 3 months since he went to the Maze of the Hazy Forest in order to collect the native plants. Low chance of survival.^000000";
+ set .@n$,"Tazar";
+ break;
+ case 2:
+ setquest 12244;
+ setquest 12253;
+ mes "^660066Age 19. Adventurer who came from a far, unknown place by ship. Been missing for 2 months since he went to explore the Maze dressed in thin tights, despite dissuasion of all Mora residents.";
+ mes "Even if he's alive, he would cause trouble to the rescue team.^000000";
+ set .@n$,"Niger";
+ break;
+ case 3:
+ setquest 12245;
+ setquest 12253;
+ mes "^660066Age unknown. Has some mental illness. Went alone in order to purify the Maze of the Hazy forest. He insists that he has good ancestry but no one trusts him.";
+ mes "Disappearance period : 12 years. Not much chance of survival.^000000";
+ set .@n$,"Messil";
+ break;
+ case 4:
+ setquest 12246;
+ setquest 12253;
+ mes "^660066Age 51. Used to be a big thief who stole famous swords from all around the world.";
+ mes "Went missing in the Maze after being pursued for running an illegal casino house which caused massive casualties in his final years. Low chance of survival.^000000";
+ set .@n$,"Noirit";
+ break;
+ case 5:
+ setquest 12247;
+ setquest 12253;
+ mes "^660066Age 22. An apprentice of an airship pilot. He has gone missing while drinking in Mora town, where he went for a break.";
+ mes "Rumor has it that he fled after signing somewhere. Disappearance period : 4 months. Low chance of survival.^000000";
+ set .@n$,"Pajama Sin";
+ break;
+ case 6:
+ setquest 12248;
+ setquest 12253;
+ mes "^660066Age Unknown. A female with long hair, dressed in black. Went on an expedition to the forest of the Maze in search of eternal life. Disappearance period : 3 months. Low chance of survival.^000000";
+ set .@n$,"Mendel";
+ break;
+ case 7:
+ setquest 12249;
+ setquest 12253;
+ mes "^660066Age around 50. The current Mayor of the Mora village. He ran away to the Forest of Maze after being caught pocketing profits by cheating the residents. Survival uncertain.^000000";
+ set .@n$,"Milebit";
+ break;
+ case 8:
+ setquest 12250;
+ setquest 12253;
+ mes "^660066Age 29. A young man with an unknown background.";
+ mes "Fled to the forest of maze after scamming 1200 Mora coins from Mora residents while pretending to start a lot of business and adapting himself in Mora. Survival uncertain.^000000";
+ set .@n$,"Kunmoon";
+ break;
+ case 9:
+ setquest 12251;
+ setquest 12253;
+ mes "^660066Age 34. Flirted with several women in Mora. Fled from Mora villagers to the forest of maze. Survival uncertain.^000000";
+ set .@n$,"Chaihokin";
+ break;
+ case 10:
+ setquest 12252;
+ setquest 12253;
+ mes "^660066Age Unknown. Disappered with coins which were joint controlled by the villagers. Low chance of survival.^000000";
+ set .@n$,"Tual";
+ break;
+ }
+ next;
+ mes "^990099Information on missing person "+.@n$+"^000000 has been found. Check your Quest Window for further information.";
+ specialeffect2 EF_STEAL;
+ close;
+}
+
+mora,131,165,7 script Wandering Customer#pa082 520,{
+ mes "[Wandering Customer]";
+ mes "I don't know whether to believe this art dealer... He made me stand here like this for days.... Ah... I feel dizzy.";
+ close;
+}
+
+mora,125,174,2 script A Random Customer#pa0829 520,{
+ mes "[Naive Customer]";
+ mes "I don't know when carving my pendant will be completed. Since he is a reliable art dealer, I suppose he won't break my pendant.";
+ close;
+}
+
+mora,104,172,7 script Victim#pa0829 520,{
+ mes "[Victim]";
+ mes "You Bastard! I want my rugged outwear! That was passed on to me by my father *SOB*";
+ next;
+ mes "^990099 It seems that he has gotten a great deal of damage from the art dealer.^000000";
+ close;
+}
+
+// Mora Daily Quests - Souls :: md_cadaver_in
+//============================================================
+// callfunc "mora_remains",<quest ID>,<NPC name>,<Mora Coin amount>,<reward ID>,<max reward amount>;
+function script mora_remains {
+ if (MaxWeight - Weight < 1000) {
+ mes "You have to make space in your inventory.";
+ close;
+ }
+ if (checkquest(getarg(0)) > -1) {
+ specialeffect2 EF_BLIND;
+ specialeffect2 EF_BEGINSPELL;
+ progressbar "ffff00",4;
+ erasequest getarg(0);
+ mes "These must be ["+getarg(1)+"]'s Remains. So carefully gather his remains.";
+ specialeffect2 EF_STEAL;
+ getitem getarg(3), rand(1,getarg(4));
+ if (rand(10)) {
+ next;
+ mes "You picked up "+getarg(2)+" Mora Coins next to the remains.";
+ specialeffect2 EF_STEAL;
+ getitem 6380,getarg(2); //Mora_Coin
+ }
+ close;
+ }
+ mes "You see traces of recent digging.";
+ close;
+}
+1@mist,132,100,0 script Tazaar's Remains#33 844,{ callfunc "mora_remains",12243,"Tazaar",6,526,3; } //Royal_Jelly
+1@mist,102,242,0 script Naizar's Remains#33 844,{ callfunc "mora_remains",12244,"Naizar",5,942,17; } //Yoyo_Tail
+1@mist,145,245,0 script Meshir's Remains#33 844,{ callfunc "mora_remains",12245,"Meshir",5,943,4; } //Solid_Shell
+1@mist,196,276,0 script Noirit's Remains#33 844,{ callfunc "mora_remains",12246,"Noirit",6,549,3; } //Nice_Sweet_Potato
+1@mist,304,327,0 script Pajama God's Remains#33 844,{ callfunc "mora_remains",12247,"Pajama God",5,945,18; } //Raccoon_Leaf
+1@mist,334,287,0 script Mendel's Remains#33 844,{ callfunc "mora_remains",12248,"Mendel",7,946,31; } //Snail's_Shell
+1@mist,330,177,0 script Milebit's Remains#33 844,{ callfunc "mora_remains",12249,"Milebit",5,7008,17; } //Stiff_Horn
+1@mist,284,84,0 script Kunmun's Remains#33 844,{ callfunc "mora_remains",12250,"Kunmun",4,6380,20; } //Mora_Coin
+1@mist,170,54,0 script Tsaihokin's Remains#33 844,{ callfunc "mora_remains",12251,"Tsaihokin",2,929,5; } //Immortal_Heart
+1@mist,118,43,0 script Tuar's Remains#33 844,{ callfunc "mora_remains",12252,"Tuar",3,6380,20; } //Mora_Coin
+
+// Knights of the Neighborhood :: mora_knight
+//============================================================
+mora,118,166,6 script Knights Chief#mo 525,{
+ mes "[Order of the Knights Chief]";
+ mes "We are the legendary order of the Neighborhood Knights, founded just five minutes ago!";
+ next;
+ mes "[Order of the Knights Chief]";
+ mes "We have four chiefs but no foot soldiers...";
+ mes "It's so frustrating!";
+ next;
+ mes "[Other Leaders]";
+ mes "Those other guys are all soldiers, but I'm the Boss!";
+ mes "I, the Head, will tell you what to do!";
+ mes "The Leader is the highest in the rank!";
+ mes "You talked me into joining the order, and now look at this!";
+ close;
+}
+
+mora,116,165,5 script Knights Boss#mo 524,{
+ set .@playtime, checkquest(1119,PLAYTIME);
+ if (.@playtime == 0 || .@playtime == 1) {
+ mes "[Order of the Knights Boss]";
+ mes "We've run out of Mora Coins.";
+ mes "Come back tomorrow!";
+ close;
+ } else if (.@playtime == 2)
+ erasequest 1119;
+ if (checkweight(6380,1) == 0) {
+ mes "[Order of the Knights Boss]";
+ mes "You have a lot of things with you!";
+ mes "Why not dump some of them in my pocket?";
+ close;
+ }
+ if (countitem(12561) >= 200) {
+ mes "[Order of the Knights Boss]";
+ mes "So you've brought back";
+ mes "200 ^FF0000Mysterious Seeds^000000.";
+ mes "Are you working under my command?";
+ mes "I'm so confused";
+ mes "because I've been sending random people on errands.";
+ next;
+ mes "[Order of the Knights Boss]";
+ mes "I'll reward you as I promised.";
+ mes "You made sure everyone knows";
+ mes "it's the Order of the Neighborhood Knights's work, right?";
+ setquest 1119;
+ delitem 12561,200; //Mysterious_Seed
+ getitem 6380,1; //Mora_Coin
+ close;
+ }
+ mes "[Order of the Knights Boss]";
+ mes "You have courage to";
+ mes "show up out of nowhere";
+ mes "and demand Mora Coins... how impressive!";
+ mes "You're more than qualified to be a soldier of the Order of the Neighborhood Knights.";
+ next;
+ mes "[Order of the Knights Boss]";
+ mes "Soldier, I need you to do something for me.";
+ mes "Go to the Hazy Forest and gather 200 ^FF0000Mysterious Seeds^000000!";
+ next;
+ switch(select("Yes, sir!:I challenge you to a duel!")) {
+ case 1:
+ mes "[Order of the Knights Boss]";
+ mes "Good attitude, "+strcharinfo(0)+" Soldier!";
+ mes "I'll reward you handsomely when you get back.";
+ next;
+ mes "[Other Bosses]";
+ mes "This is from me, the Chief!";
+ mes "Don't look down on the Head!";
+ mes "It's from me, the Leader!";
+ close;
+ case 2:
+ mes "[Order of the Knights Boss]";
+ mes "See the Chief if you want to have a duel!";
+ mes "I'm in charge of recruiting here.";
+ mes "Ahem...";
+ close;
+ }
+}
+
+mora,114,163,5 script Knights Head#mo 522,{
+ if (checkweight(6380,1) == 0) {
+ mes "[Order of the Knights Head]";
+ mes "You have a lot of things with you!";
+ mes "Why not dump some of them in my pocket?";
+ close;
+ }
+ if (ep14_1_rope < 11) {
+ mes "[Order of the Knights Head]";
+ mes "I hear that a Laphine called 'Lope'";
+ mes "went missing in the Hazy Forest.";
+ mes "I wish the Order of the Neighborhood Knights";
+ next;
+ mes "[Order of the Knights Head]";
+ mes "could help solve the case,";
+ mes "but we can't now";
+ mes "because we're not done cleaning the yard yet.";
+ mes "So, what I'm trying to say is";
+ next;
+ mes "[Order of the Knights Head]";
+ mes "why don't you go";
+ mes "and deal with the problem";
+ mes "on behalf of the Order of the Neighborhood Knights!";
+ next;
+ mes "[Order of the Knights Head]";
+ mes "I promise, as the Head of the Order,";
+ mes "that I'll give you more work";
+ mes "when you get back!";
+ next;
+ mes "[Other Heads]";
+ mes "I approve it, as the Chief.";
+ mes "You can thank me, the Boss.";
+ mes "You know the Leader is the boss here, right?";
+ close;
+ } else if (ep14_1_rope == 11) {
+ mes "[Order of the Knights Head]";
+ mes "So the missing Laphine";
+ mes "is dead?";
+ mes "I'm sorry to hear that.";
+ mes "I could have saved him.";
+ next;
+ mes "[Order of the Knights Head]";
+ mes "I hear that there are more ^0000FFLope's Clues^000000";
+ mes "in the Hazy Forest.";
+ mes "Go look for the rest of them";
+ mes "and bring back about 30 of them.";
+ mes "They will make great souvenirs.";
+ next;
+ switch(select("Am I doing all the work here or what?:Yes, sir!")) {
+ case 1:
+ mes "[Order of the Knights Head]";
+ mes "So you've noticed it?";
+ mes "Darn! I should have given you work earlier!";
+ close;
+ case 2:
+ mes "[Order of the Knights Head]";
+ mes "It was worthwhile to have trained you after all.";
+ mes "I'm proud of you,"+strcharinfo(0)+" Soldier!";
+ next;
+ mes "[Other Heads]";
+ mes "I think you'll make a great right-hand man, the Chief.";
+ mes "I feel rewarded, as the Boss.";
+ mes "As the Leader, I'm so pleased to see you all improve.";
+ set ep14_1_rope,12;
+ setquest 1118;
+ close;
+ }
+ } else if (ep14_1_rope == 12) {
+ if (countitem(6383) < 30) {
+ mes "[Order of the Knights Head]";
+ mes "You still haven't gathered";
+ mes "^0000FFLope's Clues^000000?";
+ mes "I feel somewhat good,";
+ mes "because that's about what I expected out of you.";
+ close;
+ }
+ mes "[Order of the Knights Head]";
+ mes "So you've brought back ^0000FFLope's Clues^000000.";
+ mes "Let's see ...";
+ mes "Assemble, assemble";
+ mes "Attach, attach";
+ next;
+ mes "[Lope's Letter]";
+ mes "...a traveler... attacked...";
+ mes "...under disguise... deadly poison...";
+ mes "...the Village... in danger...";
+ next;
+ mes "[Order of the Knights Head]";
+ mes "What on earth does this mean?";
+ mes "Well done, anyway.";
+ mes "Cheer up, you will be a great head of the Knights like myself, someday.";
+ next;
+ mes "[Other Heads]";
+ mes "I'm not so sure!";
+ mes "It's too much for us.";
+ mes "It's no use trying to do it.";
+ completequest 1118;
+ delitem 6383,30; //Clue_Of_Lope
+ set ep14_1_rope,13;
+ getitem 6380,2; //Mora_Coin
+ getexp 1000000,1000000;
+ close;
+ } else if (ep14_1_rope > 12) {
+ mes "[Order of the Knights Head]";
+ mes "We're in trouble.";
+ mes "We're sick of being knights.";
+ mes "We're thinking of forming";
+ mes "a circus troupe instead.";
+ mes "Are you interested in trying tightrope walking?";
+ next;
+ switch(select("Well, I could do a fire show.:This is so absurd.")) {
+ case 1:
+ mes "[Order of the Knights Head]";
+ mes "No, it's impossible.";
+ mes "I burned down a few houses";
+ mes "playing with fire.";
+ close;
+ case 2:
+ mes "[Order of the Knights Head]";
+ mes "That's the answer I expected.";
+ mes "I'm proud of myself.";
+ close;
+ }
+ close;
+ }
+ end;
+}
+
+mora,112,161,5 script Knights Leader#mo 523,{
+ mes "[Order of the Knights Leader]";
+ mes "I'm the Leader of the Order -";
+ mes "you can tell me.";
+ mes "What brings you here? Do you have some work for us?";
+ next;
+ mes "[Other Leaders]";
+ mes "Huh! I said the Boss is the boss!";
+ mes "No, the Chief is the best!";
+ mes "How rude you all are! I'm the Head here!";
+ emotion e_swt2,1;
+ close;
+}
diff --git a/npc/re/quests/skills/sage_skills.txt b/npc/re/quests/skills/sage_skills.txt
new file mode 100644
index 000000000..64ebe20e3
--- /dev/null
+++ b/npc/re/quests/skills/sage_skills.txt
@@ -0,0 +1,53 @@
+//===== Hercules Script ======================================
+//= Sage Quest Skill's related NPCs
+//===== By: ==================================================
+//= Zopokx
+//===== Current Version: =====================================
+//= 1.0
+//===== Description: =========================================
+//= Morocc/Payon Solution duplicate NPCs for Sage Quest Skill
+//===== Additional Comments: =================================
+//= 1.0 First version
+//============================================================
+
+moc_ruins,91,150,0 script Ponka-Hontas 93,{
+ mes "[Mage Guildsman]";
+ mes "Would you like a Solution? Then please give me 50 Zeny and at least 1 Empty Testtube.";
+ next;
+ if (select("Alright, Deal.:Nah, forget it.") == 1) {
+ mes "[Mage Guildsman]";
+ if (zeny < 50) {
+ mes "I'm sorry, but you don't have enough money to cover the 50 Zeny fee.";
+ close;
+ }
+ if (countitem(1092) == 0) {
+ mes "You can't carry liquids without using a bottle. Bring an Empty Test Tube the next time you see me.";
+ close;
+ }
+ delitem 1092,1; //Empty_Cylinder
+ set zeny,zeny-50;
+ getitem 1088,1; //Morocc_Potion
+ }
+ close;
+}
+
+pay_arche,122,100,0 script Dollshoi 88,{
+ mes "[Mage Guildsman]";
+ mes "You want a Solution? Hmm, give me 50 Zeny and at least 1 Empty Test Tube.";
+ next;
+ if (select("Alright, Deal.:Nah, forget it.") == 1) {
+ mes "[Mage Guildsman]";
+ if (Zeny < 50) {
+ mes "Hey! You don't have enough money to cover my 50 Zeny charge.";
+ close;
+ }
+ if (countitem(1092) == 0) {
+ mes "You can't carry solutions without a bottle! Bring me an Empty Test Tube.";
+ close;
+ }
+ delitem 1092,1; //Empty_Cylinder
+ set zeny,zeny-50;
+ getitem 1089,1; //Payon_Potion
+ }
+ close;
+}
diff --git a/npc/re/scripts.conf b/npc/re/scripts.conf
index dfe698752..e4dcd94ac 100644
--- a/npc/re/scripts.conf
+++ b/npc/re/scripts.conf
@@ -34,6 +34,7 @@ npc: npc/re/guides/guides_juno.txt
npc: npc/re/guides/guides_lighthalzen.txt
npc: npc/re/guides/guides_louyang.txt
npc: npc/re/guides/guides_lutie.txt
+npc: npc/re/guides/guides_mora.txt
npc: npc/re/guides/guides_morroc.txt
npc: npc/re/guides/guides_moscovia.txt
npc: npc/re/guides/guides_niflheim.txt
@@ -51,6 +52,7 @@ npc: npc/re/merchants/3rd_trader.txt
npc: npc/re/merchants/diamond.txt
npc: npc/re/merchants/flute.txt
npc: npc/re/merchants/inn.txt
+npc: npc/re/merchants/quivers.txt
npc: npc/re/merchants/refine.txt
npc: npc/re/merchants/renters.txt
npc: npc/re/merchants/shops.txt
@@ -85,5 +87,6 @@ npc: npc/re/quests/quests_izlude.txt
npc: npc/re/quests/quests_lighthalzen.txt
npc: npc/re/quests/quests_malangdo.txt
npc: npc/re/quests/quests_veins.txt
+npc: npc/re/quests/quests_mora.txt
npc: npc/re/quests/monstertamers.txt
-npc: npc/re/quests/quests_13_1.txt
+npc: npc/re/quests/quests_13_1.txt \ No newline at end of file
diff --git a/npc/re/warps/fields/bif_fild.txt b/npc/re/warps/fields/bif_fild.txt
index 3a32c3e75..ec9de1cf9 100644
--- a/npc/re/warps/fields/bif_fild.txt
+++ b/npc/re/warps/fields/bif_fild.txt
@@ -1,20 +1,44 @@
-//===== Hercules Script ======================================
+//===== rAthena Script =======================================
//= Bifrost Field Warp Script
//===== By: ==================================================
//= Chilly
//===== Current Version: =====================================
-//= 1.0
+//= 1.2
+//===== Compatible With: =====================================
+//= rAthena SVN
//===== Description: =========================================
//= Warp Points for Bifrost Field
//===== Additional Comments: =================================
//= 1.0 First Version.
+//= 1.1 Added official warp scripts. [Euphy]
+//= 1.2 Updated to match the official script. [Euphy]
//============================================================
splendide,275,390,0 warp bifrost_field0001 1,1,bif_fild01,316,50
-bif_fild01,318,48,0 warp bifrost_field0002 1,1,splendide,275,387
-bif_fild02,285,333,0 warp bifrost_field0003 1,1,mora,179,74
-mora,182,74,0 warp bifrost_field0004 1,1,bif_fild02,285,330
-bif_fild02,95,310,0 warp bifrost_field0005 1,1,mora,22,157
-mora,20,159,0 warp bifrost_field0006 1,1,bif_fild02,98,309
-bif_fild02,174,162,0 warp bifrost_field0007 1,1,mora,58,27
-mora,56,25,0 warp bifrost_field0008 1,1,bif_fild02,177,162
+bif_fild01,318,48,0 warp bifrost_field0002 1,1,splendide,271,382
+mora,182,74,0 warp bifrost_field0003 1,1,bif_fild02,286,327
+mora,20,159,0 warp bifrost_field0004 1,1,bif_fild02,99,308
+mora,56,25,0 warp bifrost_field0005 1,1,bif_fild02,176,162
+
+- script bifrost_field0000 -1,{
+ mes "At the end of the small path through the bright flower garden";
+ mes "is an entrance to something that looks like a small hill.";
+ next;
+ if(select("Knock-knock:Is this a wormhole?") == 1) {
+ mes "When you knock on the door-like thing just for fun,";
+ mes "the door clicks open and you feel some mysterious force pulling you inside.";
+ close2;
+ switch(atoi(charat(strnpcinfo(2),9))) {
+ case 1: warp "mora",179,74; end;
+ case 2: warp "mora",22,157; end;
+ case 3: warp "mora",58,27; end;
+ }
+ }
+ close;
+OnTouch:
+ specialeffect EF_LEVEL99_4;
+ end;
+}
+bif_fild02,285,332,0 duplicate(bifrost_field0000) Small Hole#ep14_mora1 844
+bif_fild02,95,310,0 duplicate(bifrost_field0000) Small Hole#ep14_mora2 844
+bif_fild02,174,162,0 duplicate(bifrost_field0000) Small Hole#ep14_mora3 844
diff --git a/src/char/char.c b/src/char/char.c
index f4212a076..97ad493b1 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -81,7 +81,8 @@ struct mmo_map_server {
uint32 ip;
uint16 port;
int users;
- unsigned short map[MAX_MAP_PER_SERVER];
+ unsigned short *map;
+ unsigned short maps;
} server[MAX_MAP_SERVERS];
int char_fd=-1;
@@ -2628,7 +2629,7 @@ int search_mapserver(unsigned short map, uint32 ip, uint16 port);
/// Initializes a server structure.
void mapif_server_init(int id)
{
- memset(&server[id], 0, sizeof(server[id]));
+ //memset(&server[id], 0, sizeof(server[id]));
server[id].fd = -1;
}
@@ -2655,7 +2656,7 @@ void mapif_server_reset(int id)
WBUFL(buf,4) = htonl(server[id].ip);
WBUFW(buf,8) = htons(server[id].port);
j = 0;
- for(i = 0; i < MAX_MAP_PER_SERVER; i++)
+ for(i = 0; i < server[id].maps; i++)
if (server[id].map[i])
WBUFW(buf,10+(j++)*4) = server[id].map[i];
if (j > 0) {
@@ -2725,8 +2726,11 @@ int parse_frommap(int fd)
case 0x2afa: // Receiving map names list from the map-server
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
return 0;
-
- memset(server[id].map, 0, sizeof(server[id].map));
+ if( server[id].map != NULL ) { aFree(server[id].map); server[id].map = NULL; }
+
+ server[id].maps = ( RFIFOW(fd, 2) - 4 ) / 4;
+ CREATE(server[id].map, unsigned short, server[id].maps);
+
j = 0;
for(i = 4; i < RFIFOW(fd,2); i += 4) {
server[id].map[j] = RFIFOW(fd,i);
@@ -3392,10 +3396,14 @@ int parse_frommap(int fd)
if( RFIFOREST(fd) < RFIFOW(fd,4) )
return 0;/* packet wasn't fully received yet (still fragmented) */
else {
- int sfd;/* stat server fd */
+ int sfd;/* stat server fd */
+ struct hSockOpt opt;
RFIFOSKIP(fd, 2);/* we skip first 2 bytes which are the 0x3008, so we end up with a buffer equal to the one we send */
- if( (sfd = make_connection(host2ip("stats.hercules.ws"),(uint16)25427,true) ) == -1 ) {
+ opt.silent = 1;
+ opt.setTimeo = 1;
+
+ if( (sfd = make_connection(host2ip("stats.hercules.ws"),(uint16)25427,&opt) ) == -1 ) {
RFIFOSKIP(fd, RFIFOW(fd,2) );/* skip this packet */
RFIFOFLUSH(fd);
break;/* connection not possible, we drop the report */
@@ -4275,7 +4283,6 @@ int parse_char(int fd)
server[i].ip = ntohl(RFIFOL(fd,54));
server[i].port = ntohs(RFIFOW(fd,58));
server[i].users = 0;
- memset(server[i].map, 0, sizeof(server[i].map));
session[fd]->func_parse = parse_frommap;
session[fd]->flag.server = 1;
realloc_fifo(fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK);
@@ -4486,12 +4493,12 @@ int check_connect_login_server(int tid, unsigned int tick, int id, intptr_t data
return 0;
ShowInfo("Attempt to connect to login-server...\n");
- login_fd = make_connection(login_ip, login_port, false);
- if (login_fd == -1)
- { //Try again later. [Skotlex]
+
+ if ( (login_fd = make_connection(login_ip, login_port, NULL)) == -1) { //Try again later. [Skotlex]
login_fd = 0;
return 0;
}
+
session[login_fd]->func_parse = parse_fromlogin;
session[login_fd]->flag.server = 1;
realloc_fifo(login_fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK);
@@ -4858,8 +4865,8 @@ int char_config_read(const char* cfgName)
return 0;
}
-void do_final(void)
-{
+void do_final(void) {
+ int i;
ShowStatus("Terminating...\n");
set_all_offline(-1);
@@ -4879,8 +4886,7 @@ void do_final(void)
online_char_db->destroy(online_char_db, NULL);
auth_db->destroy(auth_db, NULL);
- if( char_fd != -1 )
- {
+ if( char_fd != -1 ) {
do_close(char_fd);
char_fd = -1;
}
@@ -4888,6 +4894,10 @@ void do_final(void)
SQL->Free(sql_handle);
mapindex_final();
+ for(i = 0; i < MAX_MAP_SERVERS; i++ )
+ if( server[i].map )
+ aFree(server[i].map);
+
ShowStatus("Finished.\n");
}
@@ -4923,11 +4933,17 @@ void do_shutdown(void)
int do_init(int argc, char **argv) {
+ int i;
memset(&skillid2idx, 0, sizeof(skillid2idx));
+
+ for(i = 0; i < MAX_MAP_SERVERS; i++ )
+ server[i].map = NULL;
+
//Read map indexes
mapindex_init();
start_point.map = mapindex_name2id("new_zone01");
+
pincode_defaults();
char_config_read((argc < 2) ? CHAR_CONF_NAME : argv[1]);
diff --git a/src/char/char.h b/src/char/char.h
index b48ea359c..996a0e845 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -45,7 +45,7 @@ struct online_char_data {
DBMap* online_char_db; // int account_id -> struct online_char_data*
-#define MAX_MAP_SERVERS 30
+#define MAX_MAP_SERVERS 2
#define DEFAULT_AUTOSAVE_INTERVAL 300*1000
diff --git a/src/common/console.c b/src/common/console.c
index ba93b8e09..33d485497 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -85,6 +85,9 @@ CPCMD(exit) {
CPCMD(ers_report) {
ers_report();
}
+CPCMD(mem_report) {
+ memmgr_report(line?atoi(line):0);
+}
CPCMD(help) {
unsigned int i = 0;
for ( i = 0; i < console->cmd_list_count; i++ ) {
@@ -115,6 +118,7 @@ void console_load_defaults(void) {
CP_DEF(help),
CP_DEF_C(server),
CP_DEF_S(ers_report,server),
+ CP_DEF_S(mem_report,server),
CP_DEF_S(malloc_usage,server),
CP_DEF_S(exit,server),
};
@@ -227,8 +231,10 @@ void console_parse_sub(char *line) {
char *tok;
char sublist[CP_CMD_LENGTH * 5];
unsigned int i, len = 0;
+
memcpy(bline, line, 200);
tok = strtok(line, " ");
+
for ( i = 0; i < console->cmd_list_count; i++ ) {
if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 )
break;
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 592027f56..372991fbe 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -200,6 +200,8 @@ static struct unit_head_large *unit_head_large_first = NULL;
static struct block* block_malloc(unsigned short hash);
static void block_free(struct block* p);
static size_t memmgr_usage_bytes;
+static size_t memmgr_usage_bytes_t;
+
#define block2unit(p, n) ((struct unit_head*)(&(p)->data[ p->unit_size * (n) ]))
#define memmgr_assert(v) do { if(!(v)) { ShowError("Memory manager: assertion '" #v "' failed!\n"); } } while(0)
@@ -245,6 +247,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
/* At that time, the distinction by assigning NULL to unit_head.block */
if(hash2size(size_hash) > BLOCK_DATA_SIZE - sizeof(struct unit_head)) {
struct unit_head_large* p = (struct unit_head_large*)MALLOC(sizeof(struct unit_head_large)+size,file,line,func);
+ memmgr_usage_bytes_t += size+sizeof(struct unit_head_large);
if(p != NULL) {
p->size = size;
p->unit_head.block = NULL;
@@ -401,6 +404,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
head_large->next->prev = head_large->prev;
}
memmgr_usage_bytes -= head_large->size;
+ memmgr_usage_bytes_t -= head_large->size + sizeof(struct unit_head_large);
#ifdef DEBUG_MEMMGR
// set freed memory to 0xfd
memset(ptr, 0xfd, head_large->size);
@@ -457,6 +461,7 @@ static struct block* block_malloc(unsigned short hash)
} else {
/* Newly allocated space for the block */
p = (struct block*)MALLOC(sizeof(struct block) * (BLOCK_ALLOC), __FILE__, __LINE__, __func__ );
+ memmgr_usage_bytes_t += sizeof(struct block) * (BLOCK_ALLOC);
if(p == NULL) {
ShowFatalError("Memory manager::block_alloc failed.\n");
exit(EXIT_FAILURE);
@@ -650,6 +655,86 @@ static void memmgr_final (void)
}
#endif /* LOG_MEMMGR */
}
+/* [Ind/Hercules] */
+void memmgr_report (int extra) {
+ struct block *block = block_first;
+ struct unit_head_large *large = unit_head_large_first;
+ unsigned int count = 0, size = 0;
+ int j;
+ unsigned short msize = 1024;
+ struct {
+ const char *file;
+ unsigned short line;
+ unsigned int size;
+ unsigned int count;
+ } data[100];
+ memset(&data, 0, sizeof(data));
+
+ if( extra != 0 )
+ msize = extra;
+
+ while (block) {
+ if (block->unit_used) {
+ int i;
+ for (i = 0; i < block->unit_maxused; i++) {
+ struct unit_head *head = block2unit(block, i);
+ if( head->block != NULL && head->size > msize ) {
+ for( j = 0; j < 100; j++ ) {
+ if( data[j].file == head->file && data[j].line == head->line ) {
+ data[j].size += head->size;
+ data[j].count += 1;
+ break;
+ } else if( data[j].size == 0 ) {
+ data[j].file = head->file;
+ data[j].line = head->line;
+ data[j].size = head->size;
+ data[j].count += 1;
+ break;
+ }
+ }
+ size += (unsigned int)head->size;
+ count++;
+ }
+ }
+ }
+ block = block->block_next;
+ }
+
+ while(large) {
+ if( large->size > msize ) {
+ for( j = 0; j < 100; j++ ) {
+ if( data[j].file == large->unit_head.file && data[j].line == large->unit_head.line ) {
+ data[j].size += large->size;
+ data[j].count += 1;
+ break;
+ } else if( data[j].size == 0 ) {
+ data[j].file = large->unit_head.file;
+ data[j].line = large->unit_head.line;
+ data[j].size = large->size;
+ data[j].count += 1;
+ break;
+ }
+ }
+ size += (unsigned int)large->size;
+ count++;
+ }
+ large = large->next;
+ }
+ for( j = 0; j < 100; j++ ) {
+ if( data[j].size != 0 ) {
+ ShowMessage("[malloc] : "CL_WHITE"%s"CL_RESET":"CL_WHITE"%d"CL_RESET" %d instances => %.2f MB\n",data[j].file,data[j].line,data[j].count,(double)((data[j].size)/1024)/1024);
+ }
+ }
+ ShowMessage("[malloc] : reporting %u instances | %.2f MB\n",count,(double)((size)/1024)/1024);
+ ShowMessage("[malloc] : internal usage %.2f MB | %.2f MB\n",(double)((memmgr_usage_bytes_t-memmgr_usage_bytes)/1024)/1024,(double)((memmgr_usage_bytes_t)/1024)/1024);
+
+ if( extra ) {
+ ShowMessage("[malloc] : unit_head_large: %d bytes\n",sizeof(struct unit_head_large));
+ ShowMessage("[malloc] : unit_head: %d bytes\n",sizeof(struct unit_head));
+ ShowMessage("[malloc] : block: %d bytes\n",sizeof(struct block));
+ }
+
+}
static void memmgr_init (void)
{
@@ -677,8 +762,7 @@ void malloc_memory_check(void)
/// Returns true if a pointer is valid.
/// The check is best-effort, false positives are possible.
-bool malloc_verify_ptr(void* ptr)
-{
+bool malloc_verify_ptr(void* ptr) {
#ifdef USE_MEMMGR
return memmgr_verify(ptr) && MEMORY_VERIFY(ptr);
#else
@@ -687,8 +771,7 @@ bool malloc_verify_ptr(void* ptr)
}
-size_t malloc_usage (void)
-{
+size_t malloc_usage (void) {
#ifdef USE_MEMMGR
return memmgr_usage ();
#else
@@ -696,16 +779,16 @@ size_t malloc_usage (void)
#endif
}
-void malloc_final (void)
-{
+void malloc_final (void) {
#ifdef USE_MEMMGR
memmgr_final ();
#endif
MEMORY_CHECK();
}
-void malloc_init (void)
-{
+void malloc_init (void) {
+ memmgr_usage_bytes_t = 0;
+ memmgr_usage_bytes = 0;
#if defined(DMALLOC) && defined(CYGWIN)
// http://dmalloc.com/docs/latest/online/dmalloc_19.html
dmalloc_debug_setup(getenv("DMALLOC_OPTIONS"));
@@ -720,8 +803,7 @@ void malloc_init (void)
#endif
}
-void malloc_defaults()
-{
+void malloc_defaults(void) {
malloclib = &malloclib_s;
malloclib->init = malloc_init;
malloclib->final = malloc_final;
diff --git a/src/common/malloc.h b/src/common/malloc.h
index 34a26b56e..1b8e82bd9 100644
--- a/src/common/malloc.h
+++ b/src/common/malloc.h
@@ -80,5 +80,7 @@ struct malloc_interface {
void (*final) (void);
} malloclib_s;
+void memmgr_report (int extra);
+
struct malloc_interface *malloclib;
#endif /* _MALLOC_H_ */
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 172b27b15..c2fdfe43a 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -72,7 +72,6 @@
#define MAX_HOTKEYS 38
#endif
-#define MAX_MAP_PER_SERVER 1500 // Increased to allow creation of Instance Maps
#define MAX_INVENTORY 100
//Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well.
#define MAX_CHARS 9
@@ -104,7 +103,7 @@
#define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
#define MAX_GUILDLEVEL 50
#define MAX_GUARDIANS 8 // Local max per castle. [Skotlex]
-#define MAX_QUEST_DB 2400 // Max quests that the server will load
+#define MAX_QUEST_DB 2410 // Max quests that the server will load
#define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest
#define MAX_START_ITEMS 32 // Max number of items allowed to be given to a char whenever it's created. [mkbu95]
@@ -527,6 +526,10 @@ struct guild {
/* TODO: still used for something?|: */
unsigned short save_flag; // for TXT saving
+
+ unsigned short *instance;
+ unsigned short instances;
+
void *channel;
};
diff --git a/src/common/socket.c b/src/common/socket.c
index 5126d231b..0459004cc 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -280,9 +280,10 @@ void set_nonblocking(int fd, unsigned long yes)
ShowError("set_nonblocking: Failed to set socket #%d to non-blocking mode (%s) - Please report this!!!\n", fd, error_msg());
}
-void setsocketopts(int fd)
-{
+void setsocketopts(int fd, struct hSockOpt *opt) {
int yes = 1; // reuse fix
+ struct linger lopt;
+
#if !defined(WIN32)
// set SO_REAUSEADDR to true, unix only. on windows this option causes
// the previous owner of the socket to give up, which is not desirable
@@ -297,15 +298,22 @@ void setsocketopts(int fd)
// The RO protocol is mainly single-packet request/response, plus the FIFO model already does packet grouping anyway.
sSetsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&yes, sizeof(yes));
+ if( opt && opt->setTimeo ) {
+ struct timeval timeout;
+
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+
+ sSetsockopt(fd,SOL_SOCKET,SO_RCVTIMEO,(char *)&timeout,sizeof(timeout));
+ sSetsockopt(fd,SOL_SOCKET,SO_SNDTIMEO,(char *)&timeout,sizeof(timeout));
+ }
+
// force the socket into no-wait, graceful-close mode (should be the default, but better make sure)
//(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/closesocket_2.asp)
- {
- struct linger opt;
- opt.l_onoff = 0; // SO_DONTLINGER
- opt.l_linger = 0; // Do not care
- if( sSetsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&opt, sizeof(opt)) )
+ lopt.l_onoff = 0; // SO_DONTLINGER
+ lopt.l_linger = 0; // Do not care
+ if( sSetsockopt(fd, SOL_SOCKET, SO_LINGER, (char*)&lopt, sizeof(lopt)) )
ShowWarning("setsocketopts: Unable to set SO_LINGER mode for connection #%d!\n", fd);
- }
}
/*======================================
@@ -404,8 +412,7 @@ void flush_fifos(void)
/*======================================
* CORE : Connection functions
*--------------------------------------*/
-int connect_client(int listen_fd)
-{
+int connect_client(int listen_fd) {
int fd;
struct sockaddr_in client_address;
socklen_t len;
@@ -417,20 +424,18 @@ int connect_client(int listen_fd)
ShowError("connect_client: accept failed (%s)!\n", error_msg());
return -1;
}
- if( fd == 0 )
- {// reserved
+ if( fd == 0 ) { // reserved
ShowError("connect_client: Socket #0 is reserved - Please report this!!!\n");
sClose(fd);
return -1;
}
- if( fd >= FD_SETSIZE )
- {// socket number too big
+ if( fd >= FD_SETSIZE ) { // socket number too big
ShowError("connect_client: New socket #%d is greater than can we handle! Increase the value of FD_SETSIZE (currently %d) for your OS to fix this!\n", fd, FD_SETSIZE);
sClose(fd);
return -1;
}
- setsocketopts(fd);
+ setsocketopts(fd,NULL);
set_nonblocking(fd, 1);
#ifndef MINICORE
@@ -457,25 +462,22 @@ int make_listen_bind(uint32 ip, uint16 port)
fd = sSocket(AF_INET, SOCK_STREAM, 0);
- if( fd == -1 )
- {
+ if( fd == -1 ) {
ShowError("make_listen_bind: socket creation failed (%s)!\n", error_msg());
exit(EXIT_FAILURE);
}
- if( fd == 0 )
- {// reserved
+ if( fd == 0 ) { // reserved
ShowError("make_listen_bind: Socket #0 is reserved - Please report this!!!\n");
sClose(fd);
return -1;
}
- if( fd >= FD_SETSIZE )
- {// socket number too big
+ if( fd >= FD_SETSIZE ) { // socket number too big
ShowError("make_listen_bind: New socket #%d is greater than can we handle! Increase the value of FD_SETSIZE (currently %d) for your OS to fix this!\n", fd, FD_SETSIZE);
sClose(fd);
return -1;
}
- setsocketopts(fd);
+ setsocketopts(fd,NULL);
set_nonblocking(fd, 1);
server_address.sin_family = AF_INET;
@@ -503,7 +505,7 @@ int make_listen_bind(uint32 ip, uint16 port)
return fd;
}
-int make_connection(uint32 ip, uint16 port, bool silent) {
+int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
struct sockaddr_in remote_address;
int fd;
int result;
@@ -514,31 +516,29 @@ int make_connection(uint32 ip, uint16 port, bool silent) {
ShowError("make_connection: socket creation failed (%s)!\n", error_msg());
return -1;
}
- if( fd == 0 )
- {// reserved
+ if( fd == 0 ) {// reserved
ShowError("make_connection: Socket #0 is reserved - Please report this!!!\n");
sClose(fd);
return -1;
}
- if( fd >= FD_SETSIZE )
- {// socket number too big
+ if( fd >= FD_SETSIZE ) {// socket number too big
ShowError("make_connection: New socket #%d is greater than can we handle! Increase the value of FD_SETSIZE (currently %d) for your OS to fix this!\n", fd, FD_SETSIZE);
sClose(fd);
return -1;
}
- setsocketopts(fd);
+ setsocketopts(fd,opt);
remote_address.sin_family = AF_INET;
remote_address.sin_addr.s_addr = htonl(ip);
remote_address.sin_port = htons(port);
- if( !silent )
+ if( !( opt && opt->silent ) )
ShowStatus("Connecting to %d.%d.%d.%d:%i\n", CONVIP(ip), port);
result = sConnect(fd, (struct sockaddr *)(&remote_address), sizeof(struct sockaddr_in));
if( result == SOCKET_ERROR ) {
- if( !silent )
+ if( !( opt && opt->silent ) )
ShowError("make_connection: connect failed (socket #%d, %s)!\n", fd, error_msg());
do_close(fd);
return -1;
diff --git a/src/common/socket.h b/src/common/socket.h
index 4879cb109..b58cbdccf 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _SOCKET_H_
#define _SOCKET_H_
@@ -48,6 +49,9 @@
} \
} while(0)
+/* [Ind/Hercules] */
+#define RFIFO2PTR(fd,len) (void*)(session[fd]->rdata + len)
+
// buffer I/O macros
#define RBUFP(p,pos) (((uint8*)(p)) + (pos))
#define RBUFB(p,pos) (*(uint8*)RBUFP((p),(pos)))
@@ -94,6 +98,10 @@ struct socket_data
void* session_data; // stores application-specific data related to the session
};
+struct hSockOpt {
+ unsigned int silent : 1;
+ unsigned int setTimeo : 1;
+};
// Data prototype declaration
@@ -113,7 +121,7 @@ extern bool session_isActive(int fd);
// Function prototype declaration
int make_listen_bind(uint32 ip, uint16 port);
-int make_connection(uint32 ip, uint16 port, bool silent);
+int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt);
int realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size);
int realloc_writefifo(int fd, size_t addition);
int WFIFOSET(int fd, size_t len);
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 65da7aa24..796447633 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3940,7 +3940,7 @@ ACMD(mapinfo) {
for (i = 0; i < map[m_id].npc_num;)
{
nd = map[m_id].npc[i];
- switch(nd->ud.dir) {
+ switch(nd->dir) {
case 0: strcpy(direction, msg_txt(1101)); break; // North
case 1: strcpy(direction, msg_txt(1102)); break; // North West
case 2: strcpy(direction, msg_txt(1103)); break; // West
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 618679406..bfcd56d8e 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -9,6 +9,7 @@
#include "../common/showmsg.h"
#include "../common/socket.h"
#include "../common/strlib.h"
+#include "../common/conf.h"
#include "battleground.h"
#include "battle.h"
@@ -16,6 +17,7 @@
#include "map.h"
#include "npc.h"
#include "pc.h"
+#include "party.h"
#include "pet.h"
#include "homunculus.h"
#include "mercenary.h"
@@ -26,14 +28,12 @@
static DBMap* bg_team_db; // int bg_id -> struct battleground_data*
static unsigned int bg_team_counter = 0; // Next bg_id
-struct battleground_data* bg_team_search(int bg_id)
-{ // Search a BG Team using bg_id
+struct battleground_data* bg_team_search(int bg_id) { // Search a BG Team using bg_id
if( !bg_id ) return NULL;
return (struct battleground_data *)idb_get(bg_team_db, bg_id);
}
-struct map_session_data* bg_getavailablesd(struct battleground_data *bg)
-{
+struct map_session_data* bg_getavailablesd(struct battleground_data *bg) {
int i;
nullpo_retr(NULL, bg);
ARR_FIND(0, MAX_BG_MEMBERS, i, bg->members[i].sd != NULL);
@@ -95,8 +95,7 @@ int bg_team_join(int bg_id, struct map_session_data *sd)
guild->send_dot_remove(sd);
- for( i = 0; i < MAX_BG_MEMBERS; i++ )
- {
+ for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
if( (pl_sd = bg->members[i].sd) != NULL && pl_sd != sd )
clif->hpmeter_single(sd->fd, pl_sd->bl.id, pl_sd->battle_status.hp, pl_sd->battle_status.max_hp);
}
@@ -152,8 +151,7 @@ int bg_member_respawn(struct map_session_data *sd)
return 1; // Warped
}
-int bg_create(unsigned short mapindex, short rx, short ry, const char *ev, const char *dev)
-{
+int bg_create(unsigned short mapindex, short rx, short ry, const char *ev, const char *dev) {
struct battleground_data *bg;
bg_team_counter++;
@@ -226,12 +224,10 @@ int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
struct map_session_data *sd;
int i;
nullpo_ret(bg);
- for( i = 0; i < MAX_BG_MEMBERS; i++ )
- {
+ for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
if( (sd = bg->members[i].sd) == NULL )
continue;
- if( sd->bl.x != bg->members[i].x || sd->bl.y != bg->members[i].y )
- { // xy update
+ if( sd->bl.x != bg->members[i].x || sd->bl.y != bg->members[i].y ) { // xy update
bg->members[i].x = sd->bl.x;
bg->members[i].y = sd->bl.y;
clif->bg_xy(sd);
@@ -240,20 +236,496 @@ int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
return 0;
}
-int bg_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data)
-{
+int bg_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data) {
bg_team_db->foreach(bg_team_db, bg_send_xy_timer_sub, tick);
return 0;
}
+void bg_config_read(void) {
+ config_t bg_conf;
+ config_setting_t *data = NULL;
+ const char *config_filename = "conf/battlegrounds.conf"; // FIXME hardcoded name
+
+ if (conf_read_file(&bg_conf, config_filename))
+ return;
+
+ data = config_lookup(&bg_conf, "battlegrounds");
+
+ if (data != NULL) {
+ config_setting_t *settings = config_setting_get_elem(data, 0);
+ config_setting_t *arenas;
+ const char *delay_var;
+ int i, arena_count = 0, total = 0, offline = 0;
+
+ if( !config_setting_lookup_string(settings, "global_delay_var", &delay_var) )
+ delay_var = "BG_Delay_Tick";
+
+ safestrncpy(bg->gdelay_var, delay_var, BG_DELAY_VAR_LENGTH);
+
+ config_setting_lookup_int(settings, "maximum_afk_seconds", &bg->mafksec);
+
+ config_setting_lookup_bool(settings, "feature_off", &offline);
+
+ if( offline == 0 )
+ bg->queue_on = true;
+
+ if( (arenas = config_setting_get_member(settings, "arenas")) != NULL ) {
+ arena_count = config_setting_length(arenas);
+ CREATE( bg->arena, struct bg_arena *, arena_count );
+ for(i = 0; i < arena_count; i++) {
+ config_setting_t *arena = config_setting_get_elem(arenas, i);
+ config_setting_t *reward;
+ const char *aName, *aEvent, *aDelayVar;
+ int minLevel = 0, maxLevel = 0;
+ int prizeWin, prizeLoss, prizeDraw;
+ int minPlayers, maxPlayers, minTeamPlayers;
+ int maxDuration;
+ int fillup_duration, pregame_duration;
+
+ bg->arena[i] = NULL;
+
+ if( !config_setting_lookup_string(arena, "name", &aName) ) {
+ ShowError("bg_config_read: failed to find 'name' for arena #%d\n",i);
+ continue;
+ }
+
+ if( !config_setting_lookup_string(arena, "event", &aEvent) ) {
+ ShowError("bg_config_read: failed to find 'event' for arena #%d\n",i);
+ continue;
+ }
+
+ config_setting_lookup_int(arena, "minLevel", &minLevel);
+ config_setting_lookup_int(arena, "maxLevel", &maxLevel);
+
+ if( minLevel < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' minLevel\n",minLevel,aName);
+ minLevel = 0;
+ }
+ if( maxLevel > MAX_LEVEL ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' maxLevel\n",maxLevel,aName);
+ maxLevel = MAX_LEVEL;
+ }
+
+ if( !(reward = config_setting_get_member(settings, "reward")) ) {
+ ShowError("bg_config_read: failed to find 'reward' for arena '%s'/#%d\n",aName,i);
+ continue;
+ }
+
+ config_setting_lookup_int(reward, "win", &prizeWin);
+ config_setting_lookup_int(reward, "loss", &prizeLoss);
+ config_setting_lookup_int(reward, "draw", &prizeDraw);
+
+ if( prizeWin < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' reward:win\n",prizeWin,aName);
+ prizeWin = 0;
+ }
+ if( prizeLoss < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' reward:loss\n",prizeLoss,aName);
+ prizeLoss = 0;
+ }
+ if( prizeDraw < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' reward:draw\n",prizeDraw,aName);
+ prizeDraw = 0;
+ }
+
+ config_setting_lookup_int(arena, "minPlayers", &minPlayers);
+ config_setting_lookup_int(arena, "maxPlayers", &maxPlayers);
+ config_setting_lookup_int(arena, "minTeamPlayers", &minTeamPlayers);
+
+ if( minPlayers < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' minPlayers\n",minPlayers,aName);
+ minPlayers = 0;
+ }
+ if( maxPlayers > MAX_BG_MEMBERS * 2 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' maxPlayers, change #define MAX_BG_MEMBERS\n",maxPlayers,aName);
+ maxPlayers = 0;
+ }
+ if( minTeamPlayers < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' minTeamPlayers\n",minTeamPlayers,aName);
+ minTeamPlayers = 0;
+ }
+
+ if( !config_setting_lookup_string(arena, "delay_var", &aDelayVar) ) {
+ ShowError("bg_config_read: failed to find 'delay_var' for arena '%s'/#%d\n",aName,i);
+ continue;
+ }
+
+ config_setting_lookup_int(arena, "maxDuration", &maxDuration);
+
+ if( maxDuration < 0 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' maxDuration\n",maxDuration,aName);
+ maxDuration = 30;
+ }
+
+ config_setting_lookup_int(arena, "fillDuration", &fillup_duration);
+ config_setting_lookup_int(arena, "pGameDuration", &pregame_duration);
+
+ if( fillup_duration < 20 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' fillDuration, minimum has to be 20, defaulting to 20.\n",fillup_duration,aName);
+ fillup_duration = 20;
+ }
+
+ if( pregame_duration < 20 ) {
+ ShowWarning("bg_config_read: invalid %d value for arena '%s' pGameDuration, minimum has to be 20, defaulting to 20.\n",pregame_duration,aName);
+ pregame_duration = 20;
+ }
+
+
+ CREATE( bg->arena[i], struct bg_arena, 1 );
+
+ bg->arena[i]->id = i;
+ safestrncpy(bg->arena[i]->name, aName, NAME_LENGTH);
+ safestrncpy(bg->arena[i]->npc_event, aEvent, EVENT_NAME_LENGTH);
+ bg->arena[i]->min_level = minLevel;
+ bg->arena[i]->max_level = maxLevel;
+ bg->arena[i]->prize_win = prizeWin;
+ bg->arena[i]->prize_loss = prizeLoss;
+ bg->arena[i]->prize_draw = prizeDraw;
+ bg->arena[i]->min_players = minPlayers;
+ bg->arena[i]->max_players = maxPlayers;
+ bg->arena[i]->min_team_players = minTeamPlayers;
+ safestrncpy(bg->arena[i]->delay_var, aDelayVar, NAME_LENGTH);
+ bg->arena[i]->maxDuration = maxDuration;
+ bg->arena[i]->queue_id = -1;
+ bg->arena[i]->begin_timer = INVALID_TIMER;
+ bg->arena[i]->fillup_timer = INVALID_TIMER;
+ bg->arena[i]->pregame_duration = pregame_duration;
+ bg->arena[i]->fillup_duration = fillup_duration;
+
+ total++;
+ }
+ bg->arenas = arena_count;
+ }
+
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' arenas in '"CL_WHITE"%s"CL_RESET"'.\n", total, config_filename);
+ config_destroy(&bg_conf);
+ }
+}
+struct bg_arena *bg_name2arena (char *name) {
+ int i;
+ for(i = 0; i < bg->arenas; i++) {
+ if( strcmpi(bg->arena[i]->name,name) == 0 )
+ return bg->arena[i];
+ }
+ return NULL;
+}
+int bg_id2pos ( int queue_id, int account_id ) {
+ struct hQueue *queue = script->queue(queue_id);
+ if( queue ) {
+ int i;
+ for(i = 0; i < queue->items; i++ ) {
+ if( queue->item[i] == account_id ) {
+ return i;
+ }
+ }
+ }
+ return 0;
+}
+void bg_queue_player_cleanup(struct map_session_data *sd) {
+ if ( sd->bg_queue.client_has_bg_data ) {
+ clif->bgqueue_notice_delete(sd,BGQND_CLOSEWINDOW, sd->bg_queue.arena->id);
+ }
+ script->queue_remove(sd->bg_queue.arena->queue_id,sd->status.account_id);
+ sd->bg_queue.arena = NULL;
+ sd->bg_queue.ready = 0;
+ sd->bg_queue.client_has_bg_data = 0;
+ sd->bg_queue.type = 0;
+}
+void bg_match_over(struct bg_arena *arena, bool canceled) {
+ struct hQueue *queue = &script->hq[arena->queue_id];
+ int i;//, count = 0;
+
+ /* if( !canceled ) <check time/score> */
+
+ for( i = 0; i < queue->items; i++ ) {
+ struct map_session_data * sd = NULL;
+
+ if( ( sd = map_id2sd(queue->item[i]) ) ) {
+ bg->queue_pc_cleanup(sd);
+ clif->colormes(sd->fd,COLOR_RED,"BG Match Cancelled: not enough players");
+ }
+ }
-void do_init_battleground(void)
-{
+ bg->arena[i]->begin_timer = INVALID_TIMER;
+ bg->arena[i]->fillup_timer = INVALID_TIMER;
+ /* reset queue */
+}
+void bg_begin(struct bg_arena *arena) {
+ struct hQueue *queue = &script->hq[arena->queue_id];
+ int i, count = 0;
+
+ for( i = 0; i < queue->items; i++ ) {
+ struct map_session_data * sd = NULL;
+
+ if( ( sd = map_id2sd(queue->item[i]) ) ) {
+ if( sd->bg_queue.ready == 1 )
+ count++;
+ else
+ bg->queue_pc_cleanup(sd);
+ }
+ }
+
+ if( count < arena->min_players ) {
+ bg_match_over(arena,true);
+ } else {
+ ;
+ /* we split evenly? */
+ /* but if a party of say 10 joins, it cant be split evenly unless by luck there are 10 soloers in the queue besides them */
+ /* not sure how to split T_T needs more info */
+ }
+}
+int bg_begin_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ bg->begin(bg->arena[id]);
+ return 0;
+}
+
+void bg_queue_pregame(struct bg_arena *arena) {
+ struct hQueue *queue = &script->hq[arena->queue_id];
+ int i;
+
+ for( i = 0; i < queue->items; i++ ) {
+ struct map_session_data * sd = NULL;
+
+ if( ( sd = map_id2sd(queue->item[i]) ) ) {
+ clif->bgqueue_battlebegins(sd,arena->id,SELF);
+ }
+ }
+ arena->begin_timer = add_timer( gettick() + (arena->pregame_duration*1000), bg->begin_timer, arena->id, 0 );
+}
+int bg_fillup_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ bg->queue_pregame(bg->arena[id]);
+ return 0;
+}
+
+void bg_queue_check(struct bg_arena *arena) {
+ int count = script->hq[arena->queue_id].items;
+
+ if( count == arena->max_players ) {
+ if( arena->fillup_timer != INVALID_TIMER ) {
+ delete_timer(arena->fillup_timer,bg_fillup_timer);
+ arena->fillup_timer = INVALID_TIMER;
+ }
+ bg->queue_pregame(arena);
+ } else if( count >= arena->min_players && arena->fillup_timer == INVALID_TIMER ) {
+ arena->fillup_timer = add_timer( gettick() + (arena->fillup_duration*1000), bg->fillup_timer, arena->id, 0 );
+ }
+}
+void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type) {
+ enum BATTLEGROUNDS_QUEUE_ACK result = bg->can_queue(sd,arena,type);
+ struct hQueue *queue;
+ int i, count = 0;
+
+ if( arena->begin_timer != INVALID_TIMER ) {
+ clif->bgqueue_ack(sd,BGQA_FAIL_QUEUING_FINISHED,arena->id);
+ return;
+ }
+
+ if( result != BGQA_SUCCESS ) {
+ clif->bgqueue_ack(sd,result,arena->id);
+ return;
+ }
+
+ switch( type ) { /* guild/party already validated in can_queue */
+ case BGQT_PARTY: {
+ struct party_data *p = party_search(sd->status.party_id);
+ for( i = 0; i < MAX_PARTY; i++ ) {
+ if( !p->data[i].sd || p->data[i].sd->bg_queue.arena != NULL ) continue;
+ count++;
+ }
+ }
+ break;
+ case BGQT_GUILD:
+ for ( i=0; i<sd->guild->max_member; i++ ) {
+ if ( !sd->guild->member[i].sd || sd->guild->member[i].sd->bg_queue.arena != NULL )
+ continue;
+ count++;
+ }
+ break;
+ case BGQT_INDIVIDUAL:
+ count = 1;
+ break;
+ }
+
+ if( !(queue = script->queue(arena->queue_id)) || (queue->items+count) >= arena->max_players ) {
+ clif->bgqueue_ack(sd,BGQA_FAIL_PPL_OVERAMOUNT,arena->id);
+ return;
+ }
+
+ switch( type ) {
+ case BGQT_INDIVIDUAL:
+ sd->bg_queue.type = type;
+ sd->bg_queue.arena = arena;
+ sd->bg_queue.ready = 0;
+ script->queue_add(arena->queue_id,sd->status.account_id);
+ clif->bgqueue_joined(sd,script->hq[arena->queue_id].items);
+ clif->bgqueue_update_info(sd,arena->id,script->hq[arena->queue_id].items);
+ break;
+ case BGQT_PARTY: {
+ struct party_data *p = party_search(sd->status.party_id);
+ for( i = 0; i < MAX_PARTY; i++ ) {
+ if( !p->data[i].sd || p->data[i].sd->bg_queue.arena != NULL ) continue;
+ p->data[i].sd->bg_queue.type = type;
+ p->data[i].sd->bg_queue.arena = arena;
+ p->data[i].sd->bg_queue.ready = 0;
+ script->queue_add(arena->queue_id,p->data[i].sd->status.account_id);
+ clif->bgqueue_joined(p->data[i].sd,script->hq[arena->queue_id].items);
+ clif->bgqueue_update_info(p->data[i].sd,arena->id,script->hq[arena->queue_id].items);
+ }
+ }
+ break;
+ case BGQT_GUILD:
+ for ( i=0; i<sd->guild->max_member; i++ ) {
+ if ( !sd->guild->member[i].sd || sd->guild->member[i].sd->bg_queue.arena != NULL )
+ continue;
+ sd->guild->member[i].sd->bg_queue.type = type;
+ sd->guild->member[i].sd->bg_queue.arena = arena;
+ sd->guild->member[i].sd->bg_queue.ready = 0;
+ script->queue_add(arena->queue_id,sd->guild->member[i].sd->status.account_id);
+ clif->bgqueue_joined(sd->guild->member[i].sd,script->hq[arena->queue_id].items);
+ clif->bgqueue_update_info(sd->guild->member[i].sd,arena->id,script->hq[arena->queue_id].items);
+ }
+ break;
+ }
+
+ clif->bgqueue_ack(sd,BGQA_SUCCESS,arena->id);
+
+}
+enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type) {
+ int tick;
+ unsigned int tsec;
+ if ( sd->status.base_level > arena->max_level || sd->status.base_level < arena->max_level )
+ return BGQA_FAIL_LEVEL_INCORRECT;
+
+ if ( !(sd->class_&JOBL_2) ) /* TODO: maybe make this a per-arena setting, so users may make custom arenas like baby-only,whatever. */
+ return BGQA_FAIL_CLASS_INVALID;
+
+ tsec = (unsigned int)time(NULL);
+
+ if ( ( tick = pc_readglobalreg(sd, bg->gdelay_var) ) && tsec < tick ) {
+ char response[100];
+ if( (tick-tsec) > 60 )
+ sprintf(response, "You are a deserter! Wait %d minute(s) before you can apply again",(tick-tsec)/60);
+ else
+ sprintf(response, "You are a deserter! Wait %d seconds before you can apply again",(tick-tsec));
+ clif->colormes(sd->fd,COLOR_RED,response);
+ return BGQA_FAIL_DESERTER;
+ }
+
+ if ( ( tick = pc_readglobalreg(sd, arena->cooldown_variable) ) && tsec < tick ) {
+ char response[100];
+ if( (tick-tsec) > 60 )
+ sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %d minute(s)",(tick-tsec)/60);
+ else
+ sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %d seconds",(tick-tsec));
+ clif->colormes(sd->fd,COLOR_RED,response);
+ return BGQA_FAIL_COOLDOWN;
+ }
+
+ if( sd->bg_queue.arena != NULL )
+ return BGQA_DUPLICATE_REQUEST;
+
+ switch(type) {
+ case BGQT_GUILD:
+ if( !sd->guild || !sd->state.gmaster_flag )
+ return BGQA_NOT_PARTY_GUILD_LEADER;
+ else {
+ int i, count = 0;
+ for ( i=0; i<sd->guild->max_member; i++ ) {
+ if ( !sd->guild->member[i].sd || sd->guild->member[i].sd->bg_queue.arena != NULL )
+ continue;
+ count++;
+ }
+ if ( count < arena->min_team_players ) {
+ char response[100];
+ if( count != sd->guild->connect_member && sd->guild->connect_member >= arena->min_team_players )
+ sprintf(response, "Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d",arena->min_team_players);
+ else
+ sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d",arena->min_team_players);
+ clif->colormes(sd->fd,COLOR_RED,response);
+ return BGQA_FAIL_TEAM_COUNT;
+ }
+ }
+ break;
+ case BGQT_PARTY:
+ if( !sd->status.party_id )
+ return BGQA_NOT_PARTY_GUILD_LEADER;
+ else {
+ struct party_data *p;
+ if( (p = party_search(sd->status.party_id) ) ) {
+ int i, count = 0;
+ bool is_leader = false;
+
+ for(i = 0; i < MAX_PARTY; i++) {
+ if( !p->data[i].sd )
+ continue;
+ if( p->party.member[i].leader && sd == p->data[i].sd )
+ is_leader = true;
+ if( p->data[i].sd->bg_queue.arena == NULL )
+ count++;
+ }
+
+ if( !is_leader )
+ return BGQA_NOT_PARTY_GUILD_LEADER;
+
+ if( count < arena->min_team_players ) {
+ char response[100];
+ if( count != p->party.count && p->party.count >= arena->min_team_players )
+ sprintf(response, "Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d",arena->min_team_players);
+ else
+ sprintf(response, "Can't apply: not enough members in your team/party, minimum is %d",arena->min_team_players);
+ clif->colormes(sd->fd,COLOR_RED,response);
+ return BGQA_FAIL_TEAM_COUNT;
+ }
+
+ } else
+ return BGQA_NOT_PARTY_GUILD_LEADER;
+ }
+ break;
+ case BGQT_INDIVIDUAL:/* already did */
+ break;
+ default:
+ ShowDebug("bg_canqueue: unknown/unsupported type %d\n",type);
+ return BGQA_DUPLICATE_REQUEST;
+ }
+
+ return BGQA_SUCCESS;
+}
+void do_init_battleground(void) {
bg_team_db = idb_alloc(DB_OPT_RELEASE_DATA);
add_timer_func_list(bg_send_xy_timer, "bg_send_xy_timer");
add_timer_interval(gettick() + battle_config.bg_update_interval, bg_send_xy_timer, 0, 0, battle_config.bg_update_interval);
}
-void do_final_battleground(void)
-{
+void do_final_battleground(void) {
+ int i;
+
bg_team_db->destroy(bg_team_db, NULL);
+
+ for( i = 0; i < bg->arenas; i++ ) {
+ if( bg->arena[i] )
+ aFree(bg->arena[i]);
+ }
+
+ if( bg->arena )
+ aFree(bg->arena);
+}
+void battleground_defaults(void) {
+ bg = &bg_s;
+
+ bg->queue_on = false;
+
+ bg->mafksec = 0;
+ bg->arena = NULL;
+ bg->arenas = 0;
+ /* */
+ bg->name2arena = bg_name2arena;
+ bg->queue_add = bg_queue_add;
+ bg->can_queue = bg_canqueue;
+ bg->id2pos = bg_id2pos;
+ bg->queue_pc_cleanup = bg_queue_player_cleanup;
+ bg->begin = bg_begin;
+ bg->begin_timer = bg_begin_timer;
+ bg->queue_pregame = bg_queue_pregame;
+ bg->fillup_timer = bg_fillup_timer;
+ /* */
+ bg->config_read = bg_config_read;
}
diff --git a/src/map/battleground.h b/src/map/battleground.h
index c2b74a534..8fe9f3b77 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _BATTLEGROUND_H_
#define _BATTLEGROUND_H_
@@ -7,7 +8,21 @@
#include "../common/mmo.h" // struct party
#include "guild.h"
+/**
+ * Defines
+ **/
#define MAX_BG_MEMBERS 30
+#define BG_DELAY_VAR_LENGTH 30
+
+/**
+ * Enumerations
+ **/
+enum bg_queue_types {
+ BGQT_INVALID,
+ BGQT_INDIVIDUAL,
+ BGQT_PARTY,
+ BGQT_GUILD
+};
struct battleground_member_data {
unsigned short x, y;
@@ -42,4 +57,51 @@ int bg_team_warp(int bg_id, unsigned short mapindex, short x, short y);
int bg_member_respawn(struct map_session_data *sd);
int bg_send_message(struct map_session_data *sd, const char *mes, int len);
+struct bg_arena {
+ char name[NAME_LENGTH];
+ unsigned char id;
+ char npc_event[EVENT_NAME_LENGTH];
+ short min_level, max_level;
+ short prize_win, prize_loss, prize_draw;
+ short min_players;
+ short max_players;
+ short min_team_players;
+ char cooldown_variable[NAME_LENGTH];
+ char delay_var[NAME_LENGTH];
+ unsigned short maxDuration;
+ int queue_id;
+ int begin_timer;
+ int fillup_timer;
+ int game_timer;
+ unsigned short fillup_duration;
+ unsigned short pregame_duration;
+};
+
+/* battleground.c interface (incomplete) */
+struct battleground_interface {
+ bool queue_on;
+ /* */
+ int mafksec;
+ char gdelay_var[BG_DELAY_VAR_LENGTH];
+ /* */
+ struct bg_arena **arena;
+ unsigned char arenas;
+ /* */
+ struct bg_arena *(*name2arena) (char *name);
+ void (*queue_add) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+ enum BATTLEGROUNDS_QUEUE_ACK (*can_queue) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+ int (*id2pos) (int queue_id, int account_id);
+ void (*queue_pc_cleanup) (struct map_session_data *sd);
+ void (*begin) (struct bg_arena *arena);
+ int (*begin_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ void (*queue_pregame) (struct bg_arena *arena);
+ int (*fillup_timer) (int tid, unsigned int tick, int id, intptr_t data);
+ /* */
+ void (*config_read) (void);
+} bg_s;
+
+struct battleground_interface *bg;
+
+void battleground_defaults(void);
+
#endif /* _BATTLEGROUND_H_ */
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 06956e731..ee2e252c1 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -344,9 +344,9 @@ int chrif_sendmap(int fd) {
ShowStatus("Sending maps to char server...\n");
// Sending normal maps, not instances
- WFIFOHEAD(fd, 4 + instance_start * 4);
+ WFIFOHEAD(fd, 4 + instance->start_id * 4);
WFIFOW(fd,0) = 0x2afa;
- for(i = 0; i < instance_start; i++)
+ for(i = 0; i < instance->start_id; i++)
WFIFOW(fd,4+i*4) = map[i].index;
WFIFOW(fd,2) = 4 + i * 4;
WFIFOSET(fd,WFIFOW(fd,2));
@@ -1537,9 +1537,8 @@ static int check_connect_char_server(int tid, unsigned int tick, int id, intptr_
}
chrif_state = 0;
- char_fd = make_connection(char_ip, char_port,false);
- if (char_fd == -1)//Attempt to connect later. [Skotlex]
+ if ( ( char_fd = make_connection(char_ip, char_port,NULL) ) == -1) //Attempt to connect later. [Skotlex]
return 0;
session[char_fd]->func_parse = chrif_parse;
diff --git a/src/map/clif.c b/src/map/clif.c
index 2f69ce2fd..eb13a9515 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1333,7 +1333,7 @@ int clif_spawn(struct block_list *bl)
/**
* Hide NPC from maya purple card.
**/
- if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE))
+ if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->option&OPTION_INVISIBLE))
return 0;
clif->spawn_unit(bl,AREA_WOS);
@@ -1612,7 +1612,7 @@ void clif_move(struct unit_data *ud)
/**
* Hide NPC from maya purple card.
**/
- if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE))
+ if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->option&OPTION_INVISIBLE))
return;
if (ud->state.speed_changed) {
@@ -1666,15 +1666,14 @@ void clif_quitsave(int fd,struct map_session_data *sd) {
/// Notifies the client of a position change to coordinates on given map (ZC_NPCACK_MAPMOVE).
/// 0091 <map name>.16B <x>.W <y>.W
-void clif_changemap(struct map_session_data *sd, short map, int x, int y)
-{
+void clif_changemap(struct map_session_data *sd, short m, int x, int y) {
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x91));
WFIFOW(fd,0) = 0x91;
- mapindex_getmapname_ext(mapindex_id2name(map), (char*)WFIFOP(fd,2));
+ mapindex_getmapname_ext(map[m].cName ? map[m].cName : map[m].name, (char*)WFIFOP(fd,2));
WFIFOW(fd,18) = x;
WFIFOW(fd,20) = y;
WFIFOSET(fd,packet_len(0x91));
@@ -1683,8 +1682,7 @@ void clif_changemap(struct map_session_data *sd, short map, int x, int y)
/// Notifies the client of a position change to coordinates on given map, which is on another map-server (ZC_NPCACK_SERVERMOVE).
/// 0092 <map name>.16B <x>.W <y>.W <ip>.L <port>.W
-void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port)
-{
+void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) {
int fd;
nullpo_retv(sd);
fd = sd->fd;
@@ -2748,6 +2746,9 @@ void read_channels_config(void) {
} else {
unsigned char d = 0, dlen = strlen(irc_server);
char server[40];
+
+ memset(server, '\0', sizeof(server));
+
for(d = 0; d < dlen; d++) {
if(irc_server[d] == ':') {
memcpy(server, irc_server, d);
@@ -4344,7 +4345,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
/**
* Hide NPC from maya purple card.
**/
- if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE))
+ if(bl->type == BL_NPC && !((TBL_NPC*)bl)->chat_id && (((TBL_NPC*)bl)->option&OPTION_INVISIBLE))
return;
if ( ( ud = unit_bl2ud(bl) ) && ud->walktimer != INVALID_TIMER )
@@ -4601,16 +4602,13 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe
WBUFW(buf,2) = x;
WBUFW(buf,4) = y;
WBUFW(buf,6) = type;
- mapindex_getmapname_ext(map[m].name,(char*)WBUFP(buf,8));
+ mapindex_getmapname_ext(map[m].cName ? map[m].cName : map[m].name,(char*)WBUFP(buf,8));
- if( fd )
- {
+ if( fd ) {
WFIFOHEAD(fd,packet_len(0x192));
memcpy(WFIFOP(fd,0), buf, packet_len(0x192));
WFIFOSET(fd,packet_len(0x192));
- }
- else
- {
+ } else {
struct block_list dummy_bl;
dummy_bl.type = BL_NUL;
dummy_bl.x = x;
@@ -4799,7 +4797,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif->clearchar_skillunit((struct skill_unit *)bl,tsd->fd);
break;
case BL_NPC:
- if( !(((TBL_NPC*)bl)->sc.option&OPTION_INVISIBLE) )
+ if( !(((TBL_NPC*)bl)->option&OPTION_INVISIBLE) )
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
default:
@@ -4810,7 +4808,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
}
if (sd && sd->fd) { //sd is watching tbl go out of view.
if (((vd=status_get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS) &&
- !(tbl->type == BL_NPC && (((TBL_NPC*)tbl)->sc.option&OPTION_INVISIBLE)))
+ !(tbl->type == BL_NPC && (((TBL_NPC*)tbl)->option&OPTION_INVISIBLE)))
clif->clearunit_single(tbl->id,CLR_OUTSIGHT,sd->fd);
}
return 0;
@@ -6529,7 +6527,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
WBUFB(buf,14) = (p->party.member[i].online)?0:1;
memcpy(WBUFP(buf,15), p->party.name, NAME_LENGTH);
memcpy(WBUFP(buf,39), sd->status.name, NAME_LENGTH);
- mapindex_getmapname_ext(map[sd->bl.m].name, (char*)WBUFP(buf,63));
+ mapindex_getmapname_ext(map[sd->bl.m].cName ? map[sd->bl.m].cName : map[sd->bl.m].name, (char*)WBUFP(buf,63));
WBUFB(buf,79) = (p->party.item&1)?1:0;
WBUFB(buf,80) = (p->party.item&2)?1:0;
clif->send(buf,packet_len(0x1e9),&sd->bl,PARTY);
@@ -8485,7 +8483,7 @@ void clif_refresh(struct map_session_data *sd)
int i;
nullpo_retv(sd);
- clif->changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
+ clif->changemap(sd,sd->bl.m,sd->bl.x,sd->bl.y);
clif->inventorylist(sd);
if(pc_iscarton(sd)) {
clif->cartlist(sd);
@@ -9328,7 +9326,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if (sd->state.rewarp) { //Rewarp player.
sd->state.rewarp = 0;
- clif->changemap(sd, sd->mapindex, sd->bl.x, sd->bl.y);
+ clif->changemap(sd, sd->bl.m, sd->bl.x, sd->bl.y);
return;
}
@@ -9372,9 +9370,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( !(sd->sc.option&OPTION_INVISIBLE) ) { // increment the number of pvp players on the map
map[sd->bl.m].users_pvp++;
}
- if( map[sd->bl.m].instance_id ) {
- instance[map[sd->bl.m].instance_id].users++;
- instance_check_idle(map[sd->bl.m].instance_id);
+ if( map[sd->bl.m].instance_id >= 0 ) {
+ instances[map[sd->bl.m].instance_id].users++;
+ instance->check_idle(map[sd->bl.m].instance_id);
}
sd->state.debug_remove_map = 0; // temporary state to track double remove_map's [FlavioJS]
@@ -15573,48 +15571,61 @@ void clif_font(struct map_session_data *sd)
/*==========================================
* Instancing Window
*------------------------------------------*/
-int clif_instance(int instance_id, int type, int flag)
-{
- struct map_session_data *sd;
- struct party_data *p;
+int clif_instance(int instance_id, int type, int flag) {
+ struct map_session_data *sd = NULL;
unsigned char buf[255];
+ enum send_target target = PARTY;
+
+ switch( instances[instance_id].owner_type ) {
+ case IOT_NONE:
+ return 0;
+ case IOT_GUILD:
+ target = GUILD;
+ sd = guild->getavailablesd(guild->search(instances[instance_id].owner_id));
+ break;
+ case IOT_PARTY:
+ /* default is already PARTY */
+ sd = party_getavailablesd(party_search(instances[instance_id].owner_id));
+ break;
+ case IOT_CHAR:
+ target = SELF;
+ sd = map_id2sd(instances[instance_id].owner_id);
+ break;
+ }
- if( (p = party_search(instance[instance_id].party_id)) == NULL || (sd = party_getavailablesd(p)) == NULL )
+ if( !sd )
return 0;
-
+
switch( type ) {
case 1:
// S 0x2cb <Instance name>.61B <Standby Position>.W
// Required to start the instancing information window on Client
// This window re-appear each "refresh" of client automatically until type 4 is send to client.
WBUFW(buf,0) = 0x02CB;
- memcpy(WBUFP(buf,2),instance[instance_id].name,INSTANCE_NAME_LENGTH);
+ memcpy(WBUFP(buf,2),instances[instance_id].name,INSTANCE_NAME_LENGTH);
WBUFW(buf,63) = flag;
- clif->send(buf,packet_len(0x02CB),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CB),&sd->bl,target);
break;
case 2:
// S 0x2cc <Standby Position>.W
// To announce Instancing queue creation if no maps available
WBUFW(buf,0) = 0x02CC;
WBUFW(buf,2) = flag;
- clif->send(buf,packet_len(0x02CC),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CC),&sd->bl,target);
break;
case 3:
case 4:
// S 0x2cd <Instance Name>.61B <Instance Remaining Time>.L <Instance Noplayers close time>.L
WBUFW(buf,0) = 0x02CD;
- memcpy(WBUFP(buf,2),instance[instance_id].name,61);
- if( type == 3 )
- {
- WBUFL(buf,63) = (uint32)instance[instance_id].progress_timeout;
+ memcpy(WBUFP(buf,2),instances[instance_id].name,61);
+ if( type == 3 ) {
+ WBUFL(buf,63) = instances[instance_id].progress_timeout;
WBUFL(buf,67) = 0;
- }
- else
- {
+ } else {
WBUFL(buf,63) = 0;
- WBUFL(buf,67) = (uint32)instance[instance_id].idle_timeout;
+ WBUFL(buf,67) = instances[instance_id].idle_timeout;
}
- clif->send(buf,packet_len(0x02CD),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CD),&sd->bl,target);
break;
case 5:
// S 0x2ce <Message ID>.L
@@ -15626,7 +15637,7 @@ int clif_instance(int instance_id, int type, int flag)
WBUFW(buf,0) = 0x02CE;
WBUFL(buf,2) = flag;
//WBUFL(buf,6) = EnterLimitDate;
- clif->send(buf,packet_len(0x02CE),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CE),&sd->bl,target);
break;
}
return 0;
@@ -15634,24 +15645,24 @@ int clif_instance(int instance_id, int type, int flag)
void clif_instance_join(int fd, int instance_id)
{
- if( instance[instance_id].idle_timer != INVALID_TIMER ) {
+ if( instances[instance_id].idle_timer != INVALID_TIMER ) {
WFIFOHEAD(fd,packet_len(0x02CD));
WFIFOW(fd,0) = 0x02CD;
- memcpy(WFIFOP(fd,2),instance[instance_id].name,61);
+ memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
WFIFOL(fd,63) = 0;
- WFIFOL(fd,67) = (uint32)instance[instance_id].idle_timeout;
+ WFIFOL(fd,67) = instances[instance_id].idle_timeout;
WFIFOSET(fd,packet_len(0x02CD));
- } else if( instance[instance_id].progress_timer != INVALID_TIMER ) {
+ } else if( instances[instance_id].progress_timer != INVALID_TIMER ) {
WFIFOHEAD(fd,packet_len(0x02CD));
WFIFOW(fd,0) = 0x02CD;
- memcpy(WFIFOP(fd,2),instance[instance_id].name,61);
- WFIFOL(fd,63) = (uint32)instance[instance_id].progress_timeout;;
+ memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
+ WFIFOL(fd,63) = instances[instance_id].progress_timeout;
WFIFOL(fd,67) = 0;
WFIFOSET(fd,packet_len(0x02CD));
} else {
WFIFOHEAD(fd,packet_len(0x02CB));
WFIFOW(fd,0) = 0x02CB;
- memcpy(WFIFOP(fd,2),instance[instance_id].name,61);
+ memcpy(WFIFOP(fd,2),instances[instance_id].name,61);
WFIFOW(fd,63) = 0;
WFIFOSET(fd,packet_len(0x02CB));
}
@@ -16949,6 +16960,124 @@ void clif_status_change_end(struct block_list *bl, int tid, enum send_target tar
clif->send(&p,sizeof(p), bl, target);
}
+void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id) {
+
+ switch (response) {
+ case BGQA_FAIL_COOLDOWN:
+ case BGQA_FAIL_DESERTER:
+ case BGQA_FAIL_TEAM_COUNT:
+ break;
+ default: {
+ struct packet_bgqueue_ack p;
+
+ p.PacketType = bgqueue_ackType;
+ p.type = response;
+ safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
+
+ clif->send(&p,sizeof(p), &sd->bl, SELF);
+ }
+ break;
+ }
+}
+
+
+void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, unsigned char arena_id) {
+ struct packet_bgqueue_notice_delete p;
+
+ p.PacketType = bgqueue_notice_deleteType;
+ p.type = response;
+ safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
+
+ clif->send(&p,sizeof(p), &sd->bl, SELF);
+}
+
+void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) {
+ struct packet_bgqueue_register *p = P2PTR(fd, bgqueue_registerType);
+ struct bg_arena *arena = NULL;
+
+ if( !bg->queue_on ) return; /* temp, until feature is complete */
+
+ if( !(arena = bg->name2arena(p->bg_name)) ) {
+ clif->bgqueue_ack(sd,BGQA_FAIL_BGNAME_INVALID,0);
+ return;
+ }
+
+ switch( (enum bg_queue_types)p->type ) {
+ case BGQT_INDIVIDUAL:
+ case BGQT_PARTY:
+ case BGQT_GUILD:
+ break;
+ default:
+ clif->bgqueue_ack(sd,BGQA_FAIL_TYPE_INVALID, arena->id);
+ return;
+ }
+
+ bg->queue_add(sd, arena, (enum bg_queue_types)p->type);
+}
+
+void clif_bgqueue_update_info(struct map_session_data *sd, unsigned char arena_id, int position) {
+ struct packet_bgqueue_update_info p;
+
+ p.PacketType = bgqueue_updateinfoType;
+ safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
+ p.position = position;
+
+ sd->bg_queue.client_has_bg_data = true; // Client creates bg data when this packet arrives
+
+ clif->send(&p,sizeof(p), &sd->bl, SELF);
+}
+
+void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) {
+ //struct packet_bgqueue_checkstate *p = P2PTR(fd, bgqueue_checkstateType); /* TODO: bgqueue_notice_delete should use this p->bg_name */
+ if( !bg->queue_on ) return; /* temp, until feature is complete */
+ if ( sd->bg_queue.arena && sd->bg_queue.type ) {
+ sd->bg_queue.client_has_bg_data = true;
+ clif->bgqueue_update_info(sd,sd->bg_queue.arena->id,bg->id2pos(sd->bg_queue.arena->queue_id,sd->status.account_id));
+ } else
+ clif->bgqueue_notice_delete(sd, BGQND_FAIL_NOT_QUEUING,0);/* TODO: wrong response, should respond with p->bg_name not id 0 */
+}
+
+void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) {
+ //struct packet_bgqueue_revoke_req *p = P2PTR(fd, bgqueue_revokereqType);
+ return;
+ //bg->queue_leave(sd, p->bg_name);
+}
+
+void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) {
+ //struct packet_bgqueue_battlebegin_ack *p = P2PTR(fd, bgqueue_checkstateType);
+ return;
+ //if ( p->result == 1 )
+ // bg->queue_pc_ready(sd);
+ //else
+ // bg->queue_leave(sd, p->bg_name);
+}
+
+void clif_bgqueue_joined(struct map_session_data *sd, int pos) {
+ struct packet_bgqueue_notify_entry p;
+
+ p.PacketType = bgqueue_notify_entryType;
+ safestrncpy(p.name,sd->status.name,sizeof(p.name));
+ p.position = pos;
+
+ clif->send(&p,sizeof(p), &sd->bl, BG_QUEUE);
+}
+
+void clif_bgqueue_pcleft(struct map_session_data *sd) {
+ /* no idea */
+ return;
+}
+
+// Sends BG ready req to all with same bg arena/type as sd
+void clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_id, enum send_target target) {
+ struct packet_bgqueue_battlebegins p;
+
+ p.PacketType = bgqueue_battlebegins;
+ safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
+ safestrncpy(p.game_name, bg->arena[arena_id]->name, sizeof(p.game_name));
+
+ clif->send(&p,sizeof(p), &sd->bl, target);
+}
+
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -17124,6 +17253,7 @@ void clif_bc_ready(void) {
int do_init_clif(void) {
const char* colors[COLOR_MAX] = { "0xFF0000", "0x00ff00", "0xffffff" };
int i;
+
/**
* Setup Color Table (saves unnecessary load of strtoul on every call)
**/
@@ -17613,13 +17743,7 @@ void clif_defaults(void) {
/* elemental-related */
clif->elemental_info = clif_elemental_info;
clif->elemental_updatestatus = clif_elemental_updatestatus;
- /* misc-handling */
- clif->adopt_reply = clif_Adopt_reply;
- clif->adopt_request = clif_Adopt_request;
- clif->readbook = clif_readbook;
- clif->notify_time = clif_notify_time;
- clif->user_count = clif_user_count;
- clif->noask_sub = clif_noask_sub;
+ /* Hercules Channel System */
clif->chsys_create = clif_hercules_chsys_create;
clif->chsys_msg = clif_hercules_chsys_msg;
clif->chsys_msg2 = clif_hercules_chsys_msg2;
@@ -17632,6 +17756,20 @@ void clif_defaults(void) {
clif->chsys_quitg = clif_hercules_chsys_quitg;
clif->chsys_gjoin = clif_hercules_chsys_gjoin;
clif->chsys_gleave = clif_hercules_chsys_gleave;
+ /* bgqueue */
+ clif->bgqueue_ack = clif_bgqueue_ack;
+ clif->bgqueue_notice_delete = clif_bgqueue_notice_delete;
+ clif->bgqueue_update_info = clif_bgqueue_update_info;
+ clif->bgqueue_joined = clif_bgqueue_joined;
+ clif->bgqueue_pcleft = clif_bgqueue_pcleft;
+ clif->bgqueue_battlebegins = clif_bgqueue_battlebegins;
+ /* misc-handling */
+ clif->adopt_reply = clif_Adopt_reply;
+ clif->adopt_request = clif_Adopt_request;
+ clif->readbook = clif_readbook;
+ clif->notify_time = clif_notify_time;
+ clif->user_count = clif_user_count;
+ clif->noask_sub = clif_noask_sub;
clif->cashshop_load = clif_cashshop_db;
clif->bc_ready = clif_bc_ready;
clif->undisguise_timer = clif_undisguise_timer;
@@ -17837,6 +17975,11 @@ void clif_defaults(void) {
clif->pCashShopReqTab = clif_parse_CashShopReqTab;
clif->pCashShopSchedule = clif_parse_CashShopSchedule;
clif->pCashShopBuy = clif_parse_CashShopBuy;
+ /* BGQueue */
+ clif->pBGQueueRegister = clif_parse_bgqueue_register;
+ clif->pBGQueueCheckState = clif_parse_bgqueue_checkstate;
+ clif->pBGQueueRevokeReq = clif_parse_bgqueue_revoke_req;
+ clif->pBGQueueBattleBeginAck = clif_parse_bgqueue_battlebegin_ack;
/* */
clif->pPartyTick = clif_parse_PartyTick;
clif->pGuildInvite2 = clif_parse_GuildInvite2;
diff --git a/src/map/clif.h b/src/map/clif.h
index 3e3db98c1..4347ad743 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -8,6 +8,7 @@
#include "../common/cbasetypes.h"
#include "../common/db.h"
#include "../common/mmo.h"
+#include "../common/socket.h"
#include <stdarg.h>
/**
@@ -42,6 +43,7 @@ struct eri;
* Defines
**/
#define packet_len(cmd) packet_db[cmd].len
+#define P2PTR(fd,cmd) RFIFO2PTR(fd,packet_db[cmd].len)
#define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
#define HCHSYS_NAME_LENGTH 20
@@ -86,6 +88,8 @@ typedef enum send_target {
BG_SAMEMAP_WOS,
BG_AREA,
BG_AREA_WOS,
+
+ BG_QUEUE,
} send_target;
typedef enum emotion_type {
@@ -365,6 +369,29 @@ enum CASH_SHOP_BUY_RESULT {
CSBR_UNKNOWN = 0xb,
};
+enum BATTLEGROUNDS_QUEUE_ACK {
+ BGQA_SUCCESS = 1,
+ BGQA_FAIL_QUEUING_FINISHED,
+ BGQA_FAIL_BGNAME_INVALID,
+ BGQA_FAIL_TYPE_INVALID,
+ BGQA_FAIL_PPL_OVERAMOUNT,
+ BGQA_FAIL_LEVEL_INCORRECT,
+ BGQA_DUPLICATE_REQUEST,
+ BGQA_PLEASE_RELOGIN,
+ BGQA_NOT_PARTY_GUILD_LEADER,
+ BGQA_FAIL_CLASS_INVALID,
+ /* not official way to respond (gotta find packet?) */
+ BGQA_FAIL_DESERTER,
+ BGQA_FAIL_COOLDOWN,
+ BGQA_FAIL_TEAM_COUNT,
+};
+
+enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED {
+ BGQND_CLOSEWINDOW = 1,
+ BGQND_FAIL_BGNAME_WRONG = 3,
+ BGQND_FAIL_NOT_QUEUING = 11,
+};
+
/**
* Structures
**/
@@ -499,7 +526,7 @@ struct clif_interface {
/* main unit spawn */
int (*spawn) (struct block_list *bl);
/* map-related */
- void (*changemap) (struct map_session_data *sd, short map, int x, int y);
+ void (*changemap) (struct map_session_data *sd, short m, int x, int y);
void (*changemapcell) (int fd, int16 m, int x, int y, int type, enum send_target target);
void (*map_property) (struct map_session_data* sd, enum map_property property);
void (*pvpset) (struct map_session_data *sd, int pvprank, int pvpnum,int type);
@@ -860,6 +887,13 @@ struct clif_interface {
/* elemental-related */
void (*elemental_info) (struct map_session_data *sd);
void (*elemental_updatestatus) (struct map_session_data *sd, int type);
+ /* bgqueue */
+ void (*bgqueue_ack) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id);
+ void (*bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, unsigned char arena_id);
+ void (*bgqueue_update_info) (struct map_session_data *sd, unsigned char arena_id, int position);
+ void (*bgqueue_joined) (struct map_session_data *sd, int pos);
+ void (*bgqueue_pcleft) (struct map_session_data *sd);
+ void (*bgqueue_battlebegins) (struct map_session_data *sd, unsigned char arena_id, enum send_target target);
/* misc-handling */
void (*adopt_reply) (struct map_session_data *sd, int type);
void (*adopt_request) (struct map_session_data *sd, struct map_session_data *src, int p_id);
@@ -1078,6 +1112,11 @@ struct clif_interface {
void (*pSkillSelectMenu) (int fd, struct map_session_data *sd);
void (*pMoveItem) (int fd, struct map_session_data *sd);
void (*pDull) (int fd, struct map_session_data *sd);
+ /* BGQueue */
+ void (*pBGQueueRegister) (int fd, struct map_session_data *sd);
+ void (*pBGQueueCheckState) (int fd, struct map_session_data *sd);
+ void (*pBGQueueRevokeReq) (int fd, struct map_session_data *sd);
+ void (*pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd);
/* RagExe Cash Shop [Ind/Hercules] */
void (*pCashShopOpen) (int fd, struct map_session_data *sd);
void (*pCashShopClose) (int fd, struct map_session_data *sd);
diff --git a/src/map/guild.c b/src/map/guild.c
index b83f05f00..a6c873861 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -24,6 +24,7 @@
#include "clif.h"
#include "skill.h"
#include "log.h"
+#include "instance.h"
#include <stdio.h>
#include <stdlib.h>
@@ -503,6 +504,8 @@ int guild_recv_info(struct guild *sg) {
if((g = (struct guild*)idb_get(guild_db,sg->guild_id))==NULL) {
guild_new = true;
g=(struct guild *)aCalloc(1,sizeof(struct guild));
+ g->instance = NULL;
+ g->instances = 0;
idb_put(guild_db,sg->guild_id,g);
if( hChSys.ally ) {
struct hChSysCh *channel;
@@ -926,7 +929,8 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
sd->status.guild_id = 0;
sd->guild = NULL;
sd->guild_emblem_id = 0;
-
+ if( g->instances )
+ instance->check_kick(sd);
clif->charnameupdate(sd); //Update display name [Skotlex]
//TODO: send emblem update to self and people around
}
@@ -2211,6 +2215,10 @@ void do_final_guild(void) {
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) {
if( g->channel != NULL )
clif->chsys_delete((struct hChSysCh *)g->channel);
+ if( g->instance != NULL ) {
+ aFree(g->instance);
+ g->instance = NULL;
+ }
}
dbi_destroy(iter);
diff --git a/src/map/instance.c b/src/map/instance.c
index 8ddde8b3e..637e768c9 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/cbasetypes.h"
#include "../common/socket.h"
@@ -24,20 +25,13 @@
#include <stdarg.h>
#include <time.h>
-int instance_start = 0; // To keep the last index + 1 of normal map inserted in the map[ARRAY]
-struct s_instance instance[MAX_INSTANCE];
-
-
/// Checks whether given instance id is valid or not.
-static bool instance_is_valid(int instance_id)
-{
- if( instance_id < 1 || instance_id >= ARRAYLENGTH(instance) )
- {// out of range
+bool instance_is_valid(int instance_id) {
+ if( instance_id < 0 || instance_id >= instance->instances ) {// out of range
return false;
}
- if( instance[instance_id].state == INSTANCE_FREE )
- {// uninitialized/freed instance slot
+ if( instances[instance_id].state == INSTANCE_FREE ) {// uninitialized/freed instance slot
return false;
}
@@ -48,56 +42,104 @@ static bool instance_is_valid(int instance_id)
/*--------------------------------------
* name : instance name
* Return value could be
- * -4 = already exists | -3 = no free instances | -2 = party not found | -1 = invalid type
+ * -4 = already exists | -3 = no free instances | -2 = owner not found | -1 = invalid type
* On success return instance_id
*--------------------------------------*/
-int instance_create(int party_id, const char *name)
-{
- int i;
- struct party_data* p;
-
- if( ( p = party_search(party_id) ) == NULL )
- {
- ShowError("instance_create: party %d not found for instance '%s'.\n", party_id, name);
- return -2;
+int instance_create(int owner_id, const char *name, enum instance_owner_type type) {
+ unsigned short *iptr = NULL, *icptr = NULL;
+ struct map_session_data *sd = NULL;
+ struct party_data *p = NULL;
+ struct guild *g = NULL;
+ int i, j;
+
+ switch ( type ) {
+ case IOT_NONE:
+ break;
+ case IOT_CHAR:
+ if( ( sd = map_id2sd(owner_id) ) == NULL ) {
+ ShowError("instance_create: character %d not found for instance '%s'.\n", owner_id, name);
+ return -2;
+ }
+ iptr = sd->instance;
+ icptr = &sd->instances;
+ break;
+ case IOT_PARTY:
+ if( ( p = party_search(owner_id) ) == NULL ) {
+ ShowError("instance_create: party %d not found for instance '%s'.\n", owner_id, name);
+ return -2;
+ }
+ iptr = p->instance;
+ icptr = &p->instances;
+ break;
+ case IOT_GUILD:
+ if( ( g = guild->search(owner_id) ) == NULL ) {
+ ShowError("instance_create: guild %d not found for instance '%s'.\n", owner_id, name);
+ return -2;
+ }
+ iptr = g->instance;
+ icptr = &g->instances;
+ break;
+ default:
+ ShowError("instance_create: unknown type %d for owner_id %d and name %s.\n", type,owner_id,name);
+ return -1;
}
-
- if( p->instance_id )
- return -4; // Party already instancing
-
- // Searching a Free Instance
- // 0 is ignored as this mean "no instance" on maps
- ARR_FIND(1, MAX_INSTANCE, i, instance[i].state == INSTANCE_FREE);
- if( i == MAX_INSTANCE )
- {
- ShowError("instance_create: no free instances, consider increasing MAX_INSTANCE.\n");
- return -3;
+
+ if( type != IOT_NONE && *icptr ) {
+ ARR_FIND(0, *icptr, i, strcmp(instances[iptr[i]].name,name) == 0 );
+ if( i != *icptr )
+ return -4;/* already got this instance */
}
-
- instance[i].state = INSTANCE_IDLE;
- instance[i].instance_id = i;
- instance[i].idle_timer = INVALID_TIMER;
- instance[i].idle_timeout = instance[i].idle_timeoutval = 0;
- instance[i].progress_timer = INVALID_TIMER;
- instance[i].progress_timeout = 0;
- instance[i].users = 0;
- instance[i].party_id = party_id;
- instance[i].vars = idb_alloc(DB_OPT_RELEASE_DATA);
-
- safestrncpy( instance[i].name, name, sizeof(instance[i].name) );
- memset( instance[i].map, 0x00, sizeof(instance[i].map) );
- p->instance_id = i;
-
+
+ ARR_FIND(0, instance->instances, i, instances[i].state == INSTANCE_FREE);
+
+ if( i == instance->instances )
+ RECREATE(instances, struct instance_data, ++instance->instances);
+
+ instances[i].state = INSTANCE_IDLE;
+ instances[i].id = i;
+ instances[i].idle_timer = INVALID_TIMER;
+ instances[i].idle_timeout = instances[i].idle_timeoutval = 0;
+ instances[i].progress_timer = INVALID_TIMER;
+ instances[i].progress_timeout = 0;
+ instances[i].users = 0;
+ instances[i].map = NULL;
+ instances[i].num_map = 0;
+ instances[i].owner_id = owner_id;
+ instances[i].owner_type = type;
+ instances[i].vars = idb_alloc(DB_OPT_RELEASE_DATA);
+
+ safestrncpy( instances[i].name, name, sizeof(instances[i].name) );
+ instances[i].map = NULL;
+
+ if( type != IOT_NONE ) {
+ ARR_FIND(0, *icptr, j, iptr[j] == 0);
+ if( j == *icptr ) {
+ switch( type ) {
+ case IOT_CHAR:
+ RECREATE(sd->instance, unsigned short, ++*icptr);
+ sd->instance[sd->instances-1] = i;
+ break;
+ case IOT_PARTY:
+ RECREATE(p->instance, unsigned short, ++*icptr);
+ p->instance[p->instances-1] = i;
+ break;
+ case IOT_GUILD:
+ RECREATE(g->instance, unsigned short, ++*icptr);
+ g->instance[g->instances-1] = i;
+ break;
+ }
+ } else
+ iptr[j] = i;
+ }
+
clif->instance(i, 1, 0); // Start instancing window
- ShowInfo("[Instance] Created: %s.\n", name);
return i;
}
/*--------------------------------------
* Add a map to the instance using src map "name"
*--------------------------------------*/
-int instance_add_map(const char *name, int instance_id, bool usebasename)
-{
+int instance_add_map(const char *name, int instance_id, bool usebasename, const char *map_name) {
int16 m = map_mapname2mapid(name);
int i, im = -1;
size_t num_cell, size;
@@ -105,42 +147,49 @@ int instance_add_map(const char *name, int instance_id, bool usebasename)
if( m < 0 )
return -1; // source map not found
- if( !instance_is_valid(instance_id) )
- {
+ if( !instance->valid(instance_id) ) {
ShowError("instance_add_map: trying to attach '%s' map to non-existing instance %d.\n", name, instance_id);
return -1;
}
- if( instance[instance_id].num_map >= MAX_MAP_PER_INSTANCE )
- {
- ShowError("instance_add_map: trying to add '%s' map to instance %d (%s) failed. Please increase MAX_MAP_PER_INSTANCE.\n", name, instance_id, instance[instance_id].name);
+
+ if( map_name != NULL && strdb_iget(mapindex_db, map_name) ) {
+ ShowError("instance_add_map: trying to create instanced map with existent name '%s'\n", map_name);
return -2;
}
- if( map[m].instance_id != 0 )
- { // Source map already belong to a Instance.
+
+ if( map[m].instance_id >= 0 ) { // Source map already belong to a Instance.
ShowError("instance_add_map: trying to instance already instanced map %s.\n", name);
return -4;
}
-
- ARR_FIND( instance_start, map_num, i, !map[i].name[0] ); // Searching for a Free Map
- if( i < map_num ) im = i; // Unused map found (old instance)
- else if( map_num - 1 >= MAX_MAP_PER_SERVER )
- { // No more free maps
- ShowError("instance_add_map: no more free space to create maps on this server.\n");
- return -5;
+
+ ARR_FIND( instance->start_id, map_num, i, !map[i].name[0] ); // Searching for a Free Map
+
+ if( i < map_num )
+ im = i; // Unused map found (old instance)
+ else {
+ im = map_num; // Using next map index
+ RECREATE(map,struct map_data,++map_num);
}
- else im = map_num++; // Using next map index
+
+ if( map[m].cell == (struct mapcell *)0xdeadbeaf )
+ map_cellfromcache(&map[m]);
memcpy( &map[im], &map[m], sizeof(struct map_data) ); // Copy source map
- snprintf(map[im].name, MAP_NAME_LENGTH, (usebasename ? "%.3d#%s" : "%.3d%s"), instance_id, name); // Generate Name for Instance Map
+ if( map_name != NULL ) {
+ snprintf(map[im].name, MAP_NAME_LENGTH, "%s", map_name);
+ map[im].cName = map[m].name;
+ } else
+ snprintf(map[im].name, MAP_NAME_LENGTH, (usebasename ? "%.3d#%s" : "%.3d%s"), instance_id, name); // Generate Name for Instance Map
map[im].index = mapindex_addmap(-1, map[im].name); // Add map index
- if( !map[im].index )
- {
+ map[im].channel = NULL;
+
+ if( !map[im].index ) {
map[im].name[0] = '\0';
ShowError("instance_add_map: no more free map indexes.\n");
return -3; // No free map index
}
-
+
// Reallocate cells
num_cell = map[im].xs * map[im].ys;
CREATE( map[im].cell, struct mapcell, num_cell );
@@ -161,9 +210,11 @@ int instance_add_map(const char *name, int instance_id, bool usebasename)
map[im].instance_src_map = m;
map[m].flag.src4instance = 1; // Flag this map as a src map for instances
- instance[instance_id].map[instance[instance_id].num_map++] = im; // Attach to actual instance
- map_addmap2db(&map[im]);
+ RECREATE(instances[instance_id].map, unsigned short, ++instances[instance_id].num_map);
+ instances[instance_id].map[instances[instance_id].num_map - 1] = im; // Attach to actual instance
+ map_addmap2db(&map[im]);
+
return im;
}
@@ -172,19 +223,16 @@ int instance_add_map(const char *name, int instance_id, bool usebasename)
* party_id : source party of this instance
* type : result (0 = map id | 1 = instance id)
*--------------------------------------*/
-int instance_map2imap(int16 m, int instance_id)
-{
+int instance_map2imap(int16 m, int instance_id) {
int i;
- if( !instance_is_valid(instance_id) )
- {
+ if( !instance->valid(instance_id) ) {
return -1;
}
- for( i = 0; i < instance[instance_id].num_map; i++ )
- {
- if( instance[instance_id].map[i] && map[instance[instance_id].map[i]].instance_src_map == m )
- return instance[instance_id].map[i];
+ for( i = 0; i < instances[instance_id].num_map; i++ ) {
+ if( instances[instance_id].map[i] && map[instances[instance_id].map[i]].instance_src_map == m )
+ return instances[instance_id].map[i];
}
return -1;
}
@@ -194,59 +242,56 @@ int instance_map2imap(int16 m, int instance_id)
* instance_id : where to search
* result : mapid of map "m" in this instance
*--------------------------------------*/
-int instance_mapid2imapid(int16 m, int instance_id)
-{
+int instance_mapid2imapid(int16 m, int instance_id) {
if( map[m].flag.src4instance == 0 )
return m; // not instances found for this map
- else if( map[m].instance_id )
- { // This map is a instance, not a src map instance
+ else if( map[m].instance_id >= 0 ) { // This map is a instance, not a src map instance
ShowError("map_instance_mapid2imapid: already instanced (%d / %d)\n", m, instance_id);
return -1;
}
- if( !instance_is_valid(instance_id) )
+ if( !instance->valid(instance_id) )
return -1;
- return instance_map2imap(m, instance_id);
+ return instance->map2imap(m, instance_id);
}
/*--------------------------------------
* map_instance_map_npcsub
* Used on Init instance. Duplicates each script on source map
*--------------------------------------*/
-int instance_map_npcsub(struct block_list* bl, va_list args)
-{
+int instance_map_npcsub(struct block_list* bl, va_list args) {
struct npc_data* nd = (struct npc_data*)bl;
int16 m = va_arg(args, int); // Destination Map
- npc_duplicate4instance(nd, m);
+ if ( npc_duplicate4instance(nd, m) )
+ ShowDebug("instance_map_npcsub:npc_duplicate4instance failed (%s/%d)\n",nd->name,m);
+
return 1;
}
/*--------------------------------------
* Init all map on the instance. Npcs are created here
*--------------------------------------*/
-void instance_init(int instance_id)
-{
+void instance_init(int instance_id) {
int i;
- if( !instance_is_valid(instance_id) )
+ if( !instance->valid(instance_id) )
return; // nothing to do
- for( i = 0; i < instance[instance_id].num_map; i++ )
- map_foreachinmap(instance_map_npcsub, map[instance[instance_id].map[i]].instance_src_map, BL_NPC, instance[instance_id].map[i]);
+ for( i = 0; i < instances[instance_id].num_map; i++ )
+ map_foreachinmap(instance_map_npcsub, map[instances[instance_id].map[i]].instance_src_map, BL_NPC, instances[instance_id].map[i]);
- instance[instance_id].state = INSTANCE_BUSY;
- ShowInfo("[Instance] Initialized %s.\n", instance[instance_id].name);
+ instances[instance_id].state = INSTANCE_BUSY;
}
/*--------------------------------------
* Used on instance deleting process.
* Warps all players on each instance map to its save points.
*--------------------------------------*/
-int instance_del_load(struct map_session_data* sd, va_list args)
-{
+int instance_del_load(struct map_session_data* sd, va_list args) {
int16 m = va_arg(args,int);
+
if( !sd || sd->bl.m != m )
return 0;
@@ -285,12 +330,11 @@ int instance_cleanup_sub(struct block_list *bl, va_list ap) {
/*--------------------------------------
* Removes a simple instance map
*--------------------------------------*/
-void instance_del_map(int16 m)
-{
+void instance_del_map(int16 m) {
int i;
- if( m <= 0 || !map[m].instance_id )
- {
- ShowError("Tried to remove non-existing instance map (%d)\n", m);
+
+ if( m <= 0 || map[m].instance_id == -1 ) {
+ ShowError("instance_del_map: tried to remove non-existing instance map (%d)\n", m);
return;
}
@@ -299,116 +343,145 @@ void instance_del_map(int16 m)
if( map[m].mob_delete_timer != INVALID_TIMER )
delete_timer(map[m].mob_delete_timer, map_removemobs_timer);
-
+
mapindex_removemap( map[m].index );
// Free memory
aFree(map[m].cell);
aFree(map[m].block);
aFree(map[m].block_mob);
-
+
// Remove from instance
- for( i = 0; i < instance[map[m].instance_id].num_map; i++ )
- {
- if( instance[map[m].instance_id].map[i] == m )
- {
- instance[map[m].instance_id].num_map--;
- for( ; i < instance[map[m].instance_id].num_map; i++ )
- instance[map[m].instance_id].map[i] = instance[map[m].instance_id].map[i+1];
+ for( i = 0; i < instances[map[m].instance_id].num_map; i++ ) {
+ if( instances[map[m].instance_id].map[i] == m ) {
+ instances[map[m].instance_id].num_map--;
+ for( ; i < instances[map[m].instance_id].num_map; i++ )
+ instances[map[m].instance_id].map[i] = instances[map[m].instance_id].map[i+1];
i = -1;
break;
}
}
- if( i == instance[map[m].instance_id].num_map )
- ShowError("map_instance_del: failed to remove %s from instance list (%s): %d\n", map[m].name, instance[map[m].instance_id].name, m);
+
+ if( i == instances[map[m].instance_id].num_map )
+ ShowError("map_instance_del: failed to remove %s from instance list (%s): %d\n", map[m].name, instances[map[m].instance_id].name, m);
+
+ if( map[m].channel )
+ clif->chsys_delete(map[m].channel);
map_removemapdb(&map[m]);
memset(&map[m], 0x00, sizeof(map[0]));
-
- /* for it is default and makes it not try to delete a non-existent timer since we did not delete this entry. */
+ map[m].instance_id = -1;
map[m].mob_delete_timer = INVALID_TIMER;
}
/*--------------------------------------
* Timer to destroy instance by process or idle
*--------------------------------------*/
-int instance_destroy_timer(int tid, unsigned int tick, int id, intptr_t data)
-{
- instance_destroy(id);
+int instance_destroy_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ instance->destroy(id);
return 0;
}
/*--------------------------------------
* Removes a instance, all its maps and npcs.
*--------------------------------------*/
-void instance_destroy(int instance_id)
-{
- int last = 0, type;
- struct party_data *p;
- time_t now = time(NULL);
-
- if( !instance_is_valid(instance_id) )
+void instance_destroy(int instance_id) {
+ unsigned short *iptr = NULL, *icptr = NULL;
+ struct map_session_data *sd = NULL;
+ struct party_data *p = NULL;
+ struct guild *g = NULL;
+ int last = 0, type, j;
+ unsigned int now = (unsigned int)time(NULL);
+
+ if( !instance->valid(instance_id) )
return; // nothing to do
- if( instance[instance_id].progress_timeout && instance[instance_id].progress_timeout <= now )
+ if( instances[instance_id].progress_timeout && instances[instance_id].progress_timeout <= now )
type = 1;
- else if( instance[instance_id].idle_timeout && instance[instance_id].idle_timeout <= now )
+ else if( instances[instance_id].idle_timeout && instances[instance_id].idle_timeout <= now )
type = 2;
else
type = 3;
clif->instance(instance_id, 5, type); // Report users this instance has been destroyed
- while( instance[instance_id].num_map && last != instance[instance_id].map[0] )
- { // Remove all maps from instance
- last = instance[instance_id].map[0];
- instance_del_map( instance[instance_id].map[0] );
+ switch ( instances[instance_id].owner_type ) {
+ case IOT_NONE:
+ break;
+ case IOT_CHAR:
+ if( ( sd = map_id2sd(instances[instance_id].owner_id) ) == NULL ) {
+ break;
+ }
+ iptr = sd->instance;
+ icptr = &sd->instances;
+ break;
+ case IOT_PARTY:
+ if( ( p = party_search(instances[instance_id].owner_id) ) == NULL ) {
+ break;
+ }
+ iptr = p->instance;
+ icptr = &p->instances;
+ break;
+ case IOT_GUILD:
+ if( ( g = guild->search(instances[instance_id].owner_id) ) == NULL ) {
+ break;
+ }
+ iptr = g->instance;
+ icptr = &g->instances;
+ break;
+ default:
+ ShowError("instance_destroy: unknown type %d for owner_id %d and name %s.\n", instances[instance_id].owner_type,instances[instance_id].owner_id,instances[instance_id].name);
+ break;
+ }
+
+ if( iptr != NULL ) {
+ ARR_FIND(0, *icptr, j, iptr[j] == instance_id);
+ if( j != *icptr )
+ iptr[j] = 0;
+ }
+
+ while( instances[instance_id].num_map && last != instances[instance_id].map[0] ) { // Remove all maps from instance
+ last = instances[instance_id].map[0];
+ instance->del_map( instances[instance_id].map[0] );
}
- if( instance[instance_id].vars )
- db_destroy(instance[instance_id].vars);
-
- if( instance[instance_id].progress_timer != INVALID_TIMER )
- delete_timer( instance[instance_id].progress_timer, instance_destroy_timer);
- if( instance[instance_id].idle_timer != INVALID_TIMER )
- delete_timer( instance[instance_id].idle_timer, instance_destroy_timer);
+ if( instances[instance_id].vars )
+ db_destroy(instances[instance_id].vars);
- instance[instance_id].vars = NULL;
+ if( instances[instance_id].progress_timer != INVALID_TIMER )
+ delete_timer( instances[instance_id].progress_timer, instance_destroy_timer);
+ if( instances[instance_id].idle_timer != INVALID_TIMER )
+ delete_timer( instances[instance_id].idle_timer, instance_destroy_timer);
- if( instance[instance_id].party_id && (p = party_search(instance[instance_id].party_id)) != NULL )
- p->instance_id = 0; // Update Party information
+ instances[instance_id].vars = NULL;
- ShowInfo("[Instance] Destroyed %s.\n", instance[instance_id].name);
- memset( &instance[instance_id], 0x00, sizeof(instance[0]) );
+ aFree(instances[instance_id].map);
+
+ memset( &instances[instance_id], 0x00, sizeof(struct instance_data) );
- instance[instance_id].state = INSTANCE_FREE;
}
/*--------------------------------------
* Checks if there are users in the instance or not to start idle timer
*--------------------------------------*/
-void instance_check_idle(int instance_id)
-{
+void instance_check_idle(int instance_id) {
bool idle = true;
- time_t now = time(NULL);
+ unsigned int now = (unsigned int)time(NULL);
- if( !instance_is_valid(instance_id) || instance[instance_id].idle_timeoutval == 0 )
+ if( !instance->valid(instance_id) || instances[instance_id].idle_timeoutval == 0 )
return;
- if( instance[instance_id].users )
+ if( instances[instance_id].users )
idle = false;
- if( instance[instance_id].idle_timer != INVALID_TIMER && !idle )
- {
- delete_timer(instance[instance_id].idle_timer, instance_destroy_timer);
- instance[instance_id].idle_timer = INVALID_TIMER;
- instance[instance_id].idle_timeout = 0;
+ if( instances[instance_id].idle_timer != INVALID_TIMER && !idle ) {
+ delete_timer(instances[instance_id].idle_timer, instance_destroy_timer);
+ instances[instance_id].idle_timer = INVALID_TIMER;
+ instances[instance_id].idle_timeout = 0;
clif->instance(instance_id, 3, 0); // Notify instance users normal instance expiration
- }
- else if( instance[instance_id].idle_timer == INVALID_TIMER && idle )
- {
- instance[instance_id].idle_timeout = now + instance[instance_id].idle_timeoutval;
- instance[instance_id].idle_timer = add_timer( gettick() + (unsigned int)instance[instance_id].idle_timeoutval * 1000, instance_destroy_timer, instance_id, 0);
+ } else if( instances[instance_id].idle_timer == INVALID_TIMER && idle ) {
+ instances[instance_id].idle_timeout = now + instances[instance_id].idle_timeoutval;
+ instances[instance_id].idle_timer = add_timer( gettick() + instances[instance_id].idle_timeoutval * 1000, instance_destroy_timer, instance_id, 0);
clif->instance(instance_id, 4, 0); // Notify instance users it will be destroyed of no user join it again in "X" time
}
}
@@ -418,54 +491,46 @@ void instance_check_idle(int instance_id)
*--------------------------------------*/
void instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout)
{
- time_t now = time(0);
+ unsigned int now = (unsigned int)time(0);
- if( !instance_is_valid(instance_id) )
+ if( !instance->valid(instance_id) )
return;
- if( instance[instance_id].progress_timer != INVALID_TIMER )
- delete_timer( instance[instance_id].progress_timer, instance_destroy_timer);
- if( instance[instance_id].idle_timer != INVALID_TIMER )
- delete_timer( instance[instance_id].idle_timer, instance_destroy_timer);
-
- if( progress_timeout )
- {
- instance[instance_id].progress_timeout = now + progress_timeout;
- instance[instance_id].progress_timer = add_timer( gettick() + progress_timeout * 1000, instance_destroy_timer, instance_id, 0);
- }
- else
- {
- instance[instance_id].progress_timeout = 0;
- instance[instance_id].progress_timer = INVALID_TIMER;
+ if( instances[instance_id].progress_timer != INVALID_TIMER )
+ delete_timer( instances[instance_id].progress_timer, instance_destroy_timer);
+ if( instances[instance_id].idle_timer != INVALID_TIMER )
+ delete_timer( instances[instance_id].idle_timer, instance_destroy_timer);
+
+ if( progress_timeout ) {
+ instances[instance_id].progress_timeout = now + progress_timeout;
+ instances[instance_id].progress_timer = add_timer( gettick() + progress_timeout * 1000, instance_destroy_timer, instance_id, 0);
+ } else {
+ instances[instance_id].progress_timeout = 0;
+ instances[instance_id].progress_timer = INVALID_TIMER;
}
- if( idle_timeout )
- {
- instance[instance_id].idle_timeoutval = idle_timeout;
- instance[instance_id].idle_timer = INVALID_TIMER;
+ if( idle_timeout ) {
+ instances[instance_id].idle_timeoutval = idle_timeout;
+ instances[instance_id].idle_timer = INVALID_TIMER;
instance_check_idle(instance_id);
- }
- else
- {
- instance[instance_id].idle_timeoutval = 0;
- instance[instance_id].idle_timeout = 0;
- instance[instance_id].idle_timer = INVALID_TIMER;
+ } else {
+ instances[instance_id].idle_timeoutval = 0;
+ instances[instance_id].idle_timeout = 0;
+ instances[instance_id].idle_timer = INVALID_TIMER;
}
- if( instance[instance_id].idle_timer == INVALID_TIMER && instance[instance_id].progress_timer != INVALID_TIMER )
+ if( instances[instance_id].idle_timer == INVALID_TIMER && instances[instance_id].progress_timer != INVALID_TIMER )
clif->instance(instance_id, 3, 0);
}
/*--------------------------------------
* Checks if sd in on a instance and should be kicked from it
*--------------------------------------*/
-void instance_check_kick(struct map_session_data *sd)
-{
+void instance_check_kick(struct map_session_data *sd) {
int16 m = sd->bl.m;
clif->instance_leave(sd->fd);
- if( map[m].instance_id )
- { // User was on the instance map
+ if( map[m].instance_id >= 0 ) { // User was on the instance map
if( map[m].save.map )
pc_setpos(sd, map[m].save.map, map[m].save.x, map[m].save.y, CLR_TELEPORT);
else
@@ -473,16 +538,41 @@ void instance_check_kick(struct map_session_data *sd)
}
}
-void do_final_instance(void)
-{
+void do_final_instance(void) {
int i;
- for( i = 1; i < MAX_INSTANCE; i++ )
+ for(i = 0; i < instance->instances; i++) {
instance_destroy(i);
+ }
+
+ aFree(instances);
}
-void do_init_instance(void)
-{
- memset(instance, 0x00, sizeof(instance));
+void do_init_instance(void) {
add_timer_func_list(instance_destroy_timer, "instance_destroy_timer");
}
+
+void instance_defaults(void) {
+ instance = &instance_s;
+
+ instance->init = do_init_instance;
+ instance->final = do_final_instance;
+
+ /* start point */
+ instance->start_id = 0;
+ /* count */
+ instance->instances = 0;
+
+ /* */
+ instance->create = instance_create;
+ instance->add_map = instance_add_map;
+ instance->del_map = instance_del_map;
+ instance->map2imap = instance_map2imap;
+ instance->mapid2imapid = instance_mapid2imapid;
+ instance->destroy = instance_destroy;
+ instance->start = instance_init;
+ instance->check_idle = instance_check_idle;
+ instance->check_kick = instance_check_kick;
+ instance->set_timeout = instance_set_timeout;
+ instance->valid = instance_is_valid;
+}
diff --git a/src/map/instance.h b/src/map/instance.h
index 03b0d0898..e86586e44 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -1,51 +1,71 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _INSTANCE_H_
#define _INSTANCE_H_
-#define MAX_MAP_PER_INSTANCE 10
-#define MAX_INSTANCE 500
-
#define INSTANCE_NAME_LENGTH (60+1)
-typedef enum instance_state { INSTANCE_FREE, INSTANCE_IDLE, INSTANCE_BUSY } instance_state;
+typedef enum instance_state {
+ INSTANCE_FREE,
+ INSTANCE_IDLE,
+ INSTANCE_BUSY
+} instance_state;
+
+enum instance_owner_type {
+ IOT_NONE,
+ IOT_CHAR,
+ IOT_PARTY,
+ IOT_GUILD,
+ /* ... */
+ IOT_MAX,
+};
-struct s_instance {
+struct instance_data {
+ unsigned short id;
char name[INSTANCE_NAME_LENGTH]; // Instance Name - required for clif functions.
instance_state state;
- short instance_id;
- int party_id;
+ enum instance_owner_type owner_type;
+ int owner_id;
- int map[MAX_MAP_PER_INSTANCE];
- int num_map;
- int users;
+ unsigned short *map;
+ unsigned short num_map;
+ unsigned short users;
struct DBMap* vars; // Instance Variable for scripts
int progress_timer;
- time_t progress_timeout;
+ unsigned int progress_timeout;
int idle_timer;
- time_t idle_timeout, idle_timeoutval;
+ unsigned int idle_timeout, idle_timeoutval;
};
-extern int instance_start;
-extern struct s_instance instance[MAX_INSTANCE];
+struct instance_data *instances;
-int instance_create(int party_id, const char *name);
-int instance_add_map(const char *name, int instance_id, bool usebasename);
-void instance_del_map(int16 m);
-int instance_map2imap(int16 m, int instance_id);
-int instance_mapid2imapid(int16 m, int instance_id);
-void instance_destroy(int instance_id);
-void instance_init(int instance_id);
+struct instance_interface {
+ void (*init) (void);
+ void (*final) (void);
+ /* start point */
+ unsigned short start_id;
+ unsigned short instances;
+ /* */
+ int (*create) (int party_id, const char *name, enum instance_owner_type type);
+ int (*add_map) (const char *name, int instance_id, bool usebasename, const char *map_name);
+ void (*del_map) (int16 m);
+ int (*map2imap) (int16 m, int instance_id);
+ int (*mapid2imapid) (int16 m, int instance_id);
+ void (*destroy) (int instance_id);
+ void (*start) (int instance_id);
+ void (*check_idle) (int instance_id);
+ void (*check_kick) (struct map_session_data *sd);
+ void (*set_timeout) (int instance_id, unsigned int progress_timeout, unsigned int idle_timeout);
+ bool (*valid) (int instance_id);
+} instance_s;
-void instance_check_idle(int instance_id);
-void instance_check_kick(struct map_session_data *sd);
-void instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout);
+struct instance_interface *instance;
-void do_final_instance(void);
-void do_init_instance(void);
+void instance_defaults(void);
#endif
diff --git a/src/map/intif.c b/src/map/intif.c
index 93bb8add7..9e6403f10 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -467,7 +467,7 @@ int intif_party_changemap(struct map_session_data *sd,int online)
if(!sd)
return 0;
- if( (m=map_mapindex2mapid(sd->mapindex)) >= 0 && map[m].instance_id )
+ if( (m=map_mapindex2mapid(sd->mapindex)) >= 0 && map[m].instance_id >= 0 )
mapindex = map[map[m].instance_src_map].index;
else
mapindex = sd->mapindex;
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index 0e155011e..bfaf18af0 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -22,12 +22,16 @@
char send_string[200];
int irc_connect_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ struct hSockOpt opt;
if( ircbot->isOn || ++ircbot->fails >= 3 )
return 0;
+ opt.silent = 1;
+ opt.setTimeo = 0;
+
ircbot->last_try = gettick();
- if( ( ircbot->fd = make_connection(ircbot->ip,hChSys.irc_server_port,true) ) > 0 ){
+ if( ( ircbot->fd = make_connection(ircbot->ip,hChSys.irc_server_port,&opt) ) > 0 ){
session[ircbot->fd]->func_parse = ircbot->parse;
session[ircbot->fd]->flag.server = 1;
add_timer(gettick() + 3000, ircbot->identify_timer, 0, 0);
diff --git a/src/map/map.c b/src/map/map.c
index d4c15cd6e..54646d1c3 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -101,7 +101,7 @@ static DBMap* id_db=NULL; // int id -> struct block_list*
static DBMap* pc_db=NULL; // int id -> struct map_session_data*
static DBMap* mobid_db=NULL; // int id -> struct mob_data*
static DBMap* bossid_db=NULL; // int id -> struct mob_data* (MVP db)
-static DBMap* map_db=NULL; // unsigned int mapindex -> struct map_data*
+static DBMap* map_db=NULL; // unsigned int mapindex -> struct map_data_other_server*
static DBMap* nick_db=NULL; // int char_id -> struct charid2nick* (requested names of offline characters)
static DBMap* charid_db=NULL; // int char_id -> struct map_session_data*
static DBMap* regen_db=NULL; // int id -> struct block_list* (status_natural_heal processing)
@@ -150,6 +150,8 @@ struct map_cache_map_info {
int32 len;
};
+uint16 index2mapid[MAX_MAPINDEX];
+
char db_path[256] = "db";
char help_txt[256] = "conf/help.txt";
char help2_txt[256] = "conf/help2.txt";
@@ -162,6 +164,7 @@ int enable_grf = 0; //To enable/disable reading maps from GRF files, bypassing m
/* [Ind/Hercules] */
struct eri *map_iterator_ers;
+char *map_cache_buffer = NULL; // Has the uncompressed gat data of all maps, so just one allocation has to be made
/*==========================================
* server player count (of all mapservers)
@@ -397,8 +400,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if (sc->data[SC_PROPERTYWALK] &&
sc->data[SC_PROPERTYWALK]->val3 >= skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) )
status_change_end(bl,SC_PROPERTYWALK,INVALID_TIMER);
- } else
- if (bl->type == BL_NPC)
+ } else if (bl->type == BL_NPC)
npc_unsetcells((TBL_NPC*)bl);
if (moveblock) map_delblock(bl);
@@ -469,8 +471,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
skill->unit_move_unit_group(skill->id2group(sc->data[SC_HAWKEYES]->val4), bl->m, x1-x0, y1-y0);
}
}
- } else
- if (bl->type == BL_NPC)
+ } else if (bl->type == BL_NPC)
npc_setcells((TBL_NPC*)bl);
return 0;
@@ -1194,8 +1195,7 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int16 m,int16 x0,i
}
// Copy of map_foreachincell, but applied to the whole map. [Skotlex]
-int map_foreachinmap(int (*func)(struct block_list*,va_list), int16 m, int type,...)
-{
+int map_foreachinmap(int (*func)(struct block_list*,va_list), int16 m, int type,...) {
int b, bsize;
int returnCount = 0; //total sum of returned values of func() [Skotlex]
struct block_list *bl;
@@ -1233,6 +1233,52 @@ int map_foreachinmap(int (*func)(struct block_list*,va_list), int16 m, int type,
bl_list_count = blockcount;
return returnCount;
}
+// Copy of map_foreachinmap, but applied to all maps in a instance id. [Ind/Hercules]
+int map_foreachininstance(int (*func)(struct block_list*,va_list), int16 instance_id, int type,...) {
+ int b, bsize;
+ int returnCount = 0; //total sum of returned values of func() [Skotlex]
+ struct block_list *bl;
+ int blockcount = bl_list_count, i, j;
+ int16 m;
+ va_list ap;
+
+ for( j = 0; j < instances[instance_id].num_map; j++ ) {
+
+ m = instances[instance_id].map[j];
+
+ bsize = map[ m ].bxs * map[ m ].bys;
+
+ if( type&~BL_MOB )
+ for( b = 0; b < bsize; b++ )
+ for( bl = map[ m ].block[ b ]; bl != NULL; bl = bl->next )
+ if( bl->type&type && bl_list_count < BL_LIST_MAX )
+ bl_list[ bl_list_count++ ] = bl;
+
+ if( type&BL_MOB )
+ for( b = 0; b < bsize; b++ )
+ for( bl = map[ m ].block_mob[ b ]; bl != NULL; bl = bl->next )
+ if( bl_list_count < BL_LIST_MAX )
+ bl_list[ bl_list_count++ ] = bl;
+
+ if( bl_list_count >= BL_LIST_MAX )
+ ShowWarning("map_foreachininstance: block count too many!\n");
+
+ map_freeblock_lock();
+
+ for( i = blockcount; i < bl_list_count ; i++ )
+ if( bl_list[ i ]->prev ) { //func() may delete this bl_list[] slot, checking for prev ensures it wasnt queued for deletion.
+ va_start(ap, type);
+ returnCount += func(bl_list[ i ], ap);
+ va_end(ap);
+ }
+
+ map_freeblock_unlock();
+
+ }
+
+ bl_list_count = blockcount;
+ return returnCount;
+}
/// Generates a new flooritem object id from the interval [MIN_FLOORITEM, MAX_FLOORITEM).
@@ -1637,8 +1683,19 @@ int map_quit(struct map_session_data *sd) {
pc_itemcd_do(sd,false);
+ for( i = 0; i < sd->queues_count; i++ ) {
+ struct hQueue *queue;
+ if( (queue = script->queue(sd->queues[i])) && queue->onLogOut[0] != '\0' ) {
+ npc_event(sd, queue->onLogOut, 0);
+ }
+ }
+ /* two times, the npc event above may assign a new one or delete others */
+ for( i = 0; i < sd->queues_count; i++ ) {
+ script->queue_remove(sd->queues[i],sd->status.account_id);
+ }
+
npc_script_event(sd, NPCE_LOGOUT);
-
+
//Unit_free handles clearing the player related data,
//map_quit handles extra specific data which is related to quitting normally
//(changing map-servers invokes unit_free but bypasses map_quit)
@@ -1712,7 +1769,7 @@ int map_quit(struct map_session_data *sd) {
unit_remove_map_pc(sd,CLR_TELEPORT);
- if( map[sd->bl.m].instance_id ) { // Avoid map conflicts and warnings on next login
+ if( map[sd->bl.m].instance_id >= 0 ) { // Avoid map conflicts and warnings on next login
int16 m;
struct point *pt;
if( map[sd->bl.m].save.map )
@@ -1720,8 +1777,7 @@ int map_quit(struct map_session_data *sd) {
else
pt = &sd->status.save_point;
- if( (m=map_mapindex2mapid(pt->map)) >= 0 )
- {
+ if( (m=map_mapindex2mapid(pt->map)) >= 0 ) {
sd->bl.m = m;
sd->bl.x = pt->x;
sd->bl.y = pt->y;
@@ -2160,8 +2216,7 @@ bool mapit_exists(struct s_mapiterator* mapit)
/*==========================================
* Add npc-bl to id_db, basically register npc to map
*------------------------------------------*/
-bool map_addnpc(int16 m,struct npc_data *nd)
-{
+bool map_addnpc(int16 m,struct npc_data *nd) {
nullpo_ret(nd);
if( m < 0 || m >= map_num )
@@ -2188,8 +2243,7 @@ int map_addmobtolist(unsigned short m, struct spawn_data *spawn)
{
size_t i;
ARR_FIND( 0, MAX_MOB_LIST_PER_MAP, i, map[m].moblist[i] == NULL );
- if( i < MAX_MOB_LIST_PER_MAP )
- {
+ if( i < MAX_MOB_LIST_PER_MAP ) {
map[m].moblist[i] = spawn;
return i;
}
@@ -2250,13 +2304,11 @@ int map_removemobs_timer(int tid, unsigned int tick, int id, intptr_t data)
int count;
const int16 m = id;
- if (m < 0 || m >= MAX_MAP_PER_SERVER)
- { //Incorrect map id!
+ if (m < 0 || m >= map_num) { //Incorrect map id!
ShowError("map_removemobs_timer error: timer %d points to invalid map %d\n",tid, m);
return 0;
}
- if (map[m].mob_delete_timer != tid)
- { //Incorrect timer call!
+ if (map[m].mob_delete_timer != tid) { //Incorrect timer call!
ShowError("map_removemobs_timer mismatch: %d != %d (map %s)\n",map[m].mob_delete_timer, tid, map[m].name);
return 0;
}
@@ -2283,8 +2335,7 @@ void map_removemobs(int16 m)
/*==========================================
* Hookup, get map_id from map_name
*------------------------------------------*/
-int16 map_mapname2mapid(const char* name)
-{
+int16 map_mapname2mapid(const char* name) {
unsigned short map_index;
map_index = mapindex_name2id(name);
if (!map_index)
@@ -2295,24 +2346,18 @@ int16 map_mapname2mapid(const char* name)
/*==========================================
* Returns the map of the given mapindex. [Skotlex]
*------------------------------------------*/
-int16 map_mapindex2mapid(unsigned short mapindex)
-{
- struct map_data *md=NULL;
+int16 map_mapindex2mapid(unsigned short mapindex) {
- if (!mapindex)
+ if (!mapindex || mapindex > MAX_MAPINDEX)
return -1;
- md = (struct map_data*)uidb_get(map_db,(unsigned int)mapindex);
- if(md==NULL || md->cell==NULL)
- return -1;
- return md->m;
+ return index2mapid[mapindex] == 0 ? -1 : index2mapid[mapindex];
}
/*==========================================
* Switching Ip, port ? (like changing map_server) get ip/port from map_name
*------------------------------------------*/
-int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port)
-{
+int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port) {
struct map_data_other_server *mdos;
mdos = (struct map_data_other_server*)uidb_get(map_db,(unsigned int)name);
@@ -2443,8 +2488,7 @@ inline static struct mapcell map_gat2cell(int gat) {
return cell;
}
-static int map_cell2gat(struct mapcell cell)
-{
+static int map_cell2gat(struct mapcell cell) {
if( cell.walkable == 1 && cell.shootable == 1 && cell.water == 0 ) return 0;
if( cell.walkable == 0 && cell.shootable == 0 && cell.water == 0 ) return 1;
if( cell.walkable == 1 && cell.shootable == 1 && cell.water == 1 ) return 3;
@@ -2453,17 +2497,42 @@ static int map_cell2gat(struct mapcell cell)
ShowWarning("map_cell2gat: cell has no matching gat type\n");
return 1; // default to 'wall'
}
+int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk);
+void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag);
+void map_cellfromcache(struct map_data *m) {
+ char decode_buffer[MAX_MAP_SIZE];
+ struct map_cache_map_info *info = NULL;
+
+ if( (info = (struct map_cache_map_info *)m->cellPos) ) {
+ unsigned long size, xy;
+ int i;
+
+ size = (unsigned long)info->xs*(unsigned long)info->ys;
+
+ // TO-DO: Maybe handle the scenario, if the decoded buffer isn't the same size as expected? [Shinryo]
+ decode_zip(decode_buffer, &size, m->cellPos+sizeof(struct map_cache_map_info), info->len);
+ CREATE(m->cell, struct mapcell, size);
+
+ for( xy = 0; xy < size; ++xy )
+ m->cell[xy] = map_gat2cell(decode_buffer[xy]);
+
+ m->getcellp = map_getcellp;
+ m->setcell = map_setcell;
+
+ for(i = 0; i < m->npc_num; i++) {
+ npc_setcells(m->npc[i]);
+ }
+ }
+}
/*==========================================
* Confirm if celltype in (m,x,y) match the one given in cellchk
*------------------------------------------*/
-int map_getcell(int16 m,int16 x,int16 y,cell_chk cellchk)
-{
- return (m < 0 || m >= MAX_MAP_PER_SERVER) ? 0 : map_getcellp(&map[m],x,y,cellchk);
+int map_getcell(int16 m,int16 x,int16 y,cell_chk cellchk) {
+ return (m < 0 || m >= map_num) ? 0 : map[m].getcellp(&map[m],x,y,cellchk);
}
-int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk)
-{
+int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
struct mapcell cell;
nullpo_ret(m);
@@ -2474,8 +2543,7 @@ int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk)
cell = m->cell[x + y*m->xs];
- switch(cellchk)
- {
+ switch(cellchk) {
// gat type retrieval
case CELL_GETTYPE:
return map_cell2gat(cell);
@@ -2534,13 +2602,19 @@ int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk)
}
}
+/* [Ind/Hercules] */
+int map_sub_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
+ map_cellfromcache(m);
+ m->getcellp = map_getcellp;
+ m->setcell = map_setcell;
+ return m->getcellp(m,x,y,cellchk);
+}
/*==========================================
* Change the type/flags of a map cell
* 'cell' - which flag to modify
* 'flag' - true = on, false = off
*------------------------------------------*/
-void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag)
-{
+void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
int j;
if( m < 0 || m >= map_num || x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys )
@@ -2565,7 +2639,16 @@ void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag)
break;
}
}
-
+void map_sub_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
+
+ if( m < 0 || m >= map_num || x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys )
+ return;
+
+ map_cellfromcache(&map[m]);
+ map[m].setcell = map_setcell;
+ map[m].getcellp = map_getcellp;
+ map[m].setcell(m,x,y,cell,flag);
+}
void map_setgatcell(int16 m, int16 x, int16 y, int gat)
{
int j;
@@ -2635,8 +2718,8 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
if( map_getcell(m, x1, y1, CELL_CHKNOREACH) )
break; // Collision
- map_setcell(m, x1, y1, CELL_WALKABLE, false);
- map_setcell(m, x1, y1, CELL_SHOOTABLE, shootable);
+ map[m].setcell(m, x1, y1, CELL_WALKABLE, false);
+ map[m].setcell(m, x1, y1, CELL_SHOOTABLE, shootable);
clif->changemapcell(0, m, x1, y1, map_getcell(m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
@@ -2682,8 +2765,8 @@ void map_iwall_remove(const char *wall_name)
for( i = 0; i < iwall->size; i++ ) {
map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
- map_setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
- map_setcell(iwall->m, x1, y1, CELL_WALKABLE, true);
+ map[iwall->m].setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
+ map[iwall->m].setcell(iwall->m, x1, y1, CELL_WALKABLE, true);
clif->changemapcell(0, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
@@ -2740,8 +2823,7 @@ int map_eraseallipport_sub(DBKey key, DBData *data, va_list va)
return 0;
}
-int map_eraseallipport(void)
-{
+int map_eraseallipport(void) {
map_db->foreach(map_db,map_eraseallipport_sub);
return 1;
}
@@ -2749,8 +2831,7 @@ int map_eraseallipport(void)
/*==========================================
* Delete mapindex from db of another map server
*------------------------------------------*/
-int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port)
-{
+int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port) {
struct map_data_other_server *mdos;
mdos = (struct map_data_other_server*)uidb_get(map_db,(unsigned int)mapindex);
@@ -2800,13 +2881,12 @@ static char *map_init_mapcache(FILE *fp)
* Map cache reading
* [Shinryo]: Optimized some behaviour to speed this up
*==========================================*/
-int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer)
-{
+int map_readfromcache(struct map_data *m, char *buffer) {
int i;
struct map_cache_main_header *header = (struct map_cache_main_header *)buffer;
struct map_cache_map_info *info = NULL;
char *p = buffer + sizeof(struct map_cache_main_header);
-
+
for(i = 0; i < header->map_count; i++) {
info = (struct map_cache_map_info *)p;
@@ -2818,8 +2898,8 @@ int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer)
}
if( info && i < header->map_count ) {
- unsigned long size, xy;
-
+ unsigned long size;
+
if( info->xs <= 0 || info->ys <= 0 )
return 0;// Invalid
@@ -2831,51 +2911,30 @@ int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer)
ShowWarning("map_readfromcache: %s exceeded MAX_MAP_SIZE of %d\n", info->name, MAX_MAP_SIZE);
return 0; // Say not found to remove it from list.. [Shinryo]
}
-
- // TO-DO: Maybe handle the scenario, if the decoded buffer isn't the same size as expected? [Shinryo]
- decode_zip(decode_buffer, &size, p+sizeof(struct map_cache_map_info), info->len);
-
- CREATE(m->cell, struct mapcell, size);
-
-
- for( xy = 0; xy < size; ++xy )
- m->cell[xy] = map_gat2cell(decode_buffer[xy]);
-
+
+ m->cellPos = p;
+ m->cell = (struct mapcell *)0xdeadbeaf;
+
return 1;
}
return 0; // Not found
}
-int map_addmap(char* mapname)
-{
- if( strcmpi(mapname,"clear")==0 )
- {
- map_num = 0;
- instance_start = 0;
- return 0;
- }
-
- if( map_num >= MAX_MAP_PER_SERVER - 1 )
- {
- ShowError("Could not add map '"CL_WHITE"%s"CL_RESET"', the limit of maps has been reached.\n",mapname);
- return 1;
- }
- mapindex_getmapname(mapname, map[map_num].name);
- map_num++;
+int map_addmap(char* mapname) {
+ map[map_num].instance_id = -1;
+ mapindex_getmapname(mapname, map[map_num++].name);
return 0;
}
-static void map_delmapid(int id)
-{
+static void map_delmapid(int id) {
ShowNotice("Removing map [ %s ] from maplist"CL_CLL"\n",map[id].name);
memmove(map+id, map+id+1, sizeof(map[0])*(map_num-id-1));
map_num--;
}
-int map_delmap(char* mapname)
-{
+int map_delmap(char* mapname) {
int i;
char map_name[MAP_NAME_LENGTH];
@@ -2958,13 +3017,62 @@ void map_zone_db_clear(void) {
}
aFree(map_zone_all.capped_skills);
}
-
+void map_clean(int i) {
+ int v;
+ if(map[i].cell && map[i].cell != (struct mapcell *)0xdeadbeaf) aFree(map[i].cell);
+ if(map[i].block) aFree(map[i].block);
+ if(map[i].block_mob) aFree(map[i].block_mob);
+
+ if(battle_config.dynamic_mobs) { //Dynamic mobs flag by [random]
+ int j;
+ if(map[i].mob_delete_timer != INVALID_TIMER)
+ delete_timer(map[i].mob_delete_timer, map_removemobs_timer);
+ for (j=0; j<MAX_MOB_LIST_PER_MAP; j++)
+ if (map[i].moblist[j]) aFree(map[i].moblist[j]);
+ }
+
+ if( map[i].unit_count ) {
+ for(v = 0; v < map[i].unit_count; v++) {
+ aFree(map[i].units[v]);
+ }
+ if( map[i].units ) {
+ aFree(map[i].units);
+ map[i].units = NULL;
+ }
+ map[i].unit_count = 0;
+ }
+
+ if( map[i].skill_count ) {
+ for(v = 0; v < map[i].skill_count; v++) {
+ aFree(map[i].skills[v]);
+ }
+ if( map[i].skills ) {
+ aFree(map[i].skills);
+ map[i].skills = NULL;
+ }
+ map[i].skill_count = 0;
+ }
+
+ if( map[i].zone_mf_count ) {
+ for(v = 0; v < map[i].zone_mf_count; v++) {
+ aFree(map[i].zone_mf[v]);
+ }
+ if( map[i].zone_mf ) {
+ aFree(map[i].zone_mf);
+ map[i].zone_mf = NULL;
+ }
+ map[i].zone_mf_count = 0;
+ }
+
+ if( map[i].channel )
+ clif->chsys_delete(map[i].channel);
+}
void do_final_maps(void) {
int i, v = 0;
for( i = 0; i < map_num; i++ ) {
- if(map[i].cell) aFree(map[i].cell);
+ if(map[i].cell && map[i].cell != (struct mapcell *)0xdeadbeaf ) aFree(map[i].cell);
if(map[i].block) aFree(map[i].block);
if(map[i].block_mob) aFree(map[i].block_mob);
@@ -3009,6 +3117,12 @@ void do_final_maps(void) {
map[i].zone_mf_count = 0;
}
+ if( map[i].drop_list_count ) {
+ map[i].drop_list_count = 0;
+ }
+ if( map[i].drop_list != NULL )
+ aFree(map[i].drop_list);
+
if( map[i].channel )
clif->chsys_delete(map[i].channel);
}
@@ -3028,7 +3142,10 @@ void map_flags_init(void) {
map[i].nocommand = 0; // nocommand mapflag level
map[i].bexp = 100; // per map base exp multiplicator
map[i].jexp = 100; // per map job exp multiplicator
- memset(map[i].drop_list, 0, sizeof(map[i].drop_list)); // pvp nightmare drop list
+ if( map[i].drop_list != NULL )
+ aFree(map[i].drop_list);
+ map[i].drop_list = NULL;
+ map[i].drop_list_count = 0;
if( map[i].unit_count ) {
for(v = 0; v < map[i].unit_count; v++) {
@@ -3153,14 +3270,12 @@ int map_readgat (struct map_data* m)
/*======================================
* Add/Remove map to the map_db
*--------------------------------------*/
-void map_addmap2db(struct map_data *m)
-{
- uidb_put(map_db, (unsigned int)m->index, m);
+void map_addmap2db(struct map_data *m) {
+ index2mapid[m->index] = m->m;
}
-void map_removemapdb(struct map_data *m)
-{
- uidb_remove(map_db, (unsigned int)m->index);
+void map_removemapdb(struct map_data *m) {
+ index2mapid[m->index] = 0;
}
/*======================================
@@ -3170,8 +3285,6 @@ int map_readallmaps (void) {
int i;
FILE* fp=NULL;
int maps_removed = 0;
- char *map_cache_buffer = NULL; // Has the uncompressed gat data of all maps, so just one allocation has to be made
- char map_cache_decode_buffer[MAX_MAP_SIZE];
if( enable_grf )
ShowStatus("Loading maps (using GRF files)...\n");
@@ -3203,7 +3316,7 @@ int map_readallmaps (void) {
if( !
(enable_grf?
map_readgat(&map[i])
- :map_readfromcache(&map[i], map_cache_buffer, map_cache_decode_buffer))
+ :map_readfromcache(&map[i], map_cache_buffer))
) {
map_delmapid(i);
maps_removed++;
@@ -3213,10 +3326,9 @@ int map_readallmaps (void) {
map[i].index = mapindex_name2id(map[i].name);
- if (uidb_get(map_db,(unsigned int)map[i].index) != NULL)
- {
+ if ( index2mapid[map[i].index] != 0 ) {
ShowWarning("Map %s already loaded!"CL_CLL"\n", map[i].name);
- if (map[i].cell) {
+ if (map[i].cell && map[i].cell != (struct mapcell *)0xdeadbeaf) {
aFree(map[i].cell);
map[i].cell = NULL;
}
@@ -3225,10 +3337,10 @@ int map_readallmaps (void) {
i--;
continue;
}
-
+
+ map[i].m = i;
map_addmap2db(&map[i]);
- map[i].m = i;
memset(map[i].moblist, 0, sizeof(map[i].moblist)); //Initialize moblist [Skotlex]
map[i].mob_delete_timer = INVALID_TIMER; //Initialize timer [Skotlex]
@@ -3238,6 +3350,9 @@ int map_readallmaps (void) {
size = map[i].bxs * map[i].bys * sizeof(struct block_list*);
map[i].block = (struct block_list**)aCalloc(size, 1);
map[i].block_mob = (struct block_list**)aCalloc(size, 1);
+
+ map[i].getcellp = map_sub_getcellp;
+ map[i].setcell = map_sub_setcell;
}
// intialization and configuration-dependent adjustments of mapflags
@@ -3245,14 +3360,11 @@ int map_readallmaps (void) {
if( !enable_grf ) {
fclose(fp);
-
- // The cache isn't needed anymore, so free it.. [Shinryo]
- aFree(map_cache_buffer);
}
// finished map loading
ShowInfo("Successfully loaded '"CL_WHITE"%d"CL_RESET"' maps."CL_CLL"\n",map_num);
- instance_start = map_num; // Next Map Index will be instances
+ instance->start_id = map_num; // Next Map Index will be instances
if (maps_removed)
ShowNotice("Maps removed: '"CL_WHITE"%d"CL_RESET"'\n",maps_removed);
@@ -3267,20 +3379,17 @@ static int char_ip_set = 0;
/*==========================================
* Read map server configuration files (conf/map_server.conf...)
*------------------------------------------*/
-int map_config_read(char *cfgName)
-{
+int map_config_read(char *cfgName) {
char line[1024], w1[1024], w2[1024];
FILE *fp;
fp = fopen(cfgName,"r");
- if( fp == NULL )
- {
+ if( fp == NULL ) {
ShowError("Map configuration file not found at: %s\n", cfgName);
return 1;
}
- while( fgets(line, sizeof(line), fp) )
- {
+ while( fgets(line, sizeof(line), fp) ) {
char* ptr;
if( line[0] == '/' && line[1] == '/' )
@@ -3320,9 +3429,9 @@ int map_config_read(char *cfgName)
clif->setport(atoi(w2));
map_port = (atoi(w2));
} else if (strcmpi(w1, "map") == 0)
- map_addmap(w2);
+ map_num++;
else if (strcmpi(w1, "delmap") == 0)
- map_delmap(w2);
+ map_num--;
else if (strcmpi(w1, "npc") == 0)
npc_addsrcfile(w2);
else if (strcmpi(w1, "delnpc") == 0)
@@ -3362,7 +3471,43 @@ int map_config_read(char *cfgName)
fclose(fp);
return 0;
}
-
+int map_config_read_sub(char *cfgName) {
+ char line[1024], w1[1024], w2[1024];
+ FILE *fp;
+
+ fp = fopen(cfgName,"r");
+ if( fp == NULL ) {
+ ShowError("Map configuration file not found at: %s\n", cfgName);
+ return 1;
+ }
+
+ while( fgets(line, sizeof(line), fp) ) {
+ char* ptr;
+
+ if( line[0] == '/' && line[1] == '/' )
+ continue;
+ if( (ptr = strstr(line, "//")) != NULL )
+ *ptr = '\n'; //Strip comments
+ if( sscanf(line, "%[^:]: %[^\t\r\n]", w1, w2) < 2 )
+ continue;
+
+ //Strip trailing spaces
+ ptr = w2 + strlen(w2);
+ while (--ptr >= w2 && *ptr == ' ');
+ ptr++;
+ *ptr = '\0';
+
+ if (strcmpi(w1, "map") == 0)
+ map_addmap(w2);
+ else if (strcmpi(w1, "delmap") == 0)
+ map_delmap(w2);
+ else if (strcmpi(w1, "import") == 0)
+ map_config_read_sub(w2);
+ }
+
+ fclose(fp);
+ return 0;
+}
void map_reloadnpc_sub(char *cfgName)
{
char line[1024], w1[1024], w2[1024];
@@ -4849,11 +4994,12 @@ void read_map_zone_db(void) {
/**
* @see DBApply
*/
-int map_db_final(DBKey key, DBData *data, va_list ap)
-{
+int map_db_final(DBKey key, DBData *data, va_list ap) {
struct map_data_other_server *mdos = DB->data2ptr(data);
- if(mdos && mdos->cell == NULL)
+
+ if(mdos && malloclib->verify_ptr(mdos) && mdos->cell == NULL)
aFree(mdos);
+
return 0;
}
@@ -4877,8 +5023,7 @@ int nick_db_final(DBKey key, DBData *data, va_list args)
return 0;
}
-int cleanup_sub(struct block_list *bl, va_list ap)
-{
+int cleanup_sub(struct block_list *bl, va_list ap) {
nullpo_ret(bl);
switch(bl->type) {
@@ -4932,6 +5077,8 @@ void do_final(void)
map_quit(sd);
mapit->free(iter);
+ instance->final();
+
/* prepares npcs for a faster shutdown process */
do_clear_npc();
@@ -4954,7 +5101,6 @@ void do_final(void)
clif->final();
do_final_npc();
script->final();
- do_final_instance();
do_final_itemdb();
do_final_storage();
guild->final();
@@ -4993,6 +5139,9 @@ void do_final(void)
aFree(map);
+ if( !enable_grf )
+ aFree(map_cache_buffer);
+
ShowStatus("Finished.\n");
}
@@ -5196,10 +5345,12 @@ void map_defaults(void) {
void load_defaults(void) {
atcommand_defaults();
battle_defaults();
+ battleground_defaults();
buyingstore_defaults();
clif_defaults();
guild_defaults();
homunculus_defaults();
+ instance_defaults();
ircbot_defaults();
log_defaults();
map_defaults();
@@ -5228,79 +5379,50 @@ int do_init(int argc, char *argv[])
rnd_init();
- for( i = 1; i < argc ; i++ )
- {
+ for( i = 1; i < argc ; i++ ) {
const char* arg = argv[i];
- if( arg[0] != '-' && ( arg[0] != '/' || arg[1] == '-' ) )
- {// -, -- and /
+ if( arg[0] != '-' && ( arg[0] != '/' || arg[1] == '-' ) ) {// -, -- and /
ShowError("Unknown option '%s'.\n", argv[i]);
exit(EXIT_FAILURE);
- }
- else if( (++arg)[0] == '-' )
- {// long option
+ } else if( (++arg)[0] == '-' ) {// long option
arg++;
- if( strcmp(arg, "help") == 0 )
- {
+ if( strcmp(arg, "help") == 0 ) {
map_helpscreen(true);
- }
- else if( strcmp(arg, "version") == 0 )
- {
+ } else if( strcmp(arg, "version") == 0 ) {
map_versionscreen(true);
- }
- else if( strcmp(arg, "map-config") == 0 )
- {
+ } else if( strcmp(arg, "map-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
MAP_CONF_NAME = argv[++i];
- }
- else if( strcmp(arg, "battle-config") == 0 )
- {
+ } else if( strcmp(arg, "battle-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
BATTLE_CONF_FILENAME = argv[++i];
- }
- else if( strcmp(arg, "atcommand-config") == 0 )
- {
+ } else if( strcmp(arg, "atcommand-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
ATCOMMAND_CONF_FILENAME = argv[++i];
- }
- else if( strcmp(arg, "script-config") == 0 )
- {
+ } else if( strcmp(arg, "script-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
SCRIPT_CONF_NAME = argv[++i];
- }
- else if( strcmp(arg, "msg-config") == 0 )
- {
+ } else if( strcmp(arg, "msg-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
MSG_CONF_NAME = argv[++i];
- }
- else if( strcmp(arg, "grf-path-file") == 0 )
- {
+ } else if( strcmp(arg, "grf-path-file") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
GRF_PATH_FILENAME = argv[++i];
- }
- else if( strcmp(arg, "inter-config") == 0 )
- {
+ } else if( strcmp(arg, "inter-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
INTER_CONF_NAME = argv[++i];
- }
- else if( strcmp(arg, "log-config") == 0 )
- {
+ } else if( strcmp(arg, "log-config") == 0 ) {
if( map_arg_next_value(arg, i, argc) )
LOG_CONF_NAME = argv[++i];
- }
- else if( strcmp(arg, "run-once") == 0 ) // close the map-server as soon as its done.. for testing [Celest]
- {
+ } else if( strcmp(arg, "run-once") == 0 ) { // close the map-server as soon as its done.. for testing [Celest]
runflag = CORE_ST_STOP;
- }
- else
- {
+ } else {
ShowError("Unknown option '%s'.\n", argv[i]);
exit(EXIT_FAILURE);
}
- }
- else switch( arg[0] )
- {// short option
+ } else switch( arg[0] ) {// short option
case '?':
case 'h':
map_helpscreen(true);
@@ -5313,12 +5435,13 @@ int do_init(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
-
- CREATE(map,struct map_data,MAX_MAP_PER_SERVER);
-
+ memset(&index2mapid, 0, sizeof(index2mapid));
+
load_defaults();
-
map_config_read(MAP_CONF_NAME);
+ CREATE(map,struct map_data,map_num);
+ map_num = 0;
+ map_config_read_sub(MAP_CONF_NAME);
// loads npcs
map_reloadnpc(false);
@@ -5384,7 +5507,7 @@ int do_init(int argc, char *argv[])
atcommand->init();
battle->init();
- do_init_instance();
+ instance->init();
do_init_chrif();
clif->init();
ircbot->init();
diff --git a/src/map/map.h b/src/map/map.h
index 751cf62f6..c8c1aae12 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -27,20 +27,18 @@ enum E_MAPSERVER_ST {
MAPSERVER_ST_LAST
};
-
#define MAX_NPC_PER_MAP 512
#define AREA_SIZE battle_config.area_size
#define DAMAGELOG_SIZE 30
#define LOOTITEM_SIZE 10
-#define MAX_MOBSKILL 50 // Max 128 - See mob skill_idx type if you need this higher.
-#define MAX_MOB_LIST_PER_MAP 128
+#define MAX_MOBSKILL 50
+#define MAX_MOB_LIST_PER_MAP 100
#define MAX_EVENTQUEUE 2
#define MAX_EVENTTIMER 32
#define NATURAL_HEAL_INTERVAL 500
#define MIN_FLOORITEM 2
#define MAX_FLOORITEM START_ACCOUNT_NUM
#define MAX_LEVEL 150
-#define MAX_DROP_PER_MAP 48
#define MAX_IGNORE_LIST 20 // official is 14
#define MAX_VENDING 12
#define MAX_MAP_SIZE 512*512 // Wasn't there something like this already? Can't find it.. [Shinryo]
@@ -232,8 +230,8 @@ enum {
// No Kill Steal Protection
#define map_flag_ks(m) (map[m].flag.town || map[m].flag.pvp || map[m].flag.gvg || map[m].flag.battleground)
-//This stackable implementation does not mean a BL can be more than one type at a time, but it's
-// meant to make it easier to check for multiple types at a time on invocations such as map_foreach* calls. [Skotlex]
+//This stackable implementation does not means a BL can be more than one type at a time, but it's
+// meant to make it easier to check for multiple types at a time on invocations such as map_foreach* calls [Skotlex]
enum bl_type {
BL_NUL = 0x000,
BL_PC = 0x001,
@@ -558,6 +556,12 @@ void map_zone_change2(int m, struct map_zone_data *zone);
struct map_zone_data map_zone_all;/* used as a base on all maps */
struct map_zone_data map_zone_pk;/* used for (pk_mode) */
+struct map_drop_list {
+ int drop_id;
+ int drop_type;
+ int drop_per;
+};
+
struct map_data {
char name[MAP_NAME_LENGTH];
@@ -625,11 +629,8 @@ struct map_data {
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
- struct {
- int drop_id;
- int drop_type;
- int drop_per;
- } drop_list[MAX_DROP_PER_MAP];
+ struct map_drop_list *drop_list;
+ unsigned short drop_list_count;
struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer]
int mob_delete_timer; // [Skotlex]
@@ -676,6 +677,14 @@ struct map_data {
unsigned short short_damage_rate;
/* long_damage_rate mapflag */
unsigned short long_damage_rate;
+
+ /* instance unique name */
+ char *cName;
+
+ /* */
+ int (*getcellp)(struct map_data* m,int16 x,int16 y,cell_chk cellchk);
+ void (*setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
+ char *cellPos;
};
/// Stores information about a remote map (for multi-mapserver setups).
@@ -689,8 +698,6 @@ struct map_data_other_server {
};
int map_getcell(int16 m,int16 x,int16 y,cell_chk cellchk);
-int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk);
-void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag);
void map_setgatcell(int16 m, int16 x, int16 y, int gat);
struct map_data *map;
@@ -711,6 +718,8 @@ extern char charhelp_txt[];
extern char wisp_server_name[];
+void map_cellfromcache(struct map_data *m);
+
// users
void map_setusers(int);
int map_getusers(void);
@@ -733,6 +742,7 @@ int map_foreachinmovearea(int (*func)(struct block_list*,va_list), struct block_
int map_foreachincell(int (*func)(struct block_list*,va_list), int16 m, int16 x, int16 y, int type, ...);
int map_foreachinpath(int (*func)(struct block_list*,va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int length, int type, ...);
int map_foreachinmap(int (*func)(struct block_list*,va_list), int16 m, int type, ...);
+int map_foreachininstance(int (*func)(struct block_list*,va_list), int16 instance_id, int type,...);
//blocklist nb in one cell
int map_count_oncell(int16 m,int16 x,int16 y,int type);
struct skill_unit *map_find_skill_unit_oncell(struct block_list *,int16 x,int16 y,uint16 skill_id,struct skill_unit *, int flag);
@@ -831,6 +841,7 @@ void map_removemobs(int16 m); // [Wizputer]
void do_reconnect_map(void); //Invoked on map-char reconnection [Skotlex]
void map_addmap2db(struct map_data *m);
void map_removemapdb(struct map_data *m);
+void map_clean(int i);
extern char *INTER_CONF_NAME;
extern char *LOG_CONF_NAME;
diff --git a/src/map/mob.c b/src/map/mob.c
index 57325ba1c..433e979f3 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -137,7 +137,7 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
nd->bl.id = md->tomb_nid = npc_get_new_npc_id();
- nd->ud.dir = md->ud.dir;
+ nd->dir = md->ud.dir;
nd->bl.m = md->bl.m;
nd->bl.x = md->bl.x;
nd->bl.y = md->bl.y;
@@ -262,8 +262,7 @@ int mob_parse_dataset(struct spawn_data *data)
/*==========================================
* Generates the basic mob data using the spawn_data provided.
*------------------------------------------*/
-struct mob_data* mob_spawn_dataset(struct spawn_data *data)
-{
+struct mob_data* mob_spawn_dataset(struct spawn_data *data) {
struct mob_data *md = (struct mob_data*)aCalloc(1, sizeof(struct mob_data));
md->bl.id= npc_get_new_npc_id();
md->bl.type = BL_MOB;
@@ -290,7 +289,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data)
status_set_viewdata(&md->bl, md->class_);
status_change_init(&md->bl);
unit_dataset(&md->bl);
-
+
map_addiddb(&md->bl);
return md;
}
diff --git a/src/map/npc.c b/src/map/npc.c
index 7d0d5c6e1..bff6be30c 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -122,7 +122,7 @@ struct view_data* npc_get_viewdata(int class_)
static int npc_isnear_sub(struct block_list* bl, va_list args) {
struct npc_data *nd = (struct npc_data*)bl;
- if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
+ if( nd->option & (OPTION_HIDE|OPTION_INVISIBLE) )
return 0;
return 1;
@@ -175,7 +175,7 @@ int npc_enable_sub(struct block_list *bl, va_list ap)
{
TBL_PC *sd = (TBL_PC*)bl;
- if (nd->sc.option&OPTION_INVISIBLE)
+ if (nd->option&OPTION_INVISIBLE)
return 1;
if( npc_ontouch_event(sd,nd) > 0 && npc_ontouch2_event(sd,nd) > 0 )
@@ -204,20 +204,20 @@ int npc_enable(const char* name, int flag)
}
if (flag&1) {
- nd->sc.option&=~OPTION_INVISIBLE;
+ nd->option&=~OPTION_INVISIBLE;
clif->spawn(&nd->bl);
} else if (flag&2)
- nd->sc.option&=~OPTION_HIDE;
+ nd->option&=~OPTION_HIDE;
else if (flag&4)
- nd->sc.option|= OPTION_HIDE;
+ nd->option|= OPTION_HIDE;
else { //Can't change the view_data to invisible class because the view_data for all npcs is shared! [Skotlex]
- nd->sc.option|= OPTION_INVISIBLE;
+ nd->option|= OPTION_INVISIBLE;
clif->clearunit_area(&nd->bl,CLR_OUTSIGHT); // Hack to trick maya purple card [Xazax]
}
if (nd->class_ == WARP_CLASS || nd->class_ == FLAG_CLASS)
{ //Client won't display option changes for these classes [Toms]
- if (nd->sc.option&(OPTION_HIDE|OPTION_INVISIBLE))
+ if (nd->option&(OPTION_HIDE|OPTION_INVISIBLE))
clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
else
clif->spawn(&nd->bl);
@@ -385,8 +385,7 @@ static int npc_event_do_sub(DBKey key, DBData *data, va_list ap)
nullpo_ret(c = va_arg(ap, int *));
nullpo_ret(name = va_arg(ap, const char *));
- if( p && strcmpi(name, p) == 0 )
- {
+ if( p && strcmpi(name, p) == 0 ) {
run_script(ev->nd->u.scr.script,ev->pos,0,ev->nd->bl.id);
(*c)++;
}
@@ -815,7 +814,7 @@ int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char
ShowWarning("npc_event: player's event queue is full, can't add event '%s' !\n", eventname);
return 1;
}
- if( ev->nd->sc.option&OPTION_INVISIBLE )
+ if( ev->nd->option&OPTION_INVISIBLE )
{
//Disabled npc, shouldn't trigger event.
npc_event_dequeue(sd);
@@ -835,22 +834,20 @@ int npc_event(struct map_session_data* sd, const char* eventname, int ontouch)
nullpo_ret(sd);
- if( ev == NULL || (nd = ev->nd) == NULL )
- {
+ if( ev == NULL || (nd = ev->nd) == NULL ) {
if( !ontouch )
ShowError("npc_event: event not found [%s]\n", eventname);
return ontouch;
}
- switch(ontouch)
- {
- case 1:
- nd->touching_id = sd->bl.id;
- sd->touching_id = nd->bl.id;
- break;
- case 2:
- sd->areanpc_id = nd->bl.id;
- break;
+ switch(ontouch) {
+ case 1:
+ nd->touching_id = sd->bl.id;
+ sd->touching_id = nd->bl.id;
+ break;
+ case 2:
+ sd->areanpc_id = nd->bl.id;
+ break;
}
return npc_event_sub(sd,ev,eventname);
@@ -928,9 +925,8 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
//if(sd->npc_id)
// return 1;
- for(i=0;i<map[m].npc_num;i++)
- {
- if (map[m].npc[i]->sc.option&OPTION_INVISIBLE) {
+ for(i=0;i<map[m].npc_num;i++) {
+ if (map[m].npc[i]->option&OPTION_INVISIBLE) {
f=0; // a npc was found, but it is disabled; don't print warning
continue;
}
@@ -1008,13 +1004,11 @@ int npc_touch_areanpc2(struct mob_data *md)
struct event_data* ev;
int xs, ys;
- for( i = 0; i < map[m].npc_num; i++ )
- {
- if( map[m].npc[i]->sc.option&OPTION_INVISIBLE )
+ for( i = 0; i < map[m].npc_num; i++ ) {
+ if( map[m].npc[i]->option&OPTION_INVISIBLE )
continue;
- switch( map[m].npc[i]->subtype )
- {
+ switch( map[m].npc[i]->subtype ) {
case WARP:
if( !( battle_config.mob_warp&1 ) )
continue;
@@ -1087,27 +1081,25 @@ int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range)
if (!i) return 0; //No NPC_CELLs.
//Now check for the actual NPC on said range.
- for(i=0;i<map[m].npc_num;i++)
- {
- if (map[m].npc[i]->sc.option&OPTION_INVISIBLE)
+ for(i=0;i<map[m].npc_num;i++) {
+ if (map[m].npc[i]->option&OPTION_INVISIBLE)
continue;
- switch(map[m].npc[i]->subtype)
- {
- case WARP:
- if (!(flag&1))
- continue;
- xs=map[m].npc[i]->u.warp.xs;
- ys=map[m].npc[i]->u.warp.ys;
- break;
- case SCRIPT:
- if (!(flag&2))
+ switch(map[m].npc[i]->subtype) {
+ case WARP:
+ if (!(flag&1))
+ continue;
+ xs=map[m].npc[i]->u.warp.xs;
+ ys=map[m].npc[i]->u.warp.ys;
+ break;
+ case SCRIPT:
+ if (!(flag&2))
+ continue;
+ xs=map[m].npc[i]->u.scr.xs;
+ ys=map[m].npc[i]->u.scr.ys;
+ break;
+ default:
continue;
- xs=map[m].npc[i]->u.scr.xs;
- ys=map[m].npc[i]->u.scr.ys;
- break;
- default:
- continue;
}
if( x1 >= map[m].npc[i]->bl.x-xs && x0 <= map[m].npc[i]->bl.x+xs
@@ -1206,7 +1198,7 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
if ((nd = npc_checknear(sd,&nd->bl)) == NULL)
return 1;
//Hidden/Disabled npc.
- if (nd->class_ < 0 || nd->sc.option&(OPTION_INVISIBLE|OPTION_HIDE))
+ if (nd->class_ < 0 || nd->option&(OPTION_INVISIBLE|OPTION_HIDE))
return 1;
switch(nd->subtype) {
@@ -1291,7 +1283,7 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type)
sd->npc_id=0;
return 1;
}
- if (nd->sc.option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?)
+ if (nd->option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?)
return 1;
if( nd->class_ < 0 && !sd->state.callshop )
{// not called through a script and is not a visible NPC so an invalid call
@@ -1759,8 +1751,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
//Atempt to remove an npc from a map
//This doesn't remove it from map_db
-int npc_remove_map(struct npc_data* nd)
-{
+int npc_remove_map(struct npc_data* nd) {
int16 m,i;
nullpo_retr(1, nd);
@@ -1892,6 +1883,11 @@ int npc_unload(struct npc_data* nd, bool single) {
guild->flag_remove(nd);
}
+ if( nd->ud != &npc_base_ud ) {
+ aFree(nd->ud);
+ nd->ud = NULL;
+ }
+
script_stop_sleeptimers(nd->bl.id);
aFree(nd);
@@ -2060,8 +2056,7 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta
}
//Add then display an npc warp on map
-struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y)
-{
+struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) {
int i, flag = 0;
struct npc_data *nd;
@@ -2100,8 +2095,7 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short
npc_setcells(nd);
map_addblock(&nd->bl);
status_set_viewdata(&nd->bl, nd->class_);
- status_change_init(&nd->bl);
- unit_dataset(&nd->bl);
+ nd->ud = &npc_base_ud;
if( map[nd->bl.m].users )
clif->spawn(&nd->bl);
strdb_put(npcname_db, nd->exname, nd);
@@ -2166,8 +2160,7 @@ static const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const
npc_setcells(nd);
map_addblock(&nd->bl);
status_set_viewdata(&nd->bl, nd->class_);
- status_change_init(&nd->bl);
- unit_dataset(&nd->bl);
+ nd->ud = &npc_base_ud;
if( map[nd->bl.m].users )
clif->spawn(&nd->bl);
strdb_put(npcname_db, nd->exname, nd);
@@ -2275,18 +2268,15 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
++npc_shop;
nd->bl.type = BL_NPC;
nd->subtype = type;
- if( m >= 0 )
- {// normal shop npc
+ if( m >= 0 ) {// normal shop npc
map_addnpc(m,nd);
map_addblock(&nd->bl);
status_set_viewdata(&nd->bl, nd->class_);
- status_change_init(&nd->bl);
- unit_dataset(&nd->bl);
- nd->ud.dir = dir;
+ nd->ud = &npc_base_ud;
+ nd->dir = dir;
if( map[nd->bl.m].users )
clif->spawn(&nd->bl);
- } else
- {// 'floating' shop?
+ } else {// 'floating' shop?
map_addiddb(&nd->bl);
}
strdb_put(npcname_db, nd->exname, nd);
@@ -2485,23 +2475,18 @@ static const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, cons
nd->bl.type = BL_NPC;
nd->subtype = SCRIPT;
- if( m >= 0 )
- {
+ if( m >= 0 ) {
map_addnpc(m, nd);
- status_change_init(&nd->bl);
- unit_dataset(&nd->bl);
- nd->ud.dir = dir;
+ nd->ud = &npc_base_ud;
+ nd->dir = dir;
npc_setcells(nd);
map_addblock(&nd->bl);
- if( class_ >= 0 )
- {
+ if( class_ >= 0 ) {
status_set_viewdata(&nd->bl, nd->class_);
if( map[nd->bl.m].users )
clif->spawn(&nd->bl);
}
- }
- else
- {
+ } else {
// we skip map_addnpc, but still add it to the list of ID's
map_addiddb(&nd->bl);
}
@@ -2576,13 +2561,10 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
type = dnd->subtype;
// get placement
- if( (type==SHOP || type==CASHSHOP || type==SCRIPT) && strcmp(w1, "-") == 0 )
- {// floating shop/chashshop/script
+ if( (type==SHOP || type==CASHSHOP || type==SCRIPT) && strcmp(w1, "-") == 0 ) {// floating shop/chashshop/script
x = y = dir = 0;
m = -1;
- }
- else
- {
+ } else {
if( sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir) != 4 )// <map name>,<x>,<y>,<facing>
{
ShowError("npc_parse_duplicate: Invalid placement format for duplicate in file '%s', line '%d'. Skipping line...\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
@@ -2599,8 +2581,7 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
if( type == WARP && sscanf(w4, "%d,%d", &xs, &ys) == 2 );// <spanx>,<spany>
else if( type == SCRIPT && sscanf(w4, "%d,%d,%d", &class_, &xs, &ys) == 3);// <sprite id>,<triggerX>,<triggerY>
else if( type != WARP ) class_ = atoi(w4);// <sprite id>
- else
- {
+ else {
ShowError("npc_parse_duplicate: Invalid span format for duplicate warp in file '%s', line '%d'. Skipping line...\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
return end;// next line, try to continue
}
@@ -2618,56 +2599,50 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
nd->src_id = src_id;
nd->bl.type = BL_NPC;
nd->subtype = (enum npc_subtype)type;
- switch( type )
- {
- case SCRIPT:
- ++npc_script;
- nd->u.scr.xs = xs;
- nd->u.scr.ys = ys;
- nd->u.scr.script = dnd->u.scr.script;
- nd->u.scr.label_list = dnd->u.scr.label_list;
- nd->u.scr.label_list_num = dnd->u.scr.label_list_num;
- break;
-
- case SHOP:
- case CASHSHOP:
- ++npc_shop;
- nd->u.shop.shop_item = dnd->u.shop.shop_item;
- nd->u.shop.count = dnd->u.shop.count;
- break;
-
- case WARP:
- ++npc_warp;
- if( !battle_config.warp_point_debug )
- nd->class_ = WARP_CLASS;
- else
- nd->class_ = WARP_DEBUG_CLASS;
- nd->u.warp.xs = xs;
- nd->u.warp.ys = ys;
- nd->u.warp.mapindex = dnd->u.warp.mapindex;
- nd->u.warp.x = dnd->u.warp.x;
- nd->u.warp.y = dnd->u.warp.y;
- break;
+ switch( type ) {
+ case SCRIPT:
+ ++npc_script;
+ nd->u.scr.xs = xs;
+ nd->u.scr.ys = ys;
+ nd->u.scr.script = dnd->u.scr.script;
+ nd->u.scr.label_list = dnd->u.scr.label_list;
+ nd->u.scr.label_list_num = dnd->u.scr.label_list_num;
+ break;
+
+ case SHOP:
+ case CASHSHOP:
+ ++npc_shop;
+ nd->u.shop.shop_item = dnd->u.shop.shop_item;
+ nd->u.shop.count = dnd->u.shop.count;
+ break;
+
+ case WARP:
+ ++npc_warp;
+ if( !battle_config.warp_point_debug )
+ nd->class_ = WARP_CLASS;
+ else
+ nd->class_ = WARP_DEBUG_CLASS;
+ nd->u.warp.xs = xs;
+ nd->u.warp.ys = ys;
+ nd->u.warp.mapindex = dnd->u.warp.mapindex;
+ nd->u.warp.x = dnd->u.warp.x;
+ nd->u.warp.y = dnd->u.warp.y;
+ break;
}
//Add the npc to its location
- if( m >= 0 )
- {
+ if( m >= 0 ) {
map_addnpc(m, nd);
- status_change_init(&nd->bl);
- unit_dataset(&nd->bl);
- nd->ud.dir = dir;
+ nd->ud = &npc_base_ud;
+ nd->dir = dir;
npc_setcells(nd);
map_addblock(&nd->bl);
- if( class_ >= 0 )
- {
+ if( class_ >= 0 ) {
status_set_viewdata(&nd->bl, nd->class_);
if( map[nd->bl.m].users )
clif->spawn(&nd->bl);
}
- }
- else
- {
+ } else {
// we skip map_addnpc, but still add it to the list of ID's
map_addiddb(&nd->bl);
}
@@ -2694,25 +2669,21 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
int npc_duplicate4instance(struct npc_data *snd, int16 m) {
char newname[NAME_LENGTH];
- if( map[m].instance_id == 0 )
+ if( map[m].instance_id == -1 )
return 1;
snprintf(newname, ARRAYLENGTH(newname), "dup_%d_%d", map[m].instance_id, snd->bl.id);
- if( npc_name2id(newname) != NULL )
- { // Name already in use
+ if( npc_name2id(newname) != NULL ) { // Name already in use
ShowError("npc_duplicate4instance: the npcname (%s) is already in use while trying to duplicate npc %s in instance %d.\n", newname, snd->exname, map[m].instance_id);
return 1;
}
- if( snd->subtype == WARP )
- { // Adjust destination, if instanced
+ if( snd->subtype == WARP ) { // Adjust destination, if instanced
struct npc_data *wnd = NULL; // New NPC
int dm = map_mapindex2mapid(snd->u.warp.mapindex), im;
if( dm < 0 ) return 1;
- im = instance_mapid2imapid(dm, map[m].instance_id);
- if( im == -1 )
- {
+ if( ( im = instance->mapid2imapid(dm, map[m].instance_id) ) == -1 ) {
ShowError("npc_duplicate4instance: warp (%s) leading to instanced map (%s), but instance map is not attached to current instance.\n", map[dm].name, snd->exname);
return 1;
}
@@ -2738,18 +2709,15 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m) {
npc_setcells(wnd);
map_addblock(&wnd->bl);
status_set_viewdata(&wnd->bl, wnd->class_);
- status_change_init(&wnd->bl);
- unit_dataset(&wnd->bl);
+ wnd->ud = &npc_base_ud;
if( map[wnd->bl.m].users )
clif->spawn(&wnd->bl);
strdb_put(npcname_db, wnd->exname, wnd);
- }
- else
- {
+ } else {
static char w1[50], w2[50], w3[50], w4[50];
const char* stat_buf = "- call from instancing subsystem -\n";
- snprintf(w1, sizeof(w1), "%s,%d,%d,%d", map[m].name, snd->bl.x, snd->bl.y, snd->ud.dir);
+ snprintf(w1, sizeof(w1), "%s,%d,%d,%d", map[m].name, snd->bl.x, snd->bl.y, snd->dir);
snprintf(w2, sizeof(w2), "duplicate(%s)", snd->exname);
snprintf(w3, sizeof(w3), "%s::%s", snd->name, newname);
@@ -2765,39 +2733,36 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m) {
}
//Set mapcell CELL_NPC to trigger event later
-void npc_setcells(struct npc_data* nd)
-{
+void npc_setcells(struct npc_data* nd) {
int16 m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys;
int i,j;
- switch(nd->subtype)
- {
- case WARP:
- xs = nd->u.warp.xs;
- ys = nd->u.warp.ys;
- break;
- case SCRIPT:
- xs = nd->u.scr.xs;
- ys = nd->u.scr.ys;
- break;
- default:
- return; // Other types doesn't have touch area
+ switch(nd->subtype) {
+ case WARP:
+ xs = nd->u.warp.xs;
+ ys = nd->u.warp.ys;
+ break;
+ case SCRIPT:
+ xs = nd->u.scr.xs;
+ ys = nd->u.scr.ys;
+ break;
+ default:
+ return; // Other types doesn't have touch area
}
- if (m < 0 || xs < 0 || ys < 0) //invalid range or map
+ if (m < 0 || xs < 0 || ys < 0 || map[m].cell == (struct mapcell *)0xdeadbeaf) //invalid range or map
return;
for (i = y-ys; i <= y+ys; i++) {
for (j = x-xs; j <= x+xs; j++) {
if (map_getcell(m, j, i, CELL_CHKNOPASS))
continue;
- map_setcell(m, j, i, CELL_NPC, true);
+ map[m].setcell(m, j, i, CELL_NPC, true);
}
}
}
-int npc_unsetcells_sub(struct block_list* bl, va_list ap)
-{
+int npc_unsetcells_sub(struct block_list* bl, va_list ap) {
struct npc_data *nd = (struct npc_data*)bl;
int id = va_arg(ap,int);
if (nd->bl.id == id) return 0;
@@ -2805,8 +2770,7 @@ int npc_unsetcells_sub(struct block_list* bl, va_list ap)
return 1;
}
-void npc_unsetcells(struct npc_data* nd)
-{
+void npc_unsetcells(struct npc_data* nd) {
int16 m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys;
int i,j, x0, x1, y0, y1;
@@ -2818,7 +2782,7 @@ void npc_unsetcells(struct npc_data* nd)
ys = nd->u.scr.ys;
}
- if (m < 0 || xs < 0 || ys < 0)
+ if (m < 0 || xs < 0 || ys < 0 || map[m].cell == (struct mapcell *)0xdeadbeaf)
return;
//Locate max range on which we can locate npc cells
@@ -2831,7 +2795,7 @@ void npc_unsetcells(struct npc_data* nd)
//Erase this npc's cells
for (i = y-ys; i <= y+ys; i++)
for (j = x-xs; j <= x+xs; j++)
- map_setcell(m, j, i, CELL_NPC, false);
+ map[m].setcell(m, j, i, CELL_NPC, false);
//Re-deploy NPC cells for other nearby npcs.
map_foreachinarea( npc_unsetcells_sub, m, x0, y0, x1, y1, BL_NPC, nd->bl.id );
@@ -2910,7 +2874,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
return 1;
}
- if( ev->nd->sc.option&OPTION_INVISIBLE ) { // Disabled npc, shouldn't trigger event.
+ if( ev->nd->option&OPTION_INVISIBLE ) { // Disabled npc, shouldn't trigger event.
npc_event_dequeue(sd);
return 2;
}
@@ -2994,8 +2958,7 @@ void npc_parse_mob2(struct spawn_data* mob)
{
int i;
- for( i = mob->active; i < mob->num; ++i )
- {
+ for( i = mob->active; i < mob->num; ++i ) {
struct mob_data* md = mob_spawn_dataset(mob);
md->spawn = mob;
md->spawn->active++;
@@ -3150,19 +3113,17 @@ static const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const c
memcpy(data, &mob, sizeof(struct spawn_data));
// spawn / cache the new mobs
- if( battle_config.dynamic_mobs && map_addmobtolist(data->m, data) >= 0 )
- {
+ if( battle_config.dynamic_mobs && map_addmobtolist(data->m, data) >= 0 ) {
data->state.dynamic = true;
npc_cache_mob += data->num;
// check if target map has players
// (usually shouldn't occur when map server is just starting,
// but not the case when we do @reloadscript
- if( map[data->m].users > 0 )
+ if( map[data->m].users > 0 ) {
npc_parse_mob2(data);
- }
- else
- {
+ }
+ } else {
data->state.dynamic = false;
npc_parse_mob2(data);
npc_delay_mob += data->num;
@@ -3282,16 +3243,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
else if (!strcmpi(drop_arg2,"all"))
drop_type = 3;
- if (drop_id != 0){
- int i;
- for (i = 0; i < MAX_DROP_PER_MAP; i++) {
- if (map[m].drop_list[i].drop_id == 0){
- map[m].drop_list[i].drop_id = drop_id;
- map[m].drop_list[i].drop_type = drop_type;
- map[m].drop_list[i].drop_per = drop_per;
- break;
- }
- }
+ if (drop_id != 0) {
+ RECREATE(map[m].drop_list, struct map_drop_list, ++map[m].drop_list_count);
+ map[m].drop_list[map[m].drop_list_count-1].drop_id = drop_id;
+ map[m].drop_list[map[m].drop_list_count-1].drop_type = drop_type;
+ map[m].drop_list[map[m].drop_list_count-1].drop_per = drop_per;
map[m].flag.pvp_nightmaredrop = 1;
}
} else if (!state) //Disable
@@ -3892,10 +3848,7 @@ int npc_reload(void) {
"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
npc_id - npc_new_min, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
- do_final_instance();
-
- for( i = 0; i < ARRAYLENGTH(instance); ++i )
- instance_init(instance[i].instance_id);
+ instance->final();
map_zone_init();
@@ -4002,8 +3955,18 @@ int do_init_npc(void)
struct npc_src_list *file;
int i;
+ memset(&npc_base_ud, 0, sizeof( struct unit_data) );
+ npc_base_ud.bl = NULL;
+ npc_base_ud.walktimer = INVALID_TIMER;
+ npc_base_ud.skilltimer = INVALID_TIMER;
+ npc_base_ud.attacktimer = INVALID_TIMER;
+ npc_base_ud.attackabletime =
+ npc_base_ud.canact_tick =
+ npc_base_ud.canmove_tick = gettick();
+
//Stock view data for normal npcs.
memset(&npc_viewdb, 0, sizeof(npc_viewdb));
+
npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here.
for( i = 1; i < MAX_NPC_CLASS; i++ )
npc_viewdb[i].class_ = i;
@@ -4030,7 +3993,7 @@ int do_init_npc(void)
"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n"
"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
npc_id - START_NPC_NUM, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
-
+
map_zone_init();
npc->motd = npc_name2id("HerculesMOTD"); /* [Ind/Hercules] */
@@ -4068,6 +4031,6 @@ int do_init_npc(void)
}
void npc_defaults(void) {
npc = &npc_s;
-
+
npc->motd = NULL;
}
diff --git a/src/map/npc.h b/src/map/npc.h
index 8a8b14d6e..16e6fe74c 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -12,6 +12,7 @@ struct block_list;
struct npc_data;
struct view_data;
+struct unit_data npc_base_ud;
struct npc_timerevent_list {
int timer,pos;
@@ -26,9 +27,9 @@ struct npc_item_list {
struct npc_data {
struct block_list bl;
- struct unit_data ud; //Because they need to be able to move....
+ struct unit_data *ud;
struct view_data *vd;
- struct status_change sc; //They can't have status changes, but.. they want the visual opt values.
+ unsigned int option;
struct npc_data *master_nd;
short class_;
short speed;
@@ -37,12 +38,13 @@ struct npc_data {
int chat_id;
int touching_id;
unsigned int next_walktime;
-
+ uint8 dir;
+
unsigned size : 2;
struct status_data status;
- unsigned int level;
- unsigned int stat_point;
+ unsigned short level;
+ unsigned short stat_point;
void* chatdb; // pointer to a npc_parse struct (see npc_chat.c)
char* path;/* path dir */
diff --git a/src/map/packets.h b/src/map/packets.h
index 555f45c19..5d07f7f9e 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1869,6 +1869,10 @@ packet(0x020d,-1);
packet(0x0838,6,clif->pSolveCharName,2);
packet(0x0439,8,clif->pUseItem,2,4);
packet(0x08d2,10);
+ packet(0x08d7,28,clif->pBGQueueRegister,2);
+ packet(0x090a,26,clif->pBGQueueCheckState,2);
+ packet(0x08da,26,clif->pBGQueueRevokeReq,2);
+ packet(0x08e0,51,clif->pBGQueueBattleBeginAck,2);
#endif
//2011-11-02aRagexe
@@ -1985,7 +1989,6 @@ packet(0x020d,-1);
packet(0x08FB,6,clif->pDull,2); //bookingcanceljoinparty
packet(0x0907,5,clif->pMoveItem,2,4);
packet(0x0908,5);
- packet(0x08D7,28,clif->pDull,2,4); //battlegroundreg
packet(0x08CF,10);//Amulet spirits
packet(0x0977,14);//Monster HP Bar
#endif
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index c873d3ad3..9d1f9b280 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -87,6 +87,15 @@ enum packet_headers {
#else
unit_walkingType = 0x914,
#endif
+ bgqueue_ackType = 0x8d8,
+ bgqueue_notice_deleteType = 0x8db,
+ bgqueue_registerType = 0x8d7,
+ bgqueue_updateinfoType = 0x8d9,
+ bgqueue_checkstateType = 0x90a,
+ bgqueue_revokereqType = 0x8da,
+ bgqueue_battlebeginackType = 0x8e0,
+ bgqueue_notify_entryType = 0x8d9,
+ bgqueue_battlebegins = 0x8df,
#if PACKETVER > 20130000 /* not sure date */
dropflooritemType = 0x84b,
#else
@@ -391,6 +400,59 @@ struct packet_maptypeproperty2 {
} flag;
} __attribute__((packed));
+struct packet_bgqueue_ack {
+ short PacketType;
+ short type;
+ char bg_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_notice_delete {
+ short PacketType;
+ short type;
+ char bg_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_register {
+ short PacketType;
+ short type;
+ char bg_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_update_info {
+ short PacketType;
+ char bg_name[NAME_LENGTH];
+ int position;
+} __attribute__((packed));
+
+struct packet_bgqueue_checkstate {
+ short PacketType;
+ char bg_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_revoke_req {
+ short PacketType;
+ char bg_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_battlebegin_ack {
+ short PacketType;
+ short result;
+ char bg_name[NAME_LENGTH];
+ char game_name[NAME_LENGTH];
+} __attribute__((packed));
+
+struct packet_bgqueue_notify_entry {
+ short PacketType;
+ char name[NAME_LENGTH];
+ int position;
+} __attribute__((packed));
+
+struct packet_bgqueue_battlebegins {
+ short PacketType;
+ char bg_name[NAME_LENGTH];
+ char game_name[NAME_LENGTH];
+} __attribute__((packed));
+
#pragma pack(pop)
#endif /* _PACKETS_STRUCT_H_ */
diff --git a/src/map/party.c b/src/map/party.c
index 8a632a8ef..4462d4f07 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -50,8 +50,6 @@ static void party_fill_member(struct party_member* member, struct map_session_da
member->online = 1;
member->leader = leader;
}
-
-
/// Get the member_id of a party member.
/// Return -1 if not in party.
int party_getmemberid(struct party_data* p, struct map_session_data* sd)
@@ -101,14 +99,21 @@ static TBL_PC* party_sd_check(int party_id, int account_id, int char_id)
return sd;
}
-
+int party_db_final(DBKey key, DBData *data, va_list ap) {
+ struct party_data *p;
+
+ if( ( p = DB->data2ptr(data) ) && p->instance )
+ aFree(p->instance);
+
+ return 0;
+}
/*==========================================
* Destructor
* Called in map shutdown, cleanup var
*------------------------------------------*/
void do_final_party(void)
{
- party_db->destroy(party_db,NULL);
+ party_db->destroy(party_db,party_db_final);
party_booking_db->destroy(party_booking_db,NULL); // Party Booking [Spiria]
}
// Constructor, init vars
@@ -251,16 +256,14 @@ int party_recv_info(struct party* sp, int char_id)
int removed_count = 0;
int added[MAX_PARTY];// member_id in new data
int added_count = 0;
- int i;
+ int i,j;
int member_id;
nullpo_ret(sp);
p = (struct party_data*)idb_get(party_db, sp->party_id);
- if( p != NULL )// diff members
- {
- for( member_id = 0; member_id < MAX_PARTY; ++member_id )
- {
+ if( p != NULL ) {// diff members
+ for( member_id = 0; member_id < MAX_PARTY; ++member_id ) {
member = &p->party.member[member_id];
if( member->char_id == 0 )
continue;// empty
@@ -270,8 +273,7 @@ int party_recv_info(struct party* sp, int char_id)
if( i == MAX_PARTY )
removed[removed_count++] = member_id;
}
- for( member_id = 0; member_id < MAX_PARTY; ++member_id )
- {
+ for( member_id = 0; member_id < MAX_PARTY; ++member_id ) {
member = &sp->member[member_id];
if( member->char_id == 0 )
continue;// empty
@@ -281,17 +283,16 @@ int party_recv_info(struct party* sp, int char_id)
if( i == MAX_PARTY )
added[added_count++] = member_id;
}
- }
- else
- {
+ } else {
for( member_id = 0; member_id < MAX_PARTY; ++member_id )
if( sp->member[member_id].char_id != 0 )
added[added_count++] = member_id;
CREATE(p, struct party_data, 1);
+ p->instance = NULL;
+ p->instances = 0;
idb_put(party_db, sp->party_id, p);
}
- while( removed_count > 0 )// no longer in party
- {
+ while( removed_count > 0 ) {// no longer in party
member_id = removed[--removed_count];
sd = p->data[member_id].sd;
if( sd == NULL )
@@ -301,16 +302,14 @@ int party_recv_info(struct party* sp, int char_id)
memcpy(&p->party, sp, sizeof(struct party));
memset(&p->state, 0, sizeof(p->state));
memset(&p->data, 0, sizeof(p->data));
- for( member_id = 0; member_id < MAX_PARTY; member_id++ )
- {
+ for( member_id = 0; member_id < MAX_PARTY; member_id++ ) {
member = &p->party.member[member_id];
if ( member->char_id == 0 )
continue;// empty
p->data[member_id].sd = party_sd_check(sp->party_id, member->account_id, member->char_id);
}
party_check_state(p);
- while( added_count > 0 )// new in party
- {
+ while( added_count > 0 ) { // new in party
member_id = added[--added_count];
sd = p->data[member_id].sd;
if( sd == NULL )
@@ -319,8 +318,12 @@ int party_recv_info(struct party* sp, int char_id)
clif->party_member_info(p,sd);
clif->party_option(p,sd,0x100);
clif->party_info(p,NULL);
- if( p->instance_id != 0 )
- clif->instance_join(sd->fd, p->instance_id);
+ for( j = 0; j < p->instances; j++ ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
}
if( char_id != 0 )// requester
{
@@ -429,19 +432,21 @@ void party_member_joined(struct map_session_data *sd)
{
struct party_data* p = party_search(sd->status.party_id);
int i;
- if (!p)
- {
+ if (!p) {
party_request_info(sd->status.party_id, sd->status.char_id);
return;
}
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == sd->status.account_id && p->party.member[i].char_id == sd->status.char_id );
- if (i < MAX_PARTY)
- {
+ if (i < MAX_PARTY) {
+ int j;
p->data[i].sd = sd;
- if( p->instance_id )
- clif->instance_join(sd->fd,p->instance_id);
- }
- else
+ for( j = 0; j < p->instances; j++ ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
+ } else
sd->status.party_id = 0; //He does not belongs to the party really?
}
@@ -451,7 +456,7 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
{
struct map_session_data *sd = map_id2sd(account_id),*sd2;
struct party_data *p = party_search(party_id);
- int i;
+ int i, j;
if(sd == NULL || sd->status.char_id != char_id || !sd->party_joining ) {
if (!flag) //Char logged off before being accepted into party.
@@ -496,9 +501,13 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
clif->party_xy(sd);
clif->charnameupdate(sd); //Update char name's display [Skotlex]
- if( p->instance_id )
- clif->instance_join(sd->fd, p->instance_id);
-
+ for( j = 0; j < p->instances; j++ ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
+
return 0;
}
@@ -551,12 +560,10 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
struct map_session_data* sd = map_id2sd(account_id);
struct party_data* p = party_search(party_id);
- if( p )
- {
+ if( p ) {
int i;
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id );
- if( i < MAX_PARTY )
- {
+ if( i < MAX_PARTY ) {
clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
memset(&p->party.member[i], 0, sizeof(p->party.member[0]));
memset(&p->data[i], 0, sizeof(p->data[0]));
@@ -565,13 +572,12 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
}
}
- if( sd && sd->status.party_id == party_id && sd->status.char_id == char_id )
- {
+ if( sd && sd->status.party_id == party_id && sd->status.char_id == char_id ) {
sd->status.party_id = 0;
clif->charnameupdate(sd); //Update name display [Skotlex]
//TODO: hp bars should be cleared too
- if( p->instance_id )
- instance_check_kick(sd);
+ if( p->instances )
+ instance->check_kick(sd);
}
return 0;
@@ -581,22 +587,19 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
int party_broken(int party_id)
{
struct party_data* p;
- int i;
+ int i, j;
p = party_search(party_id);
if( p == NULL )
return 0;
- if( p->instance_id )
- {
- instance[p->instance_id].party_id = 0;
- instance_destroy( p->instance_id );
+ for( j = 0; j < p->instances; j++ ) {
+ instance->destroy( p->instance[j] );
+ instances[p->instance[j]].owner_id = 0;
}
-
- for( i = 0; i < MAX_PARTY; i++ )
- {
- if( p->data[i].sd!=NULL )
- {
+
+ for( i = 0; i < MAX_PARTY; i++ ) {
+ if( p->data[i].sd!=NULL ) {
clif->party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10);
p->data[i].sd->status.party_id=0;
}
diff --git a/src/map/party.h b/src/map/party.h
index 12fe7a2bc..3978324e4 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -25,7 +25,8 @@ struct party_data {
struct party party;
struct party_member_data data[MAX_PARTY];
uint8 itemc; //For item distribution, position of last picker in party
- unsigned int instance_id;
+ unsigned short *instance;
+ unsigned short instances;
struct {
unsigned monk : 1; //There's at least one monk in party?
unsigned sg : 1; //There's at least one Star Gladiator in party?
diff --git a/src/map/path.c b/src/map/path.c
index 3bbd8d20b..8ab63d390 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -167,12 +167,10 @@ int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
dy=(dy>0)?1:((dy<0)?-1:0);
}
- while( count > 0 && (dx != 0 || dy != 0) )
- {
- if( !map_getcellp(md,x0+dx,y0+dy,CELL_CHKPASS) )
- {// attempt partial movement
- int fx = ( dx != 0 && map_getcellp(md,x0+dx,y0,CELL_CHKPASS) );
- int fy = ( dy != 0 && map_getcellp(md,x0,y0+dy,CELL_CHKPASS) );
+ while( count > 0 && (dx != 0 || dy != 0) ) {
+ if( !md->getcellp(md,x0+dx,y0+dy,CELL_CHKPASS) ) {// attempt partial movement
+ int fx = ( dx != 0 && md->getcellp(md,x0+dx,y0,CELL_CHKPASS) );
+ int fy = ( dy != 0 && md->getcellp(md,x0,y0+dy,CELL_CHKPASS) );
if( fx && fy )
{
if(rnd()&1)
@@ -225,7 +223,7 @@ bool path_search_long(struct shootpath_data *spd,int16 m,int16 x0,int16 y0,int16
spd->x[0] = x0;
spd->y[0] = y0;
- if (map_getcellp(md,x1,y1,cell))
+ if (md->getcellp(md,x1,y1,cell))
return false;
if (dx > abs(dy)) {
@@ -238,7 +236,7 @@ bool path_search_long(struct shootpath_data *spd,int16 m,int16 x0,int16 y0,int16
while (x0 != x1 || y0 != y1)
{
- if (map_getcellp(md,x0,y0,cell))
+ if (md->getcellp(md,x0,y0,cell))
return false;
wx += dx;
wy += dy;
@@ -290,10 +288,10 @@ bool path_search(struct walkpath_data *wpd,int16 m,int16 x0,int16 y0,int16 x1,in
//Do not check starting cell as that would get you stuck.
if( x0 < 0 || x0 >= md->xs || y0 < 0 || y0 >= md->ys )
#else
- if( x0 < 0 || x0 >= md->xs || y0 < 0 || y0 >= md->ys /*|| map_getcellp(md,x0,y0,cell)*/ )
+ if( x0 < 0 || x0 >= md->xs || y0 < 0 || y0 >= md->ys /*|| md->getcellp(md,x0,y0,cell)*/ )
#endif
return false;
- if( x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || map_getcellp(md,x1,y1,cell) )
+ if( x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || md->getcellp(md,x1,y1,cell) )
return false;
// calculate (sgn(x1-x0), sgn(y1-y0))
@@ -317,7 +315,7 @@ bool path_search(struct walkpath_data *wpd,int16 m,int16 x0,int16 y0,int16 x1,in
if( dx == 0 && dy == 0 )
break; // success
- if( map_getcellp(md,x,y,cell) )
+ if( md->getcellp(md,x,y,cell) )
break; // obstacle = failure
}
@@ -365,29 +363,29 @@ bool path_search(struct walkpath_data *wpd,int16 m,int16 x0,int16 y0,int16 x1,in
// dc[2] : y--
// dc[3] : x++
- if(y < ys && !map_getcellp(md,x ,y+1,cell)) {
+ if(y < ys && !md->getcellp(md,x ,y+1,cell)) {
f |= 1; dc[0] = (y >= y1 ? 20 : 0);
e+=add_path(heap,tp,x ,y+1,dist,rp,cost+dc[0]); // (x, y+1)
}
- if(x > 0 && !map_getcellp(md,x-1,y ,cell)) {
+ if(x > 0 && !md->getcellp(md,x-1,y ,cell)) {
f |= 2; dc[1] = (x <= x1 ? 20 : 0);
e+=add_path(heap,tp,x-1,y ,dist,rp,cost+dc[1]); // (x-1, y )
}
- if(y > 0 && !map_getcellp(md,x ,y-1,cell)) {
+ if(y > 0 && !md->getcellp(md,x ,y-1,cell)) {
f |= 4; dc[2] = (y <= y1 ? 20 : 0);
e+=add_path(heap,tp,x ,y-1,dist,rp,cost+dc[2]); // (x , y-1)
}
- if(x < xs && !map_getcellp(md,x+1,y ,cell)) {
+ if(x < xs && !md->getcellp(md,x+1,y ,cell)) {
f |= 8; dc[3] = (x >= x1 ? 20 : 0);
e+=add_path(heap,tp,x+1,y ,dist,rp,cost+dc[3]); // (x+1, y )
}
- if( (f & (2+1)) == (2+1) && !map_getcellp(md,x-1,y+1,cell))
+ if( (f & (2+1)) == (2+1) && !md->getcellp(md,x-1,y+1,cell))
e+=add_path(heap,tp,x-1,y+1,dist+4,rp,cost+dc[1]+dc[0]-6); // (x-1, y+1)
- if( (f & (2+4)) == (2+4) && !map_getcellp(md,x-1,y-1,cell))
+ if( (f & (2+4)) == (2+4) && !md->getcellp(md,x-1,y-1,cell))
e+=add_path(heap,tp,x-1,y-1,dist+4,rp,cost+dc[1]+dc[2]-6); // (x-1, y-1)
- if( (f & (8+4)) == (8+4) && !map_getcellp(md,x+1,y-1,cell))
+ if( (f & (8+4)) == (8+4) && !md->getcellp(md,x+1,y-1,cell))
e+=add_path(heap,tp,x+1,y-1,dist+4,rp,cost+dc[3]+dc[2]-6); // (x+1, y-1)
- if( (f & (8+1)) == (8+1) && !map_getcellp(md,x+1,y+1,cell))
+ if( (f & (8+1)) == (8+1) && !md->getcellp(md,x+1,y+1,cell))
e+=add_path(heap,tp,x+1,y+1,dist+4,rp,cost+dc[3]+dc[0]-6); // (x+1, y+1)
tp[rp].flag=1;
if(e || heap[0]>=MAX_HEAP-5)
diff --git a/src/map/pc.c b/src/map/pc.c
index 55ce993b4..241e0fbb3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -518,8 +518,7 @@ int pc_makesavestatus(struct map_session_data *sd)
#else
sd->status.option = sd->sc.option&(OPTION_INVISIBLE|OPTION_CART|OPTION_FALCON|OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR);
#endif
- if (sd->sc.data[SC_JAILED])
- { //When Jailed, do not move last point.
+ if (sd->sc.data[SC_JAILED]) { //When Jailed, do not move last point.
if(pc_isdead(sd)){
pc_setrestartvalue(sd,0);
} else {
@@ -543,13 +542,25 @@ int pc_makesavestatus(struct map_session_data *sd)
sd->status.last_point.y = sd->bl.y;
}
- if(map[sd->bl.m].flag.nosave){
+ if(map[sd->bl.m].flag.nosave || map[sd->bl.m].instance_id >= 0){
struct map_data *m=&map[sd->bl.m];
if(m->save.map)
memcpy(&sd->status.last_point,&m->save,sizeof(sd->status.last_point));
else
memcpy(&sd->status.last_point,&sd->status.save_point,sizeof(sd->status.last_point));
}
+ if( sd->status.last_point.map == 0 ) {
+ sd->status.last_point.map = 1;
+ sd->status.last_point.x = 0;
+ sd->status.last_point.y = 0;
+ }
+
+ if( sd->status.save_point.map == 0 ) {
+ sd->status.save_point.map = 1;
+ sd->status.save_point.x = 0;
+ sd->status.save_point.y = 0;
+ }
+
return 0;
}
@@ -905,8 +916,7 @@ int pc_isequip(struct map_session_data *sd,int n)
* No problem with the session id
* set the status that has been sent from char server
*------------------------------------------*/
-bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)
-{
+bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers) {
int i;
unsigned long tick = gettick();
uint32 ip = session[sd->fd]->client_addr;
@@ -1014,6 +1024,17 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->disguise = -1;
+ sd->instance = NULL;
+ sd->instances = 0;
+
+ sd->bg_queue.arena = NULL;
+ sd->bg_queue.ready = 0;
+ sd->bg_queue.client_has_bg_data = 0;
+ sd->bg_queue.type = 0;
+
+ sd->queues = NULL;
+ sd->queues_count = 0;
+
// Event Timers
for( i = 0; i < MAX_EVENTTIMER; i++ )
sd->eventtimer[i] = INVALID_TIMER;
@@ -1075,7 +1096,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
/**
* Fixes login-without-aura glitch (the screen won't blink at this point, don't worry :P)
**/
- clif->changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
+ clif->changemap(sd,sd->bl.m,sd->bl.x,sd->bl.y);
}
/**
@@ -4680,36 +4701,62 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
* 1 - Invalid map index.
* 2 - Map not in this map-server, and failed to locate alternate map-server.
*------------------------------------------*/
-int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype)
-{
- struct party_data *p;
+int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype) {
int16 m;
nullpo_ret(sd);
- if( !mapindex || !mapindex_id2name(mapindex) )
- {
+ if( !mapindex || !mapindex_id2name(mapindex) ) {
ShowDebug("pc_setpos: Passed mapindex(%d) is invalid!\n", mapindex);
return 1;
}
- if( pc_isdead(sd) )
- { //Revive dead people before warping them
+ if( pc_isdead(sd) ) { //Revive dead people before warping them
pc_setstand(sd);
pc_setrestartvalue(sd,1);
}
-
m = map_mapindex2mapid(mapindex);
- if( map[m].flag.src4instance && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- {
- // Request the mapid of this src map into the instance of the party
- int im = instance_map2imap(m, p->instance_id);
- if( im < 0 )
- ; // Player will enter the src map for instances
- else
- { // Changes destiny to the instance map, not the source map
- m = im;
- mapindex = map_id2index(m);
+
+ if( map[m].flag.src4instance ) {
+ struct party_data *p;
+ bool stop = false;
+ int i = 0, j = 0;
+
+ if( sd->instances ) {
+ for( i = 0; i < sd->instances; i++ ) {
+ ARR_FIND(0, instances[sd->instance[i]].num_map, j, map[instances[sd->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->instance[i]].map[j]].cName);
+ if( j != instances[sd->instance[i]].num_map )
+ break;
+ }
+ if( i != sd->instances ) {
+ m = instances[sd->instance[i]].map[j];
+ mapindex = map[m].index;
+ stop = true;
+ }
+ }
+ if ( !stop && sd->status.party_id && (p = party_search(sd->status.party_id)) && p->instances ) {
+ for( i = 0; i < p->instances; i++ ) {
+ ARR_FIND(0, instances[p->instance[i]].num_map, j, map[instances[p->instance[i]].map[j]].instance_src_map == m && !map[instances[p->instance[i]].map[j]].cName);
+ if( j != instances[p->instance[i]].num_map )
+ break;
+ }
+ if( i != p->instances ) {
+ m = instances[p->instance[i]].map[j];
+ mapindex = map[m].index;
+ stop = true;
+ }
+ }
+ if ( !stop && sd->status.guild_id && sd->guild && sd->guild->instances ) {
+ for( i = 0; i < sd->guild->instances; i++ ) {
+ ARR_FIND(0, instances[sd->guild->instance[i]].num_map, j, map[instances[sd->guild->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->guild->instance[i]].map[j]].cName);
+ if( j != instances[sd->guild->instance[i]].num_map )
+ break;
+ }
+ if( i != sd->guild->instances ) {
+ m = instances[sd->guild->instance[i]].map[j];
+ mapindex = map[m].index;
+ stop = true;
+ }
}
}
@@ -4718,6 +4765,17 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if( sd->state.changemap ) { // Misc map-changing settings
int i;
sd->state.pmap = sd->bl.m;
+
+ for( i = 0; i < sd->queues_count; i++ ) {
+ struct hQueue *queue;
+ if( (queue = script->queue(sd->queues[i])) && queue->onMapChange[0] != '\0' ) {
+ pc_setregstr(sd, add_str("QMapChangeTo"), map[m].name);
+ npc_event(sd, queue->onMapChange, 0);
+ }
+ }
+
+ if( map[m].cell == (struct mapcell *)0xdeadbeaf )
+ map_cellfromcache(&map[m]);
if (sd->sc.count) { // Cancel some map related stuff.
if (sd->sc.data[SC_JAILED])
return 1; //You may not get out!
@@ -4761,8 +4819,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
}
- if( m < 0 )
- {
+ if( m < 0 ) {
uint32 ip;
uint16 port;
//if can't find any map-servers, just abort setting position.
@@ -4787,14 +4844,12 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
return 0;
}
- if( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys )
- {
+ if( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys ) {
ShowError("pc_setpos: attempt to place player %s (%d:%d) on invalid coordinates (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
x = y = 0; // make it random
}
- if( x == 0 && y == 0 )
- {// pick a random walkable cell
+ if( x == 0 && y == 0 ) {// pick a random walkable cell
do {
x=rnd()%(map[m].xs-2)+1;
y=rnd()%(map[m].ys-2)+1;
@@ -4808,7 +4863,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if(sd->bl.prev != NULL){
unit_remove_map_pc(sd,clrtype);
- clif->changemap(sd,map[m].index,x,y); // [MouseJstr]
+ clif->changemap(sd,m,x,y); // [MouseJstr]
} else if(sd->state.active)
//Tag player for rewarping after map-loading is done. [Skotlex]
sd->state.rewarp = 1;
@@ -4818,31 +4873,27 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
sd->bl.x = sd->ud.to_x = x;
sd->bl.y = sd->ud.to_y = y;
- if( sd->status.guild_id > 0 && map[m].flag.gvg_castle )
- { // Increased guild castle regen [Valaris]
+ if( sd->status.guild_id > 0 && map[m].flag.gvg_castle ) { // Increased guild castle regen [Valaris]
struct guild_castle *gc = guild->mapindex2gc(sd->mapindex);
if(gc && gc->guild_id == sd->status.guild_id)
sd->regen.state.gc = 1;
}
- if( sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0 )
- {
+ if( sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0 ) {
sd->pd->bl.m = m;
sd->pd->bl.x = sd->pd->ud.to_x = x;
sd->pd->bl.y = sd->pd->ud.to_y = y;
sd->pd->ud.dir = sd->ud.dir;
}
- if( homun_alive(sd->hd) )
- {
+ if( homun_alive(sd->hd) ) {
sd->hd->bl.m = m;
sd->hd->bl.x = sd->hd->ud.to_x = x;
sd->hd->bl.y = sd->hd->ud.to_y = y;
sd->hd->ud.dir = sd->ud.dir;
}
- if( sd->md )
- {
+ if( sd->md ) {
sd->md->bl.m = m;
sd->md->bl.x = sd->md->ud.to_x = x;
sd->md->bl.y = sd->md->ud.to_y = y;
@@ -6588,15 +6639,22 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
pc_setparam(sd, SP_KILLERRID, src?src->id:0);
- if( sd->bg_id ) {
+ if( sd->bg_id ) {/* TODO: purge when bgqueue is deemed ok */
struct battleground_data *bg;
if( (bg = bg_team_search(sd->bg_id)) != NULL && bg->die_event[0] )
npc_event(sd, bg->die_event, 0);
}
-
+
+ for( i = 0; i < sd->queues_count; i++ ) {
+ struct hQueue *queue;
+ if( (queue = script->queue(sd->queues[i])) && queue->onDeath[0] != '\0' )
+ npc_event(sd, queue->onDeath, 0);
+ }
+
+ npc_script_event(sd,NPCE_DIE);
+
// Clear anything NPC-related when you die and was interacting with one.
- if (sd->npc_id)
- {
+ if (sd->npc_id) {
if (sd->state.using_fake_npc) {
clif->clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
sd->state.using_fake_npc = 0;
@@ -6611,8 +6669,6 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
sd->st->state = END;
}
- npc_script_event(sd,NPCE_DIE);
-
/* e.g. not killed thru pc_damage */
if( pc_issit(sd) ) {
clif->sc_end(&sd->bl,sd->bl.id,SELF,SI_SIT);
@@ -6788,7 +6844,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if(map[sd->bl.m].flag.pvp_nightmaredrop)
{ // Moved this outside so it works when PVP isn't enabled and during pk mode [Ancyker]
- for(j=0;j<MAX_DROP_PER_MAP;j++){
+ for(j=0;j<map[sd->bl.m].drop_list_count;j++){
int id = map[sd->bl.m].drop_list[j].drop_id;
int type = map[sd->bl.m].drop_list[j].drop_type;
int per = map[sd->bl.m].drop_list[j].drop_per;
diff --git a/src/map/pc.h b/src/map/pc.h
index b1fa3e741..5207c4c34 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -10,6 +10,7 @@
#include "../common/timer.h" // INVALID_TIMER
#include "atcommand.h" // AtCommandType
#include "battle.h" // battle_config
+#include "battleground.h"
#include "buyingstore.h" // struct s_buyingstore
#include "itemdb.h" // MAX_ITEMGROUP
#include "map.h" // RC_MAX
@@ -519,6 +520,20 @@ struct map_session_data {
struct sc_display_entry **sc_display;
unsigned char sc_display_count;
+ unsigned short *instance;
+ unsigned short instances;
+
+ /* Possible Thanks to Yommy~! */
+ struct {
+ unsigned int ready : 1;/* did he accept the 'match is about to start, enter' dialog? */
+ unsigned int client_has_bg_data : 1; /* flags whether the client has the "in queue" window (aka the client knows it is in a queue) */
+ struct bg_arena *arena;
+ enum bg_queue_types type;
+ } bg_queue;
+
+ int *queues;
+ unsigned int queues_count;
+
// temporary debugging of bug #3504
const char* delunit_prevfile;
int delunit_prevline;
diff --git a/src/map/script.c b/src/map/script.c
index 7e15b3372..019b17cff 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -816,10 +816,12 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
func = add_word(p);
if( str_data[func].type == C_FUNC ){
+ char argT = 0;
// buildin function
add_scriptl(func);
add_scriptc(C_ARG);
arg = script->buildin[str_data[func].val];
+ if( !arg ) arg = &argT;
} else if( str_data[func].type == C_USERFUNC || str_data[func].type == C_USERFUNC_POS ){
// script defined function
add_scriptl(buildin_callsub_ref);
@@ -2358,8 +2360,8 @@ void get_val(struct script_state* st, struct script_data* data)
}
break;
case '\'':
- if (st->instance_id) {
- data->u.str = (char*)idb_get(instance[st->instance_id].vars,reference_getuid(data));
+ if ( st->instance_id >= 0 ) {
+ data->u.str = (char*)idb_get(instances[st->instance_id].vars,reference_getuid(data));
} else {
ShowWarning("script:get_val: cannot access instance variable '%s', defaulting to \"\"\n", name);
data->u.str = NULL;
@@ -2423,8 +2425,8 @@ void get_val(struct script_state* st, struct script_data* data)
}
break;
case '\'':
- if( st->instance_id )
- data->u.num = (int)idb_iget(instance[st->instance_id].vars,reference_getuid(data));
+ if( st->instance_id >= 0 )
+ data->u.num = (int)idb_iget(instances[st->instance_id].vars,reference_getuid(data));
else {
ShowWarning("script:get_val: cannot access instance variable '%s', defaulting to 0\n", name);
data->u.num = 0;
@@ -2484,9 +2486,9 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
}
return 1;
case '\'':
- if( st->instance_id ) {
- idb_remove(instance[st->instance_id].vars, num);
- if( str[0] ) idb_put(instance[st->instance_id].vars, num, aStrdup(str));
+ if( st->instance_id >= 0 ) {
+ idb_remove(instances[st->instance_id].vars, num);
+ if( str[0] ) idb_put(instances[st->instance_id].vars, num, aStrdup(str));
}
return 1;
default:
@@ -2532,10 +2534,10 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, const char* nam
}
return 1;
case '\'':
- if( st->instance_id ) {
- idb_remove(instance[st->instance_id].vars, num);
+ if( st->instance_id >= 0 ) {
+ idb_remove(instances[st->instance_id].vars, num);
if( val != 0 )
- idb_iput(instance[st->instance_id].vars, num, val);
+ idb_iput(instances[st->instance_id].vars, num, val);
}
return 1;
default:
@@ -3462,8 +3464,10 @@ void run_script_main(struct script_state *st)
script_attach_state(st);
nd = map_id2nd(st->oid);
- if( nd && map[nd->bl.m].instance_id > 0 )
+ if( nd && nd->bl.m >= 0 )
st->instance_id = map[nd->bl.m].instance_id;
+ else
+ st->instance_id = -1;
if(st->state == RERUNLINE) {
run_func(st);
@@ -3845,9 +3849,25 @@ void do_final_script(void) {
script->buildin[i] = NULL;
}
}
-
- aFree(script->buildin);
+ aFree(script->buildin);
+
+ if( script->hqs ) {
+ for( i = 0; i < script->hqs; i++ ) {
+ if( script->hq[i].item != NULL )
+ aFree(script->hq[i].item);
+ }
+ }
+ if( script->hqis ) {
+ for( i = 0; i < script->hqis; i++ ) {
+ if( script->hqi[i].item != NULL )
+ aFree(script->hqi[i].item);
+ }
+ }
+ if( script->hq != NULL )
+ aFree(script->hq);
+ if( script->hqi != NULL )
+ aFree(script->hqi);
}
/*==========================================
* Initialization
@@ -7272,7 +7292,7 @@ BUILDIN(successrefitem)
clif->additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
clif->misceffect(&sd->bl,3);
- if(sd->status.inventory[i].refine == MAX_REFINE &&
+ if(sd->status.inventory[i].refine == 10 &&
sd->status.inventory[i].card[0] == CARD0_FORGE &&
sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
){ // Fame point system [DracoRPG]
@@ -8458,13 +8478,10 @@ BUILDIN(monster)
if (sd && strcmp(mapn, "this") == 0)
m = sd->bl.m;
- else
- {
+ else {
m = map_mapname2mapid(mapn);
- if (map[m].flag.src4instance && st->instance_id)
- { // Try to redirect to the instance map, not the src map
- if ((m = instance_mapid2imapid(m, st->instance_id)) < 0)
- {
+ if (map[m].flag.src4instance && st->instance_id >= 0) { // Try to redirect to the instance map, not the src map
+ if ((m = instance->mapid2imapid(m, st->instance_id)) < 0) {
ShowError("buildin_monster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
return false;
}
@@ -8531,27 +8548,22 @@ BUILDIN(areamonster)
struct map_session_data* sd;
int16 m;
- if (script_hasdata(st,10))
- {
+ if (script_hasdata(st,10)) {
event = script_getstr(st, 10);
check_event(st, event);
}
- if (script_hasdata(st, 11))
- {
+ if (script_hasdata(st, 11)) {
size = script_getnum(st, 11);
- if (size > 3)
- {
+ if (size > 3) {
ShowWarning("buildin_monster: Attempted to spawn non-existing size %d for monster class %d\n", size, class_);
return false;
}
}
- if (script_hasdata(st, 12))
- {
+ if (script_hasdata(st, 12)) {
ai = script_getnum(st, 12);
- if (ai > 4)
- {
+ if (ai > 4) {
ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
return false;
}
@@ -8561,13 +8573,10 @@ BUILDIN(areamonster)
if (sd && strcmp(mapn, "this") == 0)
m = sd->bl.m;
- else
- {
+ else {
m = map_mapname2mapid(mapn);
- if (map[m].flag.src4instance && st->instance_id)
- { // Try to redirect to the instance map, not the src map
- if ((m = instance_mapid2imapid(m, st->instance_id)) < 0)
- {
+ if (map[m].flag.src4instance && st->instance_id >= 0) { // Try to redirect to the instance map, not the src map
+ if ((m = instance->mapid2imapid(m, st->instance_id)) < 0) {
ShowError("buildin_areamonster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
return false;
}
@@ -8629,7 +8638,7 @@ BUILDIN(killmonster)
if( (m=map_mapname2mapid(mapname))<0 )
return true;
- if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
+ if( map[m].flag.src4instance && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 )
return true;
if( script_hasdata(st,4) ) {
@@ -8670,7 +8679,7 @@ BUILDIN(killmonsterall)
if( (m = map_mapname2mapid(mapname))<0 )
return true;
- if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
+ if( map[m].flag.src4instance && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 )
return true;
if( script_hasdata(st,3) ) {
@@ -11198,8 +11207,7 @@ BUILDIN(mobcount) // Added by RoVeRT
return true;
}
- if( map[m].flag.src4instance && map[m].instance_id == 0 && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- {
+ if( map[m].flag.src4instance && map[m].instance_id >= 0 && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 ) {
script_pushint(st,-1);
return true;
}
@@ -12521,8 +12529,7 @@ BUILDIN(jump_zero)
/*==========================================
* movenpc [MouseJstr]
*------------------------------------------*/
-BUILDIN(movenpc)
-{
+BUILDIN(movenpc) {
TBL_NPC *nd = NULL;
const char *npc;
int x,y;
@@ -12535,7 +12542,7 @@ BUILDIN(movenpc)
return -1;
if (script_hasdata(st,5))
- nd->ud.dir = script_getnum(st,5) % 8;
+ nd->dir = script_getnum(st,5) % 8;
npc_movenpc(nd, x, y);
return true;
}
@@ -12589,17 +12596,20 @@ BUILDIN(npcspeed)
speed = script_getnum(st,2);
nd =(struct npc_data *)map_id2bl(st->oid);
- if( nd )
- {
+ if( nd ) {
+ if( nd->ud == &npc_base_ud ) {
+ nd->ud = NULL;
+ CREATE(nd->ud, struct unit_data, 1);
+ unit_dataset(&nd->bl);
+ }
nd->speed = speed;
- nd->ud.state.speed_changed = 1;
+ nd->ud->state.speed_changed = 1;
}
return true;
}
// make an npc walk to a position [Valaris]
-BUILDIN(npcwalkto)
-{
+BUILDIN(npcwalkto) {
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
int x=0,y=0;
@@ -12607,6 +12617,12 @@ BUILDIN(npcwalkto)
y=script_getnum(st,3);
if(nd) {
+ if( nd->ud == &npc_base_ud ) {
+ nd->ud = NULL;
+ CREATE(nd->ud, struct unit_data, 1);
+ unit_dataset(&nd->bl);
+ }
+
if (!nd->status.hp) {
status_calc_npc(nd, true);
} else {
@@ -15371,7 +15387,7 @@ BUILDIN(setcell)
for( y = y1; y <= y2; ++y )
for( x = x1; x <= x2; ++x )
- map_setcell(m, x, y, type, flag);
+ map[m].setcell(m, x, y, type, flag);
return true;
}
@@ -15895,25 +15911,28 @@ BUILDIN(bg_get_data)
* Instancing Script Commands
*------------------------------------------*/
-BUILDIN(instance_create)
-{
+BUILDIN(instance_create) {
const char *name;
- int party_id, res;
+ int owner_id, res;
+ int type = IOT_PARTY;
name = script_getstr(st, 2);
- party_id = script_getnum(st, 3);
+ owner_id = script_getnum(st, 3);
+ if( script_hasdata(st,4) ) {
+ type = script_getnum(st, 4);
+ if( type < IOT_NONE || type >= IOT_MAX ) {
+ ShowError("buildin_instance_create: unknown instance type %d for '%s'\n",type,name);
+ return true;
+ }
+ }
- res = instance_create(party_id, name);
- if( res == -4 ) // Already exists
- {
+ res = instance->create(owner_id, name, (enum instance_owner_type) type);
+ if( res == -4 ) { // Already exists
script_pushint(st, -1);
return true;
- }
- else if( res < 0 )
- {
+ } else if( res < 0 ) {
const char *err;
- switch(res)
- {
+ switch(res) {
case -3: err = "No free instances"; break;
case -2: err = "Invalid party ID"; break;
case -1: err = "Invalid type"; break;
@@ -15928,44 +15947,39 @@ BUILDIN(instance_create)
return true;
}
-BUILDIN(instance_destroy)
-{
- int instance_id;
- struct map_session_data *sd;
- struct party_data *p;
+BUILDIN(instance_destroy) {
+ int instance_id = -1;
if( script_hasdata(st, 2) )
instance_id = script_getnum(st, 2);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
else return true;
- if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
- {
+ if( !instance->valid(instance_id) ) {
ShowError("buildin_instance_destroy: Trying to destroy invalid instance %d.\n", instance_id);
return true;
}
- instance_destroy(instance_id);
+ instance->destroy(instance_id);
return true;
}
-BUILDIN(instance_attachmap)
-{
- const char *name;
+BUILDIN(instance_attachmap) {
+ const char *name, *map_name = NULL;
int16 m;
- int instance_id;
+ int instance_id = -1;
bool usebasename = false;
name = script_getstr(st,2);
instance_id = script_getnum(st,3);
- if( script_hasdata(st,4) && script_getnum(st,4) > 0)
+ if( script_hasdata(st,4) && script_getnum(st,4) > 0 )
usebasename = true;
- if( (m = instance_add_map(name, instance_id, usebasename)) < 0 ) // [Saithis]
- {
+ if( script_hasdata(st, 5) )
+ map_name = script_getstr(st, 5);
+
+ if( (m = instance->add_map(name, instance_id, usebasename, map_name)) < 0 ) { // [Saithis]
ShowError("buildin_instance_attachmap: instance creation failed (%s): %d\n", name, m);
script_pushconststr(st, "");
return true;
@@ -15975,109 +15989,81 @@ BUILDIN(instance_attachmap)
return true;
}
-BUILDIN(instance_detachmap)
-{
- struct map_session_data *sd;
- struct party_data *p;
+BUILDIN(instance_detachmap) {
const char *str;
int16 m;
- int instance_id;
+ int instance_id = -1;
str = script_getstr(st, 2);
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
else return true;
- if( (m = map_mapname2mapid(str)) < 0 || (m = instance_map2imap(m,instance_id)) < 0 )
- {
+ if( (m = map_mapname2mapid(str)) < 0 || (m = instance->map2imap(m,instance_id)) < 0 ) {
ShowError("buildin_instance_detachmap: Trying to detach invalid map %s\n", str);
return true;
}
- instance_del_map(m);
+ instance->del_map(m);
return true;
}
-BUILDIN(instance_attach)
-{
- int instance_id;
+BUILDIN(instance_attach) {
+ int instance_id = -1;
instance_id = script_getnum(st, 2);
- if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
+ if( !instance->valid(instance_id) )
return true;
st->instance_id = instance_id;
return true;
}
-BUILDIN(instance_id)
-{
- int instance_id;
-
- if( script_hasdata(st, 2) )
- {
- struct party_data *p;
- struct map_session_data *sd;
- int type;
- type = script_getnum(st, 2);
- if( type == 0 )
- instance_id = st->instance_id;
- else if( type == 1 && (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL )
- instance_id = p->instance_id;
- else
- instance_id = 0;
- }
- else
- instance_id = st->instance_id;
-
- script_pushint(st, instance_id);
+BUILDIN(instance_id) {
+ script_pushint(st, st->instance_id);
return true;
}
BUILDIN(instance_set_timeout)
{
int progress_timeout, idle_timeout;
- int instance_id;
- struct map_session_data *sd;
- struct party_data *p;
+ int instance_id = -1;
progress_timeout = script_getnum(st, 2);
idle_timeout = script_getnum(st, 3);
if( script_hasdata(st, 4) )
instance_id = script_getnum(st, 4);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
else return true;
- if( instance_id > 0 )
- instance_set_timeout(instance_id, progress_timeout, idle_timeout);
+ if( instance_id >= 0 )
+ instance->set_timeout(instance_id, progress_timeout, idle_timeout);
return true;
}
-BUILDIN(instance_init)
-{
+BUILDIN(instance_init) {
int instance_id = script_getnum(st, 2);
- if( instance[instance_id].state != INSTANCE_IDLE )
- {
+ if( !instance->valid(instance_id) ) {
+ ShowError("instance_init: invalid instance id %d.\n",instance_id);
+ return true;
+ }
+
+ if( instances[instance_id].state != INSTANCE_IDLE ) {
ShowError("instance_init: instance already initialized.\n");
return true;
}
- instance_init(instance_id);
+ instance->start(instance_id);
return true;
}
-BUILDIN(instance_announce)
-{
+BUILDIN(instance_announce) {
int instance_id = script_getnum(st,2);
const char *mes = script_getstr(st,3);
int flag = script_getnum(st,4);
@@ -16088,53 +16074,40 @@ BUILDIN(instance_announce)
int fontY = script_hasdata(st,9) ? script_getnum(st,9) : 0; // default fontY
int i;
- struct map_session_data *sd;
- struct party_data *p;
- if( instance_id == 0 )
- {
- if( st->instance_id )
+ if( instance_id == -1 ) {
+ if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
- else return true;
+ else
+ return true;
}
- if( instance_id <= 0 || instance_id >= MAX_INSTANCE )
+ if( !instance->valid(instance_id) )
return true;
- for( i = 0; i < instance[instance_id].num_map; i++ )
- map_foreachinmap(buildin_announce_sub, instance[instance_id].map[i], BL_PC,
+ for( i = 0; i < instances[instance_id].num_map; i++ )
+ map_foreachinmap(buildin_announce_sub, instances[instance_id].map[i], BL_PC,
mes, strlen(mes)+1, flag&0xf0, fontColor, fontType, fontSize, fontAlign, fontY);
return true;
}
-BUILDIN(instance_npcname)
-{
+BUILDIN(instance_npcname) {
const char *str;
- int instance_id = 0;
-
- struct map_session_data *sd;
- struct party_data *p;
+ int instance_id = -1;
struct npc_data *nd;
str = script_getstr(st, 2);
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
- if( instance_id && (nd = npc_name2id(str)) != NULL )
- {
+ if( instance_id >= 0 && (nd = npc_name2id(str)) != NULL ) {
static char npcname[NAME_LENGTH];
snprintf(npcname, sizeof(npcname), "dup_%d_%d", instance_id, nd->bl.id);
script_pushconststr(st,npcname);
- }
- else
- {
+ } else {
ShowError("script:instance_npcname: invalid instance NPC (instance_id: %d, NPC name: \"%s\".)\n", instance_id, str);
st->state = END;
return false;
@@ -16143,24 +16116,56 @@ BUILDIN(instance_npcname)
return true;
}
-BUILDIN(has_instance)
-{
+BUILDIN(has_instance) {
struct map_session_data *sd;
- struct party_data *p;
const char *str;
int16 m;
- int instance_id = 0;
+ int instance_id = -1;
str = script_getstr(st, 2);
+
+ if( (m = map_mapname2mapid(str)) < 0 ) {
+ script_pushconststr(st, "");
+ return true;
+ }
+
if( script_hasdata(st, 3) )
instance_id = script_getnum(st, 3);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (sd = script_rid2sd(st)) != NULL && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
+ else if( (sd = script_rid2sd(st)) != NULL ) {
+ struct party_data *p;
+ int i = 0, j = 0;
+ if( sd->instances ) {
+ for( i = 0; i < sd->instances; i++ ) {
+ ARR_FIND(0, instances[sd->instance[i]].num_map, j, map[instances[sd->instance[i]].map[j]].instance_src_map == m);
+ if( j != instances[sd->instance[i]].num_map )
+ break;
+ }
+ if( i != sd->instances )
+ instance_id = sd->instance[i];
+ }
+ if( instance_id == -1 && sd->status.party_id && (p = party_search(sd->status.party_id)) && p->instances ) {
+ for( i = 0; i < p->instances; i++ ) {
+ ARR_FIND(0, instances[p->instance[i]].num_map, j, map[instances[p->instance[i]].map[j]].instance_src_map == m);
+ if( j != instances[p->instance[i]].num_map )
+ break;
+ }
+ if( i != p->instances )
+ instance_id = p->instance[i];
+ }
+ if( instance_id == -1 && sd->guild && sd->guild->instances ) {
+ for( i = 0; i < sd->guild->instances; i++ ) {
+ ARR_FIND(0, instances[sd->guild->instance[i]].num_map, j, map[instances[sd->guild->instance[i]].map[j]].instance_src_map == m);
+ if( j != instances[sd->guild->instance[i]].num_map )
+ break;
+ }
+ if( i != sd->guild->instances )
+ instance_id = sd->guild->instance[i];
+ }
+ }
- if( !instance_id || (m = map_mapname2mapid(str)) < 0 || (m = instance_map2imap(m, instance_id)) < 0 )
- {
+ if( !instance->valid(instance_id) || (m = instance->map2imap(m, instance_id)) < 0 ) {
script_pushconststr(st, "");
return true;
}
@@ -16168,38 +16173,41 @@ BUILDIN(has_instance)
script_pushconststr(st, map[m].name);
return true;
}
-
-BUILDIN(instance_warpall)
-{
- struct map_session_data *pl_sd;
- int16 m, i;
- int instance_id;
+static int buildin_instance_warpall_sub(struct block_list *bl,va_list ap) {
+ struct map_session_data *sd = ((TBL_PC*)bl);
+ int mapindex = va_arg(ap,int);
+ int x = va_arg(ap,int);
+ int y = va_arg(ap,int);
+
+ pc_setpos(sd,mapindex,x,y,CLR_TELEPORT);
+
+ return 0;
+}
+BUILDIN(instance_warpall) {
+ int16 m;
+ int instance_id = -1;
const char *mapn;
int x, y;
- unsigned short mapindex;
- struct party_data *p = NULL;
+ int mapindex;
mapn = script_getstr(st,2);
x = script_getnum(st,3);
y = script_getnum(st,4);
+
if( script_hasdata(st,5) )
instance_id = script_getnum(st,5);
- else if( st->instance_id )
+ else if( st->instance_id >= 0 )
instance_id = st->instance_id;
- else if( (pl_sd = script_rid2sd(st)) != NULL && pl_sd->status.party_id && (p = party_search(pl_sd->status.party_id)) != NULL && p->instance_id )
- instance_id = p->instance_id;
- else return true;
-
- if( (m = map_mapname2mapid(mapn)) < 0 || (map[m].flag.src4instance && (m = instance_mapid2imapid(m, instance_id)) < 0) )
+ else
return true;
- if( !(p = party_search(instance[instance_id].party_id)) )
+ if( (m = map_mapname2mapid(mapn)) < 0 || (map[m].flag.src4instance && (m = instance->mapid2imapid(m, instance_id)) < 0) )
return true;
-
+
mapindex = map_id2index(m);
- for( i = 0; i < MAX_PARTY; i++ )
- if( (pl_sd = p->data[i].sd) && map[pl_sd->bl.m].instance_id == st->instance_id ) pc_setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
+ map_foreachininstance(buildin_instance_warpall_sub, instance_id, BL_PC,mapindex,x,y);
+
return true;
}
@@ -16213,8 +16221,7 @@ BUILDIN(instance_warpall)
* Example: instance_check_party (getcharid(1){,amount}{,min}{,max});
* Example 2: instance_check_party (getcharid(1),1,1,99);
*------------------------------------------*/
-BUILDIN(instance_check_party)
-{
+BUILDIN(instance_check_party) {
struct map_session_data *pl_sd;
int amount, min, max, i, party_id, c = 0;
struct party_data *p = NULL;
@@ -16328,13 +16335,12 @@ BUILDIN(areamobuseskill)
int16 m;
int range,mobid,skill_id,skill_lv,casttime,emotion,target,cancel;
- if( (m = map_mapname2mapid(script_getstr(st,2))) < 0 )
- {
+ if( (m = map_mapname2mapid(script_getstr(st,2))) < 0 ) {
ShowError("areamobuseskill: invalid map name.\n");
return true;
}
- if( map[m].flag.src4instance && st->instance_id && (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
+ if( map[m].flag.src4instance && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 )
return true;
center.m = m;
@@ -17024,6 +17030,309 @@ BUILDIN(npcskill)
return true;
}
+struct hQueue *script_hqueue_get(int idx) {
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 )
+ return NULL;
+ return &script->hq[idx];
+}
+/* set .@id,queue(); */
+/* creates queue, returns created queue id */
+BUILDIN(queue) {
+ int idx = script->hqs;
+ int i;
+
+ for(i = 0; i < script->hqs; i++) {
+ if( script->hq[i].items == -1 ) {
+ break;
+ }
+ }
+
+ if( i == script->hqs ) {
+ RECREATE(script->hq, struct hQueue, ++script->hqs);
+ script->hq[ idx ].item = NULL;
+ } else
+ idx = i;
+
+ script->hq[ idx ].id = idx;
+ script->hq[ idx ].items = 0;
+ script->hq[ idx ].onDeath[0] = '\0';
+ script->hq[ idx ].onLogOut[0] = '\0';
+ script->hq[ idx ].onMapChange[0] = '\0';
+
+ script_pushint(st,idx);
+ return true;
+}
+/* set .@length,queuesize(.@queue_id); */
+/* returns queue length */
+BUILDIN(queuesize) {
+ int idx = script_getnum(st, 2);
+
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 ) {
+ ShowWarning("buildin_queuesize: unknown queue id %d\n",idx);
+ script_pushint(st, 0);
+ } else
+ script_pushint(st, script->hq[ idx ].items );
+
+ return true;
+}
+bool script_hqueue_add(int idx, int var) {
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 ) {
+ ShowWarning("script_hqueue_add: unknown queue id %d\n",idx);
+ return true;
+ } else {
+ struct map_session_data *sd;
+ int i;
+
+ for(i = 0; i < script->hq[idx].items; i++) {
+ if( script->hq[idx].item[i] == var ) {
+ return true;
+ }
+ }
+
+ if( i == script->hq[idx].items ) {
+
+ for(i = 0; i < script->hq[idx].items; i++) {
+ if( script->hq[idx].item[i] == 0 ) {
+ break;
+ }
+ }
+
+ if( i == script->hq[idx].items )
+ RECREATE(script->hq[idx].item, int, ++script->hq[idx].items);
+
+ script->hq[idx].item[i] = var;
+
+ if( var >= START_ACCOUNT_NUM && (sd = map_id2sd(var)) ) {
+ for(i = 0; i < sd->queues_count; i++) {
+ if( sd->queues[i] == -1 ) {
+ break;
+ }
+ }
+
+ if( i == sd->queues_count )
+ RECREATE(sd->queues, int, ++sd->queues_count);
+
+ sd->queues[i] = idx;
+ }
+
+ }
+ }
+ return false;
+}
+/* queueadd(.@queue_id,.@var_id); */
+/* adds a new entry to the queue, returns 1 if already in queue, 0 otherwise */
+BUILDIN(queueadd) {
+ int idx = script_getnum(st, 2);
+ int var = script_getnum(st, 3);
+
+ script_pushint(st,script->queue_add(idx,var)?1:0);
+
+ return true;
+}
+bool script_hqueue_remove(int idx, int var) {
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 ) {
+ ShowWarning("script_hqueue_remove: unknown queue id %d (used with var %d)\n",idx,var);
+ return true;
+ } else {
+ int i;
+
+ for(i = 0; i < script->hq[idx].items; i++) {
+ if( script->hq[idx].item[i] == var ) {
+ return true;
+ }
+ }
+
+ if( i != script->hq[idx].items ) {
+ struct map_session_data *sd;
+ script->hq[idx].item[i] = 0;
+
+ if( var >= START_ACCOUNT_NUM && (sd = map_id2sd(var)) ) {
+ for(i = 0; i < sd->queues_count; i++) {
+ if( sd->queues[i] == var ) {
+ break;
+ }
+ }
+
+ if( i != sd->queues_count )
+ sd->queues[i] = -1;
+ }
+
+ }
+ }
+ return false;
+}
+/* queueremove(.@queue_id,.@var_id); */
+/* removes a entry from the queue, returns 1 if not in queue, 0 otherwise */
+BUILDIN(queueremove) {
+ int idx = script_getnum(st, 2);
+ int var = script_getnum(st, 3);
+
+ script_pushint(st, script->queue_remove(idx,var)?1:0);
+
+ return true;
+}
+
+/* queueopt(.@queue_id,optionType,<optional val>); */
+/* modifies the queue's options, when val is not provided the option is removed */
+/* when OnMapChange event is triggered, it sets a temp char var @QMapChangeTo$ with the destination map name */
+/* returns 1 when fails, 0 on success */
+BUILDIN(queueopt) {
+ int idx = script_getnum(st, 2);
+ int var = script_getnum(st, 3);
+
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 ) {
+ ShowWarning("buildin_queueopt: unknown queue id %d\n",idx);
+ script_pushint(st, 1);
+ } else if( var <= HQO_NONE || var >= HQO_MAX ) {
+ ShowWarning("buildin_queueopt: unknown optionType %d\n",var);
+ script_pushint(st, 1);
+ } else {
+ switch( (enum hQueueOpt)var ) {
+ case HQO_OnDeath:
+ if( script_hasdata(st, 4) )
+ safestrncpy(script->hq[idx].onDeath, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ script->hq[idx].onDeath[0] = '\0';
+ break;
+ case HQO_onLogOut:
+ if( script_hasdata(st, 4) )
+ safestrncpy(script->hq[idx].onLogOut, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ script->hq[idx].onLogOut[0] = '\0';
+ break;
+ case HQO_OnMapChange:
+ if( script_hasdata(st, 4) )
+ safestrncpy(script->hq[idx].onMapChange, script_getstr(st, 4), EVENT_NAME_LENGTH);
+ else
+ script->hq[idx].onMapChange[0] = '\0';
+ break;
+ default:
+ ShowWarning("buildin_queueopt: unsupported optionType %d\n",var);
+ script_pushint(st, 1);
+ break;
+ }
+ }
+
+ return true;
+}
+bool script_hqueue_del(int idx) {
+ if( idx < 0 || idx >= script->hqs || script->hq[idx].items == -1 ) {
+ ShowWarning("script_queue_del: unknown queue id %d\n",idx);
+ return true;
+ } else {
+ struct map_session_data *sd;
+ int i;
+
+ for(i = 0; i < script->hq[idx].items; i++) {
+ if( script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map_id2sd(script->hq[idx].item[i])) ) {
+ int j;
+ for(j = 0; j < sd->queues_count; j++) {
+ if( sd->queues[j] == script->hq[idx].item[i] ) {
+ break;
+ }
+ }
+
+ if( j != sd->queues_count )
+ sd->queues[j] = -1;
+ }
+ }
+
+ script->hq[idx].items = -1;
+ }
+ return false;
+}
+/* queuedel(.@queue_id); */
+/* deletes queue of id .@queue_id, returns 1 if id not found, 0 otherwise */
+BUILDIN(queuedel) {
+ int idx = script_getnum(st, 2);
+
+ script_pushint(st,script->queue_del(idx)?1:0);
+
+ return true;
+}
+
+/* set .@id, queueiterator(.@queue_id); */
+/* creates a new queue iterator, returns its id */
+BUILDIN(queueiterator) {
+ int qid = script_getnum(st, 2);
+ struct hQueue *queue = NULL;
+ int idx = script->hqis;
+ int i;
+
+ if( qid < 0 || qid >= script->hqs || script->hq[idx].items == -1 || !(queue = script->queue(qid)) ) {
+ ShowWarning("queueiterator: invalid queue id %d\n",qid);
+ return true;
+ }
+
+ for(i = 0; i < script->hqis; i++) {
+ if( script->hqi[i].items == -1 ) {
+ break;
+ }
+ }
+
+ if( i == script->hqis )
+ RECREATE(script->hqi, struct hQueueIterator, ++script->hqis);
+ else
+ idx = i;
+
+ RECREATE(script->hqi[ idx ].item, int, queue->items);
+
+ memcpy(&script->hqi[idx].item, &queue->item, sizeof(int)*queue->items);
+
+ script->hqi[ idx ].items = queue->items;
+ script->hqi[ idx ].pos = 0;
+
+ script_pushint(st,idx);
+ return true;
+}
+/* Queue Iterator Get Next */
+/* returns next/first member in the iterator, 0 if none */
+BUILDIN(qiget) {
+ int idx = script_getnum(st, 2);
+
+ if( idx < 0 || idx >= script->hqis ) {
+ ShowWarning("buildin_qiget: unknown queue iterator id %d\n",idx);
+ script_pushint(st, 0);
+ } else if ( script->hqi[idx].pos == script->hqi[idx].items ) {
+ script_pushint(st, 0);
+ } else {
+ struct hQueueIterator *it = &script->hqi[idx];
+ script_pushint(st, it->item[it->pos++]);
+ }
+
+ return true;
+}
+/* Queue Iterator Check */
+/* returns 1:0 if there is a next member in the iterator */
+BUILDIN(qicheck) {
+ int idx = script_getnum(st, 2);
+
+ if( idx < 0 || idx >= script->hqis ) {
+ ShowWarning("buildin_qicheck: unknown queue iterator id %d\n",idx);
+ script_pushint(st, 0);
+ } else if ( script->hqi[idx].pos == script->hqi[idx].items ) {
+ script_pushint(st, 0);
+ } else {
+ script_pushint(st, 1);
+ }
+
+ return true;
+}
+/* Queue Iterator Check */
+BUILDIN(qiclear) {
+ int idx = script_getnum(st, 2);
+
+ if( idx < 0 || idx >= script->hqis ) {
+ ShowWarning("buildin_qiclear: unknown queue iterator id %d\n",idx);
+ script_pushint(st, 1);
+ } else {
+ script->hqi[idx].items = -1;
+ script_pushint(st, 0);
+ }
+
+ return true;
+}
+
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
BUILDIN(defpattern);
@@ -17473,12 +17782,12 @@ void script_parse_builtin(void) {
BUILDIN_DEF(bg_updatescore,"sii"),
// Instancing
- BUILDIN_DEF(instance_create,"si"),
+ BUILDIN_DEF(instance_create,"si?"),
BUILDIN_DEF(instance_destroy,"?"),
- BUILDIN_DEF(instance_attachmap,"si?"),
+ BUILDIN_DEF(instance_attachmap,"si??"),
BUILDIN_DEF(instance_detachmap,"s?"),
BUILDIN_DEF(instance_attach,"i"),
- BUILDIN_DEF(instance_id,"?"),
+ BUILDIN_DEF(instance_id,""),
BUILDIN_DEF(instance_set_timeout,"ii?"),
BUILDIN_DEF(instance_init,"i"),
BUILDIN_DEF(instance_announce,"isi?????"),
@@ -17523,6 +17832,20 @@ void script_parse_builtin(void) {
BUILDIN_DEF(checkquest, "i?"),
BUILDIN_DEF(changequest, "ii"),
BUILDIN_DEF(showevent, "ii"),
+
+ /**
+ * hQueue [Ind/Hercules]
+ **/
+ BUILDIN_DEF(queue,""),
+ BUILDIN_DEF(queuesize,"i"),
+ BUILDIN_DEF(queueadd,"ii"),
+ BUILDIN_DEF(queueremove,"ii"),
+ BUILDIN_DEF(queueopt,"ii?"),
+ BUILDIN_DEF(queuedel,"i"),
+ BUILDIN_DEF(queueiterator,"i"),
+ BUILDIN_DEF(qicheck,"i"),
+ BUILDIN_DEF(qiget,"i"),
+ BUILDIN_DEF(qiclear,"i"),
};
int i,n, len = ARRAYLENGTH(BUILDIN), start = script->buildin_count;
char* p;
@@ -17576,6 +17899,11 @@ void script_parse_builtin(void) {
void script_defaults(void) {
script = &script_s;
+ script->hq = NULL;
+ script->hqi = NULL;
+ script->hqs = script->hqis = 0;
+ memset(&script->hqe, 0, sizeof(script->hqe));
+
script->buildin_count = 0;
script->buildin = NULL;
@@ -17586,4 +17914,9 @@ void script_defaults(void) {
script->addScript = script_hp_add;
script->conv_num = conv_num;
script->conv_str = conv_str;
+
+ script->queue = script_hqueue_get;
+ script->queue_add = script_hqueue_add;
+ script->queue_del = script_hqueue_del;
+ script->queue_remove = script_hqueue_remove;
}
diff --git a/src/map/script.h b/src/map/script.h
index a0d282bfe..70ced5d43 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -4,6 +4,8 @@
#ifndef _SCRIPT_H_
#define _SCRIPT_H_
+#include "map.h" //EVENT_NAME_LENGTH
+
#define NUM_WHISPER_VAR 10
struct map_session_data;
@@ -110,6 +112,30 @@ struct script_stack {
struct DBMap* var_function;// scope variables
};
+enum hQueueOpt {
+ HQO_NONE,
+ HQO_onLogOut,
+ HQO_OnDeath,
+ HQO_OnMapChange,
+ HQO_MAX,
+};
+
+/* [Ind/Hercules] */
+struct hQueue {
+ int id;
+ int *item;
+ int items;
+ /* events */
+ char onLogOut[EVENT_NAME_LENGTH];
+ char onDeath[EVENT_NAME_LENGTH];
+ char onMapChange[EVENT_NAME_LENGTH];
+};
+
+struct hQueueIterator {
+ int *item;
+ int items;
+ int pos;
+};
//
// Script state
@@ -129,6 +155,7 @@ struct script_state {
int instance_id;
//For backing up purposes
struct script_state *bk_st;
+ unsigned char hIterator;
int bk_npcid;
unsigned freeloop : 1;// used by buildin_freeloop
unsigned op2ref : 1;// used by op_2
@@ -291,8 +318,14 @@ struct script_function {
char *name;
char *arg;
};
+
/* script.c interface (incomplete) */
struct script_interface {
+ /* */
+ struct hQueue *hq;
+ struct hQueueIterator *hqi;
+ int hqs, hqis;
+ int hqe[HQO_MAX];
/* */
char **buildin;
unsigned int buildin_count;
@@ -304,6 +337,11 @@ struct script_interface {
bool (*addScript) (char *name, char *args, bool (*func)(struct script_state *st));
int (*conv_num) (struct script_state *st,struct script_data *data);
const char* (*conv_str) (struct script_state *st,struct script_data *data);
+ /* */
+ struct hQueue *(*queue) (int idx);
+ bool (*queue_add) (int idx, int var);
+ bool (*queue_del) (int idx);
+ bool (*queue_remove) (int idx, int var);
} script_s;
struct script_interface *script;
diff --git a/src/map/skill.c b/src/map/skill.c
index 06bfca5f8..911410727 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -14464,7 +14464,7 @@ void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill
for( y = src->bl.y - range; y <= src->bl.y + range; ++y )
for( x = src->bl.x - range; x <= src->bl.x + range; ++x )
- map_setcell(src->bl.m, x, y, cell, flag);
+ map[src->bl.m].setcell(src->bl.m, x, y, cell, flag);
}
/*==========================================
diff --git a/src/map/status.c b/src/map/status.c
index b7e906910..35ce70349 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2584,7 +2584,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
continue;
for(k = 0; k < map[sd->bl.m].zone->disabled_items_count; k++) {
- if( map[sd->bl.m].zone->disabled_items[k] == sd->inventory_data[index]->nameid ) {
+ if( map[sd->bl.m].zone->disabled_items[k] == data->nameid ) {
break;
}
}
@@ -6079,14 +6079,15 @@ void status_set_viewdata(struct block_list *bl, int class_)
/// Returns the status_change data of bl or NULL if it doesn't exist.
struct status_change *status_get_sc(struct block_list *bl) {
- if( bl )
- switch (bl->type) {
- case BL_PC: return &((TBL_PC*)bl)->sc;
- case BL_MOB: return &((TBL_MOB*)bl)->sc;
- case BL_NPC: return &((TBL_NPC*)bl)->sc;
- case BL_HOM: return &((TBL_HOM*)bl)->sc;
- case BL_MER: return &((TBL_MER*)bl)->sc;
- case BL_ELEM: return &((TBL_ELEM*)bl)->sc;
+ if( bl ) {
+ switch (bl->type) {
+ case BL_PC: return &((TBL_PC*)bl)->sc;
+ case BL_MOB: return &((TBL_MOB*)bl)->sc;
+ case BL_NPC: return NULL;
+ case BL_HOM: return &((TBL_HOM*)bl)->sc;
+ case BL_MER: return &((TBL_MER*)bl)->sc;
+ case BL_ELEM: return &((TBL_ELEM*)bl)->sc;
+ }
}
return NULL;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index cbc695c4a..3ab1008cb 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -50,7 +50,7 @@ struct unit_data* unit_bl2ud(struct block_list *bl)
if( bl->type == BL_PC) return &((struct map_session_data*)bl)->ud;
if( bl->type == BL_MOB) return &((struct mob_data*)bl)->ud;
if( bl->type == BL_PET) return &((struct pet_data*)bl)->ud;
- if( bl->type == BL_NPC) return &((struct npc_data*)bl)->ud;
+ if( bl->type == BL_NPC) return ((struct npc_data*)bl)->ud;
if( bl->type == BL_HOM) return &((struct homun_data*)bl)->ud;
if( bl->type == BL_MER) return &((struct mercenary_data*)bl)->ud;
if( bl->type == BL_ELEM) return &((struct elemental_data*)bl)->ud;
@@ -678,10 +678,12 @@ int unit_setdir(struct block_list *bl,unsigned char dir)
return 0;
}
-uint8 unit_getdir(struct block_list *bl)
-{
+uint8 unit_getdir(struct block_list *bl) {
struct unit_data *ud;
- nullpo_ret(bl );
+ nullpo_ret(bl);
+
+ if( bl->type == BL_NPC )
+ return ((TBL_NPC*)bl)->dir;
ud = unit_bl2ud(bl);
if (!ud) return 0;
return ud->dir;
@@ -1961,8 +1963,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
}
// unit_data initialization process
-void unit_dataset(struct block_list *bl)
-{
+void unit_dataset(struct block_list *bl) {
struct unit_data *ud;
nullpo_retv(ud = unit_bl2ud(bl));
@@ -2121,8 +2122,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
npc_touchnext_areanpc(sd,true);
// Check if warping and not changing the map.
- if ( sd->state.warping && !sd->state.changemap )
- {
+ if ( sd->state.warping && !sd->state.changemap ) {
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
}
@@ -2163,18 +2163,15 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
sd->state.active, sd->state.connect_new, sd->state.rewarp, sd->state.changemap, sd->state.debug_remove_map,
map[bl->m].name, map[bl->m].users,
sd->debug_file, sd->debug_line, sd->debug_func, file, line, func);
- }
- else
- if (--map[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex]
+ } else if (--map[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex]
map_removemobs(bl->m);
if( !(sd->sc.option&OPTION_INVISIBLE) )
{// decrement the number of active pvp players on the map
--map[bl->m].users_pvp;
}
- if( map[bl->m].instance_id )
- {
- instance[map[bl->m].instance_id].users--;
- instance_check_idle(map[bl->m].instance_id);
+ if( map[bl->m].instance_id >= 0 ) {
+ instances[map[bl->m].instance_id].users--;
+ instance->check_idle(map[bl->m].instance_id);
}
sd->state.debug_remove_map = 1; // temporary state to track double remove_map's [FlavioJS]
sd->debug_file = file;
@@ -2356,9 +2353,19 @@ int unit_free(struct block_list *bl, clr_type clrtype)
ers_free(pc_sc_display_ers, sd->sc_display[i]);
}
sd->sc_display_count = 0;
+ }
+ if( sd->sc_display != NULL ) {
aFree(sd->sc_display);
sd->sc_display = NULL;
}
+ if( sd->instance != NULL ) {
+ aFree(sd->instance);
+ sd->instance = NULL;
+ }
+ if( sd->queues != NULL ) {
+ aFree(sd->queues);
+ sd->queues = NULL;
+ }
break;
}
case BL_PET: