summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Hercules.xcodeproj/project.pbxproj14
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme2
-rw-r--r--Makefile.in2
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--db/constants.conf7
-rw-r--r--db/pre-re/item_db.conf10
-rw-r--r--db/quest_db.conf9
-rw-r--r--db/re/item_db.conf149
-rw-r--r--doc/constants.md9
-rw-r--r--doc/script_commands.txt65
-rw-r--r--npc/battleground/flavius/flavius01.txt8
-rw-r--r--npc/battleground/flavius/flavius02.txt8
-rw-r--r--npc/battleground/tierra/tierra01.txt20
-rw-r--r--npc/battleground/tierra/tierra02.txt20
-rw-r--r--npc/cities/jawaii.txt11
-rw-r--r--npc/cities/umbala.txt4
-rw-r--r--npc/custom/battleground/bg_tierra_01.txt6
-rw-r--r--npc/custom/battleground/bg_tierra_02.txt6
-rw-r--r--npc/custom/bgqueue/flavius.txt12
-rw-r--r--npc/custom/etc/marriage.txt6
-rw-r--r--npc/custom/etc/monster_arena.txt3
-rw-r--r--npc/custom/etc/rpsroulette.txt3
-rw-r--r--npc/custom/events/cluckers.txt14
-rw-r--r--npc/custom/item_signer.txt2
-rw-r--r--npc/custom/itembind.txt4
-rw-r--r--npc/custom/quests/hunting_missions.txt12
-rw-r--r--npc/custom/woe_controller.txt2
-rw-r--r--npc/events/gdevent_aru.txt6
-rw-r--r--npc/events/gdevent_sch.txt6
-rw-r--r--npc/events/god_se_festival.txt4
-rw-r--r--npc/events/nguild/nguild_dunsw.txt2
-rw-r--r--npc/events/nguild/nguild_ev_agit.txt2
-rw-r--r--npc/events/nguild/nguild_flags.txt4
-rw-r--r--npc/events/nguild/nguild_kafras.txt2
-rw-r--r--npc/events/nguild/nguild_managers.txt2
-rw-r--r--npc/events/nguild/nguild_warper.txt34
-rw-r--r--npc/instances/EndlessTower.txt4
-rw-r--r--npc/instances/NydhoggsNest.txt10
-rw-r--r--npc/instances/OrcsMemory.txt6
-rw-r--r--npc/instances/SealedShrine.txt26
-rw-r--r--npc/jobs/2-1/assassin.txt2
-rw-r--r--npc/kafras/functions_kafras.txt2
-rw-r--r--npc/other/CashShop_Functions.txt6
-rw-r--r--npc/other/arena/arena_party.txt8
-rw-r--r--npc/other/divorce.txt3
-rw-r--r--npc/other/marriage.txt10
-rw-r--r--npc/other/poring_war.txt24
-rw-r--r--npc/quests/eye_of_hellion.txt10
-rw-r--r--npc/quests/guildrelay.txt14
-rw-r--r--npc/quests/okolnir.txt8
-rw-r--r--npc/quests/partyrelay.txt30
-rw-r--r--npc/quests/quests_13_1.txt2
-rw-r--r--npc/quests/quests_ayothaya.txt2
-rw-r--r--npc/quests/quests_louyang.txt10
-rw-r--r--npc/quests/quests_morocc.txt8
-rw-r--r--npc/quests/quests_moscovia.txt16
-rw-r--r--npc/quests/quests_nameless.txt2
-rw-r--r--npc/quests/seals/god_weapon_creation.txt4
-rw-r--r--npc/quests/seals/megingard_seal.txt7
-rw-r--r--npc/quests/the_sign_quest.txt9
-rw-r--r--npc/re/cities/malaya.txt4
-rw-r--r--npc/re/instances/BakonawaLake.txt8
-rw-r--r--npc/re/instances/BangungotHospital.txt14
-rw-r--r--npc/re/instances/BuwayaCave.txt6
-rw-r--r--npc/re/instances/EclageInterior.txt8
-rw-r--r--npc/re/instances/HazyForest.txt6
-rw-r--r--npc/re/instances/MalangdoCulvert.txt14
-rw-r--r--npc/re/instances/OldGlastHeim.txt36
-rw-r--r--npc/re/instances/WolfchevLaboratory.txt14
-rw-r--r--npc/re/instances/ghost_palace.txt14
-rw-r--r--npc/re/instances/octopus_cave.txt6
-rw-r--r--npc/re/instances/saras_memory.txt36
-rw-r--r--npc/re/quests/eden/100-110.txt4
-rw-r--r--npc/re/quests/eden/11-25.txt2
-rw-r--r--npc/re/quests/eden/111-120.txt2
-rw-r--r--npc/re/quests/eden/121-130.txt4
-rw-r--r--npc/re/quests/eden/131-140.txt2
-rw-r--r--npc/re/quests/eden/26-40.txt2
-rw-r--r--npc/re/quests/eden/41-55.txt2
-rw-r--r--npc/re/quests/eden/56-70.txt2
-rw-r--r--npc/re/quests/eden/71-85.txt2
-rw-r--r--npc/re/quests/eden/86-90.txt2
-rw-r--r--npc/re/quests/eden/91-99.txt2
-rw-r--r--npc/re/quests/eden/eden_common.txt28
-rw-r--r--npc/re/quests/eden/eden_quests.txt24
-rw-r--r--npc/re/quests/eden/eden_service.txt2
-rw-r--r--npc/re/warps/cities/izlude.txt35
-rw-r--r--npc/re/woe-fe/invest_main.txt6
-rw-r--r--npc/woe-fe/agit_main.txt8
-rw-r--r--npc/woe-fe/aldeg_cas01.txt4
-rw-r--r--npc/woe-fe/aldeg_cas02.txt4
-rw-r--r--npc/woe-fe/aldeg_cas03.txt4
-rw-r--r--npc/woe-fe/aldeg_cas04.txt4
-rw-r--r--npc/woe-fe/aldeg_cas05.txt4
-rw-r--r--npc/woe-fe/gefg_cas01.txt4
-rw-r--r--npc/woe-fe/gefg_cas02.txt4
-rw-r--r--npc/woe-fe/gefg_cas03.txt4
-rw-r--r--npc/woe-fe/gefg_cas04.txt4
-rw-r--r--npc/woe-fe/gefg_cas05.txt4
-rw-r--r--npc/woe-fe/payg_cas01.txt4
-rw-r--r--npc/woe-fe/payg_cas02.txt4
-rw-r--r--npc/woe-fe/payg_cas03.txt4
-rw-r--r--npc/woe-fe/payg_cas04.txt4
-rw-r--r--npc/woe-fe/payg_cas05.txt4
-rw-r--r--npc/woe-fe/prtg_cas01.txt4
-rw-r--r--npc/woe-fe/prtg_cas02.txt4
-rw-r--r--npc/woe-fe/prtg_cas03.txt4
-rw-r--r--npc/woe-fe/prtg_cas04.txt4
-rw-r--r--npc/woe-fe/prtg_cas05.txt4
-rw-r--r--npc/woe-se/agit_main_se.txt20
-rw-r--r--sql-files/item_db.sql12
-rw-r--r--sql-files/item_db2.sql2
-rw-r--r--sql-files/item_db_re.sql57
-rw-r--r--src/char/char.c6
-rw-r--r--src/common/HPM.c51
-rw-r--r--src/common/HPMSymbols.inc.h6
-rw-r--r--src/common/HPMi.h1
-rw-r--r--src/common/console.c43
-rw-r--r--src/common/core.c39
-rw-r--r--src/common/db.c25
-rw-r--r--src/common/db.h17
-rw-r--r--src/common/des.c7
-rw-r--r--src/common/ers.c16
-rw-r--r--src/common/grfio.c24
-rw-r--r--src/common/mapindex.c35
-rw-r--r--src/common/memmgr.h4
-rw-r--r--src/common/mutex.c12
-rw-r--r--src/common/socket.c35
-rw-r--r--src/common/sql.c20
-rw-r--r--src/common/strlib.c1
-rw-r--r--src/common/sysinfo.c84
-rw-r--r--src/common/timer.c4
-rw-r--r--src/common/utils.c29
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/clif.c55
-rw-r--r--src/map/path.c2
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/status.c10
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc30
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc57
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc15
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc373
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.sources.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc57
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc15
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc373
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.sources.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc57
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc15
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc373
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.sources.inc1
-rwxr-xr-xtools/HPMHookGen/HPMHookGen.pl3
161 files changed, 998 insertions, 2086 deletions
diff --git a/Hercules.xcodeproj/project.pbxproj b/Hercules.xcodeproj/project.pbxproj
index 66d46e7f5..fc7aa8dc4 100644
--- a/Hercules.xcodeproj/project.pbxproj
+++ b/Hercules.xcodeproj/project.pbxproj
@@ -1075,7 +1075,7 @@
A56CC652185642B4009EB79C /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0710;
+ LastUpgradeCheck = 0800;
ORGANIZATIONNAME = herc.ws;
};
buildConfigurationList = A56CC655185642B4009EB79C /* Build configuration list for PBXProject "Hercules" */;
@@ -1503,13 +1503,18 @@
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)";
COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_FAST_MATH = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -1522,6 +1527,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_CHECK_SWITCH_STATEMENTS = NO;
GCC_WARN_SHADOW = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -1588,19 +1594,25 @@
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_FAST_MATH = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
GCC_STRICT_ALIASING = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_CHECK_SWITCH_STATEMENTS = NO;
GCC_WARN_SHADOW = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme
index 8fc8f9cbb..5aa519349 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme
index 6ce9de3a6..52ae334ba 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme
index a62507de0..ce5cd9554 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme
index a64514c1d..40648c0dc 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme
index 603e02228..37f127142 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme
index 82cd4764d..1e14dc985 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme
index 30cc2a2e3..115168afc 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme
index 756fb2794..f437d0718 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme
index 49d1cc5e8..02924f4b2 100644
--- a/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme
+++ b/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0710"
+ LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
diff --git a/Makefile.in b/Makefile.in
index be7ae674f..3de5e0bf3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -80,7 +80,7 @@ all: $(ALL_DEPENDS)
sql: $(SQL_DEPENDS)
-$(MF_TARGETS): %: %.in
+$(MF_TARGETS): %: %.in config.status
@echo " CONFIGURE"
@if [ -x config.status ]; then \
echo "Reconfiguring with options: $$(./config.status --config)"; \
diff --git a/configure b/configure
index 9fe0c9d5b..1d03a0b1f 100755
--- a/configure
+++ b/configure
@@ -3454,7 +3454,7 @@ case $host_os in
CYGWIN*)
;;
*)
- if type id >/dev/null 2>&1; then
+ if type id >/dev/null 2>&1 && test -n "$CI"; then
euid="`id -u`"
if test "$euid" == "0"; then
echo ""
diff --git a/configure.ac b/configure.ac
index 6cad8146c..10692f957 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ case $host_os in
CYGWIN*)
;;
*)
- if type id >/dev/null 2>&1; then
+ if type id >/dev/null 2>&1 && test -n "$CI"; then
euid="`id -u`"
if test "$euid" == "0"; then
echo ""
diff --git a/db/constants.conf b/db/constants.conf
index a044aee7d..c22435a36 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3656,6 +3656,13 @@ constants_db: {
NPC_NAME_HIDDEN: 2
NPC_NAME_UNIQUE: 3
NPC_MAP: 4
+
+ comment__: "getcharid"
+ CHAR_ID_CHAR: 0
+ CHAR_ID_PARTY: 1
+ CHAR_ID_GUILD: 2
+ CHAR_ID_ACCOUNT: 3
+ CHAR_ID_BG: 4
comment__: "sc_start"
SCFLAG_NONE: 0x00
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf
index 1ba177d18..4ba5719a4 100644
--- a/db/pre-re/item_db.conf
+++ b/db/pre-re/item_db.conf
@@ -93445,7 +93445,7 @@ item_db: (
Name: "Chemical Protection Helm Scroll"
Type: 2
Weight: 10
- Script: <" unitskilluseid getcharid(3),237,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5; ">
},
{
Id: 14518
@@ -93453,7 +93453,7 @@ item_db: (
Name: "Chemical Protection Shield Scrol"
Type: 2
Weight: 10
- Script: <" unitskilluseid getcharid(3),235,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5; ">
},
{
Id: 14519
@@ -93461,7 +93461,7 @@ item_db: (
Name: "Chemical Protection Armor Scroll"
Type: 2
Weight: 10
- Script: <" unitskilluseid getcharid(3),236,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5; ">
},
{
Id: 14520
@@ -93469,7 +93469,7 @@ item_db: (
Name: "Chemical Protection Weapon Scroll"
Type: 2
Weight: 10
- Script: <" unitskilluseid getcharid(3),234,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5; ">
},
{
Id: 14521
@@ -93489,7 +93489,7 @@ item_db: (
Nouse: {
sitting: true
}
- Script: <" unitskilluseid getcharid(3),108,1; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1; ">
},
{
Id: 14522
diff --git a/db/quest_db.conf b/db/quest_db.conf
index 67012bd8e..015692b07 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -4354,10 +4354,12 @@ quest_db: (
{
Id: 7104
Name: "Special task of an assassin guild 4"
+ TimeLimit: 3000
},
{
Id: 7105
Name: "Special task of an assassin guild 4"
+ TimeLimit: 600
},
{
Id: 7106
@@ -4378,6 +4380,13 @@ quest_db: (
{
Id: 7110
Name: "Special task of an assassin guild 9"
+ TimeLimit: 600
+ Targets: (
+ {
+ MobId: 2030
+ Count: 1
+ },
+ )
},
{
Id: 7111
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 41a44c2ee..34136aa5c 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -25183,9 +25183,8 @@ item_db: (
EquipLv: 65
View: 3
Script: <"
- bonus2 bAddRaceTolerance,RC_Undead,5;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,-5;
- bonus2 bAddRaceTolerance,RC_Player,-5;
+ bonus2 bAddRaceTolerance, RC_Undead, 5;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, -5;
">
},
{
@@ -60141,11 +60140,9 @@ item_db: (
noauction: true
}
Script: <"
- bonus bAspdRate,10;
- bonus2 bAddRace,RC_DemiPlayer,5;
- bonus2 bAddRace,RC_Player,5;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
+ bonus bAspdRate, 10;
+ bonus2 bAddRace, RC_DemiPlayer, 5;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;
">
},
{
@@ -60170,11 +60167,9 @@ item_db: (
noauction: true
}
Script: <"
- bonus bAspdRate,7;
- bonus2 bAddRace,RC_DemiPlayer,3;
- bonus2 bAddRace,RC_Player,3;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,7;
- bonus2 bAddRaceTolerance,RC_Player,7;
+ bonus bAspdRate, 7;
+ bonus2 bAddRace, RC_DemiPlayer, 3;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 7;
">
},
{
@@ -60199,11 +60194,9 @@ item_db: (
noauction: true
}
Script: <"
- bonus bAspdRate,5;
- bonus2 bAddRace,RC_DemiPlayer,1;
- bonus2 bAddRace,RC_Player,1;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,5;
- bonus2 bAddRaceTolerance,RC_Player,5;
+ bonus bAspdRate, 5;
+ bonus2 bAddRace, RC_DemiPlayer, 1;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;
">
},
{
@@ -62408,10 +62401,8 @@ item_db: (
Refine: false
View: 559
Script: <"
- bonus2 bAddRace,RC_DemiPlayer,5;
- bonus2 bAddRace,RC_Player,5;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,5;
- bonus2 bAddRaceTolerance,RC_Player,5;
+ bonus2 bAddRace, RC_DemiPlayer, 5;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;
">
},
{
@@ -65567,11 +65558,10 @@ item_db: (
Loc: 256
View: 639
Script: <"
- bonus bAllStats,1;
- bonus bMdef,5;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,2;
- bonus2 bAddRaceTolerance,RC_Player,2;
- bonus2 bAddRaceTolerance,RC_Brute,2;
+ bonus bAllStats, 1;
+ bonus bMdef, 5;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 2;
+ bonus2 bAddRaceTolerance, RC_Brute, 2;
">
},
{
@@ -65726,10 +65716,7 @@ item_db: (
Loc: 256
EquipLv: 95
View: 651
- Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
- ">
+ Script: <" bonus2 bAddRaceTolerance, RC_DemiPlayer, 10; ">
},
{
Id: 5773
@@ -65742,10 +65729,7 @@ item_db: (
Loc: 256
EquipLv: 95
View: 652
- Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
- ">
+ Script: <" bonus2 bAddRaceTolerance, RC_DemiPlayer, 10; ">
},
{
Id: 5774
@@ -65758,10 +65742,7 @@ item_db: (
Loc: 256
EquipLv: 95
View: 496
- Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
- ">
+ Script: <" bonus2 bAddRaceTolerance, RC_DemiPlayer, 10; ">
},
{
Id: 5775
@@ -65861,9 +65842,8 @@ item_db: (
Loc: 256
View: 658
Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
- skill WZ_EARTHSPIKE,3;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;
+ skill WZ_EARTHSPIKE, 3;
">
},
{
@@ -120572,7 +120552,7 @@ item_db: (
nomail: true
noauction: true
}
- Script: <" unitskilluseid getcharid(3),237,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5; ">
},
{
Id: 14518
@@ -120589,7 +120569,7 @@ item_db: (
nomail: true
noauction: true
}
- Script: <" unitskilluseid getcharid(3),235,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5; ">
},
{
Id: 14519
@@ -120606,7 +120586,7 @@ item_db: (
nomail: true
noauction: true
}
- Script: <" unitskilluseid getcharid(3),236,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5; ">
},
{
Id: 14520
@@ -120623,7 +120603,7 @@ item_db: (
nomail: true
noauction: true
}
- Script: <" unitskilluseid getcharid(3),234,5; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5; ">
},
{
Id: 14521
@@ -120643,7 +120623,7 @@ item_db: (
Nouse: {
sitting: true
}
- Script: <" unitskilluseid getcharid(3),108,1; ">
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1; ">
},
{
Id: 14522
@@ -132439,10 +132419,9 @@ item_db: (
Refine: false
View: 781
Script: <"
- bonus bMdef,5;
- bonus bMaxHPrate,2;
- bonus2 bAddRace,RC_DemiPlayer,5;
- bonus2 bAddRace,RC_Player,5;
+ bonus bMdef, 5;
+ bonus bMaxHPrate, 2;
+ bonus2 bAddRace, RC_DemiPlayer, 5;
">
},
{
@@ -132475,11 +132454,10 @@ item_db: (
EquipLv: 70
View: 784
Script: <"
- bonus2 bAddRace,RC_DemiPlayer,10;
- bonus2 bAddRace,RC_Player,10;
- bonus2 bAddRace,RC_Demon,10;
- if(getrefine()>6) {
- autobonus "{ bonus bAspdRate,100; }",10,7000,0,"{ specialeffect2 EF_POTION_BERSERK; }";
+ bonus2 bAddRace, RC_DemiPlayer, 10;
+ bonus2 bAddRace, RC_Demon, 10;
+ if(getrefine() > 6) {
+ autobonus "{ bonus bAspdRate, 100; }", 10, 7000, 0, "{ specialeffect2 EF_POTION_BERSERK; }";
}
">
},
@@ -132721,9 +132699,8 @@ item_db: (
Loc: 256
View: 798
Script: <"
- bonus bInt,1;
- bonus2 bAddRace,RC_DemiPlayer,5;
- bonus2 bAddRace,RC_Player,5;
+ bonus bInt, 1;
+ bonus2 bAddRace, RC_DemiPlayer, 5;
">
},
{
@@ -134405,10 +134382,9 @@ item_db: (
Loc: 256
View: 224
Script: <"
- bonus bMdef,1;
- bonus bUnbreakableHelm,0;
- bonus2 bAddRaceTolerance,RC_DemiPlayer,10;
- bonus2 bAddRaceTolerance,RC_Player,10;
+ bonus bMdef, 1;
+ bonus bUnbreakableHelm, 0;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;
">
},
{
@@ -136014,9 +135990,8 @@ item_db: (
Loc: 256
View: 957
Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,5;
- bonus2 bAddRaceTolerance,RC_Player,5;
- if (getrefine()>7) { bonus bMaxHPrate,getrefine()-7; }
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;
+ if (getrefine() > 7) { bonus bMaxHPrate, getrefine()-7; }
">
},
{
@@ -136047,9 +136022,9 @@ item_db: (
Refine: false
View: 959
Script: <"
- bonus bUnbreakableHelm,0;
- bonus bMaxSPrate,3;
- autobonus2 "{ bonus2 bAddRaceTolerance,RC_DemiPlayer,100; bonus2 bAddRaceTolerance,RC_Player,100; }",10,3000,BF_WEAPON|BF_MAGIC,"{ specialeffect2 EF_POTION_BERSERK; }";
+ bonus bUnbreakableHelm, 0;
+ bonus bMaxSPrate, 3;
+ autobonus2 "{ bonus2 bAddRaceTolerance, RC_DemiPlayer, 100; }", 10, 3000, BF_WEAPON|BF_MAGIC, "{ specialeffect2 EF_POTION_BERSERK; }";
">
},
{
@@ -136483,13 +136458,12 @@ item_db: (
EquipLv: 10
View: 1018
Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,8;
- bonus2 bAddRaceTolerance,RC_Player,8;
- bonus2 bAddRaceTolerance,RC_Dragon,8;
- bonus2 bAddItemHealRate,517,200;
- if(getrefine()>11) {
- bonus bMaxHPrate,7;
- bonus bMaxSPrate,3;
+ bonus2 bAddRaceTolerance, RC_DemiPlayer, 8;
+ bonus2 bAddRaceTolerance, RC_Dragon, 8;
+ bonus2 bAddItemHealRate, 517, 200;
+ if(getrefine() > 11) {
+ bonus bMaxHPrate, 7;
+ bonus bMaxSPrate, 3;
}
">
},
@@ -136504,10 +136478,7 @@ item_db: (
EquipLv: 70
Refine: false
View: 1019
- Script: <"
- bonus2 bAddRaceTolerance,RC_DemiPlayer,5;
- bonus2 bAddRaceTolerance,RC_Player,5;
- ">
+ Script: <" bonus2 bAddRaceTolerance, RC_DemiPlayer, 5; ">
},
{
Id: 18895
@@ -146137,6 +146108,24 @@ item_db: (
//== New Etc Items =========================================
{
+ Id: 22508
+ AegisName: "Para_Team_Mark_"
+ Name: "Eden Group Mark"
+ Type: 11
+ Delay: 1200000
+ Trade: {
+ nodrop: true
+ notrade: true
+ noselltonpc: true
+ nocart: true
+ nostorage: true
+ nogstorage: true
+ nomail: true
+ noauction: true
+ }
+ Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT), "AL_TELEPORT", 3; ">
+},
+{
Id: 22514
AegisName: "Candy_Holder"
Name: "Candy Holder"
diff --git a/doc/constants.md b/doc/constants.md
index c85e328d0..7bfcede27 100644
--- a/doc/constants.md
+++ b/doc/constants.md
@@ -3571,6 +3571,14 @@
- `NPC_NAME_UNIQUE`: 3
- `NPC_MAP`: 4
+### getcharid
+
+- `CHAR_ID_CHAR`: 0
+- `CHAR_ID_PARTY`: 1
+- `CHAR_ID_GUILD`: 2
+- `CHAR_ID_ACCOUNT`: 3
+- `CHAR_ID_BG`: 4
+
### sc_start
- `SCFLAG_NONE`: 0
@@ -16328,6 +16336,7 @@
- `Tarlock's_Boots`: 22047
- `Egir_Shoes_K`: 22059
- `Witch_Shoes`: 22067
+- `Para_Team_Mark_`: 22508
- `Candy_Holder`: 22514
- `Twisted_Key_of_Time`: 22515
- `Runstone_Lux`: 22540
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index eb7e0cd9d..9777038a4 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -2466,11 +2466,11 @@ or, if a character name is specified, of that player.
Type is the kind of associated ID number required:
- 0 - Character ID number.
- 1 - Party ID number.
- 2 - Guild ID number.
- 3 - Account ID number.
- 4 - Battle ground ID
+(0) CHAR_ID_CHAR - Character ID number.
+(1) CHAR_ID_PARTY - Party ID number.
+(2) CHAR_ID_GUILD - Guild ID number.
+(3) CHAR_ID_ACCOUNT - Account ID number.
+(4) CHAR_ID_BG - Battle ground ID
For most purposes other than printing it, a number is better to have than
a name (people do horrifying things to their character names).
@@ -2479,12 +2479,12 @@ If the character is not in a party or not in a guild, the function will
return 0 if guild or party number is requested. If a name is specified and
the character is not found, 0 is returned.
-If getcharid(0) returns a zero, the script got called not by a character
+If getcharid(CHAR_ID_CHAR) returns a zero, the script got called not by a character
and doesn't have an attached RID. Note that this will cause the map server
to print "player not attached!" error messages, so it is preferred to use
playerattached() to check for the character attached to the script.
- if (getcharid(2) == 0)
+ if (getcharid(CHAR_ID_GUILD) == 0)
mes("Only members of a guild are allowed here!");
---------------------------------------
@@ -2588,7 +2588,7 @@ return 7 in this case.
Example 1: list party member names
// get the party member names
- getpartymember(getcharid(1), 0);
+ getpartymember(getcharid(CHAR_ID_PARTY), 0);
// It's a good idea to copy the global temporary $@partymember*****
// variables to your own scope variables because if you have pauses in
@@ -2610,8 +2610,8 @@ Example 2: check party count (with a next() pause), before warping to event
.register_num = 5; // How many party members are required?
// get the charID and accountID of character's party members
- getpartymember(getcharid(1), 1);
- getpartymember(getcharid(1), 2);
+ getpartymember(getcharid(CHAR_ID_PARTY), 1);
+ getpartymember(getcharid(CHAR_ID_PARTY), 2);
if ($@partymembercount != .register_num) {
mes("Please form a party of "+ .register_num +" to continue");
@@ -2645,7 +2645,7 @@ Example 2: check party count (with a next() pause), before warping to event
// party. To prevent this, we call getpartymember again and compare
// with the original values.
- getpartymember(getcharid(1), 1);
+ getpartymember(getcharid(CHAR_ID_PARTY), 1);
if ($@partymembercount != .register_num) {
mes("You've made changes to your party !");
close();
@@ -2658,7 +2658,7 @@ Example 2: check party count (with a next() pause), before warping to event
}
// Finally, it's safe to start the event!
- warpparty("event_map", 0, 0, getcharid(1));
+ warpparty("event_map", 0, 0, getcharid(CHAR_ID_PARTY));
---------------------------------------
@@ -3377,7 +3377,7 @@ guild.
Maybe you want to make a room only guild masters can enter:
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (.@GID == 0) {
mes("Sorry you are not in a guild");
close();
@@ -3476,7 +3476,7 @@ Returns the amount of characters from the specified guild on the given map.
Example:
- mes("You have "+getmapguildusers("prontera", getcharid(2))+" guild members in Prontera.");
+ mes("You have "+getmapguildusers("prontera", getcharid(CHAR_ID_GUILD))+" guild members in Prontera.");
---------------------------------------
@@ -4251,8 +4251,8 @@ See also warp().
*warpparty("<to_mapname>", <x>, <y>, <party_id>, {"<from_mapname>"})
Warps a party to specified map and coordinate given the party ID, which
-you can get with getcharid(1). You can also request another party id given
-a member's name with getcharid(1, <player_name>).
+you can get with getcharid(CHAR_ID_PARTY). You can also request another party id given
+a member's name with getcharid(CHAR_ID_PARTY, <player_name>).
You can use the following "map names" for special warping behavior:
Random: All party members are randomly warped in their current map
@@ -4273,7 +4273,7 @@ Example:
mes("[Party Warper]");
mes("Here you go!");
close2();
- .@id = getcharid(1);
+ .@id = getcharid(CHAR_ID_PARTY);
warpparty("prontera", 150, 100, .@id);
close();
@@ -4282,7 +4282,7 @@ Example:
*warpchar("<mapname>", <x>, <y>, <char_id>)
Warps another player to specified map and coordinate given the char id,
-which you can get with getcharid(0, <player_name>). Obviously this is
+which you can get with getcharid(CHAR_ID_CHAR, <player_name>). Obviously this is
useless if you want to warp the same player that is executing this script,
unless it's some kind of "chosen" script.
@@ -4295,8 +4295,8 @@ Example:
*warpguild("<mapname>", <x>, <y>, <guild_id>)
Warps a guild to specified map and coordinate given the guild id, which
-you can get with getcharid(2). You can also request another guild id given
-the member's name with getcharid(2, <player_name>).
+you can get with getcharid(CHAR_ID_GUILD). You can also request another guild id given
+the member's name with getcharid(CHAR_ID_GUILD, <player_name>).
You can use the following "map names" for special warping behavior:
Random: All guild members are randomly warped in their current map
@@ -4611,6 +4611,7 @@ Here are the possible look types:
10 - LOOK_BODY Body(N/A)
11 - LOOK_FLOOR FLOOR(N/A)
12 - LOOK_ROBE Robe
+ 13 - LOOK_BODY2 Body style
Whatever 'shoes' means is anyone's guess, ask Gravity - the client does
nothing with this value. It still wants it from the server though, so it
@@ -4748,7 +4749,7 @@ like this. Careful, minor magic ahead.
// item. Only an existing character's name may be there.
// Let's assume our character is 'Adam' and find his ID.
- .@charid = getcharid(0, "Adam");
+ .@charid = getcharid(CHAR_ID_CHAR, "Adam");
// Now we split the character ID number into two portions with a
// binary shift operation. If you don't understand what this does,
@@ -5902,10 +5903,10 @@ Examples:
// This will make Aaron follow Bullah, when both of these characters are
// online.
- pcfollow(getcharid(3, "Aaron"), getcharid(3, "Bullah"));
+ pcfollow(getcharid(CHAR_ID_ACCOUNT, "Aaron"), getcharid(CHAR_ID_ACCOUNT, "Bullah"));
// Makes Aaron stop following whoever he is following.
- pcstopfollow(getcharid(3, "Aaron"));
+ pcstopfollow(getcharid(CHAR_ID_ACCOUNT, "Aaron"));
---------------------------------------
@@ -5919,10 +5920,10 @@ player if zero is supplied.
Examples:
// Prevents the current char from moving away.
- pcblockmove(getcharid(3), true);
+ pcblockmove(getcharid(CHAR_ID_ACCOUNT), true);
// Enables the current char to move again.
- pcblockmove(getcharid(3), false);
+ pcblockmove(getcharid(CHAR_ID_ACCOUNT), false);
---------------------------------------
@@ -5983,7 +5984,7 @@ For example:
// We'll make a poring which will automatically attack invoking player:
.@mobGID = monster("prontera", 150, 150, "Poring", PORING, 1); // PORING is defined in the mob db and its value is 1002
- unitattack(.@mobGID, getcharid(3)); // Attacker GID, attacked GID
+ unitattack(.@mobGID, getcharid(CHAR_ID_ACCOUNT)); // Attacker GID, attacked GID
The way you can get the GID of more than only one monster is looping
through all the summons to get their individual GIDs and do whatever you
@@ -6273,7 +6274,7 @@ Examples:
unitwalk(.GID, 150, 150);
//NPC will move towards the attached player.
- unitwalk(.GID, getcharid(3));//a player's GID is their account ID
+ unitwalk(.GID, getcharid(CHAR_ID_ACCOUNT));//a player's GID is their account ID
---------------------------------------
@@ -8519,7 +8520,7 @@ ID this command returns.
Example:
// Store the Party ID of the invoking character.
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
// Attempt to create an instance using that party ID.
.@id = instance_create("Endless Tower", .@party_id);
@@ -8662,7 +8663,7 @@ max - maximum level of all characters in the party (default is max
Example:
-if (instance_check_party(getcharid(1), 2, 2, 149)) {
+if (instance_check_party(getcharid(CHAR_ID_PARTY), 2, 2, 149)) {
mes("Your party meets the Memorial Dungeon requirements.");
mes("All online members are between levels 1-150 and at least two are online.");
close();
@@ -8683,7 +8684,7 @@ min - minimum level of all characters in the guild (default is 1).
max - maximum level of all characters in the guild (default is max level in conf).
Example:
- if (instance_check_guild(getcharid(2), 2, 1, 150)) {
+ if (instance_check_guild(getcharid(CHAR_ID_GUILD), 2, 1, 150)) {
mes("Your guild meets the Memorial Dungeon requirements.");
mes("All online members are between levels 1-150 and at least two are online.");
close();
@@ -8907,10 +8908,10 @@ Example:
*bg_team_setxy(<Battle Group ID>, <x>, <y>)
Update the respawn point of the given battle group to x, y on the same
-map. The <Battle Group ID> can be retrieved using getcharid(4).
+map. The <Battle Group ID> can be retrieved using getcharid(CHAR_ID_BG).
Example:
- bg_team_setxy(getcharid(4), 56, 212);
+ bg_team_setxy(getcharid(CHAR_ID_BG), 56, 212);
mapannounce("bat_a01", "Group [1] has taken the work shop, and will now respawn there.", bc_map, 0xFFCE00);
end;
diff --git a/npc/battleground/flavius/flavius01.txt b/npc/battleground/flavius/flavius01.txt
index 681786792..8370f1e53 100644
--- a/npc/battleground/flavius/flavius01.txt
+++ b/npc/battleground/flavius/flavius01.txt
@@ -405,7 +405,7 @@ OnTouch:
}
bat_b01,10,294,3 script Guillaume Vintenar#b01_a 4_M_RASWORD,{
- if ($@FlaviusBG1_id1 == getcharid(4)) {
+ if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG1_Victory == 1) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -457,7 +457,7 @@ OnInit:
}
bat_b01,389,14,3 script Croix Vintenar#b01_b 4_M_RASWORD,{
- if ($@FlaviusBG1_id2 == getcharid(4)) {
+ if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG1_Victory == 2) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -590,7 +590,7 @@ bat_b01,389,16,3 script Croix Camp#flag31 1_FLAG_EAGLE,{ end; }
bat_b01,10,294,3 script Vintenar#bat_b01_aover 4_M_KY_HEAD,{
.@A_B_gap = $@Guill_ScoreBG1 - $@Croix_ScoreBG1;
- if ($@FlaviusBG1_id1 == getcharid(4)) {
+ if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -668,7 +668,7 @@ OnInit:
bat_b01,389,14,3 script Vintenar#bat_b01_bover 4_M_CRU_HEAD,{
.@A_B_gap = $@Guill_ScoreBG1 - $@Croix_ScoreBG1;
- if ($@FlaviusBG1_id2 == getcharid(4)) {
+ if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
diff --git a/npc/battleground/flavius/flavius02.txt b/npc/battleground/flavius/flavius02.txt
index becee77c6..232dd7e39 100644
--- a/npc/battleground/flavius/flavius02.txt
+++ b/npc/battleground/flavius/flavius02.txt
@@ -405,7 +405,7 @@ OnTouch:
}
bat_b02,10,294,3 script Guillaume Vintenar#b02_a 4_M_RASWORD,{
- if ($@FlaviusBG2_id1 == getcharid(4)) {
+ if ($@FlaviusBG2_id1 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG2_Victory == 1) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -457,7 +457,7 @@ OnInit:
}
bat_b02,389,14,3 script Croix Vintenar#b02_b 4_M_RASWORD,{
- if ($@FlaviusBG2_id2 == getcharid(4)) {
+ if ($@FlaviusBG2_id2 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG2_Victory == 2) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -590,7 +590,7 @@ bat_b02,389,16,3 script Croix Camp#flag42 1_FLAG_EAGLE,{ end; }
bat_b02,10,294,3 script Vintenar#bat_b02_aover 4_M_KY_HEAD,{
.@A_B_gap = $@Guill_ScoreBG2 - $@Croix_ScoreBG2;
- if ($@FlaviusBG2_id1 == getcharid(4)) {
+ if ($@FlaviusBG2_id1 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
@@ -668,7 +668,7 @@ OnInit:
bat_b02,389,14,3 script Vintenar#bat_b02_bover 4_M_CRU_HEAD,{
.@A_B_gap = $@Guill_ScoreBG2 - $@Croix_ScoreBG2;
- if ($@FlaviusBG2_id2 == getcharid(4)) {
+ if ($@FlaviusBG2_id2 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
.@your_medal = countitem(BF_Badge2);
.@medal_gap = 500 - .@your_medal;
diff --git a/npc/battleground/tierra/tierra01.txt b/npc/battleground/tierra/tierra01.txt
index 0dabe28d0..22a612c81 100644
--- a/npc/battleground/tierra/tierra01.txt
+++ b/npc/battleground/tierra/tierra01.txt
@@ -267,8 +267,8 @@ OnKill:
OnMyMobDead:
if (mobcount("bat_a01","OBJ#bat_a01_n::OnMyMobDead") < 17) {
- bg_team_setxy getcharid(4),56,212;
- if (getcharid(4) == $@TierraBG1_id1) {
+ bg_team_setxy getcharid(CHAR_ID_BG),56,212;
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) {
donpcevent "NOBJ_mob#bat_a01_a::OnEnable";
mapannounce("bat_a01", _("Guillaume captured a Neutrality Flag, so they have an advantage."), bc_map, "0xFFCE00");
}
@@ -313,7 +313,7 @@ OnMyMobDead:
}
bat_a01,185,270,1 script Guillaume Blacksmith#a01 4_M_REPAIR,{
- if (getcharid(4) == $@TierraBG1_id1) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) {
mes("[Guillaume Blacksmith]");
mes("We are in urgency! The Barricade has been destroyed!");
mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000");
@@ -397,7 +397,7 @@ OnInit:
}
bat_a01,170,121,5 script Croix Blacksmith#bat_a01 4_M_REPAIR,{
- if (getcharid(4) == $@TierraBG1_id2) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) {
mes("[Croix Blacksmith]");
mes("We are in urgency! The Barricade has been destroyed!");
mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000");
@@ -622,28 +622,28 @@ OnTouch:
bat_a01,194,267,0 script barri_warp_up#bat_a01_a FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG1_id1)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1)
warp "bat_a01",194,261;
end;
}
bat_a01,194,265,0 script barri_warp_down#bat_a01a FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG1_id1)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1)
warp "bat_a01",194,270;
end;
}
bat_a01,177,130,0 script barri_warp_up#bat_a01_b FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG1_id2)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2)
warp "bat_a01",178,125;
end;
}
bat_a01,177,128,0 script barri_warp_down#bat_a01b FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG1_id2)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2)
warp "bat_a01",178,134;
end;
}
@@ -695,7 +695,7 @@ bat_a01,357,74,3 script Croix Camp#flag8 1_FLAG_EAGLE,{ end; }
bat_a01,348,74,3 script Croix Camp#flag9 1_FLAG_EAGLE,{ end; }
bat_a01,53,377,3 script Guillaume Vintenar#a01_a 4_M_KY_HEAD,{
- if (getcharid(4) == $@TierraBG1_id1) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) {
if ($@TierraBG1_Victory == 1) {
.@your_medal = countitem(BF_Badge1);
.@medal_gap = 500 - .@your_medal;
@@ -789,7 +789,7 @@ OnInit:
}
bat_a01,45,19,3 script Croix Vintenar#a01_b 4_M_CRU_HEAD,{
- if (getcharid(4) == $@TierraBG1_id2) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) {
if ($@TierraBG1_Victory == 2) {
.@your_medal = countitem(BF_Badge1);
.@medal_gap = 500 - .@your_medal;
diff --git a/npc/battleground/tierra/tierra02.txt b/npc/battleground/tierra/tierra02.txt
index ac7710aa8..a54935089 100644
--- a/npc/battleground/tierra/tierra02.txt
+++ b/npc/battleground/tierra/tierra02.txt
@@ -267,8 +267,8 @@ OnKill:
OnMyMobDead:
if (mobcount("bat_a02","OBJ#bat_a02_n::OnMyMobDead") < 17) {
- bg_team_setxy getcharid(4),56,212;
- if (getcharid(4) == $@TierraBG2_id1) {
+ bg_team_setxy getcharid(CHAR_ID_BG),56,212;
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) {
donpcevent "NOBJ_mob#bat_a02_a::OnEnable";
mapannounce("bat_a02", _("Guillaume captured a Neutrality Flag, so they have an advantage."), bc_map, "0xFFCE00");
}
@@ -313,7 +313,7 @@ OnMyMobDead:
}
bat_a02,185,270,1 script Guillaume Blacksmith#a02 4_M_REPAIR,{
- if (getcharid(4) == $@TierraBG2_id1) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) {
mes("[Guillaume Blacksmith]");
mes("We are in urgency! The Barricade has been destroyed!");
mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000");
@@ -397,7 +397,7 @@ OnInit:
}
bat_a02,170,121,5 script Croix Blacksmith#bat_a02 4_M_REPAIR,{
- if (getcharid(4) == $@TierraBG2_id2) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) {
mes("[Croix Blacksmith]");
mes("We are in urgency! The Barricade has been destroyed!");
mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000");
@@ -622,28 +622,28 @@ OnTouch:
bat_a02,194,267,0 script barri_warp_up#bat_a02_a FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG2_id1)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1)
warp "bat_a02",194,261;
end;
}
bat_a02,194,265,0 script barri_warp_down#bat_a02a FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG2_id1)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1)
warp "bat_a02",194,270;
end;
}
bat_a02,177,130,0 script barri_warp_up#bat_a02_b FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG2_id2)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2)
warp "bat_a02",178,125;
end;
}
bat_a02,177,128,0 script barri_warp_down#bat_a02b FAKE_NPC,7,0,{
OnTouch:
- if (getcharid(4) == $@TierraBG2_id2)
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2)
warp "bat_a02",178,134;
end;
}
@@ -695,7 +695,7 @@ bat_a02,357,74,3 script Croix Camp#flag18 1_FLAG_EAGLE,{ end; }
bat_a02,348,74,3 script Croix Camp#flag19 1_FLAG_EAGLE,{ end; }
bat_a02,53,377,3 script Guillaume Vintenar#a02_a 4_M_KY_HEAD,{
- if (getcharid(4) == $@TierraBG2_id1) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) {
if ($@TierraBG2_Victory == 1) {
.@your_medal = countitem(BF_Badge1);
.@medal_gap = 500 - .@your_medal;
@@ -789,7 +789,7 @@ OnInit:
}
bat_a02,45,19,3 script Croix Vintenar#a02_b 4_M_CRU_HEAD,{
- if (getcharid(4) == $@TierraBG2_id2) {
+ if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) {
if ($@TierraBG2_Victory == 2) {
.@your_medal = countitem(BF_Badge1);
.@medal_gap = 500 - .@your_medal;
diff --git a/npc/cities/jawaii.txt b/npc/cities/jawaii.txt
index 0c841a76e..e308d9f73 100644
--- a/npc/cities/jawaii.txt
+++ b/npc/cities/jawaii.txt
@@ -862,7 +862,7 @@ jawaii_in,28,124,0 script Bartender#jaw 1_ETC_01,{
mes "["+strcharinfo(PC_NAME)+"]";
mes "Thank you.";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
while (1) {
@@ -893,7 +893,7 @@ jawaii_in,28,124,0 script Bartender#jaw 1_ETC_01,{
mes "Thank you...";
mes "So much...";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
if (Zeny > 99) Zeny -= 100;
@@ -1103,7 +1103,7 @@ S_KillChar:
mes "Thank you...";
mes "Mr. Bartender...";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
if (Zeny > 99) Zeny -= 100;
@@ -1154,8 +1154,9 @@ jawaii_in,43,115,0 script Customer#jaw_1 4W_M_01,{
mes "the one who laughs last!";
next;
mes "^3355FFYou drank to your fill.^000000";
- close;
- percentheal -100,0;
+ close2;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
+ end;
}
mes "[Buchi]";
mes "You look happy...";
diff --git a/npc/cities/umbala.txt b/npc/cities/umbala.txt
index d705e4baa..a8127c372 100644
--- a/npc/cities/umbala.txt
+++ b/npc/cities/umbala.txt
@@ -1021,7 +1021,7 @@ umbala,140,197,1 script Bungee Jump FAKE_NPC,0,0,{
OnTouch:
switch(rand(1,3)) {
case 1:
- percentheal -100,0;
+ Hp = 1;
mapannounce "umbala","Bungee Jump: "+strcharinfo(PC_NAME)+" : Kyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~~~~~~~",bc_map;
end;
case 2:
@@ -1030,7 +1030,7 @@ OnTouch:
end;
case 3:
if (rand(1,2) == 2) {
- percentheal -99,0;
+ Hp = 1;
warp "nif_in",69,15;
}
end;
diff --git a/npc/custom/battleground/bg_tierra_01.txt b/npc/custom/battleground/bg_tierra_01.txt
index bab80916b..56a505356 100644
--- a/npc/custom/battleground/bg_tierra_01.txt
+++ b/npc/custom/battleground/bg_tierra_01.txt
@@ -99,13 +99,13 @@ OnReadyCheck:
end;
OnNeutralBreak:
- if( getcharid(4) == $@TierraBG1_id1 )
+ if( getcharid(CHAR_ID_BG) == $@TierraBG1_id1 )
{
mapannounce "bat_a01","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF;
bg_team_setxy $@TierraBG1_id2,42,16;
areawarp "bat_a01",52,208,61,217,"bat_a01",42,16;
}
- else if( getcharid(4) == $@TierraBG1_id2 )
+ else if( getcharid(CHAR_ID_BG) == $@TierraBG1_id2 )
{
mapannounce "bat_a01","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000;
bg_team_setxy $@TierraBG1_id1,50,374;
@@ -113,7 +113,7 @@ OnNeutralBreak:
}
else end;
- set .Neutral_Base, getcharid(4);
+ set .Neutral_Base, getcharid(CHAR_ID_BG);
bg_team_setxy .Neutral_Base,56,212;
if( .Guardian_1 == 0 )
diff --git a/npc/custom/battleground/bg_tierra_02.txt b/npc/custom/battleground/bg_tierra_02.txt
index 791f02109..e0f1b402a 100644
--- a/npc/custom/battleground/bg_tierra_02.txt
+++ b/npc/custom/battleground/bg_tierra_02.txt
@@ -99,13 +99,13 @@ OnReadyCheck:
end;
OnNeutralBreak:
- if( getcharid(4) == $@TierraBG2_id1 )
+ if( getcharid(CHAR_ID_BG) == $@TierraBG2_id1 )
{
mapannounce "bat_a02","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF;
bg_team_setxy $@TierraBG2_id2,42,16;
areawarp "bat_a02",52,208,61,217,"bat_a02",42,16;
}
- else if( getcharid(4) == $@TierraBG2_id2 )
+ else if( getcharid(CHAR_ID_BG) == $@TierraBG2_id2 )
{
mapannounce "bat_a02","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000;
bg_team_setxy $@TierraBG2_id1,50,374;
@@ -113,7 +113,7 @@ OnNeutralBreak:
}
else end;
- set .Neutral_Base, getcharid(4);
+ set .Neutral_Base, getcharid(CHAR_ID_BG);
bg_team_setxy .Neutral_Base,56,212;
if( .Guardian_1 == 0 )
diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt
index 33561db0a..d959253f3 100644
--- a/npc/custom/bgqueue/flavius.txt
+++ b/npc/custom/bgqueue/flavius.txt
@@ -170,12 +170,12 @@ OnReset:
end;
OnCroixQuit:
- queueremove($@Croix_QueueBG1,getcharid(3));
+ queueremove($@Croix_QueueBG1,getcharid(CHAR_ID_ACCOUNT));
callsub L_OnPlayerQuit;
end;
OnGuillaumeQuit:
- queueremove($@Guill_QueueBG1,getcharid(3));
+ queueremove($@Guill_QueueBG1,getcharid(CHAR_ID_ACCOUNT));
callsub L_OnPlayerQuit;
end;
@@ -437,7 +437,7 @@ OnTouch:
}
bat_b01,10,294,3 script Guillaume Vintenar#b01_a 4_M_RASWORD,{
- if ($@FlaviusBG1_id1 == getcharid(4)) {
+ if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG1_Victory == 1) {
set .@your_medal,countitem(BF_Badge2);
set .@medal_gap,500 - .@your_medal;
@@ -489,7 +489,7 @@ OnInit:
}
bat_b01,389,14,3 script Croix Vintenar#b01_b 4_M_RASWORD,{
- if ($@FlaviusBG1_id2 == getcharid(4)) {
+ if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) {
if ($@FlaviusBG1_Victory == 2) {
set .@your_medal,countitem(BF_Badge2);
set .@medal_gap,500 - .@your_medal;
@@ -623,7 +623,7 @@ bat_b01,389,16,3 script Croix Camp#flag31 1_FLAG_EAGLE,{ end; }
bat_b01,10,294,3 script Vintenar#bat_b01_aover 4_M_KY_HEAD,{
set .@A_B_gap,$@Guill_ScoreBG1 - $@Croix_ScoreBG1;
- if ($@FlaviusBG1_id1 == getcharid(4)) {
+ if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
set .@your_medal,countitem(BF_Badge2);
set .@medal_gap,500 - .@your_medal;
@@ -701,7 +701,7 @@ OnInit:
bat_b01,389,14,3 script Vintenar#bat_b01_bover 4_M_CRU_HEAD,{
set .@A_B_gap,$@Guill_ScoreBG1 - $@Croix_ScoreBG1;
- if ($@FlaviusBG1_id2 == getcharid(4)) {
+ if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) {
if (.@A_B_gap > 0) {
set .@your_medal,countitem(BF_Badge2);
set .@medal_gap,500 - .@your_medal;
diff --git a/npc/custom/etc/marriage.txt b/npc/custom/etc/marriage.txt
index 76b0429c8..4e521ec55 100644
--- a/npc/custom/etc/marriage.txt
+++ b/npc/custom/etc/marriage.txt
@@ -723,13 +723,13 @@ function SF_TryRegister {
set $wed_bride$,strcharinfo(PC_NAME);
$wed_bride_sex = Sex;
if ($@wedding_effect == 1) //Store account id for effect.
- set $wedding_effect_id, getcharid(3);
+ set $wedding_effect_id, getcharid(CHAR_ID_ACCOUNT);
} else {
set $wed_groom_progress,1;
set $wed_groom$,strcharinfo(PC_NAME);
$wed_groom_sex = Sex;
if ($@wedding_effect == 2) //Store account id for effect.
- set $wedding_effect_id, getcharid(3);
+ set $wedding_effect_id, getcharid(CHAR_ID_ACCOUNT);
}
}
@@ -882,7 +882,7 @@ function SF_InProgress {
mes "...I am still waiting for your partner to confirm the divorce procedure.";
close;
}
- if (getcharid(0) != $@divorcee) {
+ if (getcharid(CHAR_ID_CHAR) != $@divorcee) {
mes "["+@name$+"]";
mes "I am in the progress of divorcing "+$@divorcer$+".";
mes "Do you know who the spouse is?";
diff --git a/npc/custom/etc/monster_arena.txt b/npc/custom/etc/monster_arena.txt
index 24edd14d9..db4c37b73 100644
--- a/npc/custom/etc/monster_arena.txt
+++ b/npc/custom/etc/monster_arena.txt
@@ -724,7 +724,8 @@ L_Heal:
function script illegalkill {
announce "Illegal Kill by " + strcharinfo(PC_NAME) + " Detected",1;
- percentheal -100,-100;
+ Sp = 0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
diff --git a/npc/custom/etc/rpsroulette.txt b/npc/custom/etc/rpsroulette.txt
index e0f8b8952..331c0f0af 100644
--- a/npc/custom/etc/rpsroulette.txt
+++ b/npc/custom/etc/rpsroulette.txt
@@ -96,7 +96,8 @@ cmd_in02,182,126,2 script Crazy Boris 4_M_03,{
mes "*^0000FFClick^000000* *^FF0000BANG^000000*";
mes "You're dead!";
emotion e_gg;
- percentheal -100,-100;
+ Sp = 0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
close;
}
specialeffect EF_SUI_EXPLOSION;
diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt
index f0967590b..fbdbbed3f 100644
--- a/npc/custom/events/cluckers.txt
+++ b/npc/custom/events/cluckers.txt
@@ -23,20 +23,20 @@ prontera,156,219,4 script Cluckers 4_NFCOCK,{
if (.startcluck) {
specialeffect2 2;
switch(rand(15)) {
- case 0: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break;
+ case 0: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
case 1: npctalk "Cluuuuuck!~"; break;
- case 2: unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; break;
+ case 2: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break;
case 3: sc_start SC_FREEZE,10000,0; break;
- case 4: npctalk "CLUUUUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break;
+ case 4: npctalk "CLUUUUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
case 5: sc_start SC_SLEEP,10000,0; break;
case 6: sc_start SC_STONE,10000,0; emotion 29; break;
- case 7: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break;
- case 8: npctalk "Cluck! CLUUUCK!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break;
+ case 7: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
+ case 8: npctalk "Cluck! CLUUUCK!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
case 9: sc_start SC_STUN,10000,0; break;
case 10: sc_start SC_SLEEP,10000,0; emotion 29; break;
case 11: npctalk "Cluck! Cluck!"; break;
case 12: sc_start SC_STUN,10000,0; break;
- case 13: unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; break;
+ case 13: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break;
default:
if (rand(50) < 4) {
npctalk "WOOF!...........";
@@ -46,7 +46,7 @@ prontera,156,219,4 script Cluckers 4_NFCOCK,{
set .startcluck,0;
} else {
npctalk "Cluck! CLUUUCK!!";
- unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1;
+ unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1;
}
break;
}
diff --git a/npc/custom/item_signer.txt b/npc/custom/item_signer.txt
index 7e90542b1..a0097bb55 100644
--- a/npc/custom/item_signer.txt
+++ b/npc/custom/item_signer.txt
@@ -126,7 +126,7 @@ prt_in,24,61,7 script Perchik 1_M_01,{
delitem2 .@id,1,1,.@ref,0,.@slot[0],.@slot[1],.@slot[2],.@slot[3];
mes "Done!";
emotion e_proud;
- getitem2 .@id,1,1,.@ref,0,254,0,getcharid(0)&0xffff,(getcharid(0)>>16)&0xffff;
+ getitem2 .@id,1,1,.@ref,0,254,0,getcharid(CHAR_ID_CHAR)&0xffff,(getcharid(CHAR_ID_CHAR)>>16)&0xffff;
equip .@id;
close;
}
diff --git a/npc/custom/itembind.txt b/npc/custom/itembind.txt
index 66b37f4e7..8c51ad24d 100644
--- a/npc/custom/itembind.txt
+++ b/npc/custom/itembind.txt
@@ -25,7 +25,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{
}
mes "What kind of bind?";
.@boundtype = 1 << (select("Account", "Guild", "Character")-1);
- if(.@boundtype == 2 && (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(PC_NAME))) {
+ if(.@boundtype == 2 && (!getcharid(CHAR_ID_GUILD) || getguildmaster(getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME))) {
mes "In order for me to bind an item to a guild you must be the master of one.";
close;
}
@@ -92,7 +92,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{
next;
for(.@i = 0; .@i < getarraysize(@bound_items); .@i++) {
if(@inventorylist_id[.@item] == @bound_items[.@i] &&
- (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(PC_NAME))
+ (!getcharid(CHAR_ID_GUILD) || getguildmaster(getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME))
) {
mes "I will only unbind guild bound items that the guild master requests.";
close;
diff --git a/npc/custom/quests/hunting_missions.txt b/npc/custom/quests/hunting_missions.txt
index dc4e20f79..611bdd480 100644
--- a/npc/custom/quests/hunting_missions.txt
+++ b/npc/custom/quests/hunting_missions.txt
@@ -50,7 +50,7 @@ function Chk; function Cm;
mes "You've started a mission";
mes "on another character.";
if ( !@hm_char_del_check ) {
- if ( !query_sql( "SELECT 1 FROM `char_reg_num_db` WHERE `key` = 'Mission0' AND `char_id` IN ( SELECT `char_id` FROM `char` WHERE `account_id` = "+ getcharid(3) +" )", .@dummy ) ) {
+ if ( !query_sql( "SELECT 1 FROM `char_reg_num_db` WHERE `key` = 'Mission0' AND `char_id` IN ( SELECT `char_id` FROM `char` WHERE `account_id` = "+ getcharid(CHAR_ID_ACCOUNT) +" )", .@dummy ) ) {
next;
mes "[Hunting Missions]";
mes "I can't seem to find any records";
@@ -198,8 +198,8 @@ Mission_Status:
set #Mission_Count,0;
if (.Delay) set #Mission_Delay, gettimetick(2)+(.Delay*3600);
set Mission_Total, Mission_Total+1;
- if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num_db` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(0)+",'Mission_Total','0',1)");
- else query_sql("UPDATE `char_reg_num_db` SET `value` = "+Mission_Total+" WHERE `char_id` = "+getcharid(0)+" AND `key` = 'Mission_Total'");
+ if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num_db` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(CHAR_ID_CHAR)+",'Mission_Total','0',1)");
+ else query_sql("UPDATE `char_reg_num_db` SET `value` = "+Mission_Total+" WHERE `char_id` = "+getcharid(CHAR_ID_CHAR)+" AND `key` = 'Mission_Total'");
close;
Mission_Info:
@@ -258,7 +258,7 @@ OnBuyItem:
close;
OnNPCKillEvent:
- if (!getcharid(1) || !.Party) {
+ if (!getcharid(CHAR_ID_PARTY) || !.Party) {
if (!#Mission_Count || !Mission0) end;
for (set .@i, 0; .@i<.Quests; set .@i,.@i+1) {
if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Mission"+.@i))) {
@@ -271,8 +271,8 @@ OnNPCKillEvent:
} else if (.Party) {
set .@mob, killedrid;
getmapxy(.@map1$, .@x1, .@y1, UNITTYPE_PC);
- getpartymember getcharid(1),1;
- getpartymember getcharid(1),2;
+ getpartymember getcharid(CHAR_ID_PARTY),1;
+ getpartymember getcharid(CHAR_ID_PARTY),2;
for(set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {
if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) {
attachrid $@partymemberaid[.@i];
diff --git a/npc/custom/woe_controller.txt b/npc/custom/woe_controller.txt
index e109951d7..14e288be7 100644
--- a/npc/custom/woe_controller.txt
+++ b/npc/custom/woe_controller.txt
@@ -194,7 +194,7 @@ OnReward:
OnPCLoadMapEvent:
if (!compare(strcharinfo(PC_MAP),"g_cas")) end;
if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(PC_MAP),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(PC_MAP))))) {
- if (getcharid(2) && getcastledata(strcharinfo(PC_MAP),1) == getcharid(2)) end;
+ if (getcharid(CHAR_ID_GUILD) && getcastledata(strcharinfo(PC_MAP),1) == getcharid(CHAR_ID_GUILD)) end;
sleep2 1000;
message strcharinfo(PC_NAME), getcastlename(strcharinfo(PC_MAP))+" is currently inactive.";
sleep2 5000;
diff --git a/npc/events/gdevent_aru.txt b/npc/events/gdevent_aru.txt
index 39c3ca5f7..898880d02 100644
--- a/npc/events/gdevent_aru.txt
+++ b/npc/events/gdevent_aru.txt
@@ -79,13 +79,13 @@ OnMyMobDead:
}
arug_dun01,199,195,5 script Dwarf#aru_gd 4_M_DWARF,{
- if (getcharid(2) == 0) {
+ if (getcharid(CHAR_ID_GUILD) == 0) {
mes "[Dwarf]";
mes "Hey did you see an ugly Goblin come by? He stole something from me!";
close;
}
.@chk_urquest = questprogress(2143,PLAYTIME);
- .@chk_yourgdname$ = getguildname(getcharid(2));
+ .@chk_yourgdname$ = getguildname(getcharid(CHAR_ID_GUILD));
if ($@gdeventv_a1 == 0) {
if ($@gdevents_a$ == "") {
$@gdeventv_a1 = 1;
@@ -521,7 +521,7 @@ arug_que01,100,81,3 script Pierrot Pier#aru_gd 4_M_PIERROT,{
mes "- and come back later. -";
close;
}
- if (strcharinfo(PC_NAME) == getguildmaster(getcharid(2))) {
+ if (strcharinfo(PC_NAME) == getguildmaster(getcharid(CHAR_ID_GUILD))) {
if ($@gdeventv_a2 == 0) {
.@que_2143 = questprogress(2143,PLAYTIME);
if (!.@que_2143) {
diff --git a/npc/events/gdevent_sch.txt b/npc/events/gdevent_sch.txt
index 1d6b892b7..e04a28075 100644
--- a/npc/events/gdevent_sch.txt
+++ b/npc/events/gdevent_sch.txt
@@ -79,13 +79,13 @@ OnMyMobDead:
}
schg_dun01,194,148,5 script Dwarf#sch_gd 4_M_DWARF,{
- if (getcharid(2) == 0) {
+ if (getcharid(CHAR_ID_GUILD) == 0) {
mes "[Dwarf]";
mes "Hey did you see an ugly Goblin come by? He stole something from me!";
close;
}
.@chk_urquest = questprogress(2143,PLAYTIME);
- .@chk_yourgdname$ = getguildname(getcharid(2));
+ .@chk_yourgdname$ = getguildname(getcharid(CHAR_ID_GUILD));
if ($@gdeventv_s1 == 0) {
if ($@gdevents_s$ == "") {
$@gdeventv_s1 = 1;
@@ -520,7 +520,7 @@ schg_que01,100,81,3 script Pierrot Pier#sch_gd 4_M_PIERROT,{
mes "- and come back later. -";
close;
}
- if (strcharinfo(PC_NAME) == getguildmaster(getcharid(2))) {
+ if (strcharinfo(PC_NAME) == getguildmaster(getcharid(CHAR_ID_GUILD))) {
if ($@gdeventv_s2 == 0) {
.@que_2143 = questprogress(2143,PLAYTIME);
if (!.@que_2143) {
diff --git a/npc/events/god_se_festival.txt b/npc/events/god_se_festival.txt
index 1dbbe434a..7c0523cf5 100644
--- a/npc/events/god_se_festival.txt
+++ b/npc/events/god_se_festival.txt
@@ -66,7 +66,7 @@ yuno,1,1,0 script Festival Manager#gq_fes0 4_F_HUGIRL,{
}
yuno,118,192,5 script Rmimi Ravies#gq_fes01 4_F_HUGIRL,{
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (countitem(Valkyrie_Gift) > 0) {
mes "[Rmimi Ravies]";
mes "This is the flower.";
@@ -442,7 +442,7 @@ rachel,1,1,0 script Festival Manager#gq_fes2 4_F_HUGIRL,{
}
rachel,132,117,3 script Rhehe Ravies#gq_fes03 4_F_HUGIRL,{
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (countitem(Valkyrie_Gift) > 0) {
mes "[Rhehe Ravies]";
mes "A flower!!";
diff --git a/npc/events/nguild/nguild_dunsw.txt b/npc/events/nguild/nguild_dunsw.txt
index 23cd8ec8c..291b08db3 100644
--- a/npc/events/nguild/nguild_dunsw.txt
+++ b/npc/events/nguild/nguild_dunsw.txt
@@ -49,7 +49,7 @@ function script F_GldDunSw {
next;
if (select("Pull.", "Do not.") == 1) {
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
warp "gld_dun"+getarg(1),getarg(2),getarg(3);
end;
}
diff --git a/npc/events/nguild/nguild_ev_agit.txt b/npc/events/nguild/nguild_ev_agit.txt
index cbf6aec3c..99545bfff 100644
--- a/npc/events/nguild/nguild_ev_agit.txt
+++ b/npc/events/nguild/nguild_ev_agit.txt
@@ -67,7 +67,7 @@ function script F_AgitBreak {
.@map$ = getarg(0);
.@castle$ = getarg(1);
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (.@GID <= 0) return;
.@Economy = getcastledata(.@map$,2) - 5;
diff --git a/npc/events/nguild/nguild_flags.txt b/npc/events/nguild/nguild_flags.txt
index d2a753003..999f79dca 100644
--- a/npc/events/nguild/nguild_flags.txt
+++ b/npc/events/nguild/nguild_flags.txt
@@ -53,12 +53,12 @@ function script F_Flags {
return;
}
else {
- if (getcharid(2) == .@GID && getarg(4) == 1) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID && getarg(4) == 1) {
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if (select("Return to the guild castle.", "Quit.") == 1) {
- if (getcharid(2) == getcastledata(getarg(1),1))
+ if (getcharid(CHAR_ID_GUILD) == getcastledata(getarg(1),1))
warp getarg(1),getarg(2),getarg(3);
}
return;
diff --git a/npc/events/nguild/nguild_kafras.txt b/npc/events/nguild/nguild_kafras.txt
index 66c53ff2d..8b448bbe3 100644
--- a/npc/events/nguild/nguild_kafras.txt
+++ b/npc/events/nguild/nguild_kafras.txt
@@ -39,7 +39,7 @@
function script F_GKafra {
cutin "kafra_01",2;
@GID = getcastledata(getarg(0),1);
- if (getcharid(2) == @GID && getgdskilllv(@GID,10001)) goto L_StartG;
+ if (getcharid(CHAR_ID_GUILD) == @GID && getgdskilllv(@GID,10001)) goto L_StartG;
mes "[Kafra Service]";
mes "I am contracted to provide service only for the ^ff0000" + getguildname(@GID) + "^000000 Guild. Please use another Kafra Corporation staff member around here. I am Sorry for your inconvenience.";
diff --git a/npc/events/nguild/nguild_managers.txt b/npc/events/nguild/nguild_managers.txt
index 6ff1e7e2a..1d9b56966 100644
--- a/npc/events/nguild/nguild_managers.txt
+++ b/npc/events/nguild/nguild_managers.txt
@@ -47,7 +47,7 @@ function script F_GldManager {
mes "I am waiting for my master. Brave adventurer, follow your destiny!";
return;
}
- if (getcharid(2) != @GID){
+ if (getcharid(CHAR_ID_GUILD) != @GID){
mes "I am here to follow ^5533FF" + getguildmaster(@GID) + "^000000's command! Hey! Your not even a part of the guild!!";
mes "Where are the guardians? Destroy these intruders!";
return;
diff --git a/npc/events/nguild/nguild_warper.txt b/npc/events/nguild/nguild_warper.txt
index 07ee4b0ed..a2e2faed1 100644
--- a/npc/events/nguild/nguild_warper.txt
+++ b/npc/events/nguild/nguild_warper.txt
@@ -42,24 +42,24 @@
prontera,146,163,6 script Novice Castles 4_F_NOVICE,{
mes "[Cita]";
- if (!getcharid(2)) {
+ if (!getcharid(CHAR_ID_GUILD)) {
mes "^FF0000You have to enter a guild to be able to hit Emperium!^000000";
- } else if (getgdskilllv(getcharid(2),10013) ||
- (getgdskilllv(getcharid(2),10000) +
- getgdskilllv(getcharid(2),10001) +
- getgdskilllv(getcharid(2),10002) +
- getgdskilllv(getcharid(2),10003) +
- getgdskilllv(getcharid(2),10004) +
- getgdskilllv(getcharid(2),10005) +
- getgdskilllv(getcharid(2),10006) +
- getgdskilllv(getcharid(2),10007) +
- getgdskilllv(getcharid(2),10008) +
- getgdskilllv(getcharid(2),10009) +
- getgdskilllv(getcharid(2),10010) +
- getgdskilllv(getcharid(2),10011) +
- getgdskilllv(getcharid(2),10012) +
- getgdskilllv(getcharid(2),10013) +
- getgdskilllv(getcharid(2),10014) > 9)
+ } else if (getgdskilllv(getcharid(CHAR_ID_GUILD),10013) ||
+ (getgdskilllv(getcharid(CHAR_ID_GUILD),10000) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10001) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10002) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10003) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10004) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10005) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10006) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10007) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10008) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10009) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10010) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10011) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10012) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10013) +
+ getgdskilllv(getcharid(CHAR_ID_GUILD),10014) > 9)
) {
mes "I see... your guild has Emergency Call mastered.";
mes "You cannot enter the Novice Castle area.";
diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt
index 8fc6f973e..e6947d2a4 100644
--- a/npc/instances/EndlessTower.txt
+++ b/npc/instances/EndlessTower.txt
@@ -209,7 +209,7 @@ alberta,214,77,6 script Captain Janssen 4_M_SEAMAN,{
e_tower,81,105,0 script Tower Protection Stone 2_MONEMUS,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@p_name$ = getpartyname(.@party_id);
.@md_name$ = "Endless Tower";
@@ -221,7 +221,7 @@ e_tower,81,105,0 script Tower Protection Stone 2_MONEMUS,{
close;
}
if (!.@etower_timer) {
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "Confirmed the party has been made. Would you like to reserve entrance to the Endless Tower?";
next;
switch(select("Generate dungeon "+.@md_name$, "Enter the dungeon", "Return to Alberta", "Cancel")) {
diff --git a/npc/instances/NydhoggsNest.txt b/npc/instances/NydhoggsNest.txt
index c8f6c8567..bad1aacec 100644
--- a/npc/instances/NydhoggsNest.txt
+++ b/npc/instances/NydhoggsNest.txt
@@ -104,7 +104,7 @@ nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{
}
} else if (ins_nyd == 131 || ins_nyd == 132 || ins_nyd > 199) {
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Nidhoggur's Nest";
.@ins_nyd_check = questprogress(3135,PLAYTIME); // 3 Day cooldown
@@ -124,7 +124,7 @@ nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{
mes "And only 1 representative of you needs to talk to me, so don't annoy me...";
close;
}
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "[Yggdrasil Gatekeeper]";
mes "The loyal servants of the Guardian... what can I do for you?";
next;
@@ -224,7 +224,7 @@ L_Enter:
mes "You did not request for entrance. Please let your leader request entrance.";
close;
} else {
- mapannounce "nyd_dun02", getpartyname(getcharid(1))+"'s party member "+strcharinfo(PC_NAME)+" has entered Nidhoggur's Nest.",bc_map,"0x00ff99";
+ mapannounce "nyd_dun02", getpartyname(getcharid(CHAR_ID_PARTY))+"'s party member "+strcharinfo(PC_NAME)+" has entered Nidhoggur's Nest.",bc_map,"0x00ff99";
if (!questprogress(3135)) setquest 3135;
if (!questprogress(3136)) setquest 3136;
warp "1@nyd",32,37;
@@ -1608,7 +1608,7 @@ OnTouch_:
mes "I thank you deeply for your decision. I will use what is left of my powers to open up the path towards the Guardian's Nest.";
next;
mes "[World Tree Yggdrasil]";
- if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "The path to the Guardian's Nest is just past the waterfall by the large World Tree Yggdrasil to the North. The defensive mechanisms of the Sanctuary will start immediately.";
next;
mes "[World Tree Yggdrasil]";
@@ -1860,7 +1860,7 @@ OnTouch:
2@nyd,199,268,0 script nyd_2f_boss_enter FAKE_NPC,8,8,{
OnTouch_:
- if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
donpcevent instance_npcname("nyd_2f_boss_enter_call")+"::OnEnable";
disablenpc instance_npcname("nyd_2f_boss_enter");
end;
diff --git a/npc/instances/OrcsMemory.txt b/npc/instances/OrcsMemory.txt
index 4455124eb..48412a631 100644
--- a/npc/instances/OrcsMemory.txt
+++ b/npc/instances/OrcsMemory.txt
@@ -39,7 +39,7 @@
//== Entrance ==============================================
gef_fild10,242,202,0 script Dimensional Gorge Piece 2_MONEMUS,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@p_name$ = getpartyname(.@party_id);
.@md_name$ = "Orc's Memory";
@@ -62,7 +62,7 @@ gef_fild10,242,202,0 script Dimensional Gorge Piece 2_MONEMUS,{
close;
// Fall through to access the dungeon
} else { // !.@orctime
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "Party status confirmed. Would you like to book entrance to the "+.@md_name$+"?";
next;
switch(select("Reserve the "+.@md_name$, "Enter the Dungeon", "Cancel")) {
@@ -684,7 +684,7 @@ OnTimer23910:
}
2@orcs,26,164,0 script Torch#1-1 CLEAR_NPC,{
- if(getpartyleader(getcharid(1),2) != getcharid(0)) end;
+ if(getpartyleader(getcharid(CHAR_ID_PARTY),2) != getcharid(CHAR_ID_CHAR)) end;
progressbar "ffff00",5;
setarray .@id[0], atoi(charat(strnpcinfo(NPC_NAME_HIDDEN),0)), atoi(charat(strnpcinfo(NPC_NAME_HIDDEN),2));
if (.@id[1] == 4)
diff --git a/npc/instances/SealedShrine.txt b/npc/instances/SealedShrine.txt
index fd33f16a0..90efe6f5c 100644
--- a/npc/instances/SealedShrine.txt
+++ b/npc/instances/SealedShrine.txt
@@ -105,7 +105,7 @@ monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{
case 2:
if (BaseLevel >= 75) {
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
mes "[Friar Patrick]";
mes "Do you mean you'll go to the shrine and reseal Baphomet?";
@@ -117,7 +117,7 @@ monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{
//.@ins_bapho_check2 = questprogress(3045,PLAYTIME);
if (!.@ins_bapho_check) {
- if (getpartyleader(.@party_id,2) == getcharid(0) && instance_check_party(.@party_id,2,75)) {
+ if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR) && instance_check_party(.@party_id,2,75)) {
mes "[Friar Patrick]";
mes "Party name is "+getpartyname(.@party_id)+"...";
mes "Name of the leader is "+strcharinfo(PC_NAME)+"...";
@@ -491,7 +491,7 @@ OnMyMobDead:
//== Soul of hero near the north grave =====================
1@cata,141,221,0 script Gravestone# CLEAR_NPC,3,3,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
if ('ins_baphomet == 0) {
mes "The gravestone is trembling...";
next;
@@ -548,7 +548,7 @@ OnMyMobDead:
mes "If your ^0000FFparty leader^000000 brings me the pendant, my soul can be substantialized. So, hurry up.";
close;
}
- else if (('ins_baphomet == 2) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+ else if (('ins_baphomet == 2) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) {
mes "[Voice of the Gravestone]";
mes "Did you find the pendant?";
next;
@@ -598,7 +598,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
}
1@cata,176,119,4 script Ancient Hero's Soul#1F 4_M_CHAMPSOUL,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
cutin "ins_cata_champ_n",2;
if ('ins_baphomet == 2) {
mes "[Ancient Hero's Soul]";
@@ -660,7 +660,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
break;
case 3:
++.@ins_baphomet_1f_3;
- if (getpartyleader(.@party_id,2) == getcharid(0)) {
+ if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) {
mes "[Ancient Hero's Soul]";
mes "You look like the leader of this party. You need to go and get ^0000FF10 Essence of Fire^000000 from the torches.";
next;
@@ -712,7 +712,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
}
if (.@exitloop) break;
}
- if (getpartyleader(.@party_id,2) == getcharid(0)) {
+ if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) {
mes "[Ancient Hero's Soul]";
mes "To remind you again, I must be substantialized within the next hour. So everyone, finish your work within that time!";
'ins_baphomet = 3;
@@ -729,7 +729,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
cutin "",255;
end;
}
- else if (('ins_baphomet == 3) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+ else if (('ins_baphomet == 3) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) {
cutin "ins_cata_champ_n",2;
mes "[Ancient Hero's Soul]";
mes "Did you get 10 ^0000FFEssence of Fire^000000 and ^0000FFToken of Apostle^000000?";
@@ -766,7 +766,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
cutin "",255;
end;
}
- else if (('ins_baphomet == 4) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+ else if (('ins_baphomet == 4) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) {
cutin "ins_cata_champ_n",2;
mes "[Ancient Hero's Soul]";
mes "Are you ready? I opened the sealed gate. To pass the gate, you should carry a ^0000FFToken of Apostle^000000.";
@@ -886,8 +886,8 @@ OnInstanceInit:
//== Bobbing Torches =======================================
- script Bobbing Torch#SS FAKE_NPC,{
- .@party_id = getcharid(1);
- if (getpartyleader(.@party_id,2) == getcharid(0)) {
+ .@party_id = getcharid(CHAR_ID_PARTY);
+ if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) {
if (('ins_baphomet == 3) && (countitem(Essence_Of_Fire) < 11)) {
mes "A huge torch appearing as if it can burn everything is bobbing up and down in front of me.";
next;
@@ -1124,8 +1124,8 @@ OnInstanceInit:
2@cata,35,109,0 duplicate(Magical Seal#SS) Magical Seal#10 CLEAR_NPC
2@cata,79,65,0 script The Main Altar#ss CLEAR_NPC,{
- .@party_id = getcharid(1);
- if (('ins_baphomet == 5) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+ .@party_id = getcharid(CHAR_ID_PARTY);
+ if (('ins_baphomet == 5) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) {
mes "An evil power, too terrible to describe, lies under the great altar radiating a violet color.";
next;
mes "Complicated Magical Rune letters blink rapidly, attempting to suppress the dreadful power within.";
diff --git a/npc/jobs/2-1/assassin.txt b/npc/jobs/2-1/assassin.txt
index 86ce74644..fcc1c4c98 100644
--- a/npc/jobs/2-1/assassin.txt
+++ b/npc/jobs/2-1/assassin.txt
@@ -1103,7 +1103,7 @@ OnStartArena:
warpwaitingpc "in_moc_16", 66, 151;
attachrid($@warpwaitingpc[0]);
if (ASSIN_Q2 < 5) {
- warpchar "in_moc_16",20,145,getcharid(0);
+ warpchar "in_moc_16",20,145,getcharid(CHAR_ID_CHAR);
end;
}
donpcevent "Beholder#ASNTEST::OnEnable";
diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt
index 379aabfb7..54db666e6 100644
--- a/npc/kafras/functions_kafras.txt
+++ b/npc/kafras/functions_kafras.txt
@@ -80,7 +80,7 @@ function script F_Kafra {
break;
case 2:
// Guild Castle Kafra message
- @GID = getcharid(2);
+ @GID = getcharid(CHAR_ID_GUILD);
mes "[Kafra Employee]";
mes "Welcome. ^ff0000" + getguildname(@GID) + "^000000 Member.";
mes "The Kafra Coporation will stay with you wherever you go.";
diff --git a/npc/other/CashShop_Functions.txt b/npc/other/CashShop_Functions.txt
index 3197b3838..629e91b8a 100644
--- a/npc/other/CashShop_Functions.txt
+++ b/npc/other/CashShop_Functions.txt
@@ -57,9 +57,9 @@ function script F_CashStore {
// - No arguments.
function script F_CashPartyCall {
warp "Random",0,0;
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
getmapxy(.@mapl$, .@xl, .@yl, UNITTYPE_PC);
- warpparty .@mapl$, .@xl, .@yl, getcharid(1), .@mapl$;
+ warpparty .@mapl$, .@xl, .@yl, getcharid(CHAR_ID_PARTY), .@mapl$;
}
return;
}
@@ -285,7 +285,7 @@ function script F_Snowball {
case 2:
mes "Blessings.";
mes "Holy night~";
- unitskilluseid getcharid(3),"SM_ENDURE",10;
+ unitskilluseid getcharid(CHAR_ID_ACCOUNT),"SM_ENDURE",10;
close2;
cutin "",255;
break;
diff --git a/npc/other/arena/arena_party.txt b/npc/other/arena/arena_party.txt
index ad341e8a9..d7865d441 100644
--- a/npc/other/arena/arena_party.txt
+++ b/npc/other/arena/arena_party.txt
@@ -1025,7 +1025,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{
mes "[Staff]";
mes "^3131FF"+$arena_pttopn$+"^000000's running time was ^3131FF"+$top_ptmin+"^000000minutes ^3131FF"+$top_ptsec+"^000000seconds.";
next;
- .arn_party = getcharid(1);
+ .arn_party = getcharid(CHAR_ID_PARTY);
if (@gappt < 0) {
mes "[Staff]";
mes "Although you failed to make a new record, I hope you will succeed next time.";
@@ -1053,7 +1053,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{
mes "See you later~";
close2;
}
- if(getpartyleader(.arn_party,2) == getcharid(0)) {
+ if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) {
donpcevent "#arn_timer_pt::OnStop";
donpcevent "alloff#pt::OnEnable";
donpcevent "Ponox::OnStart";
@@ -1068,7 +1068,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{
mes "Wow! You have renewed the record!";
mes "What a great job!";
next;
- if(getpartyleader(.arn_party,2) == getcharid(0)) {
+ if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) {
mes "[Staff]";
mes "You can record you and your party members on ^FF0000the hall of Arena Time Force Battle party ^000000.";
mes "When you enter a name, the name will be remained on the top unless someone make a new record.";
@@ -1131,7 +1131,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{
mes "See you later~";
close2;
}
- if(getpartyleader(.arn_party,2) == getcharid(0)) {
+ if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) {
donpcevent "#arn_timer_pt::OnStop";
donpcevent "alloff#pt::OnEnable";
donpcevent "Ponox::OnStart";
diff --git a/npc/other/divorce.txt b/npc/other/divorce.txt
index dd4bad6b6..e3d6f5ee7 100644
--- a/npc/other/divorce.txt
+++ b/npc/other/divorce.txt
@@ -211,7 +211,8 @@ nif_in,190,112,5 script Deviruchi#divorce 4_DEVIRUCHI,{
specialeffect2 EF_DEVIL;
wedding_sign = 0;
Zeny -= 2500000;
- percentheal -100,-100;
+ Sp = 0;
+ Hp = 1;
divorce;
mes "[Deviruchi]";
mes "Bwahhahahaha~!";
diff --git a/npc/other/marriage.txt b/npc/other/marriage.txt
index ea43b347f..bbd659420 100644
--- a/npc/other/marriage.txt
+++ b/npc/other/marriage.txt
@@ -577,7 +577,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{
if (!getpartnerid()) {
if (!$@wedding) {
if (wedding_sign == 1) {
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
if (.@partymembercount == 2) {
if (Sex == SEX_MALE) {
@@ -648,7 +648,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{
}
else if ($@wedding == 1) {
if (wedding_sign == 1) {
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
if (.@partymembercount == 2) {
if (Sex == SEX_FEMALE) {
@@ -689,7 +689,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{
mes "Will you marry "+$@wed_groom$+"?";
next;
if (select("Yes, I do.", "^FF0000No.^000000") == 1) {
- if (isloggedin(getcharid(3,$@wed_groom$))) {
+ if (isloggedin(getcharid(CHAR_ID_ACCOUNT,$@wed_groom$))) {
if (marriage($@wed_groom$)) {
//Call Wedding effect
wedding;
@@ -697,12 +697,12 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{
sc_start SC_WEDDING,3600000,1;
getitem Bride_Ring,1;
//Give ring to Groom, and change to wedding sprite.
- attachrid(getcharid(3,$@wed_groom$));
+ attachrid(getcharid(CHAR_ID_ACCOUNT,$@wed_groom$));
sc_start SC_WEDDING,3600000,1;
getitem Bridegroom_Ring,1;
detachrid;
//Switch Script progression back to Bride
- attachrid(getcharid(3,$@wed_bride$));
+ attachrid(getcharid(CHAR_ID_ACCOUNT,$@wed_bride$));
cutin "wedding_bomars02",2;
mapannounce "prt_church","I now pronounce you, "+$@wed_groom$+" and "+$@wed_bride$+", husband and wife.",bc_map;
mes "[Vomars]";
diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt
index 7d58569ef..b3e0eb15a 100644
--- a/npc/other/poring_war.txt
+++ b/npc/other/poring_war.txt
@@ -644,8 +644,8 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{
close;
}
.@a_tname$ = getpartyname($@wop_team_a);
- .@pname$ = getpartyname(getcharid(1));
- if ($@wop_team_a != 0 && $@wop_team_a == getcharid(1)) {
+ .@pname$ = getpartyname(getcharid(CHAR_ID_PARTY));
+ if ($@wop_team_a != 0 && $@wop_team_a == getcharid(CHAR_ID_PARTY)) {
mes "[Mr. Doppel]";
mes "So, everyone joined the party?";
mes "The name of the party is... " + .@pname$ + ", right?";
@@ -662,7 +662,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{
mes "If you don't get there in time, you won't make it to the battle.";
close;
case 2:
- if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+ if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) {
mes "[Mr. Doppel]";
mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
next;
@@ -694,7 +694,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{
}
}
else {
- if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+ if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) {
if ($@wop_team_a == 0) {
mes "[Mr. Doppel]";
mes "So, you are the party leader of Angeling Team.";
@@ -719,7 +719,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{
mes "So, I'll register your party name as - " +.@pname$ + " -.";
mes "Now, Tell your ^4d4dffmembers to confirm your party^000000.";
mes "I'll send you to the battlefield as soon as I confirm your party.";
- $@wop_team_a = getcharid(1);
+ $@wop_team_a = getcharid(CHAR_ID_PARTY);
mapannounce "poring_w02","The registration of the Angeling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66;
close;
case 3:
@@ -775,8 +775,8 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{
close;
}
.@d_tname$ = getpartyname($@wop_team_d);
- .@pname$ = getpartyname(getcharid(1));
- if ($@wop_team_d != 0 && $@wop_team_d == getcharid(1)) {
+ .@pname$ = getpartyname(getcharid(CHAR_ID_PARTY));
+ if ($@wop_team_d != 0 && $@wop_team_d == getcharid(CHAR_ID_PARTY)) {
mes "[Mr. Doppel]";
mes "So, everyone joined the party?";
mes "The name of the party is... " + .@pname$ + ", right?";
@@ -793,7 +793,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{
mes "If you don't get there in time, you won't make it to the battle.";
close;
case 2:
- if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+ if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) {
mes "[Mr. Doppel]";
mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
next;
@@ -823,7 +823,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{
}
}
} else {
- if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+ if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) {
if ($@wop_team_d == 0) {
mes "[Mr. Doppel]";
mes "So, you are the party leader of Deviling Team.";
@@ -848,7 +848,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{
mes "So, I'll register your party name as - " + .@pname$ + " -.";
mes "Now, Tell your ^4d4dffmembers to confirm your party^000000.";
mes "I'll send you to the battlefield as soon as I confirm your party.";
- $@wop_team_d = getcharid(1);
+ $@wop_team_d = getcharid(CHAR_ID_PARTY);
mapannounce "poring_w02","The registration of the Deviling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66;
close;
case 3:
@@ -1238,7 +1238,7 @@ poring_w02,99,201,3 script Deviruchi#wop_endmaster 4_DEVIRUCHI,{
}
.@a_point = $@wop_deadcount_a;
.@d_point = $@wop_deadcount_d;
- if (getcharid(1) == $@wop_team_a) {
+ if (getcharid(CHAR_ID_PARTY) == $@wop_team_a) {
if (.@a_point < .@d_point) {
mes "[Devi]";
mes "Good work!";
@@ -1319,7 +1319,7 @@ poring_w02,99,201,3 script Deviruchi#wop_endmaster 4_DEVIRUCHI,{
}
}
}
- else if (getcharid(1) == $@wop_team_d) {
+ else if (getcharid(CHAR_ID_PARTY) == $@wop_team_d) {
if (.@a_point > .@d_point) {
mes "[Devi]";
mes "Good work!";
diff --git a/npc/quests/eye_of_hellion.txt b/npc/quests/eye_of_hellion.txt
index 15a61bf2b..8a2b54f8b 100644
--- a/npc/quests/eye_of_hellion.txt
+++ b/npc/quests/eye_of_hellion.txt
@@ -395,7 +395,7 @@ morocc_in,116,101,3 script Old Scholar Tyus#hellion 4_M_JOB_WIZARD,3,3,{
mes "you now before you are";
mes "consumed by its darkness!";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
else if (HELLIONQ > 57 && HELLIONQ < 66) {
@@ -435,7 +435,7 @@ morocc_in,116,101,3 script Old Scholar Tyus#hellion 4_M_JOB_WIZARD,3,3,{
mes "you now before you are";
mes "consumed by its darkness!";
close;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
else if (HELLIONQ == 67) {
@@ -1853,7 +1853,7 @@ pay_arche,142,28,0 script Buddha Statue#paypuzz6 HIDDEN_NPC,5,5,{
mes "to your answer. However...";
mes "You have chosen poorly.";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
case 2:
mes "[Echoing Voice]";
@@ -1863,7 +1863,7 @@ pay_arche,142,28,0 script Buddha Statue#paypuzz6 HIDDEN_NPC,5,5,{
mes "where is the respect for your";
mes "own life? If you are that willing to throw it away, you are no hero.";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
case 3:
mes "[Echoing Voice]";
@@ -1889,7 +1889,7 @@ pay_arche,142,28,0 script Buddha Statue#paypuzz6 HIDDEN_NPC,5,5,{
mes "your own cowardice. You have";
mes "chosen extremely poorly...";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
}
diff --git a/npc/quests/guildrelay.txt b/npc/quests/guildrelay.txt
index 55717e9ce..7cb580130 100644
--- a/npc/quests/guildrelay.txt
+++ b/npc/quests/guildrelay.txt
@@ -85,7 +85,7 @@
mes "head on your way.^000000";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (guildrelay_q == 100) {
if (guildtime > 22) {
@@ -1197,7 +1197,7 @@
}
}
else {
- if (getcharid(2) == 0) {
+ if (getcharid(CHAR_ID_GUILD) == 0) {
mes "[" + .@name$ + "]";
mes "You haven't joined";
mes "a guild yet? Why don't";
@@ -1264,7 +1264,7 @@
mes "head on your way.^000000";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (countitem(Soul_Of_Guild) > 0) {
mes "[" + .@name$ + "]";
@@ -1768,7 +1768,7 @@
mes "there's no reason to be here.^000000";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (countitem(Soul_Of_Confidence) > 0) {
mes "[" + .@name$ + "]";
@@ -2452,7 +2452,7 @@
mes "there's no reason to be here.^000000";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (countitem(Soul_Of_Peace) > 0) {
mes "[" + .@name$ + "]";
@@ -2527,9 +2527,9 @@
close;
}
}
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
- .@partyleader = getpartyleader(getcharid(1),2);
+ .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2);
if (guildrelay_q == 91) {
if (.@partymembercount == 6) {
mes "[" + .@name$ + "]";
diff --git a/npc/quests/okolnir.txt b/npc/quests/okolnir.txt
index 4d5cb4910..bdf763bd5 100644
--- a/npc/quests/okolnir.txt
+++ b/npc/quests/okolnir.txt
@@ -44,7 +44,7 @@ function script F_Okolnir {
- script Guide#gq_main FAKE_NPC,{
.@sub$ = callfunc("F_Okolnir");
.@GID = getcastledata(strnpcinfo(NPC_MAP),1);
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (getd("$siz_"+.@sub$+"_on") == 0) {
mes "[Guide]";
mes "This castle has a hidden secret.";
@@ -192,7 +192,7 @@ que_qsch05,345,23,0 warp Gate02#gq_sch05 1,1,schg_cas05,369,306
.@sub$ = callfunc("F_Okolnir");
.@t$ = ((compare(strnpcinfo(NPC_MAP),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(NPC_MAP),getstrlen(strnpcinfo(NPC_MAP))-1));
.@GID = getcastledata(.@t$,1);
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
cutin "wish_maiden31",1;
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
mes "[Wish Maiden]";
@@ -358,7 +358,7 @@ que_qsch05,345,23,0 warp Gate02#gq_sch05 1,1,schg_cas05,369,306
mes "[Wish Maiden]";
mes "...You are not qualified.";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
cutin "wish_maiden11",255;
end;
}
@@ -2161,7 +2161,7 @@ que_qsch05,251,255,3 duplicate(Wish Maiden#main_boss) Wish Maiden#sch05_boss WIS
.@sub$ = callfunc("F_Okolnir");
.@t$ = ((compare(strnpcinfo(NPC_MAP),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(NPC_MAP),getstrlen(strnpcinfo(NPC_MAP))-1));
.@GID = getcastledata(.@t$,1);
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (compare(.@sub$,"aru")) {
setarray .@n, 7835,1,7836,1,7837,1,7838,1,2513,1,7291,10,7293,10,7063,100,985,20;
diff --git a/npc/quests/partyrelay.txt b/npc/quests/partyrelay.txt
index 54d78bec6..f426106fc 100644
--- a/npc/quests/partyrelay.txt
+++ b/npc/quests/partyrelay.txt
@@ -34,9 +34,9 @@
//=========================================================================
payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
- .@partyleader = getpartyleader(getcharid(1),2);
+ .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2);
if (checkweight(Resin,300) == 0) {
mes "^3355FFWait a minute! You're";
mes "carrying too many items";
@@ -54,7 +54,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "of your group members with you.";
close;
}
- if ((countitem(Mission_Certificate12) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+ if ((countitem(Mission_Certificate12) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) {
mes "[Ledrion]";
mes "Ah, you've brought the";
mes "last ticket from Rospii.";
@@ -129,7 +129,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "over to Gatan right now?";
close;
}
- if ((countitem(Mission_Certificate8) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+ if ((countitem(Mission_Certificate8) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) {
mes "[Ledrion]";
mes "Great, you've brought";
mes "me the eighth ticket from";
@@ -178,7 +178,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "a ticket to Gatan?";
close;
}
- if ((countitem(Mission_Certificate4) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+ if ((countitem(Mission_Certificate4) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) {
mes "[Ledrion]";
mes "I see that you've brought";
mes "me the fourth ticket from";
@@ -219,7 +219,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "come to me, not yet.";
close;
}
- if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay == 1)) {
+ if ((BaseLevel > 39) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5) && (party_relay == 1)) {
mes "[Ledrion]";
mes "As I mentioned earlier,";
mes "I'm challenging guild";
@@ -271,7 +271,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "once the time is right.";
close;
}
- if ((.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay > 0)) {
+ if ((.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5) && (party_relay > 0)) {
mes "[Ledrion]";
mes "As leader of your";
mes "Party, you should";
@@ -280,7 +280,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
mes "of your partners.";
close;
}
- if ((.@partyleader != getcharid(0)) && (getcharid(2) > 0)) {
+ if ((.@partyleader != getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0)) {
mes "[Ledrion]";
mes "I'm sorry, but there's";
mes "nothing I can really offer";
@@ -363,7 +363,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
next;
switch(select("Sure!", "No.")) {
case 1:
- if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+ if ((BaseLevel > 39) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) {
mes "[Ledrion]";
mes "Great! Let's see...";
mes "Well, you meet all the";
@@ -402,9 +402,9 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{
}
payon,83,327,3 script Gatan#payon::RelayGatan 4_M_04,{
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
- .@partyleader = getpartyleader(getcharid(1),2);
+ .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2);
if (checkweight(Resin,300) == 0) {
mes "^3355FFWait a minute! You're";
mes "carrying too many items";
@@ -1837,9 +1837,9 @@ payon,83,327,3 script Gatan#payon::RelayGatan 4_M_04,{
}
payon,204,221,3 script Bafhail#payon::RelayBafhail 4_M_JOB_BLACKSMITH,{
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
- .@partyleader = getpartyleader(getcharid(1),2);
+ .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2);
if (checkweight(Resin,300) == 0) {
mes "^3355FFWait a minute! You're";
mes "carrying too many items";
@@ -2470,9 +2470,9 @@ payon,204,221,3 script Bafhail#payon::RelayBafhail 4_M_JOB_BLACKSMITH,{
}
payon,168,314,3 script Lospii#payon::RelayLospii 4_M_KID1,{
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
- .@partyleader = getpartyleader(getcharid(1),2);
+ .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2);
if (checkweight(Resin,300) == 0) {
mes "^3355FFWait a minute! You're";
mes "carrying too many items";
diff --git a/npc/quests/quests_13_1.txt b/npc/quests/quests_13_1.txt
index 8e57b3a96..0f1481282 100644
--- a/npc/quests/quests_13_1.txt
+++ b/npc/quests/quests_13_1.txt
@@ -13912,7 +13912,7 @@ que_dan02,115,53,3 script Man#moc2_crazyR01 4_M_DSTMAN,{
mes "Are you his enemy?";
mes "DIE!";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
cutin "mocseal_kid01",255;
diff --git a/npc/quests/quests_ayothaya.txt b/npc/quests/quests_ayothaya.txt
index 61f3d821c..f409782c8 100644
--- a/npc/quests/quests_ayothaya.txt
+++ b/npc/quests/quests_ayothaya.txt
@@ -1947,7 +1947,7 @@ ayo_dun01,272,26,0 duplicate(AyoTrap1) #th_dun1_1_4 HIDDEN_NPC
ayo_dun01,26,27,0 script #th_dun1_1::AyoTrap2 FAKE_NPC,1,1,{
OnTouch:
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
diff --git a/npc/quests/quests_louyang.txt b/npc/quests/quests_louyang.txt
index e9e76b99c..d9c07c597 100644
--- a/npc/quests/quests_louyang.txt
+++ b/npc/quests/quests_louyang.txt
@@ -4634,9 +4634,9 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{
mes strcharinfo(PC_NAME)+ "...!";
mes "Your name is now engraved on this bloody pledge board. We will fight together to the death for Louyang's future!";
next;
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
@partymember = $@partymembercount;
- if (getpartyleader(getcharid(1),1) == getcharid(0) || !@partymember) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),1) == getcharid(CHAR_ID_CHAR) || !@partymember) {
mes "[Sun Mao]";
mes "Now, the most important thing for our cause is to gather more recruits and increase our numbers. Please find others who will join us in our fight.";
next;
@@ -4659,7 +4659,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{
mes "If you're a real tourist, you do not want to get involved in our business, one way or another.";
close;
}
- } else if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ } else if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
if (QL_REVOL == 9) {
mes "[Sun Mao]";
mes "Once again,";
@@ -4668,7 +4668,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{
mes "Go back safe.";
close;
}
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
@partymember = $@partymembercount;
if (QL_REVOL < 8) {
if (@partymember == QL_REVOL +1) {
@@ -4860,7 +4860,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{
lou_in01,43,147,3 script Gunpowder Expert 4_M_ALCHE_C,{
if (ch_make == 0) {
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
@partymember = $@partymembercount;
if (!QL_REVOL) {
mes "[Hao Chenryu]";
diff --git a/npc/quests/quests_morocc.txt b/npc/quests/quests_morocc.txt
index c7acc986e..1b387be0c 100644
--- a/npc/quests/quests_morocc.txt
+++ b/npc/quests/quests_morocc.txt
@@ -938,12 +938,12 @@ moc_fild20,354,183,3 script Continental Guard#01::MocConGuard 4_M_MOC_SOLDIER,3,
close;
case 2:
if ($@re_moc < 3) {
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount;
while (.@partymembercount >= 0) {
.@name$ = .@partymembername$[.@partymembercount];
- if (isloggedin(getcharid(3,.@name$))) {
+ if (isloggedin(getcharid(CHAR_ID_ACCOUNT,.@name$))) {
++.@onlinemembers;
}
--.@partymembercount;
@@ -1001,12 +1001,12 @@ moc_fild20,354,183,3 script Continental Guard#01::MocConGuard 4_M_MOC_SOLDIER,3,
mes "[Continental Guard]";
mes "Ah, you're an adventurer working for the Continental Guard. Nice to meet you. Feel free to ask me if you need my assistance.";
next;
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount;
while (.@partymembercount >= 0) {
.@name$ = .@partymembername$[.@partymembercount];
- if (isloggedin(getcharid(3,.@name$))) {
+ if (isloggedin(getcharid(CHAR_ID_ACCOUNT,.@name$))) {
++.@onlinemembers;
}
--.@partymembercount;
diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt
index 13dd91908..3e3bb3414 100644
--- a/npc/quests/quests_moscovia.txt
+++ b/npc/quests/quests_moscovia.txt
@@ -8624,10 +8624,10 @@ OnTouch:
mes "- You hear a splashing as -";
mes "- something gleaming -";
mes "- seems to stare at you!! -";
- next;
+ close2;
specialeffect2 EF_FLASHER;
- percentheal -100,0;
- close;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
+ end;
}
} else if (rhea_rus_hair > 2 && rhea_rus_hair < 7) {
mes "[Lusalka's Voice]";
@@ -8646,9 +8646,10 @@ OnTouch:
close;
}
mes "-You seem to hear the splash but something gleaming raids on you!!-";
+ close2;
specialeffect2 EF_FLASHER;
- percentheal -100,0;
- close;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
+ end;
}
} else if (rhea_rus_hair == 8) {
mes "["+ strcharinfo(PC_NAME) +"]";
@@ -8884,10 +8885,11 @@ mosk_fild02,124,202,3 script Lusalka#rus23 4_F_RUSGREEN,{
end;
}
mes "-When Lusalka watches you, you are blacked out-";
+ close2;
specialeffect2 EF_FLASHER;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
donpcevent "Lusalka#rus23::OnDisable";
- close;
+ end;
OnInit:
disablenpc "Lusalka#rus23";
diff --git a/npc/quests/quests_nameless.txt b/npc/quests/quests_nameless.txt
index f2e20c07f..1371c93bf 100644
--- a/npc/quests/quests_nameless.txt
+++ b/npc/quests/quests_nameless.txt
@@ -10174,7 +10174,7 @@ moc_fild18,108,116,0 script #treasure CLEAR_NPC,{
mes "protection to get the treasure.^000000";
next;
input .@input$;
- getpartymember(getcharid(1));
+ getpartymember(getcharid(CHAR_ID_PARTY));
.@partymembercount = $@partymembercount;
if (.@partymembercount > 1) {
if (((.@input$ == "OpenSesame") && (treasure_nd == 9)) || ((.@input$ == "UnlockTreasure") && (treasure_nd == 10))) {
diff --git a/npc/quests/seals/god_weapon_creation.txt b/npc/quests/seals/god_weapon_creation.txt
index 87c231dd7..3f32461fa 100644
--- a/npc/quests/seals/god_weapon_creation.txt
+++ b/npc/quests/seals/god_weapon_creation.txt
@@ -89,7 +89,7 @@ gld_dun01,28,85,0 script Grunburti#1::GodDwarf 4_M_DWARF,{
mes "At least I was fortunate enough to find this cave. We Dwarves are most cozy living underground, after all.";
close;
case 3:
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (($God1 < $@god_check2) || ($God2 < $@god_check2) || ($God3 < $@god_check2) || ($God4 < $@god_check2)){
if (($God1 >= $@god_check1) && ($God2 >= $@god_check1) && ($God3 >= $@god_check1) && ($God4 >= $@god_check1) && (strcharinfo(PC_NAME) == getguildmaster(.@GID))) {
mes "[Dwarf Grunburti]";
@@ -412,7 +412,7 @@ que_god01,154,112,4 script Grunburti#god 4_M_DWARF,{
mes "pity for you~";
close;
}
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
if (strcharinfo(PC_NAME) != getguildmaster(.@GID)) {
mes "[Dwarf Grunburti]";
mes "How in the...";
diff --git a/npc/quests/seals/megingard_seal.txt b/npc/quests/seals/megingard_seal.txt
index cf17a9619..228268602 100644
--- a/npc/quests/seals/megingard_seal.txt
+++ b/npc/quests/seals/megingard_seal.txt
@@ -1859,7 +1859,7 @@ morocc_in,146,179,0 script Employee#megin1 1_F_01,{
mes "^3355FFThe Inn Employee";
mes "knocks you out~^000000";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
else {
@@ -1897,7 +1897,8 @@ morocc_in,146,179,0 script Employee#megin1 1_F_01,{
mes "^3355FFThe Inn Employee";
mes "knocks you out~^000000";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
+ end;
}
else {
mes "[Ms. Scary Inn Employee]";
@@ -1937,7 +1938,7 @@ morocc_in,146,179,0 script Employee#megin1 1_F_01,{
mes "^3355FFThe Inn Employee";
mes "knocks you out~^000000";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
else {
diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt
index 274848569..2ed7ad703 100644
--- a/npc/quests/the_sign_quest.txt
+++ b/npc/quests/the_sign_quest.txt
@@ -4484,9 +4484,8 @@ cmd_in02,88,51,4 script Strange Guy#sign 1_M_SIGNART,{
mes "I'll freakin' beat you to near";
mes "freakin' death! Bam bam bam!";
close2;
- percentheal -100,0;
soundeffect "effect\\sign_noise.wav",1;
- percentheal -99,0;
+ Hp = 1;
warp "comodo",122,100;
end;
case 2:
@@ -6837,7 +6836,7 @@ yuno,330,100,4 script Knight#ss 4_M_JOB_KNIGHT2,{
}
}
else {
- .@signid = getcharid(0,strcharinfo(PC_NAME));
+ .@signid = getcharid(CHAR_ID_CHAR,strcharinfo(PC_NAME));
.@sign3 = .@signid & 65535;
.@sign4 = .@signid >> 16;
.@sign1 = 254;
@@ -10764,7 +10763,7 @@ que_sign01,45,227,4 script Queen of the Dead 2_F_SIGN1,{
mes "invitation? Insolent mortal!";
mes "Go back to where you belong!^000000";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
}
else if (sign_q == 117) {
@@ -12202,7 +12201,7 @@ que_sign01,46,56,0 script Fountain#sign HIDDEN_NPC,{
case 1:
mes "...";
close2;
- percentheal -100,0;
+ unitkill getcharid(CHAR_ID_ACCOUNT);
end;
case 2:
mes "...";
diff --git a/npc/re/cities/malaya.txt b/npc/re/cities/malaya.txt
index afe816a3e..f18bbd0af 100644
--- a/npc/re/cities/malaya.txt
+++ b/npc/re/cities/malaya.txt
@@ -183,7 +183,7 @@ OnBingx2:
donpcevent strnpcinfo(NPC_NAME)+"::OnDisable";
end;
OnTouch:
- if (getcharid(1)) {
+ if (getcharid(CHAR_ID_PARTY)) {
if ($ma_name04$ == strcharinfo(PC_NAME) || $ma_name05$ == strcharinfo(PC_NAME) || $ma_name06$ == strcharinfo(PC_NAME)) {
donpcevent strnpcinfo(NPC_NAME)+"::OnBingx2";
mes "The unidentified creature gets a glimpse of you, blushes and then disappears.";
@@ -236,7 +236,7 @@ OnBingx2:
OnTouch:
.@i = atoi(strnpcinfo(NPC_NAME_HIDDEN));
if (.@i%4 == 2) {
- if (getcharid(0) == getpartyleader(getcharid(1),2))
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2))
.@pass = 1;
} else if (.@i%4 == 3) {
if (questprogress(4229,PLAYTIME) && questprogress(9223,PLAYTIME) && questprogress(12278,PLAYTIME))
diff --git a/npc/re/instances/BakonawaLake.txt b/npc/re/instances/BakonawaLake.txt
index 8214a3039..5e2ae7f33 100644
--- a/npc/re/instances/BakonawaLake.txt
+++ b/npc/re/instances/BakonawaLake.txt
@@ -56,7 +56,7 @@ ma_scene01,174,179,4 script Taho 4_M_DEWZATIMAN,{
close;
}
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Bakonawa Lake";
.@baku_time = questprogress(12278,PLAYTIME);
@@ -69,7 +69,7 @@ ma_scene01,174,179,4 script Taho 4_M_DEWZATIMAN,{
close;
}
if (!.@baku_time) {
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "[Taho]";
mes "Are you the leader of the Bakonawa slayers? The road is not well so we have to go down the cliff with a rope, is that OK?";
next;
@@ -144,7 +144,7 @@ sec_in02,26,26,4 script Bakonawa's Rage 4_M_DEWZATIMAN,{
mes "[Taho]";
mes "Bakonawa becomes invincible at some point. When that time comes, listen to my guides carefully. Just trust me and all will be good.";
next;
- if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "[Taho]";
mes "Now I will make Bakonawa spring out from the lake.";
next;
@@ -528,7 +528,7 @@ OnTimer10000:
mes "[Taho]";
mes "HMM. We almost got him but he is one fast creature...";
next;
- if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "[Taho]";
mes "Are we going to try again?";
next;
diff --git a/npc/re/instances/BangungotHospital.txt b/npc/re/instances/BangungotHospital.txt
index d45fdfc23..1504f892f 100644
--- a/npc/re/instances/BangungotHospital.txt
+++ b/npc/re/instances/BangungotHospital.txt
@@ -39,7 +39,7 @@
ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{
if (BaseLevel < 100) end;
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
cutin "malaya_nurseB",2;
if (!questprogress(9223)) {
.@quest = questprogress(9222);
@@ -60,7 +60,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{
else if (malaya_bang == 31)
callsub L_Closed,0;
else if (malaya_bang > 39)
- callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,0,0;
+ callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,0,0;
else {
mes "[Nurse Maenne]";
mes "..........";
@@ -104,7 +104,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{
} else {
//if (!.@party_id) goto L_NoParty; //unneeded
if (malaya_bang > 39)
- callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1;
+ callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1;
else {
mes "[Nurse Maenne]";
mes ".......";
@@ -136,7 +136,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{
} else if (.@playtime == 2) {
//if (!.@party_id) goto L_NoParty; //unneeded
if (malaya_bang > 39)
- callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1;
+ callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1;
else {
mes "[Nurse Maenne]";
mes ".......";
@@ -215,7 +215,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{
} else {
if (!.@party_id) goto L_NoParty;
if (malaya_bang > 39)
- callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1;
+ callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1;
else {
mes "[Nurse Maenne]";
mes ".......";
@@ -275,7 +275,7 @@ L_Enter:
next;
switch(select(((getarg(0))?"Prepare to enter the second floor.":""), "Enter the second floor.", "Do not enter.")) {
case 1:
- .@instance = instance_create(.@md_name$,getcharid(1));
+ .@instance = instance_create(.@md_name$,getcharid(CHAR_ID_PARTY));
if (.@instance < 0) {
mes "[Nurse Maenne]";
mes "A critical situation has happened.";
@@ -312,7 +312,7 @@ L_Enter:
mes "The party leader did not generate the dungeon yet.";
close;
} else {
- mapannounce "ma_dun01", getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member entered "+.@md_name$+".",bc_map,"0x00ff99";
+ mapannounce "ma_dun01", getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member entered "+.@md_name$+".",bc_map,"0x00ff99";
if (getarg(1)) {
if (questprogress(9223)) {
completequest 9223;
diff --git a/npc/re/instances/BuwayaCave.txt b/npc/re/instances/BuwayaCave.txt
index 878000d0f..242d0a8e4 100644
--- a/npc/re/instances/BuwayaCave.txt
+++ b/npc/re/instances/BuwayaCave.txt
@@ -44,7 +44,7 @@ ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{
close;
}
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Buwaya Cave";
if (!.@party_id) {
@@ -54,7 +54,7 @@ ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{
mes "team with other people.";
close;
}
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "[Guard]";
mes "This place is dangerous. Please go back.";
mes "If you dont have any business here, please go back.";
@@ -159,7 +159,7 @@ OnTouch:
mes "The party leader did not generate the dungeon yet.";
close;
} else {
- mapannounce "ma_fild02",getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member began hunting Buwaya in Buwaya Cave.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0
+ mapannounce "ma_fild02",getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member began hunting Buwaya in Buwaya Cave.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0
setquest 4229;
warp "1@ma_c",35,57;
end;
diff --git a/npc/re/instances/EclageInterior.txt b/npc/re/instances/EclageInterior.txt
index 9b232ac99..9ad8519b4 100644
--- a/npc/re/instances/EclageInterior.txt
+++ b/npc/re/instances/EclageInterior.txt
@@ -33,7 +33,7 @@
//=========================================================================
ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Eclage Interior";
if (!.@party_id){
mes "-! Warning !-";
@@ -42,7 +42,7 @@ ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{
close;
}
- if (getpartyleader(.@party_id,2) != getcharid(0)) {
+ if (getpartyleader(.@party_id,2) != getcharid(CHAR_ID_CHAR)) {
mes "-! Warning !-";
mes "This current quest will be held at Memorial dungeon.";
mes "Only the party leader will enter. Please create your party.";
@@ -93,7 +93,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{
next;
switch (select("Enter it.", "Forget it.")) {
case 1:
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
if (has_instance("1@ecl") == "") {
mes "It is closed shut.";
@@ -101,7 +101,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{
}
if (.@party_id) {
.@md_name$ = "Eclage Interior";
- if (getpartyleader(.@party_id,2) != getcharid(0)){
+ if (getpartyleader(.@party_id,2) != getcharid(CHAR_ID_CHAR)){
mes "-! Warning !-";
mes "This current quest will be held at Memorial dungeon.";
mes "Only the party leader will enter. Please create your party.";
diff --git a/npc/re/instances/HazyForest.txt b/npc/re/instances/HazyForest.txt
index 7b12e1649..7f85fee50 100644
--- a/npc/re/instances/HazyForest.txt
+++ b/npc/re/instances/HazyForest.txt
@@ -38,7 +38,7 @@
//== Instance Creation =====================================
bif_fild01,158,340,5 script Laphine Soldier#mist 4_M_FAIRYSOLDIER,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Mistwood Maze";
mes "[Laphine Soldier]";
@@ -51,7 +51,7 @@ bif_fild01,158,340,5 script Laphine Soldier#mist 4_M_FAIRYSOLDIER,{
close;
}
.@playtime = questprogress(7211,PLAYTIME);
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
if (.@playtime == 1) {
mes "[Laphine Soldier]";
mes "...Are you sure you're not doing too much?";
@@ -177,7 +177,7 @@ bif_fild01,161,355,0 script Log Tunnel CLEAR_NPC,{
} else {
if (questprogress(7211,PLAYTIME) == 2) erasequest 7211;
if (!questprogress(7211,PLAYTIME)) setquest 7211;
- mapannounce "bif_fild01",getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member is entering the Mistwood Maze.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0
+ mapannounce "bif_fild01",getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member is entering the Mistwood Maze.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0
warp "1@mist",89,29;
close;
}
diff --git a/npc/re/instances/MalangdoCulvert.txt b/npc/re/instances/MalangdoCulvert.txt
index e44fed03b..164caf548 100644
--- a/npc/re/instances/MalangdoCulvert.txt
+++ b/npc/re/instances/MalangdoCulvert.txt
@@ -399,7 +399,7 @@ mal_in01,160,34,4 script Missing, the Cleaner 4_CAT_SAILOR2,{
mes "You don't look like you have Seagod Protection. I can't open door at the moment!";
close;
}
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Culvert";
if (!.@party_id) {
mes "^0000ffYou have to organize a party of";
@@ -409,7 +409,7 @@ mal_in01,160,34,4 script Missing, the Cleaner 4_CAT_SAILOR2,{
}
.@playtime = questprogress(12254,PLAYTIME);
if (!.@playtime) {
- if (getcharid(0) == getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) {
mes "[Missing, the Cleaner]";
mes "Ummm? What's up? Tell me the password if you're the leader!";
next;
@@ -476,7 +476,7 @@ L_Enter:
//== Instance: Common Scripts ==============================
1@pump,63,100,4 script Missing, the Cleaner#0 4_CAT_SAILOR2,{
- if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "[Missing, the Cleaner]";
mes "I am trying to have a conversation with your leader now. Please don't disturb and wait!";
close;
@@ -497,7 +497,7 @@ L_Enter:
mes "Huh? Not ready yet? Talk to me again when you're ready.";
close;
}
- 'party_id = getcharid(1);
+ 'party_id = getcharid(CHAR_ID_PARTY);
mapannounce instance_mapname("1@pump"),"Missing: Move toward the 3 o'clock direction and wait for my next order!",bc_map,"0xff88ff",FW_NORMAL,15;
disablenpc instance_npcname("Missing, the Cleaner#0");
enablenpc instance_npcname("Missing, the Cleaner#n");
@@ -519,7 +519,7 @@ L_Enter:
mes "Hmm? Talk to me again when you're ready.";
close;
}
- 'party_id = getcharid(1);
+ 'party_id = getcharid(CHAR_ID_PARTY);
mapannounce instance_mapname("1@pump"),"Missing: I'll go in first, so follow me! I'll open up a gate at the 3 o'clock direction!",bc_map,"0xff88ff",FW_NORMAL,15;
disablenpc instance_npcname("Missing, the Cleaner#0");
enablenpc instance_npcname("Culvert Entrance#i");
@@ -566,7 +566,7 @@ function script F_mal_missing {
mes "[Missing, the Cleaner]";
mes "I don't care if you get help from your friends or not. I want you to clean up all culverts! Don't forget! I will watch you and give you instructions. Just do what I said!!";
next;
- if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "[Missing, the Cleaner]";
mes "Once your leader finishes preparing, it will begin, so get your hearts ready for it!!";
close;
@@ -594,7 +594,7 @@ function script F_mal_missing {
mes "[Missing, the Cleaner]";
mes "I see seaweed everywhere because you're wiggling! All the culverts will be blocked with seaweed!";
next;
- if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) {
mes "[Missing, the Cleaner]";
mes "Once your leader finishes preparing, settlement will be decided so get your hearts ready for it!!";
close;
diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt
index 0b7bb7e6e..0b21767f7 100644
--- a/npc/re/instances/OldGlastHeim.txt
+++ b/npc/re/instances/OldGlastHeim.txt
@@ -93,7 +93,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
mes("Umm? Did you see me at another place? I don't think so. What about this time?");
next;
if (!questprogress(12317, PLAYTIME)) {
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@p_name$ = getpartyname(.@party_id);
.@md_name$ = "Old Glast Heim";
if (!instance_check_party(.@party_id)) {
@@ -103,13 +103,13 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
}
if (!questprogress(12318, HUNTING))
setquest 12318;
- if (getcharid(0) == getpartyleader(.@party_id, 2))
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id, 2))
.@menu1$ = "Generate Time Gap";
else
.@menu1$ = "";
switch (select(.@menu1$, "Enter Old Glast Heim", "Cancel")) {
case 1:
- if (getcharid(0) != getpartyleader(.@party_id, 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2))
end;
.@instance = instance_create(.@md_name$, .@party_id);
if (.@instance < 0) {
@@ -165,7 +165,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
// Floor 1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1@gl_k,149,41,6 script Varmundt#ghinstance1 4_M_BARMUND,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) {
cutin("gl_barmund2", 2);
mes("[Varmundt]");
mes("Where's your leader? I need his help.");
@@ -181,7 +181,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
select("Oh. Well I...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Ah yes, I am. Herico told me to meet you.");
- unittalk(getcharid(3), _("Ah yes, I am. Herico told me to meet you."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Ah yes, I am. Herico told me to meet you."));
next;
cutin("gl_barmund2", 2);
mes("[Varmundt]");
@@ -191,7 +191,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{
select("Himelmez...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Who is Himelmez?");
- unittalk(getcharid(3), _("Who is Himelmez?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Who is Himelmez?"));
next;
cutin("gl_barmund3", 2);
mes("[Varmundt]");
@@ -277,7 +277,7 @@ OnEnable:
1@gl_k,154,104,3 duplicate(Khalitzburg Knight#1) Khalitzburg Knight#22 4_F_KHALITZBURG
1@gl_k,149,100,6 script Heinrich#ghinstance1 4_M_HEINRICH,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) {
cutin("gl_heinrich2", 2);
mes("[Heinrich]");
mes("Where is your leader? I must talk to him.");
@@ -289,7 +289,7 @@ OnEnable:
select("Sir. Heinrich. Varmundt...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Sir. Heinrich. Do you know what is happening in the castle now?");
- unittalk(getcharid(3), _("Sir. Heinrich. Do you know what is happening in the castle now?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sir. Heinrich. Do you know what is happening in the castle now?"));
next;
mes("[Heinrich]");
mes("Aren't you the adventurer that came along with Varmundt?");
@@ -302,7 +302,7 @@ OnEnable:
select("Himelmez's invasion...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!");
- unittalk(getcharid(3), _("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!"));
next;
cutin("gl_heinrich1", 2);
mes("[Heinrich]");
@@ -321,7 +321,7 @@ OnEnable:
select("Even if you don't believe me...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("I can't make you believe me, but there's no time to argue!");
- unittalk(getcharid(3), _("I can't make you believe me, but there's no time to argue!"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("I can't make you believe me, but there's no time to argue!"));
cutin("gl_barmund2", 255);
next;
cutin("gl_heinrich1", 2);
@@ -801,7 +801,7 @@ OnMyMobDead:
}
1@gl_k,17,51,3 script Altar boy Domun#clearGH 4_M_KID1,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) {
mes("[Altar boy Domun]");
mes("Save me, save me, please...");
close;
@@ -814,7 +814,7 @@ OnMyMobDead:
mesf("[%s]", strcharinfo(PC_NAME));
mes("Hold on!\r"
"Are you the only survivor?");
- unittalk(getcharid(3), _("Hold on! Are you the only survivor?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Hold on! Are you the only survivor?"));
next;
mes("[Altar boy Domun]");
mes("Chamberlains... monks...\r"
@@ -830,7 +830,7 @@ OnMyMobDead:
select("Pull it together!");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Wake up kid! Go east and find the middle passage to the outside! That is safe!");
- unittalk(getcharid(3), _("Wake up kid! Go east and find the middle passage to the outside! That is safe!")); // Displays 1st Letter of char name in small?
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Wake up kid! Go east and find the middle passage to the outside! That is safe!")); // Displays 1st Letter of char name in small?
next;
mes("[Altar boy Domun]");
mes("To the east passage?\r"
@@ -841,7 +841,7 @@ OnMyMobDead:
select("I will give you a weapon.");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Here's a weapon. Just close your eye and swing for those monsters.");
- unittalk(getcharid(3), _("Here's a weapon. Just close your eye and swing for those monsters."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Here's a weapon. Just close your eye and swing for those monsters."));
next;
mes("[Altar boy Domun]");
mes("Ok, I... I'l try.");
@@ -898,7 +898,7 @@ OnMyMobDead:
}
1@gl_k,291,145,3 script Holgren the Destroyer 4_F_JOB_BLACKSMITH,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) {
mes("[Holgren the Destroyer]");
mes("Are you human?");
close;
@@ -911,7 +911,7 @@ OnMyMobDead:
select("Relax! I'm not a monster!");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Relax! I am Human. Are you alone? Anyone else here?");
- unittalk(getcharid(3), _("Relax! I am Human. Are you alone? Anyone else here?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Relax! I am Human. Are you alone? Anyone else here?"));
next;
mes("[Holgren the Destroyer]");
mes("It's only me alive.");
@@ -920,7 +920,7 @@ OnMyMobDead:
select("It's dangerous here...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("It's dangerous here. You know the way to the middle passage? Can you move?");
- unittalk(getcharid(3), _("It's dangerous here. You know the way to the middle passage? Can you move?")); // Displays 1st Letter of char name in small?
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("It's dangerous here. You know the way to the middle passage? Can you move?")); // Displays 1st Letter of char name in small?
next;
mes("[Holgren the Destroyer]");
mes("Yes, I can move. I need to get out of here.");
@@ -929,7 +929,7 @@ OnMyMobDead:
select("Be safe...");
mesf("[%s]", strcharinfo(PC_NAME));
mes("Sorry, I can't go with you.");
- unittalk(getcharid(3), _("Sorry, I can't go with you."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sorry, I can't go with you."));
next;
mes("[Holgren the Destroyer]");
mes("It's ok. You've already done enough. I can help myself. Good luck to you too.");
diff --git a/npc/re/instances/WolfchevLaboratory.txt b/npc/re/instances/WolfchevLaboratory.txt
index ce0ca4c31..e88ec4332 100644
--- a/npc/re/instances/WolfchevLaboratory.txt
+++ b/npc/re/instances/WolfchevLaboratory.txt
@@ -1768,7 +1768,7 @@ lhz_dun04,151,276,3 script Researcher#memo 4_LGTSCIENCE,{
mes "So, please prepare your party members, and take care of those boss creatures. I'm not sure how long this place can hold.";
close;
} else if (lght_duk01 > 6) {
- if (getcharid(1) > 0) {
+ if (getcharid(CHAR_ID_PARTY) > 0) {
mes "[Wolfchev]";
mes "Are you all set there? I will prepare the entrance if you are the leader of that party.";
next;
@@ -1859,8 +1859,8 @@ lhz_dun04,151,276,3 script Researcher#memo 4_LGTSCIENCE,{
}
}
}
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
- .@instance = instance_create("Worsef", getcharid(1));
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
+ .@instance = instance_create("Worsef", getcharid(CHAR_ID_PARTY));
if (.@instance < 0) {
mes "[Wolfchev]";
mes "Hmm.. Lab entering system is a bit weird. Would wait for me to check the system?";
@@ -2035,7 +2035,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{
1@lhz,39,168,0 script Manual Sheet#1_1 CLEAR_NPC,{
mes "There are valve manual sheets littered on the floor.";
next;
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
mes "You the party leader, started to read the manual.";
next;
mes "[Emergency Access Valve Manual]";
@@ -2112,7 +2112,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{
1@lhz,41,172,0 script Valve#1_2 CLEAR_NPC,{
.@open_portal = 0;
mes "This is the left valve for the emergency access.";
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
next;
mes "To which direction do you wish to turn?";
next;
@@ -2174,7 +2174,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{
1@lhz,52,172,0 script Valve#1_3 CLEAR_NPC,{
.@open_portal = 0;
mes "This is the left valve for the emergency access.";
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
next;
mes "To which direction do you wish to turn?";
next;
@@ -2562,7 +2562,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{
//== The Lab No.2 Valves ===================================
- script bio4FLab2Valve FAKE_NPC,{
- if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+ if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) {
progressbar "0xffff00", 20;
stopnpctimer;
donpcevent instance_npcname("Lab2#2_2")+"::OnDisableValve1";
diff --git a/npc/re/instances/ghost_palace.txt b/npc/re/instances/ghost_palace.txt
index 8b0bbb866..08fe3b71b 100644
--- a/npc/re/instances/ghost_palace.txt
+++ b/npc/re/instances/ghost_palace.txt
@@ -59,13 +59,13 @@ dali02,44,129,5 script Unpleasent Royal Guard 4_M_SAKRAYROYAL,{
"I will be right behind you!");
close();
}
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
if (!.@party_id) {
mes("[Unpleasent Royal Guard]");
mes("This is a solo instance. Please form a solo party before continuing.");
close();
}
- if (getcharid(0) != getpartyleader(.@party_id,2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id,2)) {
mes("[Unpleasent Royal Guard]");
mes("I'm looking for adventurers to help me!\r"
"I want to talk to the team leader, can I?");
@@ -134,7 +134,7 @@ dali02,41,134,0 script Interdimensional Device::gpportal PORTAL,{
mes("The monsters that attacked the palace are wandering around the secret entrance. It would be very bad if they spotted us... Please wait until the time limit for re-entrance passed.");
close();
}
- if (getcharid(0) == getpartyleader(.@party_id,2) && !questprogress(1260)) {
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2) && !questprogress(1260)) {
mes("[Unpleasent Royal Guard]");
mes("I'm looking for adventurers to help me!\r"
"I want to talk to the team leader, can I?");
@@ -155,7 +155,7 @@ dali02,41,134,0 script Interdimensional Device::gpportal PORTAL,{
mes("^FF0000Inside the device you see a dark hole. If you wish to enter you may wish to talk to the Unpleasant Royal Guard first.^000000");
close();
}
- mapannounce("dali", sprintf(_$("%s of the party, %s, is entering the Ghost Palace."), strcharinfo(PC_NAME), getpartyname(getcharid(1))), bc_map, C_SPRINGGREEN);
+ mapannounce("dali", sprintf(_$("%s of the party, %s, is entering the Ghost Palace."), strcharinfo(PC_NAME), getpartyname(getcharid(CHAR_ID_PARTY))), bc_map, C_SPRINGGREEN);
if (!questprogress(1260)) setquest 1260;
setquest 1261;
warp("1@spa", 198, 188);
@@ -550,7 +550,7 @@ OnInstanceInit:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Sakray, What do you want sympathy? Or is it a trap?");
- unittalk(getcharid(3), _("Sakray, What do you want sympathy? Or is it a trap?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sakray, What do you want sympathy? Or is it a trap?"));
next;
mes("[Sakray]");
mes("Non...I did not need to make an effort to catch a novice.");
@@ -558,7 +558,7 @@ OnInstanceInit:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("If so... then why...?");
- unittalk(getcharid(3), _("If so... then why...?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("If so... then why...?"));
next;
cutin("cry-b", 3);
mes("[Sakray]");
@@ -580,7 +580,7 @@ OnInstanceInit:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("...");
- unittalk(getcharid(3), _("..."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("..."));
next;
mes("[Sakray]");
mes("Heh heh... I will keep watching you until the day you grow up enough.");
diff --git a/npc/re/instances/octopus_cave.txt b/npc/re/instances/octopus_cave.txt
index 71f164ff7..b09d243ab 100644
--- a/npc/re/instances/octopus_cave.txt
+++ b/npc/re/instances/octopus_cave.txt
@@ -38,7 +38,7 @@
//== Instance Creation =====================================
mal_dun01,151,235,5 script Starfish 4_ASTER,{
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@md_name$ = "Octopus Cave";
if (!.@party_id) {
@@ -46,7 +46,7 @@ mal_dun01,151,235,5 script Starfish 4_ASTER,{
mes("You alone is powerless, hehe! Better get someone to help you out. Make a party, and come back later.");
close;
}
- if (getcharid(0) != getpartyleader(.@party_id, 2)) {
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2)) {
mes("[Starfish]");
mes("Where is your leader, hehe. I don't talk to some random people. Bring your boss to me.");
close;
@@ -136,7 +136,7 @@ mal_dun01,153,237,5 script Weird Entrance CLEAR_NPC,{
close;
}
- mapannounce("mal_dun01", sprintf(_$("%s party's %s member started to hunt the Octopus!"), getpartyname(getcharid(1)), strcharinfo(PC_NAME)), bc_map, C_SPRINGGREEN);
+ mapannounce("mal_dun01", sprintf(_$("%s party's %s member started to hunt the Octopus!"), getpartyname(getcharid(CHAR_ID_PARTY)), strcharinfo(PC_NAME)), bc_map, C_SPRINGGREEN);
if (!questprogress(4197)) setquest 4197;
warp "1@cash", 199, 99;
end;
diff --git a/npc/re/instances/saras_memory.txt b/npc/re/instances/saras_memory.txt
index 0c7f4a9cb..2b3b4f2c0 100644
--- a/npc/re/instances/saras_memory.txt
+++ b/npc/re/instances/saras_memory.txt
@@ -168,7 +168,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{
erasequest 15002;
end;
} else if (!.@sara_time) {
- .@party_id = getcharid(1);
+ .@party_id = getcharid(CHAR_ID_PARTY);
.@p_name$ = getpartyname(.@party_id);
.@md_name$ = "Sara's Memory";
if (!instance_check_party(.@party_id)) {
@@ -177,13 +177,13 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{
"can use quotes to put spaces in a party name.");
close;
}
- if (getcharid(0) == getpartyleader(.@party_id, 2))
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id, 2))
.@menu1$ = "Boot up the dimensional device";
else
.@menu1$ = "";
switch (select(.@menu1$, "Use the dimensional device", "Cancel")) {
case 1:
- if (getcharid(0) != getpartyleader(.@party_id, 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2))
end;
.@instance = instance_create(.@md_name$, .@party_id);
if (.@instance < 0) {
@@ -219,11 +219,11 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{
}
1@sara,261,156,5 script A girl#sarains 4_F_SARAH_BABY,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2))
end;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Where am I?");
- unittalk(getcharid(3), _("Where am I?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Where am I?"));
next;
cutin "sara_9sara1.bmp", 2;
mes("[A girl]");
@@ -232,7 +232,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Are you from here? You don't seem to quite match the locals either.");
- unittalk(getcharid(3), _("Are you from here? You don't seem to quite match to locals either."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Are you from here? You don't seem to quite match to locals either."));
next;
mes("[A girl]");
mes("Yes! I was born here! My name is Sara. Sara Irene!");
@@ -244,7 +244,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Oh! I am sorry! Uh... Why are you standing out here all alone?");
- unittalk(getcharid(3), _("Oh! I am sorry! Uh... Why are you standing out here all alone?"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Oh! I am sorry! Uh... Why are you standing out here all alone?"));
next;
mes("[Sara Irene]");
mes("I am waiting for my father. He said that he will be here soon.");
@@ -523,7 +523,7 @@ OnEnable:
OnTouch:
.@map$ = instance_mapname("1@sara");
warp .@map$, 89, 175;
- if (getcharid(0) == getpartyleader(getcharid(1),2))
+ if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2))
viewpoint 1, 39, 142, 1, C_GREEN;
end;
}
@@ -546,7 +546,7 @@ OnTouch:
}
1@sara,107,325,5 script Sara Irene#sarains1 4_F_SARAH_BABY,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2))
end;
cutin "sara_9sara1.bmp", 2;
mes("[Sara Irene]");
@@ -1007,7 +1007,7 @@ OnMyMobDead:
}
1@sara,152,233,5 script Sara Irene#sarains2 4_F_SARAH_BABY,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2))
end;
cutin "sara_9sara2.bmp", 2;
mes("[Sara Irene]");
@@ -1031,7 +1031,7 @@ OnMyMobDead:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("I won't let you take Sara!");
- unittalk(getcharid(3), _("I won't let you take Sara!"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("I won't let you take Sara!"));
next;
cutin "sara_elder_irine3.bmp", 2;
mes("[Doyen Irene]");
@@ -1040,7 +1040,7 @@ OnMyMobDead:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Sara... run! Save yourself!");
- unittalk(getcharid(3), _("Sara... run! Save yourself!"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sara... run! Save yourself!"));
next;
cutin "sara_9sara2.bmp", 2;
mes("[Sara Irene]");
@@ -1151,7 +1151,7 @@ OnMyMobDead:
}
1@sara,156,236,3 script Doyen Irene#sarains3 4_M_CHIEF_IRIN,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2))
end;
cutin "sara_elder_irine4.bmp", 2;
mes("[Doyen Irene]");
@@ -1164,7 +1164,7 @@ OnMyMobDead:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!");
- unittalk(getcharid(3), _("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!"));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!"));
next;
mes("[Doyen Irene]");
mes("You.. think I killed Sara's mother?");
@@ -1188,7 +1188,7 @@ OnMyMobDead:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene.");
- unittalk(getcharid(3), _("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene."));
next;
mes("[Doyen Irene]");
mes("If.. you are telling the truth...\r"
@@ -1201,11 +1201,11 @@ OnMyMobDead:
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("There might be more assassins so we have to find Sara as fast as we can.");
- unittalk(getcharid(3), _("There might be more assassins so we have to find Sara as fast as we can."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("There might be more assassins so we have to find Sara as fast as we can."));
next;
mesf("[%s]", strcharinfo(PC_NAME));
mes("Sara believes that you killed her mother. We need to tell her the truth.");
- unittalk(getcharid(3), _("Sara believes that you killed her mother. We need to tell her the truth."));
+ unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sara believes that you killed her mother. We need to tell her the truth."));
next;
mes("[Doyen Irene]");
mes("We must do our best to find her. Let's split up and search for her.\r"
@@ -1233,7 +1233,7 @@ OnDisable:
}
1@sara,39,142,3 script Sara Irene#sarains3 4_F_SARAH_BABY,{
- if (getcharid(0) != getpartyleader(getcharid(1), 2))
+ if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2))
end;
mes("^FF0000As you are about to call out to Sara a sudden blow knocks you down from behind.^000000");
dispbottom(_("As you are about to call out to Sara a sudden blow knocks you down from behind."));
diff --git a/npc/re/quests/eden/100-110.txt b/npc/re/quests/eden/100-110.txt
index 2ea72a2d1..3cc47f6ef 100644
--- a/npc/re/quests/eden/100-110.txt
+++ b/npc/re/quests/eden/100-110.txt
@@ -52,7 +52,7 @@ moc_para01,37,95,5 script Gelkah#1 4_F_GELKA,{
end;
}
mes "[Gelkah]";
- if (!countitem(Para_Team_Mark)) {
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
mes "- You need to have an -";
mes "- ^4d4dff'Eden Group Mark'^000000 -";
mes "- to receive these missions. -";
@@ -1047,7 +1047,7 @@ S_Hunting:
moc_para01,41,95,5 script Rohtert#12 4_M_ROTERT,{
mes "[Rohtert]";
- if (!countitem(Para_Team_Mark)) {// Para_Team_Mark
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
cutin "rote01",2;
mes "You are not even a member of Eden Group. What are you doing here?";
mes "I'm only dealing with base level ^FF0000100 - 110^000000 adventurers.";
diff --git a/npc/re/quests/eden/11-25.txt b/npc/re/quests/eden/11-25.txt
index 361d6a2e3..f65ad9090 100644
--- a/npc/re/quests/eden/11-25.txt
+++ b/npc/re/quests/eden/11-25.txt
@@ -35,7 +35,7 @@
//=========================================================================
moc_para01,36,38,3 script Mission [11 - 25]#Tuto 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "- You need to have an -";
mes "- ^4d4dff'Eden Group Mark'^000000 -";
mes "- to receive these missions. -";
diff --git a/npc/re/quests/eden/111-120.txt b/npc/re/quests/eden/111-120.txt
index f133ca85f..4422c92c7 100644
--- a/npc/re/quests/eden/111-120.txt
+++ b/npc/re/quests/eden/111-120.txt
@@ -41,7 +41,7 @@
moc_para01,17,95,5 script Mingmin#1 4_F_GENETIC,{
mes "[Mingmin]";
- if (!countitem(Para_Team_Mark)) {// Para_Team_Mark
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
cutin "min02",0;
mes "A stranger. This place is supposed to be for Eden Group Members only.";
mes "I'm in need base level ^FF0000111 - 120^000000 adventurers to help my research.";
diff --git a/npc/re/quests/eden/121-130.txt b/npc/re/quests/eden/121-130.txt
index 32fbdeb26..d48c71702 100644
--- a/npc/re/quests/eden/121-130.txt
+++ b/npc/re/quests/eden/121-130.txt
@@ -41,7 +41,7 @@
moc_para01,44,81,3 script Melody-Jack#1 4_M_MELODY,8,8,{
mes "[Melody-Jack]";
- if (!countitem(Para_Team_Mark)) {// Para_Team_Mark
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
mes "Who the hell are you? Get out of here!";
mes "I'm only talking to base level ^FF0000121-130^000000 adventurers.";
}
@@ -582,7 +582,7 @@ OnTouch:
moc_para01,17,77,5 script Aigu#1 4_F_IU,{
mes "[Aigu]";
- if (!countitem(Para_Team_Mark)) {// Para_Team_Mark
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
mes "Oh, why aren't you a part of Eden Group?";
mes "I'm only talking to base level ^FF0000121-130^000000 adventurers.";
}
diff --git a/npc/re/quests/eden/131-140.txt b/npc/re/quests/eden/131-140.txt
index 806466624..fa6061b42 100644
--- a/npc/re/quests/eden/131-140.txt
+++ b/npc/re/quests/eden/131-140.txt
@@ -42,7 +42,7 @@
moc_para01,41,76,3 script Ragi#1 4_M_RAGI,{
cutin "ragi01",0;
mes "[Ragi]";
- if (!countitem(Para_Team_Mark)) {// Para_Team_Mark
+ if (!countitem(Para_Team_Mark) && !countitem(Para_Team_Mark_)) {
mes "Only adventurers from Eden Group are welcome here.";
mes "I'm giving requests to base level ^FF0000130-140^000000 adventurers only.";
}
diff --git a/npc/re/quests/eden/26-40.txt b/npc/re/quests/eden/26-40.txt
index c80f1c2c8..3a3068a5c 100644
--- a/npc/re/quests/eden/26-40.txt
+++ b/npc/re/quests/eden/26-40.txt
@@ -35,7 +35,7 @@
//=========================================================================
moc_para01,38,38,3 script Mission [26 - 40] 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "You are not a qualified member. You can not use the bulletin board.";
close;
}
diff --git a/npc/re/quests/eden/41-55.txt b/npc/re/quests/eden/41-55.txt
index a13db78f8..b7d95aa71 100644
--- a/npc/re/quests/eden/41-55.txt
+++ b/npc/re/quests/eden/41-55.txt
@@ -35,7 +35,7 @@
//=========================================================================
moc_para01,40,38,3 script Mission [41 - 55] 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "You are not an Eden group member. You are not qualified to access the bulletin board.";
close;
}
diff --git a/npc/re/quests/eden/56-70.txt b/npc/re/quests/eden/56-70.txt
index 741e6af89..c6aeb8c15 100644
--- a/npc/re/quests/eden/56-70.txt
+++ b/npc/re/quests/eden/56-70.txt
@@ -36,7 +36,7 @@
//=========================================================================
moc_para01,42,38,3 script Mission [56 - 70] 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "To get these missions, I need to Join the Eden Group first. I must find Secretary Lime Evenor and become a member.";
close;
}
diff --git a/npc/re/quests/eden/71-85.txt b/npc/re/quests/eden/71-85.txt
index f2bd68b6f..31f51871d 100644
--- a/npc/re/quests/eden/71-85.txt
+++ b/npc/re/quests/eden/71-85.txt
@@ -35,7 +35,7 @@
//=========================================================================
moc_para01,44,38,3 script Mission [71 - 85] 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "- Only members of the -";
mes "- Eden Group can read -";
mes "- this bulletin board. -";
diff --git a/npc/re/quests/eden/86-90.txt b/npc/re/quests/eden/86-90.txt
index 029a482ad..394970944 100644
--- a/npc/re/quests/eden/86-90.txt
+++ b/npc/re/quests/eden/86-90.txt
@@ -41,7 +41,7 @@
//=========================================================================
moc_para01,48,175,3 script 86-90 Mission Board 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "Wait a minute!";
mes "-You need to have an-";
mes "-^4d4dff'Eden Group Mark'^000000-";
diff --git a/npc/re/quests/eden/91-99.txt b/npc/re/quests/eden/91-99.txt
index 2c86f6091..328cc4474 100644
--- a/npc/re/quests/eden/91-99.txt
+++ b/npc/re/quests/eden/91-99.txt
@@ -41,7 +41,7 @@
//=========================================================================
moc_para01,48,177,3 script 91-99 Mission Board 4_BOARD3,{
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "Wait a minute!";
mes "-You need to have an-";
mes "-^4d4dff'Eden Group Mark'^000000-";
diff --git a/npc/re/quests/eden/eden_common.txt b/npc/re/quests/eden/eden_common.txt
index f07ebb2ad..9085cad91 100644
--- a/npc/re/quests/eden/eden_common.txt
+++ b/npc/re/quests/eden/eden_common.txt
@@ -44,6 +44,26 @@ moc_para01,27,35,5 script Secretary Lime Evenor 4_F_EDEN_OFFICER,{
mes "- after you loose some weight. -";
close;
}
+ if (countitem(Para_Team_Mark) > 0) {
+ mes "[Lime Evenor]";
+ mes "Thanks to many adventurers visiting our Eden Group, we've recently prepared a new version of Eden Group Mark for our visitors.";
+ mes "And it is also possible to exchange old version of Eden Group Mark into a new one.";
+ next;
+ mes "[Lime Evenor]";
+ mes "Though it has a slight time delay, this new version of Eden Group Mark will send you back to current saved location.";
+ mes "Would you like to exchange yours?";
+ next;
+ if (select("Sure", "I'm good.") == 2){
+ mes "[Lime Evenor]";
+ mes "What possible reason would you have... to not exchange?";
+ close;
+ }
+ delitem Para_Team_Mark,1;
+ getitem Para_Team_Mark_,1;
+ mes "[Lime Evenor]";
+ mes "There you go. Come back again~";
+ close;
+ }
mes "[Lime Evenor]";
mes "People who follow their dreams and romances listen to me. We are representatives of the paradise called 'The garden of Eden' called the Eden group . There is no place like this anywhere.";
mes "Hello. Can I help you?";
@@ -67,7 +87,7 @@ moc_para01,27,35,5 script Secretary Lime Evenor 4_F_EDEN_OFFICER,{
next;
break;
case 2:
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "[Lime Evenor]";
mes "You can be a Eden's member by simply registering with me.";
mes "Would you like to join Eden Group?";
@@ -106,7 +126,7 @@ moc_para01,27,35,5 script Secretary Lime Evenor 4_F_EDEN_OFFICER,{
next;
mes "[Lime Evenor]";
mes "Hopefully you can do great work as an Eden's member.";
- getitem Para_Team_Mark,1;
+ getitem Para_Team_Mark_,1;
next;
break;
case 2:
@@ -179,7 +199,7 @@ moc_para01,27,35,5 script Secretary Lime Evenor 4_F_EDEN_OFFICER,{
}
break;
case 4:
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Lime Evenor]";
mes "Would like to try some missions as an Eden member?";
next;
@@ -306,7 +326,7 @@ OnTouch:
}
moc_para01,47,39,3 script #warp_2_pass HIDDEN_NPC,{
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Lime Evenor]";
mes "Oh, it is an exclusive place only for Eden's members.";
mes "If you are a member, you can come whenever you want!";
diff --git a/npc/re/quests/eden/eden_quests.txt b/npc/re/quests/eden/eden_quests.txt
index 4e472d1af..f58c3ed5a 100644
--- a/npc/re/quests/eden/eden_quests.txt
+++ b/npc/re/quests/eden/eden_quests.txt
@@ -37,7 +37,7 @@
moc_para01,25,35,4 script Instructor Boya#para01 4_M_KNIGHT_GOLD,{
mes "[Boya]";
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "You are not in my group are you?";
mes "I don't have anything to say to outsiders.";
mes "If you want something register with my group.";
@@ -839,7 +839,7 @@ moc_fild11,180,253,5 script Talking Dog#para03 4_RUS_DWOLF,{
mes "Not a wolf.";
mes "I wasn't a dog originally...";
next;
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Talking Dog]";
mes "Anyway are you a Eden Group member?";
mes "Oh good to see you.";
@@ -1047,7 +1047,7 @@ prt_sewb1,131,262,3 script Timid Cat#para04 4_M_BABYCAT,{
pay_arche,41,136,3 script Eden Member Karl#para05 4_M_KHMAN,{
if (para_suv01 < 13) {
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Karl]";
mes "Hey, how are you?";
mes "Good to see you~";
@@ -1190,7 +1190,7 @@ pay_arche,41,136,3 script Eden Member Karl#para05 4_M_KHMAN,{
anthell01,29,264,5 script Eden Member Cloud#para06 4_M_HUMAN_02,{
if (para_suv01 < 17) {
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Cloud]";
mes "Oops.";
mes "You are a member of my group.";
@@ -1380,7 +1380,7 @@ anthell01,29,264,5 script Eden Member Cloud#para06 4_M_HUMAN_02,{
in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{
if (para_suv01 < 24) {
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Hooksha]";
mes "Unbelievable why did you come here?";
mes "Um... You are not on the third step of the training?";
@@ -1649,7 +1649,7 @@ in_orcs01,38,175,3 script Eden Member Hooksha 1_F_SIGNZISK,{
iz_dun04,43,46,3 script Eden Member Callandiva 4_F_CRU,{
if (para_suv01 < 33) {
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Callandiva]";
mes "How did you get so deep in this ocean city?";
mes "Ah, that symbol is of our group.";
@@ -2243,7 +2243,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{
mes "Ah, Kim-dduck-soon.";
mes "It's the representative meal for normal citizens.";
next;
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
if (Zeny > 2699) {
mes "[Chef]";
mes "Hey, here you are.";
@@ -2282,7 +2282,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{
mes "Course meal B?";
mes "This food with meat and vegetables in hot soup has it's origins from nomadic life under the cold and dry nature.";
next;
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
if (Zeny > 3599) {
mes "[Chef]";
mes "Hey, here you are.";
@@ -2317,7 +2317,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{
mes "How many times do I have to tell you?";
close;
case 4:
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
if (Zeny > 4499) {
mes "[Chef]";
mes "Hey, here you are.";
@@ -2360,7 +2360,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{
close;
}
case 2:
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "[Chef]";
mes "Most jobs should be managed by yourself. So it might be difficult, right?";
mes "Actually it's harmful so they have requested continuously.";
@@ -2469,7 +2469,7 @@ moc_para01,179,44,3 script Chef 4_M_CHNCOOK,{
moc_para01,23,35,5 script Instructor Ur#2nd01 4_M_KNIGHT_BLACK,{
mes "[Instructor Ur]";
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "Hey there!";
mes "I see you're not one of our agents?";
mes "Are you interested in joining us?";
@@ -3740,7 +3740,7 @@ moc_para01,111,83,3 script Blacksmith Thorn#2nd10 2_M_OLDBLSMITH,{
close;
}
mes "[Thorn]";
- if (countitem(Para_Team_Mark) < 1) {
+ if (countitem(Para_Team_Mark) < 1 && countitem(Para_Team_Mark_) < 1) {
mes "Hmm, are you a member of Eden Group?";
mes "You need to be one of our members to use my services.";
close;
diff --git a/npc/re/quests/eden/eden_service.txt b/npc/re/quests/eden/eden_service.txt
index 387141623..ce6efaa67 100644
--- a/npc/re/quests/eden/eden_service.txt
+++ b/npc/re/quests/eden/eden_service.txt
@@ -50,7 +50,7 @@
mes "3.Cabinet fee is";
mes " ^4d4dff500 zeny^000000!";
next;
- if (countitem(Para_Team_Mark) > 0) {
+ if (countitem(Para_Team_Mark) > 0 || countitem(Para_Team_Mark_) > 0) {
mes "You need to insert zeny to use the cabinet.";
mes "Cost : 500 Zeny ";
mes "Would you like to use it?";
diff --git a/npc/re/warps/cities/izlude.txt b/npc/re/warps/cities/izlude.txt
index 0fb3b1f86..124e3ed1f 100644
--- a/npc/re/warps/cities/izlude.txt
+++ b/npc/re/warps/cities/izlude.txt
@@ -83,6 +83,7 @@ OnTouch:
OnInit:
questinfo(21001, QTYPE_QUEST, 1, Job_Novice);
+ end;
}
iz_int,47,30,3 script noviship#room1-2 WARPNPC,2,2,{
@@ -100,31 +101,37 @@ iz_int,56,15,0 script noviship WARPNPC,2,2,{
OnTouch:
savepoint("int_land"+strnpcinfo(NPC_NAME_HIDDEN), 77, 101);
warp("int_land"+strnpcinfo(NPC_NAME_HIDDEN), 85, 107);
+ end;
}
int_land,49,57,0 script noviship#izlude WARPNPC,2,2,{
end;
OnTouch:
- mes "^4d4dffOnce you left this island there is no way back.";
- mes "Are you sure you want to go directly to Izlude?^000000";
- next;
- mes "^4d4dffIf you do, the quest got deleted from your Quest Log.^000000";
- next;
+ mes("^4d4dffOnce you left this island there is no way back.");
+ mes("Are you sure you want to go directly to Izlude?^000000");
+ next();
+ mes("^4d4dffIf you do, the quest got deleted from your Quest Log.^000000");
+ next();
if (select("Do not go to Izlude yet", "Sail to Izlude!") == 1) {
- mes "[Sailor]";
- mes "You want to stay here longer?";
- mes "Good, then I wait until you're ready~";
+ mes("[Sailor]");
+ mes("You want to stay here longer?");
+ mes("Good, then I wait until you're ready~");
close();
}
- mes "[Sailor]";
- mes "Lets head toward Izlude!";
- close2;
+ mes("[Sailor]");
+ mes("Lets head toward Izlude!");
+ close2();
if (questprogress(21001))
- erasequest 21001;
+ erasequest(21001);
if (questprogress(21002))
- erasequest 21002;
- warp("izlude"+strnpcinfo(NPC_NAME_HIDDEN), 196, 209);
+ erasequest(21002);
+
+ .@map$ = "izlude";
+ if (strnpcinfo(NPC_NAME_HIDDEN) != "izlude")
+ .@map$ = .@map$ + strnpcinfo(NPC_NAME_HIDDEN);
+
+ warp(.@map$, 196, 209);
end;
}
diff --git a/npc/re/woe-fe/invest_main.txt b/npc/re/woe-fe/invest_main.txt
index 012a96afe..c912444cc 100644
--- a/npc/re/woe-fe/invest_main.txt
+++ b/npc/re/woe-fe/invest_main.txt
@@ -902,7 +902,7 @@ OnAgitInvest:
mes "Please come back during the investment duration.";
close;
}
- .@guild = getcharid(2);
+ .@guild = getcharid(CHAR_ID_GUILD);
for(.@i = 1; .@i<=5; ++.@i) {
.@castle_name$[.@i] = getcastlename(.@npc$+"g_cas0"+.@i);
.@owner_id[.@i] = getcastledata(.@npc$+"g_cas0"+.@i,1);
@@ -1114,7 +1114,7 @@ OnAgitInvest:
}
.@GID = getcastledata(strnpcinfo(NPC_MAP),1);
- if (getcharid(2) != .@GID) {
+ if (getcharid(CHAR_ID_GUILD) != .@GID) {
mes "[Gate Manager]";
mes "You don't seem to be the member of guild owning this castle.";
mes "If you need any help, please visit any of our guild members at "+.@realm$+" Square.";
@@ -1145,7 +1145,7 @@ OnAgitInvest:
mes "Please come back during the investment duration.";
close;
}
- if (getcharid(2) != .@GID) {
+ if (getcharid(CHAR_ID_GUILD) != .@GID) {
mes "[Gate Manager]";
mes "You don't seem to be the member of the guild owning this castle.";
mes "Please use the normal investment from "+.@realm$+" Square.";
diff --git a/npc/woe-fe/agit_main.txt b/npc/woe-fe/agit_main.txt
index 912063b8b..5ac5b8e9a 100644
--- a/npc/woe-fe/agit_main.txt
+++ b/npc/woe-fe/agit_main.txt
@@ -101,10 +101,10 @@ OnStartArena:
// The Emperium has been broken.
OnAgitBreak:
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
// Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen)
if (.@GID <= 0) {
- .@notice$ = "Character "+strcharinfo(PC_NAME)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(NPC_NAME_HIDDEN)+" while guildless. No data will be saved and Emperium respawned.";
+ .@notice$ = "Character "+strcharinfo(PC_NAME)+" ("+getcharid(CHAR_ID_CHAR)+") broke the Emperium in Castle: "+strnpcinfo(NPC_NAME_HIDDEN)+" while guildless. No data will be saved and Emperium respawned.";
logmes .@notice$; debugmes .@notice$;
donpcevent "Agit#"+strnpcinfo(NPC_NAME_HIDDEN)+"::OnStartArena";
end;
@@ -342,7 +342,7 @@ OnRecvCastle:
}
cutin "kafra_01",2;
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[Kafra Employee]";
mes "Welcome. ^ff0000" + getguildname(.@GID) + "^000000 Member.";
mes "The Kafra Corporation will stay with you wherever you go.";
@@ -969,7 +969,7 @@ OnRecvCastle:
mes "There's a small lever. Will you pull it?";
next;
if(select("Pull.", "Don't pull.") == 1) {
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
close2;
warp .@destination$,.@coordinates[0],.@coordinates[1];
end;
diff --git a/npc/woe-fe/aldeg_cas01.txt b/npc/woe-fe/aldeg_cas01.txt
index 4472a0f46..5c76ca483 100644
--- a/npc/woe-fe/aldeg_cas01.txt
+++ b/npc/woe-fe/aldeg_cas01.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("aldeg_cas01",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas01",1)) {
warp "aldeg_cas01",218,170;
end;
}
diff --git a/npc/woe-fe/aldeg_cas02.txt b/npc/woe-fe/aldeg_cas02.txt
index 9a9182d96..e588909a1 100644
--- a/npc/woe-fe/aldeg_cas02.txt
+++ b/npc/woe-fe/aldeg_cas02.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("aldeg_cas02",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas02",1)) {
warp "aldeg_cas02",220,190;
end;
}
diff --git a/npc/woe-fe/aldeg_cas03.txt b/npc/woe-fe/aldeg_cas03.txt
index b4b1df558..a0076bfec 100644
--- a/npc/woe-fe/aldeg_cas03.txt
+++ b/npc/woe-fe/aldeg_cas03.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("aldeg_cas03",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas03",1)) {
warp "aldeg_cas03",205,186;
end;
}
diff --git a/npc/woe-fe/aldeg_cas04.txt b/npc/woe-fe/aldeg_cas04.txt
index c0289ec45..f96586f48 100644
--- a/npc/woe-fe/aldeg_cas04.txt
+++ b/npc/woe-fe/aldeg_cas04.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("aldeg_cas04",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas04",1)) {
warp "aldeg_cas04",116,217;
end;
}
diff --git a/npc/woe-fe/aldeg_cas05.txt b/npc/woe-fe/aldeg_cas05.txt
index 7a1747adb..79c5c77af 100644
--- a/npc/woe-fe/aldeg_cas05.txt
+++ b/npc/woe-fe/aldeg_cas05.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("aldeg_cas05",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas05",1)) {
warp "aldeg_cas05",167,225;
end;
}
diff --git a/npc/woe-fe/gefg_cas01.txt b/npc/woe-fe/gefg_cas01.txt
index 65ae7f1e4..364222781 100644
--- a/npc/woe-fe/gefg_cas01.txt
+++ b/npc/woe-fe/gefg_cas01.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("gefg_cas01",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas01",1)) {
warp "gefg_cas01",197,36;
end;
}
diff --git a/npc/woe-fe/gefg_cas02.txt b/npc/woe-fe/gefg_cas02.txt
index 5229586df..5729b4033 100644
--- a/npc/woe-fe/gefg_cas02.txt
+++ b/npc/woe-fe/gefg_cas02.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("gefg_cas02",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas02",1)) {
warp "gefg_cas02",178,43;
end;
}
diff --git a/npc/woe-fe/gefg_cas03.txt b/npc/woe-fe/gefg_cas03.txt
index f52cce240..d74692200 100644
--- a/npc/woe-fe/gefg_cas03.txt
+++ b/npc/woe-fe/gefg_cas03.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("gefg_cas03",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas03",1)) {
warp "gefg_cas03",221,30;
end;
}
diff --git a/npc/woe-fe/gefg_cas04.txt b/npc/woe-fe/gefg_cas04.txt
index b15f87984..39141723f 100644
--- a/npc/woe-fe/gefg_cas04.txt
+++ b/npc/woe-fe/gefg_cas04.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("gefg_cas04",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas04",1)) {
warp "gefg_cas04",168,43;
end;
}
diff --git a/npc/woe-fe/gefg_cas05.txt b/npc/woe-fe/gefg_cas05.txt
index a7722d48b..caa9a10fc 100644
--- a/npc/woe-fe/gefg_cas05.txt
+++ b/npc/woe-fe/gefg_cas05.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("gefg_cas05",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas05",1)) {
warp "gefg_cas05",168,31;
end;
}
diff --git a/npc/woe-fe/payg_cas01.txt b/npc/woe-fe/payg_cas01.txt
index 0c5f54be1..d06883620 100644
--- a/npc/woe-fe/payg_cas01.txt
+++ b/npc/woe-fe/payg_cas01.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("payg_cas01",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas01",1)) {
warp "payg_cas01",54,144;
end;
}
diff --git a/npc/woe-fe/payg_cas02.txt b/npc/woe-fe/payg_cas02.txt
index 9666a147f..9b5b97811 100644
--- a/npc/woe-fe/payg_cas02.txt
+++ b/npc/woe-fe/payg_cas02.txt
@@ -53,14 +53,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("payg_cas02",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas02",1)) {
warp "payg_cas02",278,251;
end;
}
diff --git a/npc/woe-fe/payg_cas03.txt b/npc/woe-fe/payg_cas03.txt
index 879866a62..10b859c8f 100644
--- a/npc/woe-fe/payg_cas03.txt
+++ b/npc/woe-fe/payg_cas03.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("payg_cas03",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas03",1)) {
warp "payg_cas03",9,263;
end;
}
diff --git a/npc/woe-fe/payg_cas04.txt b/npc/woe-fe/payg_cas04.txt
index a6732b5b8..46f4fbb6b 100644
--- a/npc/woe-fe/payg_cas04.txt
+++ b/npc/woe-fe/payg_cas04.txt
@@ -53,14 +53,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("payg_cas04",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas04",1)) {
warp "payg_cas04",40,235;
end;
}
diff --git a/npc/woe-fe/payg_cas05.txt b/npc/woe-fe/payg_cas05.txt
index 7e5ce5aae..a2a35790a 100644
--- a/npc/woe-fe/payg_cas05.txt
+++ b/npc/woe-fe/payg_cas05.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("payg_cas05",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas05",1)) {
warp "payg_cas05",243,27;
end;
}
diff --git a/npc/woe-fe/prtg_cas01.txt b/npc/woe-fe/prtg_cas01.txt
index 660dd11ef..33a564fe9 100644
--- a/npc/woe-fe/prtg_cas01.txt
+++ b/npc/woe-fe/prtg_cas01.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("prtg_cas01",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas01",1)) {
warp "prtg_cas01",96,173;
end;
}
diff --git a/npc/woe-fe/prtg_cas02.txt b/npc/woe-fe/prtg_cas02.txt
index 3333de0c2..6531b681f 100644
--- a/npc/woe-fe/prtg_cas02.txt
+++ b/npc/woe-fe/prtg_cas02.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("prtg_cas02",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas02",1)) {
warp "prtg_cas02",169,55;
end;
}
diff --git a/npc/woe-fe/prtg_cas03.txt b/npc/woe-fe/prtg_cas03.txt
index 9040cb697..2a3879f65 100644
--- a/npc/woe-fe/prtg_cas03.txt
+++ b/npc/woe-fe/prtg_cas03.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("prtg_cas03",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas03",1)) {
warp "prtg_cas03",181,215;
end;
}
diff --git a/npc/woe-fe/prtg_cas04.txt b/npc/woe-fe/prtg_cas04.txt
index 48c0f7026..3e0de365f 100644
--- a/npc/woe-fe/prtg_cas04.txt
+++ b/npc/woe-fe/prtg_cas04.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("prtg_cas04",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas04",1)) {
warp "prtg_cas04",258,247;
end;
}
diff --git a/npc/woe-fe/prtg_cas05.txt b/npc/woe-fe/prtg_cas05.txt
index 8ad8c6f77..56dc902a3 100644
--- a/npc/woe-fe/prtg_cas05.txt
+++ b/npc/woe-fe/prtg_cas05.txt
@@ -52,14 +52,14 @@
mes "ownership of this castle.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "[ Echoing Voice ]";
mes "Brave ones...";
mes "Do you wish to return to your honorable place?";
next;
if(select("Return to the guild castle.", "Quit.") == 1) {
close2;
- if (getcharid(2) == getcastledata("prtg_cas05",1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas05",1)) {
warp "prtg_cas05",52,41;
end;
}
diff --git a/npc/woe-se/agit_main_se.txt b/npc/woe-se/agit_main_se.txt
index 9e01c6efd..c9b34f610 100644
--- a/npc/woe-se/agit_main_se.txt
+++ b/npc/woe-se/agit_main_se.txt
@@ -230,7 +230,7 @@ OnTreasureDied:
mes "to conquer this stronghold?";
close;
}
- if (getcharid(2) != .@GID || strcharinfo(PC_NAME) != getguildmaster(.@GID)) {
+ if (getcharid(CHAR_ID_GUILD) != .@GID || strcharinfo(PC_NAME) != getguildmaster(.@GID)) {
mes "[ Steward ]";
mes "Hmpf. Your threats don't";
mes "scare me! Guardians, drive";
@@ -619,7 +619,7 @@ OnStop:
end;
OnStartArena:
- .@GID = getcharid(2);
+ .@GID = getcharid(CHAR_ID_GUILD);
.@region$ = (compare(strnpcinfo(NPC_MAP),"arug"))?"Valfreyja":"Nithafjoll";
// Lower castle Economy
.@Economy = getcastledata(strnpcinfo(NPC_MAP),2)-5;
@@ -663,7 +663,7 @@ OnStartArena:
mes "over this stronghold.";
close;
}
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) != getguildmaster(.@GID)) {
mes .@n$;
mes "As guardian of this";
@@ -854,7 +854,7 @@ OnInit:
- script Kafra#template FAKE_NPC,{
cutin "kafra_01",2;
.@GID = getcastledata(strnpcinfo(NPC_MAP),1);
- if (getcharid(2) == .@GID && getgdskilllv(.@GID,10001)) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID && getgdskilllv(.@GID,10001)) {
mes "[Kafra Employee]";
mes "Welcome, proud member";
mes "of the ^FF0000"+getguildname(.@GID)+"^000000 Guild!";
@@ -967,7 +967,7 @@ OnInit:
.@GID = getcastledata(strnpcinfo(NPC_MAP),1);
.@num = atoi(charat(strnpcinfo(NPC_NAME_VISIBLE),0));
.@var$ = "$agit_"+strnpcinfo(NPC_NAME_HIDDEN);
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
mes "^3355FFYou will need the";
mes "following materials to";
mes "rebuild a destroyed";
@@ -1120,7 +1120,7 @@ OnEnable:
.@GID = getcastledata(strnpcinfo(NPC_MAP),1);
.@num = atoi(charat(strnpcinfo(NPC_NAME_VISIBLE),15));
.@var$ = "$agit_"+strnpcinfo(NPC_NAME_HIDDEN);
- if (getcharid(2) == .@GID) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID) {
if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) {
if (getd(.@var$+"["+(.@num+1)+"]") == 2) {
mes "^3355FFDemolished Fortress";
@@ -1707,7 +1707,7 @@ OnDisable:
//== Link Flags (function) =================================
function script LinkFlag {
- if (!getcharid(2) || getcharid(2) != getcastledata(strnpcinfo(NPC_MAP),1)) end;
+ if (!getcharid(CHAR_ID_GUILD) || getcharid(CHAR_ID_GUILD) != getcastledata(strnpcinfo(NPC_MAP),1)) end;
if (getarg(0) == "Convenience Facility") {
mes "^3355FFThis is the Stronghold";
mes "Teleport Service. Would";
@@ -1754,13 +1754,13 @@ function script ReturnFlag {
mes "be recognized as its new owner.";
close;
}
- if (getcharid(2) == .@GID && getarg(1,0)) {
+ if (getcharid(CHAR_ID_GUILD) == .@GID && getarg(1,0)) {
mes "[ Ringing Voice ]";
mes "Courageous one,";
mes "do you wish to return";
mes "to your stronghold?";
next;
- if(select("Return to the Stronghold", "Cancel") == 1 && getcharid(2) == getcastledata(getarg(0),1)) {
+ if(select("Return to the Stronghold", "Cancel") == 1 && getcharid(CHAR_ID_GUILD) == getcastledata(getarg(0),1)) {
if (compare(getarg(0),"arug")) {
if (getarg(0) == "arug_cas01") setarray .@i[0],67,193;
else if (getarg(0) == "arug_cas02") setarray .@i[0],43,256;
@@ -1814,7 +1814,7 @@ function script ReturnFlag {
//== Guild Dungeon Warps ===================================
- script Sunflower#template FAKE_NPC,{
- if (getcharid(2) == getcastledata(strnpcinfo(NPC_MAP),1)) {
+ if (getcharid(CHAR_ID_GUILD) == getcastledata(strnpcinfo(NPC_MAP),1)) {
mes "- It's an amazingly huge sunflower; as big as a human! ... You feel something mysterious emanating from the flower. -";
next;
switch(select("Hold the stem.", "Do nothing.")) {
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index fcd9d8478..640258d4f 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -44,7 +44,7 @@ CREATE TABLE `item_db` (
`equip_jobs` bigint(20) UNSIGNED DEFAULT NULL,
`equip_upper` tinyint(8) UNSIGNED DEFAULT NULL,
`equip_genders` tinyint(2) UNSIGNED DEFAULT NULL,
- `equip_locations` smallint(4) UNSIGNED DEFAULT NULL,
+ `equip_locations` mediumint(8) UNSIGNED DEFAULT NULL,
`weapon_level` tinyint(2) UNSIGNED DEFAULT NULL,
`equip_level_min` smallint(5) UNSIGNED DEFAULT NULL,
`equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,
@@ -6082,11 +6082,11 @@ REPLACE INTO `item_db` VALUES ('14513','Storm_10_Scroll','Storm Gust Scroll','11
REPLACE INTO `item_db` VALUES ('14514','Vermilion_10_Scroll','Lord of Vermilion Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','itemskill WZ_VERMILION,10;','','');
REPLACE INTO `item_db` VALUES ('14515','Lex_Aeterna_Scroll','Lex Aeterna Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','itemskill PR_LEXAETERNA,1;','','');
REPLACE INTO `item_db` VALUES ('14516','Magnificat_5_Scroll','Magnificat Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','itemskill PR_MAGNIFICAT,5;','','');
-REPLACE INTO `item_db` VALUES ('14517','CP_Helm_Scroll','Chemical Protection Helm Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),237,5;','','');
-REPLACE INTO `item_db` VALUES ('14518','CP_Shield_Scroll','Chemical Protection Shield Scrol','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),235,5;','','');
-REPLACE INTO `item_db` VALUES ('14519','CP_Armor_Scroll','Chemical Protection Armor Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),236,5;','','');
-REPLACE INTO `item_db` VALUES ('14520','CP_Weapon_Scroll','Chemical Protection Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),234,5;','','');
-REPLACE INTO `item_db` VALUES ('14521','Repair_Scroll','Repair Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','unitskilluseid getcharid(3),108,1;','','');
+REPLACE INTO `item_db` VALUES ('14517','CP_Helm_Scroll','Chemical Protection Helm Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5;','','');
+REPLACE INTO `item_db` VALUES ('14518','CP_Shield_Scroll','Chemical Protection Shield Scrol','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5;','','');
+REPLACE INTO `item_db` VALUES ('14519','CP_Armor_Scroll','Chemical Protection Armor Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5;','','');
+REPLACE INTO `item_db` VALUES ('14520','CP_Weapon_Scroll','Chemical Protection Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5;','','');
+REPLACE INTO `item_db` VALUES ('14521','Repair_Scroll','Repair Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1;','','');
REPLACE INTO `item_db` VALUES ('14522','Big_Bun','Big Bun','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 100,0;','','');
REPLACE INTO `item_db` VALUES ('14523','Pill_','Pill','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 0,100;','','');
REPLACE INTO `item_db` VALUES ('14524','Superb_Fish_Slice','Superb Fish Slice','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','percentheal 100,100;','','');
diff --git a/sql-files/item_db2.sql b/sql-files/item_db2.sql
index 1e2798494..5edbc7dbd 100644
--- a/sql-files/item_db2.sql
+++ b/sql-files/item_db2.sql
@@ -44,7 +44,7 @@ CREATE TABLE `item_db2` (
`equip_jobs` bigint(20) UNSIGNED DEFAULT NULL,
`equip_upper` tinyint(8) UNSIGNED DEFAULT NULL,
`equip_genders` tinyint(2) UNSIGNED DEFAULT NULL,
- `equip_locations` smallint(4) UNSIGNED DEFAULT NULL,
+ `equip_locations` mediumint(8) UNSIGNED DEFAULT NULL,
`weapon_level` tinyint(2) UNSIGNED DEFAULT NULL,
`equip_level_min` smallint(5) UNSIGNED DEFAULT NULL,
`equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index f56ed7e68..4569bd6b1 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -44,7 +44,7 @@ CREATE TABLE `item_db` (
`equip_jobs` bigint(20) UNSIGNED DEFAULT NULL,
`equip_upper` tinyint(8) UNSIGNED DEFAULT NULL,
`equip_genders` tinyint(2) UNSIGNED DEFAULT NULL,
- `equip_locations` smallint(4) UNSIGNED DEFAULT NULL,
+ `equip_locations` mediumint(8) UNSIGNED DEFAULT NULL,
`weapon_level` tinyint(2) UNSIGNED DEFAULT NULL,
`equip_level_min` smallint(5) UNSIGNED DEFAULT NULL,
`equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,
@@ -1180,7 +1180,7 @@ REPLACE INTO `item_db` VALUES ('1936','Blue_Violin','Blue Violin','5','20','10',
REPLACE INTO `item_db` VALUES ('1937','Ru_Gold_Violin','Ru Gold Violin','4','20','10','1500','180','0','0','1','2','524288','56','1','2','3','120',NULL,'1','13','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bDex,8; bonus bVit,8;','','');
REPLACE INTO `item_db` VALUES ('1938','Infinity_Violin','Infinity Violin','4','20','10','500','150','0','0','1','1','524288','56','1','2','4','100',NULL,'1','13','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('1939','Crimson_Violin','Crimson Violin','4','20','10','800','80','0','0','1','2','524288','63','1','2','3','70',NULL,'1','13','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtk,pow(min(getrefine(),15),2); if(BaseLevel>70) { bonus bAtk,(((BaseLevel-70)/10)*5); }','','');
-REPLACE INTO `item_db` VALUES ('1940','Conch_','Conch','4','0','0','600','120','0','0','1','1','524288','63','1','2','4','130',NULL,'1','13','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,getrefine(); bonus bDex,getrefine(); if(getrefine()>4) { bonus2 bSkillAtk,WM_REVERBERATION,10; bonus2 bVariableCastrate,WM_REVERBERATION,-10; } if(getrefine()>6) { bonus2 bSkillAtk,WM_REVERBERATION,10; bonus2 bVariableCastrate,WM_REVERBERATION,-10; } if(getrefine()>8) { bonus2 bSkillAtk,WM_REVERBERATION,20; bonus2 bVariableCastrate,WM_REVERBERATION,-20; }','','');
+REPLACE INTO `item_db` VALUES ('1940','Conch_','Conch','4','0','0','600','120','0','0','1','1','524288','63','1','2','4','130',NULL,'1','13','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt, getrefine(); bonus bDex, getrefine(); if(getrefine() > 4) { bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 10; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 10; bonus2 bVariableCastrate, WM_REVERBERATION, -10; } if(getrefine() > 6) { bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 10; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 10; bonus2 bVariableCastrate, WM_REVERBERATION, -10; } if(getrefine() > 8) { bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 20; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 20; bonus2 bVariableCastrate, WM_REVERBERATION, -20; }','','');
REPLACE INTO `item_db` VALUES ('1950','Rope','Rope','4','2500','1250','400','45','0','0','2','3','524288','63','0','2','1','3',NULL,'1','14','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('1951','Rope_','Rope','4','2500','1250','400','45','0','0','2','4','524288','63','0','2','1','3',NULL,'1','14','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('1952','Line','Whip','4','12000','6000','300','80','0','0','2','2','524288','63','0','2','2','16',NULL,'1','14','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -1311,7 +1311,7 @@ REPLACE INTO `item_db` VALUES ('2154','Toy_Shield','Toy Shield','5','0','0','500
REPLACE INTO `item_db` VALUES ('2155','Academy_Shield','Academy Shield','5','0','0','1500','0','0','3','0','1','18446744073709551614','63','2','32','0','0',NULL,'1','4','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('2156','Bible_Of_Promise1','Bible of Promise(1st Vol.)','5','20','10','500','0','0','10','0','1','256','56','2','32','0','110',NULL,'1','5','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,2; skill ALL_ODINS_POWER,1;','','');
REPLACE INTO `item_db` VALUES ('2157','Insecticide','Pesticide','5','20','10','100','0','0','0','0','0','18446744073709551615','63','2','32','0','0',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace,RC_Insect,10;','','');
-REPLACE INTO `item_db` VALUES ('2158','Ramor_Shield_Undead','Ramorushirudo','5','20','10','1300','0','0','50','0','1','18446744073709551615','63','2','32','0','65',NULL,'1','3','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_Undead,5; bonus2 bAddRaceTolerance,RC_DemiPlayer,-5; bonus2 bAddRaceTolerance,RC_Player,-5;','','');
+REPLACE INTO `item_db` VALUES ('2158','Ramor_Shield_Undead','Ramorushirudo','5','20','10','1300','0','0','50','0','1','18446744073709551615','63','2','32','0','65',NULL,'1','3','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_Undead, 5; bonus2 bAddRaceTolerance, RC_DemiPlayer, -5;','','');
REPLACE INTO `item_db` VALUES ('2159','Sharel_Shield','Sharerushirudo','5','20','10','1300','0','0','50','0','1','18446744073709551615','63','2','32','0','65',NULL,'1','3','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('2160','Giant_Shield','Giant Shield','5','56000','28000','2800','0','0','130','0','1','16512','56','2','32','0','100',NULL,'1','4','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubSize,Size_Large,5; if(getrefine()>=9) { bonus2 bSubSize,Size_Large,5; }','','');
REPLACE INTO `item_db` VALUES ('2161','Geffenia_Book_Water','Geffenia Water Book','5','56000','28000','1000','0','0','30','0','1','512','56','2','32','0','100',NULL,'1','5','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,2; bonus bInt,1; if(readparam(bInt)>=120) { bonus bMatk,10; bonus bMaxHP,800; }','','');
@@ -2775,7 +2775,7 @@ REPLACE INTO `item_db` VALUES ('4692','True_Celia_Alde_Card','True Celia Alde Ca
REPLACE INTO `item_db` VALUES ('4693','True_Chen_Liu_Card','True Chen Liu Card','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,SR_DRAGONCOMBO,50; if (getequipweaponlv(EQI_HAND_R) == 4) bonus2 bSkillAtk,SR_DRAGONCOMBO,50; if (getrefine() >= 10) bonus2 bSkillAtk,SR_DRAGONCOMBO,50;','','');
REPLACE INTO `item_db` VALUES ('4694','True_Gertie_Card','True Gertie Card','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,SC_FEINTBOMB,50; if (getequipweaponlv(EQI_HAND_R) == 4) bonus2 bSkillAtk,SC_FEINTBOMB,50; if (getrefine() >= 10) bonus2 bSkillAtk,SC_FEINTBOMB,50;','','');
REPLACE INTO `item_db` VALUES ('4695','True_Trentini_Card','True Trentini Card','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,WM_METALICSOUND,50; if (getequipweaponlv(EQI_HAND_R) == 4) bonus2 bSkillAtk,WM_METALICSOUND,50; if (getrefine() >= 10) bonus2 bSkillAtk,WM_METALICSOUND,50;','','');
-REPLACE INTO `item_db` VALUES ('4696','True_Alphoccio_Card','True Alphoccio Card','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,WM_REVERBERATION,50; if (getequipweaponlv(EQI_HAND_R) == 4) bonus2 bSkillAtk,WM_REVERBERATION,50; if (getrefine() >= 10) bonus2 bSkillAtk,WM_REVERBERATION,50;','','');
+REPLACE INTO `item_db` VALUES ('4696','True_Alphoccio_Card','True Alphoccio Card','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','2','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 50; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 50; if (getequipweaponlv(EQI_HAND_R) == 4) { bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 50; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 50; } if (getrefine() >= 10) { bonus2 bSkillAtk, WM_REVERBERATION_MELEE, 50; bonus2 bSkillAtk, WM_REVERBERATION_MAGIC, 50; }','','');
REPLACE INTO `item_db` VALUES ('4700','Strength1','STR+1','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','1023','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1;','','');
REPLACE INTO `item_db` VALUES ('4701','Strength2','STR+2','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','1023','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2;','','');
REPLACE INTO `item_db` VALUES ('4702','Strength3','STR+3','6','20','10','10','0','0','0','0','0','18446744073709551615','63','2','1023','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,3;','','');
@@ -3524,9 +3524,9 @@ REPLACE INTO `item_db` VALUES ('5447','Frog_Cap','Frog Hat','5','20','10','500',
REPLACE INTO `item_db` VALUES ('5448','Solo_Play_Box1','Indifferent Solo Hat','5','20','10','300','0','0','0','0','1','18446744073709551615','63','2','769','0','0',NULL,'1','449','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','skill RG_GRAFFITI,1;','','');
REPLACE INTO `item_db` VALUES ('5449','Solo_Play_Box2','Angry Solo Hat','5','20','10','300','0','0','0','0','1','18446744073709551615','63','2','769','0','0',NULL,'1','450','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','skill RG_GRAFFITI,1;','','');
REPLACE INTO `item_db` VALUES ('5450','Sun_Cap','Solar Hat','5','20','10','1000','0','0','0','0','0','18446744073709551614','63','2','256','0','20',NULL,'1','451','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('5451','Dragonhelm_Gold','Gold Dragonhelm','5','20','10','1500','0','0','14','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','452','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,10; bonus2 bAddRace,RC_DemiPlayer,5; bonus2 bAddRace,RC_Player,5; bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10;','','');
-REPLACE INTO `item_db` VALUES ('5452','Dragonhelm_Silver','Silver Dragonhelm','5','20','10','1500','0','0','10','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','453','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,7; bonus2 bAddRace,RC_DemiPlayer,3; bonus2 bAddRace,RC_Player,3; bonus2 bAddRaceTolerance,RC_DemiPlayer,7; bonus2 bAddRaceTolerance,RC_Player,7;','','');
-REPLACE INTO `item_db` VALUES ('5453','Dragonhelm_Copper','Copper Dragonhelm','5','20','10','1500','0','0','5','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','454','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,5; bonus2 bAddRace,RC_DemiPlayer,1; bonus2 bAddRace,RC_Player,1; bonus2 bAddRaceTolerance,RC_DemiPlayer,5; bonus2 bAddRaceTolerance,RC_Player,5;','','');
+REPLACE INTO `item_db` VALUES ('5451','Dragonhelm_Gold','Gold Dragonhelm','5','20','10','1500','0','0','14','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','452','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate, 10; bonus2 bAddRace, RC_DemiPlayer, 5; bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;','','');
+REPLACE INTO `item_db` VALUES ('5452','Dragonhelm_Silver','Silver Dragonhelm','5','20','10','1500','0','0','10','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','453','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate, 7; bonus2 bAddRace, RC_DemiPlayer, 3; bonus2 bAddRaceTolerance, RC_DemiPlayer, 7;','','');
+REPLACE INTO `item_db` VALUES ('5453','Dragonhelm_Copper','Copper Dragonhelm','5','20','10','1500','0','0','5','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','454','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate, 5; bonus2 bAddRace, RC_DemiPlayer, 1; bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;','','');
REPLACE INTO `item_db` VALUES ('5454','Dog_Cap_','Puppy Hat','5','20','10','500','0','0','4','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','234','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus bInt,1; autobonus \"{ bonus bCritical,100; }\",10,3000,BF_WEAPON,\"{ specialeffect2 EF_ENHANCE; }\"; autobonus \"{ bonus bIgnoreMdefRate,100; }\",10,3000,BF_MAGIC,\"{ specialeffect2 EF_MAGICALATTHIT; }\";','','');
REPLACE INTO `item_db` VALUES ('5455','Geographer_Band_','Decorative Geographer','5','20','10','500','0','0','1','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','238','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus3 bAutoSpell,AL_HEAL,5,50; bonus3 bAutoSpellWhenHit,AL_HEAL,5,30;','','');
REPLACE INTO `item_db` VALUES ('5456','Vacation_Hat_','Summer Hat','5','20','10','200','0','0','0','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','315','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bVit,5; bonus bHPrecovRate,20; bonus bSPrecovRate,15;','','');
@@ -3653,7 +3653,7 @@ REPLACE INTO `item_db` VALUES ('5576','Japan_Winecup','Wine Cup','5','20','10','
REPLACE INTO `item_db` VALUES ('5577','Dark_Knight_MaskB','Dark Knight Mask','5','20','10','3000','0','0','5','0','0','18446744073709551615','63','2','769','0','0',NULL,'1','479','0','0','0','0','1',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus bStr,3;','','');
REPLACE INTO `item_db` VALUES ('5578','Voyage_Hat','Voyage Hat','5','200','100','10','0','0','1','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','236','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2;','','');
REPLACE INTO `item_db` VALUES ('5579','Wanderer\'s_Sakkat','Wanderer\'s Sakkat','5','20','10','300','0','0','2','0','1','18446744073709551615','63','2','768','0','0',NULL,'1','558','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2; bonus bFlee,3; if(getrefine()>6) { bonus bFlee,2; bonus bAgi,2; } if(getrefine()>8) { bonus bCritical,10; bonus bAspdRate,8; }','','');
-REPLACE INTO `item_db` VALUES ('5580','Red_Beret','Red Beret','5','20','10','100','0','0','3','0','0','18446744073709551615','63','2','256','0','0',NULL,'0','559','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace,RC_DemiPlayer,5; bonus2 bAddRace,RC_Player,5; bonus2 bAddRaceTolerance,RC_DemiPlayer,5; bonus2 bAddRaceTolerance,RC_Player,5;','','');
+REPLACE INTO `item_db` VALUES ('5580','Red_Beret','Red Beret','5','20','10','100','0','0','3','0','0','18446744073709551615','63','2','256','0','0',NULL,'0','559','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace, RC_DemiPlayer, 5; bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;','','');
REPLACE INTO `item_db` VALUES ('5581','Cancer_Diadem','Cancer Diadem','5','20','10','300','0','0','3','0','0','18446744073709551615','63','2','256','0','70',NULL,'1','560','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2; bonus2 bSubEle,Ele_Water,5; if(getrefine()>6) { bonus bMdef,1; bonus bHealPower,3; bonus bMatkRate,2; }','','');
REPLACE INTO `item_db` VALUES ('5582','Cancer_Crown','Cancer Crown','5','20','10','300','0','0','3','0','0','18446744073709551615','63','2','256','0','70',NULL,'1','561','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus2 bSubEle,Ele_Water,5; if(getrefine()>6) { bonus bDef,1; bonus bBaseAtk,15; bonus bFlee,10; }','','');
REPLACE INTO `item_db` VALUES ('5583','Para_Team_Hat','Eden Group Hat','5','0','0','0','0','0','5','0','0','18446744073709551615','63','2','256','0','12',NULL,'1','465','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -3835,7 +3835,7 @@ REPLACE INTO `item_db` VALUES ('5758','Dying_Swan','Dying Swan','5','20','10','1
REPLACE INTO `item_db` VALUES ('5759','Noah_Hat','Noa\'s Hat','5','20','10','500','0','0','1','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','636','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,3;','','');
REPLACE INTO `item_db` VALUES ('5760','Driver_Band_','Driver Band','5','20','10','100','0','0','12','0','1','1024','56','2','256','0','100',NULL,'1','637','0','0','0','0','467',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus bDex,1; bonus bMdef,5; if(readparam(bStr)>=120) { bonus bBaseAtk,10; bonus bCritical,3; }','','');
REPLACE INTO `item_db` VALUES ('5761','Sloth_Hat','Sloth Hat','5','20','10','800','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','638','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2; bonus3 bAutoSpell,AS_SONICBLOW,5,50;','','');
-REPLACE INTO `item_db` VALUES ('5762','Duneyrr_Helm','Duneyrr Hat','5','20','10','100','0','0','5','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','639','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,1; bonus bMdef,5; bonus2 bAddRaceTolerance,RC_DemiPlayer,2; bonus2 bAddRaceTolerance,RC_Player,2; bonus2 bAddRaceTolerance,RC_Brute,2;','','');
+REPLACE INTO `item_db` VALUES ('5762','Duneyrr_Helm','Duneyrr Hat','5','20','10','100','0','0','5','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','639','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats, 1; bonus bMdef, 5; bonus2 bAddRaceTolerance, RC_DemiPlayer, 2; bonus2 bAddRaceTolerance, RC_Brute, 2;','','');
REPLACE INTO `item_db` VALUES ('5763','Red_Bunny_Band','Red Bunny Band','5','0','0','200','0','0','4','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','640','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,2; bonus bMdef,3;','','');
REPLACE INTO `item_db` VALUES ('5764','Love_Rabbit_Hood','Love Rabbit Hood','5','20','10','300','0','0','1','0','1','18446744073709551615','63','2','769','0','10',NULL,'0','549','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus3 bAutoSpell,PR_GLORIA,3,((readparam(bAgi)>=80)?30:10);','','');
REPLACE INTO `item_db` VALUES ('5765','Black_Tail_Ribbon','Pitch Black Ribbon','5','20','10','100','0','0','0','0','1','18446744073709551615','63','2','256','0','10',NULL,'1','642','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus bLongAtkDef,10; bonus2 bSubEle,Ele_Neutral,5;','','');
@@ -3845,15 +3845,15 @@ REPLACE INTO `item_db` VALUES ('5768','Sakura_Coronet','Cherry Blossom Crown','5
REPLACE INTO `item_db` VALUES ('5769','Gold_Angel_Sculpture','Estatua Peque? Angel Oro','5','100','50','0','0','0','2','0','0','18446744073709551615','63','2','256','0','70',NULL,'0','646','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; skill RG_GRAFFITI,1;','','');
REPLACE INTO `item_db` VALUES ('5770','Splash_Hat','Splash Hat','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','349','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','autobonus \"{ sc_start SC_PROPERTYWIND,180000,1; }\",3,180000,BF_WEAPON,\"{ specialeffect2 EF_ENHANCE; }\";','','');
REPLACE INTO `item_db` VALUES ('5771','Family_Hat','Family Hat','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','109','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bDex,1; bonus bMdef,1; bonus bMaxHPrate,2; bonus bMaxSPrate,2; skill PR_MAGNIFICAT,1;','','');
-REPLACE INTO `item_db` VALUES ('5772','Red_Navy_Hat','Blood Admiral\'s Hat','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','651','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10;','','');
-REPLACE INTO `item_db` VALUES ('5773','Navy_Beret','Navy Blue Beret','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','652','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10;','','');
-REPLACE INTO `item_db` VALUES ('5774','Red_Pirate_Hat','Scallywag\'s Hat','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','496','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10;','','');
+REPLACE INTO `item_db` VALUES ('5772','Red_Navy_Hat','Blood Admiral\'s Hat','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','651','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;','','');
+REPLACE INTO `item_db` VALUES ('5773','Navy_Beret','Navy Blue Beret','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','652','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;','','');
+REPLACE INTO `item_db` VALUES ('5774','Red_Pirate_Hat','Scallywag\'s Hat','5','3000','1500','500','0','0','1','0','0','18446744073709551615','63','2','256','0','95',NULL,'1','496','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;','','');
REPLACE INTO `item_db` VALUES ('5775','Choco_Donut_In_Mouth','Chocolate Donut','5','20','10','50','0','0','1','0','0','18446744073709551615','63','2','1','0','0',NULL,'0','653','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bMaxHP,50;','','');
REPLACE INTO `item_db` VALUES ('5776','Blazing_Sun','Blazin Sun','5','0','0','500','0','0','0','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','654','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bVariableCastrate,MG_FIREBOLT,-5; bonus2 bSkillAtk,MG_FIREBOLT,5; bonus2 bVariableCastrate,MG_FIREBALL,-5; bonus2 bSkillAtk,MG_FIREBALL,5; bonus2 bSkillAtk,MG_FIREWALL,3; bonus2 bSkillAtk,WZ_METEOR,3; bonus bUseSPrate,5;','','');
REPLACE INTO `item_db` VALUES ('5777','Remover_Hat','Remover Hat','5','20','10','800','0','0','2','0','0','18446744073709551615','63','2','256','0','30',NULL,'0','655','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,1; bonus3 bAddMonsterDropItem,713,RC_Formless,200; bonus3 bAddMonsterDropItem,971,RC_Formless,30; bonus3 bAddMonsterDropItem,972,RC_Formless,10;','','');
REPLACE INTO `item_db` VALUES ('5778','Blue_Arara_Hat','Turkey On Your Head','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','656','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,2; bonus2 bAddMonsterDropItem,574,500; bonus2 bAddItemHealRate,574,5; .@rate = min(getrefine(),10); bonus bMaxHPrate,.@rate; bonus bMaxSPrate,.@rate; bonus3 bAutoSpellWhenHit,AL_INCAGI,.@rate,10; bonus3 bAutoSpell,AL_INCAGI,.@rate,10;','','');
REPLACE INTO `item_db` VALUES ('5779','Drooping_Boto','Drooping Boto','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','657','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,2;','','');
-REPLACE INTO `item_db` VALUES ('5780','Tendrilion_Hat','Tendrilion Hat','5','20','10','100','0','0','0','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','658','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10; skill WZ_EARTHSPIKE,3;','','');
+REPLACE INTO `item_db` VALUES ('5780','Tendrilion_Hat','Tendrilion Hat','5','20','10','100','0','0','0','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','658','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 10; skill WZ_EARTHSPIKE, 3;','','');
REPLACE INTO `item_db` VALUES ('5781','Persika','Persica','5','20','10','100','0','0','0','0','1','18446744073709551615','63','2','256','0','0',NULL,'0','659','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bFlee,1; bonus bMaxSP,20;','','');
REPLACE INTO `item_db` VALUES ('5782','Hoplite_Helmet','Legionaire Helm','5','20','10','700','0','0','4','0','1','18446744073709551615','63','2','769','0','0',NULL,'1','660','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHPrate,3;','','');
REPLACE INTO `item_db` VALUES ('5783','YellowBunny_Hairband','YellowBunny Hairband','5','20','10','200','0','0','0','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','662','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1; bonus bInt,1; bonus bDex,2; if (getrefine()>8) { bonus bAtkRate,2; bonus bMatkRate,2; } if (getrefine()>9) { bonus bAtkRate,2; bonus bMatkRate,2; }','','');
@@ -3947,7 +3947,7 @@ REPLACE INTO `item_db` VALUES ('5898','Autumn_Headband','Autumn Headband','5','0
REPLACE INTO `item_db` VALUES ('5899','Black_Ribbon_','Black Ribbon','5','0','0','200','0','0','10','0','1','128','56','2','256','0','100',NULL,'1','1120','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,RK_WINDCUTTER,50; bonus2 bSkillAtk,RK_SONICWAVE,50; if(getrefine()>=7) { bonus bAtk,2*(readparam(bAgi)/5); } if(getrefine()>=9) { bonus2 bSkillAtk,RK_IGNITIONBREAK,30; }','','');
REPLACE INTO `item_db` VALUES ('5900','Divine_Guard_Hat_','Divine Guard Hat','5','20','10','200','0','0','10','0','1','16384','56','2','256','0','100',NULL,'1','1121','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubSize,Size_Medium,5; bonus2 bSubSize,Size_Large,5; bonus2 bSubSize,Size_Small,5; if(getrefine()>6) { bonus5 bAutoSpellWhenHit,AL_HEAL,max(getskilllv(AL_HEAL),5),100,BF_WEAPON,0; } if(getrefine()>8) { bonus2 bSkillAtk,LG_RAYOFGENESIS,20; }','','');
REPLACE INTO `item_db` VALUES ('5904','Inconspicuous_Hat_','Inconspicuous Hat','5','20','10','200','0','0','10','0','1','131072','56','2','256','0','100',NULL,'1','1125','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMatkRate,7; if(getrefine()>6) { bonus bMatk,(readparam(bInt)/5)*2; } if(getrefine()>8) { bonus bMatkRate,5; }','','');
-REPLACE INTO `item_db` VALUES ('5905','Lyrica_Hat_','Lyrica Hat','5','20','10','200','0','0','10','0','1','524288','56','1','256','0','100',NULL,'1','1126','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,WM_SEVERE_RAINSTORM,15; if(getrefine()>6) { bonus bFixedCastrate,-(getskilllv(BA_MUSICALLESSON)*4); } if(getrefine()>8) { bonus2 bSkillUseSP,WM_SEVERE_RAINSTORM,10; }','','');
+REPLACE INTO `item_db` VALUES ('5905','Lyrica_Hat_','Lyrica Hat','5','20','10','200','0','0','10','0','1','524288','56','1','256','0','100',NULL,'1','1126','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,WM_SEVERE_RAINSTORM_MELEE,15; if(getrefine()>6) { bonus bFixedCastrate,-(getskilllv(BA_MUSICALLESSON)*4); } if(getrefine()>8) { bonus2 bSkillUseSP,WM_SEVERE_RAINSTORM,10; }','','');
REPLACE INTO `item_db` VALUES ('5906','Oni_Horns_','Oni Horns','5','20','10','200','0','0','10','0','1','4096','56','2','256','0','100',NULL,'1','1127','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,GC_COUNTERSLASH,getskilllv(GC_WEAPONBLOCKING)*10; if(getrefine()>6) { bonus bAtk,10; bonus bHit,5; } if(getrefine()>8) { bonus3 bAutoSpell,GC_CROSSIMPACT,1,100; }','','');
REPLACE INTO `item_db` VALUES ('5907','Sea_Captain_Hat','Sea Captain Hat','5','20','10','200','0','0','20','0','1','1024','56','2','256','0','100',NULL,'1','1128','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,NC_AXETORNADO,20; bonus2 bSkillAtk,NC_AXEBOOMERANG,20; if(getrefine()>6) { bonus2 bSkillAtk,NC_AXETORNADO,getskilllv(BS_WEAPONRESEARCH); } if(getrefine()>8) { bonus2 bSkillAtk,NC_AXETORNADO,getskilllv(NC_TRAININGAXE); }','','');
REPLACE INTO `item_db` VALUES ('5918','Gambler_Seal','Gambler Seal','5','20','10','500','0','0','0','0','0','18446744073709551615','63','2','512','0','70',NULL,'0','1202','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bCritical,3; bonus bCritAtkRate,3;','','');
@@ -7847,11 +7847,11 @@ REPLACE INTO `item_db` VALUES ('14513','Storm_10_Scroll','Storm Gust Scroll','11
REPLACE INTO `item_db` VALUES ('14514','Vermilion_10_Scroll','Lord of Vermilion Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemskill WZ_VERMILION,10;','','');
REPLACE INTO `item_db` VALUES ('14515','Lex_Aeterna_Scroll','Lex Aeterna Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemskill PR_LEXAETERNA,1;','','');
REPLACE INTO `item_db` VALUES ('14516','Magnificat_5_Scroll','Magnificat Scroll','11','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemskill PR_MAGNIFICAT,5;','','');
-REPLACE INTO `item_db` VALUES ('14517','CP_Helm_Scroll','Chemical Protection Helm Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),237,5;','','');
-REPLACE INTO `item_db` VALUES ('14518','CP_Shield_Scroll','Chemical Protection Shield Scrol','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),235,5;','','');
-REPLACE INTO `item_db` VALUES ('14519','CP_Armor_Scroll','Chemical Protection Armor Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),236,5;','','');
-REPLACE INTO `item_db` VALUES ('14520','CP_Weapon_Scroll','Chemical Protection Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(3),234,5;','','');
-REPLACE INTO `item_db` VALUES ('14521','Repair_Scroll','Repair Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','unitskilluseid getcharid(3),108,1;','','');
+REPLACE INTO `item_db` VALUES ('14517','CP_Helm_Scroll','Chemical Protection Helm Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5;','','');
+REPLACE INTO `item_db` VALUES ('14518','CP_Shield_Scroll','Chemical Protection Shield Scrol','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5;','','');
+REPLACE INTO `item_db` VALUES ('14519','CP_Armor_Scroll','Chemical Protection Armor Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5;','','');
+REPLACE INTO `item_db` VALUES ('14520','CP_Weapon_Scroll','Chemical Protection Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5;','','');
+REPLACE INTO `item_db` VALUES ('14521','Repair_Scroll','Repair Weapon Scroll','2','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1;','','');
REPLACE INTO `item_db` VALUES ('14522','Big_Bun','Big Bun','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','percentheal 100,0;','','');
REPLACE INTO `item_db` VALUES ('14523','Pill_','Pill','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','percentheal 0,100;','','');
REPLACE INTO `item_db` VALUES ('14524','Superb_Fish_Slice','Superb Fish Slice','0','0','0','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','percentheal 100,100;','','');
@@ -8579,9 +8579,9 @@ REPLACE INTO `item_db` VALUES ('18624','Rocket_Helm3','Rocket Helm3','5','20','1
REPLACE INTO `item_db` VALUES ('18625','Rocket_Helm_RWC','Rocket Helm','5','10000','5000','1000','0','0','20','0','1','18446744073709551615','63','2','256','0','95',NULL,'1','769','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus bAllStats,2; bonus bUnbreakableHelm,0;','','');
REPLACE INTO `item_db` VALUES ('18626','Gelato_Hat','Gelato Hat','5','20','10','200','0','0','2','0','1','18446744073709551615','63','2','256','0','40',NULL,'1','777','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHP,300; if(getrefine()>6) { skill MG_FROSTDIVER,5; } else { skill MG_FROSTDIVER,1; }','','');
REPLACE INTO `item_db` VALUES ('18627','Dried_Leaf','Dried Leaf','5','20','10','50','0','0','0','0','0','18446744073709551615','63','2','1','0','10',NULL,'0','711','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus2 bAddRace,RC_Plant,3;','','');
-REPLACE INTO `item_db` VALUES ('18628','Tare_Brownie','Tare Brownie','5','20','10','500','0','0','5','0','1','18446744073709551615','63','2','256','0','50',NULL,'0','781','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus bMaxHPrate,2; bonus2 bAddRace,RC_DemiPlayer,5; bonus2 bAddRace,RC_Player,5;','','');
+REPLACE INTO `item_db` VALUES ('18628','Tare_Brownie','Tare Brownie','5','20','10','500','0','0','5','0','1','18446744073709551615','63','2','256','0','50',NULL,'0','781','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef, 5; bonus bMaxHPrate, 2; bonus2 bAddRace, RC_DemiPlayer, 5;','','');
REPLACE INTO `item_db` VALUES ('18629','B_Desert_Wolf_Hat','B Desert Wolf Hat','5','10','5','300','0','0','0','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','783','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddSize,Size_Small,15;','','');
-REPLACE INTO `item_db` VALUES ('18630','Dep_Alice_Hat','Drooping Alice','5','20','10','500','0','0','6','0','0','18446744073709551614','63','2','256','0','70',NULL,'1','784','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace,RC_DemiPlayer,10; bonus2 bAddRace,RC_Player,10; bonus2 bAddRace,RC_Demon,10; if(getrefine()>6) { autobonus \"{ bonus bAspdRate,100; }\",10,7000,0,\"{ specialeffect2 EF_POTION_BERSERK; }\"; }','','');
+REPLACE INTO `item_db` VALUES ('18630','Dep_Alice_Hat','Drooping Alice','5','20','10','500','0','0','6','0','0','18446744073709551614','63','2','256','0','70',NULL,'1','784','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRace, RC_DemiPlayer, 10; bonus2 bAddRace, RC_Demon, 10; if(getrefine() > 6) { autobonus \"{ bonus bAspdRate, 100; }\", 10, 7000, 0, \"{ specialeffect2 EF_POTION_BERSERK; }\"; }','','');
REPLACE INTO `item_db` VALUES ('18631','Ribbon_Chef_Hat','Ribbon Chef hat','5','20','10','300','0','0','5','0','0','18446744073709551615','63','2','256','0','70',NULL,'1','785','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bDex,3; bonus bLuk,1; if(getrefine()>6) { bonus2 bAddMonsterDropItem,12125,500; bonus2 bAddMonsterDropItem,12126,500; bonus2 bAddMonsterDropItem,12127,400; bonus2 bAddMonsterDropItem,12128,300; bonus2 bAddMonsterDropItem,12129,200; }','','');
REPLACE INTO `item_db` VALUES ('18632','Yellow_Poring_Pin','Yellow Poring Hairpin','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','786','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18633','Pink_Poring_Pin','Pink Poring Hairpin','5','20','10','100','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','787','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -8596,7 +8596,7 @@ REPLACE INTO `item_db` VALUES ('18641','Ribbon_Magic_Hat','Ribbon Magic Hat','5'
REPLACE INTO `item_db` VALUES ('18642','hand_Scissorhand_Model','Scissorhand Model','5','20','10','200','0','0','0','0','0','18446744073709551614','63','2','1','0','20',NULL,'0','795','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1;','','');
REPLACE INTO `item_db` VALUES ('18643','Rockhand_Model','Rockhand Model','5','20','10','200','0','0','0','0','0','18446744073709551614','63','2','1','0','20',NULL,'0','796','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bStr,1;','','');
REPLACE INTO `item_db` VALUES ('18644','Paperhand_Model','Paperhand Model','5','20','10','200','0','0','0','0','0','18446744073709551614','63','2','1','0','20',NULL,'0','797','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('18645','Sailor_Hat','Sailor Hat','5','20','10','200','0','0','2','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','798','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,1; bonus2 bAddRace,RC_DemiPlayer,5; bonus2 bAddRace,RC_Player,5;','','');
+REPLACE INTO `item_db` VALUES ('18645','Sailor_Hat','Sailor Hat','5','20','10','200','0','0','2','0','0','18446744073709551615','63','2','256','0','0',NULL,'1','798','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt, 1; bonus2 bAddRace, RC_DemiPlayer, 5;','','');
REPLACE INTO `item_db` VALUES ('18646','Cow_Hat','Cow Hat','5','20','10','300','0','0','4','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','799','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddMonsterDropItem,519,100; bonus bDex,2;','','');
REPLACE INTO `item_db` VALUES ('18647','Star_Eyepatch','Stunning Star Eyepatch','5','20','10','100','0','0','0','0','0','18446744073709551615','63','2','512','0','0',NULL,'0','800','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bResEff,Eff_Stun,1500;','','');
REPLACE INTO `item_db` VALUES ('18648','Tongue_Charm','Tongue Charm','5','20','10','100','0','0','0','0','0','18446744073709551615','63','2','1','0','0',NULL,'0','801','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_Demon,3;','','');
@@ -8702,7 +8702,7 @@ REPLACE INTO `item_db` VALUES ('18750','Poker_Card_In_Mouth','Poker Card In Mout
REPLACE INTO `item_db` VALUES ('18752','Cursed_Book','Cursed Book','5','0','0','0','0','0','0','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','890','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18753','Tw_Rice_Ball','Rice Dumpling Hat','5','20','10','100','0','0','6','0','0','18446744073709551615','63','2','256','0','0',NULL,'0','892','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bLuk,1;','','');
REPLACE INTO `item_db` VALUES ('18754','Blood_Sucker','Blood Sucker','5','20','10','300','0','0','0','0','0','18446744073709551615','63','2','1','0','40',NULL,'0','893','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0;','','');
-REPLACE INTO `item_db` VALUES ('18755','Feather_Beret_','Feather Beret','5','30000','15000','600','0','0','1','0','1','18446744073709551614','63','2','256','0','0',NULL,'1','224','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,1; bonus bUnbreakableHelm,0; bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus2 bAddRaceTolerance,RC_Player,10;','','');
+REPLACE INTO `item_db` VALUES ('18755','Feather_Beret_','Feather Beret','5','30000','15000','600','0','0','1','0','1','18446744073709551614','63','2','256','0','0',NULL,'1','224','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef, 1; bonus bUnbreakableHelm, 0; bonus2 bAddRaceTolerance, RC_DemiPlayer, 10;','','');
REPLACE INTO `item_db` VALUES ('18756','Black_Shiba_Inu_Hat','Black Shiba Inu Hat','5','20','10','400','0','0','6','0','1','18446744073709551615','63','2','256','0','50',NULL,'1','894','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18757','Holy_Klobuk','Holy Klobuk','5','0','0','500','0','0','5','0','1','18446744073709551615','63','2','768','0','0',NULL,'0','895','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus2 bAddRaceTolerance,RC_Demon,10; bonus bHealPower,3; bonus bUnbreakableHelm,0;','','');
REPLACE INTO `item_db` VALUES ('18758','Hat_Of_Scrat','Hat Of Scrat','5','20','10','200','0','0','3','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','896','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -8742,7 +8742,7 @@ REPLACE INTO `item_db` VALUES ('18791','Shrine_Maiden_Hat','Shrine Maiden Hat','
REPLACE INTO `item_db` VALUES ('18792','Indonesian_Id_Sakkat','Indonesian Id Sakkat','5','0','0','400','0','0','1','0','0','18446744073709551614','63','2','256','0','45',NULL,'1','901','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bVit,10; bonus2 bAddRaceTolerance,RC_DemiPlayer,10; bonus bMatkRate,5; bonus bAtkRate,5;','','');
REPLACE INTO `item_db` VALUES ('18793','Sorc_Night_Cap','Sorc Night Cap','5','0','0','200','0','0','25','0','1','65536','56','2','256','0','100',NULL,'1','911','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,10; bonus2 bSkillAtk,MG_FIREBOLT,50; bonus2 bSkillAtk,MG_LIGHTNINGBOLT,50; bonus2 bSkillAtk,MG_COLDBOLT,50; if(getrefine()>6) { bonus2 bSkillAtk,SO_SPELLFIST,25; } if(getrefine()>8) { bonus bAspd,5; }','','');
REPLACE INTO `item_db` VALUES ('18794','Plain_Black_Mage_Hat','Plain Black Mage Hat','5','0','0','200','0','0','15','0','1','512','56','2','256','0','100',NULL,'1','912','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSkillAtk,WL_CRIMSONROCK,5; bonus2 bSkillAtk,WL_JACKFROST,5; bonus2 bSkillAtk,WL_EARTHSTRAIN,5; bonus2 bSkillAtk,WL_CHAINLIGHTNING,5; bonus2 bIgnoreMdefRate,RC_NonBoss,10; bonus2 bIgnoreMdefRate,RC_NonBoss,getrefine()*2; if(getrefine()>6) { bonus2 bSkillAtk,WL_CRIMSONROCK,5; bonus2 bSkillAtk,WL_JACKFROST,5; bonus2 bSkillAtk,WL_EARTHSTRAIN,5; bonus2 bSkillAtk,WL_CHAINLIGHTNING,5; } if(getrefine()>8) { bonus bMatkRate,5; }','','');
-REPLACE INTO `item_db` VALUES ('18795','Night_Sparrow_Hat','Night Sparrow Hat','5','0','0','200','0','0','15','0','0','524288','56','2','256','0','100',NULL,'1','913','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bFixedCastrate,-(getskilllv(BA_MUSICALLESSON)*5); if(getrefine()>6) { bonus2 bSkillAtk,WM_SEVERE_RAINSTORM,25; } if(getrefine()>8) { bonus bMaxSP,200; }','','');
+REPLACE INTO `item_db` VALUES ('18795','Night_Sparrow_Hat','Night Sparrow Hat','5','0','0','200','0','0','15','0','0','524288','56','2','256','0','100',NULL,'1','913','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bFixedCastrate,-(getskilllv(BA_MUSICALLESSON)*5); if(getrefine()>6) { bonus2 bSkillAtk,WM_SEVERE_RAINSTORM_MELEE,25; } if(getrefine()>8) { bonus bMaxSP,200; }','','');
REPLACE INTO `item_db` VALUES ('18796','RWC_Crown_Of_Victory(8th)','RWC Crown Of Victory(8th)','5','0','0','500','0','0','12','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','914','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,2; bonus2 bResEff,Eff_Curse,10000; bonus bUnbreakableHelm,0;','','');
REPLACE INTO `item_db` VALUES ('18797','Deep_Angel_Hairband','Deep Angel Hairband','5','0','0','100','0','0','4','0','1','18446744073709551614','63','2','256','0','0',NULL,'1','915','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1; bonus bLuk,1; bonus bMdef,3; bonus2 bAddRaceTolerance,RC_Demon,3;','','');
REPLACE INTO `item_db` VALUES ('18798','Pink_Angel_Hairband','Pink Angel Hairband','5','0','0','100','0','0','4','0','1','18446744073709551614','63','2','256','0','0',NULL,'1','916','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1; bonus bLuk,1; bonus bMdef,3; bonus2 bAddRaceTolerance,RC_Demon,3;','','');
@@ -8788,9 +8788,9 @@ REPLACE INTO `item_db` VALUES ('18839','Poring_Sunglasses','Poring Sunglasses','
REPLACE INTO `item_db` VALUES ('18840','King_Poring_Hat','King Poring Hat','5','20','10','350','0','0','10','0','0','18446744073709551615','63','2','256','0','0',NULL,'0','905','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bMdef,10;','','');
REPLACE INTO `item_db` VALUES ('18841','Small_Poring_Band','Small Poring Band','5','20','10','350','0','0','8','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','955','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAspdRate,(getrefine()/3)*2; bonus2 bExpAddRace, RC_All, 3; if (getrefine()>9) { bonus bAspd,1; }','','');
REPLACE INTO `item_db` VALUES ('18842','Hat_Of_Girl','Hat Of Girl','5','20','10','350','0','0','8','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','956','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,(getrefine()/3)*2; bonus2 bSubRace,RC_DemiPlayer,7; bonus bMaxHPrate,-3;','','');
-REPLACE INTO `item_db` VALUES ('18843','Small_Deviling_Hat','Small Deviling Hat','5','20','10','350','0','0','7','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','957','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,5; bonus2 bAddRaceTolerance,RC_Player,5; if (getrefine()>7) { bonus bMaxHPrate,getrefine()-7; }','','');
+REPLACE INTO `item_db` VALUES ('18843','Small_Deviling_Hat','Small Deviling Hat','5','20','10','350','0','0','7','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','957','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 5; if (getrefine() > 7) { bonus bMaxHPrate, getrefine()-7; }','','');
REPLACE INTO `item_db` VALUES ('18844','Blue_Poring_Bubble','Blue Poring Bubble','5','20','10','50','0','0','5','0','0','18446744073709551615','63','2','1','0','0',NULL,'0','958','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAllStats,2; bonus bFlee2,2;','','');
-REPLACE INTO `item_db` VALUES ('18845','Banshee_Master_Kiss','Banshee Master Kiss','5','20','10','200','0','0','5','0','0','18446744073709551615','63','2','1','0','0',NULL,'0','959','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm,0; bonus bMaxSPrate,3; autobonus2 \"{ bonus2 bAddRaceTolerance,RC_DemiPlayer,100; bonus2 bAddRaceTolerance,RC_Player,100; }\",10,3000,BF_WEAPON|BF_MAGIC,\"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
+REPLACE INTO `item_db` VALUES ('18845','Banshee_Master_Kiss','Banshee Master Kiss','5','20','10','200','0','0','5','0','0','18446744073709551615','63','2','1','0','0',NULL,'0','959','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bUnbreakableHelm, 0; bonus bMaxSPrate, 3; autobonus2 \"{ bonus2 bAddRaceTolerance, RC_DemiPlayer, 100; }\", 10, 3000, BF_WEAPON|BF_MAGIC, \"{ specialeffect2 EF_POTION_BERSERK; }\";','','');
REPLACE INTO `item_db` VALUES ('18846','Seagod_Protector','Seagod Protector','5','0','0','100','0','0','0','0','0','18446744073709551615','63','2','512','0','10',NULL,'0','960','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Water,5;','','');
REPLACE INTO `item_db` VALUES ('18847','Jolly_Roger','Jolly Roger','5','0','0','500','0','0','10','0','1','18446744073709551615','63','2','256','0','10',NULL,'1','962','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bVit,1; bonus2 bSubEle,Ele_Water,2; bonus2 bAddEle,Ele_Water,2; if (getrefine()>=7) { bonus2 bAddEle,Ele_Water,3; } if (getrefine()>=9) { bonus2 bSubEle,Ele_Water,3; }','','');
REPLACE INTO `item_db` VALUES ('18848','Fresh_Roses','Fresh Roses','5','0','0','200','0','0','0','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','963','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMatk,20+getrefine();','','');
@@ -8819,8 +8819,8 @@ REPLACE INTO `item_db` VALUES ('18889','Golden_Bunny_Band','Golden Bunny Band','
REPLACE INTO `item_db` VALUES ('18890','Gray_Bunny_Band','Gray Bunny Band','5','0','0','0','0','0','2','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','1015','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bInt,5; bonus bLuk,5; bonus bAtkRate,2; bonus bMatkRate,5; if(getrefine()>8) { bonus bAtkRate,4; bonus bMatkRate,4; } if(getrefine()>11) { bonus bFixedCastrate,-10; }','','');
REPLACE INTO `item_db` VALUES ('18891','Husky_Hat','Husky Hat','5','0','0','500','0','0','5','0','1','18446744073709551615','63','2','256','0','0',NULL,'1','1016','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAtkRate,5; bonus bMatkRate,5; bonus4 bAutoSpellWhenHit,SN_WINDWALK,5,100+(getrefine()*30),0;','','');
REPLACE INTO `item_db` VALUES ('18892','Ufo_Poring_Hat','Ufo Poring Hat','5','0','0','1000','0','0','5','0','1','18446744073709551615','63','2','256','0','10',NULL,'1','1017','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus bFlee,5; bonus bCritical,5; bonus bHit,5; bonus bFlee2,5; if(getrefine()>6) { bonus bVariableCastrate,-5; } if(getrefine()>8) { bonus bDelayrate,-5; bonus bAspdRate,5; }','','');
-REPLACE INTO `item_db` VALUES ('18893','Dragon_Claw_Helm','Dragon Claw Helm','5','0','0','1000','0','0','5','0','1','18446744073709551615','63','2','256','0','10',NULL,'1','1018','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,8; bonus2 bAddRaceTolerance,RC_Player,8; bonus2 bAddRaceTolerance,RC_Dragon,8; bonus2 bAddItemHealRate,517,200; if(getrefine()>11) { bonus bMaxHPrate,7; bonus bMaxSPrate,3; }','','');
-REPLACE INTO `item_db` VALUES ('18894','Rainbow_Star','Rainbow Star','5','0','0','500','0','0','5','0','0','18446744073709551615','63','2','512','0','70',NULL,'0','1019','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance,RC_DemiPlayer,5; bonus2 bAddRaceTolerance,RC_Player,5;','','');
+REPLACE INTO `item_db` VALUES ('18893','Dragon_Claw_Helm','Dragon Claw Helm','5','0','0','1000','0','0','5','0','1','18446744073709551615','63','2','256','0','10',NULL,'1','1018','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 8; bonus2 bAddRaceTolerance, RC_Dragon, 8; bonus2 bAddItemHealRate, 517, 200; if(getrefine() > 11) { bonus bMaxHPrate, 7; bonus bMaxSPrate, 3; }','','');
+REPLACE INTO `item_db` VALUES ('18894','Rainbow_Star','Rainbow Star','5','0','0','500','0','0','5','0','0','18446744073709551615','63','2','512','0','70',NULL,'0','1019','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bAddRaceTolerance, RC_DemiPlayer, 5;','','');
REPLACE INTO `item_db` VALUES ('18895','Celestial_Dark_Flame','Celestial Dark Flame','5','0','0','200','0','0','5','0','0','18446744073709551615','63','2','512','0','50',NULL,'0','1008','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,5;','','');
REPLACE INTO `item_db` VALUES ('18896','Pterios_Fins','Pterios Fins','5','0','0','200','0','0','5','0','0','18446744073709551615','63','2','512','0','50',NULL,'0','1009','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Fire,8;','','');
REPLACE INTO `item_db` VALUES ('18897','Azure_Diadem','Azure Diadem','5','0','0','200','0','0','5','0','0','18446744073709551615','63','2','512','0','50',NULL,'0','1010','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubEle,Ele_Water,8;','','');
@@ -9739,6 +9739,7 @@ REPLACE INTO `item_db` VALUES ('22046','Boots_of_Airship','Boots of Airship','5'
REPLACE INTO `item_db` VALUES ('22047','Tarlock\'s_Boots','Tarlock\'s Boots','5','20','10','250','0','0','13','0','0','18446744073709551615','63','2','64','0','125',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bAgi,1; bonus bAspdRate,5; if(getrefine()>6) { bonus bAgi,1; bonus bAspdRate,5; } if(getrefine()>8) { bonus bAgi,1; bonus bAspdRate,5; } if(getrefine()>11) { bonus bAspd,1; }','','');
REPLACE INTO `item_db` VALUES ('22059','Egir_Shoes_K','Egir Shoes','5','200000','100000','300','0','0','13','0','1','18446744073709551615','63','2','64','0','40',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxHP, 500; bonus bMaxSP, 50; bonus bUnbreakableShoes, 0;','','');
REPLACE INTO `item_db` VALUES ('22067','Witch_Shoes','Witch Shoes','5','3500','1750','400','0','0','10','0','0','18446744073709551614','63','2','64','0','0',NULL,'1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','skill ALL_CATCRY, 1; bonus bUnbreakableShoes, 1; autobonus3 \"{ }\", 1000, 7000, ALL_CATCRY, \"{ montransform LOLI_RURI, 420000; }\";','','');
+REPLACE INTO `item_db` VALUES ('22508','Para_Team_Mark_','Eden Group Mark','11','0','0','0','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','1200000','507',NULL,'0',NULL,'0',NULL,'0','unitskilluseid getcharid(CHAR_ID_ACCOUNT), \"AL_TELEPORT\", 3;','','');
REPLACE INTO `item_db` VALUES ('22514','Candy_Holder','Candy Holder','11','20','10','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('22515','Twisted_Key_of_Time','Twisted Key of Time','3','10','5','300','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('22540','Runstone_Lux','Lux Anima Rune','11','2','1','100','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','0','0','0','0','60000','475',NULL,'0',NULL,'20','1','0','itemskill RK_LUXANIMA,1;','','');
diff --git a/src/char/char.c b/src/char/char.c
index 952c3d781..945111640 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1945,11 +1945,15 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) {
}
/* Made Possible by Yommy~! <3 */
-void char_mmo_char_send099d(int fd, struct char_session_data *sd) {
+void char_mmo_char_send099d(int fd, struct char_session_data *sd)
+{
+// support added for client between 20121010 and 20130320
+#if PACKETVER > 20120418
WFIFOHEAD(fd,4 + (MAX_CHARS*MAX_CHAR_BUF));
WFIFOW(fd,0) = 0x99d;
WFIFOW(fd,2) = chr->mmo_chars_fromsql(sd, WFIFOP(fd,4)) + 4;
WFIFOSET(fd,WFIFOW(fd,2));
+#endif
}
/* Sends character ban list */
diff --git a/src/common/HPM.c b/src/common/HPM.c
index dbe121940..1fad7102f 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -103,6 +103,7 @@ void hplugin_export_symbol(void *value, const char *name)
void *hplugin_import_symbol(char *name, unsigned int pID)
{
int i;
+ nullpo_retr(NULL, name);
ARR_FIND(0, VECTOR_LENGTH(HPM->symbols), i, strcmp(VECTOR_INDEX(HPM->symbols, i)->name, name) == 0);
if (i != VECTOR_LENGTH(HPM->symbols))
@@ -133,6 +134,7 @@ bool hplugin_iscompatible(char* version) {
bool hplugin_exists(const char *filename)
{
int i;
+ nullpo_retr(false, filename);
for (i = 0; i < VECTOR_LENGTH(HPM->plugins); i++) {
if (strcmpi(VECTOR_INDEX(HPM->plugins, i)->filename,filename) == 0)
return true;
@@ -259,6 +261,7 @@ void hplugins_addToHPData(enum HPluginDataTypes type, uint32 pluginID, struct hp
return;
}
store = *storeptr;
+ nullpo_retv(store);
/* duplicate check */
ARR_FIND(0, VECTOR_LENGTH(store->entries), i, VECTOR_INDEX(store->entries, i)->pluginID == pluginID && VECTOR_INDEX(store->entries, i)->classid == classid);
@@ -447,7 +450,8 @@ bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *na
return true;
}
-struct hplugin *hplugin_load(const char* filename) {
+struct hplugin *hplugin_load(const char* filename)
+{
struct hplugin *plugin;
struct hplugin_info *info;
struct HPMi_interface **HPMi;
@@ -563,6 +567,7 @@ struct hplugin *hplugin_load(const char* filename) {
/* id */
plugin->hpi->pid = plugin->idx;
/* core */
+ plugin->hpi->memmgr = HPMiMalloc;
#ifdef CONSOLE_INPUT
plugin->hpi->addCPCommand = console->input->addCommand;
#endif // CONSOLE_INPUT
@@ -596,6 +601,7 @@ struct hplugin *hplugin_load(const char* filename) {
void hplugin_unload(struct hplugin* plugin)
{
int i;
+ nullpo_retv(plugin);
if (plugin->filename)
aFree(plugin->filename);
if (plugin->dll)
@@ -622,7 +628,8 @@ CMDLINEARG(loadplugin)
/**
* Reads the plugin configuration and loads the plugins as necessary.
*/
-void hplugins_config_read(void) {
+void hplugins_config_read(void)
+{
struct config_t plugins_conf;
struct config_setting_t *plist = NULL;
const char *config_filename = "conf/plugins.conf"; // FIXME hardcoded name
@@ -788,6 +795,7 @@ const char *HPM_file2ptr(const char *file)
{
int i;
+ nullpo_retr(NULL, file);
ARR_FIND(0, HPM->filenames.count, i, HPM->filenames.data[i].addr == file);
if (i != HPM->filenames.count) {
return HPM->filenames.data[i].name;
@@ -801,19 +809,29 @@ const char *HPM_file2ptr(const char *file)
return HPM->filenames.data[i].name;
}
-void* HPM_mmalloc(size_t size, const char *file, int line, const char *func) {
+
+void* HPM_mmalloc(size_t size, const char *file, int line, const char *func)
+{
return iMalloc->malloc(size,HPM_file2ptr(file),line,func);
}
-void* HPM_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_calloc(size_t num, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->calloc(num,size,HPM_file2ptr(file),line,func);
}
-void* HPM_realloc(void *p, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_realloc(void *p, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->realloc(p,size,HPM_file2ptr(file),line,func);
}
-void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->reallocz(p,size,HPM_file2ptr(file),line,func);
}
-char* HPM_astrdup(const char *p, const char *file, int line, const char *func) {
+
+char* HPM_astrdup(const char *p, const char *file, int line, const char *func)
+{
return iMalloc->astrdup(p,HPM_file2ptr(file),line,func);
}
@@ -849,6 +867,7 @@ bool hplugins_get_battle_conf(const char *w1, int *value)
{
int i;
+ nullpo_retr(w1, value);
nullpo_retr(false, value);
ARR_FIND(0, VECTOR_LENGTH(HPM->config_listeners[HPCT_BATTLE]), i, strcmpi(w1, VECTOR_INDEX(HPM->config_listeners[HPCT_BATTLE], i).key) == 0);
@@ -880,7 +899,7 @@ bool hplugins_parse_conf(const struct config_t *config, const char *filename, en
for (i = 0; i < VECTOR_LENGTH(HPM->config_listeners[point]); i++) {
const struct HPConfListenStorage *entry = &VECTOR_INDEX(HPM->config_listeners[point], i);
const char *config_name = entry->key;
- const char *str = buf;
+ const char *str = NULL;
if ((setting = libconfig->lookup(config, config_name)) == NULL) {
if (!imported && entry->required) {
ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename);
@@ -1012,9 +1031,11 @@ void hplugin_data_store_create(struct hplugin_data_store **storeptr, enum HPlugi
/**
* Called by HPM->DataCheck on a plugins incoming data, ensures data structs in use are matching!
**/
-bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, char *name) {
+bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, char *name)
+{
unsigned int i, j;
+ nullpo_retr(false, src);
if (version != datacheck_version) {
ShowError("HPMDataCheck:%s: DataCheck API version mismatch %d != %d\n", name, datacheck_version, version);
return false;
@@ -1039,7 +1060,8 @@ bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, c
return true;
}
-void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, int version) {
+void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, int version)
+{
unsigned int i;
datacheck_version = version;
@@ -1055,11 +1077,13 @@ void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, i
}
}
-void HPM_datacheck_final(void) {
+void HPM_datacheck_final(void)
+{
db_destroy(datacheck_db);
}
-void hpm_init(void) {
+void hpm_init(void)
+{
int i;
datacheck_db = NULL;
datacheck_data = NULL;
@@ -1070,8 +1094,8 @@ void hpm_init(void) {
HPM->off = false;
- memcpy(&iMalloc_HPM, iMalloc, sizeof(struct malloc_interface));
HPMiMalloc = &iMalloc_HPM;
+ *HPMiMalloc = *iMalloc;
HPMiMalloc->malloc = HPM_mmalloc;
HPMiMalloc->calloc = HPM_calloc;
HPMiMalloc->realloc = HPM_realloc;
@@ -1151,6 +1175,7 @@ void hpm_final(void)
return;
}
+
void hpm_defaults(void)
{
HPM = &HPM_s;
diff --git a/src/common/HPMSymbols.inc.h b/src/common/HPMSymbols.inc.h
index 7ccb960de..8dd0f1cd7 100644
--- a/src/common/HPMSymbols.inc.h
+++ b/src/common/HPMSymbols.inc.h
@@ -155,9 +155,6 @@ struct loginif_interface *loginif;
#ifdef MAP_MAIL_H /* mail */
struct mail_interface *mail;
#endif // MAP_MAIL_H
-#ifdef COMMON_MEMMGR_H /* iMalloc */
-struct malloc_interface *iMalloc;
-#endif // COMMON_MEMMGR_H
#ifdef MAP_MAP_H /* map */
struct map_interface *map;
#endif // MAP_MAP_H
@@ -405,9 +402,6 @@ if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("loginif", loginif)) return
#ifdef MAP_MAIL_H /* mail */
if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mail", mail)) return "mail";
#endif // MAP_MAIL_H
-#ifdef COMMON_MEMMGR_H /* iMalloc */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("iMalloc", iMalloc)) return "iMalloc";
-#endif // COMMON_MEMMGR_H
#ifdef MAP_MAP_H /* map */
if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("map", map)) return "map";
#endif // MAP_MAP_H
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 19b9b20a5..143c325c1 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -231,6 +231,7 @@ struct HPMi_interface {
/* Hooking */
struct HPMHooking_interface *hooking;
+ struct malloc_interface *memmgr;
};
#ifdef HERCULES_CORE
#define HPM_SYMBOL(n, s) (HPM->share((s), (n)), true)
diff --git a/src/common/console.c b/src/common/console.c
index f1b4523e2..654f26cb3 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -68,7 +68,8 @@ struct {
/*======================================
* CORE : Display title
*--------------------------------------*/
-void display_title(void) {
+void display_title(void)
+{
const char *vcstype = sysinfo->vcstype();
ShowMessage("\n");
@@ -130,21 +131,24 @@ int console_parse_key_pressed(void)
/**
* Stops server
**/
-CPCMD_C(exit,server) {
+CPCMD_C(exit, server)
+{
core->runflag = 0;
}
/**
* Displays ERS-related statistics (Entry Reusage System)
**/
-CPCMD_C(ers_report,server) {
+CPCMD_C(ers_report, server)
+{
ers_report();
}
/**
* Displays memory usage
**/
-CPCMD_C(mem_report,server) {
+CPCMD_C(mem_report, server)
+{
#ifdef USE_MEMMGR
memmgr_report(line?atoi(line):0);
#endif
@@ -171,7 +175,8 @@ CPCMD(help)
* [Ind/Hercules]
* Displays current malloc usage
*/
-CPCMD_C(malloc_usage,server) {
+CPCMD_C(malloc_usage, server)
+{
unsigned int val = (unsigned int)iMalloc->usage();
ShowInfo("malloc_usage: %.2f MB\n",(double)(val)/1024);
}
@@ -180,7 +185,8 @@ CPCMD_C(malloc_usage,server) {
* Skips an sql update
* Usage: sql update skip UPDATE-FILE.sql
**/
-CPCMD_C(skip,update) {
+CPCMD_C(skip, update)
+{
if( !line ) {
ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n");
return;
@@ -311,6 +317,7 @@ void console_parse_create(char *name, CParseFunc func)
char sublist[CP_CMD_LENGTH * 5];
struct CParseEntry *cmd;
+ nullpo_retv(name);
safestrncpy(sublist, name, CP_CMD_LENGTH * 5);
tok = strtok(sublist,":");
@@ -364,6 +371,7 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth)
{
int i;
char msg[CP_CMD_LENGTH * 2];
+ nullpo_retv(cmd);
Assert_retv(cmd->type == CPET_CATEGORY);
for (i = 0; i < VECTOR_LENGTH(cmd->u.children); i++) {
struct CParseEntry *child = VECTOR_INDEX(cmd->u.children, i);
@@ -391,6 +399,7 @@ void console_parse_sub(char *line)
char sublist[CP_CMD_LENGTH * 5];
int i;
+ nullpo_retv(line);
memcpy(bline, line, 200);
tok = strtok(line, " ");
@@ -444,9 +453,12 @@ void console_parse_sub(char *line)
}
ShowError("Is only a category, type '"CL_WHITE"%s help"CL_RESET"' to list its subcommands\n",sublist);
}
-void console_parse(char* line) {
+
+void console_parse(char *line)
+{
int c, i = 0, len = MAX_CONSOLE_INPUT - 1;/* we leave room for the \0 :P */
+ nullpo_retv(line);
while( (c = fgetc(stdin)) != EOF ) {
if( --len == 0 )
break;
@@ -458,7 +470,9 @@ void console_parse(char* line) {
line[i++] = '\0';
}
-void *cThread_main(void *x) {
+
+void *cThread_main(void *x)
+{
while( console->input->ptstate ) {/* loopx */
if( console->input->key_pressed() ) {
char input[MAX_CONSOLE_INPUT];
@@ -483,7 +497,9 @@ void *cThread_main(void *x) {
return NULL;
}
-int console_parse_timer(int tid, int64 tick, int id, intptr_t data) {
+
+int console_parse_timer(int tid, int64 tick, int id, intptr_t data)
+{
int i;
EnterSpinLock(console->input->ptlock);
for(i = 0; i < cinput.count; i++) {
@@ -494,7 +510,9 @@ int console_parse_timer(int tid, int64 tick, int id, intptr_t data) {
mutex->cond_signal(console->input->ptcond);
return 0;
}
-void console_parse_final(void) {
+
+void console_parse_final(void)
+{
if( console->input->ptstate ) {
InterlockedDecrement(&console->input->ptstate);
mutex->cond_signal(console->input->ptcond);
@@ -506,7 +524,9 @@ void console_parse_final(void) {
mutex->destroy(console->input->ptmutex);
}
}
-void console_parse_init(void) {
+
+void console_parse_init(void)
+{
cinput.count = 0;
console->input->ptstate = 1;
@@ -524,6 +544,7 @@ void console_parse_init(void) {
timer->add_func_list(console->input->parse_timer, "console_parse_timer");
timer->add_interval(timer->gettick() + 1000, console->input->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */
}
+
void console_setSQL(struct Sql *SQL_handle)
{
console->input->SQL = SQL_handle;
diff --git a/src/common/core.c b/src/common/core.c
index 63123dfea..74c63a6d6 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -100,7 +100,8 @@ struct core_interface *core = &core_s;
#ifndef POSIX
#define compat_signal(signo, func) signal((signo), (func))
#else
-sigfunc *compat_signal(int signo, sigfunc *func) {
+sigfunc *compat_signal(int signo, sigfunc *func)
+{
struct sigaction sact, oact;
sact.sa_handler = func;
@@ -121,7 +122,8 @@ sigfunc *compat_signal(int signo, sigfunc *func) {
* CORE : Console events for Windows
*--------------------------------------*/
#ifdef _WIN32
-static BOOL WINAPI console_handler(DWORD c_event) {
+static BOOL WINAPI console_handler(DWORD c_event)
+{
switch(c_event) {
case CTRL_CLOSE_EVENT:
case CTRL_LOGOFF_EVENT:
@@ -137,7 +139,8 @@ static BOOL WINAPI console_handler(DWORD c_event) {
return TRUE;
}
-static void cevents_init(void) {
+static void cevents_init(void)
+{
if (SetConsoleCtrlHandler(console_handler,TRUE)==FALSE)
ShowWarning ("Unable to install the console handler!\n");
}
@@ -146,7 +149,8 @@ static void cevents_init(void) {
/*======================================
* CORE : Signal Sub Function
*--------------------------------------*/
-static void sig_proc(int sn) {
+static void sig_proc(int sn)
+{
static int is_called = 0;
switch (sn) {
@@ -179,7 +183,8 @@ static void sig_proc(int sn) {
}
}
-void signals_init (void) {
+void signals_init (void)
+{
compat_signal(SIGTERM, sig_proc);
compat_signal(SIGINT, sig_proc);
#ifndef _DEBUG // need unhandled exceptions to debug on Windows
@@ -245,7 +250,8 @@ bool usercheck(void)
return true;
}
-void core_defaults(void) {
+void core_defaults(void)
+{
nullpo_defaults();
#ifndef MINICORE
hpm_defaults();
@@ -271,16 +277,20 @@ void core_defaults(void) {
thread_defaults();
#endif
}
+
/**
* Returns the source (core or plugin name) for the given command-line argument
*/
-const char *cmdline_arg_source(struct CmdlineArgData *arg) {
+const char *cmdline_arg_source(struct CmdlineArgData *arg)
+{
#ifdef MINICORE
return "core";
#else // !MINICORE
+ nullpo_retr(NULL, arg);
return HPM->pid2name(arg->pluginID);
#endif // MINICORE
}
+
/**
* Defines a command line argument.
*
@@ -292,9 +302,11 @@ const char *cmdline_arg_source(struct CmdlineArgData *arg) {
* @param options options associated to the command-line argument. @see enum cmdline_options.
* @return the success status.
*/
-bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
+bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options)
+{
struct CmdlineArgData *data = NULL;
+ nullpo_retr(false, name);
VECTOR_ENSURE(cmdline->args_data, 1, 1);
VECTOR_PUSHZEROED(cmdline->args_data);
data = &VECTOR_LAST(cmdline->args_data);
@@ -310,6 +322,7 @@ bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, Cm
return true;
}
+
/**
* Help screen to be displayed by '--help'.
*/
@@ -333,6 +346,7 @@ static CMDLINEARG(help)
}
return false;
}
+
/**
* Info screen to be displayed by '--version'.
*/
@@ -343,6 +357,7 @@ static CMDLINEARG(version)
ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
return false;
}
+
/**
* Checks if there is a value available for the current argument
*
@@ -360,6 +375,7 @@ bool cmdline_arg_next_value(const char *name, int current_arg, int argc)
return true;
}
+
/**
* Executes the command line arguments handlers.
*
@@ -381,6 +397,8 @@ bool cmdline_arg_next_value(const char *name, int current_arg, int argc)
int cmdline_exec(int argc, char **argv, unsigned int options)
{
int count = 0, i;
+
+ nullpo_ret(argv);
for (i = 1; i < argc; i++) {
int j;
struct CmdlineArgData *data = NULL;
@@ -423,6 +441,7 @@ int cmdline_exec(int argc, char **argv, unsigned int options)
}
return count;
}
+
/**
* Defines the global command-line arguments.
*/
@@ -466,10 +485,12 @@ void cmdline_defaults(void)
cmdline->arg_next_value = cmdline_arg_next_value;
cmdline->arg_source = cmdline_arg_source;
}
+
/*======================================
* CORE : MAINROUTINE
*--------------------------------------*/
-int main (int argc, char **argv) {
+int main (int argc, char **argv)
+{
int retval = EXIT_SUCCESS;
{// initialize program arguments
char *p1 = SERVER_NAME = argv[0];
diff --git a/src/common/db.c b/src/common/db.c
index 0c7bc2ae0..5f69e2f70 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -93,6 +93,7 @@
#include "common/ers.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
@@ -2795,7 +2796,8 @@ void *db_data2ptr(struct DBData *data)
* @public
* @see #db_final(void)
*/
-void db_init(void) {
+void db_init(void)
+{
db_iterator_ers = ers_new(sizeof(struct DBIterator_impl),"db.c::db_iterator_ers",ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
db_alloc_ers = ers_new(sizeof(struct DBMap_impl),"db.c::db_alloc_ers",ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
ers_chunk_size(db_alloc_ers, 50);
@@ -2907,7 +2909,7 @@ void db_final(void)
}
// Link DB System - jAthena
-void linkdb_insert( struct linkdb_node** head, void *key, void* data)
+void linkdb_insert(struct linkdb_node **head, void *key, void *data)
{
struct linkdb_node *node;
if( head == NULL ) return ;
@@ -2928,7 +2930,8 @@ void linkdb_insert( struct linkdb_node** head, void *key, void* data)
node->data = data;
}
-void linkdb_vforeach( struct linkdb_node** head, LinkDBFunc func, va_list ap) {
+void linkdb_vforeach(struct linkdb_node **head, LinkDBFunc func, va_list ap)
+{
struct linkdb_node *node;
if( head == NULL ) return;
node = *head;
@@ -2941,14 +2944,15 @@ void linkdb_vforeach( struct linkdb_node** head, LinkDBFunc func, va_list ap) {
}
}
-void linkdb_foreach( struct linkdb_node** head, LinkDBFunc func, ...) {
+void linkdb_foreach(struct linkdb_node **head, LinkDBFunc func, ...)
+{
va_list ap;
va_start(ap, func);
linkdb_vforeach(head, func, ap);
va_end(ap);
}
-void* linkdb_search( struct linkdb_node** head, void *key)
+void* linkdb_search(struct linkdb_node **head, void *key)
{
int n = 0;
struct linkdb_node *node;
@@ -2973,7 +2977,7 @@ void* linkdb_search( struct linkdb_node** head, void *key)
return NULL;
}
-void* linkdb_erase( struct linkdb_node** head, void *key)
+void* linkdb_erase(struct linkdb_node **head, void *key)
{
struct linkdb_node *node;
if( head == NULL ) return NULL;
@@ -2995,7 +2999,7 @@ void* linkdb_erase( struct linkdb_node** head, void *key)
return NULL;
}
-void linkdb_replace( struct linkdb_node** head, void *key, void *data )
+void linkdb_replace(struct linkdb_node **head, void *key, void *data)
{
int n = 0;
struct linkdb_node *node;
@@ -3022,7 +3026,7 @@ void linkdb_replace( struct linkdb_node** head, void *key, void *data )
linkdb_insert( head, key, data );
}
-void linkdb_final( struct linkdb_node** head )
+void linkdb_final(struct linkdb_node **head)
{
struct linkdb_node *node, *node2;
if( head == NULL ) return ;
@@ -3034,7 +3038,9 @@ void linkdb_final( struct linkdb_node** head )
}
*head = NULL;
}
-void db_defaults(void) {
+
+void db_defaults(void)
+{
DB = &DB_s;
DB->alloc = db_alloc;
DB->custom_release = db_custom_release;
@@ -3055,5 +3061,4 @@ void db_defaults(void) {
DB->ui2key = db_ui2key;
DB->i642key = db_i642key;
DB->ui642key = db_ui642key;
-
}
diff --git a/src/common/db.h b/src/common/db.h
index 1c0955221..4cbc66ade 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -1114,7 +1114,11 @@ HPShared struct db_interface *DB;
* @param _vec Vector.
*/
#define VECTOR_INIT(_vec) \
- memset(&(_vec), 0, sizeof(_vec))
+ do { \
+ VECTOR_DATA(_vec) = NULL; \
+ VECTOR_CAPACITY(_vec) = 0; \
+ VECTOR_LENGTH(_vec) = 0; \
+ } while(false)
/**
* Returns the internal array of values.
@@ -1220,12 +1224,11 @@ HPShared struct db_interface *DB;
*/
#define VECTOR_ENSURE(_vec, _n, _step) \
do { \
- int _empty_ = VECTOR_CAPACITY(_vec)-VECTOR_LENGTH(_vec); \
- if ((_n) > _empty_) { \
- while ((_n) > _empty_) \
- _empty_ += (_step); \
- VECTOR_RESIZE(_vec, _empty_+VECTOR_LENGTH(_vec)); \
- } \
+ int _newcapacity_ = VECTOR_CAPACITY(_vec); \
+ while ((_n) + VECTOR_LENGTH(_vec) > _newcapacity_) \
+ _newcapacity_ += (_step); \
+ if (_newcapacity_ > VECTOR_CAPACITY(_vec)) \
+ VECTOR_RESIZE(_vec, _newcapacity_); \
} while(false)
/**
diff --git a/src/common/des.c b/src/common/des.c
index c680610e9..73297ab70 100644
--- a/src/common/des.c
+++ b/src/common/des.c
@@ -23,6 +23,7 @@
#include "des.h"
#include "common/cbasetypes.h"
+#include "common/nullpo.h"
/** @file
* Implementation of the des interface.
@@ -54,6 +55,7 @@ static void des_IP(struct des_bit64 *src)
struct des_bit64 tmp = {{0}};
int i;
+ nullpo_retv(src);
for(i = 0; i < ARRAYLENGTH(ip_table); ++i) {
uint8_t j = ip_table[i] - 1;
if (src->b[(j >> 3) & 7] & mask[j & 7])
@@ -81,6 +83,7 @@ static void des_FP(struct des_bit64 *src)
struct des_bit64 tmp = {{0}};
int i;
+ nullpo_retv(src);
for (i = 0; i < ARRAYLENGTH(fp_table); ++i) {
uint8_t j = fp_table[i] - 1;
if (src->b[(j >> 3) & 7] & mask[j & 7])
@@ -119,6 +122,7 @@ static void des_E(struct des_bit64 *src)
tmp.b[i / 6 + 0] |= mask[i % 6];
}
#endif
+ nullpo_retv(src);
// optimized
tmp.b[0] = ((src->b[7]<<5) | (src->b[4]>>3)) & 0x3f; // ..0 vutsr
tmp.b[1] = ((src->b[4]<<1) | (src->b[5]>>7)) & 0x3f; // ..srqpo n
@@ -150,6 +154,7 @@ static void des_TP(struct des_bit64 *src)
struct des_bit64 tmp = {{0}};
int i;
+ nullpo_retv(src);
for (i = 0; i < ARRAYLENGTH(tp_table); ++i) {
uint8_t j = tp_table[i] - 1;
if (src->b[(j >> 3) + 0] & mask[j & 7])
@@ -194,6 +199,7 @@ static void des_SBOX(struct des_bit64 *src)
struct des_bit64 tmp = {{0}};
int i;
+ nullpo_retv(src);
for (i = 0; i < ARRAYLENGTH(s_table); ++i) {
tmp.b[i] = (s_table[i][src->b[i*2+0]] & 0xf0)
| (s_table[i][src->b[i*2+1]] & 0x0f);
@@ -214,6 +220,7 @@ static void des_RoundFunction(struct des_bit64 *src)
des_SBOX(&tmp);
des_TP(&tmp);
+ nullpo_retv(src);
src->b[0] ^= tmp.b[4];
src->b[1] ^= tmp.b[5];
src->b[2] ^= tmp.b[6];
diff --git a/src/common/ers.c b/src/common/ers.c
index 8970fefc2..3e1cdc25b 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -149,7 +149,8 @@ static struct ers_instance_t *InstanceList = NULL;
/**
* @param Options the options from the instance seeking a cache, we use it to give it a cache with matching configuration
**/
-static ers_cache_t *ers_find_cache(unsigned int size, enum ERSOptions Options) {
+static ers_cache_t *ers_find_cache(unsigned int size, enum ERSOptions Options)
+{
ers_cache_t *cache;
for (cache = CacheList; cache; cache = cache->Next)
@@ -187,6 +188,7 @@ static void ers_free_cache(ers_cache_t *cache, bool remove)
{
unsigned int i;
+ nullpo_retv(cache);
for (i = 0; i < cache->Used; i++)
aFree(cache->Blocks[i]);
@@ -307,7 +309,8 @@ static void ers_obj_destroy(ERS *self)
aFree(instance);
}
-void ers_cache_size(ERS *self, unsigned int new_size) {
+void ers_cache_size(ERS *self, unsigned int new_size)
+{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
nullpo_retv(instance);
@@ -319,10 +322,11 @@ void ers_cache_size(ERS *self, unsigned int new_size) {
instance->Cache->ChunkSize = new_size;
}
-
ERS *ers_new(uint32 size, char *name, enum ERSOptions options)
{
struct ers_instance_t *instance;
+
+ nullpo_retr(NULL, name);
CREATE(instance,struct ers_instance_t, 1);
size += sizeof(struct ers_list);
@@ -359,7 +363,8 @@ ERS *ers_new(uint32 size, char *name, enum ERSOptions options)
return &instance->VTable;
}
-void ers_report(void) {
+void ers_report(void)
+{
ers_cache_t *cache;
unsigned int cache_c = 0, blocks_u = 0, blocks_a = 0, memory_b = 0, memory_t = 0;
#ifdef DEBUG
@@ -403,7 +408,8 @@ void ers_report(void) {
/**
* Call on shutdown to clear remaining entries
**/
-void ers_final(void) {
+void ers_final(void)
+{
struct ers_instance_t *instance = InstanceList, *next;
while( instance ) {
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 0a9708f17..fba3dda86 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -86,11 +86,13 @@ struct grfio_interface *grfio;
// little endian char array to uint conversion
static unsigned int getlong(unsigned char *p)
{
+ nullpo_ret(p);
return (p[0] << 0 | p[1] << 8 | p[2] << 16 | p[3] << 24);
}
static void NibbleSwap(unsigned char *src, int len)
{
+ nullpo_retv(src);
while (len > 0) {
*src = (*src >> 4) | (*src << 4);
++src;
@@ -135,6 +137,7 @@ static void grf_shuffle_enc(struct des_bit64 *src)
{
struct des_bit64 out;
+ nullpo_retv(src);
out.b[0] = src->b[3];
out.b[1] = src->b[4];
out.b[2] = src->b[5];
@@ -152,6 +155,7 @@ static void grf_shuffle_dec(struct des_bit64 *src)
{
struct des_bit64 out;
+ nullpo_retv(src);
out.b[0] = src->b[3];
out.b[1] = src->b[4];
out.b[2] = src->b[6];
@@ -175,6 +179,7 @@ static void grf_decode_header(unsigned char *buf, size_t len)
struct des_bit64 *p = (struct des_bit64 *)buf;
size_t nblocks = len / sizeof(struct des_bit64);
size_t i;
+ nullpo_retv(buf);
// first 20 blocks are all des-encrypted
for (i = 0; i < 20 && i < nblocks; ++i)
@@ -197,6 +202,7 @@ static void grf_decode_full(unsigned char *buf, size_t len, int cycle)
int dcycle, scycle;
size_t i, j;
+ nullpo_retv(buf);
// first 20 blocks are all des-encrypted
for (i = 0; i < 20 && i < nblocks; ++i)
des->decrypt_block(&p[i]);
@@ -314,6 +320,7 @@ static void hashinit(void)
static int grf_filehash(const char *fname)
{
uint32 hash = 0;
+ nullpo_ret(fname);
while (*fname != '\0') {
hash = (hash<<1) + (hash>>7)*9 + TOLOWER(*fname);
fname++;
@@ -396,7 +403,9 @@ static struct grf_filelist *grfio_filelist_add(struct grf_filelist *entry)
*/
static struct grf_filelist *grfio_filelist_modify(struct grf_filelist *entry)
{
- struct grf_filelist *fentry = grfio_filelist_find(entry->fn);
+ struct grf_filelist *fentry;
+ nullpo_retr(NULL, entry);
+ fentry = grfio_filelist_find(entry->fn);
if (fentry != NULL) {
int tmp = fentry->next;
memcpy(fentry, entry, sizeof(struct grf_filelist));
@@ -434,6 +443,7 @@ static void grfio_localpath_create(char *buffer, size_t size, const char *filena
int i;
size_t len;
+ nullpo_retv(buffer);
len = strlen(data_dir);
if (data_dir[0] == '\0' || data_dir[len-1] == '/' || data_dir[len-1] == '\\')
@@ -553,6 +563,7 @@ void *grfio_reads(const char *fname, int *size)
static char *grfio_decode_filename(unsigned char *buf, int len)
{
int i;
+ nullpo_retr(NULL, buf);
for (i = 0; i < len; i += 8) {
NibbleSwap(&buf[i],8);
des->decrypt(&buf[i],8);
@@ -568,7 +579,9 @@ static char *grfio_decode_filename(unsigned char *buf, int len)
*/
static bool grfio_is_full_encrypt(const char *fname)
{
- const char *ext = strrchr(fname, '.');
+ const char *ext;
+ nullpo_retr(false, fname);
+ ext = strrchr(fname, '.');
if (ext != NULL) {
static const char *extensions[] = { ".gnd", ".gat", ".act", ".str" };
int i;
@@ -594,8 +607,10 @@ static int grfio_entryread(const char *grfname, int gentry)
unsigned char grf_header[0x2e] = { 0 };
int entry,entrys,ofs,grf_version;
unsigned char *grf_filelist;
+ FILE *fp;
- FILE *fp = fopen(grfname, "rb");
+ nullpo_retr(1, grfname);
+ fp = fopen(grfname, "rb");
if (fp == NULL) {
ShowWarning("GRF data file not found: '%s'\n", grfname);
return 1; // 1:not found error
@@ -764,6 +779,7 @@ static bool grfio_parse_restable_row(const char *row)
char local[256];
struct grf_filelist *entry = NULL;
+ nullpo_retr(false, row);
if (sscanf(row, "%255[^#\r\n]#%255[^#\r\n]#", w1, w2) != 2)
return false;
@@ -854,6 +870,7 @@ static void grfio_resourcecheck(void)
*/
static int grfio_add(const char *fname)
{
+ nullpo_retr(1, fname);
if (gentry_entrys >= gentry_maxentry) {
#define GENTRY_ADDS 4 // The number increment of gentry_table entries
gentry_maxentry += GENTRY_ADDS;
@@ -899,6 +916,7 @@ void grfio_init(const char *fname)
FILE *data_conf;
int grf_num = 0;
+ nullpo_retv(fname);
hashinit(); // hash table initialization
data_conf = fopen(fname, "r");
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 5b0f6169b..c09e6260d 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -25,6 +25,7 @@
#include "common/cbasetypes.h"
#include "common/db.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
@@ -37,11 +38,14 @@ struct mapindex_interface *mapindex;
/// Retrieves the map name from 'string' (removing .gat extension if present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname(const char* string, char* output) {
+const char* mapindex_getmapname(const char* string, char* output)
+{
static char buf[MAP_NAME_LENGTH];
char* dest = (output != NULL) ? output : buf;
- size_t len = strnlen(string, MAP_NAME_LENGTH_EXT);
+ size_t len;
+ nullpo_retr(buf, string);
+ len = strnlen(string, MAP_NAME_LENGTH_EXT);
if (len == MAP_NAME_LENGTH_EXT) {
ShowWarning("(mapindex_normalize_name) Map name '%*s' is too long!\n", 2*MAP_NAME_LENGTH_EXT, string);
len--;
@@ -58,12 +62,15 @@ const char* mapindex_getmapname(const char* string, char* output) {
/// Retrieves the map name from 'string' (adding .gat extension if not already present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname_ext(const char* string, char* output) {
+const char* mapindex_getmapname_ext(const char* string, char* output)
+{
static char buf[MAP_NAME_LENGTH_EXT];
char* dest = (output != NULL) ? output : buf;
size_t len;
+ nullpo_retr(buf, string);
+
safestrncpy(buf,string, sizeof(buf));
sscanf(string, "%*[^#]%*[#]%15s", buf);
@@ -87,7 +94,8 @@ const char* mapindex_getmapname_ext(const char* string, char* output) {
/// Adds a map to the specified index
/// Returns 1 if successful, 0 otherwise
-int mapindex_addmap(int index, const char* name) {
+int mapindex_addmap(int index, const char* name)
+{
char map_name[MAP_NAME_LENGTH];
if (index == -1){
@@ -128,7 +136,8 @@ int mapindex_addmap(int index, const char* name) {
return index;
}
-unsigned short mapindex_name2id(const char* name) {
+unsigned short mapindex_name2id(const char* name)
+{
int i;
char map_name[MAP_NAME_LENGTH];
@@ -141,7 +150,8 @@ unsigned short mapindex_name2id(const char* name) {
return 0;
}
-const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func) {
+const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func)
+{
if (id >= MAX_MAPINDEX || !mapindex_exists(id)) {
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line);
return mapindex->list[0].name; // dummy empty string so that the callee doesn't crash
@@ -149,7 +159,8 @@ const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const ch
return mapindex->list[id].name;
}
-int mapindex_init(void) {
+int mapindex_init(void)
+{
FILE *fp;
char line[1024];
int last_index = -1;
@@ -196,16 +207,20 @@ bool mapindex_check_default(void)
return true;
}
-void mapindex_removemap(int index){
+void mapindex_removemap(int index)
+{
+ Assert_retv(index < MAX_MAPINDEX);
strdb_remove(mapindex->db, mapindex->list[index].name);
mapindex->list[index].name[0] = '\0';
}
-void mapindex_final(void) {
+void mapindex_final(void)
+{
db_destroy(mapindex->db);
}
-void mapindex_defaults(void) {
+void mapindex_defaults(void)
+{
mapindex = &mapindex_s;
/* TODO: place it in inter-server.conf? */
diff --git a/src/common/memmgr.h b/src/common/memmgr.h
index 680947466..a5b7e4e7d 100644
--- a/src/common/memmgr.h
+++ b/src/common/memmgr.h
@@ -101,8 +101,10 @@ struct malloc_interface {
void malloc_defaults(void);
void memmgr_report(int extra);
-#endif // HERCULES_CORE
HPShared struct malloc_interface *iMalloc;
+#else
+#define iMalloc HPMi->memmgr
+#endif // HERCULES_CORE
#endif /* COMMON_MEMMGR_H */
diff --git a/src/common/mutex.c b/src/common/mutex.c
index bdc2fb4dc..464a54161 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -24,6 +24,7 @@
#include "common/cbasetypes.h" // for WIN32
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/timer.h"
@@ -84,6 +85,7 @@ struct mutex_data *mutex_create(void)
/// @copydoc mutex_interface::destroy()
void mutex_destroy(struct mutex_data *m)
{
+ nullpo_retv(m);
#ifdef WIN32
DeleteCriticalSection(&m->hMutex);
#else
@@ -96,6 +98,7 @@ void mutex_destroy(struct mutex_data *m)
/// @copydoc mutex_interface::lock()
void mutex_lock(struct mutex_data *m)
{
+ nullpo_retv(m);
#ifdef WIN32
EnterCriticalSection(&m->hMutex);
#else
@@ -106,6 +109,7 @@ void mutex_lock(struct mutex_data *m)
/// @copydoc mutex_interface::trylock()
bool mutex_trylock(struct mutex_data *m)
{
+ nullpo_retr(false, m);
#ifdef WIN32
if (TryEnterCriticalSection(&m->hMutex) != FALSE)
return true;
@@ -119,6 +123,7 @@ bool mutex_trylock(struct mutex_data *m)
/// @copydoc mutex_interface::unlock()
void mutex_unlock(struct mutex_data *m)
{
+ nullpo_retv(m);
#ifdef WIN32
LeaveCriticalSection(&m->hMutex);
#else
@@ -152,6 +157,7 @@ struct cond_data *cond_create(void)
/// @copydoc mutex_interface::cond_destroy()
void cond_destroy(struct cond_data *c)
{
+ nullpo_retv(c);
#ifdef WIN32
CloseHandle(c->events[EVENT_COND_SIGNAL]);
CloseHandle(c->events[EVENT_COND_BROADCAST]);
@@ -171,6 +177,7 @@ void cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks)
int result;
bool is_last = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
c->nWaiters++;
LeaveCriticalSection(&c->waiters_lock);
@@ -201,6 +208,7 @@ void cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks)
mutex->lock(m);
#else
+ nullpo_retv(m);
if (timeout_ticks < 0) {
pthread_cond_wait(&c->hCond, &m->hMutex);
} else {
@@ -221,6 +229,7 @@ void cond_signal(struct cond_data *c)
#ifdef WIN32
# if 0
bool has_waiters = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
if(c->nWaiters > 0)
has_waiters = true;
@@ -230,6 +239,7 @@ void cond_signal(struct cond_data *c)
# endif // 0
SetEvent(c->events[EVENT_COND_SIGNAL]);
#else
+ nullpo_retv(c);
pthread_cond_signal(&c->hCond);
#endif
}
@@ -240,6 +250,7 @@ void cond_broadcast(struct cond_data *c)
#ifdef WIN32
# if 0
bool has_waiters = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
if(c->nWaiters > 0)
has_waiters = true;
@@ -249,6 +260,7 @@ void cond_broadcast(struct cond_data *c)
# endif // 0
SetEvent(c->events[EVENT_COND_BROADCAST]);
#else
+ nullpo_retv(c);
pthread_cond_broadcast(&c->hCond);
#endif
}
diff --git a/src/common/socket.c b/src/common/socket.c
index ea7bfab40..d4b8bb43f 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -520,7 +520,8 @@ void flush_fifos(void)
/*======================================
* CORE : Connection functions
*--------------------------------------*/
-int connect_client(int listen_fd) {
+int connect_client(int listen_fd)
+{
int fd;
struct sockaddr_in client_address;
socklen_t len;
@@ -647,7 +648,8 @@ int make_listen_bind(uint32 ip, uint16 port)
return fd;
}
-int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
+int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt)
+{
struct sockaddr_in remote_address = { 0 };
int fd;
int result;
@@ -817,9 +819,12 @@ int rfifoskip(int fd, size_t len)
int wfifoset(int fd, size_t len)
{
size_t newreserve;
- struct socket_data* s = sockt->session[fd];
+ struct socket_data* s;
- if (!sockt->session_is_valid(fd) || s->wdata == NULL)
+ if (!sockt->session_is_valid(fd))
+ return 0;
+ s = sockt->session[fd];
+ if (s == NULL || s->wdata == NULL)
return 0;
// we have written len bytes to the buffer already before calling WFIFOSET
@@ -1018,10 +1023,6 @@ int do_sockets(int next)
}
}
-#ifdef __clang_analyzer__
- // Let Clang's static analyzer know this never happens (it thinks it might because of a NULL check in session_is_valid)
- if (!sockt->session[i]) continue;
-#endif // __clang_analyzer__
sockt->session[i]->func_parse(i);
if(!sockt->session[i])
@@ -1199,7 +1200,8 @@ static int connect_check_(uint32 ip)
/// Timer function.
/// Deletes old connection history records.
-static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) {
+static int connect_check_clear(int tid, int64 tick, int id, intptr_t data)
+{
int clear = 0;
int list = 0;
struct connect_history *hist = NULL;
@@ -1235,6 +1237,9 @@ int access_ipmask(const char *str, struct access_control *acc)
uint32 ip;
uint32 mask;
+ nullpo_ret(str);
+ nullpo_ret(acc);
+
if( strcmp(str,"all") == 0 ) {
ip = 0;
mask = 0;
@@ -1736,9 +1741,11 @@ bool session_is_active(int fd)
}
// Resolves hostname into a numeric ip.
-uint32 host2ip(const char* hostname)
+uint32 host2ip(const char *hostname)
{
- struct hostent* h = gethostbyname(hostname);
+ struct hostent* h;
+ nullpo_ret(hostname);
+ h = gethostbyname(hostname);
return (h != NULL) ? ntohl(*(uint32*)h->h_addr) : 0;
}
@@ -1771,7 +1778,8 @@ uint16 ntows(uint16 netshort)
}
/* [Ind/Hercules] - socket_datasync */
-void socket_datasync(int fd, bool send) {
+void socket_datasync(int fd, bool send)
+{
struct {
unsigned int length;/* short is not enough for some */
} data_list[] = {
@@ -2055,7 +2063,8 @@ void socket_net_config_read(const char *filename)
return;
}
-void socket_defaults(void) {
+void socket_defaults(void)
+{
sockt = &sockt_s;
sockt->fd_max = 0;
diff --git a/src/common/sql.c b/src/common/sql.c
index 8da105872..c80edbce4 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -144,6 +144,7 @@ int Sql_GetColumnNames(struct Sql *self, const char *table, char *out_buf, size_
size_t len;
size_t off = 0;
+ nullpo_retr(SQL_ERROR, out_buf);
if( self == NULL || SQL_ERROR == SQL->Query(self, "EXPLAIN `%s`", table) )
return SQL_ERROR;
@@ -377,7 +378,8 @@ void Sql_ShowDebug_(struct Sql *self, const char *debug_file, const unsigned lon
}
/// Frees a Sql handle returned by Sql_Malloc.
-void Sql_Free(struct Sql *self) {
+void Sql_Free(struct Sql *self)
+{
if( self )
{
SQL->FreeResult(self);
@@ -414,6 +416,7 @@ static enum enum_field_types Sql_P_SizeToMysqlIntType(int sz)
/// @private
static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type, void* buffer, size_t buffer_len, unsigned long* out_length, int8* out_is_null)
{
+ nullpo_retr(SQL_ERROR, bind);
memset(bind, 0, sizeof(MYSQL_BIND));
switch( buffer_type )
{
@@ -494,7 +497,8 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
/// Prints debug information about a field (type and length).
///
/// @private
-static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_types type, int is_unsigned, unsigned long length, const char* length_postfix) {
+static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_types type, int is_unsigned, unsigned long length, const char* length_postfix)
+{
const char *sign = (is_unsigned ? "UNSIGNED " : "");
const char *type_string = NULL;
switch (type) {
@@ -535,6 +539,7 @@ static void SqlStmt_P_ShowDebugTruncatedColumn(struct SqlStmt *self, size_t i)
MYSQL_FIELD* field;
MYSQL_BIND* column;
+ nullpo_retv(self);
meta = mysql_stmt_result_metadata(self->stmt);
field = mysql_fetch_field_direct(meta, (unsigned int)i);
ShowSQL("DB error - data of field '%s' was truncated.\n", field->name);
@@ -874,8 +879,10 @@ void SqlStmt_Free(struct SqlStmt *self)
aFree(self);
}
}
+
/* receives mysql error codes during runtime (not on first-time-connects) */
-void hercules_mysql_error_handler(unsigned int ecode) {
+void hercules_mysql_error_handler(unsigned int ecode)
+{
switch( ecode ) {
case 2003:/* Can't connect to MySQL (this error only happens here when failing to reconnect) */
if( mysql_reconnect_type == 1 ) {
@@ -1041,10 +1048,13 @@ void Sql_HerculesUpdateSkip(struct Sql *self, const char *filename)
return;
}
-void Sql_Init(void) {
+void Sql_Init(void)
+{
Sql_inter_server_read("conf/common/inter-server.conf", false); // FIXME: Hardcoded path
}
-void sql_defaults(void) {
+
+void sql_defaults(void)
+{
SQL = &sql_s;
SQL->Connect = Sql_Connect;
diff --git a/src/common/strlib.c b/src/common/strlib.c
index b67adb63c..75ce2a272 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -629,6 +629,7 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i
svstate.delim = delim;
svstate.done = false;
svstate.start = 0;
+ svstate.end = 0;
// parse
count = 0;
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index aeb8d8e71..3c7e25a0c 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -31,6 +31,7 @@
#include "common/cbasetypes.h"
#include "common/core.h"
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/strlib.h"
#include <stdio.h> // fopen
@@ -237,11 +238,13 @@ enum windows_ver_suite {
* @retval true if a revision was correctly detected.
* @retval false if no revision was detected. out is set to NULL in this case.
*/
-bool sysinfo_svn_get_revision(char **out) {
+bool sysinfo_svn_get_revision(char **out)
+{
// Only include SVN support if detected it, or we're on MSVC
#if !defined(SYSINFO_VCSTYPE) || SYSINFO_VCSTYPE == VCSTYPE_SVN || SYSINFO_VCSTYPE == VCSTYPE_UNKNOWN
FILE *fp;
+ nullpo_ret(out);
// subversion 1.7 uses a sqlite3 database
// FIXME this is hackish at best...
// - ignores database file structure
@@ -291,6 +294,8 @@ bool sysinfo_svn_get_revision(char **out) {
if (*out != NULL)
return true;
}
+#else
+ nullpo_ret(out);
#endif
if (*out != NULL)
aFree(*out);
@@ -305,11 +310,13 @@ bool sysinfo_svn_get_revision(char **out) {
* @retval true if a revision was correctly detected.
* @retval false if no revision was detected. out is set to NULL in this case.
*/
-bool sysinfo_git_get_revision(char **out) {
+bool sysinfo_git_get_revision(char **out)
+{
// Only include Git support if we detected it, or we're on MSVC
#if !defined(SYSINFO_VCSTYPE) || SYSINFO_VCSTYPE == VCSTYPE_GIT || SYSINFO_VCSTYPE == VCSTYPE_UNKNOWN
char ref[128], filepath[128], line[128];
+ nullpo_ret(out);
strcpy(ref, "HEAD");
while (*ref) {
@@ -334,6 +341,7 @@ bool sysinfo_git_get_revision(char **out) {
if (*out != NULL)
return true;
#else
+ nullpo_ret(out);
if (*out != NULL)
aFree(*out);
*out = NULL;
@@ -351,7 +359,8 @@ typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
*
* Once retrieved, the version string is stored into sysinfo->p->osversion.
*/
-void sysinfo_osversion_retrieve(void) {
+void sysinfo_osversion_retrieve(void)
+{
OSVERSIONINFOEX osvi;
StringBuf buf;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
@@ -602,7 +611,8 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
* System info is not stored anywhere after retrieval
* @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx
**/
-void sysinfo_systeminfo_retrieve( LPSYSTEM_INFO info ) {
+void sysinfo_systeminfo_retrieve(LPSYSTEM_INFO info)
+{
PGNSI pGNSI;
// Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
@@ -619,7 +629,8 @@ void sysinfo_systeminfo_retrieve( LPSYSTEM_INFO info ) {
* Returns number of bytes in a memory page
* Only needed when compiling with MSVC
**/
-long sysinfo_getpagesize( void ) {
+long sysinfo_getpagesize(void)
+{
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -633,7 +644,8 @@ long sysinfo_getpagesize( void ) {
* Once retrieved, the name is stored into sysinfo->p->cpu and the
* number of cores in sysinfo->p->cpucores.
*/
-void sysinfo_cpu_retrieve(void) {
+void sysinfo_cpu_retrieve(void)
+{
StringBuf buf;
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -669,7 +681,8 @@ void sysinfo_cpu_retrieve(void) {
*
* Once retrieved, the name is stored into sysinfo->p->arch.
*/
-void sysinfo_arch_retrieve(void) {
+void sysinfo_arch_retrieve(void)
+{
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -697,7 +710,8 @@ void sysinfo_arch_retrieve(void) {
*
* Once retrieved, the value is stored in sysinfo->p->vcsrevision_src.
*/
-void sysinfo_vcsrevision_src_retrieve(void) {
+void sysinfo_vcsrevision_src_retrieve(void)
+{
if (sysinfo->p->vcsrevision_src != NULL) {
aFree(sysinfo->p->vcsrevision_src);
sysinfo->p->vcsrevision_src = NULL;
@@ -721,7 +735,8 @@ void sysinfo_vcsrevision_src_retrieve(void) {
*
* Once retrieved, the value is stored in sysinfo->p->vcstype_name.
*/
-void sysinfo_vcstype_name_retrieve(void) {
+void sysinfo_vcstype_name_retrieve(void)
+{
if (sysinfo->p->vcstype_name != NULL) {
aFree(sysinfo->p->vcstype_name);
sysinfo->p->vcstype_name = NULL;
@@ -750,7 +765,8 @@ void sysinfo_vcstype_name_retrieve(void) {
*
* Output example: "Linux", "Darwin", "Windows", etc.
*/
-const char *sysinfo_platform(void) {
+const char *sysinfo_platform(void)
+{
return sysinfo->p->platform;
}
@@ -768,7 +784,8 @@ const char *sysinfo_platform(void) {
* Output example: "Windows 2008 Small Business Server", "OS X 10.8 Mountain Lion",
* "Gentoo Base System Release 2.2", "Debian GNU/Linux 6.0.6 (squeeze)", etc.
*/
-const char *sysinfo_osversion(void) {
+const char *sysinfo_osversion(void)
+{
return sysinfo->p->osversion;
}
@@ -787,7 +804,8 @@ const char *sysinfo_osversion(void) {
* "Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz", "Intel Core i7",
* "x86 CPU, Family 6, Model 54, Stepping 1", etc.
*/
-const char *sysinfo_cpu(void) {
+const char *sysinfo_cpu(void)
+{
return sysinfo->p->cpu;
}
@@ -800,7 +818,8 @@ const char *sysinfo_cpu(void) {
*
* @return the number of CPU cores.
*/
-int sysinfo_cpucores(void) {
+int sysinfo_cpucores(void)
+{
return sysinfo->p->cpucores;
}
@@ -817,7 +836,8 @@ int sysinfo_cpucores(void) {
*
* Output example: "x86", "x86_64", "IA-64", "ARM", etc.
*/
-const char *sysinfo_arch(void) {
+const char *sysinfo_arch(void)
+{
return sysinfo->p->arch;
}
@@ -827,7 +847,8 @@ const char *sysinfo_arch(void) {
* @retval true if this is a 64 bit build.
* @retval false if this isn't a 64 bit build (i.e. it is a 32 bit build).
*/
-bool sysinfo_is64bit(void) {
+bool sysinfo_is64bit(void)
+{
#ifdef _LP64
return true;
#else
@@ -845,7 +866,8 @@ bool sysinfo_is64bit(void) {
* Output example: "Microsoft Visual C++ 2012 (v170050727)",
* "Clang v5.0.0", "MinGW32 v3.20", "GCC v4.7.3", etc.
*/
-const char *sysinfo_compiler(void) {
+const char *sysinfo_compiler(void)
+{
return sysinfo->p->compiler;
}
@@ -860,7 +882,8 @@ const char *sysinfo_compiler(void) {
*
* Output example: "-ggdb -O2 -flto -pipe -ffast-math ..."
*/
-const char *sysinfo_cflags(void) {
+const char *sysinfo_cflags(void)
+{
return sysinfo->p->cflags;
}
@@ -875,7 +898,8 @@ const char *sysinfo_cflags(void) {
*
* @see VCSTYPE_NONE, VCSTYPE_GIT, VCSTYPE_SVN, VCSTYPE_UNKNOWN
*/
-int sysinfo_vcstypeid(void) {
+int sysinfo_vcstypeid(void)
+{
return sysinfo->p->vcstype;
}
@@ -892,7 +916,8 @@ int sysinfo_vcstypeid(void) {
*
* Output example: "Git", "SVN", "Exported"
*/
-const char *sysinfo_vcstype(void) {
+const char *sysinfo_vcstype(void)
+{
return sysinfo->p->vcstype_name;
}
@@ -910,7 +935,8 @@ const char *sysinfo_vcstype(void) {
*
* Output example: Git: "9128feccf3bddda94a7f8a170305565416815b40", SVN: "17546"
*/
-const char *sysinfo_vcsrevision_src(void) {
+const char *sysinfo_vcsrevision_src(void)
+{
return sysinfo->p->vcsrevision_src;
}
@@ -926,7 +952,8 @@ const char *sysinfo_vcsrevision_src(void) {
*
* Output example: Git: "9128feccf3bddda94a7f8a170305565416815b40", SVN: "17546"
*/
-const char *sysinfo_vcsrevision_scripts(void) {
+const char *sysinfo_vcsrevision_scripts(void)
+{
return sysinfo->p->vcsrevision_scripts;
}
@@ -934,7 +961,8 @@ const char *sysinfo_vcsrevision_scripts(void) {
* Reloads the run-time (scripts) VCS revision information. To be used during
* script reloads to refresh the cached version.
*/
-void sysinfo_vcsrevision_reload(void) {
+void sysinfo_vcsrevision_reload(void)
+{
if (sysinfo->p->vcsrevision_scripts != NULL) {
aFree(sysinfo->p->vcsrevision_scripts);
sysinfo->p->vcsrevision_scripts = NULL;
@@ -956,7 +984,8 @@ void sysinfo_vcsrevision_reload(void) {
* @retval false if the current process is running as regular user, or
* in any case under Windows.
*/
-bool sysinfo_is_superuser(void) {
+bool sysinfo_is_superuser(void)
+{
#ifndef _WIN32
if (geteuid() == 0)
return true;
@@ -967,7 +996,8 @@ bool sysinfo_is_superuser(void) {
/**
* Interface runtime initialization.
*/
-void sysinfo_init(void) {
+void sysinfo_init(void)
+{
sysinfo->p->compiler = SYSINFO_COMPILER;
#ifdef WIN32
sysinfo->p->platform = "Windows";
@@ -993,7 +1023,8 @@ void sysinfo_init(void) {
/**
* Interface shutdown cleanup.
*/
-void sysinfo_final(void) {
+void sysinfo_final(void)
+{
#ifdef WIN32
// Only need to be free'd in win32, they're #defined elsewhere
if (sysinfo->p->osversion)
@@ -1035,7 +1066,8 @@ static const char *sysinfo_time(void)
/**
* Interface default values initialization.
*/
-void sysinfo_defaults(void) {
+void sysinfo_defaults(void)
+{
sysinfo = &sysinfo_s;
memset(&sysinfo_p, '\0', sizeof(sysinfo_p));
sysinfo->p = &sysinfo_p;
diff --git a/src/common/timer.c b/src/common/timer.c
index 0b28f6a06..f820ebe12 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -258,10 +258,6 @@ int64 timer_gettick(void) {
/// Adds a timer to the timer_heap
static void push_timer_heap(int tid) {
BHEAP_ENSURE(timer_heap, 1, 256);
-#ifdef __clang_analyzer__ // Clang's static analyzer warns that BHEAP_ENSURE might set BHEAP_DATA(timer_heap) to NULL.
-#include "assert.h"
- assert(BHEAP_DATA(timer_heap) != NULL);
-#endif // __clang_analyzer__
BHEAP_PUSH(timer_heap, tid, DIFFTICK_MINTOPCMP, swap);
}
diff --git a/src/common/utils.c b/src/common/utils.c
index 73df3aae1..d393a6c23 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -54,6 +54,9 @@ void WriteDump(FILE* fp, const void* buffer, size_t length)
size_t i;
char hex[48+1], ascii[16+1];
+ nullpo_retv(fp);
+ nullpo_retv(buffer);
+
fprintf(fp, "--- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF\n");
ascii[16] = 0;
@@ -78,10 +81,12 @@ void WriteDump(FILE* fp, const void* buffer, size_t length)
}
/// Dumps given buffer on the console.
-void ShowDump(const void *buffer, size_t length) {
+void ShowDump(const void *buffer, size_t length)
+{
size_t i;
char hex[48+1], ascii[16+1];
+ nullpo_retv(buffer);
ShowDebug("--- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF\n");
ascii[16] = 0;
@@ -108,6 +113,7 @@ static char* checkpath(char *path, const char *srcpath)
{
// just make sure the char*path is not const
char *p = path;
+
if (NULL == path || NULL == srcpath)
return path;
while(*srcpath) {
@@ -400,7 +406,9 @@ int apply_percentrate(int value, int rate, int maxrate)
//-----------------------------------------------------
const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format)
{
- size_t len = strftime(str, size, format, localtime(&timestamp));
+ size_t len;
+ nullpo_retr(NULL, str);
+ len = strftime(str, size, format, localtime(&timestamp));
memset(str + len, '\0', size - len);
return str;
}
@@ -413,6 +421,7 @@ bool HCache_check(const char *file)
char s_path[255], dT[1];
time_t rtime;
+ nullpo_retr(false, file);
if (!(first = fopen(file,"rb")))
return false;
@@ -456,10 +465,14 @@ bool HCache_check(const char *file)
return true;
}
-FILE *HCache_open(const char *file, const char *opt) {
+FILE *HCache_open(const char *file, const char *opt)
+{
FILE *first;
char s_path[255];
+ nullpo_retr(NULL, file);
+ nullpo_retr(NULL, opt);
+
if( file[0] == '.' && file[1] == '/' )
file += 2;
else if( file[0] == '.' )
@@ -498,15 +511,19 @@ void HCache_init(void)
}
/* transit to fread, shields vs warn_unused_result */
-size_t hread(void * ptr, size_t size, size_t count, FILE * stream) {
+size_t hread(void *ptr, size_t size, size_t count, FILE *stream)
+{
return fread(ptr, size, count, stream);
}
+
/* transit to fwrite, shields vs warn_unused_result */
-size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream) {
+size_t hwrite(const void *ptr, size_t size, size_t count, FILE *stream)
+{
return fwrite(ptr, size, count, stream);
}
-void HCache_defaults(void) {
+void HCache_defaults(void)
+{
HCache = &HCache_s;
HCache->init = HCache_init;
diff --git a/src/map/battle.c b/src/map/battle.c
index daef8f6a8..67ab8c9b8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6008,20 +6008,18 @@ int battle_damage_area(struct block_list *bl, va_list ap) {
if (bl->type == BL_MOB && BL_UCCAST(BL_MOB, bl)->class_ == MOBID_EMPELIUM)
return 0;
if( bl != src && battle->check_target(src,bl,BCT_ENEMY) > 0 ) {
- struct map_session_data *sd = NULL;
nullpo_ret(src);
map->freeblock_lock();
- sd = BL_CAST(BL_PC, src);
if (src->type == BL_PC)
- battle->drain(sd, bl, damage, damage, status_get_race(bl), is_boss(bl));
+ battle->drain(BL_UCAST(BL_PC, src), bl, damage, damage, status_get_race(bl), is_boss(bl));
if( amotion )
battle->delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0,true);
else
status_fix_damage(src,bl,damage,0);
clif->damage(bl,bl,amotion,dmotion,damage,1,BDT_ENDURE,0);
- if (src->type != BL_PC || !sd->state.autocast)
+ if (src->type != BL_PC || !BL_UCCAST(BL_PC, src)->state.autocast)
skill->additional_effect(src, bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
map->freeblock_unlock();
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 040f86a58..b92c3185f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3249,10 +3249,7 @@ void clif_changelook(struct block_list *bl,int type,int val)
#endif
break;
case LOOK_BODY2:
- if (val && (
- sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS ||
- sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK ||
- sd->sc.option&OPTION_OKTOBERFEST))
+ if (sd != NULL && (sd->sc.option&OPTION_COSTUME) != OPTION_NOTHING)
val = 0;
vd->body_style = val;
break;
@@ -5752,7 +5749,7 @@ void clif_heal(int fd, int type, int val)
int len = packet_len(cmd);
WFIFOHEAD(fd, len);
- WFIFOW(fd, 0) = 0x13d;
+ WFIFOW(fd, 0) = cmd;
WFIFOW(fd, 2) = type;
#if PACKETVER < 20150513
WFIFOW(fd, 4) = cap_value(val, 0, INT16_MAX);
@@ -14219,7 +14216,9 @@ void clif_ranklist_sub(unsigned char *buf, enum fame_list_type type) {
}
/// 097d <RankingType>.W {<CharName>.24B <point>L}*10 <mypoint>L (ZC_ACK_RANKING)
-void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
+void clif_ranklist(struct map_session_data *sd, enum fame_list_type type)
+{
+#if PACKETVER >= 20120502
int fd;
int mypoint = 0;
int upperMask;
@@ -14243,6 +14242,7 @@ void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
WFIFOL(fd, 284) = mypoint; //mypoint
WFIFOSET(fd, 288);
+#endif
}
void clif_parse_ranklist(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -17633,7 +17633,9 @@ void clif_snap( struct block_list *bl, short x, short y ) {
#endif
}
-void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
+void clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd)
+{
+#if PACKETVER >= 20120228
struct packet_monster_hp p;
nullpo_retv(md);
@@ -17644,6 +17646,7 @@ void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
p.MaxHP = md->status.max_hp;
clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
}
/* [Ind/Hercules] placeholder for unsupported incoming packets (avoids server disconnecting client) */
@@ -18163,7 +18166,9 @@ void clif_parse_BankWithdraw(int fd, struct map_session_data *sd)
}
void clif_parse_BankCheck(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-void clif_parse_BankCheck(int fd, struct map_session_data* sd) {
+void clif_parse_BankCheck(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20130313
struct packet_banking_check p;
if (!battle_config.feature_banking) {
@@ -18176,6 +18181,7 @@ void clif_parse_BankCheck(int fd, struct map_session_data* sd) {
p.Reason = (short)0;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
void clif_parse_BankOpen(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -18188,7 +18194,9 @@ void clif_parse_BankClose(int fd, struct map_session_data* sd) {
return;
}
-void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason) {
+void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason)
+{
+#if PACKETVER >= 20130313
struct packet_banking_deposit_ack p;
nullpo_retv(sd);
@@ -18198,9 +18206,12 @@ void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK r
p.Reason = (short)reason;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
-void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason) {
+void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason)
+{
+#if PACKETVER >= 20130313
struct packet_banking_withdraw_ack p;
nullpo_retv(sd);
@@ -18210,6 +18221,7 @@ void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK
p.Reason = (short)reason;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
/* TODO: official response packet (tried 0x8cb/0x97b but the display was quite screwed up.) */
@@ -18466,6 +18478,7 @@ void clif_PartyLeaderChanged(struct map_session_data *sd, int prev_leader_aid, i
void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/* Roulette System [Yommy/Hercules] */
void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) {
+#if PACKETVER >= 20140612
struct packet_roulette_open_ack p;
if( !battle_config.feature_roulette ) {
@@ -18484,10 +18497,13 @@ void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) {
p.SilverPoint = pc_readglobalreg(sd, script->add_str("TmpRouletteSilver"));
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
+void clif_parse_RouletteInfo(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_info_ack p;
unsigned short i, j, count = 0;
@@ -18510,7 +18526,7 @@ void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
}
}
clif->send(&p,sizeof(p), &sd->bl, SELF);
- return;
+#endif
}
void clif_parse_RouletteClose(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -18584,7 +18600,9 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) __attribut
/**
* Request to cash in!
**/
-void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
+void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_itemrecv_ack p;
if( !battle_config.feature_roulette ) {
@@ -18627,7 +18645,7 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
p.Result = RECV_ITEM_FAILED;
clif->send(&p,sizeof(p), &sd->bl, SELF);
- return;
+#endif
}
bool clif_parse_roulette_db(void) {
@@ -18722,7 +18740,9 @@ bool clif_parse_roulette_db(void) {
/**
*
**/
-void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID) {
+void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_generate_ack p;
nullpo_retv(sd);
@@ -18736,6 +18756,7 @@ void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char resul
p.RemainSilver = pc_readglobalreg(sd, script->add_str("TmpRouletteSilver"));
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
/**
@@ -18743,6 +18764,7 @@ void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char resul
*/
void clif_openmergeitem(int fd, struct map_session_data *sd)
{
+#if PACKETVER > 20120228
int i = 0, n = 0, j = 0;
struct merge_item merge_items[MAX_INVENTORY];
struct merge_item *merge_items_[MAX_INVENTORY] = {0};
@@ -18785,6 +18807,7 @@ void clif_openmergeitem(int fd, struct map_session_data *sd)
for ( i = 0; i < j; i++ )
WFIFOW(fd,i*2+4) = merge_items_[i]->position;
WFIFOSET(fd,2*j+4);
+#endif
}
int clif_comparemergeitem(const void *a, const void *b)
@@ -18801,6 +18824,7 @@ int clif_comparemergeitem(const void *a, const void *b)
void clif_ackmergeitems(int fd, struct map_session_data *sd)
{
+#if PACKETVER > 20120228
int i = 0, n = 0, length = 0, count = 0;
int16 nameid = 0, indexes[MAX_INVENTORY] = {0}, amounts[MAX_INVENTORY] = {0};
struct item item_data;
@@ -18880,6 +18904,7 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
WFIFOW(fd,4) = count;
WFIFOB(fd,6) = MERGEITEM_SUCCESS;
WFIFOSET(fd,7);
+#endif
}
void clif_cancelmergeitem (int fd, struct map_session_data *sd)
diff --git a/src/map/path.c b/src/map/path.c
index f5e08d4df..07b38b740 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -192,10 +192,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i
/// Ensures there is enough space in array to store new element.
static void heap_push_node(struct node_heap *heap, struct path_node *node)
{
-#ifndef __clang_analyzer__ // TODO: Figure out why clang's static analyzer doesn't like this
BHEAP_ENSURE(*heap, 1, 256);
BHEAP_PUSH2(*heap, node, NODE_MINTOPCMP, swap_ptr);
-#endif // __clang_analyzer__
}
/// Updates path_node in the binary node_heap.
diff --git a/src/map/script.c b/src/map/script.c
index a1efbb3b8..d1aee29bf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5482,8 +5482,6 @@ bool script_sprintf(struct script_state *st, int start, struct StringBuf *out)
safestrncpy(buf, p, len);
StrBuf->AppendStr(out, buf);
}
-
- p = np;
np++;
// placeholder = "%%" ; (special case)
diff --git a/src/map/status.c b/src/map/status.c
index 5e65244ef..37efe1f93 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3806,13 +3806,15 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
}
if(flag&SCB_CRI && bst->cri) {
- if (st->luk == bst->luk)
+ if (st->luk == bst->luk) {
st->cri = status->calc_critical(bl, sc, bst->cri, true);
- else
+ } else {
st->cri = status->calc_critical(bl, sc, bst->cri + 3*(st->luk - bst->luk), true);
+ }
+ if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->status.weapon == W_KATAR) {
+ st->cri *= 2;
+ }
}
- if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->status.weapon == W_KATAR)
- st->cri <<= 1;
if(flag&SCB_FLEE2 && bst->flee2) {
if (st->luk == bst->luk)
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 6b88ddf43..1e4ca6425 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -3787,36 +3787,6 @@ typedef void (*HPMHOOK_post_mail_deliveryfail) (struct map_session_data *sd, str
typedef bool (*HPMHOOK_pre_mail_invalid_operation) (struct map_session_data **sd);
typedef bool (*HPMHOOK_post_mail_invalid_operation) (bool retVal___, struct map_session_data *sd);
#endif // MAP_MAIL_H
-#ifdef COMMON_MEMMGR_H /* iMalloc */
-typedef void (*HPMHOOK_pre_iMalloc_init) (void);
-typedef void (*HPMHOOK_post_iMalloc_init) (void);
-typedef void (*HPMHOOK_pre_iMalloc_final) (void);
-typedef void (*HPMHOOK_post_iMalloc_final) (void);
-typedef void* (*HPMHOOK_pre_iMalloc_malloc) (size_t *size, const char **file, int *line, const char **func);
-typedef void* (*HPMHOOK_post_iMalloc_malloc) (void* retVal___, size_t size, const char *file, int line, const char *func);
-typedef void* (*HPMHOOK_pre_iMalloc_calloc) (size_t *num, size_t *size, const char **file, int *line, const char **func);
-typedef void* (*HPMHOOK_post_iMalloc_calloc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func);
-typedef void* (*HPMHOOK_pre_iMalloc_realloc) (void **p, size_t *size, const char **file, int *line, const char **func);
-typedef void* (*HPMHOOK_post_iMalloc_realloc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
-typedef void* (*HPMHOOK_pre_iMalloc_reallocz) (void **p, size_t *size, const char **file, int *line, const char **func);
-typedef void* (*HPMHOOK_post_iMalloc_reallocz) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
-typedef char* (*HPMHOOK_pre_iMalloc_astrdup) (const char **p, const char **file, int *line, const char **func);
-typedef char* (*HPMHOOK_post_iMalloc_astrdup) (char* retVal___, const char *p, const char *file, int line, const char *func);
-typedef char* (*HPMHOOK_pre_iMalloc_astrndup) (const char **p, size_t *size, const char **file, int *line, const char **func);
-typedef char* (*HPMHOOK_post_iMalloc_astrndup) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func);
-typedef void (*HPMHOOK_pre_iMalloc_free) (void **p, const char **file, int *line, const char **func);
-typedef void (*HPMHOOK_post_iMalloc_free) (void *p, const char *file, int line, const char *func);
-typedef void (*HPMHOOK_pre_iMalloc_memory_check) (void);
-typedef void (*HPMHOOK_post_iMalloc_memory_check) (void);
-typedef bool (*HPMHOOK_pre_iMalloc_verify_ptr) (void **ptr);
-typedef bool (*HPMHOOK_post_iMalloc_verify_ptr) (bool retVal___, void *ptr);
-typedef size_t (*HPMHOOK_pre_iMalloc_usage) (void);
-typedef size_t (*HPMHOOK_post_iMalloc_usage) (size_t retVal___);
-typedef void (*HPMHOOK_pre_iMalloc_post_shutdown) (void);
-typedef void (*HPMHOOK_post_iMalloc_post_shutdown) (void);
-typedef void (*HPMHOOK_pre_iMalloc_init_messages) (void);
-typedef void (*HPMHOOK_post_iMalloc_init_messages) (void);
-#endif // COMMON_MEMMGR_H
#ifdef MAP_MAP_H /* map */
typedef void (*HPMHOOK_pre_map_zone_init) (void);
typedef void (*HPMHOOK_post_map_zone_init) (void);
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index 836e51f3f..3af236f48 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -804,34 +804,6 @@ struct {
struct HPMHookPoint *HP_loginif_send_users_count_post;
struct HPMHookPoint *HP_loginif_connect_to_server_pre;
struct HPMHookPoint *HP_loginif_connect_to_server_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_astrndup_pre;
- struct HPMHookPoint *HP_iMalloc_astrndup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
struct HPMHookPoint *HP_mapif_ban_pre;
struct HPMHookPoint *HP_mapif_ban_post;
struct HPMHookPoint *HP_mapif_server_init_pre;
@@ -2309,34 +2281,6 @@ struct {
int HP_loginif_send_users_count_post;
int HP_loginif_connect_to_server_pre;
int HP_loginif_connect_to_server_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_astrndup_pre;
- int HP_iMalloc_astrndup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
int HP_mapif_ban_pre;
int HP_mapif_ban_post;
int HP_mapif_server_init_pre;
@@ -3057,7 +3001,6 @@ struct {
struct inter_storage_interface inter_storage;
struct libconfig_interface libconfig;
struct loginif_interface loginif;
- struct malloc_interface iMalloc;
struct mapif_interface mapif;
struct mapindex_interface mapindex;
struct md5_interface md5;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index 047373f77..55fc347e5 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -436,21 +436,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(loginif->auth, HP_loginif_auth) },
{ HP_POP(loginif->send_users_count, HP_loginif_send_users_count) },
{ HP_POP(loginif->connect_to_server, HP_loginif_connect_to_server) },
-/* malloc_interface */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
/* mapif_interface */
{ HP_POP(mapif->ban, HP_mapif_ban) },
{ HP_POP(mapif->server_init, HP_mapif_server_init) },
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index 63afcab3c..89ae03319 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -10440,379 +10440,6 @@ void HP_loginif_connect_to_server(void) {
}
return;
}
-/* malloc_interface */
-void HP_iMalloc_init(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init();
- }
- if( HPMHooks.count.HP_iMalloc_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_final(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.final();
- }
- if( HPMHooks.count.HP_iMalloc_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, num, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrndup_pre ) {
- char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrndup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.free(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, line, func);
- }
- }
- return;
-}
-void HP_iMalloc_memory_check(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.memory_check();
- }
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-bool HP_iMalloc_verify_ptr(void *ptr) {
- int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void **ptr);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(&ptr);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
- }
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
- }
- }
- return retVal___;
-}
-size_t HP_iMalloc_usage(void) {
- int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
- retVal___ = preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.usage();
- }
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_post_shutdown(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.post_shutdown();
- }
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_init_messages(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init_messages();
- }
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
/* mapif_interface */
void HP_mapif_ban(int id, unsigned int flag, int status) {
int hIndex = 0;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
index 54ae8f030..d940e379a 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
@@ -46,7 +46,6 @@ memcpy(&HPMHooks.source.inter_quest, inter_quest, sizeof(struct inter_quest_inte
memcpy(&HPMHooks.source.inter_storage, inter_storage, sizeof(struct inter_storage_interface));
memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
memcpy(&HPMHooks.source.loginif, loginif, sizeof(struct loginif_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
memcpy(&HPMHooks.source.mapif, mapif, sizeof(struct mapif_interface));
memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface));
memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface));
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index b97b6ea7f..1d7ac8267 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -376,34 +376,6 @@ struct {
struct HPMHookPoint *HP_login_config_set_defaults_post;
struct HPMHookPoint *HP_login_config_read_pre;
struct HPMHookPoint *HP_login_config_read_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_astrndup_pre;
- struct HPMHookPoint *HP_iMalloc_astrndup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
struct HPMHookPoint *HP_md5_string_pre;
struct HPMHookPoint *HP_md5_string_post;
struct HPMHookPoint *HP_md5_binary_pre;
@@ -1077,34 +1049,6 @@ struct {
int HP_login_config_set_defaults_post;
int HP_login_config_read_pre;
int HP_login_config_read_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_astrndup_pre;
- int HP_iMalloc_astrndup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
int HP_md5_string_pre;
int HP_md5_string_post;
int HP_md5_binary_pre;
@@ -1438,7 +1382,6 @@ struct {
struct lclif_interface_private PRIV__lclif;
struct libconfig_interface libconfig;
struct login_interface login;
- struct malloc_interface iMalloc;
struct md5_interface md5;
struct mutex_interface mutex;
struct nullpo_interface nullpo;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index 2d3e37bc3..96a711af6 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -211,21 +211,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(login->parse_request_connection, HP_login_parse_request_connection) },
{ HP_POP(login->config_set_defaults, HP_login_config_set_defaults) },
{ HP_POP(login->config_read, HP_login_config_read) },
-/* malloc_interface */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
/* md5_interface */
{ HP_POP(md5->string, HP_md5_string) },
{ HP_POP(md5->binary, HP_md5_binary) },
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index 290c2283a..097b4b283 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -4716,379 +4716,6 @@ bool HP_login_config_read(const char *filename, bool included) {
}
return retVal___;
}
-/* malloc_interface */
-void HP_iMalloc_init(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init();
- }
- if( HPMHooks.count.HP_iMalloc_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_final(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.final();
- }
- if( HPMHooks.count.HP_iMalloc_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, num, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrndup_pre ) {
- char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrndup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.free(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, line, func);
- }
- }
- return;
-}
-void HP_iMalloc_memory_check(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.memory_check();
- }
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-bool HP_iMalloc_verify_ptr(void *ptr) {
- int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void **ptr);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(&ptr);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
- }
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
- }
- }
- return retVal___;
-}
-size_t HP_iMalloc_usage(void) {
- int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
- retVal___ = preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.usage();
- }
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_post_shutdown(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.post_shutdown();
- }
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_init_messages(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init_messages();
- }
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
/* md5_interface */
void HP_md5_string(const char *string, char *output) {
int hIndex = 0;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
index 6677a0c55..4bb7f5396 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
@@ -35,7 +35,6 @@ memcpy(&HPMHooks.source.lclif, lclif, sizeof(struct lclif_interface));
memcpy(&HPMHooks.source.PRIV__lclif, lclif->p, sizeof(struct lclif_interface_private));
memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
memcpy(&HPMHooks.source.login, login, sizeof(struct login_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
memcpy(&HPMHooks.source.md5, md5, sizeof(struct md5_interface));
memcpy(&HPMHooks.source.mutex, mutex, sizeof(struct mutex_interface));
memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface));
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index d71ecc52f..cbaf14715 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2984,34 +2984,6 @@ struct {
struct HPMHookPoint *HP_mail_deliveryfail_post;
struct HPMHookPoint *HP_mail_invalid_operation_pre;
struct HPMHookPoint *HP_mail_invalid_operation_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_astrndup_pre;
- struct HPMHookPoint *HP_iMalloc_astrndup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
struct HPMHookPoint *HP_map_zone_init_pre;
struct HPMHookPoint *HP_map_zone_init_post;
struct HPMHookPoint *HP_map_zone_remove_pre;
@@ -9047,34 +9019,6 @@ struct {
int HP_mail_deliveryfail_post;
int HP_mail_invalid_operation_pre;
int HP_mail_invalid_operation_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_astrndup_pre;
- int HP_iMalloc_astrndup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
int HP_map_zone_init_pre;
int HP_map_zone_init_post;
int HP_map_zone_remove_pre;
@@ -12179,7 +12123,6 @@ struct {
struct libconfig_interface libconfig;
struct log_interface logs;
struct mail_interface mail;
- struct malloc_interface iMalloc;
struct map_interface map;
struct mapindex_interface mapindex;
struct mapit_interface mapit;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index b6ee443a3..989296011 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1532,21 +1532,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mail->openmail, HP_mail_openmail) },
{ HP_POP(mail->deliveryfail, HP_mail_deliveryfail) },
{ HP_POP(mail->invalid_operation, HP_mail_invalid_operation) },
-/* malloc_interface */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->astrndup, HP_iMalloc_astrndup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
/* map_interface */
{ HP_POP(map->zone_init, HP_map_zone_init) },
{ HP_POP(map->zone_remove, HP_map_zone_remove) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 0c81e557f..e5712b34d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -39298,379 +39298,6 @@ bool HP_mail_invalid_operation(struct map_session_data *sd) {
}
return retVal___;
}
-/* malloc_interface */
-void HP_iMalloc_init(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init();
- }
- if( HPMHooks.count.HP_iMalloc_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_final(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.final();
- }
- if( HPMHooks.count.HP_iMalloc_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t num, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, num, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrndup(const char *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrndup_pre ) {
- char* (*preHookFunc) (const char **p, size_t *size, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrndup_pre[hIndex].func;
- retVal___ = preHookFunc(&p, &size, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrndup(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrndup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, size_t size, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrndup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrndup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, size, file, line, func);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void **p, const char **file, int *line, const char **func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(&p, &file, &line, &func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.free(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, line, func);
- }
- }
- return;
-}
-void HP_iMalloc_memory_check(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.memory_check();
- }
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-bool HP_iMalloc_verify_ptr(void *ptr) {
- int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void **ptr);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(&ptr);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
- }
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
- }
- }
- return retVal___;
-}
-size_t HP_iMalloc_usage(void) {
- int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
- retVal___ = preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.usage();
- }
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_post_shutdown(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.post_shutdown();
- }
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_init_messages(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init_messages();
- }
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
/* map_interface */
void HP_map_zone_init(void) {
int hIndex = 0;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
index 54861ed6f..0cc52b595 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
@@ -52,7 +52,6 @@ memcpy(&HPMHooks.source.itemdb, itemdb, sizeof(struct itemdb_interface));
memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
memcpy(&HPMHooks.source.logs, logs, sizeof(struct log_interface));
memcpy(&HPMHooks.source.mail, mail, sizeof(struct mail_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
memcpy(&HPMHooks.source.map, map, sizeof(struct map_interface));
memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface));
memcpy(&HPMHooks.source.mapit, mapit, sizeof(struct mapit_interface));
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl
index 3203e0b70..b8835b376 100755
--- a/tools/HPMHookGen/HPMHookGen.pl
+++ b/tools/HPMHookGen/HPMHookGen.pl
@@ -295,6 +295,7 @@ foreach my $file (@files) { # Loop through the xml files
my $loc = $data->{compounddef}->{$filekey}->{location}->[0];
next unless $loc->{file} =~ /src\/(map|char|login|common)\//;
next if $loc->{file} =~ /\/HPM.*\.h/; # Don't allow hooking into the HPM itself
+ next if $loc->{file} =~ /\/memmgr\.h/; # Don't allow hooking into the memory manager
my $servertype = $1;
my $key = $data->{compounddef}->{$filekey}->{compoundname}->[0];
my $original = $key;
@@ -338,8 +339,6 @@ foreach my $file (@files) { # Loop through the xml files
$key = "chr";
} elsif ($key eq "db_interface") {
$key = "DB";
- } elsif ($key eq "malloc_interface") {
- $key = "iMalloc";
} elsif ($key eq "socket_interface") {
$key = "sockt";
} elsif ($key eq "sql_interface") {