summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/libconfig/CMakeLists.txt2
-rw-r--r--README.md2
-rw-r--r--README.txt2
-rw-r--r--cache/README.txt2
-rw-r--r--cache/db/README.txt2
-rw-r--r--cache/db/pre-re/README.txt2
-rw-r--r--cache/db/re/README.txt2
-rw-r--r--conf/atcommand.conf2
-rw-r--r--conf/battle/feature.conf2
-rw-r--r--conf/battle/items.conf2
-rw-r--r--conf/battle/player.conf2
-rw-r--r--conf/battle/skill.conf2
-rw-r--r--conf/battlegrounds.conf2
-rw-r--r--conf/readme.txt2
-rw-r--r--db/cashshop_db.conf2
-rw-r--r--db/homun_skill_tree.txt2
-rw-r--r--db/homunculus_db.txt2
-rw-r--r--db/item_avail.txt2
-rw-r--r--db/pre-re/item_chain.conf2
-rw-r--r--db/pre-re/map_zone_db.conf2
-rw-r--r--db/re/exp_guild.txt2
-rw-r--r--db/re/item_chain.conf2
-rw-r--r--db/re/item_db.txt2
-rw-r--r--db/re/item_group.conf2
-rw-r--r--db/re/map_zone_db.conf2
-rw-r--r--doc/atcommands.txt2
-rw-r--r--doc/item_bonus.txt2
-rw-r--r--doc/md5_hashcheck.txt2
-rw-r--r--doc/permissions.txt2
-rw-r--r--doc/sample/bank_test.txt2
-rw-r--r--doc/sample/basejob_baseclass_upper.txt2
-rw-r--r--doc/sample/checkoption.txt2
-rw-r--r--doc/sample/delitem2.txt2
-rw-r--r--doc/sample/getequipcardid.txt2
-rw-r--r--doc/sample/getequipid.txt2
-rw-r--r--doc/sample/getiteminfo.txt2
-rw-r--r--doc/sample/getmonsterinfo.txt2
-rw-r--r--doc/sample/gstorage_test.txt2
-rw-r--r--doc/sample/npc_dynamic_shop.txt2
-rw-r--r--doc/sample/npc_extend_shop.txt2
-rw-r--r--doc/sample/npc_live_dialogues.txt2
-rw-r--r--doc/sample/npc_shop_test.txt2
-rw-r--r--doc/sample/npc_test_array.txt2
-rw-r--r--doc/sample/npc_test_chat.txt2
-rw-r--r--doc/sample/npc_test_duplicate.txt2
-rw-r--r--doc/sample/npc_test_npctimer.txt2
-rw-r--r--doc/sample/npc_test_npctimer2.txt2
-rw-r--r--doc/sample/npc_test_quest.txt2
-rw-r--r--doc/sample/npc_test_setmapflag.txt2
-rw-r--r--doc/sample/npc_test_time.txt2
-rw-r--r--doc/script_commands.txt2
-rw-r--r--doc/whisper_sys.txt2
-rw-r--r--npc/MOTD.txt2
-rw-r--r--npc/airports/rachel.txt2
-rw-r--r--npc/custom/etc/quest_warper.txt2
-rw-r--r--npc/custom/events/cluckers.txt2
-rw-r--r--npc/custom/jobmaster.txt2
-rw-r--r--npc/custom/quests/berzebub.txt2
-rw-r--r--npc/custom/quests/kaho_balmung.txt2
-rw-r--r--npc/custom/quests/kahohorn.txt2
-rw-r--r--npc/custom/quests/kings_items.txt2
-rw-r--r--npc/custom/quests/quest_shop.txt2
-rw-r--r--npc/custom/quests/sphinx_mask.txt2
-rw-r--r--npc/custom/quests/sunglasses.txt2
-rw-r--r--npc/custom/woe_controller.txt2
-rw-r--r--npc/events/idul_fitri.txt2
-rw-r--r--npc/events/valentinesday.txt2
-rw-r--r--npc/events/valentinesday_2012.txt2
-rw-r--r--npc/guild/trs_rp.txt2
-rw-r--r--npc/guild2/arug_cas01.txt2
-rw-r--r--npc/guild2/arug_cas02.txt2
-rw-r--r--npc/guild2/arug_cas03.txt2
-rw-r--r--npc/guild2/arug_cas04.txt2
-rw-r--r--npc/guild2/arug_cas05.txt2
-rw-r--r--npc/guild2/schg_cas01.txt2
-rw-r--r--npc/guild2/schg_cas02.txt2
-rw-r--r--npc/guild2/schg_cas03.txt2
-rw-r--r--npc/guild2/schg_cas04.txt2
-rw-r--r--npc/guild2/schg_cas05.txt2
-rw-r--r--npc/kafras/functions_kafras.txt2
-rw-r--r--npc/mapflag/skillduration.txt2
-rw-r--r--npc/mapflag/skillmodifier.txt2
-rw-r--r--npc/mapflag/town.txt2
-rw-r--r--npc/mapflag/zone.txt2
-rw-r--r--npc/merchants/cashheadgear_dye.txt2
-rw-r--r--npc/merchants/clothes_dyer.txt4
-rw-r--r--npc/merchants/coin_exchange.txt2
-rw-r--r--npc/merchants/elemental_trader.txt2
-rw-r--r--npc/merchants/enchan_arm.txt2
-rw-r--r--npc/merchants/hd_refine.txt2
-rw-r--r--npc/merchants/renters.txt2
-rw-r--r--npc/other/card_trader.txt2
-rw-r--r--npc/other/comodo_gambling.txt2
-rw-r--r--npc/other/guildpvp.txt2
-rw-r--r--npc/other/monster_race.txt2
-rw-r--r--npc/other/sealstatus.txt2
-rw-r--r--npc/pre-re/cities/izlude.txt2
-rw-r--r--npc/pre-re/guides/guides_alberta.txt2
-rw-r--r--npc/pre-re/guides/guides_moscovia.txt2
-rw-r--r--npc/pre-re/merchants/shops.txt2
-rw-r--r--npc/pre-re/mobs/fields/splendide.txt2
-rw-r--r--npc/pre-re/other/arena.txt2
-rw-r--r--npc/pre-re/quests/doomed_swords.txt2
-rw-r--r--npc/pre-re/quests/monstertamers.txt2
-rw-r--r--npc/pre-re/quests/quests_13_1.txt2
-rw-r--r--npc/pre-re/quests/quests_nameless.txt2
-rw-r--r--npc/pre-re/quests/skills/swordman_skills.txt2
-rw-r--r--npc/pre-re/scripts.conf2
-rw-r--r--npc/pre-re/scripts_warps.conf2
-rw-r--r--npc/quests/kiel_hyre_quest.txt2
-rw-r--r--npc/quests/mage_solution.txt2
-rw-r--r--npc/quests/quests_13_1.txt2
-rw-r--r--npc/quests/thana_quest.txt2
-rw-r--r--npc/re/cities/dicastes.txt2
-rw-r--r--npc/re/cities/jawaii.txt2
-rw-r--r--npc/re/cities/malangdo.txt2
-rw-r--r--npc/re/cities/malaya.txt2
-rw-r--r--npc/re/jobs/3-1/archbishop.txt2
-rw-r--r--npc/re/jobs/3-1/guillotine_cross.txt2
-rw-r--r--npc/re/jobs/3-1/mechanic.txt2
-rw-r--r--npc/re/jobs/3-1/ranger.txt2
-rw-r--r--npc/re/jobs/3-1/warlock.txt2
-rw-r--r--npc/re/jobs/3-2/genetic.txt2
-rw-r--r--npc/re/jobs/3-2/minstrel.txt2
-rw-r--r--npc/re/jobs/3-2/royal_guard.txt2
-rw-r--r--npc/re/jobs/3-2/shadow_chaser.txt2
-rw-r--r--npc/re/jobs/3-2/sorcerer.txt2
-rw-r--r--npc/re/jobs/3-2/sura.txt2
-rw-r--r--npc/re/jobs/3-2/wanderer.txt2
-rw-r--r--npc/re/jobs/novice/novice.txt2
-rw-r--r--npc/re/merchants/3rd_trader.txt2
-rw-r--r--npc/re/merchants/flute.txt2
-rw-r--r--npc/re/mobs/fields/amatsu.txt2
-rw-r--r--npc/re/mobs/fields/comodo.txt2
-rw-r--r--npc/re/mobs/fields/einbroch.txt2
-rw-r--r--npc/re/mobs/fields/geffen.txt2
-rw-r--r--npc/re/mobs/fields/gonryun.txt2
-rw-r--r--npc/re/mobs/fields/hugel.txt2
-rw-r--r--npc/re/mobs/fields/jawaii.txt2
-rw-r--r--npc/re/mobs/fields/lighthalzen.txt2
-rw-r--r--npc/re/mobs/fields/louyang.txt2
-rw-r--r--npc/re/mobs/fields/manuk.txt2
-rw-r--r--npc/re/mobs/fields/mjolnir.txt2
-rw-r--r--npc/re/mobs/fields/morocc.txt2
-rw-r--r--npc/re/mobs/fields/moscovia.txt2
-rw-r--r--npc/re/mobs/fields/payon.txt2
-rw-r--r--npc/re/mobs/fields/prontera.txt2
-rw-r--r--npc/re/mobs/fields/rachel.txt2
-rw-r--r--npc/re/mobs/fields/splendide.txt2
-rw-r--r--npc/re/mobs/fields/umbala.txt2
-rw-r--r--npc/re/mobs/fields/veins.txt2
-rw-r--r--npc/re/mobs/fields/yuno.txt2
-rw-r--r--npc/re/quests/monstertamers.txt2
-rw-r--r--npc/re/quests/quests_13_1.txt2
-rw-r--r--npc/re/quests/quests_malaya.txt2
-rw-r--r--npc/re/quests/quests_veins.txt2
-rw-r--r--npc/re/warps/cities/dicastes.txt2
-rw-r--r--npc/re/warps/cities/izlude.txt2
-rw-r--r--npc/re/warps/cities/malaya.txt2
-rw-r--r--npc/re/warps/dungeons/iz_dun.txt2
-rw-r--r--npc/re/warps/other/jobquests.txt2
-rw-r--r--npc/re/warps/other/s_workshop.txt2
-rw-r--r--npc/scripts_mapflags.conf2
-rw-r--r--npc/scripts_warps.conf2
-rw-r--r--plugins/empty.txt2
-rw-r--r--sql-files/item_db.sql2
-rw-r--r--sql-files/item_db_re.sql2
-rw-r--r--sql-files/upgrades/2013-02-14--16-15.sql2
-rw-r--r--sql-files/upgrades/2013-02-15--18-06.sql2
-rw-r--r--sql-files/upgrades/2013-03-05--01-05.sql2
-rw-r--r--sql-files/upgrades/2013-03-09--01-56.sql2
-rw-r--r--sql-files/upgrades/2013-03-27--18-35.sql2
-rw-r--r--sql-files/upgrades/2013-04-16--01-24.sql2
-rw-r--r--sql-files/upgrades/2013-04-16--02-15.sql2
-rw-r--r--sql-files/upgrades/index.txt2
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/map/chat.c894
-rw-r--r--src/map/chat.h112
-rw-r--r--src/map/duel.c408
-rw-r--r--src/map/elemental.c1968
-rw-r--r--src/map/elemental.h212
-rw-r--r--src/map/intif.h256
-rw-r--r--src/plugins/CMakeLists.txt2
-rw-r--r--src/plugins/db2sql.c2
-rw-r--r--src/plugins/sample.c2
-rw-r--r--tools/mapreg-converter.php2
186 files changed, 2106 insertions, 2106 deletions
diff --git a/3rdparty/libconfig/CMakeLists.txt b/3rdparty/libconfig/CMakeLists.txt
index 306a85aec..a99441249 100644
--- a/3rdparty/libconfig/CMakeLists.txt
+++ b/3rdparty/libconfig/CMakeLists.txt
@@ -26,4 +26,4 @@ set( LIBCONFIG_SOURCES
CACHE INTERNAL "libconfig sources" )
set( LIBCONFIG_DEFINITIONS
"-DLIBCONFIG_STATIC"
- CACHE INTERNAL "libconfig definitions" ) \ No newline at end of file
+ CACHE INTERNAL "libconfig definitions" )
diff --git a/README.md b/README.md
index f79cc5d51..7ffe47596 100644
--- a/README.md
+++ b/README.md
@@ -162,4 +162,4 @@ Hercules has a large collection of help files and sample NPC scripts located in
There are more files in the /doc/ directory that will help you to create scripts or update the
mapcache, or even explain how the job system and item bonuses work. Before posting a topic asking
-for help on the forums, we recommend that all users take the time to look over this directory. \ No newline at end of file
+for help on the forums, we recommend that all users take the time to look over this directory.
diff --git a/README.txt b/README.txt
index 81867a4b3..a02c9117a 100644
--- a/README.txt
+++ b/README.txt
@@ -172,4 +172,4 @@ Hercules has a large collection of help files and sample NPC scripts located in
There are more files in the /doc/ directory that will help you to create scripts or update the
mapcache, or even explain how the job system and item bonuses work. Before posting a topic asking
-for help on the forums, we recommend that all users take the time to look over this directory. \ No newline at end of file
+for help on the forums, we recommend that all users take the time to look over this directory.
diff --git a/cache/README.txt b/cache/README.txt
index 1ebe4f4e5..9c97bec71 100644
--- a/cache/README.txt
+++ b/cache/README.txt
@@ -5,4 +5,4 @@
//============================================================
No touching these folders or the files in them!
-they are read and written by the server during runtime when it feels it is wise. \ No newline at end of file
+they are read and written by the server during runtime when it feels it is wise.
diff --git a/cache/db/README.txt b/cache/db/README.txt
index 1ebe4f4e5..9c97bec71 100644
--- a/cache/db/README.txt
+++ b/cache/db/README.txt
@@ -5,4 +5,4 @@
//============================================================
No touching these folders or the files in them!
-they are read and written by the server during runtime when it feels it is wise. \ No newline at end of file
+they are read and written by the server during runtime when it feels it is wise.
diff --git a/cache/db/pre-re/README.txt b/cache/db/pre-re/README.txt
index 1ebe4f4e5..9c97bec71 100644
--- a/cache/db/pre-re/README.txt
+++ b/cache/db/pre-re/README.txt
@@ -5,4 +5,4 @@
//============================================================
No touching these folders or the files in them!
-they are read and written by the server during runtime when it feels it is wise. \ No newline at end of file
+they are read and written by the server during runtime when it feels it is wise.
diff --git a/cache/db/re/README.txt b/cache/db/re/README.txt
index 1ebe4f4e5..9c97bec71 100644
--- a/cache/db/re/README.txt
+++ b/cache/db/re/README.txt
@@ -5,4 +5,4 @@
//============================================================
No touching these folders or the files in them!
-they are read and written by the server during runtime when it feels it is wise. \ No newline at end of file
+they are read and written by the server during runtime when it feels it is wise.
diff --git a/conf/atcommand.conf b/conf/atcommand.conf
index 3b3a156eb..fc2a1af73 100644
--- a/conf/atcommand.conf
+++ b/conf/atcommand.conf
@@ -68,4 +68,4 @@ nolog: {
/* Commands help file */
help: {
@include "conf/help.txt"
-} \ No newline at end of file
+}
diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf
index 7e1f83707..440dbb31a 100644
--- a/conf/battle/feature.conf
+++ b/conf/battle/feature.conf
@@ -17,4 +17,4 @@ feature.search_stores: on
// Atcommand suggestions (Note 1)
// If one type incomplete atcommand, it will suggest the complete ones.
-feature.atcommand_suggestions: off \ No newline at end of file
+feature.atcommand_suggestions: off
diff --git a/conf/battle/items.conf b/conf/battle/items.conf
index 05aadfecd..3a4eb8083 100644
--- a/conf/battle/items.conf
+++ b/conf/battle/items.conf
@@ -85,4 +85,4 @@ item_restricted_consumption_type:1
// Script commands 'enable_items/disable_items' will not be override. (see doc/script_commands.txt)
// 1 : yes(official)
// 0 : no
-item_enabled_npc:1 \ No newline at end of file
+item_enabled_npc:1
diff --git a/conf/battle/player.conf b/conf/battle/player.conf
index ccad0afc0..436399469 100644
--- a/conf/battle/player.conf
+++ b/conf/battle/player.conf
@@ -147,4 +147,4 @@ min_npc_vendchat_distance: 3
// Super Novice's fury is enabled to increments of 10%, such as at 10.0%, 20.0% - 80.0%, 90.0%
// Changing snovice_call_type config to 1 enables its use at 0%, for maxed super novices.
// default: 0
-snovice_call_type: 0 \ No newline at end of file
+snovice_call_type: 0
diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf
index bc107f3d7..9f0b98f90 100644
--- a/conf/battle/skill.conf
+++ b/conf/battle/skill.conf
@@ -279,4 +279,4 @@ skill_trap_type: 0
// Max Possible Level of Monster skills
// Note: If your MVPs are too tough, reduce it to 10.
-mob_max_skilllvl: 100 \ No newline at end of file
+mob_max_skilllvl: 100
diff --git a/conf/battlegrounds.conf b/conf/battlegrounds.conf
index 9412829b2..6864d1584 100644
--- a/conf/battlegrounds.conf
+++ b/conf/battlegrounds.conf
@@ -108,4 +108,4 @@ battlegrounds: (
pGameDuration: 20 /* time to wait for players to confirm their attendence after queueing process has finished */
}
)
-}) \ No newline at end of file
+})
diff --git a/conf/readme.txt b/conf/readme.txt
index 24b113983..3323b5689 100644
--- a/conf/readme.txt
+++ b/conf/readme.txt
@@ -19,4 +19,4 @@ and you'll eliminate any problems updating in the future.
Neat, isn't it?
-- Semi-guide by Ajarn / Euphy \ No newline at end of file
+- Semi-guide by Ajarn / Euphy
diff --git a/db/cashshop_db.conf b/db/cashshop_db.conf
index 05bf5b270..8273b133e 100644
--- a/db/cashshop_db.conf
+++ b/db/cashshop_db.conf
@@ -58,4 +58,4 @@ cash_shop: (
ID907:500
}
}
-) \ No newline at end of file
+)
diff --git a/db/homun_skill_tree.txt b/db/homun_skill_tree.txt
index a64768490..b920ccee4 100644
--- a/db/homun_skill_tree.txt
+++ b/db/homun_skill_tree.txt
@@ -116,4 +116,4 @@
6052,8030,5,0,0,0,0,0,0,0,0,0,0,0 //MH_MIDNIGHT_FRENZY
6052,8036,5,0,0,0,0,0,0,0,0,0,0,0 //MH_TINDER_BREAKER
6052,8037,5,0,0,0,0,0,0,0,0,0,0,0 //MH_CBC
-6052,8038,5,0,0,0,0,0,0,0,0,0,0,0 //MH_EQC \ No newline at end of file
+6052,8038,5,0,0,0,0,0,0,0,0,0,0,0 //MH_EQC
diff --git a/db/homunculus_db.txt b/db/homunculus_db.txt
index b69f42419..d099db173 100644
--- a/db/homunculus_db.txt
+++ b/db/homunculus_db.txt
@@ -30,4 +30,4 @@
6049,6049,Bayeri,6112,60000,1,1,2,0,700,320,10,20,17,35,11,24,12,80,130,1,4,8,20,4,20,4,20,1,10,3,19,3,19,10,20,1,10,1,10,1,5,4,10,1,3,1,4,1,5
6050,6050,Sera,6108,60000,1,1,4,0,700,90,25,29,35,9,8,30,9,45,75,3,6,4,20,8,20,1,10,3,19,4,20,3,19,5,15,5,15,4,10,1,10,1,3,1,4,1,5,1,5
6051,6051,Dieter,6104,60000,1,1,0,0,700,80,11,11,11,11,11,11,11,30,150,0,7,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,10,1,10,1,10,1,10,1,10,1,10
-6052,6052,Eleanor,6115,60000,1,1,2,0,700,320,10,20,17,35,11,24,12,80,130,1,4,8,20,4,20,4,20,1,10,3,19,3,19,10,20,1,10,1,10,1,5,4,10,1,3,1,4,1,5 \ No newline at end of file
+6052,6052,Eleanor,6115,60000,1,1,2,0,700,320,10,20,17,35,11,24,12,80,130,1,4,8,20,4,20,4,20,1,10,3,19,3,19,10,20,1,10,1,10,1,5,4,10,1,3,1,4,1,5
diff --git a/db/item_avail.txt b/db/item_avail.txt
index a3c7acdfe..7ec78923f 100644
--- a/db/item_avail.txt
+++ b/db/item_avail.txt
@@ -23,4 +23,4 @@
//Enable if you plan to use the quest.
//12715,7721
//7915,673
-//7916,675 \ No newline at end of file
+//7916,675
diff --git a/db/pre-re/item_chain.conf b/db/pre-re/item_chain.conf
index f7591b934..bedb33d73 100644
--- a/db/pre-re/item_chain.conf
+++ b/db/pre-re/item_chain.conf
@@ -101,4 +101,4 @@ ITMCHAIN_FOOD: {
Sweet_Potato: 100
Banana: 100
Apple: 600
-} \ No newline at end of file
+}
diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf
index f51fd8fc6..384384fec 100644
--- a/db/pre-re/map_zone_db.conf
+++ b/db/pre-re/map_zone_db.conf
@@ -334,4 +334,4 @@ zones: (
Greed_Scroll: true
}
}
-) \ No newline at end of file
+)
diff --git a/db/re/exp_guild.txt b/db/re/exp_guild.txt
index dcf57d159..928047600 100644
--- a/db/re/exp_guild.txt
+++ b/db/re/exp_guild.txt
@@ -48,4 +48,4 @@
220900000
230400000
240100000
-250000000 \ No newline at end of file
+250000000
diff --git a/db/re/item_chain.conf b/db/re/item_chain.conf
index f7591b934..bedb33d73 100644
--- a/db/re/item_chain.conf
+++ b/db/re/item_chain.conf
@@ -101,4 +101,4 @@ ITMCHAIN_FOOD: {
Sweet_Potato: 100
Banana: 100
Apple: 600
-} \ No newline at end of file
+}
diff --git a/db/re/item_db.txt b/db/re/item_db.txt
index b9c3c8c09..b4c2ca654 100644
--- a/db/re/item_db.txt
+++ b/db/re/item_db.txt
@@ -8295,4 +8295,4 @@
21004,Alca_Bringer_,Alca Bringer,4,20,,3400,280,,2,2,0x00004080,56,2,34,3,100,1,3,{},{},{}
21005,Metal_Two_Hand_Sword,Metal Two-Handed Sword,4,20,,0,95,,1,1,0x00004082,63,2,34,3,0,1,3,{},{},{}
22514,Candy_Holder,Candy Holder,11,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
-22540,Runstone_Luxanima,Lux Anima Rune,11,2,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "RK_LUXANIMA",1; },{},{} \ No newline at end of file
+22540,Runstone_Luxanima,Lux Anima Rune,11,2,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "RK_LUXANIMA",1; },{},{}
diff --git a/db/re/item_group.conf b/db/re/item_group.conf
index 92a98fedc..85d2610fb 100644
--- a/db/re/item_group.conf
+++ b/db/re/item_group.conf
@@ -4741,4 +4741,4 @@ Lucky_Bag: (
("Taiwan_Luk_Coin",3),
"Big_Luk_Bookmark"
)
-*/ \ No newline at end of file
+*/
diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf
index f51fd8fc6..384384fec 100644
--- a/db/re/map_zone_db.conf
+++ b/db/re/map_zone_db.conf
@@ -334,4 +334,4 @@ zones: (
Greed_Scroll: true
}
}
-) \ No newline at end of file
+)
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 1e2985f66..42b085cd6 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -1428,4 +1428,4 @@ Sets the intimacy level of your homunculus, with 1000 being "Loyal".
Sets the hunger level of your homunculus, with 100 being "Stuffed".
---------------------------------------- \ No newline at end of file
+---------------------------------------
diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
index 7545016b5..b9dc9080f 100644
--- a/doc/item_bonus.txt
+++ b/doc/item_bonus.txt
@@ -412,4 +412,4 @@ bonus bVariableCast,x; Increases variable cast time of all skills by x millise
bonus2 bSkillFixedCast,s,x; Increases fixed cast time of skill s by x milliseconds. (supports skill names.)
bonus2 bSkillVariableCast,s,x; Increases variable cast time of skill s by x milliseconds. (supports skill names.)
bonus2 bVariableCastrate,s,x; Increases variable cast time of skill s by x%. (supports skill names.)
-bonus2 bFixedCastrate,s,x; Increases fixed cast time of skill s by x%. (supports skill names.) \ No newline at end of file
+bonus2 bFixedCastrate,s,x; Increases fixed cast time of skill s by x%. (supports skill names.)
diff --git a/doc/md5_hashcheck.txt b/doc/md5_hashcheck.txt
index a2dbf42fa..779785638 100644
--- a/doc/md5_hashcheck.txt
+++ b/doc/md5_hashcheck.txt
@@ -35,4 +35,4 @@ To enable MD5 hash checks, set 'client_hash_check' to 'on'.
The 'client_hash' group_id can be any of the groups in conf\groups.conf,
and is particularly useful if you wanted to allow GMs a different client
than normal players; for example, a GM client could be hexed differently
-with dual-clienting enabled and chat flood disabled. \ No newline at end of file
+with dual-clienting enabled and chat flood disabled.
diff --git a/doc/permissions.txt b/doc/permissions.txt
index 6cfb98897..9760f716c 100644
--- a/doc/permissions.txt
+++ b/doc/permissions.txt
@@ -31,4 +31,4 @@ show_bossmobs : Ability to see boss mobs with @showmobs.
disable_pvm : Ability to disable Player vs. Monster.
disable_pvp : Ability to disable Player vs. Player.
disable_commands_when_dead : Ability to disable @command usage when dead.
-hchsys_admin : Hercules Chat System Admin (Ability to modify channel settings regardless of ownership and join password-protected channels without requiring a password.) \ No newline at end of file
+hchsys_admin : Hercules Chat System Admin (Ability to modify channel settings regardless of ownership and join password-protected channels without requiring a password.)
diff --git a/doc/sample/bank_test.txt b/doc/sample/bank_test.txt
index e63ef7e12..8b29abd93 100644
--- a/doc/sample/bank_test.txt
+++ b/doc/sample/bank_test.txt
@@ -64,4 +64,4 @@ B_EXIT2:
mes "Good bye!";
cutin "kafra_06",255;
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/basejob_baseclass_upper.txt b/doc/sample/basejob_baseclass_upper.txt
index 04f7d310f..8e2501e09 100644
--- a/doc/sample/basejob_baseclass_upper.txt
+++ b/doc/sample/basejob_baseclass_upper.txt
@@ -15,4 +15,4 @@ prontera,155,177,1 script Tell Me 725,{
mes "BaseJob: " + BaseJob;
mes "Upper: " + Upper;
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/checkoption.txt b/doc/sample/checkoption.txt
index eb768b9b2..8f0f96d9f 100644
--- a/doc/sample/checkoption.txt
+++ b/doc/sample/checkoption.txt
@@ -14,4 +14,4 @@ prontera,156,89,6 script test_checkoption 117,{
if(checkoption(@value) == 1) mes "True!";
else if(checkoption(@value) == 0) mes "False!";
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/delitem2.txt b/doc/sample/delitem2.txt
index f38d59c27..9e74d76e7 100644
--- a/doc/sample/delitem2.txt
+++ b/doc/sample/delitem2.txt
@@ -36,4 +36,4 @@ prontera,160,182,5 script Delitem2 51,{
delitem2 @nameid,@amount,@iden,@ref,@attr,@c1,@c2,@c3,@c4;
mes "And here is the moment when your item should disappear! :P";
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/getequipcardid.txt b/doc/sample/getequipcardid.txt
index 0447bf533..6b435f41f 100644
--- a/doc/sample/getequipcardid.txt
+++ b/doc/sample/getequipcardid.txt
@@ -22,4 +22,4 @@ prontera,155,177,4 script Check My Hat 810,{
mes "Nothing?";
emotion e_hmm;
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/getequipid.txt b/doc/sample/getequipid.txt
index 654c58f3b..6a2ef342f 100644
--- a/doc/sample/getequipid.txt
+++ b/doc/sample/getequipid.txt
@@ -13,4 +13,4 @@ prontera,161,181,6 script GetEquipID Sample 105,{
for(set .@i,1; .@i<11; set .@i,.@i+1)
mes "GetEquipID(" + .@i + ") : " + getequipid(1);
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt
index 15b81b749..632999f3b 100644
--- a/doc/sample/getiteminfo.txt
+++ b/doc/sample/getiteminfo.txt
@@ -20,4 +20,4 @@ prontera,156,179,6 script test_getiteminfo 117,{
for(set .@id,0; .@id<14; set .@id,.@id+1)
mes " getiteminfo("+.@value+","+.@id+") = "+getiteminfo(.@value,.@id);
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/getmonsterinfo.txt b/doc/sample/getmonsterinfo.txt
index 079d9e7e9..471af9e5c 100644
--- a/doc/sample/getmonsterinfo.txt
+++ b/doc/sample/getmonsterinfo.txt
@@ -20,4 +20,4 @@ prontera,156,179,6 script test_getmonsterinfo 117,{
for(set .@id,0; .@id<23; set .@id,.@id+1)
mes " getmonsterinfo("+.@value+","+@id+") = "+getmonsterinfo(.@value,@id);
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/gstorage_test.txt b/doc/sample/gstorage_test.txt
index 559f7f76e..b8f9fe2c4 100644
--- a/doc/sample/gstorage_test.txt
+++ b/doc/sample/gstorage_test.txt
@@ -41,4 +41,4 @@ GS_EXIT3:
GS_EXIT4:
cutin "kafra_06",255;
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_dynamic_shop.txt b/doc/sample/npc_dynamic_shop.txt
index b6ed48808..c3bc78293 100644
--- a/doc/sample/npc_dynamic_shop.txt
+++ b/doc/sample/npc_dynamic_shop.txt
@@ -92,4 +92,4 @@ OnInit:
set $@rpotsleft, 10;
set $@opotsleft, 10;
end;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_extend_shop.txt b/doc/sample/npc_extend_shop.txt
index ccc2ce5bb..1ca4ed7b8 100644
--- a/doc/sample/npc_extend_shop.txt
+++ b/doc/sample/npc_extend_shop.txt
@@ -27,4 +27,4 @@ prontera,146,229,5 shop Armor Card Merchant 80,4003:100000,4008:100000,4011:1000
prontera,144,227,5 shop Shield Card Merchant 80,4013:100000,4032:100000,4058:100000,4059:100000,4066:100000,4074:100000,4083:100000,4120:100000,4124:100000,4136:100000,4138:100000,4045:100000,4067:100000,4075:100000,4090:100000
prontera,142,225,5 shop Robe Card Merchant 80,4056:100000,4071:100000,4081:100000,4095:100000,4108:100000,4109:100000,4113:100000,4116:100000,4133:100000,4015:100000,4088:100000,4102:100000,4129:100000
prontera,140,223,5 shop Shoes Card Merchant 80,4009:100000,4038:100000,4050:100000,4070:100000,4097:100000,4100:100000,4107:100000
-prontera,138,221,5 shop Accessory Card Merchant 80,4022:100500,4027:100500,4028:100500,4034:100500,4051:100500,4064:100500,4091:100500,4079:100500,4033:100500,4040:100500,4044:100500,4048:100500,4053:100500,4073:100500,4077:100500,4084:100500,4093:100500,4103:100500,4139:100500 \ No newline at end of file
+prontera,138,221,5 shop Accessory Card Merchant 80,4022:100500,4027:100500,4028:100500,4034:100500,4051:100500,4064:100500,4091:100500,4079:100500,4033:100500,4040:100500,4044:100500,4048:100500,4053:100500,4073:100500,4077:100500,4084:100500,4093:100500,4103:100500,4139:100500
diff --git a/doc/sample/npc_live_dialogues.txt b/doc/sample/npc_live_dialogues.txt
index 22422d9af..8778f6c50 100644
--- a/doc/sample/npc_live_dialogues.txt
+++ b/doc/sample/npc_live_dialogues.txt
@@ -51,4 +51,4 @@ M_BYE:
// Add some random goodbye from Global_Functions.txt
mes callfunc("F_Bye");
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_shop_test.txt b/doc/sample/npc_shop_test.txt
index fa58f3f52..5e492b257 100644
--- a/doc/sample/npc_shop_test.txt
+++ b/doc/sample/npc_shop_test.txt
@@ -37,4 +37,4 @@ prontera,218,211,4 shop Pet Groomer 125,537:2500,643:3000,10013:1500,10014:2000
izlude,164,138,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
morocc,269,167,4 shop Pet Groomer 125,537:2500,643:3000,10013:1500,10014:2000
geffen,193,152,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
-payon,142,104,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000 \ No newline at end of file
+payon,142,104,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
diff --git a/doc/sample/npc_test_array.txt b/doc/sample/npc_test_array.txt
index b6185adbc..36b54a3fe 100644
--- a/doc/sample/npc_test_array.txt
+++ b/doc/sample/npc_test_array.txt
@@ -40,4 +40,4 @@ prontera,164,190,1 script Array Test 112,{
mes "hoge[2]=> " + @hoge[2];
mes "hoge[3]=> " + @hoge[3];
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_chat.txt b/doc/sample/npc_test_chat.txt
index 24176b802..ca81840ea 100644
--- a/doc/sample/npc_test_chat.txt
+++ b/doc/sample/npc_test_chat.txt
@@ -34,4 +34,4 @@ OnChatEvent:
disablewaitingroomevent;
warpwaitingpc "prontera",160,180;
end;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_duplicate.txt b/doc/sample/npc_test_duplicate.txt
index 237e7e57d..d052e1cee 100644
--- a/doc/sample/npc_test_duplicate.txt
+++ b/doc/sample/npc_test_duplicate.txt
@@ -29,4 +29,4 @@ OnTouch:
prontera,150,175,4 duplicate(Test Script) Test1 909
prontera,155,175,4 duplicate(Test Script) Test2 909,2,2
-prontera,160,175,4 duplicate(Test Script) Test3 909,3,3 \ No newline at end of file
+prontera,160,175,4 duplicate(Test Script) Test3 909,3,3
diff --git a/doc/sample/npc_test_npctimer.txt b/doc/sample/npc_test_npctimer.txt
index f3c2d8bee..7dc625785 100644
--- a/doc/sample/npc_test_npctimer.txt
+++ b/doc/sample/npc_test_npctimer.txt
@@ -39,4 +39,4 @@ OnTimer5000:
OnTimer10000:
npctalk "After 10 seconds...";
end;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_npctimer2.txt b/doc/sample/npc_test_npctimer2.txt
index 6c5d139f0..1bb856b13 100644
--- a/doc/sample/npc_test_npctimer2.txt
+++ b/doc/sample/npc_test_npctimer2.txt
@@ -20,4 +20,4 @@ OnTimer5000:
mes "Ah, your level is " + readparam(11) + "!";
detachnpctimer;
close;
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_quest.txt b/doc/sample/npc_test_quest.txt
index 39f838e23..821c83739 100644
--- a/doc/sample/npc_test_quest.txt
+++ b/doc/sample/npc_test_quest.txt
@@ -45,4 +45,4 @@ prontera,90,95,1 script Jelly 123,{
mes "Thanks again for doing that for me!";
close;
}
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_setmapflag.txt b/doc/sample/npc_test_setmapflag.txt
index 010a6f85d..681fbc43a 100644
--- a/doc/sample/npc_test_setmapflag.txt
+++ b/doc/sample/npc_test_setmapflag.txt
@@ -29,4 +29,4 @@ prontera,165,145,0 script EXPflagtest 123,{
removemapflag "prontera",MF_PVP;
close;
}
-} \ No newline at end of file
+}
diff --git a/doc/sample/npc_test_time.txt b/doc/sample/npc_test_time.txt
index f9c40b910..ffa6a5ca2 100644
--- a/doc/sample/npc_test_time.txt
+++ b/doc/sample/npc_test_time.txt
@@ -22,4 +22,4 @@ prontera,157,181,6 script Time Sample 105,{
mes " GetTime(7) : " + gettime(7) + " (Year)";
mes " GetTimeStr : " + gettimestr("%Y-%m/%d %H:%M:%S",19);
close;
-} \ No newline at end of file
+}
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 75c731d53..29a1478fa 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1,4 +1,4 @@
-//===== Hercules Documentation ===============================
+//===== Hercules Documentation ===============================
//= Hercules Script Commands
//===== By: ==================================================
//= Hercules Dev Team
diff --git a/doc/whisper_sys.txt b/doc/whisper_sys.txt
index 3c870b543..39e2a54f2 100644
--- a/doc/whisper_sys.txt
+++ b/doc/whisper_sys.txt
@@ -49,4 +49,4 @@ OnWhisperGlobal:
// Script for an MVP summoning event.
}
end;
-} \ No newline at end of file
+}
diff --git a/npc/MOTD.txt b/npc/MOTD.txt
index 7b2f086b4..5e00f85b7 100644
--- a/npc/MOTD.txt
+++ b/npc/MOTD.txt
@@ -12,4 +12,4 @@
- script HerculesMOTD -1,{
message strcharinfo(0),"Welcome to Hercules! Enjoy! Please report any bugs you find.";
end;
-} \ No newline at end of file
+}
diff --git a/npc/airports/rachel.txt b/npc/airports/rachel.txt
index 88c48cd16..fce302cbc 100644
--- a/npc/airports/rachel.txt
+++ b/npc/airports/rachel.txt
@@ -31,4 +31,4 @@ OnTouch:
}
mes "Thank you, please come again.";
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/etc/quest_warper.txt b/npc/custom/etc/quest_warper.txt
index 840325636..a8e06cc75 100644
--- a/npc/custom/etc/quest_warper.txt
+++ b/npc/custom/etc/quest_warper.txt
@@ -1689,4 +1689,4 @@ treasure02,104,40,3 script Warpra Helper#24 112,{ callfunc "QWS_Dungeon_Warpra",
xmas_dun02,124,131,3 script Warpra Helper#25 112,{ callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon"; close; }
um_dun02,44,28,3 script Warpra Helper#26 112,{ callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon"; close; }
tur_dun02,162,23,3 script Warpra Helper#27 112,{ callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon"; close; }
-prt_maze02,102,69,4 script Warpra Helper#28 112,{ callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon"; close; } \ No newline at end of file
+prt_maze02,102,69,4 script Warpra Helper#28 112,{ callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon"; close; }
diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt
index cf296cb18..b221b1b7a 100644
--- a/npc/custom/events/cluckers.txt
+++ b/npc/custom/events/cluckers.txt
@@ -111,4 +111,4 @@ OnTimer40000:
if (!$cluck_item_amount) set $cluck_item_amount,1;
set .startcluck,1;
end;
-} \ No newline at end of file
+}
diff --git a/npc/custom/jobmaster.txt b/npc/custom/jobmaster.txt
index 00963bf36..68feb5b16 100644
--- a/npc/custom/jobmaster.txt
+++ b/npc/custom/jobmaster.txt
@@ -187,4 +187,4 @@ OnInit:
set .SkillPointCheck,1; // Force player to use up all skill points? (1: yes / 0: no)
set .Platinum,1; // Get platinum skills automatically? (1: yes / 0: no)
end;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/berzebub.txt b/npc/custom/quests/berzebub.txt
index 1ba44211e..6f58870eb 100644
--- a/npc/custom/quests/berzebub.txt
+++ b/npc/custom/quests/berzebub.txt
@@ -59,4 +59,4 @@ M_Leave:
mes .@n$;
mes "Such a great item I have right here...";
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/kaho_balmung.txt b/npc/custom/quests/kaho_balmung.txt
index a2a154acf..47b12ca87 100644
--- a/npc/custom/quests/kaho_balmung.txt
+++ b/npc/custom/quests/kaho_balmung.txt
@@ -48,4 +48,4 @@ prontera,158,356,4 script Royal Messenger 105,{
mes "I see you already have all the items you need. Here's your "+getitemname(getd(".@Req"+.@i+"[0]"))+", as promised.";
getitem getd(".@Req"+.@i+"[0]"),1;
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/kahohorn.txt b/npc/custom/quests/kahohorn.txt
index 031631b74..6a6e36e7c 100644
--- a/npc/custom/quests/kahohorn.txt
+++ b/npc/custom/quests/kahohorn.txt
@@ -66,4 +66,4 @@ geffen,115,107,5 script Lord Kaho's Servant 61,{
getitem 5013,1;
mes "Enjoy being God of Rune-Midgard!";
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/kings_items.txt b/npc/custom/quests/kings_items.txt
index d935dac08..bd2288d28 100644
--- a/npc/custom/quests/kings_items.txt
+++ b/npc/custom/quests/kings_items.txt
@@ -76,4 +76,4 @@ prt_castle,84,170,4 script King's Daughter 62,{
mes "Well, he won't give me what I want!!";
mes "He's the King of Prontera. He should be able to get me ANYTHING!!!";
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/quest_shop.txt b/npc/custom/quests/quest_shop.txt
index 3395ac102..0483e90da 100644
--- a/npc/custom/quests/quest_shop.txt
+++ b/npc/custom/quests/quest_shop.txt
@@ -229,4 +229,4 @@ function script qshop {
- shop qshop2 -1,909:-1
- shop qshop3 -1,909:-1
- shop qshop4 -1,909:-1
-- shop qshop5 -1,909:-1 \ No newline at end of file
+- shop qshop5 -1,909:-1
diff --git a/npc/custom/quests/sphinx_mask.txt b/npc/custom/quests/sphinx_mask.txt
index b2cf64559..fb006f3fa 100644
--- a/npc/custom/quests/sphinx_mask.txt
+++ b/npc/custom/quests/sphinx_mask.txt
@@ -49,4 +49,4 @@ L_Menu:
getitem 7114,1;
set sphmask_q,1;
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/quests/sunglasses.txt b/npc/custom/quests/sunglasses.txt
index 6e44ce007..c7ebbf937 100644
--- a/npc/custom/quests/sunglasses.txt
+++ b/npc/custom/quests/sunglasses.txt
@@ -105,4 +105,4 @@ moc_fild07,334,186,5 script Maseph 702,{
getitem 2202,1;
set SG_QUEST1,0;
close;
-} \ No newline at end of file
+}
diff --git a/npc/custom/woe_controller.txt b/npc/custom/woe_controller.txt
index c7d3f4e9e..9ddaeb362 100644
--- a/npc/custom/woe_controller.txt
+++ b/npc/custom/woe_controller.txt
@@ -447,4 +447,4 @@ while(1) {
case 5:
close;
} }
-} \ No newline at end of file
+}
diff --git a/npc/events/idul_fitri.txt b/npc/events/idul_fitri.txt
index c4c06f07f..557ce62c9 100644
--- a/npc/events/idul_fitri.txt
+++ b/npc/events/idul_fitri.txt
@@ -68,4 +68,4 @@ prontera,146,92,3 script Cellerb 58,{
emotion e_hmm;
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/events/valentinesday.txt b/npc/events/valentinesday.txt
index 8f2bd85d5..a08a1a701 100644
--- a/npc/events/valentinesday.txt
+++ b/npc/events/valentinesday.txt
@@ -126,4 +126,4 @@ prt_castle,54,34,4 script Carl Orleans 47,{
mes "[Carl Orleans]";
mes "Enjoy.";
close;
-} \ No newline at end of file
+}
diff --git a/npc/events/valentinesday_2012.txt b/npc/events/valentinesday_2012.txt
index a8597cd22..6ae844305 100644
--- a/npc/events/valentinesday_2012.txt
+++ b/npc/events/valentinesday_2012.txt
@@ -153,4 +153,4 @@ mosk_in,21,244,3 script Baker Extraordinaire 410,{
mes "Hello, "+strcharinfo(0)+"!";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/guild/trs_rp.txt b/npc/guild/trs_rp.txt
index 7b3ae5545..0c4374b66 100644
--- a/npc/guild/trs_rp.txt
+++ b/npc/guild/trs_rp.txt
@@ -52,4 +52,4 @@ gefg_cas01,154,112,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas01 -1,6,6
gefg_cas02,140,116,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas02 -1,6,6
gefg_cas03,271,290,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas03 -1,6,6
gefg_cas04,116,119,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas04 -1,6,6
-gefg_cas05,144,110,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas05 -1,6,6 \ No newline at end of file
+gefg_cas05,144,110,0 duplicate(Gld_Trea_Protect) ban_warp#gefg_cas05 -1,6,6
diff --git a/npc/guild2/arug_cas01.txt b/npc/guild2/arug_cas01.txt
index a2b929347..1f54b54ee 100644
--- a/npc/guild2/arug_cas01.txt
+++ b/npc/guild2/arug_cas01.txt
@@ -72,4 +72,4 @@ OnRecvCastleAr01:
}
aru_gld,142,235,4 duplicate(Ar01_Flag) Mardol#flag_Ar01_2 722
aru_gld,164,245,5 duplicate(Ar01_Flag) Mardol#flag_Ar01_3 722
-aru_gld,182,255,5 duplicate(Ar01_Flag) Mardol#flag_Ar01_4 722 \ No newline at end of file
+aru_gld,182,255,5 duplicate(Ar01_Flag) Mardol#flag_Ar01_4 722
diff --git a/npc/guild2/arug_cas02.txt b/npc/guild2/arug_cas02.txt
index a6b7f0d55..006443d14 100644
--- a/npc/guild2/arug_cas02.txt
+++ b/npc/guild2/arug_cas02.txt
@@ -77,4 +77,4 @@ OnAgitInit2:
OnRecvCastleAr02:
FlagEmblem GetCastleData("arug_cas02",1);
end;
-} \ No newline at end of file
+}
diff --git a/npc/guild2/arug_cas03.txt b/npc/guild2/arug_cas03.txt
index bf11c9449..93144fd36 100644
--- a/npc/guild2/arug_cas03.txt
+++ b/npc/guild2/arug_cas03.txt
@@ -69,4 +69,4 @@ OnRecvCastleAr03:
FlagEmblem GetCastleData("arug_cas03",1);
end;
}
-aru_gld,74,174,0 duplicate(Ar03_Flag) Horn#flag_Ar03_2 722 \ No newline at end of file
+aru_gld,74,174,0 duplicate(Ar03_Flag) Horn#flag_Ar03_2 722
diff --git a/npc/guild2/arug_cas04.txt b/npc/guild2/arug_cas04.txt
index c46c7ff15..6826d0d5e 100644
--- a/npc/guild2/arug_cas04.txt
+++ b/npc/guild2/arug_cas04.txt
@@ -78,4 +78,4 @@ OnRecvCastlear04:
FlagEmblem GetCastleData("arug_cas04",1);
end;
}
-aru_gld,313,318,4 duplicate(ar04_Flag2) Gefn#flag_ar04_4 722 \ No newline at end of file
+aru_gld,313,318,4 duplicate(ar04_Flag2) Gefn#flag_ar04_4 722
diff --git a/npc/guild2/arug_cas05.txt b/npc/guild2/arug_cas05.txt
index b250a9385..70b61e3cb 100644
--- a/npc/guild2/arug_cas05.txt
+++ b/npc/guild2/arug_cas05.txt
@@ -78,4 +78,4 @@ OnRecvCastlear05:
FlagEmblem GetCastleData("arug_cas05",1);
end;
}
-aru_gld,350,88,6 duplicate(ar05_Flag2) Banadis#flag_ar05_4 722 \ No newline at end of file
+aru_gld,350,88,6 duplicate(ar05_Flag2) Banadis#flag_ar05_4 722
diff --git a/npc/guild2/schg_cas01.txt b/npc/guild2/schg_cas01.txt
index 8200b49a0..f001f3379 100644
--- a/npc/guild2/schg_cas01.txt
+++ b/npc/guild2/schg_cas01.txt
@@ -69,4 +69,4 @@ OnRecvCastlesc01:
FlagEmblem GetCastleData("schg_cas01",1);
end;
}
-sch_gld,297,90,0 duplicate(Sc01_Flag) Himinn#flag_sc01_2 722 \ No newline at end of file
+sch_gld,297,90,0 duplicate(Sc01_Flag) Himinn#flag_sc01_2 722
diff --git a/npc/guild2/schg_cas02.txt b/npc/guild2/schg_cas02.txt
index 0a39f484a..bf7b457ba 100644
--- a/npc/guild2/schg_cas02.txt
+++ b/npc/guild2/schg_cas02.txt
@@ -61,4 +61,4 @@ OnRecvCastlesc02:
FlagEmblem GetCastleData("schg_cas02",1);
end;
}
-sch_gld,280,247,4 duplicate(Sc02_Flag) Andlangr#flag_sc02_2 722 \ No newline at end of file
+sch_gld,280,247,4 duplicate(Sc02_Flag) Andlangr#flag_sc02_2 722
diff --git a/npc/guild2/schg_cas03.txt b/npc/guild2/schg_cas03.txt
index 6adfa0ca1..b473c2702 100644
--- a/npc/guild2/schg_cas03.txt
+++ b/npc/guild2/schg_cas03.txt
@@ -69,4 +69,4 @@ OnRecvCastlesc03:
FlagEmblem GetCastleData("schg_cas03",1);
end;
}
-sch_gld,104,191,0 duplicate(Sc03_Flag) Bidblind#flag_sc03_2 722 \ No newline at end of file
+sch_gld,104,191,0 duplicate(Sc03_Flag) Bidblind#flag_sc03_2 722
diff --git a/npc/guild2/schg_cas04.txt b/npc/guild2/schg_cas04.txt
index 8da46dec5..51e21b972 100644
--- a/npc/guild2/schg_cas04.txt
+++ b/npc/guild2/schg_cas04.txt
@@ -69,4 +69,4 @@ OnRecvCastlesc04:
FlagEmblem GetCastleData("schg_cas04",1);
end;
}
-sch_gld,141,97,4 duplicate(sc04_Flag) Hljod#flag_sc04_2 722 \ No newline at end of file
+sch_gld,141,97,4 duplicate(sc04_Flag) Hljod#flag_sc04_2 722
diff --git a/npc/guild2/schg_cas05.txt b/npc/guild2/schg_cas05.txt
index 46b03e8bd..6f2b84544 100644
--- a/npc/guild2/schg_cas05.txt
+++ b/npc/guild2/schg_cas05.txt
@@ -71,4 +71,4 @@ OnRecvCastlesc05:
}
sch_gld,91,284,4 duplicate(sc05_Flag) Skidbladnir#flag_sc05_2 722
sch_gld,66,320,6 duplicate(sc05_Flag) Skidbladnir#flag_sc05_3 722
-sch_gld,66,310,6 duplicate(sc05_Flag) Skidbladnir#flag_sc05_4 722 \ No newline at end of file
+sch_gld,66,310,6 duplicate(sc05_Flag) Skidbladnir#flag_sc05_4 722
diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt
index c3df4e0af..d10c2fe2f 100644
--- a/npc/kafras/functions_kafras.txt
+++ b/npc/kafras/functions_kafras.txt
@@ -634,4 +634,4 @@ function script F_KafSet {
setd "@wrpC$["+.@i+"]",getd("@wrpD$["+.@i+"]")+" -> "+getd("@wrpP["+.@i+"]");
setd "@wrpC$["+getarraysize(@wrpC$)+"]","Cancel";
return;
-} \ No newline at end of file
+}
diff --git a/npc/mapflag/skillduration.txt b/npc/mapflag/skillduration.txt
index ca2f82a40..d3d96cae3 100644
--- a/npc/mapflag/skillduration.txt
+++ b/npc/mapflag/skillduration.txt
@@ -19,4 +19,4 @@
//= durations not controlled by the server (e.g. Storm Gust).
//===== Additional Comments: =================================
//= 1.0 - Initial script.
-//============================================================ \ No newline at end of file
+//============================================================
diff --git a/npc/mapflag/skillmodifier.txt b/npc/mapflag/skillmodifier.txt
index bd60806f7..60c623a36 100644
--- a/npc/mapflag/skillmodifier.txt
+++ b/npc/mapflag/skillmodifier.txt
@@ -16,4 +16,4 @@
//= Doubles the damage of Firebolt in Prontera.
//===== Additional Comments: =================================
//= 1.0 - Initial script.
-//============================================================ \ No newline at end of file
+//============================================================
diff --git a/npc/mapflag/town.txt b/npc/mapflag/town.txt
index 46331818b..a89e5f7be 100644
--- a/npc/mapflag/town.txt
+++ b/npc/mapflag/town.txt
@@ -37,4 +37,4 @@ mora mapflag town
dewata mapflag town
malangdo mapflag town
malaya mapflag town
-eclage mapflag town \ No newline at end of file
+eclage mapflag town
diff --git a/npc/mapflag/zone.txt b/npc/mapflag/zone.txt
index 62047effa..9c0be04c4 100644
--- a/npc/mapflag/zone.txt
+++ b/npc/mapflag/zone.txt
@@ -107,4 +107,4 @@ splendide mapflag zone Towns
umbala mapflag zone Towns
veins mapflag zone Towns
xmas mapflag zone Towns
-yuno mapflag zone Towns \ No newline at end of file
+yuno mapflag zone Towns
diff --git a/npc/merchants/cashheadgear_dye.txt b/npc/merchants/cashheadgear_dye.txt
index 49003e18b..3d9fd89d8 100644
--- a/npc/merchants/cashheadgear_dye.txt
+++ b/npc/merchants/cashheadgear_dye.txt
@@ -114,4 +114,4 @@ prt_in,253,168,4 script Alora 862,{
delitem .@myHG,1; // Your headgear
getitem .@dyHG,1; // Dyed headgear
close;
-} \ No newline at end of file
+}
diff --git a/npc/merchants/clothes_dyer.txt b/npc/merchants/clothes_dyer.txt
index 38e44d3cb..253e849a7 100644
--- a/npc/merchants/clothes_dyer.txt
+++ b/npc/merchants/clothes_dyer.txt
@@ -1,4 +1,4 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= Clothes Dyer
//===== By: ==================================================
//= Usnul
@@ -171,4 +171,4 @@ function Dyes {
mes "Your clothes have been dyed "+((.@s)?.@DyeName$[getarg((.@s-1)*2)]:.@DyeName$[0])+".";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/merchants/coin_exchange.txt b/npc/merchants/coin_exchange.txt
index c52db9787..04c4f793c 100644
--- a/npc/merchants/coin_exchange.txt
+++ b/npc/merchants/coin_exchange.txt
@@ -84,4 +84,4 @@
}
}
man_in01,286,16,1 duplicate(merchant_13_2) Merchant of Manuk 454
-spl_in01,110,326,5 duplicate(merchant_13_2) Merchant of Splendide 439 \ No newline at end of file
+spl_in01,110,326,5 duplicate(merchant_13_2) Merchant of Splendide 439
diff --git a/npc/merchants/elemental_trader.txt b/npc/merchants/elemental_trader.txt
index 2d120d190..10dcec3e4 100644
--- a/npc/merchants/elemental_trader.txt
+++ b/npc/merchants/elemental_trader.txt
@@ -155,4 +155,4 @@ ama_in02,61,27,7 script Alchemist#ama 749,{
mes "Bring me stones! You said you are going to help me!";
mes "Keep your promises! Kehehehkehkeh...";
close;
-} \ No newline at end of file
+}
diff --git a/npc/merchants/enchan_arm.txt b/npc/merchants/enchan_arm.txt
index a9ad383b8..5bb9a7d7d 100644
--- a/npc/merchants/enchan_arm.txt
+++ b/npc/merchants/enchan_arm.txt
@@ -150,4 +150,4 @@ S_EnchantArmor:
mes "Please come back with just ONE equipment to be enchanted.";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/merchants/hd_refine.txt b/npc/merchants/hd_refine.txt
index f944d34ba..dd7b0a813 100644
--- a/npc/merchants/hd_refine.txt
+++ b/npc/merchants/hd_refine.txt
@@ -315,4 +315,4 @@ payon,148,174,3 duplicate(Basta) Basta#payon 826
alberta_in,18,56,3 duplicate(Basta) Basta#alberta 826
yuno_in01,173,18,3 duplicate(Basta) Basta#yuno 826
ein_in01,24,82,3 duplicate(Basta) Basta#einbroch 826
-lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 826 \ No newline at end of file
+lhz_in02,280,17,3 duplicate(Basta) Basta#lighthalzen 826
diff --git a/npc/merchants/renters.txt b/npc/merchants/renters.txt
index 02afc4059..8f9410eda 100644
--- a/npc/merchants/renters.txt
+++ b/npc/merchants/renters.txt
@@ -224,4 +224,4 @@ hu_in01,381,304,5 script Falcon Breeder#hnt 105,{
mes "...Heh heh, jealous?";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/other/card_trader.txt b/npc/other/card_trader.txt
index e451a596e..c89bc8518 100644
--- a/npc/other/card_trader.txt
+++ b/npc/other/card_trader.txt
@@ -193,4 +193,4 @@ prontera,115,90,0 script Putty 90,{
break;
}
close;
-} \ No newline at end of file
+}
diff --git a/npc/other/comodo_gambling.txt b/npc/other/comodo_gambling.txt
index 188066181..8a300253c 100644
--- a/npc/other/comodo_gambling.txt
+++ b/npc/other/comodo_gambling.txt
@@ -569,4 +569,4 @@ mjolnir_02,85,362,3 script Blacksmith Miner 726,{
mes "you at a cheap price.";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/other/guildpvp.txt b/npc/other/guildpvp.txt
index 68aca1f5d..047093e5d 100644
--- a/npc/other/guildpvp.txt
+++ b/npc/other/guildpvp.txt
@@ -51,4 +51,4 @@ pvp_y_room,77,85,4 script Guild Battle Guide 105,{
close2;
warp "guild_vs"+.@i,getd(".@map"+.@j+"X["+.@i+"]"),.@mapY[.@i];
end;
-} \ No newline at end of file
+}
diff --git a/npc/other/monster_race.txt b/npc/other/monster_race.txt
index a48afea3e..273df9345 100644
--- a/npc/other/monster_race.txt
+++ b/npc/other/monster_race.txt
@@ -2962,4 +2962,4 @@ p_track01,45,42,3 script Absent Minded Man#single 881,{
mes "I should win at least once,";
mes "right? What's going on?!";
close;
-} \ No newline at end of file
+}
diff --git a/npc/other/sealstatus.txt b/npc/other/sealstatus.txt
index 038d5357d..cb2806c6a 100644
--- a/npc/other/sealstatus.txt
+++ b/npc/other/sealstatus.txt
@@ -32,4 +32,4 @@ prontera,113,294,3 script Sign Post 837,{
if (god_mjo_0 < 11) mes "^ff0000Mjolnir Seal: Not Completed^000000";
else mes "^00ff00Mjolnir Seal: Completed^000000";
close;
-} \ No newline at end of file
+}
diff --git a/npc/pre-re/cities/izlude.txt b/npc/pre-re/cities/izlude.txt
index 950f19abd..2ad5b16a8 100644
--- a/npc/pre-re/cities/izlude.txt
+++ b/npc/pre-re/cities/izlude.txt
@@ -25,4 +25,4 @@ izlude,58,126,2 duplicate(Cebalis_izlude) Cebalis#izlude 98
izlude,124,178,2 duplicate(Soldier_izlude) Soldier#izlude 105
izlude,171,133,3 duplicate(bdt) Bullet Dealer Tony#iz 86
izlude,171,127,3 duplicate(mdk) Magazine Dealer Kenny 83
-izlude_in,110,64,3 duplicate(Dorian) Dorian#izlude 878,2,2,{ \ No newline at end of file
+izlude_in,110,64,3 duplicate(Dorian) Dorian#izlude 878,2,2,{
diff --git a/npc/pre-re/guides/guides_alberta.txt b/npc/pre-re/guides/guides_alberta.txt
index c08894f52..966e0c364 100644
--- a/npc/pre-re/guides/guides_alberta.txt
+++ b/npc/pre-re/guides/guides_alberta.txt
@@ -156,4 +156,4 @@ alberta,23,238,4 script Guide#alb::AlbGuide 105,{
end;
}
-alberta,120,60,3 duplicate(AlbGuide) Guide#2alb 105 \ No newline at end of file
+alberta,120,60,3 duplicate(AlbGuide) Guide#2alb 105
diff --git a/npc/pre-re/guides/guides_moscovia.txt b/npc/pre-re/guides/guides_moscovia.txt
index 8986c7502..790e42472 100644
--- a/npc/pre-re/guides/guides_moscovia.txt
+++ b/npc/pre-re/guides/guides_moscovia.txt
@@ -89,4 +89,4 @@ moscovia,161,76,4 script Moscovia Guide#mosk 959,{
mes "Take care.";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/pre-re/merchants/shops.txt b/npc/pre-re/merchants/shops.txt
index 124ea0ef3..eb72c44a5 100644
--- a/npc/pre-re/merchants/shops.txt
+++ b/npc/pre-re/merchants/shops.txt
@@ -21,4 +21,4 @@ izlude,94,98,4 shop Fruit Gardener#iz 53,512:-1,513:-1,515:-1,516:-1
izlude,105,92,7 shop Vendor from Milk Ranch#i 90,519:-1
izlude,164,138,4 shop Pet Groomer#iz 124,537:-1,643:-1,10013:-1,10014:-1,554:-1,6113:-1,6114:-1,6115:-1
izlude_in,115,61,0 shop Tool Dealer#iz 47,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1
-izlude_in,121,64,3 shop Trading Merchant#iz 900,13200:-1,13201:-1,13202:-1,13150:-1,13102:-1,13151:-1,13154:-1,13155:-1,13163:-1,13165:-1,13168:-1 \ No newline at end of file
+izlude_in,121,64,3 shop Trading Merchant#iz 900,13200:-1,13201:-1,13202:-1,13150:-1,13102:-1,13151:-1,13154:-1,13155:-1,13163:-1,13165:-1,13168:-1
diff --git a/npc/pre-re/mobs/fields/splendide.txt b/npc/pre-re/mobs/fields/splendide.txt
index 9dfbbfa90..f8b08fe04 100644
--- a/npc/pre-re/mobs/fields/splendide.txt
+++ b/npc/pre-re/mobs/fields/splendide.txt
@@ -29,4 +29,4 @@ spl_fild02,0,0,0,0 monster Luciola Vespa 1994,15,0,0,0
spl_fild03,0,0,0,0 monster Luciola Vespa 1994,35,0,0,0
spl_fild03,0,0,0,0 monster Cornus 1992,25,0,0,0
spl_fild03,0,0,0,0 monster Naga 1993,20,0,0,0
-spl_fild03,0,0,0,0 monster Tendril Lion 1991,1,3600000,0,0 \ No newline at end of file
+spl_fild03,0,0,0,0 monster Tendril Lion 1991,1,3600000,0,0
diff --git a/npc/pre-re/other/arena.txt b/npc/pre-re/other/arena.txt
index ff88f4c28..e8fd938c6 100644
--- a/npc/pre-re/other/arena.txt
+++ b/npc/pre-re/other/arena.txt
@@ -12,4 +12,4 @@
//============================================================
izlude,128,226,0 warp welcome_arena 1,1,arena_room,100,30
-arena_room,99,24,0 warp bye_arena 2,2,izlude,128,220 \ No newline at end of file
+arena_room,99,24,0 warp bye_arena 2,2,izlude,128,220
diff --git a/npc/pre-re/quests/doomed_swords.txt b/npc/pre-re/quests/doomed_swords.txt
index 9d27d588b..6e8c45eba 100644
--- a/npc/pre-re/quests/doomed_swords.txt
+++ b/npc/pre-re/quests/doomed_swords.txt
@@ -61,4 +61,4 @@ izlude_in,173,88,2 script Nain#magum 102,{
set event_magum,5;
set dmdswrd_Q2,dmdswrd_Q2 | 4;
close;
-} \ No newline at end of file
+}
diff --git a/npc/pre-re/quests/monstertamers.txt b/npc/pre-re/quests/monstertamers.txt
index 86f118f5a..df1cb6c9d 100644
--- a/npc/pre-re/quests/monstertamers.txt
+++ b/npc/pre-re/quests/monstertamers.txt
@@ -12,4 +12,4 @@
//= 1.0 Duplicates for Monster Tamer [Streusel]
//============================================================
-izlude_in,129,64,4 duplicate(Monster_Tamer#izu) Monster Tamer#izlude 125 \ No newline at end of file
+izlude_in,129,64,4 duplicate(Monster_Tamer#izu) Monster Tamer#izlude 125
diff --git a/npc/pre-re/quests/quests_13_1.txt b/npc/pre-re/quests/quests_13_1.txt
index b98aa2b95..5e61465d8 100644
--- a/npc/pre-re/quests/quests_13_1.txt
+++ b/npc/pre-re/quests/quests_13_1.txt
@@ -14,4 +14,4 @@
// Onward to the New World
//============================================================
-izlude,101,173,6 duplicate(Promotional Staff#iz) Promotional Staff#izlude 100 \ No newline at end of file
+izlude,101,173,6 duplicate(Promotional Staff#iz) Promotional Staff#izlude 100
diff --git a/npc/pre-re/quests/quests_nameless.txt b/npc/pre-re/quests/quests_nameless.txt
index ab5d816dc..e272ad43b 100644
--- a/npc/pre-re/quests/quests_nameless.txt
+++ b/npc/pre-re/quests/quests_nameless.txt
@@ -388,4 +388,4 @@ izlude_in,113,66,0 script Strange Machine 111,{
mes "a hand on my precious";
mes "masterpiece inventions! ";
close;
-} \ No newline at end of file
+}
diff --git a/npc/pre-re/quests/skills/swordman_skills.txt b/npc/pre-re/quests/skills/swordman_skills.txt
index 7a4aa2ff3..47858500f 100644
--- a/npc/pre-re/quests/skills/swordman_skills.txt
+++ b/npc/pre-re/quests/skills/swordman_skills.txt
@@ -145,4 +145,4 @@ izlude_in,175,130,2 script Knight De Thomas 98,4,4,{
mes "I have a certain duty these days.";
mes "Ehem! Need I say more.";
close;
-} \ No newline at end of file
+}
diff --git a/npc/pre-re/scripts.conf b/npc/pre-re/scripts.conf
index 6a69ede0e..a06cab57f 100644
--- a/npc/pre-re/scripts.conf
+++ b/npc/pre-re/scripts.conf
@@ -73,4 +73,4 @@ npc: npc/pre-re/quests/quests_lighthalzen.txt
npc: npc/pre-re/quests/monstertamers.txt
npc: npc/pre-re/quests/quests_nameless.txt
npc: npc/pre-re/quests/quests_13_1.txt
-npc: npc/pre-re/quests/skills/swordman_skills.txt \ No newline at end of file
+npc: npc/pre-re/quests/skills/swordman_skills.txt
diff --git a/npc/pre-re/scripts_warps.conf b/npc/pre-re/scripts_warps.conf
index d650676c6..55b335078 100644
--- a/npc/pre-re/scripts_warps.conf
+++ b/npc/pre-re/scripts_warps.conf
@@ -19,4 +19,4 @@ npc: npc/pre-re/warps/fields/veins_fild.txt
npc: npc/pre-re/warps/fields/yuno_fild.txt
// --------------------------- Others ---------------------------
-npc: npc/pre-re/warps/other/sign.txt \ No newline at end of file
+npc: npc/pre-re/warps/other/sign.txt
diff --git a/npc/quests/kiel_hyre_quest.txt b/npc/quests/kiel_hyre_quest.txt
index 3f5a3ddf5..2940951fe 100644
--- a/npc/quests/kiel_hyre_quest.txt
+++ b/npc/quests/kiel_hyre_quest.txt
@@ -7231,4 +7231,4 @@ OnInit:
//= to after finishing the quest.
//= 3.7 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
//= 3.8 Corrected some delitems. (bugreport:690) [Samuray22]
-//= 3.9 Fixed a cutin not being erased. (bugreport:1539) [L0ne_W0lf] \ No newline at end of file
+//= 3.9 Fixed a cutin not being erased. (bugreport:1539) [L0ne_W0lf]
diff --git a/npc/quests/mage_solution.txt b/npc/quests/mage_solution.txt
index b29fd4416..0eb3b101a 100644
--- a/npc/quests/mage_solution.txt
+++ b/npc/quests/mage_solution.txt
@@ -39,4 +39,4 @@ pay_arche,122,100,0 script Dollshoi 88,{
getitem 1089,1; //Payon_Potion
}
close;
-} \ No newline at end of file
+}
diff --git a/npc/quests/quests_13_1.txt b/npc/quests/quests_13_1.txt
index 523b5ff00..ddb7a3eea 100644
--- a/npc/quests/quests_13_1.txt
+++ b/npc/quests/quests_13_1.txt
@@ -14989,4 +14989,4 @@ prontera,161,192,5 script Ash Vacuum Warper 707,{
}
end;
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/quests/thana_quest.txt b/npc/quests/thana_quest.txt
index 362695bef..b9a251d6c 100644
--- a/npc/quests/thana_quest.txt
+++ b/npc/quests/thana_quest.txt
@@ -2312,4 +2312,4 @@ OnTouch:
}
mes "A mysterious power is blocking my path.";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/cities/dicastes.txt b/npc/re/cities/dicastes.txt
index 5fd555b8f..c47671b4b 100644
--- a/npc/re/cities/dicastes.txt
+++ b/npc/re/cities/dicastes.txt
@@ -693,4 +693,4 @@ dic_in01,98,96,3 script Lost Galten#a 492,{
mes "¡ü¡ø¡ñ ¢£ ";
mes "¡ö¡ï¢² ¡û ¡ö¡ó";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/cities/jawaii.txt b/npc/re/cities/jawaii.txt
index a4b584d3a..f1020b2f8 100644
--- a/npc/re/cities/jawaii.txt
+++ b/npc/re/cities/jawaii.txt
@@ -13,4 +13,4 @@
//= 1.1 Changed to Official coordinates [Streusel]
//============================================================
-izlude,180,224,6 duplicate(Honeymoon_Helper_Izlude) Honeymoon Helper#Izlude 71 \ No newline at end of file
+izlude,180,224,6 duplicate(Honeymoon_Helper_Izlude) Honeymoon Helper#Izlude 71
diff --git a/npc/re/cities/malangdo.txt b/npc/re/cities/malangdo.txt
index 0ee7ca8be..76cc418cf 100644
--- a/npc/re/cities/malangdo.txt
+++ b/npc/re/cities/malangdo.txt
@@ -389,4 +389,4 @@ OnTouch:
emotion e_flash;
end;
}
-malangdo,164,203,3 duplicate(Cat Trainer#mal1) Cat Trainer#mal2 853,5,8 \ No newline at end of file
+malangdo,164,203,3 duplicate(Cat Trainer#mal1) Cat Trainer#mal2 853,5,8
diff --git a/npc/re/cities/malaya.txt b/npc/re/cities/malaya.txt
index dd5ca3101..30a38cf4d 100644
--- a/npc/re/cities/malaya.txt
+++ b/npc/re/cities/malaya.txt
@@ -1763,4 +1763,4 @@ malaya,257,58,6 script Jeepney Driver#09 582,{
"Since everybody have different tastes, you can see those with cool and elaborate decorations.",
"Of course you don't need to drive them yourselves, but you can ride them so please feel free to do so."
);
-} \ No newline at end of file
+}
diff --git a/npc/re/jobs/3-1/archbishop.txt b/npc/re/jobs/3-1/archbishop.txt
index c71e2abd3..9a13aa359 100644
--- a/npc/re/jobs/3-1/archbishop.txt
+++ b/npc/re/jobs/3-1/archbishop.txt
@@ -1664,4 +1664,4 @@ job3_arch01,1,1,1 script control#arch 844,{
close;
}
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/re/jobs/3-1/guillotine_cross.txt b/npc/re/jobs/3-1/guillotine_cross.txt
index 71769be81..47b42e16f 100644
--- a/npc/re/jobs/3-1/guillotine_cross.txt
+++ b/npc/re/jobs/3-1/guillotine_cross.txt
@@ -3916,4 +3916,4 @@ job3_guil03,1,8,0 script #GMhelper02_gc 844,{
mes "-_-.";
close;
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/re/jobs/3-1/mechanic.txt b/npc/re/jobs/3-1/mechanic.txt
index c38d4608f..4890d072b 100644
--- a/npc/re/jobs/3-1/mechanic.txt
+++ b/npc/re/jobs/3-1/mechanic.txt
@@ -730,4 +730,4 @@ OnTouch:
}
jupe_core2,150,33,0 duplicate(#Acquiring Knowledge) #Acquiring Knowledge2 139,1,0
-jupe_core2,0,0,0,0 monster Dimik 1669,100,0,0,0 \ No newline at end of file
+jupe_core2,0,0,0,0 monster Dimik 1669,100,0,0,0
diff --git a/npc/re/jobs/3-1/ranger.txt b/npc/re/jobs/3-1/ranger.txt
index 314f199d2..02af29d54 100644
--- a/npc/re/jobs/3-1/ranger.txt
+++ b/npc/re/jobs/3-1/ranger.txt
@@ -1803,4 +1803,4 @@ job3_rang01,58,1,0 script Worker#job_ranger 88,{
close;
}
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/re/jobs/3-1/warlock.txt b/npc/re/jobs/3-1/warlock.txt
index 9894eae4b..d08d7395d 100644
--- a/npc/re/jobs/3-1/warlock.txt
+++ b/npc/re/jobs/3-1/warlock.txt
@@ -1096,4 +1096,4 @@ job3_war01,1,2,0 script Button Girl 66,{
*/
spl_fild02,0,0,0,0 monster Bradium Golem 2049,20,5000,0,0
-spl_fild02,0,0,0,0 monster Naga 2047,20,5000,0,0 \ No newline at end of file
+spl_fild02,0,0,0,0 monster Naga 2047,20,5000,0,0
diff --git a/npc/re/jobs/3-2/genetic.txt b/npc/re/jobs/3-2/genetic.txt
index bfa7d422c..5ca20d2d3 100644
--- a/npc/re/jobs/3-2/genetic.txt
+++ b/npc/re/jobs/3-2/genetic.txt
@@ -1044,4 +1044,4 @@ job3_gen01,23,33,0,0 monster Poison Spore 1428,1,7000,0,0
job3_gen01,21,30,0,0 monster Poison Spore 1428,1,7000,0,0
job3_gen01,26,34,0,0 monster Poison Spore 1428,1,7000,0,0
job3_gen01,23,33,0,0 monster Poison Spore 1428,1,7000,0,0
-job3_gen01,21,30,0,0 monster Poison Spore 1428,1,7000,0,0 \ No newline at end of file
+job3_gen01,21,30,0,0 monster Poison Spore 1428,1,7000,0,0
diff --git a/npc/re/jobs/3-2/minstrel.txt b/npc/re/jobs/3-2/minstrel.txt
index a9d584526..5ffc84a06 100644
--- a/npc/re/jobs/3-2/minstrel.txt
+++ b/npc/re/jobs/3-2/minstrel.txt
@@ -1917,4 +1917,4 @@ prt_in,94,172,4 script Karian#job_min3 480,{
mes "[Karian]";
mes "How did you get in here?";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/jobs/3-2/royal_guard.txt b/npc/re/jobs/3-2/royal_guard.txt
index 614896133..1222c23ed 100644
--- a/npc/re/jobs/3-2/royal_guard.txt
+++ b/npc/re/jobs/3-2/royal_guard.txt
@@ -538,4 +538,4 @@ sec_in02,12,43,3 script sorcereryal 57,1,1,{
close;
}
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/re/jobs/3-2/shadow_chaser.txt b/npc/re/jobs/3-2/shadow_chaser.txt
index f9d27dc84..313ce7390 100644
--- a/npc/re/jobs/3-2/shadow_chaser.txt
+++ b/npc/re/jobs/3-2/shadow_chaser.txt
@@ -2503,4 +2503,4 @@ OnTouch:
//============================================================
tur_dun03,0,0,0,0 monster Shadow of Deception 2076,1,1000,0,0
ice_dun02,0,0,0,0 monster Shadow of Illusion 2077,1,1000,0,0
-niflheim,0,0,0,0 monster Shadow of Pleasure 2078,1,1000,0,0 \ No newline at end of file
+niflheim,0,0,0,0 monster Shadow of Pleasure 2078,1,1000,0,0
diff --git a/npc/re/jobs/3-2/sorcerer.txt b/npc/re/jobs/3-2/sorcerer.txt
index 71ec97e4b..d2cec9242 100644
--- a/npc/re/jobs/3-2/sorcerer.txt
+++ b/npc/re/jobs/3-2/sorcerer.txt
@@ -417,4 +417,4 @@ gef_tower,113,161,5 script Karacas 754,{
thor_v01,64,252,0 duplicate(Spirit Detecting Staff#0) Spirit Detecting Staff#1 836
ice_dun01,274,274,0 duplicate(Spirit Detecting Staff#0) Spirit Detecting Staff#2 836
mjo_dun03,200,141,0 duplicate(Spirit Detecting Staff#0) Spirit Detecting Staff#3 836
-gon_dun02,195,190,0 duplicate(Spirit Detecting Staff#0) Spirit Detecting Staff#4 836 \ No newline at end of file
+gon_dun02,195,190,0 duplicate(Spirit Detecting Staff#0) Spirit Detecting Staff#4 836
diff --git a/npc/re/jobs/3-2/sura.txt b/npc/re/jobs/3-2/sura.txt
index 311e95ec1..5a0e8e36a 100644
--- a/npc/re/jobs/3-2/sura.txt
+++ b/npc/re/jobs/3-2/sura.txt
@@ -864,4 +864,4 @@ sword_2-1,1,2,0 script Button Girl#sura 66,{
close;
}
}
-*/ \ No newline at end of file
+*/
diff --git a/npc/re/jobs/3-2/wanderer.txt b/npc/re/jobs/3-2/wanderer.txt
index 41839b644..fd3b75f59 100644
--- a/npc/re/jobs/3-2/wanderer.txt
+++ b/npc/re/jobs/3-2/wanderer.txt
@@ -1034,4 +1034,4 @@ xmas,145,127,7 duplicate(#wander_xmas) Spectator#xmas2 712
xmas,148,127,7 duplicate(#wander_xmas) Soy#xmas 714
xmas,149,127,1 duplicate(#wander_xmas) Mimi#xmas 714
xmas,151,127,1 duplicate(#wander_xmas) Spectator#xmas3 716
-xmas,154,129,1 duplicate(#wander_xmas) Spectator#xmas4 797 \ No newline at end of file
+xmas,154,129,1 duplicate(#wander_xmas) Spectator#xmas4 797
diff --git a/npc/re/jobs/novice/novice.txt b/npc/re/jobs/novice/novice.txt
index ebefaff48..b9c2a10ac 100644
--- a/npc/re/jobs/novice/novice.txt
+++ b/npc/re/jobs/novice/novice.txt
@@ -2053,4 +2053,4 @@ new_5-3,0,0,0,0 monster Fabre 1184,5,0,0,0
new_5-3,0,0,0,0 monster Rocker 1052,10,0,0,0
new_5-3,0,0,0,0 monster Spore 1014,1,0,0,0
new_5-3,0,0,0,0 monster Thief Bug 1051,1,0,0,0
-new_5-3,0,0,0,0 monster Thief Bug 1053,1,0,0,0 \ No newline at end of file
+new_5-3,0,0,0,0 monster Thief Bug 1053,1,0,0,0
diff --git a/npc/re/merchants/3rd_trader.txt b/npc/re/merchants/3rd_trader.txt
index 7c3ca3cac..86dd01656 100644
--- a/npc/re/merchants/3rd_trader.txt
+++ b/npc/re/merchants/3rd_trader.txt
@@ -225,4 +225,4 @@ gef_tower,105,172,5 script Point Salesman#Sorcerer::pss 700,{
}
comodo,241,103,6 duplicate(pss) Point Salesman#1 700
alberta,105,52,7 duplicate(pss) Point Salesman#2 700
-veins,202,128,6 duplicate(pss) Point Salesman#3 700 \ No newline at end of file
+veins,202,128,6 duplicate(pss) Point Salesman#3 700
diff --git a/npc/re/merchants/flute.txt b/npc/re/merchants/flute.txt
index 8eb987e08..1aa7c38d4 100644
--- a/npc/re/merchants/flute.txt
+++ b/npc/re/merchants/flute.txt
@@ -138,4 +138,4 @@ tur_dun01,89,170,5 script Expert Flute Crafter 59,{
mes "Eeehh? You are not a Ranger?";
mes "Then this flute is totally useless for you!";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/mobs/fields/amatsu.txt b/npc/re/mobs/fields/amatsu.txt
index 86e96f337..c0469afff 100644
--- a/npc/re/mobs/fields/amatsu.txt
+++ b/npc/re/mobs/fields/amatsu.txt
@@ -32,4 +32,4 @@ ama_fild01,171,313,0,0 monster Hydra 1068,1,66000,33000,0
ama_fild01,171,314,0,0 monster Hydra 1068,1,69000,34500,0
ama_fild01,171,315,0,0 monster Hydra 1068,1,69000,34500,0
ama_fild01,175,314,0,0 monster Hydra 1068,1,72000,39000,0
-ama_fild01,169,315,0,0 monster Hydra 1068,1,72000,39000,0 \ No newline at end of file
+ama_fild01,169,315,0,0 monster Hydra 1068,1,72000,39000,0
diff --git a/npc/re/mobs/fields/comodo.txt b/npc/re/mobs/fields/comodo.txt
index ae4ddedeb..b2db8d86b 100644
--- a/npc/re/mobs/fields/comodo.txt
+++ b/npc/re/mobs/fields/comodo.txt
@@ -94,4 +94,4 @@ cmd_fild09,0,0,0,0 monster Metaller 1058,145,5000,0,0
cmd_fild09,0,0,0,0 monster Deniro 1105,15,5000,0,0
cmd_fild09,0,0,0,0 monster Piere 1160,15,5000,0,0
cmd_fild09,0,0,0,0 monster Andre 1095,15,5000,0,0
-cmd_fild09,0,0,0,0 monster Ant Egg 1097,10,5000,0,0 \ No newline at end of file
+cmd_fild09,0,0,0,0 monster Ant Egg 1097,10,5000,0,0
diff --git a/npc/re/mobs/fields/einbroch.txt b/npc/re/mobs/fields/einbroch.txt
index f31395f3b..eaf12a96d 100644
--- a/npc/re/mobs/fields/einbroch.txt
+++ b/npc/re/mobs/fields/einbroch.txt
@@ -104,4 +104,4 @@ ein_fild09,0,0,0,0 monster Red Mushroom 1085,10,120000,60000,0
//==================================================
//ein_fild10,0,0,0,0 monster Red Plant 1078,20,120000,60000,1
//ein_fild10,0,0,0,0 monster Yellow Plant 1081,20,120000,60000,1
-//ein_fild10,0,0,0,0 monster Blue Plant 1079,20,600000,300000,1 \ No newline at end of file
+//ein_fild10,0,0,0,0 monster Blue Plant 1079,20,600000,300000,1
diff --git a/npc/re/mobs/fields/geffen.txt b/npc/re/mobs/fields/geffen.txt
index 35ff2e814..d6d6be055 100644
--- a/npc/re/mobs/fields/geffen.txt
+++ b/npc/re/mobs/fields/geffen.txt
@@ -197,4 +197,4 @@ gef_fild11,283,100,4,1 monster Black Mushroom 1084,3,360000,180000,1
//==================================================
// gef_fild14 - Disabled on Renewal
-//================================================== \ No newline at end of file
+//==================================================
diff --git a/npc/re/mobs/fields/gonryun.txt b/npc/re/mobs/fields/gonryun.txt
index 290524caa..5ffd88921 100644
--- a/npc/re/mobs/fields/gonryun.txt
+++ b/npc/re/mobs/fields/gonryun.txt
@@ -17,4 +17,4 @@ gon_fild01,0,0,0,0 monster Dumpling Child 1409,55,5000,0,0
gon_fild01,0,0,0,0 monster Baby Leopard 1415,40,5000,0,0
gon_fild01,0,0,0,0 monster Side Winder 1037,10,5000,0,0
gon_fild01,0,0,0,0 monster Green Plant 1080,5,10000,0,1
-gon_fild01,0,0,0,0 monster Shining Plant 1083,1,10000,0,1 \ No newline at end of file
+gon_fild01,0,0,0,0 monster Shining Plant 1083,1,10000,0,1
diff --git a/npc/re/mobs/fields/hugel.txt b/npc/re/mobs/fields/hugel.txt
index 852d35e4e..fd04fc658 100644
--- a/npc/re/mobs/fields/hugel.txt
+++ b/npc/re/mobs/fields/hugel.txt
@@ -71,4 +71,4 @@ hu_fild06,234,251,14,120 monster Yellow Plant 1081,10,600000,0,1
//==================================================
// hu_fild07 - Disabled on Renewal
//==================================================
-//hu_fild07,0,0,0,0 monster Yellow Plant 1081,20,10000,0,1 \ No newline at end of file
+//hu_fild07,0,0,0,0 monster Yellow Plant 1081,20,10000,0,1
diff --git a/npc/re/mobs/fields/jawaii.txt b/npc/re/mobs/fields/jawaii.txt
index 14490c698..b2483deca 100644
--- a/npc/re/mobs/fields/jawaii.txt
+++ b/npc/re/mobs/fields/jawaii.txt
@@ -24,4 +24,4 @@ jawaii_in,128,121,1,4 monster Red Mushroom 1085,1,3000000,1200000,0
jawaii_in,124,76,1,1 monster Black Mushroom 1084,1,3600000,1200000,0
jawaii_in,72,74,5,1 monster Black Mushroom 1084,2,3000000,1200000,0
jawaii_in,73,117,4,4 monster Thief Bug Egg 1048,1,5400000,3000000,0
-jawaii_in,83,117,5,5 monster Thief Bug Egg 1048,1,4800000,2400000,0 \ No newline at end of file
+jawaii_in,83,117,5,5 monster Thief Bug Egg 1048,1,4800000,2400000,0
diff --git a/npc/re/mobs/fields/lighthalzen.txt b/npc/re/mobs/fields/lighthalzen.txt
index 92cbad659..6438c3c93 100644
--- a/npc/re/mobs/fields/lighthalzen.txt
+++ b/npc/re/mobs/fields/lighthalzen.txt
@@ -45,4 +45,4 @@ lhz_fild03,0,0,0,0 monster Rafflesia 1162,20,5000,0,0
lhz_fild03,0,0,0,0 monster Metaling 1613,20,5000,0,0
lhz_fild03,0,0,0,0 monster Demon Pungus 1378,15,5000,0,0
lhz_fild03,0,0,0,0 monster Red Plant 1078,10,60000,30000,1
-lhz_fild03,0,0,0,0 monster Green Plant 1080,10,60000,30000,0 \ No newline at end of file
+lhz_fild03,0,0,0,0 monster Green Plant 1080,10,60000,30000,0
diff --git a/npc/re/mobs/fields/louyang.txt b/npc/re/mobs/fields/louyang.txt
index 586b49960..6654d835a 100644
--- a/npc/re/mobs/fields/louyang.txt
+++ b/npc/re/mobs/fields/louyang.txt
@@ -18,4 +18,4 @@ lou_fild01,0,0,0,0 monster Mi Gao 1516,40,5000,0,0
lou_fild01,0,0,0,0 monster Mantis 1139,19,5000,0,0
lou_fild01,0,0,0,0 monster Geographer 1368,19,5000,0,0
lou_fild01,0,0,0,0 monster Black Mushroom 1084,5,5000,0,0
-lou_fild01,0,0,0,0 monster Yellow Plant 1081,10,10000,0,1 \ No newline at end of file
+lou_fild01,0,0,0,0 monster Yellow Plant 1081,10,10000,0,1
diff --git a/npc/re/mobs/fields/manuk.txt b/npc/re/mobs/fields/manuk.txt
index e27d7f6c6..eddc7169b 100644
--- a/npc/re/mobs/fields/manuk.txt
+++ b/npc/re/mobs/fields/manuk.txt
@@ -31,4 +31,4 @@ man_fild02,0,0,0,0 monster Tatacho 1986,25,5000,0,0
man_fild03,0,0,0,0 monster Hillslion 1989,25,5000,0,0
man_fild03,0,0,0,0 monster Tatacho 1986,25,5000,0,0
man_fild03,0,0,0,0 monster Centipede 1987,25,5000,0,0
-man_fild03,0,0,0,0 monster Hardrock Mammoth 1990,1,14400000,0,0 \ No newline at end of file
+man_fild03,0,0,0,0 monster Hardrock Mammoth 1990,1,14400000,0,0
diff --git a/npc/re/mobs/fields/mjolnir.txt b/npc/re/mobs/fields/mjolnir.txt
index 58fba9422..78e39d96b 100644
--- a/npc/re/mobs/fields/mjolnir.txt
+++ b/npc/re/mobs/fields/mjolnir.txt
@@ -224,4 +224,4 @@ mjolnir_11,295,271,0,0 monster Green Plant 1080,1,180000,90000,1
//==================================================
mjolnir_12,0,0,0,0 monster Dustiness 1114,130,5000,0,0
mjolnir_12,0,0,0,0 monster Hunter Fly 1035,35,5000,0,0
-mjolnir_12,0,0,0,0 monster Mantis 1139,35,5000,0,0 \ No newline at end of file
+mjolnir_12,0,0,0,0 monster Mantis 1139,35,5000,0,0
diff --git a/npc/re/mobs/fields/morocc.txt b/npc/re/mobs/fields/morocc.txt
index 3e71b0846..663f46134 100644
--- a/npc/re/mobs/fields/morocc.txt
+++ b/npc/re/mobs/fields/morocc.txt
@@ -214,4 +214,4 @@ moc_fild22,0,0,0,0 monster Incarnation of Morroc 1918,60,30000,0,0
moc_fild22,0,0,0,0 monster Incarnation of Morroc 1919,60,30000,0,0
moc_fild22,0,0,0,0 monster Incarnation of Morroc 1920,60,30000,0,0
moc_fild22,0,0,0,0 monster Incarnation of Morroc 1921,25,10000,0,0
-moc_fild22,0,0,0,0 boss_monster Wounded Morroc 1917,1,43200000,600000,0 \ No newline at end of file
+moc_fild22,0,0,0,0 boss_monster Wounded Morroc 1917,1,43200000,600000,0
diff --git a/npc/re/mobs/fields/moscovia.txt b/npc/re/mobs/fields/moscovia.txt
index 7ffbd4c28..158fb2d66 100644
--- a/npc/re/mobs/fields/moscovia.txt
+++ b/npc/re/mobs/fields/moscovia.txt
@@ -18,4 +18,4 @@ mosk_fild02,0,0,0,0 monster Argiope 1099,30,5000,0,0
mosk_fild02,0,0,0,0 monster Mantis 1139,10,5000,0,0
mosk_fild02,0,0,0,0 monster Geographer 1368,5,5000,0,0
mosk_fild02,0,0,0,0 monster Yellow Plant 1081,5,10000,0,1
-mosk_fild02,0,0,0,0 monster White Plant 1082,5,10000,0,1 \ No newline at end of file
+mosk_fild02,0,0,0,0 monster White Plant 1082,5,10000,0,1
diff --git a/npc/re/mobs/fields/payon.txt b/npc/re/mobs/fields/payon.txt
index 9736fb31b..41e239861 100644
--- a/npc/re/mobs/fields/payon.txt
+++ b/npc/re/mobs/fields/payon.txt
@@ -127,4 +127,4 @@ pay_fild10,66,332,10,10 monster Blue Plant 1079,1,360000,180000,1
//==================================================
// pay_fild11 - Disabled on Renewal
-//================================================== \ No newline at end of file
+//==================================================
diff --git a/npc/re/mobs/fields/prontera.txt b/npc/re/mobs/fields/prontera.txt
index 5eec3c925..0930fc088 100644
--- a/npc/re/mobs/fields/prontera.txt
+++ b/npc/re/mobs/fields/prontera.txt
@@ -122,4 +122,4 @@ prt_fild11,0,0,0,0 monster Goblin 1125,10,5000,0,0
prt_fild11,0,0,0,0 monster Goblin 1123,10,5000,0,0
prt_fild11,0,0,0,0 monster Goblin 1122,10,5000,0,0
prt_fild11,0,0,0,0 monster Panzer Goblin 1308,1,1800000,1200000,0
-prt_fild11,0,0,0,0 monster Red Mushroom 1085,10,180000,90000,1 \ No newline at end of file
+prt_fild11,0,0,0,0 monster Red Mushroom 1085,10,180000,90000,1
diff --git a/npc/re/mobs/fields/rachel.txt b/npc/re/mobs/fields/rachel.txt
index 68e34c4c5..d8dd26f42 100644
--- a/npc/re/mobs/fields/rachel.txt
+++ b/npc/re/mobs/fields/rachel.txt
@@ -99,4 +99,4 @@ ra_fild12,0,0,0,0 monster Red Plant 1078,5,10000,0,1
//==================================================
// ra_fild13 - Disabled on Renewal
-//================================================== \ No newline at end of file
+//==================================================
diff --git a/npc/re/mobs/fields/splendide.txt b/npc/re/mobs/fields/splendide.txt
index a9b5c8a1a..97a6befd4 100644
--- a/npc/re/mobs/fields/splendide.txt
+++ b/npc/re/mobs/fields/splendide.txt
@@ -30,4 +30,4 @@ spl_fild02,0,0,0,0 monster Luciola Vespa 1994,15,5000,0,0
spl_fild03,0,0,0,0 monster Luciola Vespa 1994,35,5000,0,0
spl_fild03,0,0,0,0 monster Cornus 1992,25,5000,0,0
spl_fild03,0,0,0,0 monster Naga 1993,20,5000,0,0
-spl_fild03,0,0,0,0 monster Tendrilion 1991,1,3600000,0,0 \ No newline at end of file
+spl_fild03,0,0,0,0 monster Tendrilion 1991,1,3600000,0,0
diff --git a/npc/re/mobs/fields/umbala.txt b/npc/re/mobs/fields/umbala.txt
index e3bd52469..3914207a3 100644
--- a/npc/re/mobs/fields/umbala.txt
+++ b/npc/re/mobs/fields/umbala.txt
@@ -54,4 +54,4 @@ um_fild04,0,0,0,0 monster Wootan Fighter 1499,5,5000,0,0
um_fild04,0,0,0,0 monster Wooden Golem 1497,10,5000,0,0
um_fild04,0,0,0,0 monster Choco 1214,2,5000,0,0
um_fild04,0,0,0,0 monster Red Plant 1078,5,180000,90000,1
-um_fild04,0,0,0,0 monster Yellow Plant 1081,5,180000,90000,1 \ No newline at end of file
+um_fild04,0,0,0,0 monster Yellow Plant 1081,5,180000,90000,1
diff --git a/npc/re/mobs/fields/veins.txt b/npc/re/mobs/fields/veins.txt
index ca8cc431e..dd52b4257 100644
--- a/npc/re/mobs/fields/veins.txt
+++ b/npc/re/mobs/fields/veins.txt
@@ -75,4 +75,4 @@ ve_fild04,288,273,4,4 monster Blue Plant 1079,3,660000,0,1
ve_fild07,0,0,0,0 monster Stapo 1784,100,5000,0,0
ve_fild07,0,0,0,0 monster Drosera 1781,50,5000,0,0
ve_fild07,0,0,0,0 monster Muscipular 1780,30,5000,0,0
-ve_fild07,0,0,0,0 monster White Plant 1082,10,600000,0,1 \ No newline at end of file
+ve_fild07,0,0,0,0 monster White Plant 1082,10,600000,0,1
diff --git a/npc/re/mobs/fields/yuno.txt b/npc/re/mobs/fields/yuno.txt
index 13f1ecb63..15aa2046b 100644
--- a/npc/re/mobs/fields/yuno.txt
+++ b/npc/re/mobs/fields/yuno.txt
@@ -138,4 +138,4 @@ yuno_fild11,0,0,0,0 monster Yellow Plant 1081,10,180000,90000,1
// yuno_fild12 - Border Checkpoint
//==================================================
yuno_fild12,0,0,0,0 monster Geographer 1368,60,5000,0,0
-yuno_fild12,0,0,0,0 monster Mantis 1139,30,5000,0,0 \ No newline at end of file
+yuno_fild12,0,0,0,0 monster Mantis 1139,30,5000,0,0
diff --git a/npc/re/quests/monstertamers.txt b/npc/re/quests/monstertamers.txt
index cc95d3749..c2a1388e1 100644
--- a/npc/re/quests/monstertamers.txt
+++ b/npc/re/quests/monstertamers.txt
@@ -12,4 +12,4 @@
//= 1.0 Duplicates for Monster Tamer
//============================================================
-izlude_in,55,105,4 duplicate(Monster_Tamer#izu) Monster Tamer#izlude 125 \ No newline at end of file
+izlude_in,55,105,4 duplicate(Monster_Tamer#izu) Monster Tamer#izlude 125
diff --git a/npc/re/quests/quests_13_1.txt b/npc/re/quests/quests_13_1.txt
index 107b7c029..f1908874e 100644
--- a/npc/re/quests/quests_13_1.txt
+++ b/npc/re/quests/quests_13_1.txt
@@ -14,4 +14,4 @@
// Onward to the New World
//============================================================
-izlude,102,171,6 duplicate(Promotional Staff#iz) Promotional Staff#izlude 100 \ No newline at end of file
+izlude,102,171,6 duplicate(Promotional Staff#iz) Promotional Staff#izlude 100
diff --git a/npc/re/quests/quests_malaya.txt b/npc/re/quests/quests_malaya.txt
index 002130ee6..96fb036b0 100644
--- a/npc/re/quests/quests_malaya.txt
+++ b/npc/re/quests/quests_malaya.txt
@@ -1480,4 +1480,4 @@ ma_fild02,308,262,3 script Guard#buwayacave 570,{
OnInit:
disablenpc "Guard#buwayacave";
end;
-} \ No newline at end of file
+}
diff --git a/npc/re/quests/quests_veins.txt b/npc/re/quests/quests_veins.txt
index 3478fe16b..0f3df7828 100644
--- a/npc/re/quests/quests_veins.txt
+++ b/npc/re/quests/quests_veins.txt
@@ -12,4 +12,4 @@
//= 1.0 First version.
//============================================================
-ve_fild02,337,314,4 duplicate(WincingOldMan_veins) Wincing Old Man#ve 945 \ No newline at end of file
+ve_fild02,337,314,4 duplicate(WincingOldMan_veins) Wincing Old Man#ve 945
diff --git a/npc/re/warps/cities/dicastes.txt b/npc/re/warps/cities/dicastes.txt
index d2c84ad0a..1a59f5241 100644
--- a/npc/re/warps/cities/dicastes.txt
+++ b/npc/re/warps/cities/dicastes.txt
@@ -71,4 +71,4 @@ dic_in01,57,48,0 duplicate(Elevator#main) Elevator#9 844
dic_in01,137,46,0 duplicate(Elevator#main) Elevator#10 844
dic_in01,222,46,0 duplicate(Elevator#main) Elevator#11 844
dic_in01,388,272,0 duplicate(Elevator#main) Elevator#12 844
-dic_in01,389,208,0 duplicate(Elevator#main) Elevator#13 844 \ No newline at end of file
+dic_in01,389,208,0 duplicate(Elevator#main) Elevator#13 844
diff --git a/npc/re/warps/cities/izlude.txt b/npc/re/warps/cities/izlude.txt
index 4be33317e..fa888c7fb 100644
--- a/npc/re/warps/cities/izlude.txt
+++ b/npc/re/warps/cities/izlude.txt
@@ -38,4 +38,4 @@ iz_ac01,100,24,0 warp iz_ac01 2,2,izlude,127,253
iz_ac01,122,25,0 warp iz_ac02 2,2,iz_ac02,104,27
iz_ac01,78,25,0 warp iz_ac03 2,2,iz_ac02,104,27
iz_ac02,113,27,0 warp iz_ac04 2,2,iz_ac01,122,28
-iz_ac02,94,27,0 warp iz_ac05 2,2,iz_ac01,78,28 \ No newline at end of file
+iz_ac02,94,27,0 warp iz_ac05 2,2,iz_ac01,78,28
diff --git a/npc/re/warps/cities/malaya.txt b/npc/re/warps/cities/malaya.txt
index a792c4690..38e67e3e0 100644
--- a/npc/re/warps/cities/malaya.txt
+++ b/npc/re/warps/cities/malaya.txt
@@ -99,4 +99,4 @@ ma_zif05,30,22,0 warp malaya_car0005 1,1,malaya,341,150
ma_zif06,30,22,0 warp malaya_car0006 1,1,malaya,294,293
ma_zif07,30,22,0 warp malaya_car0007 1,1,malaya,239,221
ma_zif08,30,22,0 warp malaya_car0008 1,1,malaya,59,246
-ma_zif09,30,22,0 warp malaya_car0009 1,1,malaya,254,68 \ No newline at end of file
+ma_zif09,30,22,0 warp malaya_car0009 1,1,malaya,254,68
diff --git a/npc/re/warps/dungeons/iz_dun.txt b/npc/re/warps/dungeons/iz_dun.txt
index bbe68f8b8..7b46b5e2d 100644
--- a/npc/re/warps/dungeons/iz_dun.txt
+++ b/npc/re/warps/dungeons/iz_dun.txt
@@ -60,4 +60,4 @@ iz_dun05,142,190,5 script Guard#iz_dun 413,{
mes "You're braver than I thought.";
close;
}
-} \ No newline at end of file
+}
diff --git a/npc/re/warps/other/jobquests.txt b/npc/re/warps/other/jobquests.txt
index 5b62a74a4..3a2a321fb 100644
--- a/npc/re/warps/other/jobquests.txt
+++ b/npc/re/warps/other/jobquests.txt
@@ -41,4 +41,4 @@ job3_gen01,71,56,0 warp #from2to1gen 1,1,job3_gen01,11,60
//==============================================================================
//Shadow Chaser
//==============================================================================
-job3_sha01,71,19,0 warp shadowc1 1,1,tha_t01,149,224 \ No newline at end of file
+job3_sha01,71,19,0 warp shadowc1 1,1,tha_t01,149,224
diff --git a/npc/re/warps/other/s_workshop.txt b/npc/re/warps/other/s_workshop.txt
index bc04509b3..3f50edb6b 100644
--- a/npc/re/warps/other/s_workshop.txt
+++ b/npc/re/warps/other/s_workshop.txt
@@ -28,4 +28,4 @@ s_atelier,80,66,0 warp s_atelier0012 1,1,s_atelier,32,56
s_atelier,109,129,0 warp s_atelier0013 1,1,s_atelier,159,125
s_atelier,160,130,0 warp s_atelier0014 1,1,s_atelier,114,129
yuno,278,66,0 warp s_atelier0015 1,1,s_atelier,111,122
-s_atelier,107,122,0 warp s_atelier0016 1,1,yuno,274,66 \ No newline at end of file
+s_atelier,107,122,0 warp s_atelier0016 1,1,yuno,274,66
diff --git a/npc/scripts_mapflags.conf b/npc/scripts_mapflags.conf
index 2fe92eb0a..29a72171b 100644
--- a/npc/scripts_mapflags.conf
+++ b/npc/scripts_mapflags.conf
@@ -29,4 +29,4 @@ npc: npc/mapflag/town.txt
npc: npc/mapflag/reset.txt
npc: npc/mapflag/skillmodifier.txt
npc: npc/mapflag/skillduration.txt
-npc: npc/mapflag/notomb.txt \ No newline at end of file
+npc: npc/mapflag/notomb.txt
diff --git a/npc/scripts_warps.conf b/npc/scripts_warps.conf
index 75b14bb47..6f3a25558 100644
--- a/npc/scripts_warps.conf
+++ b/npc/scripts_warps.conf
@@ -87,4 +87,4 @@ npc: npc/warps/other/kiel.txt
npc: npc/warps/other/other.txt
npc: npc/warps/other/arena.txt
npc: npc/warps/guildcastles.txt
-npc: npc/warps/pvp.txt \ No newline at end of file
+npc: npc/warps/pvp.txt
diff --git a/plugins/empty.txt b/plugins/empty.txt
index e6b990d30..81128d0e2 100644
--- a/plugins/empty.txt
+++ b/plugins/empty.txt
@@ -1 +1 @@
-Oi. nothing to see here! unless you compile a plugin :P \ No newline at end of file
+Oi. nothing to see here! unless you compile a plugin :P
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index 67421fd77..6a62fd4c6 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -6178,4 +6178,4 @@ INSERT INTO `item_db` (`id`, `name_english`, `name_japanese`, `type`, `price_buy
(19505, 'T_Cigarette', 'T Cigarette', 5, 0, 0, 0, 0, 0, 0, 0, 4294967295, 7, 2, 4096, 0, 0, 0, 54, '', '', ''),
(19506, 'T_Valkyrie_Feather_Band', 'T Valkyrie Feather Band', 5, 0, 0, 0, 0, 0, 0, 0, 4294967295, 7, 2, 1024, 0, 0, 1, 300, '', '', ''),
(19507, 'Clear_Sun', 'Clear Sun', 5, 0, 0, 0, 0, 0, 0, 0, 4294967295, 7, 2, 1024, 0, 1, 0, 654, '', '', ''),
-(22540, 'Runstone_Luxanima', 'Lux Anima Rune', 11, 2, 1, 100, 0, 0, 0, 0, 4294967295, 7, 2, 0, 0, 0, 0, 0, 'itemskill "RK_LUXANIMA",1;', '', ''); \ No newline at end of file
+(22540, 'Runstone_Luxanima', 'Lux Anima Rune', 11, 2, 1, 100, 0, 0, 0, 0, 4294967295, 7, 2, 0, 0, 0, 0, 0, 'itemskill "RK_LUXANIMA",1;', '', '');
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index a6c53f1e7..dfe4f7830 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -8165,4 +8165,4 @@ INSERT INTO `item_db_re` (`id`, `name_english`, `name_japanese`, `type`, `price_
(21004, 'Alca_Bringer_', 'Alca Bringer', 4, 20, 10, 3400, 280, 0, 0, 2, 2, 16512, 56, 2, 34, 3, 100, 0, 1, 3, '', '', ''),
(21005, 'Metal_Two_Hand_Sword', 'Metal Two-Handed Sword', 4, 20, 10, 0, 95, 0, 0, 1, 1, 16514, 63, 2, 34, 3, 0, 0, 1, 3, '', '', ''),
(22514, 'Candy_Holder', 'Candy Holder', 11, 20, 10, 10, 0, 0, 0, 0, 0, 4294967295, 63, 2, 0, 0, 0, 0, 0, 0, '', '', ''),
-(22540, 'Runstone_Luxanima', 'Lux Anima Rune', 11, 2, 1, 100, 0, 0, 0, 0, 0, 4294967295, 63, 2, 0, 0, 0, 0, 0, 0, 'itemskill "RK_LUXANIMA",1;', '', ''); \ No newline at end of file
+(22540, 'Runstone_Luxanima', 'Lux Anima Rune', 11, 2, 1, 100, 0, 0, 0, 0, 0, 4294967295, 63, 2, 0, 0, 0, 0, 0, 0, 'itemskill "RK_LUXANIMA",1;', '', '');
diff --git a/sql-files/upgrades/2013-02-14--16-15.sql b/sql-files/upgrades/2013-02-14--16-15.sql
index 9afd034b1..9eac1a5e8 100644
--- a/sql-files/upgrades/2013-02-14--16-15.sql
+++ b/sql-files/upgrades/2013-02-14--16-15.sql
@@ -4,4 +4,4 @@ CREATE TABLE IF NOT EXISTS `sql_updates` (
`ignored` enum('Yes','No') NOT NULL DEFAULT 'No'
) ENGINE=MyISAM;
ALTER TABLE `skill` ADD COLUMN `flag` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500);
diff --git a/sql-files/upgrades/2013-02-15--18-06.sql b/sql-files/upgrades/2013-02-15--18-06.sql
index 066693c70..836655095 100644
--- a/sql-files/upgrades/2013-02-15--18-06.sql
+++ b/sql-files/upgrades/2013-02-15--18-06.sql
@@ -1,3 +1,3 @@
#1360951560
ALTER TABLE `sql_updates` ADD PRIMARY KEY(`timestamp`);
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560);
diff --git a/sql-files/upgrades/2013-03-05--01-05.sql b/sql-files/upgrades/2013-03-05--01-05.sql
index 4a1e23807..a280dc8dd 100644
--- a/sql-files/upgrades/2013-03-05--01-05.sql
+++ b/sql-files/upgrades/2013-03-05--01-05.sql
@@ -1,3 +1,3 @@
#1362445531
ALTER TABLE `login` ADD `character_slots` TINYINT( 3 ) UNSIGNED NOT NULL;
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531);
diff --git a/sql-files/upgrades/2013-03-09--01-56.sql b/sql-files/upgrades/2013-03-09--01-56.sql
index 43811ee33..c35777283 100644
--- a/sql-files/upgrades/2013-03-09--01-56.sql
+++ b/sql-files/upgrades/2013-03-09--01-56.sql
@@ -1,4 +1,4 @@
#1362794218
ALTER TABLE `login` ADD COLUMN `pincode` varchar(4) NOT NULL DEFAULT '';
ALTER TABLE `login` ADD COLUMN `pincode_change` int(11) unsigned NOT NULL DEFAULT '0';
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218);
diff --git a/sql-files/upgrades/2013-03-27--18-35.sql b/sql-files/upgrades/2013-03-27--18-35.sql
index fc50953c4..323aa2ace 100644
--- a/sql-files/upgrades/2013-03-27--18-35.sql
+++ b/sql-files/upgrades/2013-03-27--18-35.sql
@@ -1,3 +1,3 @@
#1364409316
ALTER TABLE `char` ADD COLUMN `slotchange` SMALLINT(3) unsigned NOT NULL default '0';
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316);
diff --git a/sql-files/upgrades/2013-04-16--01-24.sql b/sql-files/upgrades/2013-04-16--01-24.sql
index 69672b368..a55eebe1a 100644
--- a/sql-files/upgrades/2013-04-16--01-24.sql
+++ b/sql-files/upgrades/2013-04-16--01-24.sql
@@ -1,3 +1,3 @@
#1366075474
#Info http://hercules.ws/board/topic/410-skill-script-command-updatefix/
-UPDATE `skill` SET `flag` = 0 WHERE `flag` = 4 AND `id` != 2535 AND `id` != 681; \ No newline at end of file
+UPDATE `skill` SET `flag` = 0 WHERE `flag` = 4 AND `id` != 2535 AND `id` != 681;
diff --git a/sql-files/upgrades/2013-04-16--02-15.sql b/sql-files/upgrades/2013-04-16--02-15.sql
index 771bd6ec2..3a0895204 100644
--- a/sql-files/upgrades/2013-04-16--02-15.sql
+++ b/sql-files/upgrades/2013-04-16--02-15.sql
@@ -1,4 +1,4 @@
#1366078541
ALTER TABLE `char` ADD `char_opt` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474);#for the previous that missed it..
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); \ No newline at end of file
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541);
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index 54502d48b..984898b22 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -3,4 +3,4 @@
2013-03-05--01-05.sql
2013-03-06--00-00.sql
2013-03-09--01-56.sql
-2013-04-16--01-24.sql \ No newline at end of file
+2013-04-16--01-24.sql
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 100958358..0c120f99a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,4 +17,4 @@ add_subdirectory( login )
add_subdirectory( char )
add_subdirectory( map )
add_subdirectory( tool )
-add_subdirectory( plugins ) \ No newline at end of file
+add_subdirectory( plugins )
diff --git a/src/map/chat.c b/src/map/chat.c
index 75ae3681b..3a76dd157 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -1,447 +1,447 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/mmo.h"
-#include "atcommand.h" // msg_txt()
-#include "battle.h" // struct battle_config
-#include "clif.h"
-#include "map.h"
-#include "npc.h" // npc_event_do()
-#include "pc.h"
-#include "skill.h" // ext_skill_unit_onplace()
-#include "chat.h"
-
-#include <stdio.h>
-#include <string.h>
-
-
-int chat_triggerevent(struct chat_data *cd); // forward declaration
-
-/// Initializes a chatroom object (common functionality for both pc and npc chatrooms).
-/// Returns a chatroom object on success, or NULL on failure.
-static struct chat_data* chat_createchat(struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
-{
- struct chat_data* cd;
- nullpo_retr(NULL, bl);
-
- cd = (struct chat_data *) aMalloc(sizeof(struct chat_data));
-
- safestrncpy(cd->title, title, sizeof(cd->title));
- safestrncpy(cd->pass, pass, sizeof(cd->pass));
- cd->pub = pub;
- cd->users = 0;
- cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
- cd->trigger = trigger;
- cd->zeny = zeny;
- cd->minLvl = minLvl;
- cd->maxLvl = maxLvl;
- memset(cd->usersd, 0, sizeof(cd->usersd));
- cd->owner = bl;
- safestrncpy(cd->npc_event, ev, sizeof(cd->npc_event));
-
- cd->bl.id = iMap->get_new_object_id();
- cd->bl.m = bl->m;
- cd->bl.x = bl->x;
- cd->bl.y = bl->y;
- cd->bl.type = BL_CHAT;
- cd->bl.next = cd->bl.prev = NULL;
-
- if( cd->bl.id == 0 )
- {
- aFree(cd);
- cd = NULL;
- }
-
- iMap->addiddb(&cd->bl);
-
- if( bl->type != BL_NPC )
- cd->kick_list = idb_alloc(DB_OPT_BASE);
-
- return cd;
-}
-
-/*==========================================
- * player chatroom creation
- *------------------------------------------*/
-int chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
-{
- struct chat_data* cd;
- nullpo_ret(sd);
-
- if( sd->chatID )
- return 0; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
-
- if( sd->state.vending || sd->state.buyingstore )
- {// not chat, when you already have a store open
- return 0;
- }
-
- if( map[sd->bl.m].flag.nochat )
- {
- clif->message(sd->fd, msg_txt(281));
- return 0; //Can't create chatrooms on this map.
- }
-
- if( iMap->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) )
- {
- clif->message (sd->fd, msg_txt(665));
- return 0;
- }
-
- pc_stop_walking(sd,1);
-
- cd = chat_createchat(&sd->bl, title, pass, limit, pub, 0, "", 0, 1, MAX_LEVEL);
- if( cd ) {
- cd->users = 1;
- cd->usersd[0] = sd;
- pc_setchatid(sd,cd->bl.id);
- pc_stop_attack(sd);
- clif->createchat(sd,0);
- clif->dispchat(cd,0);
- } else
- clif->createchat(sd,1);
-
- return 0;
-}
-
-/*==========================================
- * join an existing chatroom
- *------------------------------------------*/
-int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
-{
- struct chat_data* cd;
-
- nullpo_ret(sd);
- cd = (struct chat_data*)iMap->id2bl(chatid);
-
- if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )
- {
- clif->joinchatfail(sd,0);
- return 0;
- }
-
- if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc->has_permission(sd, PC_PERM_JOIN_ALL_CHAT) )
- {
- clif->joinchatfail(sd,1);
- return 0;
- }
-
- if( sd->status.base_level < cd->minLvl || sd->status.base_level > cd->maxLvl ) {
- if(sd->status.base_level < cd->minLvl)
- clif->joinchatfail(sd,5);
- else
- clif->joinchatfail(sd,6);
-
- return 0;
- }
-
- if( sd->status.zeny < cd->zeny ) {
- clif->joinchatfail(sd,4);
- return 0;
- }
-
- if( cd->owner->type != BL_NPC && idb_exists(cd->kick_list,sd->status.char_id) ) {
- clif->joinchatfail(sd,2);//You have been kicked out of the room.
- return 0;
- }
-
- pc_stop_walking(sd,1);
- cd->usersd[cd->users] = sd;
- cd->users++;
-
- pc_setchatid(sd,cd->bl.id);
-
- clif->joinchatok(sd, cd); //To the person who newly joined the list of all
- clif->addchat(cd, sd); //Reports To the person who already in the chat
- clif->dispchat(cd, 0); //Reported number of changes to the people around
-
- chat_triggerevent(cd); //Event
-
- return 0;
-}
-
-
-/*==========================================
- * leave a chatroom
- *------------------------------------------*/
-int chat_leavechat(struct map_session_data* sd, bool kicked)
-{
- struct chat_data* cd;
- int i;
- int leavechar;
-
- nullpo_retr(1, sd);
-
- cd = (struct chat_data*)iMap->id2bl(sd->chatID);
- if( cd == NULL )
- {
- pc_setchatid(sd, 0);
- return 1;
- }
-
- ARR_FIND( 0, cd->users, i, cd->usersd[i] == sd );
- if ( i == cd->users )
- { // Not found in the chatroom?
- pc_setchatid(sd, 0);
- return -1;
- }
-
- clif->leavechat(cd, sd, kicked);
- pc_setchatid(sd, 0);
- cd->users--;
-
- leavechar = i;
-
- for( i = leavechar; i < cd->users; i++ )
- cd->usersd[i] = cd->usersd[i+1];
-
-
- if( cd->users == 0 && cd->owner->type == BL_PC ) { // Delete empty chatroom
- struct skill_unit* unit;
- struct skill_unit_group* group;
-
- clif->clearchat(cd, 0);
- db_destroy(cd->kick_list);
- iMap->deliddb(&cd->bl);
- iMap->delblock(&cd->bl);
- iMap->freeblock(&cd->bl);
-
- unit = iMap->find_skill_unit_oncell(&sd->bl, sd->bl.x, sd->bl.y, AL_WARP, NULL, 0);
- group = (unit != NULL) ? unit->group : NULL;
- if (group != NULL)
- skill->unit_onplace(unit, &sd->bl, group->tick);
-
- return 1;
- }
-
- if( leavechar == 0 && cd->owner->type == BL_PC )
- { // Set and announce new owner
- cd->owner = (struct block_list*) cd->usersd[0];
- clif->changechatowner(cd, cd->usersd[0]);
- clif->clearchat(cd, 0);
-
- //Adjust Chat location after owner has been changed.
- iMap->delblock( &cd->bl );
- cd->bl.x=cd->usersd[0]->bl.x;
- cd->bl.y=cd->usersd[0]->bl.y;
- iMap->addblock( &cd->bl );
-
- clif->dispchat(cd,0);
- }
- else
- clif->dispchat(cd,0); // refresh chatroom
-
- return 0;
-}
-
-/*==========================================
- * change a chatroom's owner
- *------------------------------------------*/
-int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
-{
- struct chat_data* cd;
- struct map_session_data* tmpsd;
- int i;
-
- nullpo_retr(1, sd);
-
- cd = (struct chat_data*)iMap->id2bl(sd->chatID);
- if( cd == NULL || (struct block_list*) sd != cd->owner )
- return 1;
-
- ARR_FIND( 1, cd->users, i, strncmp(cd->usersd[i]->status.name, nextownername, NAME_LENGTH) == 0 );
- if( i == cd->users )
- return -1; // name not found
-
- // erase temporarily
- clif->clearchat(cd,0);
-
- // set new owner
- cd->owner = (struct block_list*) cd->usersd[i];
- clif->changechatowner(cd,cd->usersd[i]);
-
- // swap the old and new owners' positions
- tmpsd = cd->usersd[i];
- cd->usersd[i] = cd->usersd[0];
- cd->usersd[0] = tmpsd;
-
- // set the new chatroom position
- iMap->delblock( &cd->bl );
- cd->bl.x = cd->owner->x;
- cd->bl.y = cd->owner->y;
- iMap->addblock( &cd->bl );
-
- // and display again
- clif->dispchat(cd,0);
-
- return 0;
-}
-
-/*==========================================
- * change a chatroom's status (title, etc)
- *------------------------------------------*/
-int chat_changechatstatus(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
-{
- struct chat_data* cd;
-
- nullpo_retr(1, sd);
-
- cd = (struct chat_data*)iMap->id2bl(sd->chatID);
- if( cd==NULL || (struct block_list *)sd != cd->owner )
- return 1;
-
- safestrncpy(cd->title, title, CHATROOM_TITLE_SIZE);
- safestrncpy(cd->pass, pass, CHATROOM_PASS_SIZE);
- cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
- cd->pub = pub;
-
- clif->changechatstatus(cd);
- clif->dispchat(cd,0);
-
- return 0;
-}
-
-/*==========================================
- * kick an user from a chatroom
- *------------------------------------------*/
-int chat_kickchat(struct map_session_data* sd, const char* kickusername)
-{
- struct chat_data* cd;
- int i;
-
- nullpo_retr(1, sd);
-
- cd = (struct chat_data *)iMap->id2bl(sd->chatID);
-
- if( cd==NULL || (struct block_list *)sd != cd->owner )
- return -1;
-
- ARR_FIND( 0, cd->users, i, strncmp(cd->usersd[i]->status.name, kickusername, NAME_LENGTH) == 0 );
- if( i == cd->users )
- return -1;
-
- if (pc->has_permission(cd->usersd[i], PC_PERM_NO_CHAT_KICK))
- return 0; //gm kick protection [Valaris]
-
- idb_put(cd->kick_list,cd->usersd[i]->status.char_id,(void*)1);
-
- chat->leavechat(cd->usersd[i],1);
- return 0;
-}
-
-/// Creates a chat room for the npc.
-int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
-{
- struct chat_data* cd;
- nullpo_ret(nd);
-
- if( nd->chat_id ) {
- ShowError("chat_createnpcchat: npc '%s' already has a chatroom, cannot create new one!\n", nd->exname);
- return 0;
- }
-
- if( zeny > MAX_ZENY || maxLvl > MAX_LEVEL ) {
- ShowError("chat_createnpcchat: npc '%s' has a required lvl or amount of zeny over the max limit!\n", nd->exname);
- return 0;
- }
-
- cd = chat_createchat(&nd->bl, title, "", limit, pub, trigger, ev, zeny, minLvl, maxLvl);
-
- if( cd ) {
- nd->chat_id = cd->bl.id;
- clif->dispchat(cd,0);
- }
-
- return 0;
-}
-
-/// Removes the chatroom from the npc.
-int chat_deletenpcchat(struct npc_data* nd)
-{
- struct chat_data *cd;
- nullpo_ret(nd);
-
- cd = (struct chat_data*)iMap->id2bl(nd->chat_id);
- if( cd == NULL )
- return 0;
-
- chat->npckickall(cd);
- clif->clearchat(cd, 0);
- iMap->deliddb(&cd->bl);
- iMap->delblock(&cd->bl);
- iMap->freeblock(&cd->bl);
- nd->chat_id = 0;
-
- return 0;
-}
-
-/*==========================================
- * Trigger npc event when we enter the chatroom
- *------------------------------------------*/
-int chat_triggerevent(struct chat_data *cd)
-{
- nullpo_ret(cd);
-
- if( cd->users >= cd->trigger && cd->npc_event[0] )
- npc_event_do(cd->npc_event);
- return 0;
-}
-
-/// Enables the event of the chat room.
-/// At most, 127 users are needed to trigger the event.
-int chat_enableevent(struct chat_data* cd)
-{
- nullpo_ret(cd);
-
- cd->trigger &= 0x7f;
- chat_triggerevent(cd);
- return 0;
-}
-
-/// Disables the event of the chat room
-int chat_disableevent(struct chat_data* cd)
-{
- nullpo_ret(cd);
-
- cd->trigger |= 0x80;
- return 0;
-}
-
-/// Kicks all the users from the chat room.
-int chat_npckickall(struct chat_data* cd)
-{
- nullpo_ret(cd);
-
- while( cd->users > 0 )
- chat->leavechat(cd->usersd[cd->users-1],0);
-
- return 0;
-}
-
-/*=====================================
-* Default Functions : chat.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-void chat_defaults(void) {
- chat = &chat_s;
- /* funcs */
-
- chat->createpcchat = chat_createpcchat;
- chat->joinchat = chat_joinchat;
- chat->leavechat = chat_leavechat;
- chat->changechatowner = chat_changechatowner;
- chat->changechatstatus = chat_changechatstatus;
- chat->kickchat = chat_kickchat;
-
- chat->createnpcchat = chat_createnpcchat;
- chat->deletenpcchat = chat_deletenpcchat;
- chat->enableevent = chat_enableevent;
- chat->disableevent = chat_disableevent;
- chat->npckickall = chat_npckickall;
-}
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/mmo.h"
+#include "atcommand.h" // msg_txt()
+#include "battle.h" // struct battle_config
+#include "clif.h"
+#include "map.h"
+#include "npc.h" // npc_event_do()
+#include "pc.h"
+#include "skill.h" // ext_skill_unit_onplace()
+#include "chat.h"
+
+#include <stdio.h>
+#include <string.h>
+
+
+int chat_triggerevent(struct chat_data *cd); // forward declaration
+
+/// Initializes a chatroom object (common functionality for both pc and npc chatrooms).
+/// Returns a chatroom object on success, or NULL on failure.
+static struct chat_data* chat_createchat(struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
+{
+ struct chat_data* cd;
+ nullpo_retr(NULL, bl);
+
+ cd = (struct chat_data *) aMalloc(sizeof(struct chat_data));
+
+ safestrncpy(cd->title, title, sizeof(cd->title));
+ safestrncpy(cd->pass, pass, sizeof(cd->pass));
+ cd->pub = pub;
+ cd->users = 0;
+ cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
+ cd->trigger = trigger;
+ cd->zeny = zeny;
+ cd->minLvl = minLvl;
+ cd->maxLvl = maxLvl;
+ memset(cd->usersd, 0, sizeof(cd->usersd));
+ cd->owner = bl;
+ safestrncpy(cd->npc_event, ev, sizeof(cd->npc_event));
+
+ cd->bl.id = iMap->get_new_object_id();
+ cd->bl.m = bl->m;
+ cd->bl.x = bl->x;
+ cd->bl.y = bl->y;
+ cd->bl.type = BL_CHAT;
+ cd->bl.next = cd->bl.prev = NULL;
+
+ if( cd->bl.id == 0 )
+ {
+ aFree(cd);
+ cd = NULL;
+ }
+
+ iMap->addiddb(&cd->bl);
+
+ if( bl->type != BL_NPC )
+ cd->kick_list = idb_alloc(DB_OPT_BASE);
+
+ return cd;
+}
+
+/*==========================================
+ * player chatroom creation
+ *------------------------------------------*/
+int chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
+{
+ struct chat_data* cd;
+ nullpo_ret(sd);
+
+ if( sd->chatID )
+ return 0; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
+
+ if( sd->state.vending || sd->state.buyingstore )
+ {// not chat, when you already have a store open
+ return 0;
+ }
+
+ if( map[sd->bl.m].flag.nochat )
+ {
+ clif->message(sd->fd, msg_txt(281));
+ return 0; //Can't create chatrooms on this map.
+ }
+
+ if( iMap->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) )
+ {
+ clif->message (sd->fd, msg_txt(665));
+ return 0;
+ }
+
+ pc_stop_walking(sd,1);
+
+ cd = chat_createchat(&sd->bl, title, pass, limit, pub, 0, "", 0, 1, MAX_LEVEL);
+ if( cd ) {
+ cd->users = 1;
+ cd->usersd[0] = sd;
+ pc_setchatid(sd,cd->bl.id);
+ pc_stop_attack(sd);
+ clif->createchat(sd,0);
+ clif->dispchat(cd,0);
+ } else
+ clif->createchat(sd,1);
+
+ return 0;
+}
+
+/*==========================================
+ * join an existing chatroom
+ *------------------------------------------*/
+int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
+{
+ struct chat_data* cd;
+
+ nullpo_ret(sd);
+ cd = (struct chat_data*)iMap->id2bl(chatid);
+
+ if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )
+ {
+ clif->joinchatfail(sd,0);
+ return 0;
+ }
+
+ if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc->has_permission(sd, PC_PERM_JOIN_ALL_CHAT) )
+ {
+ clif->joinchatfail(sd,1);
+ return 0;
+ }
+
+ if( sd->status.base_level < cd->minLvl || sd->status.base_level > cd->maxLvl ) {
+ if(sd->status.base_level < cd->minLvl)
+ clif->joinchatfail(sd,5);
+ else
+ clif->joinchatfail(sd,6);
+
+ return 0;
+ }
+
+ if( sd->status.zeny < cd->zeny ) {
+ clif->joinchatfail(sd,4);
+ return 0;
+ }
+
+ if( cd->owner->type != BL_NPC && idb_exists(cd->kick_list,sd->status.char_id) ) {
+ clif->joinchatfail(sd,2);//You have been kicked out of the room.
+ return 0;
+ }
+
+ pc_stop_walking(sd,1);
+ cd->usersd[cd->users] = sd;
+ cd->users++;
+
+ pc_setchatid(sd,cd->bl.id);
+
+ clif->joinchatok(sd, cd); //To the person who newly joined the list of all
+ clif->addchat(cd, sd); //Reports To the person who already in the chat
+ clif->dispchat(cd, 0); //Reported number of changes to the people around
+
+ chat_triggerevent(cd); //Event
+
+ return 0;
+}
+
+
+/*==========================================
+ * leave a chatroom
+ *------------------------------------------*/
+int chat_leavechat(struct map_session_data* sd, bool kicked)
+{
+ struct chat_data* cd;
+ int i;
+ int leavechar;
+
+ nullpo_retr(1, sd);
+
+ cd = (struct chat_data*)iMap->id2bl(sd->chatID);
+ if( cd == NULL )
+ {
+ pc_setchatid(sd, 0);
+ return 1;
+ }
+
+ ARR_FIND( 0, cd->users, i, cd->usersd[i] == sd );
+ if ( i == cd->users )
+ { // Not found in the chatroom?
+ pc_setchatid(sd, 0);
+ return -1;
+ }
+
+ clif->leavechat(cd, sd, kicked);
+ pc_setchatid(sd, 0);
+ cd->users--;
+
+ leavechar = i;
+
+ for( i = leavechar; i < cd->users; i++ )
+ cd->usersd[i] = cd->usersd[i+1];
+
+
+ if( cd->users == 0 && cd->owner->type == BL_PC ) { // Delete empty chatroom
+ struct skill_unit* unit;
+ struct skill_unit_group* group;
+
+ clif->clearchat(cd, 0);
+ db_destroy(cd->kick_list);
+ iMap->deliddb(&cd->bl);
+ iMap->delblock(&cd->bl);
+ iMap->freeblock(&cd->bl);
+
+ unit = iMap->find_skill_unit_oncell(&sd->bl, sd->bl.x, sd->bl.y, AL_WARP, NULL, 0);
+ group = (unit != NULL) ? unit->group : NULL;
+ if (group != NULL)
+ skill->unit_onplace(unit, &sd->bl, group->tick);
+
+ return 1;
+ }
+
+ if( leavechar == 0 && cd->owner->type == BL_PC )
+ { // Set and announce new owner
+ cd->owner = (struct block_list*) cd->usersd[0];
+ clif->changechatowner(cd, cd->usersd[0]);
+ clif->clearchat(cd, 0);
+
+ //Adjust Chat location after owner has been changed.
+ iMap->delblock( &cd->bl );
+ cd->bl.x=cd->usersd[0]->bl.x;
+ cd->bl.y=cd->usersd[0]->bl.y;
+ iMap->addblock( &cd->bl );
+
+ clif->dispchat(cd,0);
+ }
+ else
+ clif->dispchat(cd,0); // refresh chatroom
+
+ return 0;
+}
+
+/*==========================================
+ * change a chatroom's owner
+ *------------------------------------------*/
+int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
+{
+ struct chat_data* cd;
+ struct map_session_data* tmpsd;
+ int i;
+
+ nullpo_retr(1, sd);
+
+ cd = (struct chat_data*)iMap->id2bl(sd->chatID);
+ if( cd == NULL || (struct block_list*) sd != cd->owner )
+ return 1;
+
+ ARR_FIND( 1, cd->users, i, strncmp(cd->usersd[i]->status.name, nextownername, NAME_LENGTH) == 0 );
+ if( i == cd->users )
+ return -1; // name not found
+
+ // erase temporarily
+ clif->clearchat(cd,0);
+
+ // set new owner
+ cd->owner = (struct block_list*) cd->usersd[i];
+ clif->changechatowner(cd,cd->usersd[i]);
+
+ // swap the old and new owners' positions
+ tmpsd = cd->usersd[i];
+ cd->usersd[i] = cd->usersd[0];
+ cd->usersd[0] = tmpsd;
+
+ // set the new chatroom position
+ iMap->delblock( &cd->bl );
+ cd->bl.x = cd->owner->x;
+ cd->bl.y = cd->owner->y;
+ iMap->addblock( &cd->bl );
+
+ // and display again
+ clif->dispchat(cd,0);
+
+ return 0;
+}
+
+/*==========================================
+ * change a chatroom's status (title, etc)
+ *------------------------------------------*/
+int chat_changechatstatus(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub)
+{
+ struct chat_data* cd;
+
+ nullpo_retr(1, sd);
+
+ cd = (struct chat_data*)iMap->id2bl(sd->chatID);
+ if( cd==NULL || (struct block_list *)sd != cd->owner )
+ return 1;
+
+ safestrncpy(cd->title, title, CHATROOM_TITLE_SIZE);
+ safestrncpy(cd->pass, pass, CHATROOM_PASS_SIZE);
+ cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
+ cd->pub = pub;
+
+ clif->changechatstatus(cd);
+ clif->dispchat(cd,0);
+
+ return 0;
+}
+
+/*==========================================
+ * kick an user from a chatroom
+ *------------------------------------------*/
+int chat_kickchat(struct map_session_data* sd, const char* kickusername)
+{
+ struct chat_data* cd;
+ int i;
+
+ nullpo_retr(1, sd);
+
+ cd = (struct chat_data *)iMap->id2bl(sd->chatID);
+
+ if( cd==NULL || (struct block_list *)sd != cd->owner )
+ return -1;
+
+ ARR_FIND( 0, cd->users, i, strncmp(cd->usersd[i]->status.name, kickusername, NAME_LENGTH) == 0 );
+ if( i == cd->users )
+ return -1;
+
+ if (pc->has_permission(cd->usersd[i], PC_PERM_NO_CHAT_KICK))
+ return 0; //gm kick protection [Valaris]
+
+ idb_put(cd->kick_list,cd->usersd[i]->status.char_id,(void*)1);
+
+ chat->leavechat(cd->usersd[i],1);
+ return 0;
+}
+
+/// Creates a chat room for the npc.
+int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
+{
+ struct chat_data* cd;
+ nullpo_ret(nd);
+
+ if( nd->chat_id ) {
+ ShowError("chat_createnpcchat: npc '%s' already has a chatroom, cannot create new one!\n", nd->exname);
+ return 0;
+ }
+
+ if( zeny > MAX_ZENY || maxLvl > MAX_LEVEL ) {
+ ShowError("chat_createnpcchat: npc '%s' has a required lvl or amount of zeny over the max limit!\n", nd->exname);
+ return 0;
+ }
+
+ cd = chat_createchat(&nd->bl, title, "", limit, pub, trigger, ev, zeny, minLvl, maxLvl);
+
+ if( cd ) {
+ nd->chat_id = cd->bl.id;
+ clif->dispchat(cd,0);
+ }
+
+ return 0;
+}
+
+/// Removes the chatroom from the npc.
+int chat_deletenpcchat(struct npc_data* nd)
+{
+ struct chat_data *cd;
+ nullpo_ret(nd);
+
+ cd = (struct chat_data*)iMap->id2bl(nd->chat_id);
+ if( cd == NULL )
+ return 0;
+
+ chat->npckickall(cd);
+ clif->clearchat(cd, 0);
+ iMap->deliddb(&cd->bl);
+ iMap->delblock(&cd->bl);
+ iMap->freeblock(&cd->bl);
+ nd->chat_id = 0;
+
+ return 0;
+}
+
+/*==========================================
+ * Trigger npc event when we enter the chatroom
+ *------------------------------------------*/
+int chat_triggerevent(struct chat_data *cd)
+{
+ nullpo_ret(cd);
+
+ if( cd->users >= cd->trigger && cd->npc_event[0] )
+ npc_event_do(cd->npc_event);
+ return 0;
+}
+
+/// Enables the event of the chat room.
+/// At most, 127 users are needed to trigger the event.
+int chat_enableevent(struct chat_data* cd)
+{
+ nullpo_ret(cd);
+
+ cd->trigger &= 0x7f;
+ chat_triggerevent(cd);
+ return 0;
+}
+
+/// Disables the event of the chat room
+int chat_disableevent(struct chat_data* cd)
+{
+ nullpo_ret(cd);
+
+ cd->trigger |= 0x80;
+ return 0;
+}
+
+/// Kicks all the users from the chat room.
+int chat_npckickall(struct chat_data* cd)
+{
+ nullpo_ret(cd);
+
+ while( cd->users > 0 )
+ chat->leavechat(cd->usersd[cd->users-1],0);
+
+ return 0;
+}
+
+/*=====================================
+* Default Functions : chat.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+void chat_defaults(void) {
+ chat = &chat_s;
+ /* funcs */
+
+ chat->createpcchat = chat_createpcchat;
+ chat->joinchat = chat_joinchat;
+ chat->leavechat = chat_leavechat;
+ chat->changechatowner = chat_changechatowner;
+ chat->changechatstatus = chat_changechatstatus;
+ chat->kickchat = chat_kickchat;
+
+ chat->createnpcchat = chat_createnpcchat;
+ chat->deletenpcchat = chat_deletenpcchat;
+ chat->enableevent = chat_enableevent;
+ chat->disableevent = chat_disableevent;
+ chat->npckickall = chat_npckickall;
+}
diff --git a/src/map/chat.h b/src/map/chat.h
index ff78d8617..a7736e9f3 100644
--- a/src/map/chat.h
+++ b/src/map/chat.h
@@ -1,56 +1,56 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-#ifndef _CHAT_H_
-#define _CHAT_H_
-#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE
-struct map_session_data;
-struct chat_data;
-
-
-struct chat_data {
- struct block_list bl; // data for this map object
- char title[CHATROOM_TITLE_SIZE]; // room title
- char pass[CHATROOM_PASS_SIZE]; // password
- bool pub; // private/public flag
- uint8 users; // current user count
- uint8 limit; // join limit
- uint8 trigger; // number of users needed to trigger event
- uint32 zeny; // required zeny to join
- uint32 minLvl; // minimum base level to join
- uint32 maxLvl; // maximum base level allowed to join
- struct map_session_data* usersd[20];
- struct block_list* owner;
- char npc_event[EVENT_NAME_LENGTH];
- DBMap* kick_list; //DBMap of users who were kicked from this chat
-};
-
-
-
-
-/*=====================================
-* Interface : chat.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-struct chat_interface {
- /* funcs */
-
- int (*createpcchat) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
- int (*joinchat) (struct map_session_data* sd, int chatid, const char* pass);
- int (*leavechat) (struct map_session_data* sd, bool kicked);
- int (*changechatowner) (struct map_session_data* sd, const char* nextownername);
- int (*changechatstatus) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
- int (*kickchat) (struct map_session_data* sd, const char* kickusername);
-
- int (*createnpcchat) (struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
- int (*deletenpcchat) (struct npc_data* nd);
- int (*enableevent) (struct chat_data* cd);
- int (*disableevent) (struct chat_data* cd);
- int (*npckickall) (struct chat_data* cd);
-} chat_s;
-
-struct chat_interface *chat;
-
-void chat_defaults(void);
-
-#endif /* _CHAT_H_ */
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CHAT_H_
+#define _CHAT_H_
+#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE
+struct map_session_data;
+struct chat_data;
+
+
+struct chat_data {
+ struct block_list bl; // data for this map object
+ char title[CHATROOM_TITLE_SIZE]; // room title
+ char pass[CHATROOM_PASS_SIZE]; // password
+ bool pub; // private/public flag
+ uint8 users; // current user count
+ uint8 limit; // join limit
+ uint8 trigger; // number of users needed to trigger event
+ uint32 zeny; // required zeny to join
+ uint32 minLvl; // minimum base level to join
+ uint32 maxLvl; // maximum base level allowed to join
+ struct map_session_data* usersd[20];
+ struct block_list* owner;
+ char npc_event[EVENT_NAME_LENGTH];
+ DBMap* kick_list; //DBMap of users who were kicked from this chat
+};
+
+
+
+
+/*=====================================
+* Interface : chat.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+struct chat_interface {
+ /* funcs */
+
+ int (*createpcchat) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
+ int (*joinchat) (struct map_session_data* sd, int chatid, const char* pass);
+ int (*leavechat) (struct map_session_data* sd, bool kicked);
+ int (*changechatowner) (struct map_session_data* sd, const char* nextownername);
+ int (*changechatstatus) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
+ int (*kickchat) (struct map_session_data* sd, const char* kickusername);
+
+ int (*createnpcchat) (struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
+ int (*deletenpcchat) (struct npc_data* nd);
+ int (*enableevent) (struct chat_data* cd);
+ int (*disableevent) (struct chat_data* cd);
+ int (*npckickall) (struct chat_data* cd);
+} chat_s;
+
+struct chat_interface *chat;
+
+void chat_defaults(void);
+
+#endif /* _CHAT_H_ */
diff --git a/src/map/duel.c b/src/map/duel.c
index a04ed855b..c3b241e9e 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -1,204 +1,204 @@
-// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
-// See the LICENSE file
-// Portions Copyright (c) Athena Dev Teams
-
-#include "../common/cbasetypes.h"
-
-#include "atcommand.h" // msg_txt
-#include "clif.h"
-#include "duel.h"
-#include "pc.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-/*==========================================
- * Duel organizing functions [LuzZza]
- *------------------------------------------*/
-void duel_savetime(struct map_session_data* sd)
-{
- time_t timer;
- struct tm *t;
-
- time(&timer);
- t = localtime(&timer);
-
- pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);
-}
-
-int duel_checktime(struct map_session_data* sd)
-{
- int diff;
- time_t timer;
- struct tm *t;
-
- time(&timer);
- t = localtime(&timer);
-
- diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME");
-
- return !(diff >= 0 && diff < battle_config.duel_time_interval);
-}
-static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
-{
- struct map_session_data *ssd = va_arg(va, struct map_session_data*);
- int *p = va_arg(va, int*);
- char output[256];
-
- if (sd->duel_group != ssd->duel_group) return 0;
-
- sprintf(output, " %d. %s", ++(*p), sd->status.name);
- clif->disp_onlyself(ssd, output, strlen(output));
- return 1;
-}
-
-void duel_showinfo(const unsigned int did, struct map_session_data* sd)
-{
- int p=0;
- char output[256];
-
- if(iDuel->duel_list[did].max_players_limit > 0)
- sprintf(output, msg_txt(370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --"
- did, iDuel->duel_count,
- iDuel->duel_list[did].members_count,
- iDuel->duel_list[did].members_count + iDuel->duel_list[did].invites_count,
- iDuel->duel_list[did].max_players_limit);
- else
- sprintf(output, msg_txt(371), //" -- Duels: %d/%d, Members: %d/%d --"
- did, iDuel->duel_count,
- iDuel->duel_list[did].members_count,
- iDuel->duel_list[did].members_count + iDuel->duel_list[did].invites_count);
-
- clif->disp_onlyself(sd, output, strlen(output));
- iMap->map_foreachpc(duel_showinfo_sub, sd, &p);
-}
-
-int duel_create(struct map_session_data* sd, const unsigned int maxpl)
-{
- int i=1;
- char output[256];
-
- while(iDuel->duel_list[i].members_count > 0 && i < MAX_DUEL) i++;
- if(i == MAX_DUEL) return 0;
-
- iDuel->duel_count++;
- sd->duel_group = i;
- iDuel->duel_list[i].members_count++;
- iDuel->duel_list[i].invites_count = 0;
- iDuel->duel_list[i].max_players_limit = maxpl;
-
- strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
- clif->disp_onlyself(sd, output, strlen(output));
-
- clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
- clif->maptypeproperty2(&sd->bl,SELF);
- return i;
-}
-
-void duel_invite(const unsigned int did, struct map_session_data* sd, struct map_session_data* target_sd)
-{
- char output[256];
-
- // " -- Player %s invites %s to duel --"
- sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
- target_sd->duel_invite = did;
- iDuel->duel_list[did].invites_count++;
-
- // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
- sprintf(output, msg_txt(374), sd->status.name);
- clif->broadcast((struct block_list *)target_sd, output, strlen(output)+1, BC_BLUE, SELF);
-}
-
-static int duel_leave_sub(struct map_session_data* sd, va_list va)
-{
- int did = va_arg(va, int);
- if (sd->duel_invite == did)
- sd->duel_invite = 0;
- return 0;
-}
-
-void duel_leave(const unsigned int did, struct map_session_data* sd)
-{
- char output[256];
-
- // " <- Player %s has left duel --"
- sprintf(output, msg_txt(375), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
- iDuel->duel_list[did].members_count--;
-
- if(iDuel->duel_list[did].members_count == 0) {
- iMap->map_foreachpc(duel_leave_sub, did);
- iDuel->duel_count--;
- }
-
- sd->duel_group = 0;
- duel_savetime(sd);
- clif->map_property(sd, MAPPROPERTY_NOTHING);
- clif->maptypeproperty2(&sd->bl,SELF);
-}
-
-void duel_accept(const unsigned int did, struct map_session_data* sd)
-{
- char output[256];
-
- iDuel->duel_list[did].members_count++;
- sd->duel_group = sd->duel_invite;
- iDuel->duel_list[did].invites_count--;
- sd->duel_invite = 0;
-
- // " -> Player %s has accepted duel --"
- sprintf(output, msg_txt(376), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
- clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
- clif->maptypeproperty2(&sd->bl,SELF);
-}
-
-void duel_reject(const unsigned int did, struct map_session_data* sd)
-{
- char output[256];
-
- // " -- Player %s has rejected duel --"
- sprintf(output, msg_txt(377), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
- iDuel->duel_list[did].invites_count--;
- sd->duel_invite = 0;
-}
-
-void do_final_duel(void)
-{
-}
-
-void do_init_duel(void)
-{
- memset(&iDuel->duel_list[0], 0, sizeof(iDuel->duel_list));
-}
-
-/*=====================================
-* Default Functions : duel.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-void iDuel_defaults(void) {
- iDuel = &iDuel_s;
- /* vars */
- iDuel->duel_count = 0;
- /* funcs */
- //Duel functions // [LuzZza]
- iDuel->create = duel_create;
- iDuel->invite = duel_invite;
- iDuel->accept = duel_accept;
- iDuel->reject = duel_reject;
- iDuel->leave = duel_leave;
- iDuel->showinfo = duel_showinfo;
- iDuel->checktime = duel_checktime;
-
- iDuel->do_init_duel = do_init_duel;
- iDuel->do_final_duel = do_final_duel;
-}
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
+
+#include "../common/cbasetypes.h"
+
+#include "atcommand.h" // msg_txt
+#include "clif.h"
+#include "duel.h"
+#include "pc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+/*==========================================
+ * Duel organizing functions [LuzZza]
+ *------------------------------------------*/
+void duel_savetime(struct map_session_data* sd)
+{
+ time_t timer;
+ struct tm *t;
+
+ time(&timer);
+ t = localtime(&timer);
+
+ pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);
+}
+
+int duel_checktime(struct map_session_data* sd)
+{
+ int diff;
+ time_t timer;
+ struct tm *t;
+
+ time(&timer);
+ t = localtime(&timer);
+
+ diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME");
+
+ return !(diff >= 0 && diff < battle_config.duel_time_interval);
+}
+static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
+{
+ struct map_session_data *ssd = va_arg(va, struct map_session_data*);
+ int *p = va_arg(va, int*);
+ char output[256];
+
+ if (sd->duel_group != ssd->duel_group) return 0;
+
+ sprintf(output, " %d. %s", ++(*p), sd->status.name);
+ clif->disp_onlyself(ssd, output, strlen(output));
+ return 1;
+}
+
+void duel_showinfo(const unsigned int did, struct map_session_data* sd)
+{
+ int p=0;
+ char output[256];
+
+ if(iDuel->duel_list[did].max_players_limit > 0)
+ sprintf(output, msg_txt(370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --"
+ did, iDuel->duel_count,
+ iDuel->duel_list[did].members_count,
+ iDuel->duel_list[did].members_count + iDuel->duel_list[did].invites_count,
+ iDuel->duel_list[did].max_players_limit);
+ else
+ sprintf(output, msg_txt(371), //" -- Duels: %d/%d, Members: %d/%d --"
+ did, iDuel->duel_count,
+ iDuel->duel_list[did].members_count,
+ iDuel->duel_list[did].members_count + iDuel->duel_list[did].invites_count);
+
+ clif->disp_onlyself(sd, output, strlen(output));
+ iMap->map_foreachpc(duel_showinfo_sub, sd, &p);
+}
+
+int duel_create(struct map_session_data* sd, const unsigned int maxpl)
+{
+ int i=1;
+ char output[256];
+
+ while(iDuel->duel_list[i].members_count > 0 && i < MAX_DUEL) i++;
+ if(i == MAX_DUEL) return 0;
+
+ iDuel->duel_count++;
+ sd->duel_group = i;
+ iDuel->duel_list[i].members_count++;
+ iDuel->duel_list[i].invites_count = 0;
+ iDuel->duel_list[i].max_players_limit = maxpl;
+
+ strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
+ clif->disp_onlyself(sd, output, strlen(output));
+
+ clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif->maptypeproperty2(&sd->bl,SELF);
+ return i;
+}
+
+void duel_invite(const unsigned int did, struct map_session_data* sd, struct map_session_data* target_sd)
+{
+ char output[256];
+
+ // " -- Player %s invites %s to duel --"
+ sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+
+ target_sd->duel_invite = did;
+ iDuel->duel_list[did].invites_count++;
+
+ // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
+ sprintf(output, msg_txt(374), sd->status.name);
+ clif->broadcast((struct block_list *)target_sd, output, strlen(output)+1, BC_BLUE, SELF);
+}
+
+static int duel_leave_sub(struct map_session_data* sd, va_list va)
+{
+ int did = va_arg(va, int);
+ if (sd->duel_invite == did)
+ sd->duel_invite = 0;
+ return 0;
+}
+
+void duel_leave(const unsigned int did, struct map_session_data* sd)
+{
+ char output[256];
+
+ // " <- Player %s has left duel --"
+ sprintf(output, msg_txt(375), sd->status.name);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+
+ iDuel->duel_list[did].members_count--;
+
+ if(iDuel->duel_list[did].members_count == 0) {
+ iMap->map_foreachpc(duel_leave_sub, did);
+ iDuel->duel_count--;
+ }
+
+ sd->duel_group = 0;
+ duel_savetime(sd);
+ clif->map_property(sd, MAPPROPERTY_NOTHING);
+ clif->maptypeproperty2(&sd->bl,SELF);
+}
+
+void duel_accept(const unsigned int did, struct map_session_data* sd)
+{
+ char output[256];
+
+ iDuel->duel_list[did].members_count++;
+ sd->duel_group = sd->duel_invite;
+ iDuel->duel_list[did].invites_count--;
+ sd->duel_invite = 0;
+
+ // " -> Player %s has accepted duel --"
+ sprintf(output, msg_txt(376), sd->status.name);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+
+ clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif->maptypeproperty2(&sd->bl,SELF);
+}
+
+void duel_reject(const unsigned int did, struct map_session_data* sd)
+{
+ char output[256];
+
+ // " -- Player %s has rejected duel --"
+ sprintf(output, msg_txt(377), sd->status.name);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+
+ iDuel->duel_list[did].invites_count--;
+ sd->duel_invite = 0;
+}
+
+void do_final_duel(void)
+{
+}
+
+void do_init_duel(void)
+{
+ memset(&iDuel->duel_list[0], 0, sizeof(iDuel->duel_list));
+}
+
+/*=====================================
+* Default Functions : duel.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+void iDuel_defaults(void) {
+ iDuel = &iDuel_s;
+ /* vars */
+ iDuel->duel_count = 0;
+ /* funcs */
+ //Duel functions // [LuzZza]
+ iDuel->create = duel_create;
+ iDuel->invite = duel_invite;
+ iDuel->accept = duel_accept;
+ iDuel->reject = duel_reject;
+ iDuel->leave = duel_leave;
+ iDuel->showinfo = duel_showinfo;
+ iDuel->checktime = duel_checktime;
+
+ iDuel->do_init_duel = do_init_duel;
+ iDuel->do_final_duel = do_final_duel;
+}
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 03aa93e49..1952d93e2 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -1,984 +1,984 @@
-// 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/malloc.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
-#include "../common/random.h"
-#include "../common/strlib.h"
-
-#include "log.h"
-#include "clif.h"
-#include "chrif.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "map.h"
-#include "pc.h"
-#include "status.h"
-#include "skill.h"
-#include "mob.h"
-#include "pet.h"
-#include "battle.h"
-#include "party.h"
-#include "guild.h"
-#include "atcommand.h"
-#include "script.h"
-#include "npc.h"
-#include "trade.h"
-#include "unit.h"
-#include "elemental.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-int elemental_search_index(int class_) {
- int i;
- ARR_FIND(0, MAX_ELEMENTAL_CLASS, i, elemental->elemental_db[i].class_ == class_);
- return (i == MAX_ELEMENTAL_CLASS)?-1:i;
-}
-
-bool elemental_class(int class_) {
- return (bool)(elemental_search_index(class_) > -1);
-}
-
-struct view_data * elemental_get_viewdata(int class_) {
- int i = elemental_search_index(class_);
- if( i < 0 )
- return 0;
-
- return &elemental->elemental_db[i].vd;
-}
-
-int elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime) {
- struct s_elemental ele;
- struct s_elemental_db *db;
- int i;
-
- nullpo_retr(1,sd);
-
- if( (i = elemental_search_index(class_)) < 0 )
- return 0;
-
- db = &elemental->elemental_db[i];
- memset(&ele,0,sizeof(struct s_elemental));
-
- ele.char_id = sd->status.char_id;
- ele.class_ = class_;
- ele.mode = EL_MODE_PASSIVE; // Initial mode
- i = db->status.size+1; // summon level
-
- //[(Caster�s Max HP/ 3 ) + (Caster�s INT x 10 )+ (Caster�s Job Level x 20 )] x [(Elemental Summon Level + 2) / 3]
- ele.hp = ele.max_hp = (sd->battle_status.max_hp/3 + sd->battle_status.int_*10 + sd->status.job_level) * ((i + 2) / 3);
- //Caster�s Max SP /4
- ele.sp = ele.max_sp = sd->battle_status.max_sp/4;
- //Caster�s [ Max SP / (18 / Elemental Summon Skill Level) 1- 100 ]
- ele.atk = (sd->battle_status.max_sp / (18 / i) * 1 - 100);
- //Caster�s [ Max SP / (18 / Elemental Summon Skill Level) ]
- ele.atk2 = sd->battle_status.max_sp / 18;
- //Caster�s HIT + (Caster�s Base Level )
- ele.hit = sd->battle_status.hit + sd->status.base_level;
- //[Elemental Summon Skill Level x (Caster�s INT / 2 + Caster�s DEX / 4)]
- ele.matk = i * (sd->battle_status.int_ / 2 + sd->battle_status.dex / 4);
- //150 + [Caster�s DEX / 10] + [Elemental Summon Skill Level x 3 ]
- ele.amotion = 150 + sd->battle_status.dex / 10 + i * 3;
- //Caster�s DEF + (Caster�s Base Level / (5 � Elemental Summon Skill Level)
- ele.def = sd->battle_status.def + sd->status.base_level / (5-i);
- //Caster�s MDEF + (Caster�s INT / (5 - Elemental Summon Skill Level)
- ele.mdef = sd->battle_status.mdef + sd->battle_status.int_ / (5-i);
- //Caster�s FLEE + (Caster�s Base Level / (5 � Elemental Summon Skill Level)
- ele.flee = sd->status.base_level / (5-i);
- //Caster�s HIT + (Caster�s Base Level )
- ele.hit = sd->battle_status.hit + sd->status.base_level;
-
- //per individual bonuses
- switch(db->class_){
- case 2114: case 2115:
- case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10)
- ele.atk += i * 20;
- ele.atk2 += i * 20;
- ele.hit += i * 10;
- break;
- case 2117: case 2118:
- case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20)
- ele.mdef += i * 10;
- ele.matk += i * 20;
- break;
- case 2120: case 2121:
- case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10)
- ele.flee += i * 20;
- ele.matk += i * 10;
- break;
- case 2123: case 2124:
- case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5)
- ele.def += i * 25;
- ele.atk += i * 5;
- ele.atk2 += i * 5;
- break;
- }
-
- if( (i=pc->checkskill(sd,SO_EL_SYMPATHY)) > 0 ){
- ele.hp = ele.max_hp = ele.max_hp * 5 * i / 100;
- ele.sp = ele.max_sp = ele.max_sp * 5 * i / 100;
- ele.atk += 25 * i;
- ele.atk2 += 25 * i;
- ele.matk += 25 * i;
- }
-
- ele.life_time = lifetime;
-
- // Request Char Server to create this elemental
- intif->elemental_create(&ele);
-
- return 1;
-}
-
-int elemental_get_lifetime(struct elemental_data *ed) {
- const struct TimerData * td;
- if( ed == NULL || ed->summon_timer == INVALID_TIMER )
- return 0;
-
- td = iTimer->get_timer(ed->summon_timer);
- return (td != NULL) ? DIFF_TICK(td->tick, iTimer->gettick()) : 0;
-}
-
-int elemental_save(struct elemental_data *ed) {
- ed->elemental.mode = ed->battle_status.mode;
- ed->elemental.hp = ed->battle_status.hp;
- ed->elemental.sp = ed->battle_status.sp;
- ed->elemental.max_hp = ed->battle_status.max_hp;
- ed->elemental.max_sp = ed->battle_status.max_sp;
- ed->elemental.atk = ed->battle_status.rhw.atk;
- ed->elemental.atk2 = ed->battle_status.rhw.atk2;
- ed->elemental.matk = ed->battle_status.matk_min;
- ed->elemental.def = ed->battle_status.def;
- ed->elemental.mdef = ed->battle_status.mdef;
- ed->elemental.flee = ed->battle_status.flee;
- ed->elemental.hit = ed->battle_status.hit;
- ed->elemental.life_time = elemental->get_lifetime(ed);
- intif->elemental_save(&ed->elemental);
- return 1;
-}
-
-static int elemental_summon_end(int tid, unsigned int tick, int id, intptr_t data) {
- struct map_session_data *sd;
- struct elemental_data *ed;
-
- if( (sd = iMap->id2sd(id)) == NULL )
- return 1;
- if( (ed = sd->ed) == NULL )
- return 1;
-
- if( ed->summon_timer != tid ) {
- ShowError("elemental_summon_end %d != %d.\n", ed->summon_timer, tid);
- return 0;
- }
-
- ed->summon_timer = INVALID_TIMER;
- elemental->delete(ed, 0); // Elemental's summon time is over.
-
- return 0;
-}
-
-void elemental_summon_stop(struct elemental_data *ed) {
- nullpo_retv(ed);
- if( ed->summon_timer != INVALID_TIMER )
- iTimer->delete_timer(ed->summon_timer, elemental_summon_end);
- ed->summon_timer = INVALID_TIMER;
-}
-
-int elemental_delete(struct elemental_data *ed, int reply) {
- struct map_session_data *sd;
- nullpo_ret(ed);
-
- sd = ed->master;
- ed->elemental.life_time = 0;
-
- elemental->clean_effect(ed);
- elemental->summon_stop(ed);
-
- if( !sd )
- return unit_free(&ed->bl, 0);
-
- sd->ed = NULL;
- sd->status.ele_id = 0;
-
- return unit_remove_map(&ed->bl, 0);
-}
-
-void elemental_summon_init(struct elemental_data *ed) {
- if( ed->summon_timer == INVALID_TIMER )
- ed->summon_timer = iTimer->add_timer(iTimer->gettick() + ed->elemental.life_time, elemental_summon_end, ed->master->bl.id, 0);
-
- ed->regen.state.block = 0;
-}
-
-int elemental_data_received(struct s_elemental *ele, bool flag) {
- struct map_session_data *sd;
- struct elemental_data *ed;
- struct s_elemental_db *db;
- int i = elemental_search_index(ele->class_);
-
- if( (sd = iMap->charid2sd(ele->char_id)) == NULL )
- return 0;
-
- if( !flag || i < 0 ) { // Not created - loaded - DB info
- sd->status.ele_id = 0;
- return 0;
- }
-
- db = &elemental->elemental_db[i];
- if( !sd->ed ) { // Initialize it after first summon.
- sd->ed = ed = (struct elemental_data*)aCalloc(1,sizeof(struct elemental_data));
- ed->bl.type = BL_ELEM;
- ed->bl.id = npc_get_new_npc_id();
- ed->master = sd;
- ed->db = db;
- memcpy(&ed->elemental, ele, sizeof(struct s_elemental));
- iStatus->set_viewdata(&ed->bl, ed->elemental.class_);
- ed->vd->head_mid = 10; // Why?
- iStatus->change_init(&ed->bl);
- unit_dataset(&ed->bl);
- ed->ud.dir = sd->ud.dir;
-
- ed->bl.m = sd->bl.m;
- ed->bl.x = sd->bl.x;
- ed->bl.y = sd->bl.y;
- unit_calc_pos(&ed->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
- ed->bl.x = ed->ud.to_x;
- ed->bl.y = ed->ud.to_y;
-
- iMap->addiddb(&ed->bl);
- status_calc_elemental(ed,1);
- ed->last_spdrain_time = ed->last_thinktime = iTimer->gettick();
- ed->summon_timer = INVALID_TIMER;
- elemental_summon_init(ed);
- } else {
- memcpy(&sd->ed->elemental, ele, sizeof(struct s_elemental));
- ed = sd->ed;
- }
-
- sd->status.ele_id = ele->elemental_id;
-
- if( ed->bl.prev == NULL && sd->bl.prev != NULL ) {
- iMap->addblock(&ed->bl);
- clif->spawn(&ed->bl);
- clif->elemental_info(sd);
- clif->elemental_updatestatus(sd,SP_HP);
- clif->hpmeter_single(sd->fd,ed->bl.id,ed->battle_status.hp,ed->battle_status.max_hp);
- clif->elemental_updatestatus(sd,SP_SP);
- }
-
- return 1;
-}
-
-int elemental_clean_single_effect(struct elemental_data *ed, uint16 skill_id) {
- struct block_list *bl;
- sc_type type = iStatus->skill2sc(skill_id);
-
- nullpo_ret(ed);
-
- bl = battle->get_master(&ed->bl);
-
- if( type ) {
- switch( type ) {
- // Just remove status change.
- case SC_PYROTECHNIC_OPTION:
- case SC_HEATER_OPTION:
- case SC_TROPIC_OPTION:
- case SC_FIRE_CLOAK_OPTION:
- case SC_AQUAPLAY_OPTION:
- case SC_WATER_SCREEN_OPTION:
- case SC_COOLER_OPTION:
- case SC_CHILLY_AIR_OPTION:
- case SC_GUST_OPTION:
- case SC_WIND_STEP_OPTION:
- case SC_BLAST_OPTION:
- case SC_WATER_DROP_OPTION:
- case SC_WIND_CURTAIN_OPTION:
- case SC_WILD_STORM_OPTION:
- case SC_PETROLOGY_OPTION:
- case SC_SOLID_SKIN_OPTION:
- case SC_CURSED_SOIL_OPTION:
- case SC_STONE_SHIELD_OPTION:
- case SC_UPHEAVAL_OPTION:
- case SC_CIRCLE_OF_FIRE_OPTION:
- case SC_TIDAL_WEAPON_OPTION:
- if( bl ) status_change_end(bl,type,INVALID_TIMER); // Master
- status_change_end(&ed->bl,type-1,INVALID_TIMER); // Elemental Spirit
- break;
- case SC_ZEPHYR:
- if( bl ) status_change_end(bl,type,INVALID_TIMER);
- break;
- default:
- ShowWarning("Invalid SC=%d in elemental_clean_single_effect\n",type);
- break;
- }
- }
-
- return 1;
-}
-
-int elemental_clean_effect(struct elemental_data *ed) {
- struct map_session_data *sd;
-
- nullpo_ret(ed);
-
- // Elemental side
- status_change_end(&ed->bl, SC_TROPIC, INVALID_TIMER);
- status_change_end(&ed->bl, SC_HEATER, INVALID_TIMER);
- status_change_end(&ed->bl, SC_AQUAPLAY, INVALID_TIMER);
- status_change_end(&ed->bl, SC_COOLER, INVALID_TIMER);
- status_change_end(&ed->bl, SC_CHILLY_AIR, INVALID_TIMER);
- status_change_end(&ed->bl, SC_PYROTECHNIC, INVALID_TIMER);
- status_change_end(&ed->bl, SC_FIRE_CLOAK, INVALID_TIMER);
- status_change_end(&ed->bl, SC_WATER_DROP, INVALID_TIMER);
- status_change_end(&ed->bl, SC_WATER_SCREEN, INVALID_TIMER);
- status_change_end(&ed->bl, SC_GUST, INVALID_TIMER);
- status_change_end(&ed->bl, SC_WIND_STEP, INVALID_TIMER);
- status_change_end(&ed->bl, SC_BLAST, INVALID_TIMER);
- status_change_end(&ed->bl, SC_WIND_CURTAIN, INVALID_TIMER);
- status_change_end(&ed->bl, SC_WILD_STORM, INVALID_TIMER);
- status_change_end(&ed->bl, SC_PETROLOGY, INVALID_TIMER);
- status_change_end(&ed->bl, SC_SOLID_SKIN, INVALID_TIMER);
- status_change_end(&ed->bl, SC_CURSED_SOIL, INVALID_TIMER);
- status_change_end(&ed->bl, SC_STONE_SHIELD, INVALID_TIMER);
- status_change_end(&ed->bl, SC_UPHEAVAL, INVALID_TIMER);
- status_change_end(&ed->bl, SC_CIRCLE_OF_FIRE, INVALID_TIMER);
- status_change_end(&ed->bl, SC_TIDAL_WEAPON, INVALID_TIMER);
-
- if( (sd = ed->master) == NULL )
- return 0;
-
- // Master side
- status_change_end(&sd->bl, SC_TROPIC_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_HEATER_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_AQUAPLAY_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_COOLER_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_CHILLY_AIR_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_PYROTECHNIC_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_FIRE_CLOAK_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WATER_DROP_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WATER_SCREEN_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_GUST_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WIND_STEP_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_BLAST_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WATER_DROP_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WIND_CURTAIN_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WILD_STORM_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_ZEPHYR, INVALID_TIMER);
- status_change_end(&sd->bl, SC_WIND_STEP_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_PETROLOGY_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_SOLID_SKIN_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_CURSED_SOIL_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_STONE_SHIELD_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_UPHEAVAL_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_CIRCLE_OF_FIRE_OPTION, INVALID_TIMER);
- status_change_end(&sd->bl, SC_TIDAL_WEAPON_OPTION, INVALID_TIMER);
-
- return 1;
-}
-
-int elemental_action(struct elemental_data *ed, struct block_list *bl, unsigned int tick) {
- struct skill_condition req;
- uint16 skill_id, skill_lv;
- int i;
-
- nullpo_ret(ed);
- nullpo_ret(bl);
-
- if( !ed->master )
- return 0;
-
- if( ed->target_id )
- elemental->unlocktarget(ed); // Remove previous target.
-
- ARR_FIND(0, MAX_ELESKILLTREE, i, ed->db->skill[i].id && (ed->db->skill[i].mode&EL_SKILLMODE_AGGRESSIVE));
- if( i == MAX_ELESKILLTREE )
- return 0;
-
- skill_id = ed->db->skill[i].id;
- skill_lv = ed->db->skill[i].lv;
-
- if( elemental->skillnotok(skill_id, ed) )
- return 0;
-
- if( ed->ud.skilltimer != INVALID_TIMER )
- return 0;
- else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 )
- return 0;
-
- ed->target_id = ed->ud.skilltarget = bl->id; // Set new target
- ed->last_thinktime = tick;
-
- // Not in skill range.
- if( !battle->check_range(&ed->bl,bl,skill->get_range(skill_id,skill_lv)) ) {
- // Try to walk to the target.
- if( !unit_walktobl(&ed->bl, bl, skill->get_range(skill_id,skill_lv), 2) )
- elemental->unlocktarget(ed);
- else {
- // Walking, waiting to be in range. Client don't handle it, then we must handle it here.
- int walk_dist = distance_bl(&ed->bl,bl) - skill->get_range(skill_id,skill_lv);
- ed->ud.skill_id = skill_id;
- ed->ud.skill_lv = skill_lv;
-
- if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
- ed->ud.skilltimer = iTimer->add_timer( tick+iStatus->get_speed(&ed->bl)*walk_dist, skill->castend_pos, ed->bl.id, 0 );
- else
- ed->ud.skilltimer = iTimer->add_timer( tick+iStatus->get_speed(&ed->bl)*walk_dist, skill->castend_id, ed->bl.id, 0 );
- }
- return 1;
-
- }
-
- req = elemental->skill_get_requirements(skill_id, skill_lv);
-
- if(req.hp || req.sp){
- struct map_session_data *sd = BL_CAST(BL_PC, battle->get_master(&ed->bl));
- if( sd ){
- if( sd->skill_id_old != SO_EL_ACTION && //regardless of remaining HP/SP it can be cast
- (status_get_hp(&ed->bl) < req.hp || status_get_sp(&ed->bl) < req.sp) )
- return 1;
- else
- status_zap(&ed->bl, req.hp, req.sp);
- }
- }
-
- //Otherwise, just cast the skill.
- if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
- unit_skilluse_pos(&ed->bl, bl->x, bl->y, skill_id, skill_lv);
- else
- unit_skilluse_id(&ed->bl, bl->id, skill_id, skill_lv);
-
- // Reset target.
- ed->target_id = 0;
-
- return 1;
-}
-
-/*===============================================================
- * Action that elemental perform after changing mode.
- * Activates one of the skills of the new mode.
- *-------------------------------------------------------------*/
-int elemental_change_mode_ack(struct elemental_data *ed, int mode) {
- struct block_list *bl = &ed->master->bl;
- uint16 skill_id, skill_lv;
- int i;
-
- nullpo_ret(ed);
-
- if( !bl )
- return 0;
-
- // Select a skill.
- ARR_FIND(0, MAX_ELESKILLTREE, i, ed->db->skill[i].id && (ed->db->skill[i].mode&mode));
- if( i == MAX_ELESKILLTREE )
- return 0;
-
- skill_id = ed->db->skill[i].id;
- skill_lv = ed->db->skill[i].lv;
-
- if( elemental->skillnotok(skill_id, ed) )
- return 0;
-
- if( ed->ud.skilltimer != INVALID_TIMER )
- return 0;
- else if( DIFF_TICK(iTimer->gettick(), ed->ud.canact_tick) < 0 )
- return 0;
-
- ed->target_id = bl->id; // Set new target
- ed->last_thinktime = iTimer->gettick();
-
- if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
- unit_skilluse_pos(&ed->bl, bl->x, bl->y, skill_id, skill_lv);
- else
- unit_skilluse_id(&ed->bl,bl->id,skill_id,skill_lv);
-
- ed->target_id = 0; // Reset target after casting the skill to avoid continious attack.
-
- return 1;
-}
-
-/*===============================================================
- * Change elemental mode.
- *-------------------------------------------------------------*/
-int elemental_change_mode(struct elemental_data *ed, int mode) {
- nullpo_ret(ed);
-
- // Remove target
- elemental->unlocktarget(ed);
-
- // Removes the effects of the previous mode.
- if(ed->elemental.mode != mode ) elemental->clean_effect(ed);
-
- ed->battle_status.mode = ed->elemental.mode = mode;
-
- // Normalize elemental mode to elemental skill mode.
- if( mode == EL_MODE_AGGRESSIVE ) mode = EL_SKILLMODE_AGGRESSIVE; // Aggressive spirit mode -> Aggressive spirit skill.
- else if( mode == EL_MODE_ASSIST ) mode = EL_SKILLMODE_ASSIST; // Assist spirit mode -> Assist spirit skill.
- else mode = EL_SKILLMODE_PASIVE; // Passive spirit mode -> Passive spirit skill.
-
- // Use a skill inmediately after every change mode.
- if( mode != EL_SKILLMODE_AGGRESSIVE )
- elemental->change_mode_ack(ed,mode);
- return 1;
-}
-
-void elemental_heal(struct elemental_data *ed, int hp, int sp) {
- if( hp )
- clif->elemental_updatestatus(ed->master, SP_HP);
- if( sp )
- clif->elemental_updatestatus(ed->master, SP_SP);
-}
-
-int elemental_dead(struct elemental_data *ed) {
- elemental->delete(ed, 1);
- return 0;
-}
-
-int elemental_unlocktarget(struct elemental_data *ed) {
- nullpo_ret(ed);
-
- ed->target_id = 0;
- elemental_stop_attack(ed);
- elemental_stop_walking(ed,1);
- return 0;
-}
-
-int elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
- int idx = skill->get_index(skill_id);
- nullpo_retr(1,ed);
-
- if (idx == 0)
- return 1; // invalid skill id
-
- return skill->not_ok(skill_id, ed->master);
-}
-
-struct skill_condition elemental_skill_get_requirements(uint16 skill_id, uint16 skill_lv){
- struct skill_condition req;
- int idx = skill->get_index(skill_id);
-
- memset(&req,0,sizeof(req));
-
- if( idx == 0 ) // invalid skill id
- return req;
-
- if( skill_lv < 1 || skill_lv > MAX_SKILL_LEVEL )
- return req;
-
- req.hp = skill_db[idx].hp[skill_lv-1];
- req.sp = skill_db[idx].sp[skill_lv-1];
-
- return req;
-}
-
-int elemental_set_target( struct map_session_data *sd, struct block_list *bl ) {
- struct elemental_data *ed = sd->ed;
-
- nullpo_ret(ed);
- nullpo_ret(bl);
-
- if( ed->bl.m != bl->m || !check_distance_bl(&ed->bl, bl, ed->db->range2) )
- return 0;
-
- if( !iStatus->check_skilluse(&ed->bl, bl, 0, 0) )
- return 0;
-
- if( ed->target_id == 0 )
- ed->target_id = bl->id;
-
- return 1;
-}
-
-static int elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
- struct elemental_data *ed;
- struct block_list **target;
- int dist;
-
- nullpo_ret(bl);
-
- ed = va_arg(ap,struct elemental_data *);
- target = va_arg(ap,struct block_list**);
-
- //If can't seek yet, not an enemy, or you can't attack it, skip.
- if( (*target) == bl || !iStatus->check_skilluse(&ed->bl, bl, 0, 0) )
- return 0;
-
- if( battle->check_target(&ed->bl,bl,BCT_ENEMY) <= 0 )
- return 0;
-
- switch( bl->type ) {
- case BL_PC:
- if( !map_flag_vs(ed->bl.m) )
- return 0;
- default:
- dist = distance_bl(&ed->bl, bl);
- if( ((*target) == NULL || !check_distance_bl(&ed->bl, *target, dist)) && battle->check_range(&ed->bl,bl,ed->db->range2) ) { //Pick closest target?
- (*target) = bl;
- ed->target_id = bl->id;
- ed->min_chase = dist + ed->db->range3;
- if( ed->min_chase > AREA_SIZE )
- ed->min_chase = AREA_SIZE;
- return 1;
- }
- break;
- }
- return 0;
-}
-
-static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *sd, unsigned int tick) {
- struct block_list *target = NULL;
- int master_dist, view_range, mode;
-
- nullpo_ret(ed);
- nullpo_ret(sd);
-
- if( ed->bl.prev == NULL || sd == NULL || sd->bl.prev == NULL )
- return 0;
-
- // Check if caster can sustain the summoned elemental
- if( DIFF_TICK(tick,ed->last_spdrain_time) >= 10000 ){// Drain SP every 10 seconds
- int sp = 5;
-
- switch(ed->vd->class_){
- case 2115: case 2118:
- case 2121: case 2124:
- sp = 8;
- break;
- case 2116: case 2119:
- case 2122: case 2125:
- sp = 11;
- break;
- }
-
- if( status_get_sp(&sd->bl) < sp ){ // Can't sustain delete it.
- elemental->delete(sd->ed,0);
- return 0;
- }
-
- status_zap(&sd->bl,0,sp);
- ed->last_spdrain_time = tick;
- }
-
- if( DIFF_TICK(tick,ed->last_thinktime) < MIN_ELETHINKTIME )
- return 0;
-
- ed->last_thinktime = tick;
-
- if( ed->ud.skilltimer != INVALID_TIMER )
- return 0;
-
- if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 )
- return 0; //No thinking when you just started to walk.
-
- if(ed->ud.walkpath.path_pos < ed->ud.walkpath.path_len && ed->ud.target == sd->bl.id)
- return 0; //No thinking until be near the master.
-
- if( ed->sc.count && ed->sc.data[SC_BLIND] )
- view_range = 3;
- else
- view_range = ed->db->range2;
-
- mode = status_get_mode(&ed->bl);
-
- master_dist = distance_bl(&sd->bl, &ed->bl);
- if( master_dist > AREA_SIZE ) { // Master out of vision range.
- elemental->unlocktarget(ed);
- unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT);
- clif->elemental_updatestatus(sd,SP_HP);
- clif->elemental_updatestatus(sd,SP_SP);
- return 0;
- } else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase.
- short x = sd->bl.x, y = sd->bl.y;
- if( ed->target_id )
- elemental->unlocktarget(ed);
- if( ed->ud.walktimer != INVALID_TIMER && ed->ud.target == sd->bl.id )
- return 0; //Already walking to him
- if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 )
- return 0; //Can't move yet.
- if( iMap->search_freecell(&ed->bl, sd->bl.m, &x, &y, MIN_ELEDISTANCE, MIN_ELEDISTANCE, 1)
- && unit_walktoxy(&ed->bl, x, y, 0) )
- return 0;
- }
-
- if( mode == EL_MODE_AGGRESSIVE ) {
- target = iMap->id2bl(ed->ud.target);
-
- if( !target )
- iMap->foreachinrange(elemental_ai_sub_timer_activesearch, &ed->bl, view_range, BL_CHAR, ed, &target, status_get_mode(&ed->bl));
-
- if( !target ) { //No targets available.
- elemental->unlocktarget(ed);
- return 1;
- }
-
- if( battle->check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) { // 2% chance to cast attack skill.
- if( elemental->action(ed,target,tick) )
- return 1;
- }
-
- //Attempt to attack.
- //At this point we know the target is attackable, we just gotta check if the range matches.
- if( ed->ud.target == target->id && ed->ud.attacktimer != INVALID_TIMER ) //Already locked.
- return 1;
-
- if( battle->check_range(&ed->bl, target, ed->base_status.rhw.range) ) {//Target within range, engage
- unit_attack(&ed->bl,target->id,1);
- return 1;
- }
-
- //Follow up if possible.
- if( !unit_walktobl(&ed->bl, target, ed->base_status.rhw.range, 2) )
- elemental->unlocktarget(ed);
- }
-
- return 0;
-}
-
-static int elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
- unsigned int tick = va_arg(ap,unsigned int);
- if(sd->status.ele_id && sd->ed)
- elemental_ai_sub_timer(sd->ed,sd,tick);
-
- return 0;
-}
-
-static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
- iMap->map_foreachpc(elemental_ai_sub_foreachclient,tick);
- return 0;
-}
-
-int read_elementaldb(void) {
- FILE *fp;
- char line[1024], *p;
- char *str[26];
- int i, j = 0, k = 0, ele;
- struct s_elemental_db *db;
- struct status_data *status;
-
- sprintf(line, "%s/%s", iMap->db_path, "elemental_db.txt");
- memset(elemental->elemental_db,0,sizeof(elemental->elemental_db));
-
- fp = fopen(line, "r");
- if( !fp ) {
- ShowError("read_elementaldb : can't read elemental_db.txt\n");
- return -1;
- }
-
- while( fgets(line, sizeof(line), fp) && j < MAX_ELEMENTAL_CLASS ) {
- k++;
- if( line[0] == '/' && line[1] == '/' )
- continue;
-
- if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
- continue;
-
- i = 0;
- p = strtok(line, ",");
- while( p != NULL && i < 26 ) {
- str[i++] = p;
- p = strtok(NULL, ",");
- }
- if( i < 26 ) {
- ShowError("read_elementaldb : Incorrect number of columns at elemental_db.txt line %d.\n", k);
- continue;
- }
-
- db = &elemental->elemental_db[j];
- db->class_ = atoi(str[0]);
- safestrncpy(db->sprite, str[1], NAME_LENGTH);
- safestrncpy(db->name, str[2], NAME_LENGTH);
- db->lv = atoi(str[3]);
-
- status = &db->status;
- db->vd.class_ = db->class_;
-
- status->max_hp = atoi(str[4]);
- status->max_sp = atoi(str[5]);
- status->rhw.range = atoi(str[6]);
- status->rhw.atk = atoi(str[7]);
- status->rhw.atk2 = atoi(str[8]);
- status->def = atoi(str[9]);
- status->mdef = atoi(str[10]);
- status->str = atoi(str[11]);
- status->agi = atoi(str[12]);
- status->vit = atoi(str[13]);
- status->int_ = atoi(str[14]);
- status->dex = atoi(str[15]);
- status->luk = atoi(str[16]);
- db->range2 = atoi(str[17]);
- db->range3 = atoi(str[18]);
- status->size = atoi(str[19]);
- status->race = atoi(str[20]);
-
- ele = atoi(str[21]);
- status->def_ele = ele%10;
- status->ele_lv = ele/20;
- if( status->def_ele >= ELE_MAX ) {
- ShowWarning("Elemental %d has invalid element type %d (max element is %d)\n", db->class_, status->def_ele, ELE_MAX - 1);
- status->def_ele = ELE_NEUTRAL;
- }
- if( status->ele_lv < 1 || status->ele_lv > 4 ) {
- ShowWarning("Elemental %d has invalid element level %d (max is 4)\n", db->class_, status->ele_lv);
- status->ele_lv = 1;
- }
-
- status->aspd_rate = 1000;
- status->speed = atoi(str[22]);
- status->adelay = atoi(str[23]);
- status->amotion = atoi(str[24]);
- status->dmotion = atoi(str[25]);
-
- j++;
- }
-
- fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' elementals in '"CL_WHITE"db/elemental_db.txt"CL_RESET"'.\n",j);
-
- return 0;
-}
-
-int read_elemental_skilldb(void) {
- FILE *fp;
- char line[1024], *p;
- char *str[4];
- struct s_elemental_db *db;
- int i, j = 0, k = 0, class_;
- uint16 skill_id, skill_lv;
- int skillmode;
-
- sprintf(line, "%s/%s", iMap->db_path, "elemental_skill_db.txt");
- fp = fopen(line, "r");
- if( !fp ) {
- ShowError("read_elemental_skilldb : can't read elemental_skill_db.txt\n");
- return -1;
- }
-
- while( fgets(line, sizeof(line), fp) ) {
- k++;
- if( line[0] == '/' && line[1] == '/' )
- continue;
-
- if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
- continue;
-
- i = 0;
- p = strtok(line, ",");
- while( p != NULL && i < 4 ) {
- str[i++] = p;
- p = strtok(NULL, ",");
- }
- if( i < 4 ) {
- ShowError("read_elemental_skilldb : Incorrect number of columns at elemental_skill_db.txt line %d.\n", k);
- continue;
- }
-
- class_ = atoi(str[0]);
- ARR_FIND(0, MAX_ELEMENTAL_CLASS, i, class_ == elemental->elemental_db[i].class_);
- if( i == MAX_ELEMENTAL_CLASS ) {
- ShowError("read_elemental_skilldb : Class not found in elemental_db for skill entry, line %d.\n", k);
- continue;
- }
-
- skill_id = atoi(str[1]);
- if( skill_id < EL_SKILLBASE || skill_id >= EL_SKILLBASE + MAX_ELEMENTALSKILL ) {
- ShowError("read_elemental_skilldb : Skill out of range, line %d.\n", k);
- continue;
- }
-
- db = &elemental->elemental_db[i];
- skill_lv = atoi(str[2]);
-
- skillmode = atoi(str[3]);
- if( skillmode < EL_SKILLMODE_PASIVE || skillmode > EL_SKILLMODE_AGGRESSIVE ) {
- ShowError("read_elemental_skilldb : Skillmode out of range, line %d.\n",k);
- continue;
- }
- ARR_FIND( 0, MAX_ELESKILLTREE, i, db->skill[i].id == 0 || db->skill[i].id == skill_id );
- if( i == MAX_ELESKILLTREE ) {
- ShowWarning("Unable to load skill %d into Elemental %d's tree. Maximum number of skills per elemental has been reached.\n", skill_id, class_);
- continue;
- }
- db->skill[i].id = skill_id;
- db->skill[i].lv = skill_lv;
- db->skill[i].mode = skillmode;
- j++;
- }
-
- fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"db/elemental_skill_db.txt"CL_RESET"'.\n",j);
- return 0;
-}
-
-void reload_elementaldb(void) {
- read_elementaldb();
- elemental->reload_skilldb();
-}
-
-void reload_elemental_skilldb(void) {
- elemental->read_skilldb();
-}
-
-int do_init_elemental(void) {
- read_elementaldb();
- elemental->read_skilldb();
-
- iTimer->add_timer_func_list(elemental_ai_timer,"elemental_ai_timer");
- iTimer->add_timer_interval(iTimer->gettick()+MIN_ELETHINKTIME,elemental_ai_timer,0,0,MIN_ELETHINKTIME);
-
- return 0;
-}
-
-void do_final_elemental(void) {
- return;
-}
-
-/*=====================================
-* Default Functions : elemental.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-void elemental_defaults(void) {
- elemental = &elemental_s;
- /* funcs */
-
- elemental->class = elemental_class;
- elemental->get_viewdata = elemental_get_viewdata;
-
- elemental->create = elemental_create;
- elemental->data_received = elemental_data_received;
- elemental->save = elemental_save;
-
- elemental->change_mode_ack = elemental_change_mode_ack;
- elemental->change_mode = elemental_change_mode;
-
- elemental->heal = elemental_heal;
- elemental->dead = elemental_dead;
-
- elemental->delete = elemental_delete;
- elemental->summon_stop = elemental_summon_stop;
-
- elemental->get_lifetime = elemental_get_lifetime;
-
- elemental->unlocktarget = elemental_unlocktarget;
- elemental->skillnotok = elemental_skillnotok;
- elemental->set_target = elemental_set_target;
- elemental->clean_single_effect = elemental_clean_single_effect;
- elemental->clean_effect = elemental_clean_effect;
- elemental->action = elemental_action;
- elemental->skill_get_requirements = elemental_skill_get_requirements;
-
- elemental->read_skilldb = read_elemental_skilldb;
- elemental->reload_elementaldb = reload_elementaldb;
- elemental->reload_skilldb = reload_elemental_skilldb;
- elemental->do_init_elemental = do_init_elemental;
- elemental->do_final_elemental = do_final_elemental;
-}
+// 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/malloc.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
+#include "../common/nullpo.h"
+#include "../common/mmo.h"
+#include "../common/showmsg.h"
+#include "../common/utils.h"
+#include "../common/random.h"
+#include "../common/strlib.h"
+
+#include "log.h"
+#include "clif.h"
+#include "chrif.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "map.h"
+#include "pc.h"
+#include "status.h"
+#include "skill.h"
+#include "mob.h"
+#include "pet.h"
+#include "battle.h"
+#include "party.h"
+#include "guild.h"
+#include "atcommand.h"
+#include "script.h"
+#include "npc.h"
+#include "trade.h"
+#include "unit.h"
+#include "elemental.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+int elemental_search_index(int class_) {
+ int i;
+ ARR_FIND(0, MAX_ELEMENTAL_CLASS, i, elemental->elemental_db[i].class_ == class_);
+ return (i == MAX_ELEMENTAL_CLASS)?-1:i;
+}
+
+bool elemental_class(int class_) {
+ return (bool)(elemental_search_index(class_) > -1);
+}
+
+struct view_data * elemental_get_viewdata(int class_) {
+ int i = elemental_search_index(class_);
+ if( i < 0 )
+ return 0;
+
+ return &elemental->elemental_db[i].vd;
+}
+
+int elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime) {
+ struct s_elemental ele;
+ struct s_elemental_db *db;
+ int i;
+
+ nullpo_retr(1,sd);
+
+ if( (i = elemental_search_index(class_)) < 0 )
+ return 0;
+
+ db = &elemental->elemental_db[i];
+ memset(&ele,0,sizeof(struct s_elemental));
+
+ ele.char_id = sd->status.char_id;
+ ele.class_ = class_;
+ ele.mode = EL_MODE_PASSIVE; // Initial mode
+ i = db->status.size+1; // summon level
+
+ //[(Caster�s Max HP/ 3 ) + (Caster�s INT x 10 )+ (Caster�s Job Level x 20 )] x [(Elemental Summon Level + 2) / 3]
+ ele.hp = ele.max_hp = (sd->battle_status.max_hp/3 + sd->battle_status.int_*10 + sd->status.job_level) * ((i + 2) / 3);
+ //Caster�s Max SP /4
+ ele.sp = ele.max_sp = sd->battle_status.max_sp/4;
+ //Caster�s [ Max SP / (18 / Elemental Summon Skill Level) 1- 100 ]
+ ele.atk = (sd->battle_status.max_sp / (18 / i) * 1 - 100);
+ //Caster�s [ Max SP / (18 / Elemental Summon Skill Level) ]
+ ele.atk2 = sd->battle_status.max_sp / 18;
+ //Caster�s HIT + (Caster�s Base Level )
+ ele.hit = sd->battle_status.hit + sd->status.base_level;
+ //[Elemental Summon Skill Level x (Caster�s INT / 2 + Caster�s DEX / 4)]
+ ele.matk = i * (sd->battle_status.int_ / 2 + sd->battle_status.dex / 4);
+ //150 + [Caster�s DEX / 10] + [Elemental Summon Skill Level x 3 ]
+ ele.amotion = 150 + sd->battle_status.dex / 10 + i * 3;
+ //Caster�s DEF + (Caster�s Base Level / (5 � Elemental Summon Skill Level)
+ ele.def = sd->battle_status.def + sd->status.base_level / (5-i);
+ //Caster�s MDEF + (Caster�s INT / (5 - Elemental Summon Skill Level)
+ ele.mdef = sd->battle_status.mdef + sd->battle_status.int_ / (5-i);
+ //Caster�s FLEE + (Caster�s Base Level / (5 � Elemental Summon Skill Level)
+ ele.flee = sd->status.base_level / (5-i);
+ //Caster�s HIT + (Caster�s Base Level )
+ ele.hit = sd->battle_status.hit + sd->status.base_level;
+
+ //per individual bonuses
+ switch(db->class_){
+ case 2114: case 2115:
+ case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10)
+ ele.atk += i * 20;
+ ele.atk2 += i * 20;
+ ele.hit += i * 10;
+ break;
+ case 2117: case 2118:
+ case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20)
+ ele.mdef += i * 10;
+ ele.matk += i * 20;
+ break;
+ case 2120: case 2121:
+ case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10)
+ ele.flee += i * 20;
+ ele.matk += i * 10;
+ break;
+ case 2123: case 2124:
+ case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5)
+ ele.def += i * 25;
+ ele.atk += i * 5;
+ ele.atk2 += i * 5;
+ break;
+ }
+
+ if( (i=pc->checkskill(sd,SO_EL_SYMPATHY)) > 0 ){
+ ele.hp = ele.max_hp = ele.max_hp * 5 * i / 100;
+ ele.sp = ele.max_sp = ele.max_sp * 5 * i / 100;
+ ele.atk += 25 * i;
+ ele.atk2 += 25 * i;
+ ele.matk += 25 * i;
+ }
+
+ ele.life_time = lifetime;
+
+ // Request Char Server to create this elemental
+ intif->elemental_create(&ele);
+
+ return 1;
+}
+
+int elemental_get_lifetime(struct elemental_data *ed) {
+ const struct TimerData * td;
+ if( ed == NULL || ed->summon_timer == INVALID_TIMER )
+ return 0;
+
+ td = iTimer->get_timer(ed->summon_timer);
+ return (td != NULL) ? DIFF_TICK(td->tick, iTimer->gettick()) : 0;
+}
+
+int elemental_save(struct elemental_data *ed) {
+ ed->elemental.mode = ed->battle_status.mode;
+ ed->elemental.hp = ed->battle_status.hp;
+ ed->elemental.sp = ed->battle_status.sp;
+ ed->elemental.max_hp = ed->battle_status.max_hp;
+ ed->elemental.max_sp = ed->battle_status.max_sp;
+ ed->elemental.atk = ed->battle_status.rhw.atk;
+ ed->elemental.atk2 = ed->battle_status.rhw.atk2;
+ ed->elemental.matk = ed->battle_status.matk_min;
+ ed->elemental.def = ed->battle_status.def;
+ ed->elemental.mdef = ed->battle_status.mdef;
+ ed->elemental.flee = ed->battle_status.flee;
+ ed->elemental.hit = ed->battle_status.hit;
+ ed->elemental.life_time = elemental->get_lifetime(ed);
+ intif->elemental_save(&ed->elemental);
+ return 1;
+}
+
+static int elemental_summon_end(int tid, unsigned int tick, int id, intptr_t data) {
+ struct map_session_data *sd;
+ struct elemental_data *ed;
+
+ if( (sd = iMap->id2sd(id)) == NULL )
+ return 1;
+ if( (ed = sd->ed) == NULL )
+ return 1;
+
+ if( ed->summon_timer != tid ) {
+ ShowError("elemental_summon_end %d != %d.\n", ed->summon_timer, tid);
+ return 0;
+ }
+
+ ed->summon_timer = INVALID_TIMER;
+ elemental->delete(ed, 0); // Elemental's summon time is over.
+
+ return 0;
+}
+
+void elemental_summon_stop(struct elemental_data *ed) {
+ nullpo_retv(ed);
+ if( ed->summon_timer != INVALID_TIMER )
+ iTimer->delete_timer(ed->summon_timer, elemental_summon_end);
+ ed->summon_timer = INVALID_TIMER;
+}
+
+int elemental_delete(struct elemental_data *ed, int reply) {
+ struct map_session_data *sd;
+ nullpo_ret(ed);
+
+ sd = ed->master;
+ ed->elemental.life_time = 0;
+
+ elemental->clean_effect(ed);
+ elemental->summon_stop(ed);
+
+ if( !sd )
+ return unit_free(&ed->bl, 0);
+
+ sd->ed = NULL;
+ sd->status.ele_id = 0;
+
+ return unit_remove_map(&ed->bl, 0);
+}
+
+void elemental_summon_init(struct elemental_data *ed) {
+ if( ed->summon_timer == INVALID_TIMER )
+ ed->summon_timer = iTimer->add_timer(iTimer->gettick() + ed->elemental.life_time, elemental_summon_end, ed->master->bl.id, 0);
+
+ ed->regen.state.block = 0;
+}
+
+int elemental_data_received(struct s_elemental *ele, bool flag) {
+ struct map_session_data *sd;
+ struct elemental_data *ed;
+ struct s_elemental_db *db;
+ int i = elemental_search_index(ele->class_);
+
+ if( (sd = iMap->charid2sd(ele->char_id)) == NULL )
+ return 0;
+
+ if( !flag || i < 0 ) { // Not created - loaded - DB info
+ sd->status.ele_id = 0;
+ return 0;
+ }
+
+ db = &elemental->elemental_db[i];
+ if( !sd->ed ) { // Initialize it after first summon.
+ sd->ed = ed = (struct elemental_data*)aCalloc(1,sizeof(struct elemental_data));
+ ed->bl.type = BL_ELEM;
+ ed->bl.id = npc_get_new_npc_id();
+ ed->master = sd;
+ ed->db = db;
+ memcpy(&ed->elemental, ele, sizeof(struct s_elemental));
+ iStatus->set_viewdata(&ed->bl, ed->elemental.class_);
+ ed->vd->head_mid = 10; // Why?
+ iStatus->change_init(&ed->bl);
+ unit_dataset(&ed->bl);
+ ed->ud.dir = sd->ud.dir;
+
+ ed->bl.m = sd->bl.m;
+ ed->bl.x = sd->bl.x;
+ ed->bl.y = sd->bl.y;
+ unit_calc_pos(&ed->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
+ ed->bl.x = ed->ud.to_x;
+ ed->bl.y = ed->ud.to_y;
+
+ iMap->addiddb(&ed->bl);
+ status_calc_elemental(ed,1);
+ ed->last_spdrain_time = ed->last_thinktime = iTimer->gettick();
+ ed->summon_timer = INVALID_TIMER;
+ elemental_summon_init(ed);
+ } else {
+ memcpy(&sd->ed->elemental, ele, sizeof(struct s_elemental));
+ ed = sd->ed;
+ }
+
+ sd->status.ele_id = ele->elemental_id;
+
+ if( ed->bl.prev == NULL && sd->bl.prev != NULL ) {
+ iMap->addblock(&ed->bl);
+ clif->spawn(&ed->bl);
+ clif->elemental_info(sd);
+ clif->elemental_updatestatus(sd,SP_HP);
+ clif->hpmeter_single(sd->fd,ed->bl.id,ed->battle_status.hp,ed->battle_status.max_hp);
+ clif->elemental_updatestatus(sd,SP_SP);
+ }
+
+ return 1;
+}
+
+int elemental_clean_single_effect(struct elemental_data *ed, uint16 skill_id) {
+ struct block_list *bl;
+ sc_type type = iStatus->skill2sc(skill_id);
+
+ nullpo_ret(ed);
+
+ bl = battle->get_master(&ed->bl);
+
+ if( type ) {
+ switch( type ) {
+ // Just remove status change.
+ case SC_PYROTECHNIC_OPTION:
+ case SC_HEATER_OPTION:
+ case SC_TROPIC_OPTION:
+ case SC_FIRE_CLOAK_OPTION:
+ case SC_AQUAPLAY_OPTION:
+ case SC_WATER_SCREEN_OPTION:
+ case SC_COOLER_OPTION:
+ case SC_CHILLY_AIR_OPTION:
+ case SC_GUST_OPTION:
+ case SC_WIND_STEP_OPTION:
+ case SC_BLAST_OPTION:
+ case SC_WATER_DROP_OPTION:
+ case SC_WIND_CURTAIN_OPTION:
+ case SC_WILD_STORM_OPTION:
+ case SC_PETROLOGY_OPTION:
+ case SC_SOLID_SKIN_OPTION:
+ case SC_CURSED_SOIL_OPTION:
+ case SC_STONE_SHIELD_OPTION:
+ case SC_UPHEAVAL_OPTION:
+ case SC_CIRCLE_OF_FIRE_OPTION:
+ case SC_TIDAL_WEAPON_OPTION:
+ if( bl ) status_change_end(bl,type,INVALID_TIMER); // Master
+ status_change_end(&ed->bl,type-1,INVALID_TIMER); // Elemental Spirit
+ break;
+ case SC_ZEPHYR:
+ if( bl ) status_change_end(bl,type,INVALID_TIMER);
+ break;
+ default:
+ ShowWarning("Invalid SC=%d in elemental_clean_single_effect\n",type);
+ break;
+ }
+ }
+
+ return 1;
+}
+
+int elemental_clean_effect(struct elemental_data *ed) {
+ struct map_session_data *sd;
+
+ nullpo_ret(ed);
+
+ // Elemental side
+ status_change_end(&ed->bl, SC_TROPIC, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_HEATER, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_AQUAPLAY, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_COOLER, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_CHILLY_AIR, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_PYROTECHNIC, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_FIRE_CLOAK, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_WATER_DROP, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_WATER_SCREEN, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_GUST, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_WIND_STEP, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_BLAST, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_WIND_CURTAIN, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_WILD_STORM, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_PETROLOGY, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_SOLID_SKIN, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_CURSED_SOIL, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_STONE_SHIELD, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_UPHEAVAL, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_CIRCLE_OF_FIRE, INVALID_TIMER);
+ status_change_end(&ed->bl, SC_TIDAL_WEAPON, INVALID_TIMER);
+
+ if( (sd = ed->master) == NULL )
+ return 0;
+
+ // Master side
+ status_change_end(&sd->bl, SC_TROPIC_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_HEATER_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_AQUAPLAY_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_COOLER_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_CHILLY_AIR_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_PYROTECHNIC_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_FIRE_CLOAK_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WATER_DROP_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WATER_SCREEN_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_GUST_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WIND_STEP_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_BLAST_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WATER_DROP_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WIND_CURTAIN_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WILD_STORM_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_ZEPHYR, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_WIND_STEP_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_PETROLOGY_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_SOLID_SKIN_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_CURSED_SOIL_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_STONE_SHIELD_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_UPHEAVAL_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_CIRCLE_OF_FIRE_OPTION, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_TIDAL_WEAPON_OPTION, INVALID_TIMER);
+
+ return 1;
+}
+
+int elemental_action(struct elemental_data *ed, struct block_list *bl, unsigned int tick) {
+ struct skill_condition req;
+ uint16 skill_id, skill_lv;
+ int i;
+
+ nullpo_ret(ed);
+ nullpo_ret(bl);
+
+ if( !ed->master )
+ return 0;
+
+ if( ed->target_id )
+ elemental->unlocktarget(ed); // Remove previous target.
+
+ ARR_FIND(0, MAX_ELESKILLTREE, i, ed->db->skill[i].id && (ed->db->skill[i].mode&EL_SKILLMODE_AGGRESSIVE));
+ if( i == MAX_ELESKILLTREE )
+ return 0;
+
+ skill_id = ed->db->skill[i].id;
+ skill_lv = ed->db->skill[i].lv;
+
+ if( elemental->skillnotok(skill_id, ed) )
+ return 0;
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
+ return 0;
+ else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 )
+ return 0;
+
+ ed->target_id = ed->ud.skilltarget = bl->id; // Set new target
+ ed->last_thinktime = tick;
+
+ // Not in skill range.
+ if( !battle->check_range(&ed->bl,bl,skill->get_range(skill_id,skill_lv)) ) {
+ // Try to walk to the target.
+ if( !unit_walktobl(&ed->bl, bl, skill->get_range(skill_id,skill_lv), 2) )
+ elemental->unlocktarget(ed);
+ else {
+ // Walking, waiting to be in range. Client don't handle it, then we must handle it here.
+ int walk_dist = distance_bl(&ed->bl,bl) - skill->get_range(skill_id,skill_lv);
+ ed->ud.skill_id = skill_id;
+ ed->ud.skill_lv = skill_lv;
+
+ if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
+ ed->ud.skilltimer = iTimer->add_timer( tick+iStatus->get_speed(&ed->bl)*walk_dist, skill->castend_pos, ed->bl.id, 0 );
+ else
+ ed->ud.skilltimer = iTimer->add_timer( tick+iStatus->get_speed(&ed->bl)*walk_dist, skill->castend_id, ed->bl.id, 0 );
+ }
+ return 1;
+
+ }
+
+ req = elemental->skill_get_requirements(skill_id, skill_lv);
+
+ if(req.hp || req.sp){
+ struct map_session_data *sd = BL_CAST(BL_PC, battle->get_master(&ed->bl));
+ if( sd ){
+ if( sd->skill_id_old != SO_EL_ACTION && //regardless of remaining HP/SP it can be cast
+ (status_get_hp(&ed->bl) < req.hp || status_get_sp(&ed->bl) < req.sp) )
+ return 1;
+ else
+ status_zap(&ed->bl, req.hp, req.sp);
+ }
+ }
+
+ //Otherwise, just cast the skill.
+ if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
+ unit_skilluse_pos(&ed->bl, bl->x, bl->y, skill_id, skill_lv);
+ else
+ unit_skilluse_id(&ed->bl, bl->id, skill_id, skill_lv);
+
+ // Reset target.
+ ed->target_id = 0;
+
+ return 1;
+}
+
+/*===============================================================
+ * Action that elemental perform after changing mode.
+ * Activates one of the skills of the new mode.
+ *-------------------------------------------------------------*/
+int elemental_change_mode_ack(struct elemental_data *ed, int mode) {
+ struct block_list *bl = &ed->master->bl;
+ uint16 skill_id, skill_lv;
+ int i;
+
+ nullpo_ret(ed);
+
+ if( !bl )
+ return 0;
+
+ // Select a skill.
+ ARR_FIND(0, MAX_ELESKILLTREE, i, ed->db->skill[i].id && (ed->db->skill[i].mode&mode));
+ if( i == MAX_ELESKILLTREE )
+ return 0;
+
+ skill_id = ed->db->skill[i].id;
+ skill_lv = ed->db->skill[i].lv;
+
+ if( elemental->skillnotok(skill_id, ed) )
+ return 0;
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
+ return 0;
+ else if( DIFF_TICK(iTimer->gettick(), ed->ud.canact_tick) < 0 )
+ return 0;
+
+ ed->target_id = bl->id; // Set new target
+ ed->last_thinktime = iTimer->gettick();
+
+ if( skill->get_inf(skill_id) & INF_GROUND_SKILL )
+ unit_skilluse_pos(&ed->bl, bl->x, bl->y, skill_id, skill_lv);
+ else
+ unit_skilluse_id(&ed->bl,bl->id,skill_id,skill_lv);
+
+ ed->target_id = 0; // Reset target after casting the skill to avoid continious attack.
+
+ return 1;
+}
+
+/*===============================================================
+ * Change elemental mode.
+ *-------------------------------------------------------------*/
+int elemental_change_mode(struct elemental_data *ed, int mode) {
+ nullpo_ret(ed);
+
+ // Remove target
+ elemental->unlocktarget(ed);
+
+ // Removes the effects of the previous mode.
+ if(ed->elemental.mode != mode ) elemental->clean_effect(ed);
+
+ ed->battle_status.mode = ed->elemental.mode = mode;
+
+ // Normalize elemental mode to elemental skill mode.
+ if( mode == EL_MODE_AGGRESSIVE ) mode = EL_SKILLMODE_AGGRESSIVE; // Aggressive spirit mode -> Aggressive spirit skill.
+ else if( mode == EL_MODE_ASSIST ) mode = EL_SKILLMODE_ASSIST; // Assist spirit mode -> Assist spirit skill.
+ else mode = EL_SKILLMODE_PASIVE; // Passive spirit mode -> Passive spirit skill.
+
+ // Use a skill inmediately after every change mode.
+ if( mode != EL_SKILLMODE_AGGRESSIVE )
+ elemental->change_mode_ack(ed,mode);
+ return 1;
+}
+
+void elemental_heal(struct elemental_data *ed, int hp, int sp) {
+ if( hp )
+ clif->elemental_updatestatus(ed->master, SP_HP);
+ if( sp )
+ clif->elemental_updatestatus(ed->master, SP_SP);
+}
+
+int elemental_dead(struct elemental_data *ed) {
+ elemental->delete(ed, 1);
+ return 0;
+}
+
+int elemental_unlocktarget(struct elemental_data *ed) {
+ nullpo_ret(ed);
+
+ ed->target_id = 0;
+ elemental_stop_attack(ed);
+ elemental_stop_walking(ed,1);
+ return 0;
+}
+
+int elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
+ int idx = skill->get_index(skill_id);
+ nullpo_retr(1,ed);
+
+ if (idx == 0)
+ return 1; // invalid skill id
+
+ return skill->not_ok(skill_id, ed->master);
+}
+
+struct skill_condition elemental_skill_get_requirements(uint16 skill_id, uint16 skill_lv){
+ struct skill_condition req;
+ int idx = skill->get_index(skill_id);
+
+ memset(&req,0,sizeof(req));
+
+ if( idx == 0 ) // invalid skill id
+ return req;
+
+ if( skill_lv < 1 || skill_lv > MAX_SKILL_LEVEL )
+ return req;
+
+ req.hp = skill_db[idx].hp[skill_lv-1];
+ req.sp = skill_db[idx].sp[skill_lv-1];
+
+ return req;
+}
+
+int elemental_set_target( struct map_session_data *sd, struct block_list *bl ) {
+ struct elemental_data *ed = sd->ed;
+
+ nullpo_ret(ed);
+ nullpo_ret(bl);
+
+ if( ed->bl.m != bl->m || !check_distance_bl(&ed->bl, bl, ed->db->range2) )
+ return 0;
+
+ if( !iStatus->check_skilluse(&ed->bl, bl, 0, 0) )
+ return 0;
+
+ if( ed->target_id == 0 )
+ ed->target_id = bl->id;
+
+ return 1;
+}
+
+static int elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
+ struct elemental_data *ed;
+ struct block_list **target;
+ int dist;
+
+ nullpo_ret(bl);
+
+ ed = va_arg(ap,struct elemental_data *);
+ target = va_arg(ap,struct block_list**);
+
+ //If can't seek yet, not an enemy, or you can't attack it, skip.
+ if( (*target) == bl || !iStatus->check_skilluse(&ed->bl, bl, 0, 0) )
+ return 0;
+
+ if( battle->check_target(&ed->bl,bl,BCT_ENEMY) <= 0 )
+ return 0;
+
+ switch( bl->type ) {
+ case BL_PC:
+ if( !map_flag_vs(ed->bl.m) )
+ return 0;
+ default:
+ dist = distance_bl(&ed->bl, bl);
+ if( ((*target) == NULL || !check_distance_bl(&ed->bl, *target, dist)) && battle->check_range(&ed->bl,bl,ed->db->range2) ) { //Pick closest target?
+ (*target) = bl;
+ ed->target_id = bl->id;
+ ed->min_chase = dist + ed->db->range3;
+ if( ed->min_chase > AREA_SIZE )
+ ed->min_chase = AREA_SIZE;
+ return 1;
+ }
+ break;
+ }
+ return 0;
+}
+
+static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *sd, unsigned int tick) {
+ struct block_list *target = NULL;
+ int master_dist, view_range, mode;
+
+ nullpo_ret(ed);
+ nullpo_ret(sd);
+
+ if( ed->bl.prev == NULL || sd == NULL || sd->bl.prev == NULL )
+ return 0;
+
+ // Check if caster can sustain the summoned elemental
+ if( DIFF_TICK(tick,ed->last_spdrain_time) >= 10000 ){// Drain SP every 10 seconds
+ int sp = 5;
+
+ switch(ed->vd->class_){
+ case 2115: case 2118:
+ case 2121: case 2124:
+ sp = 8;
+ break;
+ case 2116: case 2119:
+ case 2122: case 2125:
+ sp = 11;
+ break;
+ }
+
+ if( status_get_sp(&sd->bl) < sp ){ // Can't sustain delete it.
+ elemental->delete(sd->ed,0);
+ return 0;
+ }
+
+ status_zap(&sd->bl,0,sp);
+ ed->last_spdrain_time = tick;
+ }
+
+ if( DIFF_TICK(tick,ed->last_thinktime) < MIN_ELETHINKTIME )
+ return 0;
+
+ ed->last_thinktime = tick;
+
+ if( ed->ud.skilltimer != INVALID_TIMER )
+ return 0;
+
+ if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 )
+ return 0; //No thinking when you just started to walk.
+
+ if(ed->ud.walkpath.path_pos < ed->ud.walkpath.path_len && ed->ud.target == sd->bl.id)
+ return 0; //No thinking until be near the master.
+
+ if( ed->sc.count && ed->sc.data[SC_BLIND] )
+ view_range = 3;
+ else
+ view_range = ed->db->range2;
+
+ mode = status_get_mode(&ed->bl);
+
+ master_dist = distance_bl(&sd->bl, &ed->bl);
+ if( master_dist > AREA_SIZE ) { // Master out of vision range.
+ elemental->unlocktarget(ed);
+ unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT);
+ clif->elemental_updatestatus(sd,SP_HP);
+ clif->elemental_updatestatus(sd,SP_SP);
+ return 0;
+ } else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase.
+ short x = sd->bl.x, y = sd->bl.y;
+ if( ed->target_id )
+ elemental->unlocktarget(ed);
+ if( ed->ud.walktimer != INVALID_TIMER && ed->ud.target == sd->bl.id )
+ return 0; //Already walking to him
+ if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 )
+ return 0; //Can't move yet.
+ if( iMap->search_freecell(&ed->bl, sd->bl.m, &x, &y, MIN_ELEDISTANCE, MIN_ELEDISTANCE, 1)
+ && unit_walktoxy(&ed->bl, x, y, 0) )
+ return 0;
+ }
+
+ if( mode == EL_MODE_AGGRESSIVE ) {
+ target = iMap->id2bl(ed->ud.target);
+
+ if( !target )
+ iMap->foreachinrange(elemental_ai_sub_timer_activesearch, &ed->bl, view_range, BL_CHAR, ed, &target, status_get_mode(&ed->bl));
+
+ if( !target ) { //No targets available.
+ elemental->unlocktarget(ed);
+ return 1;
+ }
+
+ if( battle->check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) { // 2% chance to cast attack skill.
+ if( elemental->action(ed,target,tick) )
+ return 1;
+ }
+
+ //Attempt to attack.
+ //At this point we know the target is attackable, we just gotta check if the range matches.
+ if( ed->ud.target == target->id && ed->ud.attacktimer != INVALID_TIMER ) //Already locked.
+ return 1;
+
+ if( battle->check_range(&ed->bl, target, ed->base_status.rhw.range) ) {//Target within range, engage
+ unit_attack(&ed->bl,target->id,1);
+ return 1;
+ }
+
+ //Follow up if possible.
+ if( !unit_walktobl(&ed->bl, target, ed->base_status.rhw.range, 2) )
+ elemental->unlocktarget(ed);
+ }
+
+ return 0;
+}
+
+static int elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
+ unsigned int tick = va_arg(ap,unsigned int);
+ if(sd->status.ele_id && sd->ed)
+ elemental_ai_sub_timer(sd->ed,sd,tick);
+
+ return 0;
+}
+
+static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ iMap->map_foreachpc(elemental_ai_sub_foreachclient,tick);
+ return 0;
+}
+
+int read_elementaldb(void) {
+ FILE *fp;
+ char line[1024], *p;
+ char *str[26];
+ int i, j = 0, k = 0, ele;
+ struct s_elemental_db *db;
+ struct status_data *status;
+
+ sprintf(line, "%s/%s", iMap->db_path, "elemental_db.txt");
+ memset(elemental->elemental_db,0,sizeof(elemental->elemental_db));
+
+ fp = fopen(line, "r");
+ if( !fp ) {
+ ShowError("read_elementaldb : can't read elemental_db.txt\n");
+ return -1;
+ }
+
+ while( fgets(line, sizeof(line), fp) && j < MAX_ELEMENTAL_CLASS ) {
+ k++;
+ if( line[0] == '/' && line[1] == '/' )
+ continue;
+
+ if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
+ continue;
+
+ i = 0;
+ p = strtok(line, ",");
+ while( p != NULL && i < 26 ) {
+ str[i++] = p;
+ p = strtok(NULL, ",");
+ }
+ if( i < 26 ) {
+ ShowError("read_elementaldb : Incorrect number of columns at elemental_db.txt line %d.\n", k);
+ continue;
+ }
+
+ db = &elemental->elemental_db[j];
+ db->class_ = atoi(str[0]);
+ safestrncpy(db->sprite, str[1], NAME_LENGTH);
+ safestrncpy(db->name, str[2], NAME_LENGTH);
+ db->lv = atoi(str[3]);
+
+ status = &db->status;
+ db->vd.class_ = db->class_;
+
+ status->max_hp = atoi(str[4]);
+ status->max_sp = atoi(str[5]);
+ status->rhw.range = atoi(str[6]);
+ status->rhw.atk = atoi(str[7]);
+ status->rhw.atk2 = atoi(str[8]);
+ status->def = atoi(str[9]);
+ status->mdef = atoi(str[10]);
+ status->str = atoi(str[11]);
+ status->agi = atoi(str[12]);
+ status->vit = atoi(str[13]);
+ status->int_ = atoi(str[14]);
+ status->dex = atoi(str[15]);
+ status->luk = atoi(str[16]);
+ db->range2 = atoi(str[17]);
+ db->range3 = atoi(str[18]);
+ status->size = atoi(str[19]);
+ status->race = atoi(str[20]);
+
+ ele = atoi(str[21]);
+ status->def_ele = ele%10;
+ status->ele_lv = ele/20;
+ if( status->def_ele >= ELE_MAX ) {
+ ShowWarning("Elemental %d has invalid element type %d (max element is %d)\n", db->class_, status->def_ele, ELE_MAX - 1);
+ status->def_ele = ELE_NEUTRAL;
+ }
+ if( status->ele_lv < 1 || status->ele_lv > 4 ) {
+ ShowWarning("Elemental %d has invalid element level %d (max is 4)\n", db->class_, status->ele_lv);
+ status->ele_lv = 1;
+ }
+
+ status->aspd_rate = 1000;
+ status->speed = atoi(str[22]);
+ status->adelay = atoi(str[23]);
+ status->amotion = atoi(str[24]);
+ status->dmotion = atoi(str[25]);
+
+ j++;
+ }
+
+ fclose(fp);
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' elementals in '"CL_WHITE"db/elemental_db.txt"CL_RESET"'.\n",j);
+
+ return 0;
+}
+
+int read_elemental_skilldb(void) {
+ FILE *fp;
+ char line[1024], *p;
+ char *str[4];
+ struct s_elemental_db *db;
+ int i, j = 0, k = 0, class_;
+ uint16 skill_id, skill_lv;
+ int skillmode;
+
+ sprintf(line, "%s/%s", iMap->db_path, "elemental_skill_db.txt");
+ fp = fopen(line, "r");
+ if( !fp ) {
+ ShowError("read_elemental_skilldb : can't read elemental_skill_db.txt\n");
+ return -1;
+ }
+
+ while( fgets(line, sizeof(line), fp) ) {
+ k++;
+ if( line[0] == '/' && line[1] == '/' )
+ continue;
+
+ if( line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
+ continue;
+
+ i = 0;
+ p = strtok(line, ",");
+ while( p != NULL && i < 4 ) {
+ str[i++] = p;
+ p = strtok(NULL, ",");
+ }
+ if( i < 4 ) {
+ ShowError("read_elemental_skilldb : Incorrect number of columns at elemental_skill_db.txt line %d.\n", k);
+ continue;
+ }
+
+ class_ = atoi(str[0]);
+ ARR_FIND(0, MAX_ELEMENTAL_CLASS, i, class_ == elemental->elemental_db[i].class_);
+ if( i == MAX_ELEMENTAL_CLASS ) {
+ ShowError("read_elemental_skilldb : Class not found in elemental_db for skill entry, line %d.\n", k);
+ continue;
+ }
+
+ skill_id = atoi(str[1]);
+ if( skill_id < EL_SKILLBASE || skill_id >= EL_SKILLBASE + MAX_ELEMENTALSKILL ) {
+ ShowError("read_elemental_skilldb : Skill out of range, line %d.\n", k);
+ continue;
+ }
+
+ db = &elemental->elemental_db[i];
+ skill_lv = atoi(str[2]);
+
+ skillmode = atoi(str[3]);
+ if( skillmode < EL_SKILLMODE_PASIVE || skillmode > EL_SKILLMODE_AGGRESSIVE ) {
+ ShowError("read_elemental_skilldb : Skillmode out of range, line %d.\n",k);
+ continue;
+ }
+ ARR_FIND( 0, MAX_ELESKILLTREE, i, db->skill[i].id == 0 || db->skill[i].id == skill_id );
+ if( i == MAX_ELESKILLTREE ) {
+ ShowWarning("Unable to load skill %d into Elemental %d's tree. Maximum number of skills per elemental has been reached.\n", skill_id, class_);
+ continue;
+ }
+ db->skill[i].id = skill_id;
+ db->skill[i].lv = skill_lv;
+ db->skill[i].mode = skillmode;
+ j++;
+ }
+
+ fclose(fp);
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"db/elemental_skill_db.txt"CL_RESET"'.\n",j);
+ return 0;
+}
+
+void reload_elementaldb(void) {
+ read_elementaldb();
+ elemental->reload_skilldb();
+}
+
+void reload_elemental_skilldb(void) {
+ elemental->read_skilldb();
+}
+
+int do_init_elemental(void) {
+ read_elementaldb();
+ elemental->read_skilldb();
+
+ iTimer->add_timer_func_list(elemental_ai_timer,"elemental_ai_timer");
+ iTimer->add_timer_interval(iTimer->gettick()+MIN_ELETHINKTIME,elemental_ai_timer,0,0,MIN_ELETHINKTIME);
+
+ return 0;
+}
+
+void do_final_elemental(void) {
+ return;
+}
+
+/*=====================================
+* Default Functions : elemental.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+void elemental_defaults(void) {
+ elemental = &elemental_s;
+ /* funcs */
+
+ elemental->class = elemental_class;
+ elemental->get_viewdata = elemental_get_viewdata;
+
+ elemental->create = elemental_create;
+ elemental->data_received = elemental_data_received;
+ elemental->save = elemental_save;
+
+ elemental->change_mode_ack = elemental_change_mode_ack;
+ elemental->change_mode = elemental_change_mode;
+
+ elemental->heal = elemental_heal;
+ elemental->dead = elemental_dead;
+
+ elemental->delete = elemental_delete;
+ elemental->summon_stop = elemental_summon_stop;
+
+ elemental->get_lifetime = elemental_get_lifetime;
+
+ elemental->unlocktarget = elemental_unlocktarget;
+ elemental->skillnotok = elemental_skillnotok;
+ elemental->set_target = elemental_set_target;
+ elemental->clean_single_effect = elemental_clean_single_effect;
+ elemental->clean_effect = elemental_clean_effect;
+ elemental->action = elemental_action;
+ elemental->skill_get_requirements = elemental_skill_get_requirements;
+
+ elemental->read_skilldb = read_elemental_skilldb;
+ elemental->reload_elementaldb = reload_elementaldb;
+ elemental->reload_skilldb = reload_elemental_skilldb;
+ elemental->do_init_elemental = do_init_elemental;
+ elemental->do_final_elemental = do_final_elemental;
+}
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 96d2ed89f..250cd3b72 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -1,106 +1,106 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-#ifndef _ELEMENTAL_H_
-#define _ELEMENTAL_H_
-#include "status.h" // struct status_data, struct status_change
-#include "unit.h" // struct unit_data
-#define MIN_ELETHINKTIME 100
-#define MIN_ELEDISTANCE 2
-#define MAX_ELEDISTANCE 5
-#define EL_MODE_AGGRESSIVE (MD_CANMOVE|MD_AGGRESSIVE|MD_CANATTACK)
-#define EL_MODE_ASSIST (MD_CANMOVE|MD_ASSIST)
-#define EL_MODE_PASSIVE MD_CANMOVE
-#define EL_SKILLMODE_PASIVE 0x1
-#define EL_SKILLMODE_ASSIST 0x2
-#define EL_SKILLMODE_AGGRESSIVE 0x4
-struct elemental_skill {
- unsigned short id, lv;
- short mode;
-};
-struct s_elemental_db {
- int class_;
- char sprite[NAME_LENGTH], name[NAME_LENGTH];
- unsigned short lv;
- short range2, range3;
- struct status_data status;
- struct view_data vd;
- struct elemental_skill skill[MAX_ELESKILLTREE];
-};
-struct elemental_data {
- struct block_list bl;
- struct unit_data ud;
- struct view_data *vd;
- struct status_data base_status, battle_status;
- struct status_change sc;
- struct regen_data regen;
-
- struct s_elemental_db *db;
- struct s_elemental elemental;
-
- struct map_session_data *master;
- int summon_timer;
- int skill_timer;
-
- unsigned last_thinktime, last_linktime, last_spdrain_time;
- short min_chase;
- int target_id, attacked_id;
-};
-
-
-
-
-
-
-
-
-#define elemental_stop_walking(ed, type) unit_stop_walking(&(ed)->bl, type)
-#define elemental_stop_attack(ed) unit_stop_attack(&(ed)->bl)
-
-
-/*=====================================
-* Interface : elemental.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-struct elemental_interface {
- /* vars */
- struct s_elemental_db elemental_db[MAX_ELEMENTAL_CLASS]; // Elemental Database
- /* funcs */
- bool (*class) (int class_);
- struct view_data * (*get_viewdata) (int class_);
-
- int (*create) (struct map_session_data *sd, int class_, unsigned int lifetime);
- int (*data_received) (struct s_elemental *ele, bool flag);
- int (*save) (struct elemental_data *ed);
-
- int (*change_mode_ack) (struct elemental_data *ed, int mode);
- int (*change_mode) (struct elemental_data *ed, int mode);
-
- void (*heal) (struct elemental_data *ed, int hp, int sp);
- int (*dead) (struct elemental_data *ed);
-
- int (*delete) (struct elemental_data *ed, int reply);
- void (*summon_stop) (struct elemental_data *ed);
-
- int (*get_lifetime) (struct elemental_data *ed);
-
- int (*unlocktarget) (struct elemental_data *ed);
- int (*skillnotok) (uint16 skill_id, struct elemental_data *ed);
- int (*set_target) (struct map_session_data *sd, struct block_list *bl);
- int (*clean_single_effect) (struct elemental_data *ed, uint16 skill_id);
- int (*clean_effect) (struct elemental_data *ed);
- int (*action) (struct elemental_data *ed, struct block_list *bl, unsigned int tick);
- struct skill_condition (*skill_get_requirements) (uint16 skill_id, uint16 skill_lv);
-
- int (*read_skilldb) (void);
- void (*reload_elementaldb) (void);
- void (*reload_skilldb) (void);
- int (*do_init_elemental) (void);
- void (*do_final_elemental) (void);
-} elemental_s;
-
-struct elemental_interface *elemental;
-
-void elemental_defaults(void);
-
-#endif /* _ELEMENTAL_H_ */
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _ELEMENTAL_H_
+#define _ELEMENTAL_H_
+#include "status.h" // struct status_data, struct status_change
+#include "unit.h" // struct unit_data
+#define MIN_ELETHINKTIME 100
+#define MIN_ELEDISTANCE 2
+#define MAX_ELEDISTANCE 5
+#define EL_MODE_AGGRESSIVE (MD_CANMOVE|MD_AGGRESSIVE|MD_CANATTACK)
+#define EL_MODE_ASSIST (MD_CANMOVE|MD_ASSIST)
+#define EL_MODE_PASSIVE MD_CANMOVE
+#define EL_SKILLMODE_PASIVE 0x1
+#define EL_SKILLMODE_ASSIST 0x2
+#define EL_SKILLMODE_AGGRESSIVE 0x4
+struct elemental_skill {
+ unsigned short id, lv;
+ short mode;
+};
+struct s_elemental_db {
+ int class_;
+ char sprite[NAME_LENGTH], name[NAME_LENGTH];
+ unsigned short lv;
+ short range2, range3;
+ struct status_data status;
+ struct view_data vd;
+ struct elemental_skill skill[MAX_ELESKILLTREE];
+};
+struct elemental_data {
+ struct block_list bl;
+ struct unit_data ud;
+ struct view_data *vd;
+ struct status_data base_status, battle_status;
+ struct status_change sc;
+ struct regen_data regen;
+
+ struct s_elemental_db *db;
+ struct s_elemental elemental;
+
+ struct map_session_data *master;
+ int summon_timer;
+ int skill_timer;
+
+ unsigned last_thinktime, last_linktime, last_spdrain_time;
+ short min_chase;
+ int target_id, attacked_id;
+};
+
+
+
+
+
+
+
+
+#define elemental_stop_walking(ed, type) unit_stop_walking(&(ed)->bl, type)
+#define elemental_stop_attack(ed) unit_stop_attack(&(ed)->bl)
+
+
+/*=====================================
+* Interface : elemental.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+struct elemental_interface {
+ /* vars */
+ struct s_elemental_db elemental_db[MAX_ELEMENTAL_CLASS]; // Elemental Database
+ /* funcs */
+ bool (*class) (int class_);
+ struct view_data * (*get_viewdata) (int class_);
+
+ int (*create) (struct map_session_data *sd, int class_, unsigned int lifetime);
+ int (*data_received) (struct s_elemental *ele, bool flag);
+ int (*save) (struct elemental_data *ed);
+
+ int (*change_mode_ack) (struct elemental_data *ed, int mode);
+ int (*change_mode) (struct elemental_data *ed, int mode);
+
+ void (*heal) (struct elemental_data *ed, int hp, int sp);
+ int (*dead) (struct elemental_data *ed);
+
+ int (*delete) (struct elemental_data *ed, int reply);
+ void (*summon_stop) (struct elemental_data *ed);
+
+ int (*get_lifetime) (struct elemental_data *ed);
+
+ int (*unlocktarget) (struct elemental_data *ed);
+ int (*skillnotok) (uint16 skill_id, struct elemental_data *ed);
+ int (*set_target) (struct map_session_data *sd, struct block_list *bl);
+ int (*clean_single_effect) (struct elemental_data *ed, uint16 skill_id);
+ int (*clean_effect) (struct elemental_data *ed);
+ int (*action) (struct elemental_data *ed, struct block_list *bl, unsigned int tick);
+ struct skill_condition (*skill_get_requirements) (uint16 skill_id, uint16 skill_lv);
+
+ int (*read_skilldb) (void);
+ void (*reload_elementaldb) (void);
+ void (*reload_skilldb) (void);
+ int (*do_init_elemental) (void);
+ void (*do_final_elemental) (void);
+} elemental_s;
+
+struct elemental_interface *elemental;
+
+void elemental_defaults(void);
+
+#endif /* _ELEMENTAL_H_ */
diff --git a/src/map/intif.h b/src/map/intif.h
index f0c1067fb..8abcf819d 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -1,128 +1,128 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-#ifndef _INTIF_H_
-#define _INFIF_H_
-//#include "../common/mmo.h"
-struct party_member;
-struct guild_member;
-struct guild_position;
-struct s_pet;
-struct s_homunculus;
-struct s_mercenary;
-struct s_elemental;
-struct mail_message;
-struct auction_data;
-
-
-
-
-
-#define intif_rename_pc(sd, name) intif->rename(sd, 0, name)
-#define intif_rename_pet(sd, name) intif->rename(sd, 1, name)
-#define intif_rename_hom(sd, name) intif->rename(sd, 2, name)
-
-
-
-
-
-
-/*=====================================
-* Interface : intif.h
-* Generated by HerculesInterfaceMaker
-* created by Susu
-*-------------------------------------*/
-struct intif_interface {
- /* funcs */
-
-
- int (*parse) (int fd);
-
- int (*create_pet)(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name);
-
- int (*broadcast) (const char* mes, int len, int type);
- int (*broadcast2) (const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY);
- int (*main_message) (struct map_session_data* sd, const char* message);
-
- int (*wis_message) (struct map_session_data *sd,char *nick,char *mes,int mes_len);
- int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes);
-
- int (*saveregistry) (struct map_session_data *sd, int type);
- int (*request_registry) (struct map_session_data *sd, int flag);
-
- int (*request_guild_storage) (int account_id, int guild_id);
- int (*send_guild_storage) (int account_id, struct guild_storage *gstor);
-
- int (*create_party) (struct party_member *member,char *name,int item,int item2);
- int (*request_partyinfo) (int party_id, int char_id);
-
- int (*party_addmember) (int party_id,struct party_member *member);
- int (*party_changeoption) (int party_id, int account_id, int exp, int item);
- int (*party_leave) (int party_id,int account_id, int char_id);
- int (*party_changemap) (struct map_session_data *sd, int online);
- int (*break_party) (int party_id);
- int (*party_message) (int party_id, int account_id, const char *mes,int len);
- int (*party_leaderchange) (int party_id,int account_id,int char_id);
-
- int (*guild_create) (const char *name, const struct guild_member *master);
- int (*guild_request_info) (int guild_id);
- int (*guild_addmember) (int guild_id, struct guild_member *m);
- int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes);
- int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class_);
- int (*guild_break) (int guild_id);
- int (*guild_message) (int guild_id, int account_id, const char *mes, int len);
- int (*guild_change_gm) (int guild_id, const char* name, int len);
- int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len);
- int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len);
- int (*guild_position) (int guild_id, int idx, struct guild_position *p);
- int (*guild_skillup) (int guild_id, uint16 skill_id, int account_id, int max);
- int (*guild_alliance) (int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
- int (*guild_notice) (int guild_id, const char *mes1, const char *mes2);
- int (*guild_emblem) (int guild_id, int len, const char *data);
- int (*guild_castle_dataload) (int num, int *castle_ids);
- int (*guild_castle_datasave) (int castle_id, int index, int value);
- int (*request_petdata) (int account_id, int char_id, int pet_id);
- int (*save_petdata) (int account_id, struct s_pet *p);
- int (*delete_petdata) (int pet_id);
- int (*rename) (struct map_session_data *sd, int type, char *name);
- int (*homunculus_create) (int account_id, struct s_homunculus *sh);
- bool (*homunculus_requestload) (int account_id, int homun_id);
- int (*homunculus_requestsave) (int account_id, struct s_homunculus* sh);
- int (*homunculus_requestdelete) (int homun_id);
- /******QUEST SYTEM*******/
- int (*request_questlog) (struct map_session_data * sd);
- int (*quest_save) (struct map_session_data * sd);
- // MERCENARY SYSTEM
- int (*mercenary_create) (struct s_mercenary *merc);
- int (*mercenary_request) (int merc_id, int char_id);
- int (*mercenary_delete) (int merc_id);
- int (*mercenary_save) (struct s_mercenary *merc);
- // MAIL SYSTEM
- int (*Mail_requestinbox) (int char_id, unsigned char flag);
- int (*Mail_read) (int mail_id);
- int (*Mail_getattach) (int char_id, int mail_id);
- int (*Mail_delete) (int char_id, int mail_id);
- int (*Mail_return) (int char_id, int mail_id);
- int (*Mail_send) (int account_id, struct mail_message *msg);
- // AUCTION SYSTEM
- int (*Auction_requestlist) (int char_id, short type, int price, const char* searchtext, short page);
- int (*Auction_register) (struct auction_data *auction);
- int (*Auction_cancel) (int char_id, unsigned int auction_id);
- int (*Auction_close) (int char_id, unsigned int auction_id);
- int (*Auction_bid) (int char_id, const char* name, unsigned int auction_id, int bid);
- // ELEMENTAL SYSTEM
- int (*elemental_create) (struct s_elemental *ele);
- int (*elemental_request) (int ele_id, int char_id);
- int (*elemental_delete) (int ele_id);
- int (*elemental_save) (struct s_elemental *ele);
- /* @accinfo */
- void (*request_accinfo) (int u_fd, int aid, int group_lv, char* query);
-
- int (*CheckForCharServer) (void);
-} intif_s;
-
-struct intif_interface *intif;
-
-void intif_defaults(void);
-
-#endif /* _INTIF_H_ */
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _INTIF_H_
+#define _INFIF_H_
+//#include "../common/mmo.h"
+struct party_member;
+struct guild_member;
+struct guild_position;
+struct s_pet;
+struct s_homunculus;
+struct s_mercenary;
+struct s_elemental;
+struct mail_message;
+struct auction_data;
+
+
+
+
+
+#define intif_rename_pc(sd, name) intif->rename(sd, 0, name)
+#define intif_rename_pet(sd, name) intif->rename(sd, 1, name)
+#define intif_rename_hom(sd, name) intif->rename(sd, 2, name)
+
+
+
+
+
+
+/*=====================================
+* Interface : intif.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+struct intif_interface {
+ /* funcs */
+
+
+ int (*parse) (int fd);
+
+ int (*create_pet)(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id,
+ short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name);
+
+ int (*broadcast) (const char* mes, int len, int type);
+ int (*broadcast2) (const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY);
+ int (*main_message) (struct map_session_data* sd, const char* message);
+
+ int (*wis_message) (struct map_session_data *sd,char *nick,char *mes,int mes_len);
+ int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes);
+
+ int (*saveregistry) (struct map_session_data *sd, int type);
+ int (*request_registry) (struct map_session_data *sd, int flag);
+
+ int (*request_guild_storage) (int account_id, int guild_id);
+ int (*send_guild_storage) (int account_id, struct guild_storage *gstor);
+
+ int (*create_party) (struct party_member *member,char *name,int item,int item2);
+ int (*request_partyinfo) (int party_id, int char_id);
+
+ int (*party_addmember) (int party_id,struct party_member *member);
+ int (*party_changeoption) (int party_id, int account_id, int exp, int item);
+ int (*party_leave) (int party_id,int account_id, int char_id);
+ int (*party_changemap) (struct map_session_data *sd, int online);
+ int (*break_party) (int party_id);
+ int (*party_message) (int party_id, int account_id, const char *mes,int len);
+ int (*party_leaderchange) (int party_id,int account_id,int char_id);
+
+ int (*guild_create) (const char *name, const struct guild_member *master);
+ int (*guild_request_info) (int guild_id);
+ int (*guild_addmember) (int guild_id, struct guild_member *m);
+ int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes);
+ int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class_);
+ int (*guild_break) (int guild_id);
+ int (*guild_message) (int guild_id, int account_id, const char *mes, int len);
+ int (*guild_change_gm) (int guild_id, const char* name, int len);
+ int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len);
+ int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len);
+ int (*guild_position) (int guild_id, int idx, struct guild_position *p);
+ int (*guild_skillup) (int guild_id, uint16 skill_id, int account_id, int max);
+ int (*guild_alliance) (int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
+ int (*guild_notice) (int guild_id, const char *mes1, const char *mes2);
+ int (*guild_emblem) (int guild_id, int len, const char *data);
+ int (*guild_castle_dataload) (int num, int *castle_ids);
+ int (*guild_castle_datasave) (int castle_id, int index, int value);
+ int (*request_petdata) (int account_id, int char_id, int pet_id);
+ int (*save_petdata) (int account_id, struct s_pet *p);
+ int (*delete_petdata) (int pet_id);
+ int (*rename) (struct map_session_data *sd, int type, char *name);
+ int (*homunculus_create) (int account_id, struct s_homunculus *sh);
+ bool (*homunculus_requestload) (int account_id, int homun_id);
+ int (*homunculus_requestsave) (int account_id, struct s_homunculus* sh);
+ int (*homunculus_requestdelete) (int homun_id);
+ /******QUEST SYTEM*******/
+ int (*request_questlog) (struct map_session_data * sd);
+ int (*quest_save) (struct map_session_data * sd);
+ // MERCENARY SYSTEM
+ int (*mercenary_create) (struct s_mercenary *merc);
+ int (*mercenary_request) (int merc_id, int char_id);
+ int (*mercenary_delete) (int merc_id);
+ int (*mercenary_save) (struct s_mercenary *merc);
+ // MAIL SYSTEM
+ int (*Mail_requestinbox) (int char_id, unsigned char flag);
+ int (*Mail_read) (int mail_id);
+ int (*Mail_getattach) (int char_id, int mail_id);
+ int (*Mail_delete) (int char_id, int mail_id);
+ int (*Mail_return) (int char_id, int mail_id);
+ int (*Mail_send) (int account_id, struct mail_message *msg);
+ // AUCTION SYSTEM
+ int (*Auction_requestlist) (int char_id, short type, int price, const char* searchtext, short page);
+ int (*Auction_register) (struct auction_data *auction);
+ int (*Auction_cancel) (int char_id, unsigned int auction_id);
+ int (*Auction_close) (int char_id, unsigned int auction_id);
+ int (*Auction_bid) (int char_id, const char* name, unsigned int auction_id, int bid);
+ // ELEMENTAL SYSTEM
+ int (*elemental_create) (struct s_elemental *ele);
+ int (*elemental_request) (int ele_id, int char_id);
+ int (*elemental_delete) (int ele_id);
+ int (*elemental_save) (struct s_elemental *ele);
+ /* @accinfo */
+ void (*request_accinfo) (int u_fd, int aid, int group_lv, char* query);
+
+ int (*CheckForCharServer) (void);
+} intif_s;
+
+struct intif_interface *intif;
+
+void intif_defaults(void);
+
+#endif /* _INTIF_H_ */
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 4e4851bc5..e3043a668 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -33,4 +33,4 @@ if( INSTALL_COMPONENT_RUNTIME )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} sample CACHE INTERNAL "" )
message( STATUS "Creating target sample - done" )
-endif( BUILD_PLUGIN_sample ) \ No newline at end of file
+endif( BUILD_PLUGIN_sample )
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 5cb8d52a2..ebd2a9ee5 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -135,4 +135,4 @@ HPExport void plugin_init (void) {
strlib = GET_SYMBOL("strlib");
HPMi->addCPCommand("server:tools:db2sql",CPCMD_A(db2sql));
-} \ No newline at end of file
+}
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index 4a8402560..4f9e34f74 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -141,4 +141,4 @@ HPExport void server_online (void) {
/* run when server is shutting down */
HPExport void plugin_final (void) {
ShowInfo ("%s says ~Bye world\n",pinfo.name);
-} \ No newline at end of file
+}
diff --git a/tools/mapreg-converter.php b/tools/mapreg-converter.php
index 3d548554a..ef5cc791c 100644
--- a/tools/mapreg-converter.php
+++ b/tools/mapreg-converter.php
@@ -35,4 +35,4 @@
}
fprintf(STDERR, "done.".PHP_EOL);
-?> \ No newline at end of file
+?>