summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Hercules.xcodeproj/project.pbxproj2
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme13
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme13
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme13
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme19
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme16
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme19
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme19
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme19
-rw-r--r--Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme13
-rw-r--r--Makefile.in2
-rw-r--r--README.md184
-rw-r--r--conf/battle/battle.conf10
-rw-r--r--conf/battle/client.conf6
-rw-r--r--conf/battle/drops.conf2
-rw-r--r--conf/battle/exp.conf6
-rw-r--r--conf/battle/gm.conf4
-rw-r--r--conf/battle/guild.conf5
-rw-r--r--conf/battle/items.conf6
-rw-r--r--conf/battle/misc.conf20
-rw-r--r--conf/battle/monster.conf18
-rw-r--r--conf/battle/party.conf3
-rw-r--r--conf/battle/pet.conf6
-rw-r--r--conf/battle/player.conf4
-rw-r--r--conf/battle/skill.conf29
-rw-r--r--conf/battlegrounds.conf14
-rw-r--r--conf/channels.conf14
-rw-r--r--conf/char-server.conf9
-rw-r--r--conf/groups.conf43
-rw-r--r--conf/inter-server.conf4
-rw-r--r--conf/login-server.conf8
-rw-r--r--conf/map-server.conf6
-rw-r--r--conf/maps.conf6
-rw-r--r--conf/messages.conf2
-rw-r--r--conf/packet.conf2
-rw-r--r--conf/plugins.conf18
-rw-r--r--conf/script.conf1
-rw-r--r--db/cashshop_db.conf24
-rw-r--r--db/const.txt2
-rw-r--r--db/guild_skill_tree.txt1
-rw-r--r--db/homun_skill_tree.txt60
-rw-r--r--db/job_db2.txt3
-rw-r--r--db/map_index.txt14
-rw-r--r--db/mob_skill_db2.txt6
-rw-r--r--db/pet_db2.txt3
-rw-r--r--db/pre-re/exp.txt2
-rw-r--r--db/pre-re/exp_homun.txt2
-rw-r--r--db/pre-re/item_chain.conf16
-rw-r--r--db/pre-re/item_group.conf12
-rw-r--r--db/pre-re/item_packages.conf12
-rw-r--r--db/pre-re/job_db.conf67
-rw-r--r--db/pre-re/map_zone_db.conf75
-rw-r--r--db/pre-re/mob_skill_db.txt5
-rw-r--r--db/pre-re/pet_db.txt119
-rw-r--r--db/pre-re/size_fix.txt4
-rw-r--r--db/pre-re/skill_cast_db.txt104
-rw-r--r--db/pre-re/skill_db.txt11
-rw-r--r--db/pre-re/skill_require_db.txt6
-rw-r--r--db/pre-re/skill_tree.conf142
-rw-r--r--db/pre-re/skill_unit_db.txt10
-rw-r--r--db/produce_db.txt6
-rw-r--r--db/quest_db.conf674
-rw-r--r--db/re/exp_homun.txt2
-rw-r--r--db/re/item_chain.conf16
-rw-r--r--db/re/item_db.conf106
-rw-r--r--db/re/item_group.conf12
-rw-r--r--db/re/item_packages.conf10
-rw-r--r--db/re/job_db.conf54
-rw-r--r--db/re/level_penalty.txt2
-rw-r--r--db/re/map_zone_db.conf71
-rw-r--r--db/re/mob_db.txt3
-rw-r--r--db/re/mob_skill_db.txt6
-rw-r--r--db/re/pet_db.txt (renamed from db/pet_db.txt)5
-rw-r--r--db/re/size_fix.txt4
-rw-r--r--db/re/skill_cast_db.txt94
-rw-r--r--db/re/skill_db.txt11
-rw-r--r--db/re/skill_require_db.txt6
-rw-r--r--db/re/skill_tree.conf142
-rw-r--r--db/re/skill_unit_db.txt10
-rw-r--r--db/roulette_db.conf11
-rw-r--r--db/sc_config.txt4
-rw-r--r--db/skill_changematerial_db.txt32
-rw-r--r--db/translations.conf12
-rw-r--r--doc/script_commands.txt21
-rw-r--r--npc/airports/airships.txt4
-rw-r--r--npc/battleground/kvm/kvm01.txt2
-rw-r--r--npc/battleground/kvm/kvm02.txt2
-rw-r--r--npc/battleground/kvm/kvm03.txt2
-rw-r--r--npc/cities/amatsu.txt18
-rw-r--r--npc/cities/ayothaya.txt10
-rw-r--r--npc/cities/einbech.txt6
-rw-r--r--npc/cities/einbroch.txt4
-rw-r--r--npc/cities/geffen.txt6
-rw-r--r--npc/cities/hugel.txt2
-rw-r--r--npc/cities/jawaii.txt8
-rw-r--r--npc/cities/morocc.txt1
-rw-r--r--npc/cities/moscovia.txt2
-rw-r--r--npc/cities/yuno.txt4
-rw-r--r--npc/custom/battleground/bg_common.txt24
-rw-r--r--npc/custom/battleground/bg_flavius_01.txt2
-rw-r--r--npc/custom/battleground/bg_flavius_02.txt2
-rw-r--r--npc/custom/battleground/bg_kvm01.txt6
-rw-r--r--npc/custom/battleground/bg_kvm02.txt6
-rw-r--r--npc/custom/battleground/bg_kvm03.txt6
-rw-r--r--npc/custom/battleground/bg_tierra_01.txt8
-rw-r--r--npc/custom/battleground/bg_tierra_02.txt8
-rw-r--r--npc/custom/bgqueue/flavius.txt26
-rw-r--r--npc/custom/card_remover.txt4
-rw-r--r--npc/custom/etc/floating_rates.txt2
-rw-r--r--npc/custom/etc/marriage.txt38
-rw-r--r--npc/custom/etc/monster_arena.txt4
-rw-r--r--npc/custom/etc/penal_servitude.txt3
-rw-r--r--npc/custom/etc/quest_warper.txt21
-rw-r--r--npc/custom/etc/stock_market.txt3
-rw-r--r--npc/custom/events/valentinesdayexp.txt2
-rw-r--r--npc/custom/item_signer.txt1
-rw-r--r--npc/custom/quests/kaho_balmung.txt3
-rw-r--r--npc/custom/quests/questboard.txt230
-rw-r--r--npc/custom/quests/tha_statues.txt1
-rw-r--r--npc/custom/quests/thq/THQS_QuestNPC.txt2
-rw-r--r--npc/events/MemorialDay_2008.txt172
-rw-r--r--npc/events/RWC_2012.txt4
-rw-r--r--npc/events/christmas_2008.txt151
-rw-r--r--npc/events/dumplingfestival.txt4
-rw-r--r--npc/events/god_se_festival.txt2
-rw-r--r--npc/events/halloween_2009.txt6
-rw-r--r--npc/events/nguild/nguild_flags.txt8
-rw-r--r--npc/events/valentinesday_2009.txt17
-rw-r--r--npc/events/xmas.txt2
-rw-r--r--npc/instances/SealedShrine.txt16
-rw-r--r--npc/jobs/1-1e/taekwon.txt1
-rw-r--r--npc/jobs/2-1/assassin.txt2
-rw-r--r--npc/jobs/2-1/priest.txt1
-rw-r--r--npc/jobs/2-1e/StarGladiator.txt2
-rw-r--r--npc/jobs/2-2/crusader.txt3
-rw-r--r--npc/jobs/2-2a/Professor.txt1
-rw-r--r--npc/jobs/valkyrie.txt1
-rw-r--r--npc/merchants/dye_maker.txt2
-rw-r--r--npc/merchants/old_pharmacist.txt2
-rw-r--r--npc/other/Global_Functions.txt25
-rw-r--r--npc/other/books.txt3
-rw-r--r--npc/other/comodo_gambling.txt4
-rw-r--r--npc/other/fortune.txt2
-rw-r--r--npc/other/hugel_bingo.txt2
-rw-r--r--npc/other/monster_museum.txt56
-rw-r--r--npc/other/poring_war.txt2
-rw-r--r--npc/other/pvp.txt2
-rw-r--r--npc/other/turbo_track.txt55
-rw-r--r--npc/pre-re/guides/guides_alberta.txt2
-rw-r--r--npc/pre-re/guides/guides_amatsu.txt2
-rw-r--r--npc/pre-re/guides/guides_izlude.txt2
-rw-r--r--npc/pre-re/guides/guides_morroc.txt2
-rw-r--r--npc/pre-re/guides/guides_moscovia.txt1
-rw-r--r--npc/pre-re/jobs/1-1/acolyte.txt1
-rw-r--r--npc/pre-re/jobs/1-1/archer.txt1
-rw-r--r--npc/pre-re/quests/collection/quest_demonpungus.txt2
-rw-r--r--npc/pre-re/quests/collection/quest_dokebi.txt2
-rw-r--r--npc/pre-re/quests/collection/quest_fabre.txt2
-rw-r--r--npc/pre-re/quests/collection/quest_frilldora.txt2
-rw-r--r--npc/pre-re/quests/collection/quest_goat.txt1
-rw-r--r--npc/pre-re/quests/collection/quest_golem.txt2
-rw-r--r--npc/pre-re/quests/skills/novice_skills.txt (renamed from npc/quests/skills/novice_skills.txt)0
-rw-r--r--npc/pre-re/scripts_jobs.conf4
-rw-r--r--npc/quests/first_class/tu_merchant.txt63
-rw-r--r--npc/quests/first_class/tu_sword.txt48
-rw-r--r--npc/quests/lvl4_weapon_quest.txt6
-rw-r--r--npc/quests/newgears/2010_headgears.txt16
-rw-r--r--npc/quests/quests_lighthalzen.txt3
-rw-r--r--npc/quests/quests_nameless.txt2
-rw-r--r--npc/quests/skills/hunter_skills.txt1
-rw-r--r--npc/re/cities/dewata.txt2
-rw-r--r--npc/re/cities/eclage.txt13
-rw-r--r--npc/re/cities/izlude.txt191
-rw-r--r--npc/re/events/halloween_2014.txt7
-rw-r--r--npc/re/instances/BuwayaCave.txt2
-rw-r--r--npc/re/instances/EclageInterior.txt42
-rw-r--r--npc/re/instances/MalangdoCulvert.txt2
-rw-r--r--npc/re/instances/OctopusCave.txt2
-rw-r--r--npc/re/instances/WolfchevLaboratory.txt6
-rw-r--r--npc/re/jobs/1-1/acolyte.txt1
-rw-r--r--npc/re/jobs/2e/kagerou_oboro.txt12
-rw-r--r--npc/re/jobs/novice/academy.txt14213
-rw-r--r--npc/re/jobs/novice/novice.txt2
-rw-r--r--npc/re/merchants/coin_exchange.txt7
-rw-r--r--npc/re/merchants/diamond.txt27
-rw-r--r--npc/re/merchants/ninja_craftsman.txt22
-rw-r--r--npc/re/merchants/shadow_refiner.txt14
-rw-r--r--npc/re/mobs/champion.txt2
-rw-r--r--npc/re/mobs/dungeons/treasure.txt64
-rw-r--r--npc/re/mobs/fields/niflheim.txt2
-rw-r--r--npc/re/mobs/fields/prontera.txt36
-rw-r--r--npc/re/mobs/fields/umbala.txt8
-rw-r--r--npc/re/quests/cupet.txt36
-rw-r--r--npc/re/quests/eden/100-110.txt2
-rw-r--r--npc/re/quests/eden/111-120.txt1
-rw-r--r--npc/re/quests/eden/131-140.txt4
-rw-r--r--npc/re/quests/eden/eden_quests.txt2
-rw-r--r--npc/re/quests/newgears/2012_headgears.txt4
-rw-r--r--npc/re/quests/quests_dewata.txt1
-rw-r--r--npc/re/quests/quests_dicastes.txt11
-rw-r--r--npc/re/quests/quests_eclage.txt158
-rw-r--r--npc/re/quests/quests_malangdo.txt2
-rw-r--r--npc/re/quests/quests_malaya.txt8
-rw-r--r--npc/re/scripts_jobs.conf3
-rw-r--r--npc/re/warps/cities/izlude.txt15
-rw-r--r--npc/re/warps/dungeons/ecl_dun.txt2
-rw-r--r--npc/scripts_jobs.conf2
-rw-r--r--npc/warps/cities/einbroch.txt9
-rw-r--r--npc/warps/cities/gonryun.txt2
-rw-r--r--npc/warps/cities/mid_camp.txt1
-rw-r--r--npc/warps/cities/prontera.txt2
-rw-r--r--npc/warps/dungeons/lhz_dun.txt2
-rw-r--r--npc/warps/dungeons/mosk_dun.txt7
-rw-r--r--npc/warps/pvp.txt1
-rw-r--r--npc/woe-fe/agit_main.txt4
-rw-r--r--sql-files/item_db_re.sql8
-rw-r--r--sql-files/main.sql69
-rw-r--r--sql-files/upgrades/index.txt1
-rw-r--r--src/char/HPMchar.h1
-rw-r--r--src/char/char.c59
-rw-r--r--src/char/int_quest.h1
-rw-r--r--src/char/inter.c2
-rw-r--r--src/common/HPM.c33
-rw-r--r--src/common/HPMDataCheck.h1
-rw-r--r--src/common/HPMi.h7
-rw-r--r--src/common/atomic.h14
-rw-r--r--src/common/core.c6
-rw-r--r--src/common/db.h111
-rw-r--r--src/common/grfio.c24
-rw-r--r--src/common/mmo.h5
-rw-r--r--src/common/mutex.c17
-rw-r--r--src/common/nullpo.c1
-rw-r--r--src/common/socket.c14
-rw-r--r--src/common/sql.c88
-rw-r--r--src/common/sql.h25
-rw-r--r--src/common/strlib.c5
-rw-r--r--src/common/thread.c20
-rw-r--r--src/common/utils.c6
-rw-r--r--src/config/core.h1
-rw-r--r--src/map/HPMmap.c21
-rw-r--r--src/map/atcommand.c1213
-rw-r--r--src/map/atcommand.h5
-rw-r--r--src/map/battle.c154
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/battleground.c35
-rw-r--r--src/map/buyingstore.c20
-rw-r--r--src/map/channel.c23
-rw-r--r--src/map/chat.c12
-rw-r--r--src/map/chrif.c39
-rw-r--r--src/map/clif.c1652
-rw-r--r--src/map/clif.h8
-rw-r--r--src/map/duel.c49
-rw-r--r--src/map/elemental.c21
-rw-r--r--src/map/guild.c99
-rw-r--r--src/map/homunculus.c27
-rw-r--r--src/map/instance.c99
-rw-r--r--src/map/intif.c98
-rw-r--r--src/map/irc-bot.c71
-rw-r--r--src/map/itemdb.c311
-rw-r--r--src/map/log.c32
-rw-r--r--src/map/mail.c6
-rw-r--r--src/map/map.c250
-rw-r--r--src/map/map.h23
-rw-r--r--src/map/mercenary.c21
-rw-r--r--src/map/mob.c70
-rw-r--r--src/map/npc.c289
-rw-r--r--src/map/npc_chat.c70
-rw-r--r--src/map/packets.h3
-rw-r--r--src/map/party.c42
-rw-r--r--src/map/path.c37
-rw-r--r--src/map/path.h6
-rw-r--r--src/map/pc.c479
-rw-r--r--src/map/pc.h6
-rw-r--r--src/map/pc_groups.c38
-rw-r--r--src/map/pet.c161
-rw-r--r--src/map/quest.c1
-rw-r--r--src/map/script.c703
-rw-r--r--src/map/script.h16
-rw-r--r--src/map/skill.c143
-rw-r--r--src/map/status.c96
-rw-r--r--src/map/unit.c66
-rw-r--r--src/plugins/HPMHooking.c4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc88
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc22
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc696
-rw-r--r--src/plugins/db2sql.c4
-rw-r--r--src/test/test_spinlock.c11
-rw-r--r--src/tool/mapcache.c3
-rw-r--r--tools/HPMHookGen/doxygen.conf114
-rwxr-xr-xtravis.sh2
290 files changed, 21270 insertions, 5444 deletions
diff --git a/Hercules.xcodeproj/project.pbxproj b/Hercules.xcodeproj/project.pbxproj
index 53f265077..1472c088a 100644
--- a/Hercules.xcodeproj/project.pbxproj
+++ b/Hercules.xcodeproj/project.pbxproj
@@ -1068,7 +1068,7 @@
A56CC652185642B4009EB79C /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0610;
+ LastUpgradeCheck = 0700;
ORGANIZATIONNAME = herc.ws;
};
buildConfigurationList = A56CC655185642B4009EB79C /* Build configuration list for PBXProject "Hercules" */;
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_char.xcscheme
index 12a0d695e..939f8b553 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,21 +23,24 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@@ -52,10 +55,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_login.xcscheme
index 5fa20971c..18d882660 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,21 +23,24 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@@ -52,10 +55,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/HPMHooking_map.xcscheme
index 858418253..064025406 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,21 +23,24 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@@ -52,10 +55,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/char-server.xcscheme
index b9836d007..5f85740db 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
@@ -38,17 +38,21 @@
ReferencedContainer = "container:Hercules.xcodeproj">
</BuildableReference>
</MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC6721856434D009EB79C"
@@ -61,12 +65,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC6721856434D009EB79C"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme
index d7e8bdeee..a90bb43af 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
@@ -37,21 +37,24 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PreActions>
<ExecutionAction
@@ -91,7 +94,8 @@
</ActionContent>
</ExecutionAction>
</PostActions>
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC67B18564356009EB79C"
@@ -110,10 +114,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/login-server.xcscheme
index 440318f1a..3977cbe03 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
@@ -38,17 +38,21 @@
ReferencedContainer = "container:Hercules.xcodeproj">
</BuildableReference>
</MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC66918564315009EB79C"
@@ -61,12 +65,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC66918564315009EB79C"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/map-server.xcscheme
index 7dc549275..83a72c791 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
@@ -38,17 +38,21 @@
ReferencedContainer = "container:Hercules.xcodeproj">
</BuildableReference>
</MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC67B18564356009EB79C"
@@ -61,12 +65,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A56CC67B18564356009EB79C"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/mapcache.xcscheme
index 20d0f01e1..bac21b6d8 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,10 +23,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
@@ -38,17 +38,21 @@
ReferencedContainer = "container:Hercules.xcodeproj">
</BuildableReference>
</MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A5380CCC1856CE180090CBC4"
@@ -61,12 +65,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A5380CCC1856CE180090CBC4"
diff --git a/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme b/Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme
index 0fcd90852..bdb806e99 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 = "0610"
+ LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -23,21 +23,24 @@
</BuildActionEntries>
</BuildAction>
<TestAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
+ shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
+ buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@@ -52,10 +55,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
+ buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
diff --git a/Makefile.in b/Makefile.in
index d2877c6b0..9e7e35b1a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -156,7 +156,7 @@ sysinfo: config.status
config.status: configure
@echo " RECONFIGURE"
- @./config.status --recheck
+ @./config.status --recheck && ./config.status
help: Makefile
@echo "most common targets are 'all' 'sql' 'clean' 'plugins' 'help'"
diff --git a/README.md b/README.md
index e3e19be33..ab8c0aaa1 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,25 @@
Hercules
========
-Build Status: [![Build Status](https://travis-ci.org/HerculesWS/Hercules.png?branch=master)](https://travis-ci.org/HerculesWS/Hercules)
+Build Status:
+[![Build Status](https://travis-ci.org/HerculesWS/Hercules.svg)](https://travis-ci.org/HerculesWS/Hercules)
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/3892/badge.svg)](https://scan.coverity.com/projects/herculesws-hercules)
+
+Issues and pull requests:
+[![Open Issues](https://img.shields.io/github/issues-raw/HerculesWS/Hercules.svg?label=Open%20Issues)](https://github.com/HerculesWS/Hercules/issues)
+[![Issues in progress](https://badge.waffle.io/HerculesWS/Hercules.svg?label=status%3Aconfirmed&title=In%20Progress)](https://waffle.io/HerculesWS/Hercules)
+[![Ready PRs](https://badge.waffle.io/HerculesWS/Hercules.svg?label=status%3Aready&title=Ready%20PRs)](https://waffle.io/HerculesWS/Hercules)
+
+Development and Community:
+[![GitHub Repository](https://img.shields.io/badge/github-HerculesWS/Hercules-green.svg)](https://github.com/HerculesWS/Hercules)
+[![Waffle Board](https://img.shields.io/badge/waffle-HerculesWS/Hercules-6699dd.svg)](https://waffle.io/HerculesWS/Hercules)
+[![IRC](https://img.shields.io/badge/IRC-Rizon/Hercules-yellow.svg)](irc://rizon.net/Hercules)
+[![Community Forum](https://img.shields.io/badge/forum-herc.ws-orange.svg)](http://herc.ws)
+[![Twitter](https://img.shields.io/badge/twitter-@HerculesWS-blue.svg)](https://twitter.com/HerculesWS)
+
+Project Info:
+![Language](https://img.shields.io/badge/language-C-yellow.svg)
+[![License](https://img.shields.io/badge/license-GPLv3-663399.svg)](https://github.com/HerculesWS/Hercules/blob/master/LICENSE)
Table of Contents
---------
@@ -12,81 +30,102 @@ Table of Contents
* 5 Helpful Links
* 6 More Documentation
-1. What is Hercules?
----------
+What is Hercules?
+-----------------
Hercules is a collaborative software development project revolving around the
creation of a robust massively multiplayer online role playing game (MMORPG)
server package. Written in C, the program is very versatile and provides NPCs,
-warps and modifications. The project is jointly managed by a group of volunteers
-located around the world as well as a tremendous community providing QA and
-support. Hercules is a continuation of the original Athena project.
+warps and modifications. The project is jointly managed by a group of
+volunteers located around the world as well as a tremendous community providing
+QA and support. Hercules is a continuation of the original Athena project.
+
+Prerequisites
+-------------
+Before installing Hercules there are certain tools and applications you will
+need. This differs between the varying operating systems available, so the
+following is broken down into Windows and Unix (incl. Linux) prerequisites.
+
+#### Windows
+ - Git client
+ - MySQL-compatible server ([MySQL Community Edition](https://www.mysql.com/products/community/) or [MariaDB](https://mariadb.org/))
+ - Microsoft Visual Studio ([Version 2010 through 2015](https://www.visualstudio.com/))
+
+#### Unix/Linux/BSD (names of packages may require specific version numbers on certain distributions)
+ - git
+ - gcc or clang (version 4.1 or newer, recommended 4.8 or newer)
+ - GNU make
+ - mysql (mysql-server)
+ - libmysqlclient (mysql-devel)
+ - zlib (zlib-devel)
+ - libpcre (pcre-devel) *optional*
+ - *Optional dependencies for development only*
+ - perl (required to rebuild the HPM Hooks and HPMDataCheck or to regenerate the mobdb sql table)
+ - Doxygen (required to rebuild the HPM Hooks and HPMDataCheck)
+
+#### Mac OS X
+ - Xcode
+ - MySQL-compatible server (installation of mysql or mariadb through [Homebrew](http://brew.sh/) is recommended)
+ - libpcre (pcre-devel) *optional*
+ - *Optional dependencies for development only*
+ - Doxygen (required to rebuild the HPM Hooks and HPMDataCheck)
+
+#### Optional, useful tools
+ - MySQL GUI clients
+ - [MySQL Workbench](http://www.mysql.com/downloads/workbench/) (cross-platform)
+ - [HeidiSQL](http://www.heidisql.com/) (Windows)
+ - [Sequel Pro](http://www.sequelpro.com/) (Mac OS X)
+ - Git clients
+ - [Atlassian SourceTree](https://www.sourcetreeapp.com/) (Windows, Mac OS X)
+ - [TortoiseGit](https://tortoisegit.org/) (Windows)
+
+
+Installation
+------------
-2. Prerequisites
----------
-Before installing Hercules there are certain tools and applications you will need.
-This differs between the varying operating systems available, so the following
-is broken down into Windows and Linux prerequisites.
-
-* Windows
- * TortoiseGIT ( http://code.google.com/p/tortoisegit/ )
- * MSysGit ( http://code.google.com/p/msysgit/downloads/list?can=2 )
- * MySQL ( http://www.mysql.com/downloads/mysql/ )
- * MySQL Workbench ( http://www.mysql.com/downloads/workbench/ )
- * MS Visual C++ ( http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express )
-
-* Linux (names of packages may require specific version numbers on certain distributions)
- * gcc
- * make
- * mysql
- * mysql-devel
- * mysql-server
- * pcre-devel
- * git
- * zlib-devel
-
-3. Installation
----------
This section is a very brief set of installation instructions. For more concise guides
relevant to your Operation System, please refer to the Wiki (links at the end of this file).
-* Windows
- * Install prerequisites
- * Create a folder to download Hercules into (e.g. C:\Hercules)
- * Right click this folder and select "Git Clone".
- * Paste the GIT URL into the box: https://github.com/HerculesWS/Hercules.git
- * Open MySQL Workbench and create an instance to connect to your MySQL Server
- * Create a database (hercules), a user (hercules), give permissions (GRANT SELECT,INSERT,UPDATE,DELETE)
- and then login using the new user
- * Use MySQL Workbench to run the .sql files in /sql-files/ on the new Hercules database
-
-* Linux
- * (For CentOS)
- * Step 1: yum install gcc make mysql mysql-devel mysql-server pcre-devel zlib-devel
- * Step 2: rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
- * Step 3: yum install --enablerepo=webtatic git-all
- * Step 4: yum install --enablerepo=webtatic --disableexcludes=main git-all
- * (For Debian/Others)
- * Type: apt-get install git make gcc libmysqlclient-dev zlib1g-dev libpcre3-dev
- * Type: mysql_secure_installation
- * Start your MySQL server
- * Setup a MySQL user:
-
- CREATE USER 'hercules'@'localhost' IDENTIFIED BY 'password';
- * Assign permissions:
-
- GRANT SELECT,INSERT,UPDATE,DELETE ON `hercules\_rag`.* TO 'hercules'@'localhost';
- * Type: git clone https://github.com/HerculesWS/Hercules.git ~/Hercules
- * Insert SQL files: mysql --user=root -p hercules_rag < trunk/sql-files/main.sql (and others)
- * Type: cd trunk && ./configure && make clean && make sql
- * When you're ready, type: ./athena-start start
-
-
-
-4. Troubleshooting
----------
+#### Windows
+ 1. Install the prerequisites.
+ 2. Clone the Hercules repository (see [GitHub](https://github.com/HerculesWS/Hercules)) using a git client, into a new folder.
+ 3. Connect to the MySQL server as root:
+ - Create a database (hercules): `CREATE DATABASE hercules;`
+ - Create a user (hercules): `CREATE USER 'hercules'@'localhost' IDENTIFIED BY 'password';`.
+ - Give permissions (GRANT SELECT,INSERT,UPDATE,DELETE) to the user: `GRANT SELECT,INSERT,UPDATE,DELETE ON \`hercules\`.* TO 'hercules'@'localhost';`
+ 4. Connect to the MySQL server as the new user:
+ - Import the .sql files in /sql-files/ into the new database.
+ 5. Start Visual Studio and load the provided solution:
+ - Compile and run the three projects, login-server, char-server, map-server.
+
+#### Unix
+ 1. Install the prerequisites through your distribution's package manager
+ - (Red Hat compatible / CentOS) `yum install gcc make mysql mysql-devel mysql-server pcre-devel zlib-devel git`
+ - (Debian compatible) `apt-get install gcc make libmysqlclient-dev zlib1g-dev libpcre3-dev mysql-server git`
+ - (FreeBSD) `pkg install clang35 gmake mysql56-server mysql-connector-c pcre git`
+ - (Mac OS X):
+ - Install Xcode through the Mac App Store
+ - Initialize the build tools through the Terminal `xcode-select --help`
+ - Install Homebrew as described on the project page
+ - Install MySQL: `brew install mysql`
+ 2. Clone the Hercules repository `git clone https://github.com/HerculesWS/Hercules.git ~/Hercules`
+ 3. Configure the MySQL server and start it.
+ 4. Connect to the MySQL server as root:
+ - Create a database (hercules): `CREATE DATABASE hercules;`
+ - Create a user (hercules): `CREATE USER 'hercules'@'localhost' IDENTIFIED BY 'password';`.
+ - Give permissions (GRANT SELECT,INSERT,UPDATE,DELETE) to the user: `GRANT SELECT,INSERT,UPDATE,DELETE ON \`hercules\`.* TO 'hercules'@'localhost';`
+ 5. Connect to the MySQL server as the new user:
+ - Import the .sql files in /sql-files/ into the new database.
+ 6. Enter the Hercules directory and configure/build Hercules
+ - `./configure`
+ - `make clean && make sql` (on FreeBSD, replace `make` with `gmake`)
+ 7. Start the three servers login-server, char-server, map-server.
+
+Troubleshooting
+---------------
+
If you're having problems with starting your server, the first thing you should
-do is check what's happening on your consoles. More often that not, all support issues
-can be solved simply by looking at the error messages given.
+do is check what's happening on your consoles. More often that not, all support
+issues can be solved simply by looking at the error messages given.
Examples:
@@ -125,8 +164,9 @@ Examples:
If this shows up on the map server, it generally means that there is no Char Server available
to accept the connection.
-5. Helpful Links
----------
+Helpful Links
+-------------
+
The following list of links point to various help files within the GIT, articles or
pages on the Wiki or topics within the Hercules forum.
@@ -144,9 +184,9 @@ pages on the Wiki or topics within the Hercules forum.
Channel: #Hercules
+More Documentation
+------------------
-6. More Documentation
----------
Hercules has a large collection of help files and sample NPC scripts located in /doc/
* Scripting
diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf
index 42d9a7262..8c9447ccb 100644
--- a/conf/battle/battle.conf
+++ b/conf/battle/battle.conf
@@ -37,7 +37,7 @@ pc_damage_walk_delay_rate: 20
damage_walk_delay_rate: 100
// Move-delay adjustment for multi-hitting attacks.
-// When hit by a multi-hitting skill like Lord of Vermillion or Jupitel Thunder, characters will be
+// When hit by a multi-hitting skill like Lord of Vermillion or Jupitel Thunder, characters will be
// unable to move for an additional "(number of hits -1) * multihit_delay" milliseconds.
// 80 is the setting that feels like Aegis (vs Sonic Blows)
// 230 is the setting that makes walkdelay last until the last hit (vs Jupitel thunder)
@@ -57,7 +57,7 @@ undead_detect_type: 0
// (Will not work in Renewal)
attribute_recover: no
-// What is the minimum and maximum hitrate of normal attacks?
+// What is the minimum and maximum hitrate of normal attacks?
min_hitrate: 5
max_hitrate: 100
@@ -121,7 +121,7 @@ attack_attr_none: 14
equip_natural_break_rate: 0
// Overall rate of which your own equipment can break. (Note 2)
-// This rate affects penalty breaking rate of skills such as power-thrust and your natural breaking rate
+// This rate affects penalty breaking rate of skills such as power-thrust and your natural breaking rate
// (from equip_natural_break_rate). If a Sage's endow skill fails and this is above 0, the selected char's
// weapon will be broken.
equip_self_break_rate: 100
@@ -137,8 +137,8 @@ delay_battle_damage: yes
// Are arrows/ammo consumed when used on a bow/gun?
// 0 = No
// 1 = Yes
-// 2 = Yes even for skills that do not specify arrow consumption when said
-// skill is weapon-based and used with ranged weapons (auto-guesses which
+// 2 = Yes even for skills that do not specify arrow consumption when said
+// skill is weapon-based and used with ranged weapons (auto-guesses which
// skills should consume ammo when it's acquired via a card or plagiarize)
arrow_decrement: 1
diff --git a/conf/battle/client.conf b/conf/battle/client.conf
index 5089fa4a5..e10f03d82 100644
--- a/conf/battle/client.conf
+++ b/conf/battle/client.conf
@@ -16,7 +16,7 @@
packet_obfuscation: 1
// Minimum delay between whisper/global/party/guild messages (in ms)
-// Messages that break this threshold are silently omitted.
+// Messages that break this threshold are silently omitted.
min_chat_delay: 0
// Valid range of dyes and styles on the client.
@@ -24,7 +24,7 @@ min_hair_style: 0
max_hair_style: 29
min_hair_color: 0
max_hair_color: 8
-min_cloth_color: 0
+min_cloth_color: 0
max_cloth_color: 4
// When set to yes, the damage field in packets sent from woe maps will be set
@@ -77,7 +77,7 @@ save_clothcolor: yes
// Do not display cloth colors for the wedding costume?
// Note: Both save_clothcolor and wedding_modifydisplay have to be enabled
-// for this option to take effect. Set this to yes if your cloth palettes
+// for this option to take effect. Set this to yes if your cloth palettes
// pack doesn't has wedding palettes (or has less than the other jobs)
wedding_ignorepalette: no
diff --git a/conf/battle/drops.conf b/conf/battle/drops.conf
index 424c46f5b..ec122002a 100644
--- a/conf/battle/drops.conf
+++ b/conf/battle/drops.conf
@@ -83,7 +83,7 @@ item_drop_treasure_min: 1
item_drop_treasure_max: 10000
// Use logarithmic drops? (Note 1)
-// Logarithmic drops scale drop rates in a non-linear fashion using the equation
+// Logarithmic drops scale drop rates in a non-linear fashion using the equation
// Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5))
// Where x is the original drop rate and y is the drop_rate modifier (the previously mentioned item_rate* variables)
// Use the following table for an idea of how the rate will affect drop rates when logarithmic drops are used:
diff --git a/conf/battle/exp.conf b/conf/battle/exp.conf
index 7c781d3a3..88c5d9c7a 100644
--- a/conf/battle/exp.conf
+++ b/conf/battle/exp.conf
@@ -20,14 +20,14 @@ multi_level_up: no
// Setting this can cap the max experience one can get per kill specified as a
// % of the current exp bar. (Every 10 = 1.0%)
-// For example, set it to 500 and no matter how much exp the mob gives,
+// For example, set it to 500 and no matter how much exp the mob gives,
// it can never give you above half of your current exp bar.
max_exp_gain_rate: 0
// Method of calculating earned experience when defeating a monster:
// 0 = uses damage given / total damage as damage ratio
// 1 = uses damage given / max_hp as damage ratio
-// NOTE: Using type 1 disables the bonus where the first attacker gets
+// NOTE: Using type 1 disables the bonus where the first attacker gets
// his share of the exp doubled when multiple people attack the mob.
exp_calc_type: 0
@@ -86,6 +86,6 @@ disp_experience: no
disp_zeny: no
// Use the contents of db/statpoint.txt when doing a stats reset and leveling up? (Note 1)
-// If no, an equation will be used which preserves statpoints earned/lost
+// If no, an equation will be used which preserves statpoints earned/lost
// through external means (ie: stat point buyers/sellers)
use_statpoint_table: yes
diff --git a/conf/battle/gm.conf b/conf/battle/gm.conf
index 7370da6c5..83882ae1c 100644
--- a/conf/battle/gm.conf
+++ b/conf/battle/gm.conf
@@ -13,8 +13,8 @@ atcommand_spawn_quantity_limit: 100
// Maximum number of slave-clones that can be have by using the @slaveclone at command. (0 denotes unlimited quantity)
atcommand_slave_clone_limit: 25
-// If 'no', commands require exact player name. If 'yes', entering a partial
-// name will work, as long as there's only one match from all players in the
+// If 'no', commands require exact player name. If 'yes', entering a partial
+// name will work, as long as there's only one match from all players in the
// current map server.
partial_name_scan: yes
diff --git a/conf/battle/guild.conf b/conf/battle/guild.conf
index 91c39fe71..59fc78c51 100644
--- a/conf/battle/guild.conf
+++ b/conf/battle/guild.conf
@@ -17,7 +17,8 @@ guild_exp_limit: 50
guild_max_castles: 0
// Restart guild skills cooldown by relog? (Note 1)
-// When "no", you relog with the same cooldown remaining as from when you logged out, "yes" restarts the cooldown upon login to its full duration.
+// When "no", you relog with the same cooldown remaining as from when you
+// logged out, "yes" restarts the cooldown upon login to its full duration.
guild_skill_relog_delay: no
// Damage adjustments for WOE battles against defending Guild monsters (Note 2)
@@ -46,4 +47,4 @@ guild_notice_changemap: 2
// Can guild members invite/expel members inside guild castles in WoE/GvG? (Note 1)
// default: no
guild_castle_invite: no
-guild_castle_expulsion: no \ No newline at end of file
+guild_castle_expulsion: no
diff --git a/conf/battle/items.conf b/conf/battle/items.conf
index 09210a3ea..e2358b6d6 100644
--- a/conf/battle/items.conf
+++ b/conf/battle/items.conf
@@ -52,9 +52,9 @@ random_monster_checklv: no
ignore_items_gender: yes
// Item check? (Note 1)
-// On map change it will check for items not tagged as "available" and
+// On map change it will check for items not tagged as "available" and
// auto-delete them from inventory/cart.
-// NOTE: An item is not available if it was not loaded from the item_db or you
+// NOTE: An item is not available if it was not loaded from the item_db or you
// specify it as unavailable in db/item_avail.txt
item_check: no
@@ -72,7 +72,7 @@ cashfood_use_interval: 60000
gtb_sc_immunity: 50
// Enable autospell card effects to stack?
-// NOTE: Different cards that grant the same skill will both
+// NOTE: Different cards that grant the same skill will both
// always work independently of each other regardless of setting.
autospell_stacking: no
diff --git a/conf/battle/misc.conf b/conf/battle/misc.conf
index 7d797d2eb..a3c6ed26a 100644
--- a/conf/battle/misc.conf
+++ b/conf/battle/misc.conf
@@ -9,12 +9,16 @@
// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun)
//--------------------------------------------------------------
-// PK Server Mode. Turns entire server pvp(excluding towns). Experience loss is doubled if killed by another player.
-// When players hunt monsters over 20 levels higher, they will receive 15% additional exp., and 25% chance of receiving more items.
-// There is a nopvp.txt for setting up maps not to have pk on in this mode. Novices cannot be attacked and cannot attack.
-// Normal pvp counter and rank display are disabled as well.
-// Note: If pk_mode is set to 2 instead of 1 (yes), players will receive a
-// manner penalty of 5 each time they kill another player (see manner_system
+// PK Server Mode.
+// Turns entire server pvp(excluding towns).
+// Experience loss is doubled if killed by another player.
+// When players hunt monsters over 20 levels higher, they will receive 15%
+// additional exp., and 25% chance of receiving more items.
+// There is a nopvp.txt for setting up maps not to have pk on in this mode.
+// Novices cannot be attacked and cannot attack.
+// Normal pvp counter and rank display are disabled as well.
+// Note: If pk_mode is set to 2 instead of 1 (yes), players will receive a
+// manner penalty of 5 each time they kill another player (see manner_system
// config to adjust how this will affect players)
pk_mode: 0
@@ -45,7 +49,7 @@ battle_log: off
etc_log: off
// Do you want to debug warp points? If set to yes, warp points will appear as flags.(Note 1)
-// It will also run on start-up a warp-check to print out which warp points lead directly on
+// It will also run on start-up a warp-check to print out which warp points lead directly on
// top of on-touch npcs (which can lead to infinite loopback warping situations)
warp_point_debug: no
@@ -80,7 +84,7 @@ duel_time_interval: 60
// Restrict duel usage to same map
duel_only_on_same_map: no
-// Determines max number of characters that can stack within a single cell.
+// Determines max number of characters that can stack within a single cell.
// Official - Only affects the walking routines of characters, including monsters.
// If a unit stops walking and is on a cell with more than stack limit
// characters on it, it will walk to the closest free cell.
diff --git a/conf/battle/monster.conf b/conf/battle/monster.conf
index b26bda207..23087ec78 100644
--- a/conf/battle/monster.conf
+++ b/conf/battle/monster.conf
@@ -27,13 +27,13 @@ monster_max_aspd: 199
// attacked (eg: GrimTooth), otherwise, their rude attack" is only activated
// if they can't melee reach the target (eg: sniping)
// 0x004: If not set, mobs that can change target only do so when melee attacked
-// (distance player/mob < 3), otherwise mobs may change target and chase
+// (distance player/mob < 3), otherwise mobs may change target and chase
// ranged attackers. This flag also overrides the 'provoke' target.
// 0x008: When set, mobs scatter as soon as they lose their target. Use this mode
// to make it much harder to mob-train by hiding and collecting them on a
// single spot (ie: GrimTooth training)
// 0x010: If set, mob skills defined for friends will also trigger on themselves.
-// 0x020: When set, the monster ai is executed for all monsters in maps that
+// 0x020: When set, the monster ai is executed for all monsters in maps that
// have players on them, instead of only for mobs who are in the vicinity
// of players.
// 0x040: When set, when the mob's target changes map, the mob will walk towards
@@ -45,7 +45,7 @@ monster_max_aspd: 199
// the same skill, instead, only to that particular entry (eg: Mob has heal
// on six lines in the mob_skill_db, only the entry that is actually used
// will receive the delay). This will make monsters harder, especially MvPs.
-// 0x400: Set this to make mobs have a range of 9 for all skills. Otherwise, they
+// 0x400: Set this to make mobs have a range of 9 for all skills. Otherwise, they
// will obey the normal skill range rules.
// Example: 0x140 -> Chase players through warps + use skills in random order.
monster_ai: 0
@@ -56,7 +56,7 @@ monster_ai: 0
// 2: Every 2 cells moved
// 3: Every 3 cells moved (official)
// x: Every x cells moved
-// Regardless of this setting, a monster will always rethink its chase if it has
+// Regardless of this setting, a monster will always rethink its chase if it has
// reached its target. Increase this value if you want to make monsters continue
// moving after they lost their target (hide, no line of sight, etc.).
monster_chase_refresh: 3
@@ -120,7 +120,7 @@ plant_spawn_delay: 100
boss_spawn_delay: 100
// Should mobs not spawn within the viewing range of players?
-// 0 is disabled, otherwise it is the number of retries before giving up
+// 0 is disabled, otherwise it is the number of retries before giving up
// and spawning the mob within player-view anyway, unless the max (100) is used,
// in which case the mob will not be spawned, and it'll be retried again in
// 5 seconds.
@@ -195,7 +195,7 @@ mob_remove_delay: 300000
// Defines on who the mob npc_event gets executed when a mob is killed.
// Type 1: On the player that killed the mob (if killed by a non-player, resorts to type 0)
// Type 0: On the player that did the most damage to the mob.
-// NOTE: This affects who gains the Castle when the Emperium is broken.
+// NOTE: This affects who gains the Castle when the Emperium is broken.
mob_npc_event_type: 1
// Time in milliseconds to activate protection against Kill Steal
@@ -211,6 +211,10 @@ mob_slave_keep_target: yes
// See http://irowiki.org/wiki/MVP#Gravestone
mvp_tomb_enabled: yes
+// Show hp bar on monsters? (Default: yes)
+// NOTE: only works on client 2012-04-04aRagexeRE onwards
+show_monster_hp_bar: yes
+
// Whether or not the size of specially summoned mobs influences experience, drop rates,
// and stats. The rates will be doubled for large mobs, and halved for small ones.
// This is only invoked under the 'monster' command, @monsterbig, and @monstersmall. (Note 1)
@@ -231,4 +235,4 @@ mob_size_influence: no
// Default (least exploitable): mob - 75, boss - 0
// Default (most official): mob - 220, boss - 1
mob_icewall_walk_block: 220
-boss_icewall_walk_block: 1 \ No newline at end of file
+boss_icewall_walk_block: 1
diff --git a/conf/battle/party.conf b/conf/battle/party.conf
index 14d5f47c8..72a22b94a 100644
--- a/conf/battle/party.conf
+++ b/conf/battle/party.conf
@@ -18,7 +18,7 @@ party_update_interval: 1000
// 1: Athena - bar is updated with the party map dots (up to 1 second delay)
party_hp_mode: 0
-// When 'Party Share' item sharing is enabled in a party,
+// When 'Party Share' item sharing is enabled in a party,
// announce in the party which party-member received the item and what's he received? (Note 1)
show_party_share_picker: yes
@@ -30,7 +30,6 @@ show_party_share_picker: yes
show_picker.item_type: 112
// Method of distribution when item party share is enabled in a party:
-//
// 0: Normal (item goes to a random party member)
// 1: Item Share is disabled for non-mob drops (player/pet drops)
// 2: Round Robin (items are distributed evenly and in order among members)
diff --git a/conf/battle/pet.conf b/conf/battle/pet.conf
index e80826ce8..594184b35 100644
--- a/conf/battle/pet.conf
+++ b/conf/battle/pet.conf
@@ -34,7 +34,7 @@ pet_attack_support: no
// When the master receives damage from the monster, whether or not the pet attacks back. (Note 1)
pet_damage_support: no
-// Minimum intimacy necessary for a pet to support their master. Default is 900
+// Minimum intimacy necessary for a pet to support their master. Default is 900
// (intimacy goes from 0 to 1000). At this minimum, support rate is 50% of pet's normal value.
// At max (1000) support rate is 150%.
pet_support_min_friendly: 900
@@ -43,7 +43,7 @@ pet_support_min_friendly: 900
pet_equip_min_friendly: 900
// Whether or not the pet's will use skills. (Note 1)
-// Note: Offensive pet skills need at least pet_attack_support or
+// Note: Offensive pet skills need at least pet_attack_support or
// pet_damage_support to work (they trigger while the pet is attacking).
pet_status_support: no
@@ -66,7 +66,7 @@ pet_lv_rate: 0
pet_max_stats: 99
// When pet leveling is enabled, these are the imposed caps on
-// min/max damage. Note that these only cap atk1 and atk2, if you
+// min/max damage. Note that these only cap atk1 and atk2, if you
// enable pet_str, their max damage is then their base_atk + pet_max_atk2
pet_max_atk1: 500
pet_max_atk2: 1000
diff --git a/conf/battle/player.conf b/conf/battle/player.conf
index cdfcece8d..babd6cfc3 100644
--- a/conf/battle/player.conf
+++ b/conf/battle/player.conf
@@ -94,7 +94,7 @@ max_baby_parameter: 80
max_baby_third_parameter: 117
// Max armor def/mdef
-// NOTE: This setting have no effect if server is run on Renewal Mode (RENEWAL)
+// NOTE: This setting have no effect if server is run on Renewal Mode (RENEWAL)
// NOTE: does not affects skills and status effects like Mental Strength
// If weapon_defense_type is non-zero, it won't apply to max def.
// If magic_defense_type is non-zero, it won't apply to max mdef.
@@ -117,7 +117,7 @@ show_hp_sp_drain: no
// Display the gained hp/sp values from killing mobs? (Ie: Sky Deleter Card)
show_hp_sp_gain: yes
-// If set, when A accepts B as a friend, B will also be added to A's friend
+// If set, when A accepts B as a friend, B will also be added to A's friend
// list, otherwise, only A appears in B's friend list.
// NOTE: this setting only enables friend auto-adding; auto-deletion does not work yet
friend_auto_add: yes
diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf
index f3da0e209..7622968f8 100644
--- a/conf/battle/skill.conf
+++ b/conf/battle/skill.conf
@@ -25,8 +25,8 @@ delay_dependon_agi: no
min_skill_delay_limit: 100
// This delay is the min 'can't walk delay' of all skills.
-// NOTE: Do not set this too low, if a character starts moving too soon after
-// doing a skill, the client will not update this, and the player/mob will
+// NOTE: Do not set this too low, if a character starts moving too soon after
+// doing a skill, the client will not update this, and the player/mob will
// appear to "teleport" afterwards.
default_walk_delay: 300
@@ -74,7 +74,7 @@ skillrange_by_distance: 14
skillrange_from_weapon: 0
// Should a check on the caster's status be performed in all skill attacks?
-// When set to yes, meteors, storm gust and any other ground skills will have
+// When set to yes, meteors, storm gust and any other ground skills will have
// no effect while the caster is unable to fight (eg: stunned).
skill_caster_check: yes
@@ -103,7 +103,7 @@ combo_delay_rate: 100
auto_counter_type: 15
// Can ground skills be placed on top of each other? (Note 3)
-// By default, skills with UF_NOREITERATION set cannot be stacked on top of
+// By default, skills with UF_NOREITERATION set cannot be stacked on top of
// other skills, this setting will override that. (skill_unit_db)
skill_reiteration: 0
@@ -123,7 +123,7 @@ traps_setting: 0
// Restrictions applied to the Alchemist's Summon Flora skill (add as necessary)
// 1: Enable players to damage the floras outside of versus grounds.
// 2: Disable having different types out at the same time
-// (eg: forbid summoning anything except hydras when there's already
+// (eg: forbid summoning anything except hydras when there's already
// one hydra out)
summon_flora_setting: 3
@@ -135,14 +135,13 @@ summon_flora_setting: 3
song_timer_reset: 0
// Whether placed down skills will check walls (Note 1)
-// (Makes it so that Storm Gust/Lord of Vermillion/etc when cast next to a wall, won't hit on the other side)
+// (Makes it so that Storm Gust/Lord of Vermillion/etc when cast next to a wall, won't hit on the other side)
skill_wall_check: yes
// When cloaking, Whether the wall is checked or not. (Note 1)
// Note: When the skill does not checks for walls, you will always be considered
-// as if you had a wall-next to you (you always get the wall-based speed).
+// as if you had a wall-next to you (you always get the wall-based speed).
// Add the settings as required, being hit always uncloaks you.
-//
// 0 = doesn't check for walls
// 1 = Check for walls
// 2 = Cloaking is not canceled when attacking.
@@ -168,7 +167,7 @@ chat_warpportal: no
// 0: Do not show defense
// 1: Base defense [RE default]
// 2: Vit/Int defense
-// 3: Both (the addition of both)
+// 3: Both (the addition of both)
sense_type: 1
// Which finger offensive style will be used?
@@ -205,10 +204,10 @@ backstab_bow_penalty: yes
// Use 0 to disable (max allowed value is 255)
skill_steal_max_tries: 0
-// Can Rogues plagiarize advanced job skills
+// Can Rogues plagiarize advanced job skills
// 0 = no restriction
-// 1 = only stalker may plagiarize advanced skills
-// 2 = advanced skills cannot be plagiarized by anyone
+// 1 = only stalker may plagiarize advanced skills
+// 2 = advanced skills cannot be plagiarized by anyone
// Official servers setting: 2
copyskill_restrict: 2
@@ -221,7 +220,7 @@ max_heal: 9999
max_heal_lv: 11
// Emergency Recall Guild Skill setting (add as appropriate).
-// Note that for the skill to be usable at all,
+// Note that for the skill to be usable at all,
// you need at least one of 1/2 and 4/8
// 1: Skill is usable outside of woe.
// 2: Skill is usable during woe.
@@ -233,7 +232,7 @@ emergency_call: 11
// Guild Aura Skills setting (add as appropriate).
// (This affects GD_LEADERSHIP, GD_GLORYWOUNDS, GD_SOULCOLD and GD_HAWKEYES)
-// Note that for the skill to be usable at all,
+// Note that for the skill to be usable at all,
// you need at least one of 1/2 and 4/8
// 1: Skill works outside of woe.
// 2: Skill works during woe.
@@ -266,7 +265,7 @@ sg_angel_skill_ratio: 10
skill_add_heal_rate: 7
// Whether the damage of EarthQuake with a single target on screen is able to be reflected.
-// Note: On official server, EQ is reflectable when there is only one target on the screen,
+// Note: On official server, EQ is reflectable when there is only one target on the screen,
// which might be an exploit to hunt the MVPs.
eq_single_target_reflectable: yes
diff --git a/conf/battlegrounds.conf b/conf/battlegrounds.conf
index ea54d3f2e..2b4184e11 100644
--- a/conf/battlegrounds.conf
+++ b/conf/battlegrounds.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//====================================================
//= http://herc.ws/board/topic/928-memory-slasher-may-30-patch/
//====================================================
@@ -21,12 +21,12 @@
battlegrounds: (
{
/* feature is not complete */
- feature_off:true
+ feature_off: true
/* character variable for global bg delay */
global_delay_var: "BG_Delay_Tick"
/* how many seconds to consider a player "afk" and kick him out? */
maximum_afk_seconds: 30
-
+
/* one can add as many as he wishes */
/* for custom ones, need to edit "lua files/entryqueue/entryqueuelist.lua" [Ind/Hercules] */
arenas: ({
diff --git a/conf/channels.conf b/conf/channels.conf
index 19021a64d..bd1dcaf4a 100644
--- a/conf/channels.conf
+++ b/conf/channels.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//====================================================
//================= More Information =================
// http://herc.ws/board/topic/316-introducing-hercules-channel-system/
@@ -16,7 +16,7 @@ chsys: (
/* Default Channels (available on boot) */
default_channels: {
/* channel_name : channel_messages_color */
- main: "Orange" /* Available as #main */
+ main: "Orange" /* Available as #main */
support: "Blue" /* Available as #support */
trade: "Red" /* Available as #trade */
offtopic: "Cyan" /* Available as #offtopic */
@@ -38,7 +38,7 @@ chsys: (
/* Allow users to create their own (private) channels through @channels command? */
/* (must also allow players to use @channels in groups.conf) */
allow_user_channel_creation: true
-
+
/* "map_local_channel" is a instanced channel unique to each map. */
map_local_channel: true
map_local_channel_name: "map" /* Available as #map */
diff --git a/conf/char-server.conf b/conf/char-server.conf
index aa3f7691c..37631ddae 100644
--- a/conf/char-server.conf
+++ b/conf/char-server.conf
@@ -9,7 +9,7 @@ userid: s1
passwd: p1
// Server name, use alternative character such as ASCII 160 for spaces.
-// NOTE: Do not use spaces or any of these characters which are not allowed in
+// NOTE: Do not use spaces or any of these characters which are not allowed in
// Windows filenames \/:*?"<>|
// ... or else guild emblems won't work client-side!
server_name: Hercules
@@ -91,11 +91,12 @@ gm_allow_group: -1
// On SQL servers, it applies to guilds (character save interval is defined on the map config)
autosave_time: 60
-// Display information on the console whenever characters/guilds/parties/pets are loaded/saved?
+// Display information on the console whenever characters/guilds/parties/pets are loaded/saved?
save_log: yes
// Start point, Map name followed by coordinates (x,y)
-start_point: new_1-1,53,111
+start_point: iz_int,97,90
+start_point_pre: new_1-1,53,111
// Starting items for new characters
// Format is: id1,quantity1,stackable1,idN,quantityN,stackableN
@@ -113,7 +114,7 @@ fame_list_blacksmith: 10
fame_list_taekwon: 10
// Guild earned exp modifier.
-// Adjusts taxed exp before adding it to the guild's exp. For example, if set
+// Adjusts taxed exp before adding it to the guild's exp. For example, if set
// to 200, the guild receives double the player's taxed exp.
guild_exp_rate: 100
diff --git a/conf/groups.conf b/conf/groups.conf
index d31f46f24..3f0c34ffb 100644
--- a/conf/groups.conf
+++ b/conf/groups.conf
@@ -5,7 +5,7 @@ Player groups configuration file
This file defines "player groups" and their privileges.
-Each group has its id and name, lists of available commands and other
+Each group has its id and name, lists of available commands and other
permissions, and a list of other groups it inherits from.
@@ -15,15 +15,15 @@ Group settings
Unique group number. The only required field.
<name>
-Any string. If empty, defaults to "Group <id>". It is used in several @who
+Any string. If empty, defaults to "Group <id>". It is used in several @who
commands.
<level>
-Equivalent of GM level, which was used in revisions before r15572. You can
-set it to any number, but usually it's between 0 (default) and 99. Members of
-groups with lower level can not perform some actions/commands (like @kick) on
-members of groups with higher level. It is what script command getgmlevel()
-returns. Group level can also be used to override trade restrictions
+Equivalent of GM level, which was used in revisions before r15572. You can set
+it to any number, but usually it's between 0 (default) and 99. Members of
+groups with lower level can not perform some actions/commands (like @kick) on
+members of groups with higher level. It is what script command getgmlevel()
+returns. Group level can also be used to override trade restrictions
(db/item_trade.txt).
<commands>
@@ -31,15 +31,15 @@ A group of settings
<command name> : <bool>
or
<commandname> : [ <bool>, <bool> ]
-First boolean value is for atcommand, second one for charcommand. If set to
-true, group can use command. If only atcommand value is provided, false is
-assumed for charcommand. If a command name is not included, false is assumed for
-both atcommand and charcommand.
+First boolean value is for atcommand, second one for charcommand. If set to
+true, group can use command. If only atcommand value is provided, false is
+assumed for charcommand. If a command name is not included, false is assumed
+for both atcommand and charcommand.
For a full list of available commands, see: doc/atcommands.txt.
Command names must not be aliases.
<log_commands>
-Boolean value. If true then all commands used by the group will be logged to
+Boolean value. If true then all commands used by the group will be logged to
atcommandlog. If setting is omitted in a group definition, false is assumed.
Requires 'log_commands' to be enabled in 'conf/logs.conf'.
@@ -50,7 +50,7 @@ If a permission is not included, false is assumed.
For a full list of available permissions, see: doc/permissions.txt
<inherit>
-A list of group names that given group will inherit commands and permissions
+A list of group names that given group will inherit commands and permissions
from. Group names are case-sensitive.
Inheritance results
@@ -58,19 +58,19 @@ Inheritance results
Both multiple inheritance (Group 2 -> Group 1 and Group 3 -> Group 1) and
recursive inheritance (Group 3 -> Group 2 -> Group 1) are allowed.
-Inheritance rules should not create cycles (eg Group 1 inherits from Group 2,
-and Group inherits from Group 1 at the same time). Configuration with cycles is
+Inheritance rules should not create cycles (eg Group 1 inherits from Group 2,
+and Group inherits from Group 1 at the same time). Configuration with cycles is
considered faulty and can't be processed fully by server.
-Command or permission is inherited ONLY if it's not already defined for the
+Command or permission is inherited ONLY if it's not already defined for the
group.
-If group inherits from multiple groups, and the same command or permission is
-defined for more than one of these groups, it's undefined which one will be
+If group inherits from multiple groups, and the same command or permission is
+defined for more than one of these groups, it's undefined which one will be
inherited.
Syntax
------
-This config file uses libconfig syntax:
+This config file uses libconfig syntax:
http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
*/
@@ -84,8 +84,8 @@ groups: (
/* no commands by default */
}
permissions: {
- /* without this basic permissions regular players could not
- trade or party */
+ /* without this basic permissions regular players could not
+ * trade or party */
can_trade: true
can_party: true
}
@@ -273,4 +273,3 @@ groups: (
}
}
)
-
diff --git a/conf/inter-server.conf b/conf/inter-server.conf
index 85acdc4df..c3ad8d676 100644
--- a/conf/inter-server.conf
+++ b/conf/inter-server.conf
@@ -15,10 +15,10 @@ party_share_level: 15
// You can specify the codepage to use in your mySQL tables here.
// (Note that this feature requires MySQL 4.1+)
-//default_codepage:
+//default_codepage:
-// For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1
+// For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1
// Under windows, you want to use 127.0.0.1. If you see a message like
// "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"
// and you have localhost, switch it to 127.0.0.1
diff --git a/conf/login-server.conf b/conf/login-server.conf
index 06e0eb18b..620fae327 100644
--- a/conf/login-server.conf
+++ b/conf/login-server.conf
@@ -9,7 +9,7 @@
// NOTE: This allows you to run multiple servers on multiple interfaces
// while using the same ports for each server.
//bind_ip: 127.0.0.1
-
+
// Login Server Port
login_port: 6900
@@ -87,7 +87,7 @@ ipban.enable: yes
//ipban.sql.db_username: ragnarok
//ipban.sql.db_password: ragnarok
//ipban.sql.db_database: ragnarok
-//ipban.sql.codepage:
+//ipban.sql.codepage:
//ipban.sql.ipban_table: ipbanlist
// Dynamic password failure ipban system
ipban.dynamic_pass_failure_ban: yes
@@ -105,7 +105,7 @@ ipban_cleanup_interval: 60
//ip_sync_interval: 10
// DNS Blacklist Blocking
-// If enabled, each incoming connection will be tested against the blacklists
+// If enabled, each incoming connection will be tested against the blacklists
// on the specified dnsbl_servers (comma-separated list)
use_dnsbl: no
dnsbl_servers: bl.blocklist.de, socks.dnsbl.sorbs.net
@@ -128,7 +128,7 @@ dnsbl_servers: bl.blocklist.de, socks.dnsbl.sorbs.net
//account.sql.db_username: ragnarok
//account.sql.db_password: ragnarok
//account.sql.db_database: ragnarok
-//account.sql.codepage:
+//account.sql.codepage:
//account.sql.case_sensitive: no
//account.sql.account_db: login
//account.sql.accreg_db: global_reg_value
diff --git a/conf/map-server.conf b/conf/map-server.conf
index 7f37a05da..d0749e85e 100644
--- a/conf/map-server.conf
+++ b/conf/map-server.conf
@@ -78,12 +78,12 @@ use_grf: no
// Database autosave time
// All characters are saved on this time in seconds (example:
-// autosave of 60 secs with 60 characters online -> one char is saved every
+// autosave of 60 secs with 60 characters online -> one char is saved every
// second)
autosave_time: 300
// Min database save intervals (in ms)
-// Prevent saving characters faster than at this rate (prevents char-server
+// Prevent saving characters faster than at this rate (prevents char-server
// save-load getting too high as character-count increases)
minsave_time: 100
@@ -99,7 +99,7 @@ minsave_time: 100
// 128: After every buying store transaction
// 256: After every bank transaction (deposit/withdraw)
// NOTE: These settings decrease the chance of dupes/lost items when there's a
-// server crash at the expense of increasing the map/char server lag. If your
+// server crash at the expense of increasing the map/char server lag. If your
// server rarely crashes, but experiences interserver lag, you may want to set
// these off.
save_settings: 511
diff --git a/conf/maps.conf b/conf/maps.conf
index 458c9feff..404eb7f3e 100644
--- a/conf/maps.conf
+++ b/conf/maps.conf
@@ -665,14 +665,14 @@ map: tha_t06
map: tha_t08
// --- Thanatos Tower ---
-// -- 2005-09-21sdata_k.gpf --
+// -- 2005-09-21sdata_k.gpf --
map: tha_t09
map: tha_t10
map: tha_t11
map: tha_t12
// --- Auction Market ---
-// -- 2005-11-29sdata_k.gpf --
+// -- 2005-11-29sdata_k.gpf --
map: auction_01
map: auction_02
@@ -681,7 +681,7 @@ map: auction_02
map: alde_tt03
// --- Garden City Hugel / Kiehl ---
-// -- 2005-12-20sdata_k.gpf --
+// -- 2005-12-20sdata_k.gpf --
map: hugel
map: hu_in01
map: que_bingo
diff --git a/conf/messages.conf b/conf/messages.conf
index 3ec46eb92..2b5f8eb63 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -4,7 +4,7 @@
//= This file handles all messages set throughout the server.
//============================================================
// For translation, just change msg here (second line),
-// no need to modify source code or alternatively,
+// no need to modify source code or alternatively,
// use conf/import/msg_conf.txt.
//============================================================
// Format:
diff --git a/conf/packet.conf b/conf/packet.conf
index 85996f4e3..33de0e901 100644
--- a/conf/packet.conf
+++ b/conf/packet.conf
@@ -45,7 +45,6 @@ order: deny,allow
// deny: 127.0.0.1
-
//---- DDoS Protection Settings ----
// If ddos_count connection request are made within ddos_interval msec, it assumes it's a DDoS attack
@@ -62,5 +61,4 @@ ddos_count: 5
// (default is 600000 msecs, 10 minutes)
ddos_autoreset: 600000
-
import: conf/import/packet_conf.txt
diff --git a/conf/plugins.conf b/conf/plugins.conf
index 367fc81f2..bdde28492 100644
--- a/conf/plugins.conf
+++ b/conf/plugins.conf
@@ -1,24 +1,24 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//====================================================
//== Topic Discussion ================================
//== http://herc.ws/board/topic/549-introducing-hercules-plugin-manager/
//====================================================
//== Description =====================================
-//The plugin system allows you to create customized scripts
-//outside of the source. These scripts won't conflict with any
-//future source updates - think of it as a /conf/import/ for the source.
+//The plugin system allows you to create customized scripts
+//outside of the source. These scripts won't conflict with any
+//future source updates - think of it as a /conf/import/ for the source.
//====================================================
/* --------------- Format ---------------
-After you have listed your plugin(s) in "quotations",
+After you have listed your plugin(s) in "quotations",
you need to put in a comma, to separate the plugins.
-----------------------------------------
plugins_list: [
diff --git a/conf/script.conf b/conf/script.conf
index 57442e87f..1512aa15a 100644
--- a/conf/script.conf
+++ b/conf/script.conf
@@ -2,7 +2,6 @@
// Hercules Script Configuration File
//--------------------------------------------------------
-
warn_func_mismatch_paramnum: yes
check_cmdcount: 655360
diff --git a/db/cashshop_db.conf b/db/cashshop_db.conf
index ecd17daf8..e610a5aa3 100644
--- a/db/cashshop_db.conf
+++ b/db/cashshop_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
//= http://herc.ws/board/topic/367-introducing-cash-shop-support/
//====================================================
@@ -26,37 +26,37 @@ cash_shop: (
Apple:100
ID531:250
}
-
+
cat_1: { //Popular
ID513:100
Banana_Juice:250
}
-
+
cat_2: { //Limited
Grape:100
ID533:250
}
-
+
cat_3: { //Rental
ID515:100
Carrot_Juice:250
}
-
+
cat_4: { //Permanent
Green_Herb:100
ID510:250
}
-
+
cat_5: { //Scroll
ID501:100
ID502:250
}
-
+
cat_6: { //Usable
White_Potion:150
Blue_Potion:500
}
-
+
cat_7: { //Other
ID909:400
ID907:500
diff --git a/db/const.txt b/db/const.txt
index 47192a04e..78d64345e 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -642,7 +642,7 @@ Eff_Confusion 7
Eff_Blind 8
Eff_Bleeding 9
Eff_DPoison 10
-Eff_Fear 11
+Eff_Fear 11
Eff_Cold 12
Eff_Burning 13
Eff_Deepsleep 14
diff --git a/db/guild_skill_tree.txt b/db/guild_skill_tree.txt
index 8572244aa..9c5d06c18 100644
--- a/db/guild_skill_tree.txt
+++ b/db/guild_skill_tree.txt
@@ -11,7 +11,6 @@
//
// NOTE: MAX_GUILD_SKILL_REQUIRE (typically 5) ID/Lv pairs must be specified.
-
10000,1,0,0,0,0,0,0,0,0,0,0 //GD_APPROVAL#Official Guild Approval#
10001,1,10000,1,0,0,0,0,0,0,0,0 //GD_KAFRACONTRACT#Contract with Kafra#
10002,1,10000,1,0,0,0,0,0,0,0,0 //GD_GUARDRESEARCH#Guardian Research#
diff --git a/db/homun_skill_tree.txt b/db/homun_skill_tree.txt
index b920ccee4..f39f698fd 100644
--- a/db/homun_skill_tree.txt
+++ b/db/homun_skill_tree.txt
@@ -14,102 +14,122 @@
//
// NOTE: MAX_PC_SKILL_REQUIRE (typically 5) ID/Lv pairs must be specified.
-//Lif
+// Lif
6001,8001,5,0,0,0,0,0,0,0,0,0,0,0 //HLIF_HEAL
6001,8002,5,8001,3,0,0,0,0,0,0,0,0,0 //HLIF_AVOID
6001,8003,5,8001,5,0,0,0,0,0,0,0,0,0 //HLIF_BRAIN
-//Amistr
+
+// Amistr
6002,8005,5,0,0,0,0,0,0,0,0,0,0,0 //HAMI_CASTLE
6002,8006,5,8005,5,0,0,0,0,0,0,0,0,0 //HAMI_DEFENCE
6002,8007,5,8006,3,0,0,0,0,0,0,0,0,0 //HAMI_SKIN
-//Filir
+
+// Filir
6003,8009,5,0,0,0,0,0,0,0,0,0,0,0 //HFLI_MOON
6003,8010,5,8009,3,0,0,0,0,0,0,0,0,0 //HFLI_FLEET
6003,8011,5,8010,3,0,0,0,0,0,0,0,0,0 //HFLI_SPEED
-//Vanilmirth
+
+// Vanilmirth
6004,8013,5,0,0,0,0,0,0,0,0,0,0,0 //HVAN_CAPRICE
6004,8014,5,8013,3,0,0,0,0,0,0,0,0,0 //HVAN_CHAOTIC
6004,8015,5,8013,5,0,0,0,0,0,0,0,0,0 //HVAN_INSTRUCT
-//Lif2
+
+// Lif2
6005,8001,5,0,0,0,0,0,0,0,0,0,0,0 //HLIF_HEAL
6005,8002,5,8001,3,0,0,0,0,0,0,0,0,0 //HLIF_AVOID
6005,8003,5,8001,5,0,0,0,0,0,0,0,0,0 //HLIF_BRAIN
-//Amistr2
+
+// Amistr2
6006,8005,5,0,0,0,0,0,0,0,0,0,0,0 //HAMI_CASTLE
6006,8006,5,8005,5,0,0,0,0,0,0,0,0,0 //HAMI_DEFENCE
6006,8007,5,8006,3,0,0,0,0,0,0,0,0,0 //HAMI_SKIN
-//Filir2
+
+// Filir2
6007,8009,5,0,0,0,0,0,0,0,0,0,0,0 //HFLI_MOON
6007,8010,5,8009,3,0,0,0,0,0,0,0,0,0 //HFLI_FLEET
6007,8011,5,8010,3,0,0,0,0,0,0,0,0,0 //HFLI_SPEED
-//Vanilmirth2
+
+// Vanilmirth2
6008,8013,5,0,0,0,0,0,0,0,0,0,0,0 //HVAN_CAPRICE
6008,8014,5,8013,3,0,0,0,0,0,0,0,0,0 //HVAN_CHAOTIC
6008,8015,5,8013,5,0,0,0,0,0,0,0,0,0 //HVAN_INSTRUCT
-//Lif_H
+
+// Lif_H
6009,8001,5,0,0,0,0,0,0,0,0,0,0,0 //HLIF_HEAL
6009,8002,5,8001,3,0,0,0,0,0,0,0,0,0 //HLIF_AVOID
6009,8003,5,8001,5,0,0,0,0,0,0,0,0,0 //HLIF_BRAIN
6009,8004,3,0,0,0,0,0,0,0,0,0,0,910 //HLIF_CHANGE
+
//Amistr_H
6010,8005,5,0,0,0,0,0,0,0,0,0,0,0 //HAMI_CASTLE
6010,8006,5,8005,5,0,0,0,0,0,0,0,0,0 //HAMI_DEFENCE
6010,8007,5,8006,3,0,0,0,0,0,0,0,0,0 //HAMI_SKIN
6010,8008,3,0,0,0,0,0,0,0,0,0,0,910 //HAMI_BLOODLUST
-//Filir_H
+
+// Filir_H
6011,8009,5,0,0,0,0,0,0,0,0,0,0,0 //HFLI_MOON
6011,8010,5,8009,3,0,0,0,0,0,0,0,0,0 //HFLI_FLEET
6011,8011,5,8010,3,0,0,0,0,0,0,0,0,0 //HFLI_SPEED
6011,8012,3,0,0,0,0,0,0,0,0,0,0,910 //HFLI_SBR44
-//Vanilmirth_H
+
+// Vanilmirth_H
6012,8013,5,0,0,0,0,0,0,0,0,0,0,0 //HVAN_CAPRICE
6012,8014,5,8013,3,0,0,0,0,0,0,0,0,0 //HVAN_CHAOTIC
6012,8015,5,8013,5,0,0,0,0,0,0,0,0,0 //HVAN_INSTRUCT
6012,8016,3,0,0,0,0,0,0,0,0,0,0,910 //HVAN_EXPLOSION
-//Lif2_H
+
+// Lif2_H
6013,8001,5,0,0,0,0,0,0,0,0,0,0,0 //HLIF_HEAL
6013,8002,5,8001,3,0,0,0,0,0,0,0,0,0 //HLIF_AVOID
6013,8003,5,8001,5,0,0,0,0,0,0,0,0,0 //HLIF_BRAIN
6013,8004,3,0,0,0,0,0,0,0,0,0,0,910 //HLIF_CHANGE
-//Amistr2_H
+
+// Amistr2_H
6014,8005,5,0,0,0,0,0,0,0,0,0,0,0 //HAMI_CASTLE
6014,8006,5,8005,5,0,0,0,0,0,0,0,0,0 //HAMI_DEFENCE
6014,8007,5,8006,3,0,0,0,0,0,0,0,0,0 //HAMI_SKIN
6014,8008,3,0,0,0,0,0,0,0,0,0,0,910 //HAMI_BLOODLUST
-//Filir2_H
+
+// Filir2_H
6015,8009,5,0,0,0,0,0,0,0,0,0,0,0 //HFLI_MOON
6015,8010,5,8009,3,0,0,0,0,0,0,0,0,0 //HFLI_FLEET
6015,8011,5,8010,3,0,0,0,0,0,0,0,0,0 //HFLI_SPEED
6015,8012,3,0,0,0,0,0,0,0,0,0,0,910 //HFLI_SBR44
-//Vanilmirth2_H
+
+// Vanilmirth2_H
6016,8013,5,0,0,0,0,0,0,0,0,0,0,0 //HVAN_CAPRICE
6016,8014,5,8013,3,0,0,0,0,0,0,0,0,0 //HVAN_CHAOTIC
6016,8015,5,8013,5,0,0,0,0,0,0,0,0,0 //HVAN_INSTRUCT
6016,8016,3,0,0,0,0,0,0,0,0,0,0,910 //HVAN_EXPLOSION
-//Eira
+
+// Eira
6048,8022,5,0,0,0,0,0,0,0,0,0,0,0 //MH_LIGHT_OF_REGENE
6048,8023,5,0,0,0,0,0,0,0,0,0,0,0 //MH_OVERED_BOOST
6048,8024,5,0,0,0,0,0,0,0,0,0,0,0 //MH_ERASER_CUTTER
6048,8025,5,0,0,0,0,0,0,0,0,0,0,0 //MH_XENO_SLASHER
6048,8026,5,0,0,0,0,0,0,0,0,0,0,0 //MH_SILENT_BREEZE
-//Bayeri
+
+// Bayeri
6049,8031,5,0,0,0,0,0,0,0,0,0,0,0 //MH_STAHL_HORN
6049,8032,5,0,0,0,0,0,0,0,0,0,0,0 //MH_GOLDENE_FERSE
6049,8033,5,0,0,0,0,0,0,0,0,0,0,0 //MH_STEINWAND
6049,8034,5,0,0,0,0,0,0,0,0,0,0,0 //MH_HEILIGE_STANGE
6049,8035,5,0,0,0,0,0,0,0,0,0,0,0 //MH_ANGRIFFS_MODUS
-//Sera
+
+// Sera
6050,8018,5,0,0,0,0,0,0,0,0,0,0,0 //MH_SUMMON_LEGION
6050,8019,5,0,0,0,0,0,0,0,0,0,0,0 //MH_NEEDLE_OF_PARALYZE
6050,8020,5,0,0,0,0,0,0,0,0,0,0,0 //MH_POISON_MIST
6050,8021,5,0,0,0,0,0,0,0,0,0,0,0 //MH_PAIN_KILLER
-//Dieter
+
+// Dieter
6051,8039,5,0,0,0,0,0,0,0,0,0,0,0 //MH_MAGMA_FLOW
6051,8040,5,0,0,0,0,0,0,0,0,0,0,0 //MH_GRANITIC_ARMOR
6051,8041,5,0,0,0,0,0,0,0,0,0,0,0 //MH_LAVA_SLIDE
6051,8042,5,0,0,0,0,0,0,0,0,0,0,0 //MH_PYROCLASTIC
6051,8043,5,0,0,0,0,0,0,0,0,0,0,0 //MH_VOLCANIC_ASH
-//Elanor
+
+// Elanor
6052,8027,1,0,0,0,0,0,0,0,0,0,0,0 //MH_STYLE_CHANGE
6052,8028,5,0,0,0,0,0,0,0,0,0,0,0 //MH_SONIC_CRAW
6052,8029,5,0,0,0,0,0,0,0,0,0,0,0 //MH_SILVERVEIN_RUSH
diff --git a/db/job_db2.txt b/db/job_db2.txt
index 19e19e192..c2cc06064 100644
--- a/db/job_db2.txt
+++ b/db/job_db2.txt
@@ -11,7 +11,7 @@
// 4 = INT increased by 1 at this job level
// 5 = DEX increased by 1 at this job level
// 6 = LUK increased by 1 at this job level
-//
+
// Novice
0,0,6,5,0,2,3,0,1,4,0
// Swordman
@@ -289,4 +289,3 @@
4212,5,0,4,0,2,3,0,1,6,0,5,1,2,0,4,6,3,0,1,5,2,0,6,3,4,0,5,0,2,0,1,4,0,5,4,0,3,5,1,0,2,4,1,0,5,6,2,1,0,5
// Rebellion
4215,0,5,0,4,0,3,5,4,2,6,0,0,3,4,0,2,5,4,3,6,0,0,3,5,1,4,2,0,0,6,3,0,5,4,1,0,0,5,0,2,6,0,5,3,4,0,0,0,0,1
-
diff --git a/db/map_index.txt b/db/map_index.txt
index 7eafc7f66..7e43f7cd2 100644
--- a/db/map_index.txt
+++ b/db/map_index.txt
@@ -1,13 +1,13 @@
//======================================================================================
// Map Index
//======================================================================================
-//Contains the list of maps with their respective IDs for inter-server use.
-//IDs must never change, therefore any new maps need to be added at the end,
-//and old ones must not be removed, but may be replaced.
-//Format:
-//mapname<tab>index <- specifies index for this map
-//mapname <- map will use index of previous map +1
-//Note that map index 0 is special and reserved for "error" status.
+// Contains the list of maps with their respective IDs for inter-server use.
+// IDs must never change, therefore any new maps need to be added at the end,
+// and old ones must not be removed, but may be replaced.
+// Format:
+// mapname<tab>index <- specifies index for this map
+// mapname <- map will use index of previous map +1
+// Note that map index 0 is special and reserved for "error" status.
alb_ship 1
alb2trea
diff --git a/db/mob_skill_db2.txt b/db/mob_skill_db2.txt
index bc1384f2f..4fb5b84a1 100644
--- a/db/mob_skill_db2.txt
+++ b/db/mob_skill_db2.txt
@@ -53,7 +53,7 @@
// -2: added for all normal types.
// -4: added for all mobs.
-// rAthena Dev Team
+// Athena Dev Team
//1900,Valaris@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,,
//1900,Valaris@AL_TELEPORT,walk,26,1,500,0,5000,yes,self,rudeattacked,,,,,,,,
//1900,Valaris@KN_BRANDISHSPEAR,attack,57,10,2000,500,5000,no,target,always,0,,,,,,29,
@@ -114,7 +114,7 @@
//1921,Easter Bunny@NPC_SUMMONSLAVE,attack,196,5,10000,3000,10000,no,self,slavele,2,1063,,,,,,
//1921,Easter Bunny@NPC_SUMMONSLAVE,idle,196,5,5000,2000,40000,no,self,always,2,1920,,,,,,
-//Custom Fire Poring. Warning, Colides with META_DENIRO
+// Custom Fire Poring. Warning, Colides with META_DENIRO
//1239,Fire Poring@AL_HEAL,idle,28,10,10000,0,2000,yes,self,always,0,,,,,,4,
//1239,Fire Poring@AL_HEAL,walk,28,10,10000,0,2000,yes,self,always,0,,,,,,4,
//1239,Fire Poring@AL_TELEPORT,attack,26,1,1000,5000,60000,no,self,myhpltmaxrate,30,,,,,,,
@@ -128,7 +128,7 @@
//1239,Fire Poring@RG_STRIPSHIELD,attack,216,5,2000,0,3000,yes,target,always,0,,,,,,,
//1239,Fire Poring@RG_STRIPWEAPON,attack,215,5,2000,0,3000,yes,target,always,0,,,,,,,
-//iRO Halloween Event 2009
+// iRO Halloween Event 2009
//3014,Halloween Whisper@AS_CLOAKING,idle,135,1,2000,200,5000,yes,self,always,0,,,,,,,
//3014,Halloween Whisper@AS_CLOAKING,chase,135,1,2000,200,5000,yes,self,always,0,,,,,,,
//3014,Halloween Whisper@NPC_EMOTION,idle,197,1,2000,0,5000,yes,self,always,0,,,,,,,
diff --git a/db/pet_db2.txt b/db/pet_db2.txt
index cf2248dc4..4e9b26fd9 100644
--- a/db/pet_db2.txt
+++ b/db/pet_db2.txt
@@ -10,7 +10,7 @@
// 05. EggID Pet Egg ID.
// 06. EquipID Pet Accessory ID.
// 07. FoodID Pet Food ID.
-// 08. Fullness The amount Hunger is decreased every [HungryDelay] seconds.
+// 08. Fullness The amount of hunger points increasing with each feeding.
// 09. HungryDelay The amount of time it takes for hunger to decrease after feeding. (Default: 60 seconds)
// 10. R_Hungry Amount of Intimacy that is increased when fed.
// 11. R_Full Amount of Intimacy that is decreased when over-fed.
@@ -50,4 +50,3 @@
//A single pet can have petloot, petskillbonus, petskillattack and
//petskillsupport at the same time, but only one of each.
-
diff --git a/db/pre-re/exp.txt b/db/pre-re/exp.txt
index 7fff53932..840a216eb 100644
--- a/db/pre-re/exp.txt
+++ b/db/pre-re/exp.txt
@@ -45,8 +45,6 @@
//Job - Super Novice & Baby Super Novice
99,23:4045,1,30,43,58,76,116,180,220,272,336,520,604,699,802,948,1125,1668,1937,2226,3040,3988,5564,6272,7021,9114,11473,15290,16891,18570,23229,28359,36478,39716,43088,52417,62495,78160,84175,90404,107611,125915,153941,191781,204351,248352,286212,386371,409795,482092,509596,982092,992092,1002092,1012092,1022092,1032092,1042092,1052092,1062092,1072092,1082092,1092092,1102092,1112092,1122092,1132092,1142092,1152092,1162092,1172092,1182092,1192092,1202092,1212092,1222092,1232092,1242092,1252092,1262092,1272092,1282092,1292092,1302092,1312092,1322092,1332092,1342092,1352092,1362092,1372092,1382092,1392092,1402092,1412092,1422092,1432092,1442092,1452092,1462092,1491333,1521159,1551582,1582613,1614265,1646550,1679480,1713069,1747330,1782276,1817921,1854279,1891364,1929191,1967774,2007129,2047271,2088216,2129980,2172579,2216030,2260350,2305556,2351667,2398700,2446673,2495606,2545518,2596428,2648356,2701323,2755349,2810455,2866664,2923997,2982476,3042125,3102967,3165026,3228326,3292892,3358749,3425923,3494441,3564329,3635615,3708327,3782493,3858142,3935304,4014010,4094290,4176175,4259698,4344891,4431788,4520423,4610831,4703047,4797107,4893049,4990909,5090727,5192541,5296391,5402318,5510364,5620571,5732982,5847641,5964593,6083884,6205561,6329672,6456265,6585390,6717097,6851438,6988466,7128235,7270799,7416214,7564538,7715828,7870144,8027546,8188096,8351857,8518893,8689270,8863055,9040315,9221121,9405543,9593653,9785525,9981235,10180859,10384475,10592164,10804007,11020086,11240487,11465296,11694601,11928492,12167061,12410401,12658608,12911779,13170014,13433414,13702082,13976123,14255645,14540757,14831571,15128202,15430765,15739380,16054167,16375250,16702754,17036808,17377543,17725094,18079595,18441187,18810011,19186211,19569935,19961334,20360560,20767770,21183125,21606786,22038921,22479697,22929289,23387873,23855628,24332740,24819394,25315781,25822095,26338537,26865306,27402611,27950663,28509676,29079868,29661464,30254692,30859785,31476979,32106518
-
-
//================================
// Renewal content (required for some core features)
//================================
diff --git a/db/pre-re/exp_homun.txt b/db/pre-re/exp_homun.txt
index 9b48412dd..f8b443526 100644
--- a/db/pre-re/exp_homun.txt
+++ b/db/pre-re/exp_homun.txt
@@ -97,4 +97,4 @@
9165840
9553880
9945920
-0
+0
diff --git a/db/pre-re/item_chain.conf b/db/pre-re/item_chain.conf
index 744b1cbcf..57eaef05e 100644
--- a/db/pre-re/item_chain.conf
+++ b/db/pre-re/item_chain.conf
@@ -1,22 +1,20 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
// Structure of file:
/*
-
ITMCHAIN_<Name>: {
<Item_Name>: <chance>
}
-
*/
ITMCHAIN_ORE: {
@@ -39,7 +37,7 @@ ITMCHAIN_ORE: {
Elunium: 20
Oridecon: 20
Gold: 10
- Emperium: 5
+ Emperium: 5
}
ITMCHAIN_GEM: {
@@ -58,7 +56,7 @@ ITMCHAIN_GEM: {
Crystal_Jewel: 150
Crystal_Jewel_: 80
Crystal_Jewel__: 50
- Crystal_Jewel___: 30
+ Crystal_Jewel___: 30
}
ITMCHAIN_HEAL: {
diff --git a/db/pre-re/item_group.conf b/db/pre-re/item_group.conf
index f03762790..54d71d1c8 100644
--- a/db/pre-re/item_group.conf
+++ b/db/pre-re/item_group.conf
@@ -1,19 +1,19 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
// Structure of file:
/*
<Container_Item_Name>: (
- "Item_Name" or
+ "Item_Name" or
("Item_Name",Repeat_Count)
)
*/
diff --git a/db/pre-re/item_packages.conf b/db/pre-re/item_packages.conf
index a25453f3f..2a7df83ab 100644
--- a/db/pre-re/item_packages.conf
+++ b/db/pre-re/item_packages.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
@@ -13547,4 +13547,4 @@ Old_Ore_Box: {
Random: 1
Rate: 50
}
-} \ No newline at end of file
+}
diff --git a/db/pre-re/job_db.conf b/db/pre-re/job_db.conf
index ff83db27a..52db40eff 100644
--- a/db/pre-re/job_db.conf
+++ b/db/pre-re/job_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://hercs.ws/board/topic/9082-job-db1txt-redesign/
//============== pRE Structure Example ===============
@@ -47,6 +47,7 @@ Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so
// Note: If table index size is smaller than the max level the server will automatically generate the missing index based on the average increase per level.
}
*/
+
//====================================================
Novice: {
BaseASPD: {
@@ -88,7 +89,7 @@ Novice: {
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, // 111 - 120
121, 122, 123, 124, 125, 126, 127, 128, 129, 130, // 121 - 130
131, 132, 133, 134, 135, 136, 137, 138, 139, 140, // 131 - 140
- 141, 142, 143, 144, 145, 146, 147, 148, 149, 150] // 141 - 150
+ 141, 142, 143, 144, 145, 146, 147, 148, 149, 150] // 141 - 150
}
Swordsman: {
Weight: 28000
@@ -103,7 +104,7 @@ Swordsman: {
TwoHandAxe: 750
Mace: 650
TwoHandMace: 700
- }
+ }
HPTable:[ 40, 46, 53, 61, 70, 79, 89, 100, 111, 123, // 1 - 10
136, 149, 163, 178, 194, 210, 227, 245, 263, 282, // 11 - 20
302, 322, 343, 365, 388, 411, 435, 460, 485, 511, // 21 - 30
@@ -133,7 +134,7 @@ Swordsman: {
232, 234, 236, 238, 240, 242, 244, 246, 248, 250, // 111 - 120
252, 254, 256, 258, 260, 262, 264, 266, 268, 270, // 121 - 130
272, 274, 276, 278, 280, 282, 284, 286, 288, 290, // 131 - 140
- 292, 294, 296, 298, 300, 302, 304, 306, 308, 310] // 141 - 150
+ 292, 294, 296, 298, 300, 302, 304, 306, 308, 310] // 141 - 150
}
Magician: {
Weight: 22000
@@ -172,7 +173,7 @@ Magician: {
676, 682, 688, 694, 700, 706, 712, 718, 724, 730, // 111 - 120
736, 742, 748, 754, 760, 766, 772, 778, 784, 790, // 121 - 130
796, 802, 808, 814, 820, 826, 832, 838, 844, 850, // 131 - 140
- 856, 862, 868, 874, 880, 886, 892, 898, 904, 910] // 141 - 150
+ 856, 862, 868, 874, 880, 886, 892, 898, 904, 910] // 141 - 150
}
Archer: {
Weight: 26000
@@ -236,7 +237,7 @@ Acolyte: {
565, 570, 575, 580, 585, 590, 595, 600, 605, 610, // 111 - 120
615, 620, 625, 630, 635, 640, 645, 650, 655, 660, // 121 - 130
665, 670, 675, 680, 685, 690, 695, 700, 705, 710, // 131 - 140
- 715, 720, 725, 730, 735, 740, 745, 750, 755, 760] // 141 - 150
+ 715, 720, 725, 730, 735, 740, 745, 750, 755, 760] // 141 - 150
}
Merchant: {
Weight: 28000
@@ -264,7 +265,7 @@ Merchant: {
343, 346, 349, 352, 355, 358, 361, 364, 367, 370, // 111 - 120
373, 376, 379, 382, 385, 388, 391, 394, 397, 400, // 121 - 130
403, 406, 409, 412, 415, 418, 421, 424, 427, 430, // 131 - 140
- 433, 436, 439, 442, 445, 448, 451, 454, 457, 460] // 141 - 150
+ 433, 436, 439, 442, 445, 448, 451, 454, 457, 460] // 141 - 150
}
Thief: {
Weight: 24000
@@ -387,7 +388,7 @@ Wizard: {
1009, 1018, 1027, 1036, 1045, 1054, 1063, 1072, 1081, 1090, // 111 - 120
1099, 1108, 1117, 1126, 1135, 1144, 1153, 1162, 1171, 1180, // 121 - 130
1189, 1198, 1207, 1216, 1225, 1234, 1243, 1252, 1261, 1270, // 131 - 140
- 1279, 1288, 1297, 1306, 1315, 1324, 1333, 1342, 1351, 1360] // 141 - 150
+ 1279, 1288, 1297, 1306, 1315, 1324, 1333, 1342, 1351, 1360] // 141 - 150
}
Blacksmith: {
Weight: 30000
@@ -530,7 +531,7 @@ Crusader: {
531, 536, 541, 545, 550, 555, 559, 564, 569, 574, // 111 - 120
578, 583, 588, 592, 597, 602, 606, 611, 616, 621, // 121 - 130
625, 630, 635, 639, 644, 649, 653, 658, 663, 668, // 131 - 140
- 672, 677, 682, 686, 691, 696, 700, 705, 710, 715] // 141 - 150
+ 672, 677, 682, 686, 691, 696, 700, 705, 710, 715] // 141 - 150
}
Rogue: {
Weight: 24000
@@ -698,7 +699,7 @@ Taekwon: {
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 111 - 120
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 121 - 130
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 131 - 140
- 200, 200, 200, 200, 200, 200, 200, 200, 200, 200] // 141 - 150
+ 200, 200, 200, 200, 200, 200, 200, 200, 200, 200] // 141 - 150
}
Star_Gladiator: {
Inherit: ("Taekwon")
@@ -731,7 +732,7 @@ Star_Gladiator: {
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 111 - 120
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 121 - 130
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 131 - 140
- 500, 500, 500, 500, 500, 500, 500, 500, 500, 500] // 141 - 150
+ 500, 500, 500, 500, 500, 500, 500, 500, 500, 500] // 141 - 150
}
Soul_Linker: {
Weight: 24000
@@ -770,7 +771,7 @@ Soul_Linker: {
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 111 - 120
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 121 - 130
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 131 - 140
- 900, 900, 900, 900, 900, 900, 900, 900, 900, 900] // 141 - 150
+ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900] // 141 - 150
}
Gunslinger: {
Weight: 28000
@@ -797,7 +798,7 @@ Gunslinger: {
528, 534, 540, 546, 552, 558, 564, 570, 576, 582, // 111 - 120
588, 594, 600, 606, 612, 618, 624, 630, 636, 642, // 121 - 130
648, 654, 660, 666, 672, 678, 684, 690, 696, 702, // 131 - 140
- 708, 714, 720, 726, 732, 738, 744, 750, 756, 762] // 141 - 150
+ 708, 714, 720, 726, 732, 738, 744, 750, 756, 762] // 141 - 150
}
Ninja: {
Weight: 26000
@@ -885,7 +886,7 @@ Rune_Knight: {
TwoHandAxe: 520
Mace: 450
TwoHandMace: 520
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -911,7 +912,7 @@ Warlock: {
Sword: 600
Rod: 500
TwoHandRod: 560
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -935,7 +936,7 @@ Ranger: {
Fist: 400
Dagger: 500
Bow: 490
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -963,7 +964,7 @@ Arch_Bishop: {
Knuckle: 500
Book: 440
TwoHandRod: 550
- }
+ }
}
Mechanic: {
Weight: 38000
@@ -976,7 +977,7 @@ Mechanic: {
TwoHandAxe: 480
Mace: 480
TwoHandMace: 500
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1002,7 +1003,7 @@ Guillotine_Cross: {
Sword: 650
Axe: 800
Katar: 420
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1027,7 +1028,7 @@ Shadow_Chaser: {
Dagger: 430
Sword: 470
Bow: 470
- }
+ }
}
Royal_Guard: {
Inherit: ("Guillotine_Cross")
@@ -1043,7 +1044,7 @@ Royal_Guard: {
TwoHandAxe: 520
Mace: 440
TwoHandMace: 500
- }
+ }
}
Sorcerer: {
Weight: 30000
@@ -1055,7 +1056,7 @@ Sorcerer: {
Rod: 450
Book: 450
TwoHandRod: 550
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1080,14 +1081,14 @@ Minstrel: {
Dagger: 520
Bow: 490
Instrument: 440
- }
+ }
}
Wanderer: {
Inherit: ("Ranger")
BaseASPD: {
Whip: 440
Instrument: 2000
- }
+ }
}
Sura: {
Weight: 30000
@@ -1099,7 +1100,7 @@ Sura: {
Rod: 480
Knuckle: 390
TwoHandRod: 500
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1127,7 +1128,7 @@ Genetic: {
TwoHandAxe: 510
Mace: 440
TwoHandMace: 480
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1152,14 +1153,14 @@ Kagerou: {
Fist: 400
Dagger: 450
FuumaShuriken: 500
- }
+ }
}
Oboro: {
Inherit: ("Kagerou")
}
Rebellion: {
Inherit: ("Gunslinger")
- InheritHP: ("Soul_Linker")
+ InheritHP: ("Soul_Linker")
}
Novice_High: {
Inherit: ("Novice")
@@ -1370,4 +1371,4 @@ Expanded_Super_Novice: {
}
Expanded_Super_Baby: {
Inherit: ("Novice")
-} \ No newline at end of file
+}
diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf
index 2d0ffee49..11559512d 100644
--- a/db/pre-re/map_zone_db.conf
+++ b/db/pre-re/map_zone_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//====================================================
//= Hercules Map Zone Database [Ind/Hercules]
//================ More Information ==================
@@ -24,7 +24,6 @@
//= PLAYER, HOMUN, MERCENARY, MONSTER, PET, ELEMENTAL, MOB_BOSS, CLONE, ALL and NONE
//====================================================
-
zones: (
{
/* All zone is a dynamic (very special) zone that is forcebly inherited by ALL maps automatically */
@@ -41,10 +40,10 @@ zones: (
//Apple: true
//ID501: true
}
-
+
mapflags: (
)
-
+
/* "command:min-group-lv-to-override" e.g. "heal: 70" */
disabled_commands: {
//Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
@@ -61,7 +60,7 @@ zones: (
/* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
/* However, it wont be applied to maps with its own zones (specified through mapflag) */
name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
WM_LULLABY_DEEPSLEEP: "PLAYER"
WM_SIRCLEOFNATURE: "PLAYER"
@@ -69,43 +68,43 @@ zones: (
SO_ARRULLO: "PLAYER"
CG_HERMODE: "PLAYER"
}
-
+
disabled_items: {
-
+
}
mapflags: (
)
-
+
},
{
/* PvP zone is applied to all maps with a pvp mapflag */
name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
BS_GREED: "PLAYER"
CG_HERMODE: "PLAYER"
}
-
+
disabled_items: {
Greed_Scroll: true
}
-
+
mapflags: (
"nocashshop",
)
-
+
},
{
/* PK Mode zone is only used when server is on pk_mode (battle.conf),
it applies to all pvp maps that don't have their own zone */
name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
-
+
}
-
+
disabled_items: {
-
+
}
/* PK Mode Damage Reductions */
@@ -125,7 +124,7 @@ zones: (
{
/* GvG zone is applied to all maps with a gvg mapflag */
name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER"
AL_WARP: "PLAYER"
@@ -145,7 +144,7 @@ zones: (
SC_FATALMENACE: "PLAYER"
SC_DIMENSIONDOOR: "PLAYER"
}
-
+
disabled_items: {
Assumptio_5_Scroll: true
Greed_Scroll: true
@@ -170,12 +169,12 @@ zones: (
"nocashshop",
"gvg_noparty",
)
-
+
},
{
/* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER"
AL_WARP: "PLAYER"
@@ -214,8 +213,8 @@ zones: (
disabled_items: {
Assumptio_5_Scroll: true
Pty_Assumptio_Scroll: true
- }
-
+ }
+
/* knockback disabled */
/* Battlegrounds Damage Reductions */
/* - weapon_damage_rate -30% */
@@ -235,7 +234,7 @@ zones: (
},
{
name: "Aldebaran Turbo Track"
-
+
disabled_skills: {
SM_ENDURE: "PLAYER"
AL_TELEPORT: "PLAYER"
@@ -256,7 +255,7 @@ zones: (
SC_DIMENSIONDOOR: "PLAYER"
GN_CARTBOOST: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
Anodyne: true
@@ -266,12 +265,12 @@ zones: (
},
{
name: "Jail"
-
+
disabled_skills: {
TK_JUMPKICK: "PLAYER"
TK_HIGHJUMP: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
Wing_Of_Butterfly: true
@@ -284,14 +283,14 @@ zones: (
},
{
name: "Izlude Battle Arena"
-
+
disabled_skills: {
RG_INTIMIDATE: "PLAYER"
AL_TELEPORT: "PLAYER"
SC_FATALMENACE: "PLAYER"
- SC_DIMENSIONDOOR: "PLAYER"
+ SC_DIMENSIONDOOR: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
}
@@ -299,7 +298,7 @@ zones: (
{
name: "GvG2"
inherit: ( "GvG" ) /* will import all gvg has */
-
+
disabled_skills: {
TK_HIGHJUMP: "PLAYER"
SA_ABRACADABRA: "PLAYER"
@@ -307,7 +306,7 @@ zones: (
},
{
name: "Sealed Shrine"
-
+
disabled_skills: {
MG_SAFETYWALL: "PLAYER"
AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
@@ -320,7 +319,7 @@ zones: (
},
{
name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
WZ_ICEWALL: "PLAYER"
@@ -333,7 +332,7 @@ zones: (
},
{
name: "Towns"
-
+
disabled_skills: {
AM_CANNIBALIZE: "PLAYER"
AM_SPHEREMINE: "PLAYER"
@@ -343,7 +342,7 @@ zones: (
WM_POEMOFNETHERWORLD: "PLAYER"
GN_WALLOFTHORN: "PLAYER"
}
-
+
disabled_items: {
Greed_Scroll: true
}
diff --git a/db/pre-re/mob_skill_db.txt b/db/pre-re/mob_skill_db.txt
index e854d4a6e..c86690676 100644
--- a/db/pre-re/mob_skill_db.txt
+++ b/db/pre-re/mob_skill_db.txt
@@ -1,4 +1,4 @@
-// Mob Skill Database
+// Mob Skill Database
// Based on Aegis Episode 11.3
//
// Structure of Database:
@@ -4325,7 +4325,7 @@
1795,Bloody Knight@WZ_STORMGUST,attack,89,10,10000,1000,20000,no,target,always,,,,,,,,
1795,Bloody Knight@WZ_VERMILION,attack,85,20,10000,1000,20000,no,target,always,,,,,,,,
1795,Bloody Knight@WZ_METEOR,attack,83,11,10000,1000,20000,no,target,always,,,,,,,,
-// Guild Dungeon SE (13.1)
+// Guild Dungeon SE (13.1)
1796,Aunoe@MG_THUNDERSTORM,attack,21,5,500,1500,10000,no,target,always,0,,,,,,,
1796,Aunoe@MG_THUNDERSTORM,chase,21,5,500,1500,10000,no,target,always,0,,,,,,,
1796,Aunoe@NPC_HOLYATTACK,attack,189,2,500,0,5000,yes,target,always,0,,,,,,,
@@ -5773,6 +5773,7 @@
2082,Piranha@MG_COLDBOLT,chase,14,3,500,1000,5000,yes,target,always,0,,,,,,,
2082,Piranha@WZ_WATERBALL,attack,86,3,500,1000,5000,yes,target,always,0,,,,,,6,
2082,Piranha@NPC_BLOODDRAIN,attack,199,1,500,0,5000,yes,target,always,0,,,,,,,
+
//****
// NC Mechanic Summons
2042,Silver Sniper@AL_HEAL,chase,28,10,10000,0,1000,no,self,myhpltmaxrate,99,,,,,,,
diff --git a/db/pre-re/pet_db.txt b/db/pre-re/pet_db.txt
new file mode 100644
index 000000000..4c149bc8d
--- /dev/null
+++ b/db/pre-re/pet_db.txt
@@ -0,0 +1,119 @@
+// Pet Database
+//
+// Structure of Database:
+// MobID,Name,JName,LureID,EggID,EquipID,FoodID,Fullness,HungryDelay,R_Hungry,R_Full,Intimate,Die,Capture,Speed,S_Performance,talk_convert_class,attack_rate,defence_attack_rate,change_target_rate,pet_script,loyal_script
+//
+// 01. MobID Monster ID of the pet.
+// 02. Name Name of the monster as defined in the database.
+// 03. JName The display name of the monster when hatched.
+// 04. LureID Pet Tame Item ID.
+// 05. EggID Pet Egg ID.
+// 06. EquipID Pet Accessory ID.
+// 07. FoodID Pet Food ID.
+// 08. Fullness The amount of hunger points increasing with each feeding.
+// 09. HungryDelay The amount of time it takes for hunger to decrease after feeding. (Default: 60 seconds)
+// 10. R_Hungry Amount of Intimacy that is increased when fed.
+// 11. R_Full Amount of Intimacy that is decreased when over-fed.
+// 12. Intimate Amount of Intimacy the pet starts with.
+// 13. Die Amount of Intimacy that is decreased when the pet owner dies.
+// 14. Capture Capture succes rate (10000 = 100%)
+// 15. Speed Pet's walk speed. (Defaul: 150)
+// 16. S_Performance Special Performance. (Yes = 1, No = 0)
+// 17. talk_convert_class Disables pet talk (instead of talking they emote with /!.)
+// 18. attack_rate Rate of which the pet will attack (requires at least pet_support_min_friendly intimacy).
+// 19. defence_attack_rate Rate of which the pet will retaliate when master is being attacked (requires at least pet_support_min_friendly intimacy).
+// 20. change_target_rate Rate of which the pet will change its attack target.
+// 21. pet_script Script to execute when the pet is hatched.
+// 22. loyal_script Script to execute when the pet is hatched (requires at least pet_equip_min_friendly intimacy, independent of pet_script).
+// NOTE: The max value (100%) of attack_rate, defense_rate & change_target_rate is 10000.
+
+// In theory you can use any valid script, but it is run only once upon pet
+// loading, so it is recommended you use the specific pet scripts:
+
+// petskillattack skillid, skilllv, hits, rate, bonusrate Skill attack that
+// triggers while the pet is attacking. Rate is the base chance of execution
+// per attack. Bonusrate is an additional success rate when intimacy reaches
+// max. If hits is specified and different than 0, it will make the pet cast
+// the skill with a fixed amount of damage inflicted and the specified number
+// of hits. A value of zero uses the skill's defaults.
+
+// petskillsupport skillid, skilllv, delay, hp%, sp% Casts a support skill when
+// the health levels are below the specified hp% and sp%. Delay is the minimum
+// time in seconds before the skill can be cast again
+
+// petrecovery type, delay: Cures the "type" status effect after "delay"
+// seconds
+
+// petskillbonus type, value, duration, delay Gives bonus stats. Type is the
+// stat to increase (bStr, bLuk), value is the amount by which it is increased,
+// duration signals how long the bonus lasts delay is the time elapsed after
+// the bonus ends and before it starts again.
+
+// A single pet can have petloot, petskillbonus, petskillattack and
+// petskillsupport at the same time, but only one of each.
+
+1002,PORING,Poring,619,9001,10013,531,80,60,50,100,250,20,2000,150,1,0,350,400,800,{ petloot 10; },{ bonus bLuk,2; bonus bCritical,1; }
+1113,DROPS,Drops,620,9002,10013,508,80,60,40,100,250,20,1500,150,1,0,300,400,500,{ petloot 10; },{ bonus bHit,3; bonus bAtk,3; }
+1031,POPORING,Poporing,621,9003,10013,511,80,60,30,100,250,20,1000,150,1,0,300,500,400,{ petloot 15; },{ bonus bLuk,2; bonus2 bSubEle,Ele_Poison,10; }
+1063,LUNATIC,Lunatic,622,9004,10007,534,80,60,40,100,250,20,1500,150,0,0,300,300,1000,{ petskillbonus bLuk,3,10,50; },{ bonus bCritical,2; bonus bAtk,2; }
+1049,PICKY,Picky,623,9005,10012,507,80,60,40,100,250,20,2000,150,1,0,500,600,50,{ petskillbonus bStr,3,10,50;},{ bonus bStr,1; bonus bAtk,5; }
+1011,CHONCHON,ChonChon,624,9006,10002,537,80,60,30,100,250,20,1500,150,1,0,500,500,250,{ petskillbonus bAgi,4,10,50; },{ bonus bAgi,1; bonus bFlee,2; }
+1042,STEEL_CHONCHON,Steel ChonChon,625,9007,10002,1002,80,60,20,100,250,20,1000,150,1,0,500,500,200,{ petskillbonus bAgiVit,4,20,40; },{ bonus bFlee,6; bonus bAgi,-1; }
+1035,HUNTER_FLY,Hunter Fly,626,9008,10002,716,80,60,10,100,250,20,500,150,1,0,500,500,200,{ petskillattack "NPC_WINDATTACK",888,2,0,10; },{ bonus bFlee,-5; bonus bFlee2,2; }
+1167,SAVAGE_BABE,Savage Babe,627,9009,10015,537,80,60,40,100,250,20,1500,150,0,0,500,500,200,{ petskillbonus bVit,4,10,50; },{ bonus bVit,1; bonus bMaxHP,50; }
+1107,DESERT_WOLF_B,Baby Desert Wolf,628,9010,10003,537,80,60,40,100,250,20,1000,150,0,0,400,400,400,{ petskillattack "SM_PROVOKE",1,0,0,5;},{ bonus bInt,1; bonus bMaxSP,50; }
+1052,ROCKER,Rocker,629,9011,10014,537,80,60,30,100,250,20,1500,150,0,0,350,350,600,{ petskillbonus bAllStats,1,10,50; },{ bonus bHPrecovRate,5; bonus bMaxHP,25; }
+1014,SPORE,Spore,630,9012,10017,537,80,60,30,100,250,20,1500,150,0,0,350,500,500,{ petrecovery SC_POISON,60; },{ bonus bHit,5; bonus bAtk,-2; }
+1077,POISON_SPORE,Poison Spore,631,9013,10017,537,80,60,20,100,250,20,1000,150,0,0,600,200,400,{ petskillattack "NPC_POISON",20,0,0,10; },{ bonus bStr,1; bonus bInt,1; }
+1019,PECOPECO,PecoPeco,632,9014,10010,537,80,60,30,100,250,20,1000,150,1,0,400,500,800,{ petskillbonus bSpeedRate,25,20,20; },{ bonus bMaxHP,150; bonus bMaxSP,-10; }
+1056,SMOKIE,Smokie,633,9015,10019,537,80,60,30,100,250,20,1000,150,1,0,600,600,100,{ petskillbonus bPerfectHide,1,3600,0; },{ bonus bAgi,1; bonus bFlee2,1; }
+1057,YOYO,Yoyo,634,9016,10018,532,80,60,20,100,250,20,1000,150,1,0,300,800,400,{ petloot 20; },{ bonus bCritical,3; bonus bLuk,-1; }
+1023,ORK_WARRIOR,Orc Warrior,635,9017,10009,537,80,60,20,100,250,20,500,150,1,0,600,200,300,{ petskillattack "NPC_PIERCINGATT",100,1,0,10; },{ bonus bAtk,10; bonus bDef,-3; }
+1026,MUNAK,Munak,636,9018,10008,537,80,60,20,100,250,20,500,150,0,0,300,750,300,{ petskillattack "NPC_DARKNESSATTACK",444,1,0,10; },{ bonus bInt,1; bonus bDef,1; }
+1110,DOKEBI,Dokebi,637,9019,10005,537,80,60,20,100,250,20,500,150,0,0,300,300,800,{ petskillattack "BS_HAMMERFALL",1,0,0,10; },{ bonus bMatkRate,1; bonus bAtkRate,-1; }
+1170,SOHEE,Sohee,638,9020,10016,537,80,60,10,100,250,20,500,150,0,0,100,1000,200,{ petskillsupport AL_HEAL,10,60,33,100; },{ bonus bStr,1; bonus bDex,1; }
+1029,ISIS,Isis,639,9021,10006,537,80,60,10,100,250,20,500,150,0,0,650,450,150,{ petskillsupport "PR_MAGNIFICAT",2,60,50,50; },{ bonus bMatkRate,-1; bonus bAtkRate,1; }
+1155,PETIT,Petite,640,9022,10011,537,80,60,20,100,250,20,500,150,0,0,800,400,100,{ petskillattack "WZ_HEAVENDRIVE",500,1,0,10; },{ bonus bDef,-2; bonus bMdef,-2; bonus bAspdRate,1; }
+1109,DEVIRUCHI,Deviruchi,641,9023,10004,711,80,60,10,100,250,20,500,150,0,0,800,200,100,{ petskillbonus bAgiDexStr,6,20,40; },{ bonus bMatkRate,1; bonus bAtkRate,1; bonus bMaxHPrate,-3; bonus bMaxSPrate,-3; }
+1101,BAPHOMET_,Baphomet Jr.,642,9024,10001,518,80,60,10,100,250,20,200,150,0,0,1000,100,200,{ petskillattack "NPC_DARKNESSATTACK",1776,4,0,5; },{ bonus bDef,1; bonus bMdef,1; bonus2 bResEff,Eff_Stun,-100; }
+1188,BON_GUN,Bon Gun,659,9025,10020,537,80,60,30,100,250,20,500,150,1,0,600,200,400,{ petskillattack "NPC_DARKNESSATTACK",555,1,1,1; },{ bonus bVit,1; bonus2 bResEff,Eff_Stun,100; }
+1200,ZHERLTHSH,Zealotus,660,9026,0,929,80,60,10,100,250,20,300,150,0,0,1000,100,500,{ petskillattack "AS_SONICBLOW",1,0,0,3; },{ bonus2 bAddRace,RC_DemiPlayer,2; bonus2 bMagicAddRace,RC_DemiPlayer,2; }
+1275,ALICE,Alice,661,9027,0,504,80,60,20,100,250,20,800,150,0,0,100,1000,200,{ petskillsupport "AL_HEAL",5,60,25,100; },{ bonus bMdef,1; if (RENEWAL) { bonus2 bAddRaceTolerance,RC_DemiPlayer,1; } else { bonus2 bSubRace,RC_DemiPlayer,1; } }
+1815,EVENT_RICECAKE,Rice Cake,0,9028,0,511,80,60,50,100,250,20,2000,150,1,0,500,500,200,{ petskillsupport "CR_DEFENDER",3,240,50,100; },{ bonus2 bSubEle,Ele_Neutral,1; bonus bMaxHPrate,-1; }
+1245,GOBLINE_XMAS,Christmas Goblin,12225,9029,0,911,80,60,50,100,250,20,2000,150,0,0,300,300,800,{ petskillattack "MG_SIGHT",5,0,5,5; },{ bonus bMaxHP,30; bonus2 bSubEle,Ele_Water,1; }
+
+// Newest pets.
+1519,CHUNG_E,Green Maiden,12395,9030,0,6115,80,60,50,100,250,20,2000,150,0,0,300,300,800,{ petskillattack "CR_SHIELDCHARGE",5,0,5,5; },{ bonus bDef,1; if (RENEWAL) { bonus2 bAddRaceTolerance,RC_DemiPlayer,1; } else { bonus2 bSubRace,RC_DemiPlayer,1; } }
+1879,ECLIPSE_P,Spring Rabbit,0,9031,0,7766,80,60,50,100,250,20,2000,150,0,0,300,300,800,{ petskillattack "TF_THROWSTONE",1,0,5,5; },{}
+1122,GOBLIN_1,Goblin,14569,9032,0,7821,80,60,50,100,250,20,800,150,0,0,300,300,800,{ petskillattack "NPC_WINDATTACK",5,0,5,5; },{}
+1123,GOBLIN_2,Goblin,14570,9033,0,7821,80,60,50,100,250,20,800,150,0,0,300,300,800,{ petskillattack "NPC_FIREATTACK",5,0,5,5; },{}
+1125,GOBLIN_4,Goblin,14571,9034,0,7821,80,60,50,100,250,20,800,150,0,0,300,300,800,{ petskillattack "NPC_GROUNDATTACK",5,0,5,5; },{}
+1385,DELETER_,Deleter,14572,9035,0,7822,80,60,20,100,250,20,800,150,0,0,300,300,800,{ petskillattack "SM_MAGNUM",5,0,5,5; },{}
+1382,DIABOLIC,Diabolic,14573,9036,0,7823,80,60,10,100,250,20,800,150,0,0,300,300,800,{ petskillattack "WZ_METEOR",2,0,5,5; },{}
+1208,WANDER_MAN,Wanderer,14574,9037,0,7824,80,60,20,100,250,20,800,150,0,0,300,300,800,{ petskillattack "NPC_UNDEADATTACK",5,0,5,5; },{}
+
+1963,P_CHUNG_E,New Year Doll,0,9038,0,554,80,60,30,100,250,20,800,150,0,0,300,300,800,{ petskillattack "CR_SHIELDCHARGE",5,0,5,5; },{}
+
+// New pets JapanRO Mobile
+1040,GOLEM,Golem,12371,9053,10035,6111,80,60,20,100,250,20,500,150,0,0,300,300,800,{},{ bonus bMaxHP,100; bonus bFlee,-5; }
+1143,MARIONETTE,Marionette,12361,9043,10025,6098,80,60,10,100,250,20,500,150,0,0,300,300,800,{},{ bonus bSPrecovRate,3; }
+1148,MEDUSA,Medusa,12368,9050,10032,6108,80,60,10,100,250,20,200,150,0,0,300,300,800,{},{ bonus bVit,1; bonus2 bResEff,Eff_Stone,500; }
+1179,WHISPER,Whisper,12363,9045,10027,6100,80,60,20,100,250,20,500,150,0,0,300,300,800,{},{ bonus bFlee,7; bonus bDef,-3; }
+1299,GOBLIN_LEADER,Goblin Leader,12364,9046,10028,6104,80,60,10,100,250,20,50,150,0,0,300,300,800,{},{ bonus2 bAddRace,RC_DemiPlayer,3; }
+1370,SUCCUBUS,Succubus,12373,9055,10037,6113,80,60,10,100,250,20,200,150,0,0,300,300,800,{},{ bonus2 bHPDrainRate,50,5; }
+1374,INCUBUS,Incubus,12370,9052,10034,6110,80,60,10,100,250,20,50,150,0,0,300,300,800,{},{ bonus bMaxSPrate,3; }
+1379,NIGHTMARE_TERROR,Nightmare Terror,12372,9054,10036,6112,80,60,10,100,250,20,200,150,0,0,300,300,800,{},{ bonus2 bResEff,Eff_Sleep,10000; }
+1401,SHINOBI,Shinobi,12362,9044,10026,6099,80,60,20,100,250,20,500,150,0,0,300,300,800,{},{ bonus bAgi,2; }
+1404,MIYABI_NINGYO,Miyabi Doll,12366,9048,10030,6106,80,60,15,100,250,20,200,150,0,0,300,300,800,{},{ bonus bInt,1; bonus bCastrate,-3; }
+1416,WICKED_NYMPH,Evil Nymph,12365,9047,10029,6105,80,60,15,100,250,20,500,150,0,0,300,300,800,{},{ bonus bMaxSP,30; bonus bSPrecovRate,5; }
+1495,STONE_SHOOTER,Stone Shooter,12369,9051,10033,6109,80,60,20,100,250,20,500,150,0,0,300,300,800,{},{ bonus2 bSubEle,Ele_Fire,3; }
+1504,DULLAHAN,Dullahan,12367,9049,10031,6107,80,60,10,100,250,20,200,150,0,0,300,300,800,{},{ bonus bCritAtkRate,5; }
+1505,LOLI_RURI,Loli Ruri,12360,9042,10024,6097,80,60,15,100,250,20,200,150,0,0,300,300,800,{},{ bonus bMaxHPrate,3; bonus3 bAutoSpellWhenHit,"AL_HEAL",1,50; }
+1513,CIVIL_SERVANT,Mao Guai,12358,9040,10022,6095,80,60,10,100,250,20,500,150,0,0,300,300,800,{},{ bonus bMaxSP,10; }
+1586,LEAF_CAT,Leaf Cat,12359,9041,10023,6096,80,60,20,100,250,20,200,150,0,0,300,300,800,{},{ if (RENEWAL) { bonus2 bAddRaceTolerance,RC_Brute,2; } else { bonus2 bSubRace,RC_Brute,3; } }
+1630,BACSOJIN_,White Lady,12357,9039,10021,6094,80,60,10,100,250,20,2000,150,0,0,300,300,800,{},{}
+1837,IMP,Fire Imp,12374,9056,10038,6114,80,60,10,100,250,20,200,150,0,0,300,300,800,{},{ bonus2 bSubEle,Ele_Fire,2; bonus2 bAddEle,Ele_Fire,2; }
+
+// Brasilis Quest - Suspicious Beach [UNHATCHABLE]
+2057,E_CRAMP,Strange Cramp,12408,6221,0,0,0,0,0,0,0,0,50,0,0,0,350,400,800,{},{} // kRO version
+2081,E_HYDRA,Strange Hydra,12408,6221,0,0,0,0,0,0,0,0,50,0,0,0,350,400,800,{},{} // iRO/cRO version
diff --git a/db/pre-re/size_fix.txt b/db/pre-re/size_fix.txt
index 81bba5044..ae0049db0 100644
--- a/db/pre-re/size_fix.txt
+++ b/db/pre-re/size_fix.txt
@@ -1,7 +1,7 @@
// Database for size fix for weapon damage.
-//Columns: Weapon type, Rows: Target size.
-//Unarmed, Knife, 1H Sword, 2H Sword, 1H Spear, 2H Spears, 1H Axe, 2H Axe, Mace, 2H Mace, Staff, Bow, Knuckle, Musical Instrument, Whip, Book, Katar, Revolver, Rifle, Shotgun, Gatling Gun, Grenade Launcher, Fuuma Shuriken, 2H Staff
+// Columns: Weapon type, Rows: Target size.
+// Unarmed, Knife, 1H Sword, 2H Sword, 1H Spear, 2H Spears, 1H Axe, 2H Axe, Mace, 2H Mace, Staff, Bow, Knuckle, Musical Instrument, Whip, Book, Katar, Revolver, Rifle, Shotgun, Gatling Gun, Grenade Launcher, Fuuma Shuriken, 2H Staff
100,100, 75, 75, 75, 75, 50, 50, 75,100,100,100,100, 75, 75,100, 75,100,100,100,100,100,100,100 // Size: Small
100, 75,100, 75, 75, 75, 75, 75,100,100,100,100, 75,100,100,100,100,100,100,100,100,100,100,100 // Size: Medium
100, 50, 75,100,100,100,100,100,100,100,100, 75, 50, 75, 50, 50, 75,100,100,100,100,100,100,100 // Size: Large
diff --git a/db/pre-re/skill_cast_db.txt b/db/pre-re/skill_cast_db.txt
index cbe004662..98c1720f5 100644
--- a/db/pre-re/skill_cast_db.txt
+++ b/db/pre-re/skill_cast_db.txt
@@ -16,7 +16,6 @@
// - Makes lvl 1 have 1000 (1s) cool down, lvl 2 2500 (2.5s), lvl 3 3000, and so on.
//==========================================
-
//===== Swordman ===========================
//-- SM_PROVOKE
6,0,0,0,30000,0,1000
@@ -26,7 +25,6 @@
8,0,0,0,10000:13000:16000:19000:22000:25000:28000:31000:34000:37000,10000,10000
//==========================================
-
//===== Mage ===============================
//-- MG_SIGHT
10,0,0,0,10000,0,0
@@ -54,7 +52,6 @@
21,1000:2000:3000:4000:5000:6000:7000:8000:9000:10000,2000,0,500,0,0
//==========================================
-
//===== Acolyte ============================
//-- AL_RUWACH
24,0,0,0,10000,0,0
@@ -82,7 +79,6 @@
35,0,1000,0,0,6000,0
//==========================================
-
//===== Archer =============================
//-- AC_CONCENTRATION
45,0,0,0,60000:80000:100000:120000:140000:160000:180000:200000:220000:240000,0,0
@@ -92,7 +88,6 @@
47,0,0,0,100,0,0
//==========================================
-
//===== Thief ==============================
//-- TF_HIDING
51,0,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0,0
@@ -100,13 +95,11 @@
52,0,0,0,0,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,0
//==========================================
-
//===== First planned to be shared =========
//-- ALL_RESURRECTION
54,6000:4000:2000:0,0:1000:2000:3000,0,0,0,0
//==========================================
-
//===== Knight =============================
//-- KN_BRANDISHSPEAR
57,700,0,0,0,0,0
@@ -121,7 +114,6 @@
62,700,0,0,0,0,0
//==========================================
-
//===== Priest =============================
//-- PR_IMPOSITIO
66,0,3000,0,60000,0,0
@@ -153,7 +145,6 @@
79,15000,4000,0,5000:6000:7000:8000:9000:10000:11000:12000:13000:14000,0,0
//==========================================
-
//===== Wizard =============================
//-- WZ_FIREPILLAR
80,3000:2700:2400:2100:1800:1500:1200:900:600:300,1000,0,30000,600:800:1000:1200:1400:1600:1800:2000:2200:2400,0
@@ -181,7 +172,6 @@
92,0,1000,0,5000:10000:15000:20000:25000,5000:10000:15000:20000:25000,0
//==========================================
-
//===== Blacksmith =========================
//-- BS_REPAIRWEAPON
108,7500,0,0,0,0,0
@@ -197,7 +187,6 @@
114,0,0,0,1000:2000:3000:4000:5000,0,0
//==========================================
-
//===== Hunter =============================
//-- HT_SKIDTRAP
115,0,0,0,300000:240000:180000:120000:60000,0,0
@@ -225,7 +214,6 @@
129,1500,1000,0,0,0,0
//==========================================
-
//===== Assassin ===========================
//-- AS_CLOAKING
135,0,0,0,500:1000:2000:3000:4000:5000:6000:7000:8000:9000,0,0
@@ -242,7 +230,6 @@
//==========================================
-
//===== 1st Jobs Quest Skills===============
//-- NV_TRICKDEAD
143,0,0,0,600000,0,0
@@ -268,7 +255,6 @@
157,5000,0,0,300000,0,0
//==========================================
-
//===== NPC Skills Part 1 ==================
//-- NPC_ATTRICHANGE
161,0,0,0,1800000,0,0
@@ -323,7 +309,6 @@
207,0,0,0,30000:40000:50000:60000:70000:80000:90000:100000:110000:120000,0,0
//==========================================
-
//===== Rogue ==============================
//-- RG_BACKSTAB
212,0,500,0,0,0,0
@@ -343,7 +328,6 @@
220,0,0,0,180000,0,0
//==========================================
-
//===== Alchemist ==========================
//-- AM_DEMONSTRATION
229,1000,0,0,40000:45000:50000:55000:60000,0,0
@@ -367,7 +351,6 @@
247,2000,0,0,0,0,0
//==========================================
-
//===== Crusader ===========================
//-- CR_AUTOGUARD
249,0,0,0,300000,0,0
@@ -391,7 +374,6 @@
258,0,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0,0
//==========================================
-
//===== Monk ===============================
//-- MO_CALLSPIRITS
261,1000,0,0,600000,0,0
@@ -448,7 +430,6 @@
294,0,0,0,1200000,0,0
//==========================================
-
//===== Bard & Dancer (Ensemble Skills) ====
//-- BD_ADAPTATION
304,0,0,0,0,5000,0
@@ -471,7 +452,6 @@
313,0,0,0,60000,60000,0
//==========================================
-
//===== Bard ===============================
//-- BA_MUSICALSTRIKE
316,1500,0,0,0,0,0
@@ -489,7 +469,6 @@
322,0,0,0,180000,20000,0
//==========================================
-
//===== Dancer =============================
//-- DC_THROWARROW
324,1500,0,0,0,0,0
@@ -507,7 +486,6 @@
330,0,0,0,180000,20000,0
//==========================================
-
//===== Wedding Skills =====================
//-- WE_MALE
334,3000,0,0,0,0,0
@@ -517,7 +495,6 @@
336,0,0,0,20000,0,0
//==========================================
-
//===== NPC Skills Part 2 ==================
//-- NPC_GRANDDARKNESS
339,2000,1500,900,900,10000:11000:12000:13000:14000:15000:16000:17000:18000:19000,0
@@ -535,7 +512,6 @@
354,0,0:500:1000:1500:2000:2500,0,0,0,0
//==========================================
-
//===== Lord Knight ========================
//-- LK_AURABLADE
355,0,0,0,40000:60000:80000:100000:120000,0,0
@@ -551,7 +527,6 @@
360,0,0,0,300000,0,0
//==========================================
-
//===== High Priest ========================
//-- HP_ASSUMPTIO
361,1000:1500:2000:2500:3000,1100:1200:1300:1400:1500,0,20000:40000:60000:80000:100000,0,0
@@ -559,7 +534,6 @@
362,5000:6000:7000:8000:9000,2000:3000:4000:5000:6000,0,20000:25000:30000:35000:40000,20000:25000:30000:35000:40000,0
//==========================================
-
//===== High Wzard =========================
//-- HW_MAGICCRASHER
365,300,300,0,0,0,0
@@ -567,7 +541,6 @@
366,700,0,0,30000,0,0
//==========================================
-
//===== Paladin ============================
//-- PA_PRESSURE
367,2000:2500:3000:3500:4000,2000:2500:3000:3500:4000,0,0,2000:3000:4000:5000:6000,0
@@ -577,7 +550,6 @@
369,0,0,0,60000,60000,0
//==========================================
-
//===== Champion ===========================
//-- CH_PALMSTRIKE
370,0,300,0,0,0,0
@@ -587,7 +559,6 @@
372,0,800:800:800:800:800:1000:1000:1000:1000:1000,0,0,0,0
//==========================================
-
//===== Professor ==========================
//-- PF_HPCONVERSION
373,0,1000:1200:1400:1600:1800,0,0,0,0
@@ -597,7 +568,6 @@
375,0,0,0,0,0,10000:10000:10000:10000:15000
//==========================================
-
//===== Assassin Cross =====================
//-- ASC_EDP
378,0,2000,0,40000:45000:50000:55000:60000,20000:30000:40000:50000:60000,0
@@ -605,7 +575,6 @@
379,700,1000:1200:1400:1600:1800:2000:2200:2400:2600:2800,0,0,0,0
//==========================================
-
//===== Sniper =============================
//-- SN_SIGHT
380,0,0,0,30000,0,0
@@ -617,7 +586,6 @@
383,2000:2400:2800:3200:3600:4000:4400:4800:5200:5600,2000,0,130000:160000:190000:220000:250000:280000:310000:340000:370000:400000,0,0
//==========================================
-
//===== Whitesmith =========================
//-- WS_MELTDOWN
384,500:500:600:600:700:700:800:800:900:1000,0,0,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,5000,0
@@ -626,7 +594,6 @@
387,0,0,0,60000,0,0
//==========================================
-
//===== Stalker ============================
//-- ST_CHASEWALK
389,1200,0,0,10000,30000,0
@@ -634,7 +601,6 @@
390,0,0,0,300000,0,0
//==========================================
-
//===== Clown / Gypsy ======================
//-- CG_ARROWVULCAN
394,2000:2200:2400:2600:2800:3000:3200:3400:3600:3800,2800:2800:2800:2800:2800:3000:3000:3000:3000:3000,2000,0,0,0
@@ -669,7 +635,6 @@
407,0,500,0,0,0,0
//==========================================
-
//===== Adoption Skills ====================
//-- WE_BABY
408,3000,0,0,300000,0,0
@@ -679,7 +644,6 @@
410,0,0,0,20000,0,0
//==========================================
-
//===== Taekwon ============================
//-- TK_RUN
411,6000:5000:4000:3000:2000:1000:0:0:0:0,0,0,1000,150000,0
@@ -833,7 +797,6 @@
499,0,0,0,100,0,0
//==========================================
-
//===== Gunslinger =========================
//-- GS_GLITTERING
500,0,0,0,600000,0,0
@@ -869,7 +832,6 @@
521,2000,0,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,10000,0
//==========================================
-
//===== Ninja ==============================
//-- NJ_KUNAI
524,0,1000,0,0,0,0
@@ -1104,7 +1066,7 @@
2015,0,0,0,180000,10000,0
//-- RK_VITALITYACTIVATION
2016,0,0,0,180000,0,0
-//-- RK_STORMBLAST
+//-- RK_STORMBLAST
2017,2000,2000,0,0,0,0
//-- RK_FIGHTINGSPIRIT
2018,0,0,0,180000,0,0
@@ -1144,7 +1106,7 @@
2034,0,1000,0,0,0,0
//-- GC_HALLUCINATIONWALK
2035,0,0,0,30000:35000:40000:45000:50000,25000,300000
-//-- GC_ROLLINGCUTTER
+//-- GC_ROLLINGCUTTER
2036,0,200,0,3000,0,0
//-- GC_CROSSRIPPERSLASHER
2037,0,1000,0,0,0,0
@@ -1157,7 +1119,7 @@
2038,2000,500,0,0,0,0
//-- AB_ANCILLA
2039,1000,1000,0,0,0,0
-//-- AB_ADORAMUS
+//-- AB_ADORAMUS
2040,2000,500,0,6000:7000:8000:9000:10000:11000:12000:13000:14000:15000,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,2000
//-- AB_CLEMENTIA
2041,3000,0,0,120000:180000:240000,0,0
@@ -1194,7 +1156,7 @@
//==========================================
//===== Warlock ============================
-//-- WL_WHITEIMPRISON
+//-- WL_WHITEIMPRISON
2201,0,0,0,6000:8000:10000:12000:14000,15000,4000
//-- WL_SOULEXPANSION
2202,2000,500,0,0,0,0
@@ -1202,13 +1164,13 @@
2203,2000:2500:3000:3500:4000,1000,0,40000,0,4000
//-- WL_JACKFROST
2204,2000:2500:3000:3500:4000,1000,0,10000:15000:20000:25000:30000,0,0
-//-- WL_MARSHOFABYSS
+//-- WL_MARSHOFABYSS
2205,0,1000,0,30000,0,2500:3000:3500:4000:4500
//-- WL_RECOGNIZEDSPELL
2206,1000,1000,0,60000:90000:120000:150000:180000,0,50000:80000:110000:140000:170000
-//-- WL_SIENNAEXECRATE
+//-- WL_SIENNAEXECRATE
2207,2000,2000,0,10000:12000:14000:16000:18000,0,0
-//-- WL_STASIS
+//-- WL_STASIS
2209,3000,2000,0,10000:15000:20000:25000:30000,1000,180000:190000:200000:210000:220000
//-- WL_DRAINLIFE
2210,4000,0,0,0,0,2000
@@ -1216,11 +1178,11 @@
2211,5000,2000,0,5000,0,5000
//-- WL_HELLINFERNO
2212,3000,1000,0,20000:30000:40000:50000:60000,0,0
-//-- WL_COMET
+//-- WL_COMET
2213,10000:11000:12000:13000:14000,0,0,100,42000,60000
-//-- WL_CHAINLIGHTNING
+//-- WL_CHAINLIGHTNING
2214,3500:4000:4500:5000:5500,0,0,100,0,3000
-//-- WL_EARTHSTRAIN
+//-- WL_EARTHSTRAIN
2216,2000:3000:4000:5000:6000,1000,0,100,75000:90000:105000:120000:135000,10000
//-- WL_TETRAVORTEX
2217,5000:6000:7000:8000:9000,2000,0,15000:120000:40000:5000,0,15000
@@ -1232,7 +1194,7 @@
2224,2000,0,0,120000:160000:200000:240000:280000,0,0
//-- WL_SUMMONSTONE
2229,2000,0,0,120000:160000:200000:240000:280000,0,0
-//-- WL_READING_SB
+//-- WL_READING_SB
2231,5000,500,0,0,0,0
//-- WL_TELEKINESIS_INTENSE
5012,1000,0,0,60000,0,300000
@@ -1248,9 +1210,9 @@
2236,4000,1000,0,0,0,0
//-- RA_DETONATOR
2237,0,0,0,1000,0,0
-//-- RA_ELECTRICSHOCKER
+//-- RA_ELECTRICSHOCKER
2238,0,0,0,15000,20000:22000:24000:26000:28000,0
-//-- RA_CLUSTERBOMB
+//-- RA_CLUSTERBOMB
2239,0,0,0,15000,0,0
//-- RA_WUGMASTERY
2240,0,1000,0,0,0,0
@@ -1341,7 +1303,7 @@
//===== Shadow Chaser ======================
//-- SC_FATALMENACE
2284,0,500,0,0,0,0
-//-- SC_REPRODUCE
+//-- SC_REPRODUCE
2285,0,1000,0,60000,0,0
//-- SC_AUTOSHADOWSPELL
2286,4000:3600:3200:2800:2400:2000:1600:1200:800:400,0,0,60000:80000:100000:120000:140000:160000:180000:200000:220000:300000,0,0
@@ -1395,7 +1357,7 @@
2310,0,0,0,3500:4000:4500:5000:5500,0,2000
//-- LG_REFLECTDAMAGE
2311,0,0,0,300000,0,0
-//-- LG_PINPOINTATTACK
+//-- LG_PINPOINTATTACK
2312,0,1000,0,5000,0,5000
//-- LG_FORCEOFVANGUARD
2313,0,1000,0,300000,0,0
@@ -1432,7 +1394,7 @@
2326,0,0,0,3000,0,0
//-- SR_SKYNETBLOW
2327,0,500,0,0,0,0
-//-- SR_EARTHSHAKER
+//-- SR_EARTHSHAKER
2328,0,0,0,1000,0,3000
//-- SR_FALLENEMPIRE
2329,0,0,0,500:1000:1500:2000:2500,0,0
@@ -1465,7 +1427,7 @@
2344,0,0,0,5000:7000:9000:11000:13000,0,1000:1500:2000:2500:3000
//-- SR_GENTLETOUCH_CURE
2345,0,1000,0,0,0,1000:1500:2000:2500:3000
-//-- SR_GENTLETOUCH_ENERGYGAIN
+//-- SR_GENTLETOUCH_ENERGYGAIN
2346,1000,1000,0,240000,0,0
//-- SR_GENTLETOUCH_CHANGE
2347,1000,1000,0,240000,0,200000:180000:160000:140000:120000
@@ -1561,7 +1523,7 @@
2451,1000,1000,0,60000,0,2000
//-- SO_WARMER
2452,2200:2400:2600:2800:3000,1000,0,40000:45000:50000:55000:60000,30000,35000:40000:45000:50000:55000
-//-- SO_VACUUM_EXTREME
+//-- SO_VACUUM_EXTREME
2453,1000:1500:2000:2500:3000,1000,0,4000:6000:8000:10000:12000,1000,5000
//-- SO_VARETYR_SPEAR
2454,2200:2400:2600:2800:3000,1000,0,0,2200:2400:2600:2800:3000,2000
@@ -1569,15 +1531,15 @@
2455,2200:2400:2600:2800:3000,1000,0,8000:10000:12000:14000:16000,0,5000:6000:7000:8000:9000
//-- SO_EL_CONTROL
2456,2000,0,0,0,0,5000
-//-- SO_SUMMON_AGNI
+//-- SO_SUMMON_AGNI
2457,1000:2000:3000,0,0,600000:900000:1200000,0,60000
//-- SO_SUMMON_AQUA
2458,1000:2000:3000,0,0,600000:900000:1200000,0,60000
-//-- SO_SUMMON_VENTUS
+//-- SO_SUMMON_VENTUS
2459,1000:2000:3000,0,0,600000:900000:1200000,0,60000
-//-- SO_SUMMON_TERA
+//-- SO_SUMMON_TERA
2460,1000:2000:3000,0,0,600000:900000:1200000,0,60000
-//-- SO_EL_ACTION
+//-- SO_EL_ACTION
2461,0,0,0,0,0,5000
//-- SO_EL_ANALYSIS
2462,0,0,0,0,0,0
@@ -1611,7 +1573,7 @@
2481,1500,500,0,2000:2000:3000:3000:4000,0,5000
//-- GN_WALLOFTHORN
2482,1500,500,0,10000:11000:12000:13000:14000,0,5000
-//-- GN_CRAZYWEED
+//-- GN_CRAZYWEED
2483,3000:3500:4000:4500:5000:5500:6000:6500:7000:7500,500,0,0,0,5000
//-- GN_CRAZYWEED_ATK
2484,0,0,0,100,0,0
@@ -1627,7 +1589,7 @@
//-- GN_HELLS_PLANT
2490,3000:3500:4000:4500:5000,500,0,14000:21000:28000:35000:42000,0,0
-//-- GN_HELLS_PLANT_ATK
+//-- GN_HELLS_PLANT_ATK
2491,0,0,0,20000,0,0
//-- GN_MANDRAGORA
2492,1000,500,0,10000:15000:20000:25000:30000,0,10000
@@ -1753,7 +1715,7 @@
//-- MH_SUMMON_LEGION
8018,1600:1400:1200:1000:800,0,0,20000:30000:40000:50000:60000,0,0
-//-- MH_NEEDLE_OF_PARALYZE
+//-- MH_NEEDLE_OF_PARALYZE
8019,1000:1100:1200:1300:1400,0,0,12000:14000:16000:18000:20000,0,0
//-- MH_POISON_MIST
8020,500:700:900:1100:1300,0,0,12000:14000:16000:18000:20000,4000:6000:8000:10000:12000,0
@@ -1770,14 +1732,14 @@
//-- MH_SILENT_BREEZE
8026,1000:1200:1400:1600:1800,0,0,9000:12000:15000:18000:21000,0,0
//-- MH_STYLE_CHANGE
-//8027,0,0,0,0,0,0,0
+//8027,0,0,0,0,0,0,0
//-- MH_SONIC_CRAW
-//8028,0,0,0,0,0,0,0
+//8028,0,0,0,0,0,0,0
//-- MH_SILVERVEIN_RUSH
-//8029,0,0,0,0,0,0,0
+//8029,0,0,0,0,0,0,0
//-- MH_MIDNIGHT_FRENZY
-//8030,0,0,0,0,0,0,0
-//-- MH_STAHL_HORN
+//8030,0,0,0,0,0,0,0
+//-- MH_STAHL_HORN
8031,800:600:400:200:0,0,0,5000,0,0
//-- MH_GOLDENE_FERSE
8032,1000:1200:1400:1600:1800,0,0,30000:45000:60000:75000:90000,0,0
@@ -1788,11 +1750,11 @@
//-- MH_ANGRIFFS_MODUS
8035,200:400:600:800:1000,0,0,30000:45000:60000:75000:90000,0,0
//-- MH_TINDER_BREAKER
-//8036,0,0,0,0,0,0,0
+//8036,0,0,0,0,0,0,0
//-- MH_CBC
-//8037,0,0,0,0,0,0,0
+//8037,0,0,0,0,0,0,0
//-- MH_EQC
-//8038,0,0,0,0,0,0,0
+//8038,0,0,0,0,0,0,0
//-- MH_MAGMA_FLOW
8039,2000:2500:3000:3500:4000,0,0,30000:45000:60000:75000:90000,0,0
//-- MH_GRANITIC_ARMOR
diff --git a/db/pre-re/skill_db.txt b/db/pre-re/skill_db.txt
index 9feec142c..5f8553127 100644
--- a/db/pre-re/skill_db.txt
+++ b/db/pre-re/skill_db.txt
@@ -18,7 +18,7 @@
// 0x80 - Skill ignores target's def cards
// 07 splash/effect range (-1 for screen-wide)
// 08 MaxLv
-// 09 Number of hits (when positive, damage is increased by hits,
+// 09 Number of hits (when positive, damage is increased by hits,
// negative values just show number of hits without increasing total damage)
// 10 Cast interrupted when hit?
// 11 defense-reduction rate during cast.
@@ -45,6 +45,7 @@
// 15 Blowcount (amount of tiles skill knockbacks)
// 16 Name
// 17 Description
+
1,0,0,0,0,0,0,9,0,no,0,0,0,none,0, NV_BASIC,Basic Skill
2,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0, SM_SWORD,Sword Mastery
3,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0, SM_TWOHAND,Two-Handed Sword Mastery
@@ -760,7 +761,7 @@
2211,11,8,1,3,0x2,3,5,-7,yes,0,0,0,magic,3, WL_CRIMSONROCK,Crimson Rock
2212,11,6,1,3,0,0,5,1,yes,0,0,0,magic,0, WL_HELLINFERNO,Hell Inferno
2213,11,8,2,0,0,0,5,-20,yes,0,0,0,magic,2, WL_COMET,Comet
-2214,11,6,1,0,0,3,5,1,yes,0,0,0,magic,0, WL_CHAINLIGHTNING,Chain Lightning
+2214,11,6,1,0,0,3,5,1,yes,0,0,0,magic,0, WL_CHAINLIGHTNING,Chain Lightning
2215,11,6,1,4,0,0,5,1,no,0,0,0,magic,0, WL_CHAINLIGHTNING_ATK,Chain Lightning Attack
2216,3,8,2,2,0,0,5,-6:-7:-8:-9:-10,yes,0,0,0,magic,0, WL_EARTHSTRAIN,Earth Strain
2217,11,6,1,0,0,0,5,1,yes,0,0,0,magic,0, WL_TETRAVORTEX,Tetra Vortex
@@ -771,7 +772,7 @@
2222,0,6,4,3,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONFB,Summon Fire Ball
2223,0,6,4,4,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONBL,Summon Lightning Ball
2224,0,6,4,1,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONWB,Summon Water Ball
-2225,11,6,1,3,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_FIRE,Summon Attack Fire
+2225,11,6,1,3,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_FIRE,Summon Attack Fire
2226,11,6,1,4,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_WIND,Summon Attack Wind
2227,11,6,1,1,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_WATER,Summon Attack Water
2228,11,6,1,2,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_GROUND,Summon Attack Earth
@@ -1064,7 +1065,7 @@
3006,7:8:9:10:11,6,2,0,0x2,2,5,0,no,0,0,0,weapon,0, KO_BAKURETSU,Bakuretsu Kunai
3007,0,6,4,-1,0x42,4:4:4:4:5,5,0,no,0,0,0,misc,0, KO_HAPPOKUNAI,Happo Kunai
3008,9,8,2,0,0x12,2,10,-10,no,0,0,0,misc,0, KO_MUCHANAGE,Mucha Nage
-3009,9:10:11:12:13,8,2,-1,0x2,3,5,-5,no,0,0,0,weapon,0, KO_HUUMARANKA,Huuma Shuriken Ranka
+3009,9:10:11:12:13,8,2,-1,0x2,3,5,-5,no,0,0,0,weapon,0, KO_HUUMARANKA,Huuma Shuriken Ranka
3010,3,6,4,0,0x42,0,5,1,no,0,0x80,0,weapon,0, KO_MAKIBISHI,Makibishi
3011,0,6,4,0,0x1,0,5,0,yes,0,0,0,none,0, KO_MEIKYOUSISUI,Meikyo Shisui
3012,0,6,4,0,0x1,0,5,0,no,0,0,1,none,3:4:5:6:7, KO_ZANZOU,Zanzou
@@ -1073,7 +1074,7 @@
3015,0,6,4,3,0x1,0,1,1,no,0,0,0,none,0, KO_KAHU_ENTEN,Kahu Enten
3016,0,6,4,1,0x1,0,1,1,no,0,0,0,none,0, KO_HYOUHU_HUBUKI,Hyouhu Hubuki
3017,0,6,4,4,0x1,0,1,1,no,0,0,0,none,0, KO_KAZEHU_SEIRAN,Kazehu Seiran
-3018,0,6,4,2,0x1,0,1,1,no,0,0,0,none,0, KO_DOHU_KOUKAI,Dohu Koukai
+3018,0,6,4,2,0x1,0,1,1,no,0,0,0,none,0, KO_DOHU_KOUKAI,Dohu Koukai
3019,11,6,1,0,0,0,5,0,no,0,0,0,magic,0, KO_KAIHOU,Technique Kaihou
3020,7,6,2,0,0,0,1,3,yes,0,0,0,magic,0, KO_ZENKAI,Zenkai
3021,5:6:7:8:9,6,16,0,0x1,0,5,1,no,0,0,0,none,0, KO_GENWAKU,Genwaku
diff --git a/db/pre-re/skill_require_db.txt b/db/pre-re/skill_require_db.txt
index d70d9175d..8b09f085e 100644
--- a/db/pre-re/skill_require_db.txt
+++ b/db/pre-re/skill_require_db.txt
@@ -711,7 +711,7 @@
2347,0,0,40:50:60:70:80,-2:-4:-6:-8:-10,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_GENTLETOUCH_CHANGE#Gentle Touch - Change#
2348,0,0,40:50:60:70:80,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_GENTLETOUCH_REVITALIZE#Gentle Touch - Revitalize#
//More from SR Sura (but not following ID order)
-2517,0,0,40:45:50:55:60,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_HOWLINGOFLION#Howling of Lion#
+2517,0,0,40:45:50:55:60,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_HOWLINGOFLION#Howling of Lion#
2518,0,0,40:50:60:70:80,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_RIDEINLIGHTNING#Ride In Lightening#
//****
@@ -730,8 +730,8 @@
// WM Wanderer/Minstrel
2413,0,0,64:68:72:76:80,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_METALICSOUND#Metallic Sound#
2414,0,0,28:32:38:42:48,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION#Reverberation#
-2415,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MELEE#Reverberation Melee#
-2416,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MAGIC#Reverberation Magic#
+2415,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MELEE#Reverberation Melee#
+2416,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MAGIC#Reverberation Magic#
2417,0,0,10,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_DOMINION_IMPULSE#Dominion Impulse#
2418,0,0,80:90:100:110:120,0,0,0,11,1,20,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_SEVERE_RAINSTORM#Severe Rainstorm#
2419,0,0,12:16:20:24:28,0,0,0,13:14,0,0,none,0,11513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_POEMOFNETHERWORLD#Poem of Netherworld#
diff --git a/db/pre-re/skill_tree.conf b/db/pre-re/skill_tree.conf
index 1b9ad25a5..b5fcd5aca 100644
--- a/db/pre-re/skill_tree.conf
+++ b/db/pre-re/skill_tree.conf
@@ -1,24 +1,24 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1188-skill-tree-db-redesign/
//================ Structure Example =================
/*
Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so if you want to add a new job you should add it there)
- inherit: ( "Other_Job_Name" ); // Base job from which this job will inherit its skill tree. NV_TRICKDEAD inheritance is skipped for non-novices from the source
+ inherit: ( "Other_Job_Name" ); // Base job from which this job will inherit its skill tree. NV_TRICKDEAD inheritance is skipped for non-novices from the source
- skills: { // SKILL_NAMEs come from the Name (16th column) value in db/pre-re/skill_db.txt
- SKILL_NAME1: Max_Level // Use this for skills that don't have other skill prerequisite; Max_Level is a numeric value that should match your client side files
- SKILL_NAME2: { // Use this for skills which have other skills as prerequisites
- MaxLevel: Max_Level // Max_Level is a numeric value that should match your client side files
- SKILL_NAME_PREREQUISITE: Level_Prerequisite // The prerequisite skill and min level for having this skill available. Should also match your client side files
+ skills: { // SKILL_NAMEs come from the Name (16th column) value in db/pre-re/skill_db.txt
+ SKILL_NAME1: Max_Level // Use this for skills that don't have other skill prerequisite; Max_Level is a numeric value that should match your client side files
+ SKILL_NAME2: { // Use this for skills which have other skills as prerequisites
+ MaxLevel: Max_Level // Max_Level is a numeric value that should match your client side files
+ SKILL_NAME_PREREQUISITE: Level_Prerequisite // The prerequisite skill and min level for having this skill available. Should also match your client side files
SKILL_NAME_PREREQUISITE2: Level_Prerequisite2 // You can add as many prerequisite skills as you want. Minimum of 1 if you add a skill this way
}
}
@@ -26,7 +26,7 @@ Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so
//====================================================
Novice: {
- skills: {
+ skills: {
NV_BASIC: 9
NV_FIRSTAID: 1
NV_TRICKDEAD: 1
@@ -39,7 +39,7 @@ Novice: {
Swordsman: {
inherit: ( "Novice" );
- skills: {
+ skills: {
SM_SWORD: 10
SM_TWOHAND: {
MaxLevel: 10
@@ -64,7 +64,7 @@ Swordsman: {
Magician: {
inherit: ( "Novice" );
- skills: {
+ skills: {
MG_SRECOVERY: 10
MG_SIGHT: 1
MG_NAPALMBEAT: 10
@@ -104,7 +104,7 @@ Magician: {
Archer: {
inherit: ( "Novice" );
- skills: {
+ skills: {
AC_OWL: 10
AC_VULTURE: {
MaxLevel: 10
@@ -126,7 +126,7 @@ Archer: {
Acolyte: {
inherit: ( "Novice" );
- skills: {
+ skills: {
AL_DP: 10
AL_DEMONBANE: {
MaxLevel: 10
@@ -177,7 +177,7 @@ Acolyte: {
Merchant: {
inherit: ( "Novice" );
- skills: {
+ skills: {
MC_INCCARRY: 10
MC_DISCOUNT: {
MaxLevel: 10
@@ -209,7 +209,7 @@ Merchant: {
Thief: {
inherit: ( "Novice" );
- skills: {
+ skills: {
TF_DOUBLE: 10
TF_MISS: 10
TF_STEAL: 10
@@ -231,7 +231,7 @@ Thief: {
Knight: {
inherit: ( "Swordsman" );
- skills: {
+ skills: {
KN_SPEARMASTERY: 10
KN_PIERCE: {
MaxLevel: 10
@@ -284,7 +284,7 @@ Knight: {
Priest: {
inherit: ( "Acolyte" );
- skills: {
+ skills: {
MG_SRECOVERY: 10
MG_SAFETYWALL: {
MaxLevel: 10
@@ -353,7 +353,7 @@ Priest: {
Wizard: {
inherit: ( "Magician" );
- skills: {
+ skills: {
WZ_FIREPILLAR: {
MaxLevel: 10
MG_FIREWALL: 1
@@ -416,7 +416,7 @@ Wizard: {
Blacksmith: {
inherit: ( "Merchant" );
- skills: {
+ skills: {
BS_IRON: 5
BS_STEEL: {
MaxLevel: 5
@@ -500,7 +500,7 @@ Blacksmith: {
Hunter: {
inherit: ( "Archer" );
- skills: {
+ skills: {
HT_SKIDTRAP: 5
HT_LANDMINE: 5
HT_ANKLESNARE: {
@@ -576,7 +576,7 @@ Hunter: {
Assassin: {
inherit: ( "Thief" );
- skills: {
+ skills: {
AS_RIGHT: 5
AS_LEFT: {
MaxLevel: 5
@@ -620,7 +620,7 @@ Assassin: {
Crusader: {
inherit: ( "Swordsman" );
- skills: {
+ skills: {
KN_RIDING: {
MaxLevel: 1
SM_ENDURE: 1
@@ -694,7 +694,7 @@ Crusader: {
Monk: {
inherit: ( "Acolyte" );
- skills: {
+ skills: {
MO_IRONHAND: {
MaxLevel: 10
AL_DEMONBANE: 10
@@ -767,7 +767,7 @@ Monk: {
Sage: {
inherit: ( "Magician" );
- skills: {
+ skills: {
WZ_ESTIMATION: 1
WZ_EARTHSPIKE: {
MaxLevel: 5
@@ -860,7 +860,7 @@ Sage: {
Rogue: {
inherit: ( "Thief" );
- skills: {
+ skills: {
SM_SWORD: 10
AC_VULTURE: 10
AC_DOUBLE: {
@@ -943,7 +943,7 @@ Rogue: {
Alchemist: {
inherit: ( "Merchant" );
- skills: {
+ skills: {
AM_AXEMASTERY: 10
AM_LEARNINGPOTION: 10
AM_PHARMACY: {
@@ -1017,7 +1017,7 @@ Alchemist: {
Bard: {
inherit: ( "Archer" );
- skills: {
+ skills: {
BA_MUSICALLESSON: 10
BA_MUSICALSTRIKE: {
MaxLevel: 5
@@ -1091,7 +1091,7 @@ Bard: {
Dancer: {
inherit: ( "Archer" );
- skills: {
+ skills: {
DC_DANCINGLESSON: 10
DC_THROWARROW: {
MaxLevel: 5
@@ -1304,7 +1304,7 @@ Super_Novice: {
Gunslinger: {
inherit: ( "Novice" );
- skills: {
+ skills: {
GS_GLITTERING: 5
GS_FLING: {
MaxLevel: 1
@@ -1395,7 +1395,7 @@ Gunslinger: {
Ninja: {
inherit: ( "Novice" );
- skills: {
+ skills: {
NJ_TOBIDOUGU: 10
NJ_SYURIKEN: {
MaxLevel: 10
@@ -1491,7 +1491,7 @@ Ninja: {
}
}
Novice_High: {
- inherit: ( "Novice" );
+ inherit: ( "Novice" );
}
Swordsman_High: {
inherit: ( "Swordsman" );
@@ -1513,7 +1513,7 @@ Thief_High: {
}
Lord_Knight: {
inherit: ( "Knight" );
- skills: {
+ skills: {
LK_AURABLADE: {
MaxLevel: 5
SM_BASH: 5
@@ -1565,7 +1565,7 @@ Lord_Knight: {
High_Priest: {
inherit: ( "Priest" );
- skills: {
+ skills: {
HP_ASSUMPTIO: {
MaxLevel: 5
AL_ANGELUS: 1
@@ -1594,7 +1594,7 @@ High_Priest: {
High_Wizard: {
inherit: ( "Wizard" );
- skills: {
+ skills: {
HW_SOULDRAIN: {
MaxLevel: 10
MG_SRECOVERY: 5
@@ -1625,7 +1625,7 @@ High_Wizard: {
Whitesmith: {
inherit: ( "Blacksmith" );
- skills: {
+ skills: {
WS_MELTDOWN: {
MaxLevel: 10
BS_SKINTEMPER: 3
@@ -1659,7 +1659,7 @@ Whitesmith: {
Sniper: {
inherit: ( "Hunter" );
- skills: {
+ skills: {
SN_SIGHT: {
MaxLevel: 10
AC_OWL: 10
@@ -1688,7 +1688,7 @@ Sniper: {
Assassin_Cross: {
inherit: ( "Assassin" );
- skills: {
+ skills: {
ASC_KATAR: {
MaxLevel: 5
TF_DOUBLE: 5
@@ -1723,7 +1723,7 @@ Assassin_Cross: {
Paladin: {
inherit: ( "Crusader" );
- skills: {
+ skills: {
PA_PRESSURE: {
MaxLevel: 5
SM_ENDURE: 5
@@ -1751,7 +1751,7 @@ Paladin: {
Champion: {
inherit: ( "Monk" );
- skills: {
+ skills: {
CH_PALMSTRIKE: {
MaxLevel: 5
MO_IRONHAND: 7
@@ -1781,7 +1781,7 @@ Champion: {
Professor: {
inherit: ( "Sage" );
- skills: {
+ skills: {
PF_HPCONVERSION: {
MaxLevel: 5
MG_SRECOVERY: 1
@@ -1827,7 +1827,7 @@ Professor: {
Stalker: {
inherit: ( "Rogue" );
- skills: {
+ skills: {
ST_CHASEWALK: {
MaxLevel: 5
TF_HIDING: 5
@@ -1853,7 +1853,7 @@ Stalker: {
Creator: {
inherit: ( "Alchemist" );
- skills: {
+ skills: {
CR_SLIMPITCHER: {
MaxLevel: 10
AM_POTIONPITCHER: 5
@@ -1876,7 +1876,7 @@ Creator: {
Clown: {
inherit: ( "Bard" );
- skills: {
+ skills: {
CG_ARROWVULCAN: {
MaxLevel: 10
AC_SHOWER: 5
@@ -1912,7 +1912,7 @@ Clown: {
Gypsy: {
inherit: ( "Dancer" );
- skills: {
+ skills: {
CG_ARROWVULCAN: {
MaxLevel: 10
AC_SHOWER: 5
@@ -2011,7 +2011,7 @@ Super_Baby: {
Taekwon: {
inherit: ( "Novice" );
- skills: {
+ skills: {
TK_RUN: 10
TK_READYSTORM: {
MaxLevel: 1
@@ -2057,7 +2057,7 @@ Taekwon: {
Star_Gladiator: {
inherit: ( "Taekwon" );
- skills: {
+ skills: {
SG_FEEL: 3
SG_SUN_WARM: {
MaxLevel: 3
@@ -2123,7 +2123,7 @@ Star_Gladiator: {
Soul_Linker: {
inherit: ( "Taekwon" );
- skills: {
+ skills: {
SL_ALCHEMIST: 5
SL_MONK: 5
SL_STAR: 5
@@ -2224,7 +2224,7 @@ Dark_Collector: {
Rune_Knight: {
inherit: ( "Knight" );
- skills: {
+ skills: {
RK_ENCHANTBLADE: {
MaxLevel: 5
RK_RUNEMASTERY: 2
@@ -2279,7 +2279,7 @@ Rune_Knight: {
Warlock: {
inherit: ( "Wizard" );
- skills: {
+ skills: {
WL_WHITEIMPRISON: {
MaxLevel: 5
WL_SOULEXPANSION: 3
@@ -2375,7 +2375,7 @@ Warlock: {
Ranger: {
inherit: ( "Hunter" );
- skills: {
+ skills: {
RA_ARROWSTORM: {
MaxLevel: 10
RA_AIMEDBOLT: 5
@@ -2470,7 +2470,7 @@ Ranger: {
Arch_Bishop: {
inherit: ( "Priest" );
- skills: {
+ skills: {
AB_JUDEX: {
MaxLevel: 5
PR_TURNUNDEAD: 1
@@ -2563,7 +2563,7 @@ Arch_Bishop: {
Mechanic: {
inherit: ( "Blacksmith" );
- skills: {
+ skills: {
NC_MADOLICENCE: 5
NC_BOOSTKNUCKLE: {
MaxLevel: 5
@@ -2680,7 +2680,7 @@ Mechanic: {
Guillotine_Cross: {
inherit: ( "Assassin" );
- skills: {
+ skills: {
GC_VENOMIMPRESS: {
MaxLevel: 5
AS_ENCHANTPOISON: 3
@@ -2763,7 +2763,7 @@ Warlock_Trans: {
inherit: ( "High_Wizard", "Warlock" );
}
Ranger_Trans: {
- inherit: ( "Sniper", "Ranger" );
+ inherit: ( "Sniper", "Ranger" );
}
Arch_Bishop_Trans: {
inherit: ( "High_Priest", "Arch_Bishop" );
@@ -2777,7 +2777,7 @@ Guillotine_Cross_Trans: {
Royal_Guard: {
inherit: ( "Crusader" );
- skills: {
+ skills: {
LG_CANNONSPEAR: {
MaxLevel: 5
LG_PINPOINTATTACK: 1
@@ -2864,7 +2864,7 @@ Royal_Guard: {
Sorcerer: {
inherit: ( "Sage" );
- skills: {
+ skills: {
SO_FIREWALK: {
MaxLevel: 5
SA_VOLCANO: 1
@@ -2991,7 +2991,7 @@ Sorcerer: {
Minstrel: {
inherit: ( "Bard" );
- skills: {
+ skills: {
MI_RUSH_WINDMILL: {
MaxLevel: 5
WM_LULLABY_DEEPSLEEP: 1
@@ -3103,7 +3103,7 @@ Minstrel: {
Wanderer: {
inherit: ( "Dancer" );
- skills: {
+ skills: {
WA_SWING_DANCE: {
MaxLevel: 5
WM_LULLABY_DEEPSLEEP: 1
@@ -3215,7 +3215,7 @@ Wanderer: {
Sura: {
inherit: ( "Monk" );
- skills: {
+ skills: {
SR_DRAGONCOMBO: {
MaxLevel: 10
MO_TRIPLEATTACK: 5
@@ -3324,7 +3324,7 @@ Sura: {
Genetic: {
inherit: ( "Alchemist" );
- skills: {
+ skills: {
GN_TRAINING_SWORD: 5
GN_REMODELING_CART: 5
GN_CART_TORNADO: {
@@ -3399,7 +3399,7 @@ Genetic: {
Shadow_Chaser: {
inherit: ( "Rogue" );
- skills: {
+ skills: {
SC_FATALMENACE: {
MaxLevel: 5
RG_INTIMIDATE: 5
@@ -3560,7 +3560,7 @@ Baby_Shadow_Chaser: {
Expanded_Super_Novice: {
inherit: ( "Super_Novice" );
- skills: {
+ skills: {
PR_IMPOSITIO: 5
PR_SANCTUARY: {
MaxLevel: 10
@@ -3668,12 +3668,12 @@ Expanded_Super_Novice: {
}
}
Expanded_Super_Baby: {
- inherit: ( "Expanded_Super_Novice" );
+ inherit: ( "Expanded_Super_Novice" );
}
Kagerou: {
- inherit: ( "Ninja" );
+ inherit: ( "Ninja" );
- skills: {
+ skills: {
KO_YAMIKUMO: {
MaxLevel: 1
NJ_KIRIKAGE: 5
@@ -3763,9 +3763,9 @@ Kagerou: {
}
}
Oboro: {
- inherit: ( "Ninja" );
+ inherit: ( "Ninja" );
- skills: {
+ skills: {
KO_YAMIKUMO: {
MaxLevel: 1
NJ_KIRIKAGE: 5
@@ -3855,7 +3855,7 @@ Oboro: {
}
}
Rebellion: {
- inherit: ( "Gunslinger" );
+ inherit: ( "Gunslinger" );
skills: {
RL_RICHS_COIN: {
diff --git a/db/pre-re/skill_unit_db.txt b/db/pre-re/skill_unit_db.txt
index f91ccf2b9..406152b27 100644
--- a/db/pre-re/skill_unit_db.txt
+++ b/db/pre-re/skill_unit_db.txt
@@ -165,7 +165,7 @@
5010,0xfe, , 0, 2, -1,enemy, 0x000 //SC_ESCAPE
8020,0xf5, , 0, 3,2300:2100:1900:1700:1500,enemy, 0x018 //MH_POISON_MIST
-8033,0x7e, , 0, 0, -1,all, 0x003 //MH_STEINWAND
+8033,0x7e, , 0, 0, -1,all, 0x003 //MH_STEINWAND
8025,0x86, , 0, 2:2:3:3:4,1000,enemy, 0x018 //MH_XENO_SLASHER
8041,0xf6, , 1:1:2:2:3, 0,2000,enemy, 0x01A //MH_LAVA_SLIDE
8043,0xf7, , 1, 0,-1,enemy, 0x2018 //MH_VOLCANIC_ASH
@@ -181,7 +181,7 @@
8409,0xef, , 0, 1, -1,friend,0x2018 //EL_ZEPHYR
8412,0xf0, , 0, 1, -1,friend,0x2018 //EL_POWER_OF_GAIA
-10006,0xc1, , 2, 0, -1,sameguild, 0x040 //GD_LEADERSHIP
-10007,0xc2, , 2, 0, -1,sameguild, 0x040 //GD_GLORYWOUNDS
-10008,0xc3, , 2, 0, -1,sameguild, 0x040 //GD_SOULCOLD
-10009,0xc4, , 2, 0, -1,sameguild, 0x040 //GD_HAWKEYES
+10006,0xc1, , 2, 0, -1,sameguild, 0x040 //GD_LEADERSHIP
+10007,0xc2, , 2, 0, -1,sameguild, 0x040 //GD_GLORYWOUNDS
+10008,0xc3, , 2, 0, -1,sameguild, 0x040 //GD_SOULCOLD
+10009,0xc4, , 2, 0, -1,sameguild, 0x040 //GD_HAWKEYES
diff --git a/db/produce_db.txt b/db/produce_db.txt
index 83499bb53..4d8b1a2ca 100644
--- a/db/produce_db.txt
+++ b/db/produce_db.txt
@@ -186,7 +186,7 @@
12053,13,0,0,7474,0,966,20,961,10,518,1,7453,1
//-- Tentacle and Cheese Gratin <-- 10 Tentacle, 10 Cheese, 5 Yam, 1 Sweet Sauce
12058,13,0,0,7474,0,962,10,548,10,549,5,7453,1
-//-- Fried Sweet Potato with Syrup <-- 10 Potato, 10 Yam, 1 Sweet Potato, 1 Sweet Sauce
+//-- Fried Sweet Potato with Syrup <-- 10 Potato, 10 Yam, 1 Sweet Potato, 1 Sweet Sauce
12068,13,0,0,7474,0,516,10,549,10,633,1,7453,1
//--------------------LEVEL 4-----------
@@ -197,7 +197,7 @@
12054,14,0,0,7475,0,962,30,509,10,7194,10,7031,1,1024,20
//-- Rib with Herbs and Spices <-- 5 Meat, 3 Red Herb, 2 Yellow Herb, 3 Green Herb, 1 Sweet Sauce, 1 Lemon
12044,14,0,0,7475,0,517,5,507,3,508,2,511,3,7453,1,568,1
-//-- Cream Sandwich <-- 5 Bread, 15 Milk, 10 Cheese, 10 Yellow Herb, 1 Meat, 1 Sweet Sauce
+//-- Cream Sandwich <-- 5 Bread, 15 Milk, 10 Cheese, 10 Yellow Herb, 1 Meat, 1 Sweet Sauce
12064,14,0,0,7475,0,580,5,519,15,548,10,508,10,517,1,7453,1
//-- Lutie Mixed Cold Noodles <-- 3 Grain, 1 Hot Sauce, 10 Ice Cubic, 10 Carrot, 10 Jack o' Pumpkin
12059,14,0,0,7475,0,577,3,7455,1,7066,10,515,10,1062,10
@@ -471,7 +471,7 @@
1046,26,2494,1,955,40,753,5
//-- Petite DiablOfs Horn <-- GN_CHANGEMATERIAL Lv1, 5 Stone Heart, 10 Resin
1038,26,2494,1,953,5,907,10
-//-- Root Of Maneater <-- GN_CHANGEMATERIAL Lv1, 25 Talon, 20 Tooth Of
+//-- Root Of Maneater <-- GN_CHANGEMATERIAL Lv1, 25 Talon, 20 Tooth Of
1033,26,2494,1,917,25,1044,20
//-- Conch <-- GN_CHANGEMATERIAL Lv1, 5 Gill, 25 Immortal Heart
961,26,2494,1,956,5,929,25
diff --git a/db/quest_db.conf b/db/quest_db.conf
index a834d4294..221e9f248 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -1436,10 +1436,10 @@ quest_db: (
)
},
// New Novice Ground
-{
+/*{
Id: 2299
Name: "Training Center: Talk to Lisa"
-},
+},*/
{
Id: 2300
Name: "Training Center: Talk to General Reindeer"
@@ -12001,6 +12001,676 @@ quest_db: (
Id: 14141
Name: "Ingredients for research"
},
+// Academy 14.2
+{
+ Id: 1229
+ Name: "Swordsman training"
+},
+{
+ Id: 1230
+ Name: "Swordsman training"
+},
+{
+ Id: 1233
+ Name: "Swordsman training"
+},
+{
+ Id: 1234
+ Name: "Swordsman training"
+},
+{
+ Id: 1235
+ Name: "Swordsman training"
+},
+{
+ Id: 1236
+ Name: "Swordsman training"
+},
+{
+ Id: 1237
+ Name: "Shop guide"
+},
+{
+ Id: 1238
+ Name: "Shop guide"
+},
+{
+ Id: 1239
+ Name: "Shop guide"
+},
+{
+ Id: 1240
+ Name: "Shop guide"
+},
+{
+ Id: 2293
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2294
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2295
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2296
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2297
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2298
+ Name: "Adventurer's Companion"
+},
+{
+ Id: 2299
+ Name: "Rapid Completion Experience"
+},
+{
+ Id: 4268
+ Name: "Ninja trainer"
+},
+{
+ Id: 4269
+ Name: "Registration at the Academy"
+},
+{
+ Id: 4270
+ Name: "Ninja training - stat explanation"
+},
+{
+ Id: 4271
+ Name: "Ninja training-explanation about the skills"
+},
+{
+ Id: 4272
+ Name: "Ninja training- conversation about the skills"
+},
+{
+ Id: 4273
+ Name: "Ninja training- explanation about the weapons"
+},
+{
+ Id: 4274
+ Name: "Ninjas training- explanation about job change"
+},
+{
+ Id: 4275
+ Name: "Ninja training-Exercise1"
+ Targets: (
+ {
+ MobId: 1113
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4276
+ Name: "Ninja training-Exercise2"
+ Targets: (
+ {
+ MobId: 1002
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4277
+ Name: "Ninja training-Actual battle2"
+ Targets: (
+ {
+ MobId: 1052
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4278
+ Name: "Ninja training-Actual battle1"
+ Targets: (
+ {
+ MobId: 1024
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4279
+ Name: "Ninja training-test"
+},
+{
+ Id: 4280
+ Name: "Ninja training-test"
+},
+{
+ Id: 4281
+ Name: "Beginner's training-Ninja"
+},
+{
+ Id: 4282
+ Name: "Ninja training-exercise1"
+ Targets: (
+ {
+ MobId: 1113
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4283
+ Name: "Ninja training-exercise2"
+ Targets: (
+ {
+ MobId: 1002
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4284
+ Name: "Ninja training-actual battle2"
+ Targets: (
+ {
+ MobId: 1052
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4285
+ Name: "Ninja training-actual battle1"
+ Targets: (
+ {
+ MobId: 1024
+ Count: 10
+ },
+ )
+},
+{
+ Id: 4286
+ Name: "Ninja training-test"
+},
+{
+ Id: 4287
+ Name: "Ninja training-test"
+},
+{
+ Id: 5147
+ Name: "Gunslinger basic training(1)"
+},
+{
+ Id: 5148
+ Name: "Gunslinger basic training(2)"
+},
+{
+ Id: 5149
+ Name: "<Battle training request form A>"
+ Targets: (
+ {
+ MobId: 1004
+ Count: 10
+ },
+ )
+},
+{
+ Id: 5150
+ Name: "<Battle training request form B>"
+ Targets: (
+ {
+ MobId: 1012
+ Count: 10
+ },
+ )
+},
+{
+ Id: 5151
+ Name: "<Battle training request form C>"
+ Targets: (
+ {
+ MobId: 1167
+ Count: 10
+ },
+ )
+},
+{
+ Id: 5152
+ Name: "<Battle training request form D>"
+ Targets: (
+ {
+ MobId: 1052
+ Count: 10
+ },
+ )
+},
+{
+ Id: 5153
+ Name: "Refining tutorial (1)"
+},
+{
+ Id: 5154
+ Name: "Refining tutorial (2)"
+},
+{
+ Id: 5155
+ Name: "Refining tutorial (3)"
+},
+{
+ Id: 5156
+ Name: "Refining tutorial (4)"
+},
+{
+ Id: 5157
+ Name: "Enchant tutorial (1)"
+},
+{
+ Id: 5158
+ Name: "Entchant tutorial (2)"
+},
+{
+ Id: 5159
+ Name: "Enchant tutorial (3)"
+},
+{
+ Id: 7471
+ Name: "First time talking after being born"
+},
+{
+ Id: 7472
+ Name: "First step towards a new world"
+},
+{
+ Id: 7473
+ Name: "Cool drink"
+},
+{
+ Id: 7474
+ Name: "Searching for treasure"
+},
+{
+ Id: 7475
+ Name: "Discovered the Airship"
+},
+{
+ Id: 7476
+ Name: "Discovered the Arena"
+},
+{
+ Id: 7477
+ Name: "Bridge to Prontera"
+},
+{
+ Id: 7478
+ Name: "Basic Medical Botany"
+},
+{
+ Id: 7479
+ Name: "Friend or Foe?"
+},
+{
+ Id: 7480
+ Name: "Regarding Thief job"
+},
+{
+ Id: 7481
+ Name: "Vicente's class"
+},
+{
+ Id: 7482
+ Name: "Vercassel's class"
+},
+{
+ Id: 7483
+ Name: "Use the Thief Manual"
+},
+{
+ Id: 7484
+ Name: "Shop owner! Order to steal!"
+},
+{
+ Id: 7485
+ Name: "Assassin! Use Envenom"
+ Targets: (
+ {
+ MobId: 1725
+ Count: 1
+ },
+ )
+},
+{
+ Id: 7486
+ Name: "With Lumin"
+},
+{
+ Id: 7487
+ Name: "30 second duel"
+ TimeLimit: 30
+ Targets: (
+ {
+ MobId: 1725
+ Count: 4
+ },
+ )
+
+},
+{
+ Id: 7488
+ Name: "Trio set of Fire Elements"
+},
+{
+ Id: 7489
+ Name: "Silent liquidation plan"
+},
+{
+ Id: 7490
+ Name: "Mushroom soup calling memories"
+},
+{
+ Id: 7491
+ Name: "Get away to Paradise!"
+},
+{
+ Id: 7492
+ Name: "Invincible pumpkin knight"
+},
+{
+ Id: 7493
+ Name: "Battle of 17 vs. 1"
+},
+{
+ Id: 7494
+ Name: "Cleanup of the mushroom farm"
+},
+{
+ Id: 9264
+ Name: "Job change to Mage"
+},
+{
+ Id: 9265
+ Name: "Job change to Mage"
+},
+{
+ Id: 9266
+ Name: "Job change to Mage"
+},
+{
+ Id: 9267
+ Name: "The way to be a strong Mage - 1"
+},
+{
+ Id: 9268
+ Name: "The way to be a strong Mage - 2"
+},
+{
+ Id: 9269
+ Name: "The way to be a strong Mage - 3"
+},
+{
+ Id: 9270
+ Name: "The way to be a strong Mage - 4"
+},
+{
+ Id: 11255
+ Name: "Otter Ssamsun"
+},
+{
+ Id: 11338
+ Name: "Conversation with Subino"
+},
+{
+ Id: 11339
+ Name: "The most delicious on earth"
+ Targets: (
+ {
+ MobId: 1002
+ Count: 10
+ },
+ )
+},
+{
+ Id: 11340
+ Name: "Carrots are delicious!"
+ Targets: (
+ {
+ MobId: 1063
+ Count: 10
+ },
+ )
+},
+{
+ Id: 11341
+ Name: "Rolling Fabre's clothing"
+ Targets: (
+ {
+ MobId: 1007
+ Count: 10
+ },
+ )
+},
+{
+ Id: 11342
+ Name: "Antidote Material~"
+ Targets: (
+ {
+ MobId: 1004
+ Count: 10
+ },
+ )
+},
+{
+ Id: 11343
+ Name: "Conversation with Alice"
+},
+{
+ Id: 11344
+ Name: "Barrier!!"
+ Targets: (
+ {
+ MobId: 1008
+ Count: 5
+ },
+ )
+},
+{
+ Id: 11345
+ Name: "Conversation with Alice"
+},
+{
+ Id: 11346
+ Name: "Acolyte_damped creatures(LV.13)"
+},
+{
+ Id: 11347
+ Name: "Acolyte_soft bone(LV.18)"
+},
+{
+ Id: 11348
+ Name: "Acolyte_Solid bone(LV.23)"
+},
+{
+ Id: 12302
+ Name: "Salim Hamid"
+},
+{
+ Id: 12303
+ Name: "Applicant for trader"
+},
+{
+ Id: 12304
+ Name: "Introduction to merchantology"
+},
+{
+ Id: 12305
+ Name: "About the capability figure"
+},
+{
+ Id: 12306
+ Name: "Experience of disounts"
+},
+{
+ Id: 12307
+ Name: "Way to the Merchant"
+},
+{
+ Id: 12308
+ Name: "Removal of Worm Tails"
+},
+{
+ Id: 12309
+ Name: "Removal of Boa"
+},
+{
+ Id: 12310
+ Name: "Removal of Spore"
+},
+{
+ Id: 12311
+ Name: "Removal of Pirate Skeletons"
+},
+{
+ Id: 12312
+ Name: "Supplementary to the theory lesson"
+},
+{
+ Id: 12313
+ Name: "About stats"
+},
+{
+ Id: 12314
+ Name: "About skills"
+},
+{
+ Id: 13101
+ Name: "The way of Taekwon"
+},
+{
+ Id: 13102
+ Name: "Spinning kick"
+},
+{
+ Id: 13103
+ Name: "Breaking Willows"
+},
+{
+ Id: 13104
+ Name: "Breaking Spores"
+},
+{
+ Id: 13105
+ Name: "Breaking Zombies"
+},
+{
+ Id: 13106
+ Name: "Breaking Skeletons"
+},
+{
+ Id: 14142
+ Name: "To the Archer's town!"
+},
+{
+ Id: 14143
+ Name: "Application for the Archer's job change"
+},
+{
+ Id: 14144
+ Name: "Retest - Stats"
+},
+{
+ Id: 14145
+ Name: "Archer Skills"
+},
+{
+ Id: 14146
+ Name: "Hunting training"
+},
+{
+ Id: 14147
+ Name: "Retest - Skills"
+},
+{
+ Id: 14148
+ Name: "To the next step"
+},
+{
+ Id: 14149
+ Name: "Listening to the 2nd job change"
+},
+{
+ Id: 14150
+ Name: "To the next step"
+},
+{
+ Id: 14151
+ Name: "Hunting training - Spoa"
+},
+{
+ Id: 14152
+ Name: "Hunting training - Creamy"
+},
+{
+ Id: 14153
+ Name: "Hunting training - Skeleton"
+},
+{
+ Id: 14154
+ Name: "Fragrant herb mix"
+},
+{
+ Id: 14155
+ Name: "Crunchy salad"
+},
+{
+ Id: 14156
+ Name: "Anything shabushabu"
+},
+{
+ Id: 14157
+ Name: "Baked golden apple"
+},
+{
+ Id: 14158
+ Name: "Presentation of the Archer manual"
+},
+{
+ Id: 14159
+ Name: "Met with the PR staff"
+},
+{
+ Id: 14160
+ Name: "Met with the PR staff"
+},
+{
+ Id: 14161
+ Name: "Test of stats"
+},
+{
+ Id: 14162
+ Name: "Test of skills"
+},
+{
+ Id: 14163
+ Name: "Caught Spores"
+},
+{
+ Id: 14164
+ Name: "Caught Creamy"
+},
+{
+ Id: 14165
+ Name: "Caught Skeletons"
+},
+{
+ Id: 15000
+ Name: "Experiencing abnormal statuses"
+},
+{
+ Id: 15001
+ Name: "Hold your breath"
+ TimeLimit: 20
+},
// 2014 Halloween Event
{
Id: 14450
diff --git a/db/re/exp_homun.txt b/db/re/exp_homun.txt
index 3c479cfa4..f74c5016c 100644
--- a/db/re/exp_homun.txt
+++ b/db/re/exp_homun.txt
@@ -148,4 +148,4 @@
8922000
8966000
9094000
-0
+0
diff --git a/db/re/item_chain.conf b/db/re/item_chain.conf
index 744b1cbcf..57eaef05e 100644
--- a/db/re/item_chain.conf
+++ b/db/re/item_chain.conf
@@ -1,22 +1,20 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
// Structure of file:
/*
-
ITMCHAIN_<Name>: {
<Item_Name>: <chance>
}
-
*/
ITMCHAIN_ORE: {
@@ -39,7 +37,7 @@ ITMCHAIN_ORE: {
Elunium: 20
Oridecon: 20
Gold: 10
- Emperium: 5
+ Emperium: 5
}
ITMCHAIN_GEM: {
@@ -58,7 +56,7 @@ ITMCHAIN_GEM: {
Crystal_Jewel: 150
Crystal_Jewel_: 80
Crystal_Jewel__: 50
- Crystal_Jewel___: 30
+ Crystal_Jewel___: 30
}
ITMCHAIN_HEAL: {
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 53d217551..c00cc9d9b 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -21094,9 +21094,9 @@ item_db: (
bonus2 bAddRaceTolerance,RC_NonBoss,30;
bonus2 bAddRaceTolerance,RC_Boss,30;
bonus bUnbreakableShield,0;
-/* When you receive Melee Physical damage, chance of casting Protective Light for 60 seconds. */
-/* Cancels Stun, Sleep, Curse, Stone Curse, Poison, Blind, Silence, Bleeding, Chaos, and Frozen. */
-/* Protects the user against such effects for a set duration. */
+/* When you receive Melee Physical damage, chance of casting Protective Light for 60 seconds. */
+/* Cancels Stun, Sleep, Curse, Stone Curse, Poison, Blind, Silence, Bleeding, Chaos, and Frozen. */
+/* Protects the user against such effects for a set duration. */
">
},
{
@@ -40704,7 +40704,7 @@ item_db: (
bonus bInt,1;
bonus bIgnoreMdefRate,2;
bonus bIgnoreMdefRate,getrefine()/4;
- }
+ }
">
},
{
@@ -41726,7 +41726,7 @@ item_db: (
Loc: 16
Script: <"
bonus bAtk,30;
- /* When attacked by enemy, drain 5 SP from user. */
+ /* When attacked by enemy, drain 5 SP from user. */
">
},
{
@@ -48393,8 +48393,7 @@ item_db: (
Loc: 256
View: 341
Script: <"
-
- bonus bLuk,3;
+ bonus bLuk,3;
bonus2 bAddRaceTolerance,RC_Angel, 5;
bonus2 bAddRace,RC_Angel, 5;
bonus2 bMagicAddRace,RC_Angel,5;
@@ -57747,7 +57746,7 @@ item_db: (
bonus2 bSubEle,Ele_Neutral,5;
bonus2 bAddRaceTolerance,RC_Dragon,5;
bonus2 bHPLossRate,600,4000;
- bonus3 bAutoSpellWhenHit,HP_ASSUMPTIO,5,20; /* Custom - IRO */
+ bonus3 bAutoSpellWhenHit,HP_ASSUMPTIO,5,20; /* Custom - IRO */
bonus bUnbreakableHelm,0;
">
},
@@ -57852,7 +57851,7 @@ item_db: (
EquipLv: 10
View: 1105
Script: <"
- bonus5 bAutoSpell,DC_SCREAM,5,50,BF_WEAPON|BF_MAGIC,0; /* Custom - TWRO */
+ bonus5 bAutoSpell,DC_SCREAM,5,50,BF_WEAPON|BF_MAGIC,0; /* Custom - TWRO */
">
},
{
@@ -64478,8 +64477,8 @@ item_db: (
},
{
Id: 6593
- AegisName: "Cryptura_Hair_Coupon"
- Name: "Kuritura Hairstyle Coupon"
+ AegisName: "Criatura_Hair_Coupon"
+ Name: "Criatura Hair Coupon"
Buy: 0
Trade: {
nodrop: true
@@ -75013,6 +75012,13 @@ item_db: (
Weight: 10
},
{
+ Id: 11060
+ AegisName: "Energy_Xtal_Combi_Book"
+ Name: "Energy Crystal Book"
+ Buy: 0
+ Weight: 10
+},
+{
Id: 11500
AegisName: "Light_Yellow_Pot"
Name: "Light Yellow Potion"
@@ -85893,6 +85899,39 @@ item_db: (
">
},
{
+ Id: 12845
+ AegisName: "Amatsu_Butterfly_Wing"
+ Name: "Amatsu Butterfly Wing"
+},
+{
+ Id: 12846
+ AegisName: "Little_Unripe_Apple"
+ Name: "Little Unripe Apple"
+ Type: 2
+ Buy: 10
+ Weight: 50
+ Nouse: {
+ sitting: true
+ }
+ Script: <" pet 2398; ">
+},
+{
+ Id: 12847
+ AegisName: "Old_Equipment_Box"
+ Name: "Old Equipment Box"
+ Type: 0
+ Weight: 10
+ Trade: {
+ nodrop: true
+ notrade: true
+ noselltonpc: true
+ nocart: true
+ nogstorage: true
+ nomail: true
+ noauction: true
+ }
+},
+{
Id: 12848
AegisName: "Falcon_Flute"
Name: "Falcon Flute"
@@ -112187,7 +112226,7 @@ item_db: (
Loc: 16
EquipLv: 105
Script: <"
- bonus3 bAutoSpell,DC_WINKCHARM,1,20; /* Custom - IDRO */
+ bonus3 bAutoSpell,DC_WINKCHARM,1,20; /* Custom - IDRO */
if(getrefine()>4) { bonus bCritAtkRate,4; }
if(getrefine()>6) { bonus bCritAtkRate,6; }
">
@@ -117780,7 +117819,7 @@ item_db: (
bonus bMdef,3;
bonus bHit,10;
bonus bDelayrate,-5;
- if(getrefine()>6) { bonus2 bAddMonsterDropItem,522,(getrefine()*100)-600; } /* Custom - KRO */
+ if(getrefine()>6) { bonus2 bAddMonsterDropItem,522,(getrefine()*100)-600; } /* Custom - KRO */
">
},
{
@@ -118514,7 +118553,6 @@ item_db: (
EquipLv: 10
View: 729
Script: <"
-
bonus bMdef,3;
bonus2 bAddRaceTolerance,RC_Dragon,5;
bonus2 bAddRace,RC_Dragon,5;
@@ -119308,9 +119346,9 @@ item_db: (
EquipLv: 10
View: 766
Script: <"
- bonus bMdef,3;
- autobonus "{ bonus bAtkEle,Ele_Dark; }",30,60000;
- bonus2 bSubEle,Ele_Holy,-10;
+ bonus bMdef,3;
+ autobonus "{ bonus bAtkEle,Ele_Dark; }",30,60000;
+ bonus2 bSubEle,Ele_Holy,-10;
bonus2 bSubRace,RC_Angel,-10;
">
},
@@ -120023,7 +120061,7 @@ item_db: (
EquipLv: 80
View: 804
Script: <"
- bonus2 bHPDrainRate,10*(5+1*(getrefine()>7)+2*(getrefine()>8)+2*(getrefine()>9)),1+2*(getrefine()>5)+2*(getrefine()>7)+3*(getrefine()>9);
+ bonus2 bHPDrainRate,10*(5+1*(getrefine()>7)+2*(getrefine()>8)+2*(getrefine()>9)),1+2*(getrefine()>5)+2*(getrefine()>7)+3*(getrefine()>9);
bonus2 bSPDrainRate,10*(5+1*(getrefine()>8)+2*(getrefine()>9)),1+(getrefine()>7)+2*(getrefine()>9);
">
},
@@ -120363,9 +120401,9 @@ item_db: (
Loc: 256
View: 11
Script: <"
- bonus bAgi,3;
- bonus bAspdRate,1;
- bonus2 bSPLossRate,5,10000;
+ bonus bAgi,3;
+ bonus bAspdRate,1;
+ bonus2 bSPLossRate,5,10000;
">
},
{
@@ -120745,7 +120783,7 @@ item_db: (
Refine: false
View: 844
Script: <"
- bonus2 bSubRace,RC_Fish,15;
+ bonus2 bSubRace,RC_Fish,15;
bonus3 bAddMonsterDropItem,579,RC_Fish,5;
">
},
@@ -121163,7 +121201,7 @@ item_db: (
},
{
Id: 18730
- AegisName: "Cryptura_Academy_Hat"
+ AegisName: "Criatura_Academy_Hat"
Name: "Criatura Hat"
Type: 5
Buy: 100
@@ -121404,7 +121442,6 @@ item_db: (
Loc: 256
View: 888
Script: <"
-
bonus bStr,2;
bonus bMaxHP,100;
">
@@ -122066,7 +122103,7 @@ item_db: (
EquipLv: 20
View: 899
Script: <"
- bonus2 bAddMonsterDropItem,921,100+((getrefine()/2)*20); /* Custom - JRO */
+ bonus2 bAddMonsterDropItem,921,100+((getrefine()/2)*20); /* Custom - JRO */
bonus2 bAddMonsterDropItem,7033,100+((getrefine()/2)*20);
">
},
@@ -122167,7 +122204,7 @@ item_db: (
bonus2 bSkillAtk,WL_CHAINLIGHTNING,5;
bonus2 bIgnoreMdefRate,RC_NonBoss,10;
bonus2 bIgnoreMdefRate,RC_NonBoss,getrefine()*2;
- if(getrefine()>6) {
+ if(getrefine()>6) {
bonus2 bSkillAtk,WL_CRIMSONROCK,5;
bonus2 bSkillAtk,WL_JACKFROST,5;
bonus2 bSkillAtk,WL_EARTHSTRAIN,5;
@@ -123663,7 +123700,7 @@ item_db: (
View: 1034
Script: <"
bonus bAllStats,1;
- bonus5 bAutoSpellWhenHit,AL_RUWACH,1,50,BF_WEAPON,0; /* Custom - PRO */
+ bonus5 bAutoSpellWhenHit,AL_RUWACH,1,50,BF_WEAPON,0; /* Custom - PRO */
">
},
{
@@ -123679,7 +123716,7 @@ item_db: (
View: 1035
Script: <"
bonus bAllStats,1;
- bonus5 bAutoSpellWhenHit,AL_RUWACH,1,50,BF_WEAPON,0; /* Custom - PRO */
+ bonus5 bAutoSpellWhenHit,AL_RUWACH,1,50,BF_WEAPON,0; /* Custom - PRO */
">
},
{
@@ -123785,7 +123822,7 @@ item_db: (
View: 1065
Script: <"
bonus bDex,2;
- bonus5 bAutoSpellWhenHit,WZ_STORMGUST,5,50,BF_WEAPON,0; /* Custom - IRO */
+ bonus5 bAutoSpellWhenHit,WZ_STORMGUST,5,50,BF_WEAPON,0; /* Custom - IRO */
if(getrefine()>=8) { bonus bDex,1+((getrefine()/2)-4); }
">
},
@@ -123997,8 +124034,8 @@ item_db: (
bonus bStr,3;
bonus bAtkRate,4;
if(BaseLevel<100) { bonus bStr,getrefine()/2; } else { bonus bStr,getrefine(); }
- /* +Giant Lance, when using Joint Beat, auto cast Lv.1 Spiral pierce, */
- /* every refine of lance increase the chance of trigger and increase damage of spiral pierce by 5%. */
+ /* +Giant Lance, when using Joint Beat, auto cast Lv.1 Spiral pierce, */
+ /* every refine of lance increase the chance of trigger and increase damage of spiral pierce by 5%. */
">
},
{
@@ -124015,7 +124052,7 @@ item_db: (
bonus bDefRate,-50;
bonus bMdefRate,-50;
bonus2 bSubRace,RC_Insect,getrefine();
- bonus3 bAutoSpell,NPC_WIDECONFUSE,2,100+(getrefine()*10); /* Custom - JRO */
+ bonus3 bAutoSpell,NPC_WIDECONFUSE,2,100+(getrefine()*10); /* Custom - JRO */
">
},
{
@@ -124965,8 +125002,7 @@ item_db: (
Refine: false
View: 712
Script: <"
-
- bonus bUnbreakableHelm,0;
+ bonus bUnbreakableHelm,0;
bonus2 bAddRaceTolerance,RC_Angel,1;
bonus2 bAddRaceTolerance,RC_Demon,1;
bonus3 bAddMonsterDropItem,523,RC_Angel,400;
@@ -132001,7 +132037,7 @@ item_db: (
View: 3
Script: <"
bonus bCritAtkRate,getrefine()*2;
- bonus3 bAutoSpell,NPC_CRITICALWOUND,1,50; /* Custom - JRO */
+ bonus3 bAutoSpell,NPC_CRITICALWOUND,1,50; /* Custom - JRO */
">
},
{
diff --git a/db/re/item_group.conf b/db/re/item_group.conf
index 699be4048..82a17a339 100644
--- a/db/re/item_group.conf
+++ b/db/re/item_group.conf
@@ -1,19 +1,19 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
// Structure of file:
/*
<Container_Item_Name>: (
- "Item_Name" or
+ "Item_Name" or
("Item_Name",Repeat_Count)
)
*/
diff --git a/db/re/item_packages.conf b/db/re/item_packages.conf
index 8fc9a2e17..0c90d737c 100644
--- a/db/re/item_packages.conf
+++ b/db/re/item_packages.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1244-official-item-grouppackagechain
//====================================================
diff --git a/db/re/job_db.conf b/db/re/job_db.conf
index 38d79597b..d7a2e6679 100644
--- a/db/re/job_db.conf
+++ b/db/re/job_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/9082-job-db1txt-redesign/
//============== RE Structure Example ================
@@ -92,7 +92,7 @@ Novice: {
121, 122, 123, 124, 125, 126, 127, 128, 129, 130, // 121 - 130
131, 132, 133, 134, 135, 136, 137, 138, 139, 140, // 131 - 140
141, 142, 143, 144, 145, 146, 147, 148, 149, 150, // 141 - 150
- 151, 152, 153, 154, 155, 156, 157, 158, 159, 160] // 151 - 160
+ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160] // 151 - 160
}
Swordsman: {
Weight: 28000
@@ -139,7 +139,7 @@ Swordsman: {
232, 234, 236, 238, 240, 242, 244, 246, 248, 250, // 111 - 120
252, 254, 256, 258, 260, 262, 264, 266, 268, 270, // 121 - 130
272, 274, 276, 278, 280, 282, 284, 286, 288, 290, // 131 - 140
- 292, 294, 296, 298, 300, 302, 304, 306, 308, 310] // 141 - 150
+ 292, 294, 296, 298, 300, 302, 304, 306, 308, 310] // 141 - 150
}
Magician: {
Weight: 22000
@@ -180,7 +180,7 @@ Magician: {
676, 682, 688, 694, 700, 706, 712, 718, 724, 730, // 111 - 120
736, 742, 748, 754, 760, 766, 772, 778, 784, 790, // 121 - 130
796, 802, 808, 814, 820, 826, 832, 838, 844, 850, // 131 - 140
- 856, 862, 868, 874, 880, 886, 892, 898, 904, 910] // 141 - 150
+ 856, 862, 868, 874, 880, 886, 892, 898, 904, 910] // 141 - 150
}
Archer: {
Weight: 26000
@@ -248,7 +248,7 @@ Acolyte: {
565, 570, 575, 580, 585, 590, 595, 600, 605, 610, // 111 - 120
615, 620, 625, 630, 635, 640, 645, 650, 655, 660, // 121 - 130
665, 670, 675, 680, 685, 690, 695, 700, 705, 710, // 131 - 140
- 715, 720, 725, 730, 735, 740, 745, 750, 755, 760] // 141 - 150
+ 715, 720, 725, 730, 735, 740, 745, 750, 755, 760] // 141 - 150
}
Merchant: {
Weight: 28000
@@ -277,7 +277,7 @@ Merchant: {
343, 346, 349, 352, 355, 358, 361, 364, 367, 370, // 111 - 120
373, 376, 379, 382, 385, 388, 391, 394, 397, 400, // 121 - 130
403, 406, 409, 412, 415, 418, 421, 424, 427, 430, // 131 - 140
- 433, 436, 439, 442, 445, 448, 451, 454, 457, 460] // 141 - 150
+ 433, 436, 439, 442, 445, 448, 451, 454, 457, 460] // 141 - 150
}
Thief: {
Weight: 24000
@@ -405,7 +405,7 @@ Wizard: {
1009, 1018, 1027, 1036, 1045, 1054, 1063, 1072, 1081, 1090, // 111 - 120
1099, 1108, 1117, 1126, 1135, 1144, 1153, 1162, 1171, 1180, // 121 - 130
1189, 1198, 1207, 1216, 1225, 1234, 1243, 1252, 1261, 1270, // 131 - 140
- 1279, 1288, 1297, 1306, 1315, 1324, 1333, 1342, 1351, 1360] // 141 - 150
+ 1279, 1288, 1297, 1306, 1315, 1324, 1333, 1342, 1351, 1360] // 141 - 150
}
Blacksmith: {
Weight: 30000
@@ -547,7 +547,7 @@ Crusader: {
531, 536, 541, 545, 550, 555, 559, 564, 569, 574, // 111 - 120
578, 583, 588, 592, 597, 602, 606, 611, 616, 621, // 121 - 130
625, 630, 635, 639, 644, 649, 653, 658, 663, 668, // 131 - 140
- 672, 677, 682, 686, 691, 696, 700, 705, 710, 715] // 141 - 150
+ 672, 677, 682, 686, 691, 696, 700, 705, 710, 715] // 141 - 150
}
Rogue: {
Weight: 24000
@@ -721,7 +721,7 @@ Taekwon: {
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 111 - 120
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 121 - 130
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, // 131 - 140
- 200, 200, 200, 200, 200, 200, 200, 200, 200, 200] // 141 - 150
+ 200, 200, 200, 200, 200, 200, 200, 200, 200, 200] // 141 - 150
}
Star_Gladiator: {
Inherit: ("Taekwon")
@@ -754,7 +754,7 @@ Star_Gladiator: {
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 111 - 120
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 121 - 130
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, // 131 - 140
- 500, 500, 500, 500, 500, 500, 500, 500, 500, 500] // 141 - 150
+ 500, 500, 500, 500, 500, 500, 500, 500, 500, 500] // 141 - 150
}
Soul_Linker: {
Weight: 24000
@@ -794,7 +794,7 @@ Soul_Linker: {
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 111 - 120
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 121 - 130
900, 900, 900, 900, 900, 900, 900, 900, 900, 900, // 131 - 140
- 900, 900, 900, 900, 900, 900, 900, 900, 900, 900] // 141 - 150
+ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900] // 141 - 150
}
Gunslinger: {
Weight: 28000
@@ -822,7 +822,7 @@ Gunslinger: {
528, 534, 540, 546, 552, 558, 564, 570, 576, 582, // 111 - 120
588, 594, 600, 606, 612, 618, 624, 630, 636, 642, // 121 - 130
648, 654, 660, 666, 672, 678, 684, 690, 696, 702, // 131 - 140
- 708, 714, 720, 726, 732, 738, 744, 750, 756, 762] // 141 - 150
+ 708, 714, 720, 726, 732, 738, 744, 750, 756, 762] // 141 - 150
}
Ninja: {
Weight: 26000
@@ -912,7 +912,7 @@ Rune_Knight: {
Mace: 45
TwoHandMace: 52
Shield: 5
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -959,7 +959,7 @@ Warlock: {
Rod: 50
TwoHandRod: 56
Shield: 5
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1004,7 +1004,7 @@ Ranger: {
Dagger: 50
Bow: 49
Shield: 8
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1102,7 +1102,7 @@ Mechanic: {
Mace: 48
TwoHandMace: 50
Shield: 6
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1154,7 +1154,7 @@ Guillotine_Cross: {
/* GrenadeLauncher: 100 */
/* FuumaShuriken: 110 */
Shield: 9
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1284,7 +1284,7 @@ Sorcerer: {
Book: 45
TwoHandRod: 55
Shield: 5
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1358,7 +1358,7 @@ Wanderer: {
Bow: 49
Whip: 44
Shield: 7
- }
+ }
}
Sura: {
Weight: 30000
@@ -1371,7 +1371,7 @@ Sura: {
Knuckle: 39
TwoHandRod: 50
Shield: 5
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1403,7 +1403,7 @@ Genetic: {
Mace: 44
TwoHandMace: 48
Shield: 4
- }
+ }
HPTable:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 1 - 10
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, // 11 - 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, // 21 - 30
@@ -1501,7 +1501,7 @@ Oboro: {
}
Rebellion: {
Inherit: ("Gunslinger")
- InheritHP: ("Soul_Linker")
+ InheritHP: ("Soul_Linker")
}
Novice_High: {
Inherit: ("Novice")
@@ -1712,4 +1712,4 @@ Expanded_Super_Novice: {
}
Expanded_Super_Baby: {
Inherit: ("Novice")
-} \ No newline at end of file
+}
diff --git a/db/re/level_penalty.txt b/db/re/level_penalty.txt
index 81b33c141..882aca91b 100644
--- a/db/re/level_penalty.txt
+++ b/db/re/level_penalty.txt
@@ -7,7 +7,7 @@
// 1=experience, 2=item drop
// RACE:
// 0=Formless, 1=Undead, 2=Brute, 3=Plant, 4=Insect,
-// 5=Fish, 6=Demon, 7=Demi-Human, 8=Angel, 9=Dragon,
+// 5=Fish, 6=Demon, 7=Demi-Human, 8=Angel, 9=Dragon,
// 10=Boss monsters, 11=Normal monsters
//
// Note: RENEWAL_DROP and/or RENEWAL_EXP must be enabled.
diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf
index be7d3317a..0622368a6 100644
--- a/db/re/map_zone_db.conf
+++ b/db/re/map_zone_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//====================================================
//= Hercules Map Zone Database [Ind/Hercules]
//================ More Information ==================
@@ -24,7 +24,6 @@
//= PLAYER, HOMUN, MERCENARY, MONSTER, PET, ELEMENTAL, MOB_BOSS, CLONE, ALL and NONE
//====================================================
-
zones: (
{
/* All zone is a dynamic (very special) zone that is forcebly inherited by ALL maps automatically */
@@ -41,10 +40,10 @@ zones: (
//Apple: true
//ID501: true
}
-
+
mapflags: (
)
-
+
/* "command:min-group-lv-to-override" e.g. "heal: 70" */
disabled_commands: {
//Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
@@ -61,7 +60,7 @@ zones: (
/* Normal zone is applied to all maps that are not pkable (where players cant fight each other) */
/* However, it wont be applied to maps with its own zones (specified through mapflag) */
name: "Normal" /* changing this name requires MAP_ZONE_NORMAL_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
WM_LULLABY_DEEPSLEEP: "PLAYER"
WM_SIRCLEOFNATURE: "PLAYER"
@@ -69,7 +68,7 @@ zones: (
SO_ARRULLO: "PLAYER"
CG_HERMODE: "PLAYER"
}
-
+
disabled_items: {
Velum_Jamadhar: true
Velum_Scare: true
@@ -106,22 +105,22 @@ zones: (
}
mapflags: (
)
-
+
},
{
/* PvP zone is applied to all maps with a pvp mapflag */
name: "PvP" /* changing this name requires MAP_ZONE_PVP_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
BS_GREED: "PLAYER"
CG_HERMODE: "PLAYER"
}
-
+
disabled_items: {
Greed_Scroll: true
C_Beginner_Cap: true
}
-
+
/* cashshop disabled in pvp maps */
mapflags: (
"nocashshop",
@@ -131,13 +130,13 @@ zones: (
/* PK Mode zone is only used when server is on pk_mode (battle.conf),
it applies to all pvp maps that don't have their own zone */
name: "PK Mode" /* changing this name requires MAP_ZONE_PK_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
-
+
}
-
+
disabled_items: {
-
+
}
/* PK Mode Damage Reductions */
@@ -157,7 +156,7 @@ zones: (
{
/* GvG zone is applied to all maps with a gvg mapflag */
name: "GvG" /* changing this name requires MAP_ZONE_GVG_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER"
AL_WARP: "PLAYER"
@@ -177,7 +176,7 @@ zones: (
SC_FATALMENACE: "PLAYER"
SC_DIMENSIONDOOR: "PLAYER"
}
-
+
disabled_items: {
Assumptio_5_Scroll: true
Greed_Scroll: true
@@ -235,12 +234,12 @@ zones: (
"nocashshop",
"gvg_noparty",
)
-
+
},
{
/* Battlegrounds zone is applied to all maps with a battlegrounds mapflag */
name: "Battlegrounds" /* changing this name requires MAP_ZONE_BG_NAME to also be changed in src/map/map.h file */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER"
AL_WARP: "PLAYER"
@@ -312,8 +311,8 @@ zones: (
Siege_Suits: true
Siege_Robe: true
C_Beginner_Cap: true
- }
-
+ }
+
/* knockback disabled */
/* Battlegrounds Damage Reductions */
/* - weapon_damage_rate -30% */
@@ -333,7 +332,7 @@ zones: (
},
{
name: "Aldebaran Turbo Track"
-
+
disabled_skills: {
SM_ENDURE: "PLAYER"
AL_TELEPORT: "PLAYER"
@@ -354,7 +353,7 @@ zones: (
SC_DIMENSIONDOOR: "PLAYER"
GN_CARTBOOST: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
Anodyne: true
@@ -364,12 +363,12 @@ zones: (
},
{
name: "Jail"
-
+
disabled_skills: {
TK_JUMPKICK: "PLAYER"
TK_HIGHJUMP: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
Wing_Of_Butterfly: true
@@ -382,14 +381,14 @@ zones: (
},
{
name: "Izlude Battle Arena"
-
+
disabled_skills: {
RG_INTIMIDATE: "PLAYER"
AL_TELEPORT: "PLAYER"
SC_FATALMENACE: "PLAYER"
- SC_DIMENSIONDOOR: "PLAYER"
+ SC_DIMENSIONDOOR: "PLAYER"
}
-
+
disabled_items: {
Wing_Of_Fly: true
}
@@ -397,7 +396,7 @@ zones: (
{
name: "GvG2"
inherit: ( "GvG" ) /* will import all gvg has */
-
+
disabled_skills: {
TK_HIGHJUMP: "PLAYER"
SA_ABRACADABRA: "PLAYER"
@@ -405,7 +404,7 @@ zones: (
},
{
name: "Sealed Shrine"
-
+
disabled_skills: {
MG_SAFETYWALL: "PLAYER"
AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
@@ -418,7 +417,7 @@ zones: (
},
{
name: "Memorial Dungeon" /* ETower, Orc's Memory, Nidhoggur's Nest, etc */
-
+
disabled_skills: {
AL_TELEPORT: "PLAYER | MONSTER | HOMUN | MERCENARY"
WZ_ICEWALL: "PLAYER"
@@ -431,7 +430,7 @@ zones: (
},
{
name: "Towns"
-
+
disabled_skills: {
AM_CANNIBALIZE: "PLAYER"
AM_SPHEREMINE: "PLAYER"
@@ -441,7 +440,7 @@ zones: (
WM_POEMOFNETHERWORLD: "PLAYER"
GN_WALLOFTHORN: "PLAYER"
}
-
+
disabled_items: {
Greed_Scroll: true
Velum_Jamadhar: true
diff --git a/db/re/mob_db.txt b/db/re/mob_db.txt
index d1f21667a..a212b3632 100644
--- a/db/re/mob_db.txt
+++ b/db/re/mob_db.txt
@@ -1547,7 +1547,7 @@
//2395,SEIREN
//2396,POSEIDON
//2397,KRAKEN_BABY
-2398,LITTLE_PORING,LITTLE_PORING,Baby Poring,1,40,1,18,10,1,8,1,2,5,6,1,1,0,6,5,10,12,0,3,21,0x0,400,1872,672,480,0,0,0,0,0,0,0,909,9000,1202,100,938,1000,512,5000,507,1000,512,500,507,1000,0,0,0,0,4545,100
+2398,LITTLE_PORING,LITTLE_PORING,Baby Poring,1,40,1,18,10,1,8,1,2,5,6,1,1,0,6,5,10,12,0,3,21,0x83,400,1872,672,480,0,0,0,0,0,0,0,909,9000,1202,100,938,1000,512,5000,507,1000,512,500,507,1000,0,0,0,0,4545,100
//2399,E_MINI_DEMON
//2400,E_DIABOLIC
2401,G_PORING,G_PORING,Poring,1,60,1,0,0,1,8,1,2,5,6,1,1,0,6,5,10,12,1,3,21,0x0,400,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@@ -2363,6 +2363,7 @@
//3353,PAD_PLESIOS
//3354,PAD_BRACHY
//3355,PAD_BRACHYS
+
// 2014 Halloween Event
3381,DARK_SOUL,Dark Soul,Dark Soul,10,20,1,0,0,1,20,20,0,0,1,1,1,1,1,1,0,0,1,6,27,0x81,100,1960,960,504,0,0,0,0,0,0,0,12192,2000,6914,4000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
3382,WANDERING_SOUL,Wandering Soul,Wandering Soul,1,10,1,0,0,1,10,10,0,0,1,1,1,1,1,1,0,0,1,6,28,0x81,100,912,1248,576,0,0,0,0,0,0,0,12192,2000,6915,4000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
diff --git a/db/re/mob_skill_db.txt b/db/re/mob_skill_db.txt
index 04c870045..a521a348a 100644
--- a/db/re/mob_skill_db.txt
+++ b/db/re/mob_skill_db.txt
@@ -1,4 +1,4 @@
-// Mob Skill Database
+// Mob Skill Database
// Based on Aegis Episode 14.2
//
// Structure of Database:
@@ -4202,7 +4202,7 @@
1794,Roween@NPC_COMBOATTACK,attack,171,4,500,500,5000,no,target,always,,,,,,,6,
1794,Roween@NPC_EMOTION,idle,197,1,2000,0,5000,yes,self,always,,22,0x308D,,,,,
1794,Roween@NPC_WINDATTACK,attack,187,2,500,500,5000,no,target,always,,,,,,,,
-// Guild Dungeon SE (13.1)
+// Guild Dungeon SE (13.1)
1796,Aunoe@AL_HEAL,attack,28,5,3000,0,5000,yes,friend,friendhpltmaxrate,50,,,,,,3,
1796,Aunoe@AL_HEAL,idle,28,5,3000,0,5000,yes,friend,friendhpltmaxrate,50,,,,,,3,
1796,Aunoe@AL_HEAL,chase,28,5,3000,0,5000,yes,friend,friendhpltmaxrate,50,,,,,,3,
@@ -9960,4 +9960,4 @@
//3074,Timeholder@NPC_HELLJUDGEMENT,attack,662,10,10000,1000,10000,no,self,always,0,,,,,,,
//3074,Timeholder@NPC_PULSESTRIKE,attack,661,5,2000,0,30000,yes,self,always,0,,,,,,,
//3074,Timeholder@NPC_SUMMONSLAVE,attack,196,5,10000,700,10000,no,self,slavele,0,2917,,,,,,
-//3074,Timeholder@NPC_SUMMONSLAVE,idle,196,5,10000,700,10000,no,self,slavele,0,2917,,,,,, \ No newline at end of file
+//3074,Timeholder@NPC_SUMMONSLAVE,idle,196,5,10000,700,10000,no,self,slavele,0,2917,,,,,,
diff --git a/db/pet_db.txt b/db/re/pet_db.txt
index 37401dca4..bc0c91932 100644
--- a/db/pet_db.txt
+++ b/db/re/pet_db.txt
@@ -10,7 +10,7 @@
// 05. EggID Pet Egg ID.
// 06. EquipID Pet Accessory ID.
// 07. FoodID Pet Food ID.
-// 08. Fullness The amount Hunger is decreased every [HungryDelay] seconds.
+// 08. Fullness The amount of hunger points increasing with each feeding.
// 09. HungryDelay The amount of time it takes for hunger to decrease after feeding. (Default: 60 seconds)
// 10. R_Hungry Amount of Intimacy that is increased when fed.
// 11. R_Full Amount of Intimacy that is decreased when over-fed.
@@ -116,3 +116,6 @@
// Brasilis Quest - Suspicious Beach [UNHATCHABLE]
2057,E_CRAMP,Strange Cramp,12408,6221,0,0,0,0,0,0,0,0,50,0,0,0,350,400,800,{},{} // kRO version
2081,E_HYDRA,Strange Hydra,12408,6221,0,0,0,0,0,0,0,0,50,0,0,0,350,400,800,{},{} // iRO/cRO version
+
+// 14.2 Academy
+2398,LITTLE_PORING,Little Poring,12846,9062,10013,531,80,60,50,100,250,20,2000,150,1,0,350,400,800,{ petloot 10; },{ bonus bLuk,2; bonus bCritical,1; }
diff --git a/db/re/size_fix.txt b/db/re/size_fix.txt
index f83560a87..e8e3774d5 100644
--- a/db/re/size_fix.txt
+++ b/db/re/size_fix.txt
@@ -1,7 +1,7 @@
// Database for size fix for weapon damage.
-//Columns: Weapon type, Rows: Target size.
-//Unarmed, Knife, 1H Sword, 2H Sword, 1H Spear, 2H Spears, 1H Axe, 2H Axe, Mace, 2H Mace, Staff, Bow, Knuckle, Musical Instrument, Whip, Book, Katar, Revolver, Rifle, Shotgun, Gatling Gun, Grenade Launcher, Fuuma Shuriken, 2H Staff
+// Columns: Weapon type, Rows: Target size.
+// Unarmed, Knife, 1H Sword, 2H Sword, 1H Spear, 2H Spears, 1H Axe, 2H Axe, Mace, 2H Mace, Staff, Bow, Knuckle, Musical Instrument, Whip, Book, Katar, Revolver, Rifle, Shotgun, Gatling Gun, Grenade Launcher, Fuuma Shuriken, 2H Staff
100,100, 75, 75, 75, 75, 50, 50, 75, 75,100,100,100, 75, 75,100, 75,100,100,100,100,100, 75,100 // Size: Small
100, 75,100, 75, 75, 75, 75, 75,100,100,100,100, 75,100,100,100,100,100,100,100,100,100, 75,100 // Size: Medium
100, 50, 75,100,100,100,100,100,100,100,100, 75, 50, 75, 50, 50, 75,100,100,100,100,100,100,100 // Size: Large
diff --git a/db/re/skill_cast_db.txt b/db/re/skill_cast_db.txt
index 7d73fccef..2e349205a 100644
--- a/db/re/skill_cast_db.txt
+++ b/db/re/skill_cast_db.txt
@@ -8,7 +8,7 @@
// AfterCastWalkDleay : amount of time before character can move again, in milliseconds
// Duration1 / Duration2 : usually the durations used by the skill, at special cases it is used to hold special data
// Cool Down : amount of time until character can re-use this skill, in milliseconds
-// Fixed Casting Time: the skills fixed casting time in milliseconds (when 0, uses 20% of cast time and less than 0 means no fixed cast time)
+// Fixed Casting Time: the skills fixed casting time in milliseconds (when 0, uses 20% of cast time and less than 0 means no fixed cast time)
//== Extra
// On all fields you can use ':' as a delimiter to level-specific values,
// - Example using SM_PROVOKE
@@ -17,7 +17,6 @@
// - Makes lvl 1 have 1000 (1s) cool down, lvl 2 2500 (2.5s), lvl 3 3000, and so on.
//==========================================
-
//===== Swordman ===========================
//-- SM_PROVOKE
6,0,0,0,30000,0,0,0
@@ -27,7 +26,6 @@
8,0,0,0,10000:13000:16000:19000:22000:25000:28000:31000:34000:37000,10000,10000,0
//==========================================
-
//===== Mage ===============================
//-- MG_SIGHT
10,0,0,0,10000,0,0,0
@@ -55,7 +53,6 @@
21,640:1280:1920:2560:3200:3840:4480:5120:5760:6400,2000:2000:2000:2000:2000:2000:2000:2000:2000:2000,0,500,0,0,160:320:480:640:800:960:1120:1280:1440:1600
//==========================================
-
//===== Acolyte ============================
//-- AL_RUWACH
24,0,0,0,10000,0,0,0
@@ -83,7 +80,6 @@
35,0,1000,0,0,6000,0,0
//==========================================
-
//===== Archer =============================
//-- AC_CONCENTRATION
45,0,0,0,60000:80000:100000:120000:140000:160000:180000:200000:220000:240000,0,0,0
@@ -93,7 +89,6 @@
47,0,100,0,100,0,0,0
//==========================================
-
//===== Thief ==============================
//-- TF_HIDING
51,0,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0,0,0
@@ -101,13 +96,11 @@
52,0,0,0,0,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,0,0
//==========================================
-
//===== First planned to be shared =========
//-- ALL_RESURRECTION
54,4800:3200:1600:0,0:1000:2000:3000,0,0,0,0,1200:800:400:0
//==========================================
-
//===== Knight =============================
//-- KN_BRANDISHSPEAR
57,350,0,0,0,0,0,350
@@ -121,7 +114,6 @@
62,350,0,0,0,0,0,350
//==========================================
-
//===== Priest =============================
//-- PR_IMPOSITIO
66,0,3000,0,60000,0,0,0
@@ -154,7 +146,6 @@
//==========================================
-
//===== Wizard =============================
//-- WZ_FIREPILLAR
80,1920:1728:1536:1344:1152:960:768:576:384:192,1000,0,30000,600:800:1000:1200:1400:1600:1800:2000:2200:2400,0,480:432:384:336:288:240:192:144:96:48
@@ -182,7 +173,6 @@
92,0,1000,0,5000:10000:15000:20000:25000,5000:10000:15000:20000:25000,0,0
//==========================================
-
//===== Blacksmith =========================
//-- BS_REPAIRWEAPON
108,2500,0,0,0,0,0,2500
@@ -198,7 +188,6 @@
114,0,0,0,1000:2000:3000:4000:5000,0,0,0
//==========================================
-
//===== Hunter =============================
//-- HT_SKIDTRAP
115,0,0,0,300000:240000:180000:120000:60000,0,0,0
@@ -224,7 +213,6 @@
129,800,1000,0,0,0,0,200
//==========================================
-
//===== Assassin ===========================
//-- AS_CLOAKING
135,0,0,0,500:1000:2000:3000:4000:5000:6000:7000:8000:9000,0,0,0
@@ -240,7 +228,6 @@
141,500,0,0,5000:5500:6000:6500:7000:7500:8000:8500:9000:9500,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,7500:8000:8500:9000:9500:10000:10500:11000:11500:12000,500
//==========================================
-
//===== 1st Jobs Quest Skills===============
//-- NV_TRICKDEAD
143,0,0,0,600000,0,0,0
@@ -268,7 +255,6 @@
157,0,0,0,300000,0,0,5000
//==========================================
-
//===== NPC Skills Part 1 ==================
//-- NPC_ATTRICHANGE
161,0,0,0,1800000,0,0,0
@@ -322,7 +308,6 @@
207,0,0,0,30000:40000:50000:60000:70000:80000:90000:100000:110000:120000,0,0,0
//==========================================
-
//===== Rogue ==============================
//-- RG_BACKSTAP
212,0,500,0,5000,0,0,0
@@ -340,7 +325,6 @@
220,0,0,0,180000,0,0,0
//==========================================
-
//===== Alchemist ==========================
//-- AM_DEMONSTRATION
229,800,500,0,40000:45000:50000:55000:60000,0,0,200
@@ -364,7 +348,6 @@
247,2000,0,0,0,0,0,1000
//==========================================
-
//===== Crusader ===========================
//-- CR_AUTOGUARD
249,0,0,0,300000,0,0,0
@@ -388,7 +371,6 @@
258,0,0,0,30000:60000:90000:120000:150000:180000:210000:240000:270000:300000,0,0,0
//==========================================
-
//===== Monk ===============================
//-- MO_CALLSPIRITS
261,500,0,0,600000,0,0,500
@@ -439,7 +421,6 @@
294,0,0,0,1200000,0,0,0
//==========================================
-
//===== Bard & Dancer (Ensemble Skills) ====
//-- BD_ADAPTATION
304,0,0,0,0,5000,0,0
@@ -461,7 +442,6 @@
313,0,0,0,60000,60000,0,0
//==========================================
-
//===== Bard ===============================
//-- BA_MUSICALSTRIKE
316,1200,0,0,0,0,0,300
@@ -479,7 +459,6 @@
322,0,0,0,180000,20000,0,0
//==========================================
-
//===== Dancer =============================
//-- DC_THROWARROW
324,1200,0,0,0,0,0,300
@@ -497,7 +476,6 @@
330,0,0,0,180000,20000,0,0
//==========================================
-
//===== Wedding Skills =====================
//-- WE_MALE
334,1500,0,0,0,0,0,1500
@@ -507,7 +485,6 @@
336,0,0,0,20000,0,0,0
//==========================================
-
//===== NPC Skills Part 2 ==================
//-- NPC_GRANDDARKNESS
339,0,0,900,900,10000:11000:12000:13000:14000:15000:16000:17000:18000:19000,0,0
@@ -525,7 +502,6 @@
354,0,0,0,0,0,0,0
//==========================================
-
//===== Lord Knight ========================
//-- LK_AURABLADE
355,0,0,0,40000:60000:80000:100000:120000,0,0,0
@@ -541,7 +517,6 @@
360,0,0,0,300000,0,0,0
//==========================================
-
//===== High Priest ========================
//-- HP_ASSUMPTIO
361,800:1200:1600:2000:2400:2400:2400:2400:2400:2400,1100:1200:1300:1400:1500,0,20000:40000:60000:80000:100000,0,0,200:300:400:500:600
@@ -549,15 +524,13 @@
362,0,2000:3000:4000:5000:6000,0,20000:25000:30000:35000:40000,20000:25000:30000:35000:40000,0,5000:6000:7000:8000:9000
//==========================================
-
//===== High Wzard =========================
//-- HW_MAGICCRASHER
365,240,300,0,0,0,0,60
-//-- HW_MAGICPOWER
+//-- HW_MAGICPOWER
366,0,0,0,30000,0,0,
//==========================================
-
//===== Paladin ============================
//-- PA_PRESSURE
367,1600,2000:2500:3000:3500:4000,0,0,2000:3000:4000:5000:6000,0,400
@@ -565,7 +538,6 @@
369,0,0,0,60000,60000,0,
//==========================================
-
//===== Champion ===========================
//-- CH_PALMSTRIKE
370,0,300,0,0,0,0,
@@ -573,7 +545,6 @@
371,0,0,0,0,2000:4000:6000:8000:10000,0,
//==========================================
-
//===== Professor ==========================
//-- PF_HPCONVERSION
373,1000:1200:1400:1600:1800,0,0,0,0,0,
@@ -583,7 +554,6 @@
375,0,0,0,0,0,10000:10000:10000:10000:15000,0
//==========================================
-
//===== Assassin Cross =====================
//-- ASC_EDP
378,0,2000,0,40000:45000:50000:55000:60000,20000:30000:40000:50000:60000,0,0
@@ -591,7 +561,6 @@
379,250,1000:1200:1400:1600:1800:2000:2200:2400:2600:2800,0,0,0,0,250
//==========================================
-
//===== Sniper =============================
//-- SN_SIGHT
380,0,0,0,30000,0,0,0
@@ -603,7 +572,6 @@
383,1500:1800:2100:2400:2700:3000:3300:3600:3900:4200,2000,0,130000:160000:190000:220000:250000:280000:310000:340000:370000:400000,0,0,500:600:700:800:900:1000:1100:1200:1300:1400
//==========================================
-
//===== Whitesmith =========================
//-- WS_MELTDOWN
384,0,0,0,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,5000,0,5:5:6:6:7:7:8:8:9:10
@@ -611,7 +579,6 @@
387,0,0,0,60000,0,0,0
//==========================================
-
//===== Stalker ============================
//-- ST_CHASEWALK
389,500,0,0,10000,30000,0,500
@@ -619,7 +586,6 @@
390,0,0,0,300000,0,0,
//==========================================
-
//===== Clown / Gypsy ======================
//-- CG_ARROWVULCAN
394,1600:1760:1920:2080:2240:2400:2560:2720:2880:3040,2000,2000,0,0,0,400:440:480:520:560:600:640:680:720:760
@@ -658,7 +624,6 @@
407,0,5000,0,0,0,0,0
//==========================================
-
//===== Adoption Skills ====================
//-- WE_BABY
408,0,0,0,300000,0,0,2000
@@ -668,7 +633,6 @@
410,0,0,0,20000,0,0,0
//==========================================
-
//===== Taekwon ============================
//-- TK_RUN
411,3000:2500:2000:1500:100:500:0:0:0:0,300,0,1000,150000,0,3000:2500:2000:1500:1000:500:0:0:0:0
@@ -836,7 +800,6 @@
499,0,100,0,100,0,0,0
//==========================================
-
//===== Gunslinger =========================
//-- GS_GLITTERING
500,0,0,0,600000,0,0,0
@@ -872,7 +835,6 @@
521,800,1000,0,3000:6000:9000:12000:15000:18000:21000:24000:27000:30000,10000,0,200
//==========================================
-
//===== Ninja ==============================
//-- NJ_KUNAI
524,0,1000,0,0,0,0,0
@@ -1107,7 +1069,7 @@
2015,0,0,0,180000,10000,0,2000
//-- RK_VITALITYACTIVATION
2016,0,0,0,180000,0,0,-1
-//-- RK_STORMBLAST
+//-- RK_STORMBLAST
2017,2000,2000,0,0,0,0,-1
//-- RK_FIGHTINGSPIRIT
2018,0,0,0,180000,0,0,-1
@@ -1147,7 +1109,7 @@
2034,0,1000,0,0,0,0,-1
//-- GC_HALLUCINATIONWALK
2035,0,0,0,30000:35000:40000:45000:50000,25000,300000,-1
-//-- GC_ROLLINGCUTTER
+//-- GC_ROLLINGCUTTER
2036,0,200,0,3000,0,0,-1
//-- GC_CROSSRIPPERSLASHER
2037,0,1000,0,0,0,0,-1
@@ -1160,7 +1122,7 @@
2038,2000,500,0,0,0,0,500
//-- AB_ANCILLA
2039,1000,1000,0,0,0,0,-1
-//-- AB_ADORAMUS
+//-- AB_ADORAMUS
2040,2000,500,0,6000:7000:8000:9000:10000:11000:12000:13000:14000:15000,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000,2000,-1
//-- AB_CLEMENTIA
2041,3000,0,0,120000:180000:240000,0,0,1000
@@ -1197,7 +1159,7 @@
//==========================================
//===== Warlock ============================
-//-- WL_WHITEIMPRISON
+//-- WL_WHITEIMPRISON
2201,0,0,0,6000:8000:10000:12000:14000,15000,4000,-1
//-- WL_SOULEXPANSION
2202,2000,500,0,0,0,0,-1
@@ -1205,13 +1167,13 @@
2203,2000:2500:3000:3500:4000,1000,0,40000,0,4000,500
//-- WL_JACKFROST
2204,2000:2500:3000:3500:4000,1000,0,10000:15000:20000:25000:30000,0,0,1000
-//-- WL_MARSHOFABYSS
+//-- WL_MARSHOFABYSS
2205,0,1000,0,30000,0,2500:3000:3500:4000:4500,500
//-- WL_RECOGNIZEDSPELL
2206,1000,1000,0,60000:90000:120000:150000:180000,0,50000:80000:110000:140000:170000,1000
-//-- WL_SIENNAEXECRATE
+//-- WL_SIENNAEXECRATE
2207,2000,2000,0,10000:12000:14000:16000:18000,0,0,-1
-//-- WL_STASIS
+//-- WL_STASIS
2209,3000,2000,0,10000:15000:20000:25000:30000,1000,180000:190000:200000:210000:220000,1000
//-- WL_DRAINLIFE
2210,4000,0,0,0,0,2000,1000
@@ -1219,11 +1181,11 @@
2211,5000,2000,0,5000,0,5000,1000
//-- WL_HELLINFERNO
2212,3000,1000,0,20000:30000:40000:50000:60000,0,0,1000
-//-- WL_COMET
+//-- WL_COMET
2213,10000:11000:12000:13000:14000,0,0,100,42000,60000,1000:1500:2000:2500:3000
-//-- WL_CHAINLIGHTNING
+//-- WL_CHAINLIGHTNING
2214,3500:4000:4500:5000:5500,0,0,100,0,3000,1000
-//-- WL_EARTHSTRAIN
+//-- WL_EARTHSTRAIN
2216,2000:3000:4000:5000:6000,1000,0,100,75000:90000:105000:120000:135000,10000,2000
//-- WL_TETRAVORTEX
2217,5000:6000:7000:8000:9000,2000,0,15000:120000:40000:5000,0,15000,2000
@@ -1235,7 +1197,7 @@
2224,2000,0,0,120000:160000:200000:240000:280000,0,0,-1
//-- WL_SUMMONSTONE
2229,2000,0,0,120000:160000:200000:240000:280000,0,0,-1
-//-- WL_READING_SB
+//-- WL_READING_SB
2231,5000,500,0,0,0,0,1000
//-- WL_TELEKINESIS_INTENSE
5012,1000,0,0,60000,0,300000,-1
@@ -1251,9 +1213,9 @@
2236,4000,1000,0,0,0,0,500
//-- RA_DETONATOR
2237,0,0,0,1000,0,0,-1
-//-- RA_ELECTRICSHOCKER
+//-- RA_ELECTRICSHOCKER
2238,0,0,0,15000,20000:22000:24000:26000:28000,0,-1
-//-- RA_CLUSTERBOMB
+//-- RA_CLUSTERBOMB
2239,0,0,0,15000,0,0,-1
//-- RA_WUGMASTERY
2240,0,1000,0,0,0,0,-1
@@ -1344,7 +1306,7 @@
//===== Shadow Chaser ======================
//-- SC_FATALMENACE
2284,0,500,0,0,0,0,-1
-//-- SC_REPRODUCE
+//-- SC_REPRODUCE
2285,0,1000,0,60000,0,0,-1
//-- SC_AUTOSHADOWSPELL
2286,4000:3600:3200:2800:2400:2000:1600:1200:800:400,0,0,60000:80000:100000:120000:140000:160000:180000:200000:220000:300000,0,0,2000
@@ -1398,7 +1360,7 @@
2310,0,0,0,3500:4000:4500:5000:5500,0,2000,-1
//-- LG_REFLECTDAMAGE
2311,0,0,0,300000,0,0,-1
-//-- LG_PINPOINTATTACK
+//-- LG_PINPOINTATTACK
2312,0,1000,0,5000,0,5000,-1
//-- LG_FORCEOFVANGUARD
2313,0,1000,0,300000,0,0,-1
@@ -1435,7 +1397,7 @@
2326,0,0,0,3000,0,0,-1
//-- SR_SKYNETBLOW
2327,0,500,0,0,0,0,-1
-//-- SR_EARTHSHAKER
+//-- SR_EARTHSHAKER
2328,0,0,0,1000,0,3000,-1
//-- SR_FALLENEMPIRE
2329,0,0,0,500:1000:1500:2000:2500,0,0,-1
@@ -1468,7 +1430,7 @@
2344,0,0,0,5000:7000:9000:11000:13000,0,1000:1500:2000:2500:3000,-1
//-- SR_GENTLETOUCH_CURE
2345,0,1000,0,0,0,1000:1500:2000:2500:3000,-1
-//-- SR_GENTLETOUCH_ENERGYGAIN
+//-- SR_GENTLETOUCH_ENERGYGAIN
2346,1000,1000,0,240000,0,0,1000:1500:2000:2500:3000
//-- SR_GENTLETOUCH_CHANGE
2347,1000,1000,0,240000,0,200000:180000:160000:140000:120000,1000
@@ -1564,7 +1526,7 @@
2451,1000,1000,0,60000,0,2000,-1
//-- SO_WARMER
2452,2200:2400:2600:2800:3000,1000,0,40000:45000:50000:55000:60000,30000,35000:40000:45000:50000:55000,1800:1600:1400:1200:1000
-//-- SO_VACUUM_EXTREME
+//-- SO_VACUUM_EXTREME
2453,1000:1500:2000:2500:3000,1000,0,4000:6000:8000:10000:12000,0,5000,-1
//-- SO_VARETYR_SPEAR
2454,2200:2400:2600:2800:3000,1000,0,0,2200:2400:2600:2800:3000,2000,1800:1600:1400:1200:1000
@@ -1572,15 +1534,15 @@
2455,2200:2400:2600:2800:3000,1000,0,8000:10000:12000:14000:16000,0,5000:6000:7000:8000:9000,800:600:400:200:-1
//-- SO_EL_CONTROL
2456,2000,0,0,0,0,5000,0
-//-- SO_SUMMON_AGNI
+//-- SO_SUMMON_AGNI
2457,1000:2000:3000,0,0,600000:900000:1200000,0,60000,2000
//-- SO_SUMMON_AQUA
2458,1000:2000:3000,0,0,600000:900000:1200000,0,60000,2000
-//-- SO_SUMMON_VENTUS
+//-- SO_SUMMON_VENTUS
2459,1000:2000:3000,0,0,600000:900000:1200000,0,60000,2000
-//-- SO_SUMMON_TERA
+//-- SO_SUMMON_TERA
2460,1000:2000:3000,0,0,600000:900000:1200000,0,60000,2000
-//-- SO_EL_ACTION
+//-- SO_EL_ACTION
2461,0,0,0,0,0,5000,0
//-- SO_EL_ANALYSIS
2462,0,0,0,0,0,0,2000
@@ -1614,7 +1576,7 @@
2481,1500,500,0,2000:2000:3000:3000:4000,0,5000,-1
//-- GN_WALLOFTHORN
2482,1500,500,0,10000:11000:12000:13000:14000,0,5000,-1
-//-- GN_CRAZYWEED
+//-- GN_CRAZYWEED
2483,3000:3500:4000:4500:5000:5500:6000:6500:7000:7500,500,0,0,0,5000,-1
//-- GN_CRAZYWEED_ATK
2484,0,0,0,100,0,0,-1
@@ -1630,7 +1592,7 @@
//-- GN_HELLS_PLANT
2490,3000:3500:4000:4500:5000,500,0,14000:21000:28000:35000:42000,0,0,-1
-//-- GN_HELLS_PLANT_ATK
+//-- GN_HELLS_PLANT_ATK
2491,0,0,0,20000,0,0,-1
//-- GN_MANDRAGORA
2492,1000,500,0,10000:15000:20000:25000:30000,0,10000,-1
@@ -1769,7 +1731,7 @@
//-- MH_SUMMON_LEGION
8018,1600:1400:1200:1000:800,0,0,20000:30000:40000:50000:60000,0,0,400:600:800:1000:1200
-//-- MH_NEEDLE_OF_PARALYZE
+//-- MH_NEEDLE_OF_PARALYZE
8019,1000:1100:1200:1300:1400,0,0,12000:14000:16000:18000:20000,0,0,500:400:300:200:100
//-- MH_POISON_MIST
8020,500:700:900:1100:1300,0,0,12000:14000:16000:18000:20000,4000:6000:8000:10000:12000,0,500
@@ -1793,7 +1755,7 @@
//8029,0,0,0,0,0,0,0
//-- MH_MIDNIGHT_FRENZY
//8030,0,0,0,0,0,0,0
-//-- MH_STAHL_HORN
+//-- MH_STAHL_HORN
8031,800:600:400:200:0,0,0,5000,0,0,200:400:600:800:1000
//-- MH_GOLDENE_FERSE
8032,1000:1200:1400:1600:1800,0,0,30000:45000:60000:75000:90000,0,0,-1
diff --git a/db/re/skill_db.txt b/db/re/skill_db.txt
index 8e4a4c022..eb875fc56 100644
--- a/db/re/skill_db.txt
+++ b/db/re/skill_db.txt
@@ -18,7 +18,7 @@
// 0x80 - Skill ignores target's def cards
// 07 splash/effect range (-1 for screen-wide)
// 08 MaxLv
-// 09 Number of hits (when positive, damage is increased by hits,
+// 09 Number of hits (when positive, damage is increased by hits,
// negative values just show number of hits without increasing total damage)
// 10 Cast interrupted when hit?
// 11 defense-reduction rate during cast.
@@ -45,6 +45,7 @@
// 15 Blowcount (amount of tiles skill knockbacks)
// 16 Name
// 17 Description
+
1,0,0,0,0,0,0,9,0,no,0,0,0,none,0, NV_BASIC,Basic Skill
2,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0, SM_SWORD,Sword Mastery
3,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0, SM_TWOHAND,Two-Handed Sword Mastery
@@ -772,7 +773,7 @@
2211,11,8,1,3,0x2,3,5,-7,yes,0,0,0,magic,3, WL_CRIMSONROCK,Crimson Rock
2212,11,6,1,3,0,0,5,1,yes,0,0,0,magic,0, WL_HELLINFERNO,Hell Inferno
2213,11,8,2,0,0,0,5,-20,yes,0,0,0,magic,2, WL_COMET,Comet
-2214,11,6,1,0,0,3,5,1,yes,0,0,0,magic,0, WL_CHAINLIGHTNING,Chain Lightning
+2214,11,6,1,0,0,3,5,1,yes,0,0,0,magic,0, WL_CHAINLIGHTNING,Chain Lightning
2215,11,6,1,4,0,0,5,1,no,0,0,0,magic,0, WL_CHAINLIGHTNING_ATK,Chain Lightning Attack
2216,3,8,2,2,0,0,5,-6:-7:-8:-9:-10,yes,0,0,0,magic,0, WL_EARTHSTRAIN,Earth Strain
2217,11,6,1,0,0,0,5,1,yes,0,0,0,magic,0, WL_TETRAVORTEX,Tetra Vortex
@@ -783,7 +784,7 @@
2222,0,6,4,3,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONFB,Summon Fire Ball
2223,0,6,4,4,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONBL,Summon Lightning Ball
2224,0,6,4,1,0x1,0,5,1,yes,0,0,0,magic,0, WL_SUMMONWB,Summon Water Ball
-2225,11,6,1,3,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_FIRE,Summon Attack Fire
+2225,11,6,1,3,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_FIRE,Summon Attack Fire
2226,11,6,1,4,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_WIND,Summon Attack Wind
2227,11,6,1,1,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_WATER,Summon Attack Water
2228,11,6,1,2,0,0,5,1,no,0,0,1,magic,0, WL_SUMMON_ATK_GROUND,Summon Attack Earth
@@ -1076,7 +1077,7 @@
3006,7:8:9:10:11,6,2,0,0x2,2,5,0,no,0,0,0,weapon,0, KO_BAKURETSU,Bakuretsu Kunai
3007,0,6,4,-1,0x42,4:4:4:4:5,5,0,no,0,0,0,misc,0, KO_HAPPOKUNAI,Happo Kunai
3008,9,8,2,0,0x12,2,10,-10,no,0,0,0,misc,0, KO_MUCHANAGE,Mucha Nage
-3009,9:10:11:12:13,8,2,-1,0x2,3,5,-5,no,0,0,0,weapon,0, KO_HUUMARANKA,Huuma Shuriken Ranka
+3009,9:10:11:12:13,8,2,-1,0x2,3,5,-5,no,0,0,0,weapon,0, KO_HUUMARANKA,Huuma Shuriken Ranka
3010,3,6,4,0,0x42,0,5,1,no,0,0x80,0,weapon,0, KO_MAKIBISHI,Makibishi
3011,0,6,4,0,0x1,0,5,0,yes,0,0,0,none,0, KO_MEIKYOUSISUI,Meikyo Shisui
3012,0,6,4,0,0x1,0,5,0,no,0,0,1,none,3:4:5:6:7, KO_ZANZOU,Zanzou
@@ -1085,7 +1086,7 @@
3015,0,6,4,3,0x1,0,1,1,no,0,0,0,none,0, KO_KAHU_ENTEN,Kahu Enten
3016,0,6,4,1,0x1,0,1,1,no,0,0,0,none,0, KO_HYOUHU_HUBUKI,Hyouhu Hubuki
3017,0,6,4,4,0x1,0,1,1,no,0,0,0,none,0, KO_KAZEHU_SEIRAN,Kazehu Seiran
-3018,0,6,4,2,0x1,0,1,1,no,0,0,0,none,0, KO_DOHU_KOUKAI,Dohu Koukai
+3018,0,6,4,2,0x1,0,1,1,no,0,0,0,none,0, KO_DOHU_KOUKAI,Dohu Koukai
3019,11,6,1,0,0,0,5,0,no,0,0,0,magic,0, KO_KAIHOU,Technique Kaihou
3020,7,6,2,0,0,0,1,3,yes,0,0,0,magic,0, KO_ZENKAI,Zenkai
3021,5:6:7:8:9,6,16,0,0x1,0,5,1,no,0,0,0,none,0, KO_GENWAKU,Genwaku
diff --git a/db/re/skill_require_db.txt b/db/re/skill_require_db.txt
index 0b9f86efe..ed9f94b47 100644
--- a/db/re/skill_require_db.txt
+++ b/db/re/skill_require_db.txt
@@ -715,7 +715,7 @@
2347,0,0,40:50:60:70:80,-2:-4:-6:-8:-10,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_GENTLETOUCH_CHANGE#Gentle Touch - Change#
2348,0,0,40:50:60:70:80,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_GENTLETOUCH_REVITALIZE#Gentle Touch - Revitalize#
//More from SR Sura (but not following ID order)
-2517,0,0,40:45:50:55:60,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_HOWLINGOFLION#Howling of Lion#
+2517,0,0,40:45:50:55:60,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_HOWLINGOFLION#Howling of Lion#
2518,0,0,40:50:60:70:80,0,0,0,99,0,0,none,1:2:3:4:5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //SR_RIDEINLIGHTNING#Ride In Lightening#
//****
@@ -734,8 +734,8 @@
// WM Wanderer/Minstrel
2413,0,0,64:68:72:76:80,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_METALICSOUND#Metallic Sound#
2414,0,0,28:32:38:42:48,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION#Reverberation#
-2415,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MELEE#Reverberation Melee#
-2416,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MAGIC#Reverberation Magic#
+2415,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MELEE#Reverberation Melee#
+2416,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_REVERBERATION_MAGIC#Reverberation Magic#
2417,0,0,10,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_DOMINION_IMPULSE#Dominion Impulse#
2418,0,0,80:90:100:110:120,0,0,0,11,1,20,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_SEVERE_RAINSTORM#Severe Rainstorm#
2419,0,0,12:16:20:24:28,0,0,0,13:14,0,0,none,0,11513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_POEMOFNETHERWORLD#Poem of Netherworld#
diff --git a/db/re/skill_tree.conf b/db/re/skill_tree.conf
index 0da4479d4..a29b924aa 100644
--- a/db/re/skill_tree.conf
+++ b/db/re/skill_tree.conf
@@ -1,24 +1,24 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
// http://herc.ws/board/topic/1188-skill-tree-db-redesign/
//================ Structure Example =================
/*
Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so if you want to add a new job you should add it there)
- inherit: ( "Other_Job_Name" ); // Base job from which this job will inherit its skill tree. NV_TRICKDEAD inheritance is skipped for non-novices from the source
+ inherit: ( "Other_Job_Name" ); // Base job from which this job will inherit its skill tree. NV_TRICKDEAD inheritance is skipped for non-novices from the source
- skills: { // SKILL_NAMEs come from the Name (16th column) value in db/re/skill_db.txt
- SKILL_NAME1: Max_Level // Use this for skills that don't have other skill prerequisite; Max_Level is a numeric value that should match your client side files
- SKILL_NAME2: { // Use this for skills which have other skills as prerequisites
- MaxLevel: Max_Level // Max_Level is a numeric value that should match your client side files
- SKILL_NAME_PREREQUISITE: Level_Prerequisite // The prerequisite skill and min level for having this skill available. Should also match your client side files
+ skills: { // SKILL_NAMEs come from the Name (16th column) value in db/re/skill_db.txt
+ SKILL_NAME1: Max_Level // Use this for skills that don't have other skill prerequisite; Max_Level is a numeric value that should match your client side files
+ SKILL_NAME2: { // Use this for skills which have other skills as prerequisites
+ MaxLevel: Max_Level // Max_Level is a numeric value that should match your client side files
+ SKILL_NAME_PREREQUISITE: Level_Prerequisite // The prerequisite skill and min level for having this skill available. Should also match your client side files
SKILL_NAME_PREREQUISITE2: Level_Prerequisite2 // You can add as many prerequisite skills as you want. Minimum of 1 if you add a skill this way
}
}
@@ -26,7 +26,7 @@ Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so
//====================================================
Novice: {
- skills: {
+ skills: {
NV_BASIC: 9
NV_FIRSTAID: 1
NV_TRICKDEAD: 1
@@ -39,7 +39,7 @@ Novice: {
Swordsman: {
inherit: ( "Novice" );
- skills: {
+ skills: {
SM_SWORD: 10
SM_TWOHAND: {
MaxLevel: 10
@@ -64,7 +64,7 @@ Swordsman: {
Magician: {
inherit: ( "Novice" );
- skills: {
+ skills: {
MG_SRECOVERY: 10
MG_SIGHT: 1
MG_NAPALMBEAT: 10
@@ -104,7 +104,7 @@ Magician: {
Archer: {
inherit: ( "Novice" );
- skills: {
+ skills: {
AC_OWL: 10
AC_VULTURE: {
MaxLevel: 10
@@ -126,7 +126,7 @@ Archer: {
Acolyte: {
inherit: ( "Novice" );
- skills: {
+ skills: {
AL_DP: 10
AL_DEMONBANE: {
MaxLevel: 10
@@ -177,7 +177,7 @@ Acolyte: {
Merchant: {
inherit: ( "Novice" );
- skills: {
+ skills: {
MC_INCCARRY: 10
MC_DISCOUNT: {
MaxLevel: 10
@@ -209,7 +209,7 @@ Merchant: {
Thief: {
inherit: ( "Novice" );
- skills: {
+ skills: {
TF_DOUBLE: 10
TF_MISS: 10
TF_STEAL: 10
@@ -231,7 +231,7 @@ Thief: {
Knight: {
inherit: ( "Swordsman" );
- skills: {
+ skills: {
KN_SPEARMASTERY: 10
KN_PIERCE: {
MaxLevel: 10
@@ -284,7 +284,7 @@ Knight: {
Priest: {
inherit: ( "Acolyte" );
- skills: {
+ skills: {
MG_SRECOVERY: 10
MG_SAFETYWALL: {
MaxLevel: 10
@@ -353,7 +353,7 @@ Priest: {
Wizard: {
inherit: ( "Magician" );
- skills: {
+ skills: {
WZ_FIREPILLAR: {
MaxLevel: 10
MG_FIREWALL: 1
@@ -416,7 +416,7 @@ Wizard: {
Blacksmith: {
inherit: ( "Merchant" );
- skills: {
+ skills: {
BS_IRON: 5
BS_STEEL: {
MaxLevel: 5
@@ -500,7 +500,7 @@ Blacksmith: {
Hunter: {
inherit: ( "Archer" );
- skills: {
+ skills: {
HT_SKIDTRAP: 5
HT_LANDMINE: 5
HT_ANKLESNARE: {
@@ -576,7 +576,7 @@ Hunter: {
Assassin: {
inherit: ( "Thief" );
- skills: {
+ skills: {
AS_RIGHT: 5
AS_LEFT: {
MaxLevel: 5
@@ -620,7 +620,7 @@ Assassin: {
Crusader: {
inherit: ( "Swordsman" );
- skills: {
+ skills: {
KN_RIDING: {
MaxLevel: 1
SM_ENDURE: 1
@@ -694,7 +694,7 @@ Crusader: {
Monk: {
inherit: ( "Acolyte" );
- skills: {
+ skills: {
MO_IRONHAND: {
MaxLevel: 10
AL_DEMONBANE: 10
@@ -767,7 +767,7 @@ Monk: {
Sage: {
inherit: ( "Magician" );
- skills: {
+ skills: {
WZ_ESTIMATION: 1
WZ_EARTHSPIKE: {
MaxLevel: 5
@@ -860,7 +860,7 @@ Sage: {
Rogue: {
inherit: ( "Thief" );
- skills: {
+ skills: {
SM_SWORD: 10
AC_VULTURE: 10
AC_DOUBLE: {
@@ -943,7 +943,7 @@ Rogue: {
Alchemist: {
inherit: ( "Merchant" );
- skills: {
+ skills: {
AM_AXEMASTERY: 10
AM_LEARNINGPOTION: 10
AM_PHARMACY: {
@@ -1017,7 +1017,7 @@ Alchemist: {
Bard: {
inherit: ( "Archer" );
- skills: {
+ skills: {
BA_MUSICALLESSON: 10
BA_MUSICALSTRIKE: {
MaxLevel: 5
@@ -1091,7 +1091,7 @@ Bard: {
Dancer: {
inherit: ( "Archer" );
- skills: {
+ skills: {
DC_DANCINGLESSON: 10
DC_THROWARROW: {
MaxLevel: 5
@@ -1304,7 +1304,7 @@ Super_Novice: {
Gunslinger: {
inherit: ( "Novice" );
- skills: {
+ skills: {
GS_GLITTERING: 5
GS_FLING: {
MaxLevel: 1
@@ -1395,7 +1395,7 @@ Gunslinger: {
Ninja: {
inherit: ( "Novice" );
- skills: {
+ skills: {
NJ_TOBIDOUGU: 10
NJ_SYURIKEN: {
MaxLevel: 10
@@ -1491,7 +1491,7 @@ Ninja: {
}
}
Novice_High: {
- inherit: ( "Novice" );
+ inherit: ( "Novice" );
}
Swordsman_High: {
inherit: ( "Swordsman" );
@@ -1513,7 +1513,7 @@ Thief_High: {
}
Lord_Knight: {
inherit: ( "Knight" );
- skills: {
+ skills: {
LK_AURABLADE: {
MaxLevel: 5
SM_BASH: 5
@@ -1565,7 +1565,7 @@ Lord_Knight: {
High_Priest: {
inherit: ( "Priest" );
- skills: {
+ skills: {
HP_ASSUMPTIO: {
MaxLevel: 5
AL_ANGELUS: 1
@@ -1594,7 +1594,7 @@ High_Priest: {
High_Wizard: {
inherit: ( "Wizard" );
- skills: {
+ skills: {
HW_SOULDRAIN: {
MaxLevel: 10
MG_SRECOVERY: 5
@@ -1625,7 +1625,7 @@ High_Wizard: {
Whitesmith: {
inherit: ( "Blacksmith" );
- skills: {
+ skills: {
WS_MELTDOWN: {
MaxLevel: 10
BS_SKINTEMPER: 3
@@ -1659,7 +1659,7 @@ Whitesmith: {
Sniper: {
inherit: ( "Hunter" );
- skills: {
+ skills: {
SN_SIGHT: {
MaxLevel: 10
AC_OWL: 10
@@ -1688,7 +1688,7 @@ Sniper: {
Assassin_Cross: {
inherit: ( "Assassin" );
- skills: {
+ skills: {
ASC_KATAR: {
MaxLevel: 5
TF_DOUBLE: 5
@@ -1723,7 +1723,7 @@ Assassin_Cross: {
Paladin: {
inherit: ( "Crusader" );
- skills: {
+ skills: {
PA_PRESSURE: {
MaxLevel: 5
SM_ENDURE: 5
@@ -1751,7 +1751,7 @@ Paladin: {
Champion: {
inherit: ( "Monk" );
- skills: {
+ skills: {
CH_PALMSTRIKE: {
MaxLevel: 5
MO_IRONHAND: 7
@@ -1781,7 +1781,7 @@ Champion: {
Professor: {
inherit: ( "Sage" );
- skills: {
+ skills: {
PF_HPCONVERSION: {
MaxLevel: 5
MG_SRECOVERY: 1
@@ -1827,7 +1827,7 @@ Professor: {
Stalker: {
inherit: ( "Rogue" );
- skills: {
+ skills: {
ST_CHASEWALK: {
MaxLevel: 5
TF_HIDING: 5
@@ -1850,7 +1850,7 @@ Stalker: {
Creator: {
inherit: ( "Alchemist" );
- skills: {
+ skills: {
CR_SLIMPITCHER: {
MaxLevel: 10
AM_POTIONPITCHER: 5
@@ -1873,7 +1873,7 @@ Creator: {
Clown: {
inherit: ( "Bard" );
- skills: {
+ skills: {
CG_ARROWVULCAN: {
MaxLevel: 10
AC_SHOWER: 5
@@ -1909,7 +1909,7 @@ Clown: {
Gypsy: {
inherit: ( "Dancer" );
- skills: {
+ skills: {
CG_ARROWVULCAN: {
MaxLevel: 10
AC_SHOWER: 5
@@ -2008,7 +2008,7 @@ Super_Baby: {
Taekwon: {
inherit: ( "Novice" );
- skills: {
+ skills: {
TK_RUN: 10
TK_READYSTORM: {
MaxLevel: 1
@@ -2054,7 +2054,7 @@ Taekwon: {
Star_Gladiator: {
inherit: ( "Taekwon" );
- skills: {
+ skills: {
SG_FEEL: 3
SG_SUN_WARM: {
MaxLevel: 3
@@ -2120,7 +2120,7 @@ Star_Gladiator: {
Soul_Linker: {
inherit: ( "Taekwon" );
- skills: {
+ skills: {
SL_ALCHEMIST: 5
SL_MONK: 5
SL_STAR: 5
@@ -2221,7 +2221,7 @@ Dark_Collector: {
Rune_Knight: {
inherit: ( "Knight" );
- skills: {
+ skills: {
RK_ENCHANTBLADE: {
MaxLevel: 5
RK_RUNEMASTERY: 2
@@ -2276,7 +2276,7 @@ Rune_Knight: {
Warlock: {
inherit: ( "Wizard" );
- skills: {
+ skills: {
WL_WHITEIMPRISON: {
MaxLevel: 5
WL_SOULEXPANSION: 3
@@ -2372,7 +2372,7 @@ Warlock: {
Ranger: {
inherit: ( "Hunter" );
- skills: {
+ skills: {
RA_ARROWSTORM: {
MaxLevel: 10
RA_AIMEDBOLT: 5
@@ -2467,7 +2467,7 @@ Ranger: {
Arch_Bishop: {
inherit: ( "Priest" );
- skills: {
+ skills: {
AB_JUDEX: {
MaxLevel: 5
PR_TURNUNDEAD: 1
@@ -2560,7 +2560,7 @@ Arch_Bishop: {
Mechanic: {
inherit: ( "Blacksmith" );
- skills: {
+ skills: {
NC_MADOLICENCE: 5
NC_BOOSTKNUCKLE: {
MaxLevel: 5
@@ -2677,7 +2677,7 @@ Mechanic: {
Guillotine_Cross: {
inherit: ( "Assassin" );
- skills: {
+ skills: {
GC_VENOMIMPRESS: {
MaxLevel: 5
AS_ENCHANTPOISON: 3
@@ -2760,7 +2760,7 @@ Warlock_Trans: {
inherit: ( "High_Wizard", "Warlock" );
}
Ranger_Trans: {
- inherit: ( "Sniper", "Ranger" );
+ inherit: ( "Sniper", "Ranger" );
}
Arch_Bishop_Trans: {
inherit: ( "High_Priest", "Arch_Bishop" );
@@ -2774,7 +2774,7 @@ Guillotine_Cross_Trans: {
Royal_Guard: {
inherit: ( "Crusader" );
- skills: {
+ skills: {
LG_CANNONSPEAR: {
MaxLevel: 5
LG_PINPOINTATTACK: 1
@@ -2861,7 +2861,7 @@ Royal_Guard: {
Sorcerer: {
inherit: ( "Sage" );
- skills: {
+ skills: {
SO_FIREWALK: {
MaxLevel: 5
SA_VOLCANO: 1
@@ -2988,7 +2988,7 @@ Sorcerer: {
Minstrel: {
inherit: ( "Bard" );
- skills: {
+ skills: {
MI_RUSH_WINDMILL: {
MaxLevel: 5
WM_LULLABY_DEEPSLEEP: 1
@@ -3100,7 +3100,7 @@ Minstrel: {
Wanderer: {
inherit: ( "Dancer" );
- skills: {
+ skills: {
WA_SWING_DANCE: {
MaxLevel: 5
WM_LULLABY_DEEPSLEEP: 1
@@ -3212,7 +3212,7 @@ Wanderer: {
Sura: {
inherit: ( "Monk" );
- skills: {
+ skills: {
SR_DRAGONCOMBO: {
MaxLevel: 10
MO_TRIPLEATTACK: 5
@@ -3321,7 +3321,7 @@ Sura: {
Genetic: {
inherit: ( "Alchemist" );
- skills: {
+ skills: {
GN_TRAINING_SWORD: 5
GN_REMODELING_CART: 5
GN_CART_TORNADO: {
@@ -3396,7 +3396,7 @@ Genetic: {
Shadow_Chaser: {
inherit: ( "Rogue" );
- skills: {
+ skills: {
SC_FATALMENACE: {
MaxLevel: 5
RG_INTIMIDATE: 5
@@ -3557,7 +3557,7 @@ Baby_Shadow_Chaser: {
Expanded_Super_Novice: {
inherit: ( "Super_Novice" );
- skills: {
+ skills: {
PR_IMPOSITIO: 5
PR_SANCTUARY: {
MaxLevel: 10
@@ -3665,12 +3665,12 @@ Expanded_Super_Novice: {
}
}
Expanded_Super_Baby: {
- inherit: ( "Expanded_Super_Novice" );
+ inherit: ( "Expanded_Super_Novice" );
}
Kagerou: {
- inherit: ( "Ninja" );
+ inherit: ( "Ninja" );
- skills: {
+ skills: {
KO_YAMIKUMO: {
MaxLevel: 1
NJ_KIRIKAGE: 5
@@ -3760,9 +3760,9 @@ Kagerou: {
}
}
Oboro: {
- inherit: ( "Ninja" );
+ inherit: ( "Ninja" );
- skills: {
+ skills: {
KO_YAMIKUMO: {
MaxLevel: 1
NJ_KIRIKAGE: 5
@@ -3852,7 +3852,7 @@ Oboro: {
}
}
Rebellion: {
- inherit: ( "Gunslinger" );
+ inherit: ( "Gunslinger" );
skills: {
RL_RICHS_COIN: {
diff --git a/db/re/skill_unit_db.txt b/db/re/skill_unit_db.txt
index ffc451a0e..fc74dcbce 100644
--- a/db/re/skill_unit_db.txt
+++ b/db/re/skill_unit_db.txt
@@ -168,7 +168,7 @@
5010,0xfe, , 0, 2, -1,enemy, 0x000 //SC_ESCAPE
8020,0xf5, , 0, 3,2300:2100:1900:1700:1500,enemy, 0x018 //MH_POISON_MIST
-8033,0x7e, , 0, 0, -1,all, 0x003 //MH_STEINWAND
+8033,0x7e, , 0, 0, -1,all, 0x003 //MH_STEINWAND
8025,0x86, , 0, 2:2:3:3:4,1000,enemy, 0x018 //MH_XENO_SLASHER
8041,0xf6, , 1:1:2:2:3, 0,2000,enemy, 0x01A //MH_LAVA_SLIDE
8043,0xf7, , 1, 0,-1,enemy, 0x2018 //MH_VOLCANIC_ASH
@@ -184,7 +184,7 @@
8409,0xef, , 0, 1, -1,friend,0x2018 //EL_ZEPHYR
8412,0xf0, , 0, 1, -1,friend,0x2018 //EL_POWER_OF_GAIA
-10006,0xc1, , 2, 0, -1,sameguild, 0x040 //GD_LEADERSHIP
-10007,0xc2, , 2, 0, -1,sameguild, 0x040 //GD_GLORYWOUNDS
-10008,0xc3, , 2, 0, -1,sameguild, 0x040 //GD_SOULCOLD
-10009,0xc4, , 2, 0, -1,sameguild, 0x040 //GD_HAWKEYES
+10006,0xc1, , 2, 0, -1,sameguild, 0x040 //GD_LEADERSHIP
+10007,0xc2, , 2, 0, -1,sameguild, 0x040 //GD_GLORYWOUNDS
+10008,0xc3, , 2, 0, -1,sameguild, 0x040 //GD_SOULCOLD
+10009,0xc4, , 2, 0, -1,sameguild, 0x040 //GD_HAWKEYES
diff --git a/db/roulette_db.conf b/db/roulette_db.conf
index c82bb0830..6ab579dba 100644
--- a/db/roulette_db.conf
+++ b/db/roulette_db.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
//= http://herc.ws/board/topic/7618-2014-10-22-roulette-and-per-char-gender/
//====================================================
@@ -74,4 +74,3 @@ roulette: (
}
}
)
-
diff --git a/db/sc_config.txt b/db/sc_config.txt
index cd0b050f6..650409f6c 100644
--- a/db/sc_config.txt
+++ b/db/sc_config.txt
@@ -11,8 +11,8 @@
// 32 - SC considered as debuff and be removed by Gospel and etc.
// 64 - SC cannot be reset when MADO Gear is taken off.
// 128 - SC cannot be reset by 'sc_end SC_ALL' and status change clear.
-//Example:
-//SC_ENDURE, 21 //SC_ENDURE: cannot be removed by death and dispell and cosidered as buff. (16 + 4 + 1 = 21)
+// Example:
+// SC_ENDURE, 21 //SC_ENDURE: cannot be removed by death and dispell and cosidered as buff. (16 + 4 + 1 = 21)
SC_PROVOKE, 32
SC_ENDURE, 21
diff --git a/db/skill_changematerial_db.txt b/db/skill_changematerial_db.txt
index 78920cd66..3fb92139e 100644
--- a/db/skill_changematerial_db.txt
+++ b/db/skill_changematerial_db.txt
@@ -4,17 +4,17 @@
// ProductID,BaseRate,MakeAmount1,MakeAmountRate1,MakeAmount2,MakeAmountRate2
// MakeAmount3,MakeAmountRate3,MakeAmount4,MakeAmountRate4,MakeAmount5,MakeAmountRate5
//====================================================
-// NOTE:
+// NOTE:
// Up to 5 ID/Amount pairs can be specified.
// Rate = n/10%
//====================================================
-703,4,800,2,200 // Hinalle
+703,4,800,2,200 // Hinalle
958,800,9,1000 // Horrendous_Mouth
959,800,7,1000 // Rotten_Scale
-960,1000,6,800,9,200 // Nipper
+960,1000,6,800,9,200 // Nipper
961,800,3,1000 // Conch
-962,1000,4,800,6,200 // Tentacle
+962,1000,4,800,6,200 // Tentacle
963,800,3,1000 // Sharp_Scale
964,800,8,1000 // Crap_Shell
967,800,4,1000 // Turtle_Shell
@@ -22,9 +22,9 @@
970,800,9,1000 // Alchol
971,800,5,1000 // Detrimindexta
973,800,4,1000 // Counteragent
-974,1000,4,800,6,200 // Mixture
-991,1000,1,500,1,500 // Crystal_Blue
-992,1000,1,500,1,500 // Wind_Of_Verdure
+974,1000,4,800,6,200 // Mixture
+991,1000,1,500,1,500 // Crystal_Blue
+992,1000,1,500,1,500 // Wind_Of_Verdure
999,1000,10,1000 // Steel
1003,500,1,1000 // Coal
1008,800,6,1000 // Frozen_Heart
@@ -34,21 +34,21 @@
1012,800,3,1000 // Lizard_Scruff
1013,9,800,13,200 // Colorful_Shell
1014,4,800,6,200 // Jaws_Of_Ant
-1016,1000,7,800,10,200 // Rat_Tail
+1016,1000,7,800,10,200 // Rat_Tail
1019,800,2,1000 // Wooden_Block
-1020,1000,4,800,6,200 // Long_Hair
+1020,1000,4,800,6,200 // Long_Hair
1021,800,4,1000 // Dokkaebi_Horn
-1022,1000,2,800,3,200 // Fox_Tail
+1022,1000,2,800,3,200 // Fox_Tail
1024,800,4,1000 // Chinese_Ink
1025,800,8,1000 // Spiderweb
1026,800,4,1000 // Acorn
1030,800,2,1000 // Tiger_Footskin
-1033,1000,4,800,6,200 // Root_Of_Maneater
-1034,1000,6,800,9,200 // Cobold_Hair
-1035,1000,8,800,12,200 // Dragon_Canine
+1033,1000,4,800,6,200 // Root_Of_Maneater
+1034,1000,6,800,9,200 // Cobold_Hair
+1035,1000,8,800,12,200 // Dragon_Canine
1037,800,6,1000 // Dragon_Train
-1038,1000,1,1000 // Petite_Dablofs_Horn
-1040,1000,8,800,12,200 // Elder_Pixie's_Beard
+1038,1000,1,1000 // Petite_Dablofs_Horn
+1040,1000,8,800,12,200 // Elder_Pixie's_Beard
1041,800,3,1000 // Lantern
1042,800,6,1000 // Short_Leg
1043,800,6,1000 // Nail_Of_Orc
@@ -57,7 +57,7 @@
1049,800,6,1000 // Skirt_Of_Virgin
1050,800,3,1000 // Tendon
1051,800,7,1000 // Detonator
-1053,1000,6,800,9,200 // Tooth_Of_Ancient_Fish
+1053,1000,6,800,9,200 // Tooth_Of_Ancient_Fish
1056,800,8,1000 // Grit
1058,800,5,1000 // Wing_Of_Moth
1059,1000,5,1000 // Transparent_Cloth
diff --git a/db/translations.conf b/db/translations.conf
index fc8144636..a93e86384 100644
--- a/db/translations.conf
+++ b/db/translations.conf
@@ -1,12 +1,12 @@
//====================================================
-//= _ _ _
-//= | | | | | |
-//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
-//=
-//= http://herc.ws/board/
+//=
+//= http://herc.ws/board/
//================= More Information =================
//= http://herc.ws/board/topic/8687-hercules-ultimate-localization-design/
//====================================================
@@ -17,4 +17,4 @@
translations: (
//"path/to/my/Language.po",
//"db/Spanish.po", //(Example)
-) \ No newline at end of file
+)
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 0726630df..146e58a45 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3988,7 +3988,7 @@ night mode or day mode:
//=====================================
---------------------------------------
-*isequipped(<id>{,<id>{,<id>{,<id>}}})
+*isequipped(<item id>{,<item id>{,<item id>{,<item id>}}})
This function will return 1 if the invoking character has all of the item
IDs given equipped (if card IDs are passed, then it checks if the cards
@@ -4001,19 +4001,22 @@ If even one of the items given is not equipped, 0 will be returned.
if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
// (Poring)
if (isequipped(4001)) mes "A poring card is useful, don't you think?";
+ // (Earring)
+ if (isequipped(2622)) mes "You got a pair of nice Earring.";
The function was meant for item scripts to support the cards released by
Gravity in February 2005, but it will work just fine in normal NPC scripts.
---------------------------------------
-*isequippedcnt(<card id>{,<card id>{,<card id>{,<card id>}}})
+*isequippedcnt(<item id>{,<item id>{,<item id>{,<item id>}}})
This function is similar to 'isequipped', but instead of 1 or 0, it will
-return the number of cards in the list given that were found on the
+return the number of equipped items/cards in the list given that were found on the
invoking character.
if (isequippedcnt(4001,4005,4033,4196) == 4) mes "Finally got all four poring cards?";
+ if (isequippedcnt(5353,2622) == 2) mes "You equipped both Helm of Sun and Earring.";
---------------------------------------
@@ -5831,7 +5834,7 @@ Examples:
---------------------------------------
*pcblockmove <id>,<option>;
-
+
Prevents the given ID from moving when the option != 0, and 0 enables the
ID to move again. The ID can either be the GID of a monster/NPC or account
ID of a character, and will run for the attached player if zero is
@@ -6301,7 +6304,7 @@ A debug message also shows on the console when no events are triggered.
---------------------------------------
-*npctalk "<message>";
+*npctalk "<message>"{,"<npc name>"};
This command will display a message to the surrounding area as if the NPC
object running it was a player talking - that is, above their head and in
@@ -6311,6 +6314,7 @@ the message to complete the effect.
// This will make everyone in the area see the NPC greet the character
// who just invoked it.
npctalk "Hello "+strcharinfo(0)+", how are you?";
+ npctalk "Hello "+strcharinfo(0)+", how are you?","Another_NPC_Name";
---------------------------------------
@@ -6794,7 +6798,8 @@ if any.
The valid information types are:
- 0 - Number of users currently chatting.
+ 0 - Number of users currently in the waiting room
+ $@chatmembers[] - list of user account_id
1 - Maximum number of users allowed.
2 - Will return 1 if the waiting room has a trigger set.
0 otherwise.
@@ -6807,6 +6812,10 @@ The valid information types are:
32 - Whether or not the waiting room is full.
33 - Whether the amount of users in the waiting room is higher than the
trigger number.
+ 34 - Minimum Base Level to enter waiting room.
+ 35 - Maximum Base Level to enter waiting room.
+ 36 - Minimum Zeny to enter waiting room.
+
---------------------------------------
diff --git a/npc/airports/airships.txt b/npc/airports/airships.txt
index eaf042978..9a9941e25 100644
--- a/npc/airports/airships.txt
+++ b/npc/airports/airships.txt
@@ -650,7 +650,7 @@ airplane,50,66,5 script Apple Merchant#airplane 4_M_04,{
airplane_01,243,73,0 script #AirshipWarp-3 WARPNPC,1,1,{
end;
-
+
OnTouch:
switch ($@airplanelocation2) {
case 0: warp "ra_fild12",292,204; end;
@@ -668,7 +668,7 @@ OnHide:
specialeffect EF_BASH;
disablenpc strnpcinfo(0);
end;
-
+
OnUnhide:
enablenpc strnpcinfo(0);
specialeffect EF_SUMMONSLAVE;
diff --git a/npc/battleground/kvm/kvm01.txt b/npc/battleground/kvm/kvm01.txt
index d5ecdfa31..951d9ef2b 100644
--- a/npc/battleground/kvm/kvm01.txt
+++ b/npc/battleground/kvm/kvm01.txt
@@ -25,7 +25,7 @@ bat_room,169,226,5 script KVM Waiting Room#a::KvM01R_Guillaume 4_M_KY_KNT,{
OnInit:
waitingroom "Battle Station 5 Players",6,"KvM01_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
$@KvM01BG_id1 = waitingroom2bg("bat_c01",52,129,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
end;
diff --git a/npc/battleground/kvm/kvm02.txt b/npc/battleground/kvm/kvm02.txt
index bf41528cc..ea2a32bbc 100644
--- a/npc/battleground/kvm/kvm02.txt
+++ b/npc/battleground/kvm/kvm02.txt
@@ -27,7 +27,7 @@ bat_room,197,226,5 script KVM Waiting Room#a2::KvM02R_Guillaume 4_M_KY_KNT,{
OnInit:
waitingroom "Battle Station 5 Players",6,"KvM02_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
$@KvM02BG_id1 = waitingroom2bg("bat_c02",52,129,"KvM02_BG::OnGuillaumeQuit","KvM02_BG::OnGuillaumeDie");
end;
diff --git a/npc/battleground/kvm/kvm03.txt b/npc/battleground/kvm/kvm03.txt
index f4bd49d4f..279a0b5fe 100644
--- a/npc/battleground/kvm/kvm03.txt
+++ b/npc/battleground/kvm/kvm03.txt
@@ -26,7 +26,7 @@ bat_room,225,226,5 script KVM Waiting Room#a3::KvM03R_Guillaume 4_M_KY_KNT,{
OnInit:
waitingroom "Battle Station 5 Players",6,"KvM03_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
$@KvM03BG_id1 = waitingroom2bg("bat_c03",52,129,"KvM03_BG::OnGuillaumeQuit","KvM03_BG::OnGuillaumeDie");
end;
diff --git a/npc/cities/amatsu.txt b/npc/cities/amatsu.txt
index 54f23c853..3db68617e 100644
--- a/npc/cities/amatsu.txt
+++ b/npc/cities/amatsu.txt
@@ -165,7 +165,7 @@ amatsu,230,160,3 script Well-side Maiden#ama 4_F_JPN2,{
mes "It really gives me the creeps.";
close;
}
-
+
amatsu,179,107,4 script John#ama 4_M_04,{
mes "[John]";
mes "Yo~";
@@ -222,7 +222,7 @@ amatsu,179,107,4 script John#ama 4_M_04,{
mes "I guess it's over...";
close;
}
-
+
amatsu,205,163,3 script Mimi#ama 4_F_JPNCHIBI,{
mes "[Mimi]";
mes "Puhuhu~!";
@@ -240,7 +240,7 @@ amatsu,205,163,3 script Mimi#ama 4_F_JPNCHIBI,{
mes "A lady can always use a little more makeup.";
close;
}
-
+
amatsu,185,115,3 script Drunken Man#ama 4_M_JPNOJI2,{
mes "[Kosake]";
mes "*Hiccup*...My wife is just like,";
@@ -280,7 +280,7 @@ amatsu,185,115,3 script Drunken Man#ama 4_M_JPNOJI2,{
mes "If you buy me a drink, I will think about it...Hehehe...*Hiccup*..";
close;
}
-
+
amatsu,217,179,1 script Grandma#ama 4_F_JPNOBA2,{
mes "[Hatsue]";
mes "I'm worried about my husband.";
@@ -292,7 +292,7 @@ amatsu,217,179,1 script Grandma#ama 4_F_JPNOBA2,{
mes "went to the bar and starts drinking again? The man just doesn't have any backbone. *Phew*";
close;
}
-
+
amatsu,287,266,3 script Jyaburo#ama 4_M_JPNOJI,{
mes "[Jyaburo]";
mes "This place is special to me.";
@@ -372,7 +372,7 @@ amatsu,269,221,1 script Propose Girl#ama 4_F_JPN,{
mes "happy things will happen, if you do.";
close;
}
-
+
amatsu,243,202,3 script Drama Teacher#ama 4_F_JPNOBA2,{
jap_tree = 2;
mes "[Garakame sensei]";
@@ -417,7 +417,7 @@ amatsu,243,202,3 script Drama Teacher#ama 4_F_JPNOBA2,{
mes "someday when you are ready.";
close;
}
-
+
amatsu,283,203,1 script Bonubonu#ama1 SEE_OTTER,{
end;
}
@@ -451,7 +451,7 @@ amatsu,283,203,1 script Bonubonu#ama2 HIDDEN_NPC,{
mes "It is really a miraculous and gracious tree...";
close;
}
-
+
amatsu,274,178,7 script Veterinarian#ama 4_M_JOB_WIZARD,{
jap_tree = 4;
mes "[Sakura Seiichi]";
@@ -504,7 +504,7 @@ amatsu,274,178,7 script Veterinarian#ama 4_M_JOB_WIZARD,{
mes "Finally, I couldn't even hear anything. I can't even recall what he was trying to tell me...^000000";
close;
}
-
+
amatsu,262,197,1 script Legendary Tree HIDDEN_NPC,{
if (jap_tree == 1) {
mes "^3355FFAs she mentioned, this tree";
diff --git a/npc/cities/ayothaya.txt b/npc/cities/ayothaya.txt
index db1a47a31..4eba67b7f 100644
--- a/npc/cities/ayothaya.txt
+++ b/npc/cities/ayothaya.txt
@@ -120,7 +120,7 @@ ayothaya,189,120,3 script Young Man#Thang 4_M_THAIONGBAK,{
mes "I think.";
close;
}
-
+
ayothaya,171,152,5 script Girl#Lalitha 4_F_THAIAYO,{
.@sit = rand(1,5);
if (.@sit > 0 && .@sit < 3) {
@@ -191,7 +191,7 @@ ayothaya,171,152,5 script Girl#Lalitha 4_F_THAIAYO,{
mes "What's up?";
close;
}
-
+
ayothaya,143,102,5 script Old Man#ayothaya 4_M_THAIOLD,{
mes "[Villager]";
mes "Ummm.";
@@ -236,7 +236,7 @@ ayothaya,143,102,5 script Old Man#ayothaya 4_M_THAIOLD,{
mes "at least once.";
close;
}
-
+
ayothaya,197,189,5 script Young Man#1ayothaya 4_M_THAIAYO,{
mes "[Kwan]";
mes "Phew, isn't it";
@@ -262,7 +262,7 @@ ayothaya,197,189,5 script Young Man#1ayothaya 4_M_THAIAYO,{
mes "Well, anyway, it's still a really good idea to stay away from that place. I hope you enjoy visiting Ayotaya, and that you keep safe~";
close;
}
-
+
ayothaya,214,142,5 script Young Man#5ayothaya 4_M_THAIONGBAK,{
mes "[Detzi]";
mes "In Ayotaya, we have our own traditional martial arts. We, the young men of the village, practice our traditional martial arts in order to become strong.";
@@ -271,7 +271,7 @@ ayothaya,214,142,5 script Young Man#5ayothaya 4_M_THAIONGBAK,{
mes "Why don't you learn our martial arts? I guarantee that it will help you greatly in your travels.";
close;
}
-
+
ayothaya,241,264,5 script Young Man#5ayothaya2 4_M_THAIONGBAK,{
mes "[Eik]";
mes "Hey...";
diff --git a/npc/cities/einbech.txt b/npc/cities/einbech.txt
index d3d853846..428b680e0 100644
--- a/npc/cities/einbech.txt
+++ b/npc/cities/einbech.txt
@@ -429,7 +429,7 @@ ein_in01,279,92,3 script Tavern Lady#ein 4_M_EINMAN2,{
mes "freshly knit doilies?";
close;
}
-
+
ein_in01,277,95,7 script Ryan Danger#air#einbech 4_M_EINMAN,{
mes "[R.D. Kim]";
mes "Oooh...";
@@ -481,7 +481,7 @@ ein_in01,277,95,7 script Ryan Danger#air#einbech 4_M_EINMAN,{
mes "of his freakin' mind!)";
close;
}
-
+
ein_in01,281,85,3 script Drunken Man#einbech 4_M_DIEMAN,{
mes "[Drunken Man]";
mes "...^333333*Hiccup*^000000...";
@@ -740,7 +740,7 @@ einbech,46,107,6 script Shena#ein::EinMonsters 4_F_EINOLD,{
close;
}
}
-
+
einbech,48,107,4 duplicate(EinMonsters) Luda#ein 4_F_EINWOMAN,{
einbech,148,242,5 script Jung#ein 4_M_EINMAN,{
diff --git a/npc/cities/einbroch.txt b/npc/cities/einbroch.txt
index 714b0bde6..b84a1d897 100644
--- a/npc/cities/einbroch.txt
+++ b/npc/cities/einbroch.txt
@@ -237,7 +237,7 @@ einbroch,232,272,3 script Train Station Staff#ein1::EinbrochTrain 4_M_EIN_SOLDIE
close;
}
}
-
+
einbroch,252,301,3 duplicate(EinbrochTrain) Train Station Staff#ein2 4_M_EIN_SOLDIER
einbroch,259,326,3 script Leslie#ein_1 4_F_EINOLD,{
@@ -285,7 +285,7 @@ einbroch,236,191,3 script Tan#ein 4_M_EINMAN,{
mes "you should carry one with you.";
close;
}
-
+
einbroch,228,121,5 script Little Toby#ein-1 4_M_EINMAN,{
mes "[Little Toby]";
mes "Excuse me...";
diff --git a/npc/cities/geffen.txt b/npc/cities/geffen.txt
index a5d3e8354..58742ae48 100644
--- a/npc/cities/geffen.txt
+++ b/npc/cities/geffen.txt
@@ -181,7 +181,7 @@ geffen,111,48,0 script Stacey 4W_F_01,{
close;
}
}
-
+
geffen_in,34,170,0 script Theodore 1_M_01,{
mes "[Theodore]";
mes "Hello!";
@@ -872,7 +872,7 @@ geffen_in,79,76,2 script Merchant Daven 2_M_PHARMACIST,{
}
close;
}
-
+
geffen_in,114,73,5 script Hadenheim 4_M_SEAMAN,{
mes "[Hans Hadenheim]";
mes "Man, the Rune-Midgard continent sure is big! How's it going, youngster?";
@@ -1335,7 +1335,7 @@ geffen_in,39,127,2 script Psychic Advisor 4_M_BIBI,{
close;
}
}
-
+
geffen_in,109,72,2 script Monster Scholar 4_F_01,{
mes "[Estheres]";
mes "Hello, I'm the resident expert of Monsterology here in Geffen. Is there anything in particular that you're curious about?";
diff --git a/npc/cities/hugel.txt b/npc/cities/hugel.txt
index aae031ebd..5d3458799 100644
--- a/npc/cities/hugel.txt
+++ b/npc/cities/hugel.txt
@@ -55,7 +55,7 @@ hugel,126,151,3 script Emily 4_F_01,{
mes "Don't you think that sounds weird?";
close;
}
-
+
hugel,86,165,5 script Kayplas 4_M_HUBOY,{
mes "[Kayplas]";
mes "Ooh, I really want to";
diff --git a/npc/cities/jawaii.txt b/npc/cities/jawaii.txt
index 85a993c89..a8cc57ee2 100644
--- a/npc/cities/jawaii.txt
+++ b/npc/cities/jawaii.txt
@@ -624,7 +624,7 @@ jawaii_in,30,96,4 script Employee#jaw6 4_F_07,{
}
mes "I hope you will have a good time.";
close;
-
+
OnWelcome:
emotion e_kis;
end;
@@ -714,7 +714,7 @@ OnTouch:
donpcevent "Employee#jaw1::OnSolo";
end;
}
-
+
jawaii_in,15,104,0 script Waitress#jawaii 1_F_PUBGIRL,{
if (checkweight(1201,1) == 0) {
mes "^3355FF * Wait a minute! *";
@@ -1113,7 +1113,7 @@ S_KillChar:
mes "[Bartender]";
return;
}
-
+
jawaii_in,43,115,0 script Customer#jaw_1 4W_M_01,{
if (!getpartnerid()) {
if (Zeny > 99) {
@@ -1388,7 +1388,7 @@ prt_in,173,13,4 script Customer#SoloHan 4_M_04,{
mes "Is this the third time this week I've gotten plastered? Bachewcca, help me count!";
close;
}
-
+
prt_in,170,14,0 script Customer#Bachewcca 4_M_ORIENT02,{
mes "[Bachewcca]";
mes "..............";
diff --git a/npc/cities/morocc.txt b/npc/cities/morocc.txt
index e2ca328df..70b652508 100644
--- a/npc/cities/morocc.txt
+++ b/npc/cities/morocc.txt
@@ -777,4 +777,3 @@ moc_fild16,200,231,4 duplicate(SinGuard) Assassin Guardian#5 4_M_MOC_SOLDIER
moc_fild16,211,231,4 duplicate(SinGuard) Assassin Guardian#6 4_M_MOC_SOLDIER
moc_fild16,200,257,4 duplicate(SinGuard) Assassin Guardian#7 4_M_MOC_SOLDIER
moc_fild16,211,257,4 duplicate(SinGuard) Assassin Guardian#8 4_M_MOC_SOLDIER
-
diff --git a/npc/cities/moscovia.txt b/npc/cities/moscovia.txt
index 74c121836..e6653fef0 100644
--- a/npc/cities/moscovia.txt
+++ b/npc/cities/moscovia.txt
@@ -46,7 +46,6 @@
mes "I'll help you to have a nice trip";
mes "to Moscovia!";
close;
-
case 2:
mes "[Moscovia P.R. Officer]";
mes "Ok then, let us start now.";
@@ -114,7 +113,6 @@ moscovia,166,53,4 script Moscovia P.R. Officer#2 4_F_RUSWOMAN2,{
end;
}
-
// Moscovia Palace :: mos_swan
//============================================================
moscovia,253,166,4 script Soldier#mosk1 4_M_RUSKNIGHT,{
diff --git a/npc/cities/yuno.txt b/npc/cities/yuno.txt
index cda19d322..526a91551 100644
--- a/npc/cities/yuno.txt
+++ b/npc/cities/yuno.txt
@@ -56,7 +56,7 @@ yuno,184,173,4 script Freidrich#juno 4_F_NOVICE,{
close;
}
}
-
+
yuno,337,227,4 script Juno Granny#juno 8_F_GRANDMOTHER,{
mes "[Granny]";
if (rand(1,50) == 1) {
@@ -195,7 +195,7 @@ yuno,165,111,4 script Juno Sage#juno 2_F_MAGICMASTER,,{
close;
}
}
-
+
yuno,157,205,4 script Juno Artisan#juno 1_M_JOBGUIDER,{
mes "[Artisan]";
mes "*Mumble mumble...*";
diff --git a/npc/custom/battleground/bg_common.txt b/npc/custom/battleground/bg_common.txt
index 8b99deb39..54b13bb28 100644
--- a/npc/custom/battleground/bg_common.txt
+++ b/npc/custom/battleground/bg_common.txt
@@ -137,14 +137,14 @@ bat_room,160,140,3 script Prince Croix 4_M_CRU_CRUA,{
// *********************************************************************
function script Time2Str {
set .@time_left, getarg(0) - gettimetick(2);
-
+
set .@Days, .@time_left / 86400;
set .@time_left, .@time_left - (.@Days * 86400);
set .@Hours, .@time_left / 3600;
set .@time_left, .@time_left - (.@Hours * 3600);
set .@Minutes, .@time_left / 60;
set .@time_left, .@time_left - (.@Minutes * 60);
-
+
set .@Time$, "";
if( .@Days > 1 )
set .@Time$, .@Time$ + .@Days + " days, ";
@@ -165,7 +165,7 @@ function script Time2Str {
set .@Time$, .@Time$ + .@time_left + " seconds.";
else if( .@time_left == 1 )
set .@Time$, .@Time$ + .@time_left + " second.";
-
+
return .@Time$;
}
@@ -203,7 +203,7 @@ bat_room,156,178,5 script Tierra Valley Officer#1 4_M_KY_KNT,{
mes "Please sign up for an army with Prince Croix or General Guillaume!";
close;
}
-
+
mes "Hello " + strcharinfo(0) + ", let's show the power of the Guillaume Army to those stinky Croixs!";
next;
if( select("I want to join your army!:End Conversation") == 2 )
@@ -226,7 +226,7 @@ bat_room,156,178,5 script Tierra Valley Officer#1 4_M_KY_KNT,{
mes "Stand-by for Tierra Gorge Battle until the time limit passes.";
close;
}
-
+
if( BaseLevel < 80 )
{
mes "I'm very please you want to join our army, but I'm sorry: I can't send a rookie like you to die on the cruel battlefield";
@@ -343,7 +343,7 @@ bat_room,164,178,5 script Tierra Valley Officer#3 4_M_KY_KNT,{
mes "Please sign up for an army with Prince Croix or General Guillaume!";
close;
}
-
+
mes "Hello " + strcharinfo(0) + ", let's show the power of the Guillaume Army to those stinky Croixs!";
next;
if( select("I want to join your army!:End Conversation") == 2 )
@@ -1260,7 +1260,7 @@ bat_room,160,150,3 script Erundek 4_M_MANAGER,{
case 4: setarray .@Item_DB[0],2376,2377,2378,2379,2380,2381,2382; set .@Value, 80; break;
case 5: setarray .@Item_DB[0],2720,2721,2722,2723,2724,2725,2733; set .@Value, 500; break;
}
-
+
break;
case 3: // Valor Badges
mes "[Erundek]";
@@ -1278,7 +1278,7 @@ bat_room,160,150,3 script Erundek 4_M_MANAGER,{
case 4: setarray .@Item_DB[0],2376,2377,2378,2379,2380,2381,2382; set .@Value, 80; break;
case 5: setarray .@Item_DB[0],2720,2721,2722,2723,2724,2725,2733; set .@Value, 500; break;
}
-
+
break;
case 4: // Heroism Badge
mes "[Erundek]";
@@ -1286,7 +1286,7 @@ bat_room,160,150,3 script Erundek 4_M_MANAGER,{
mes "This shop is not available at the moment.";
close;
}
-
+
mes "[Erundek]";
mes "What item do you want to exchange?";
mes "If you are not sure, check the catalog.";
@@ -1305,21 +1305,21 @@ bat_room,160,150,3 script Erundek 4_M_MANAGER,{
mes "Remember, Battleground Reward Items are ^FF0000Character Bound^000000.";
mes "Are you sure you want this item?";
next;
-
+
if( select("Yes:No") == 2 )
{
mes "[Erundek]";
mes "Do you need more time to check the items?";
close;
}
-
+
if( countitem(.@Badge) < .@Value )
{
mes "[Erundek]";
mes "I'm sorry, but you don't have enough badges to exchange.";
close;
}
-
+
delitem .@Badge,.@Value;
getitem .@Item_ID,1;
mes "[Erundek]";
diff --git a/npc/custom/battleground/bg_flavius_01.txt b/npc/custom/battleground/bg_flavius_01.txt
index fd0cf9112..30693da21 100644
--- a/npc/custom/battleground/bg_flavius_01.txt
+++ b/npc/custom/battleground/bg_flavius_01.txt
@@ -54,7 +54,7 @@ OnReadyCheck:
end;
set .@Guillaume, getwaitingroomstate(0,"Fl1R_Guillaume");
set .@Croix, getwaitingroomstate(0,"Fl1R_Croix");
-
+
if( .@Guillaume < 10 || .@Croix < 10 )
{
mapannounce "bat_room","Battleground -- Flavius [80-99] G: " + .@Guillaume + "/10, C: " + .@Croix + "/10",1,0x006400;
diff --git a/npc/custom/battleground/bg_flavius_02.txt b/npc/custom/battleground/bg_flavius_02.txt
index f7b7756f4..c735614c1 100644
--- a/npc/custom/battleground/bg_flavius_02.txt
+++ b/npc/custom/battleground/bg_flavius_02.txt
@@ -54,7 +54,7 @@ OnReadyCheck:
end;
set .@Guillaume, getwaitingroomstate(0,"Fl2R_Guillaume");
set .@Croix, getwaitingroomstate(0,"Fl2R_Croix");
-
+
if( .@Guillaume < 10 || .@Croix < 10 )
{
mapannounce "bat_room","Battleground -- Flavius [80-99] G: " + .@Guillaume + "/10, C: " + .@Croix + "/10",1,0x808000;
diff --git a/npc/custom/battleground/bg_kvm01.txt b/npc/custom/battleground/bg_kvm01.txt
index aa12759b9..be826215e 100644
--- a/npc/custom/battleground/bg_kvm01.txt
+++ b/npc/custom/battleground/bg_kvm01.txt
@@ -11,7 +11,7 @@ bat_room,253,227,4 script Registration::KvM01R_Guillaume 4_M_KY_KNT,{ // KvM Gui
OnInit:
waitingroom "Battle Station 5 Players",5,"KvM01_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
set $@KvM01BG_id1, waitingroom2bg("bat_c01",53,128,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
end;
@@ -150,7 +150,7 @@ OnTimer27000:
OnTimer28000:
donpcevent "::OnKvM01LightB";
end;
-
+
OnTimer29000:
donpcevent "::OnKvM01LightC";
end;
@@ -205,7 +205,7 @@ OnTimer330000:
OnGuillaumeWin:
set $@KvM01BG, 3;
set $@KvM01BG_Victory, 1;
-
+
stopnpctimer;
sleep 2000;
mapannounce "bat_c01","The Guillaume Army has won the Battle of Kreiger Von Midgard",1,0x0000FF;
diff --git a/npc/custom/battleground/bg_kvm02.txt b/npc/custom/battleground/bg_kvm02.txt
index f2f5f7ca1..91e594a90 100644
--- a/npc/custom/battleground/bg_kvm02.txt
+++ b/npc/custom/battleground/bg_kvm02.txt
@@ -11,7 +11,7 @@ bat_room,225,227,4 script Registration::KvM02R_Guillaume 4_M_KY_KNT,{ // KvM Gui
OnInit:
waitingroom "Battle Station 5 Players",5,"KvM02_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
set $@KvM02BG_id1, waitingroom2bg("bat_c02",53,128,"KvM02_BG::OnGuillaumeQuit","KvM02_BG::OnGuillaumeDie");
end;
@@ -150,7 +150,7 @@ OnTimer27000:
OnTimer28000:
donpcevent "::OnKvM02LightB";
end;
-
+
OnTimer29000:
donpcevent "::OnKvM02LightC";
end;
@@ -205,7 +205,7 @@ OnTimer330000:
OnGuillaumeWin:
set $@KvM02BG, 3;
set $@KvM02BG_Victory, 1;
-
+
stopnpctimer;
sleep 2000;
mapannounce "bat_c02","The Guillaume Army has won the Battle of Kreiger Von Midgard",1,0x0000FF;
diff --git a/npc/custom/battleground/bg_kvm03.txt b/npc/custom/battleground/bg_kvm03.txt
index f38e81bd1..33edb0be7 100644
--- a/npc/custom/battleground/bg_kvm03.txt
+++ b/npc/custom/battleground/bg_kvm03.txt
@@ -11,7 +11,7 @@ bat_room,197,227,4 script Registration::KvM03R_Guillaume 4_M_KY_KNT,{ // KvM Gui
OnInit:
waitingroom "Battle Station 5 Players",5,"KvM03_BG::OnGuillaumeJoin",1;
end;
-
+
OnEnterBG:
set $@KvM03BG_id1, waitingroom2bg("bat_c03",53,128,"KvM03_BG::OnGuillaumeQuit","KvM03_BG::OnGuillaumeDie");
end;
@@ -150,7 +150,7 @@ OnTimer27000:
OnTimer28000:
donpcevent "::OnKvM03LightB";
end;
-
+
OnTimer29000:
donpcevent "::OnKvM03LightC";
end;
@@ -205,7 +205,7 @@ OnTimer330000:
OnGuillaumeWin:
set $@KvM03BG, 3;
set $@KvM03BG_Victory, 1;
-
+
stopnpctimer;
sleep 2000;
mapannounce "bat_c03","The Guillaume Army has won the Battle of Kreiger Von Midgard",1,0x0000FF;
diff --git a/npc/custom/battleground/bg_tierra_01.txt b/npc/custom/battleground/bg_tierra_01.txt
index 671c2d929..797b3a389 100644
--- a/npc/custom/battleground/bg_tierra_01.txt
+++ b/npc/custom/battleground/bg_tierra_01.txt
@@ -69,7 +69,7 @@ OnReadyCheck:
bg_monster $@TierraBG1_id1,"bat_a01",176,345,"Food Depot",1909,"Tierra_BG1::OnGuillaumeBreak";
bg_monster $@TierraBG1_id2,"bat_a01",167,50,"Food Storage",1910,"Tierra_BG1::OnCroixBreak";
bg_monster 0,"bat_a01",273,204,"Neutrality Flag",1911,"Tierra_BG1::OnNeutralBreak";
-
+
set .Neutral_Base, 0;
set $@TierraBG1_Victory, 0;
@@ -94,7 +94,7 @@ OnReadyCheck:
mapannounce "bat_a01","Guillaume Vintenar Axl Rose : Let's attack to burn down Croix's food storage",1,0x0000FF;
sleep 2000;
mapannounce "bat_a01","Croix Vintenar Swandery : Master of Valhalla! Let us be gifted with unfailing faith and courage",1,0xFF0000;
-
+
initnpctimer;
end;
@@ -120,7 +120,7 @@ OnNeutralBreak:
set .Guardian_1, bg_monster(.Neutral_Base,"bat_a01",280,233,"Guardian",1949,"Tierra_BG1::OnGuardian1");
else
bg_monster_set_team .Guardian_1, .Neutral_Base;
-
+
if( .Guardian_2 == 0 )
set .Guardian_2, bg_monster(.Neutral_Base,"bat_a01",287,203,"Guardian",1950,"Tierra_BG1::OnGuardian2");
else
@@ -294,7 +294,7 @@ OnWall:
OnBuild:
for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
bg_monster 0,"bat_a01",186+.@i,266,"Barricade",1906,"Croix_TV1B::OnWall";
-
+
setwall "bat_a01",186,266,16,6,1,"bat_a01_c1";
set .MyMobCount,16;
end;
diff --git a/npc/custom/battleground/bg_tierra_02.txt b/npc/custom/battleground/bg_tierra_02.txt
index c6cebf581..f18d60769 100644
--- a/npc/custom/battleground/bg_tierra_02.txt
+++ b/npc/custom/battleground/bg_tierra_02.txt
@@ -69,7 +69,7 @@ OnReadyCheck:
bg_monster $@TierraBG2_id1,"bat_a02",176,345,"Food Depot",1909,"Tierra_BG2::OnGuillaumeBreak";
bg_monster $@TierraBG2_id2,"bat_a02",167,50,"Food Storage",1910,"Tierra_BG2::OnCroixBreak";
bg_monster 0,"bat_a02",273,204,"Neutrality Flag",1911,"Tierra_BG2::OnNeutralBreak";
-
+
set .Neutral_Base, 0;
set $@TierraBG2_Victory, 0;
@@ -94,7 +94,7 @@ OnReadyCheck:
mapannounce "bat_a02","Guillaume Vintenar Axl Rose : Let's attack to burn down Croix's food storage",1,0x0000FF;
sleep 2000;
mapannounce "bat_a02","Croix Vintenar Swandery : Master of Valhalla! Let us be gifted with unfailing faith and courage",1,0xFF0000;
-
+
initnpctimer;
end;
@@ -120,7 +120,7 @@ OnNeutralBreak:
set .Guardian_1, bg_monster(.Neutral_Base,"bat_a02",280,233,"Guardian",1949,"Tierra_BG2::OnGuardian1");
else
bg_monster_set_team .Guardian_1, .Neutral_Base;
-
+
if( .Guardian_2 == 0 )
set .Guardian_2, bg_monster(.Neutral_Base,"bat_a02",287,203,"Guardian",1950,"Tierra_BG2::OnGuardian2");
else
@@ -294,7 +294,7 @@ OnWall:
OnBuild:
for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
bg_monster 0,"bat_a02",186+.@i,266,"Barricade",1906,"Croix_TV2B::OnWall";
-
+
setwall "bat_a02",186,266,16,6,1,"bat_a02_c1";
set .MyMobCount,16;
end;
diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt
index 8112be12e..f93821264 100644
--- a/npc/custom/bgqueue/flavius.txt
+++ b/npc/custom/bgqueue/flavius.txt
@@ -19,7 +19,6 @@
//= 1.5b Adjustments to the team-splitting algorithm [Haruna]
//============================================================
-
//Tacham, while the script is under testings the original will remain, meaning if you wanna test this you need to disable the other, or they'll conflict.
bat_b01,15,15,3 script start#bat_b01 CLEAR_NPC,{
OnInit:
@@ -28,22 +27,21 @@ OnInit:
//$@bg_queue_id is cleared after this event ends
OnPlayerListReady:
-
- set $@FlaviusBG1_id1, bg_create_team("bat_b01",10,290);
+ set $@FlaviusBG1_id1, bg_create_team("bat_b01",10,290);
set $@FlaviusBG1_id2, bg_create_team("bat_b01",390,10);
set $@Croix_QueueBG1, queue();
set $@Guill_QueueBG1, queue();
-
+
queueopt($@Guill_QueueBG1,HQO_OnLogout,"start#bat_b01::OnGuillaumeQuit");
queueopt($@Croix_QueueBG1,HQO_OnLogout,"start#bat_b01::OnCroixQuit");
-
+
set .@i, 0;
-
+
copyarray .@bg_member[0],$@bg_member[0],$@bg_member_size;
copyarray .@bg_member_group[0],$@bg_member_group[0],$@bg_member_size;
copyarray .@bg_member_type[0],$@bg_member_type[0],$@bg_member_size;
-
+
freeloop(1);
// Counting all participants and determining sizes, condensing .@bg_member_group
set .@nogroupcount, 0;
@@ -66,7 +64,7 @@ OnPlayerListReady:
set .@bg_count[.@j], 1;
}
}
-
+
// Now, sorting the group arrays from amount of population descending! Bubble sort powers, I call upon thee!
// Type doesn't matter here for precedence checks, but also needs to be sorted the same way along with groups
for (set .@i, 0; .@i < getarraysize(.@bg_groups); set .@i, .@i + 1) {
@@ -84,7 +82,7 @@ OnPlayerListReady:
}
}
}
-
+
// Add the groups to the queues! :D
for (set .@i, 0; .@i < getarraysize(.@bg_groups); set .@i, .@i + 1){
if (queuesize($@Croix_QueueBG1) <= queuesize($@Guill_QueueBG1)){ // Catch'em all and add to the queue!
@@ -123,7 +121,7 @@ OnPlayerListReady:
set $@FlaviusBG1_Victory, 0;
set $@Croix_ScoreBG1, 0;
set $@Guill_ScoreBG1, 0;
-
+
bg_updatescore "bat_b01",$@Guill_ScoreBG1,$@Croix_ScoreBG1;
donpcevent "OBJ#bat_b01_a::OnKill";
@@ -143,11 +141,11 @@ OnPlayerListReady:
disablenpc "Vintenar#bat_b01_bover";
bg_warp $@FlaviusBG1_id1,"bat_b01",87,75;
bg_warp $@FlaviusBG1_id2,"bat_b01",311,224;
-
+
/* after warp */
queueopt($@Guill_QueueBG1,HQO_OnMapChange,"start#bat_b01::OnGuillaumeQuit");
queueopt($@Croix_QueueBG1,HQO_OnMapChange,"start#bat_b01::OnCroixQuit");
-
+
donpcevent "countdown#bat_b01::OnEnable";
end;
@@ -180,14 +178,14 @@ OnGuillaumeQuit:
queueremove($@Guill_QueueBG1,getcharid(3));
callsub L_OnPlayerQuit;
end;
-
+
L_OnPlayerQuit:
bg_leave;
setd $@bg_delay_var$,gettimetick(2);
if( queuesize($@Guill_QueueBG1) == 0 || queuesize($@Croix_QueueBG1) == 0 ) /* todo check score and decide a winner if anyone left */
callsub OnMatchOver;
end;
-
+
OnMatchOver:
if( $@FlaviusBG1_id1 || $@FlaviusBG1_id2 ) {
queuedel($@Croix_QueueBG1);
diff --git a/npc/custom/card_remover.txt b/npc/custom/card_remover.txt
index e3aa2bb5b..dace8cac0 100644
--- a/npc/custom/card_remover.txt
+++ b/npc/custom/card_remover.txt
@@ -49,7 +49,7 @@ prt_in,28,73,4 script Wise Old Woman#eAcustom 1_F_ORIENT_04,{
close;
}
set .@cardcount,getequipcardcnt(.@part);
-
+
if (!checkweight(1202,(.@cardcount+1))) {
mes "^3355FFJust a minute!";
mes "I can't offer any of my";
@@ -91,7 +91,7 @@ prt_in,28,73,4 script Wise Old Woman#eAcustom 1_F_ORIENT_04,{
Zeny -= (.zenycost+(.@cardcount * .percardcost));
delitem 1000,1;
delitem 715,1;
-
+
// Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
// First value = Total failure chance (item and cards destroyed)
// Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
diff --git a/npc/custom/etc/floating_rates.txt b/npc/custom/etc/floating_rates.txt
index ff3b6e8fa..c207c6275 100644
--- a/npc/custom/etc/floating_rates.txt
+++ b/npc/custom/etc/floating_rates.txt
@@ -35,7 +35,7 @@ OnHour18:
setbattleflag("item_rate_equip",$@drate);
//we don't change card drops rate, because these values won't change them anyway
atcommand "@reloadmobdb";
-
+
announce "Current Rune-Midgard rates are: 1."+($@brate-100)+"x 1."+($@jrate-100)+"x 1."+($@drate-100)+"x",bc_all,0xFF6060;
end;
}
diff --git a/npc/custom/etc/marriage.txt b/npc/custom/etc/marriage.txt
index 0d25be9d5..ab1b48c30 100644
--- a/npc/custom/etc/marriage.txt
+++ b/npc/custom/etc/marriage.txt
@@ -65,7 +65,7 @@ prt_church,100,123,4 script Vomars 1_M_PASTOR,{
function SF_RetrieveRingF;
function SF_RingsAccepted;
function SF_StartCeremony;
-
+
if (getpartnerid() > 0) {
mes "["+@name$+"]";
mes "You have my blessings, have a wonderful married life.";
@@ -81,7 +81,7 @@ prt_church,100,123,4 script Vomars 1_M_PASTOR,{
mes "to prepare for marriage";
close;
} // End official iRO dialog
-
+
if (strcharinfo(0) == $wed_groom$) {
SF_Groom();
end;
@@ -278,7 +278,7 @@ function SF_RetrieveRingM {
mes "Here's the wedding ring for your bride.";
if ($@wed_ring) delitem $@wed_ring,1;
set $wed_groom_progress,4;
-
+
if ($wed_bride_progress == 4)
SF_StartCeremony();
else {
@@ -336,7 +336,7 @@ function SF_StartCeremony {
OnTimer1000:
npctalk "Ladies and Gentlemen, We will now join in holy matrimony these two lovers.";
end;
-
+
OnTimer5000:
npctalk "Now more than ever, will both of your lives be entwined together as so will be your souls.";
end;
@@ -344,31 +344,31 @@ OnTimer5000:
OnTimer10000:
npctalk "You will both honor and cherish each other through the best and worst of times.";
end;
-
+
OnTimer15000:
npctalk "The safety and well being of your other will now also be your responsibility.";
end;
-
+
OnTimer20000:
npctalk "May in sickness or good health, your love burn bright like no force can extinguish it.";
end;
-
+
OnTimer25000:
npctalk "Those here stand witness to these vows bestowed upon you, you must act accordingly to them.";
end;
-
+
OnTimer30000:
npctalk "Understanding that, we are nothing more but mortals on this earth, but this is our triumph.";
end;
-
+
OnTimer35000:
npctalk "We here will now join these two mortal entities, and create an immortal love.";
end;
-
+
OnTimer40000:
npctalk $wed_groom$+", you have accepted to take "+$wed_bride$+" as your lawfully wedded wife,";
end;
-
+
OnTimer45000:
npctalk "and you, "+$wed_bride$+", have accepted take "+$wed_groom$+" as your lawfully wedded husband.";
end;
@@ -440,7 +440,7 @@ prt_church,106,99,3 script Happy Marry 1_F_02,{
mes "Isn't marriage beautiful?";
close;
}
-
+
function SF_WedProgress;
function SF_Principles;
function SF_Procedure;
@@ -451,7 +451,7 @@ prt_church,106,99,3 script Happy Marry 1_F_02,{
SF_WedProgress();
end;
}
-
+
do {
mes "["+@name$+"]";
mes "Marriage... is such a beautiful thing.";
@@ -529,7 +529,7 @@ function SF_Register {
close;
}
}
-
+
function SF_WedProgress {
if (strcharinfo(0) == $wed_groom$) {
mes "["+@name$+"]";
@@ -658,7 +658,7 @@ OnTimer60000:
npctalk "Registration timed out. Is it that noone wants to marry "+$@msg$+"..?";
emotion e_hmm;
-
+
set $wed_groom$,"";
set $wed_groom_sex, 0;
set $wed_bride$,"";
@@ -675,7 +675,7 @@ function SF_TryRegister {
set @type$, "groom";
if (@bride)
set @type$, "bride";
-
+
mes "["+@name$+"]";
mes "Before registering as "+@type$+", let me check if you meet all the requirements...";
next;
@@ -689,7 +689,7 @@ function SF_TryRegister {
set @item, 7170;
else
set @item, 2338;
-
+
if (getequipid(2) != @item) {
mes "["+@name$+"]";
mes "You should be wearing a "+getitemname(@item)+" if you want to get married.";
@@ -814,12 +814,12 @@ prt_church,94,99,4 script Sister Lisa 1_F_PRIEST,{
function SF_DivorceEnd;
function SF_InProgress;
-
+
if ($@divorce_progress==1) {
goto SF_InProgress;
end;
}
-
+
do {
mes "["+@name$+"]";
mes "Divorcing can be such a sad event...";
diff --git a/npc/custom/etc/monster_arena.txt b/npc/custom/etc/monster_arena.txt
index 82f764977..9c00b67a5 100644
--- a/npc/custom/etc/monster_arena.txt
+++ b/npc/custom/etc/monster_arena.txt
@@ -195,7 +195,6 @@ L_Exit:
}
gon_test,56,91,6 duplicate(monsterreferee) Referee#01 1_M_PUBMASTER
-
// Usher //
gon_test,58,94,6 script Usher 4_M_04,{
set @marena,1;
@@ -332,7 +331,6 @@ L_Sell:
mes "You earned ^0000FF" + @sellearn + "^000000z.";
close;
-
L_NoExp:
mes "[Monster Trainer]";
mes "You do not have enough experience.";
@@ -761,8 +759,6 @@ OnTouch:
gon_test,43,87,5 duplicate(SummonPad) Summon Pad 2 HIDDEN_NPC,2,2
gon_test,72,87,5 duplicate(SummonPad) Summon Pad 3 HIDDEN_NPC,2,2
-
-
// Skill Disabler //
gon_test mapflag noskill
diff --git a/npc/custom/etc/penal_servitude.txt b/npc/custom/etc/penal_servitude.txt
index b83bf3f83..30aaf17e2 100644
--- a/npc/custom/etc/penal_servitude.txt
+++ b/npc/custom/etc/penal_servitude.txt
@@ -134,7 +134,7 @@ sec_in02,137,57,1 script Overseer 4_M_PAY_SOLDIER,{
delitem 4009,countitem(4009);//Items: Chonchon_Card,
delitem 4022,countitem(4022);//Items: Spore_Card,
delitem 4048,countitem(4048);//Items: Poison_Spore_Card,
-
+
if (PRISON_Q <= 0 ) goto L_GET_Q;
mes "I want you to gather ^FF0000"+PRISON_Q+" Orange Net Mushroom^000000.";
@@ -170,7 +170,6 @@ L_GET_Q:
close;
}
-
sec_in02 mapflag nomemo
sec_in02 mapflag nosave SavePoint
sec_in02 mapflag noteleport
diff --git a/npc/custom/etc/quest_warper.txt b/npc/custom/etc/quest_warper.txt
index 3526cde5c..fd6865a54 100644
--- a/npc/custom/etc/quest_warper.txt
+++ b/npc/custom/etc/quest_warper.txt
@@ -71,10 +71,10 @@ function script Q_Warpra {
mes "Hello,";
mes "I can warp you to any town or dungeon, but you need to unlock them first by visiting us.";
mes "What do you need?";
-
+
if(getarg(0) == 0) callfunc "QWS_MMarray",0;
if(getarg(0) == 1) callfunc "QWS_MMarray",1;
-
+
set @MMenu,select(@Mmenulist$[0],@Mmenulist$[1],@Mmenulist$[2],@Mmenulist$[3],@Mmenulist$[4],@Mmenulist$[5],@Mmenulist$[6],@Mmenulist$[7],@Mmenulist$[8],@Mmenulist$[9],@Mmenulist$[10],@Mmenulist$[11]);
switch(@Mmenuref[@MMenu-1]+1){
@@ -167,7 +167,7 @@ Setprice:
if (!$QW_S_PRICE) mes "Storage = ^FF0000 Free ^000000";
if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000";
mes "Guild Storage = "+(($QW_GS_PRICE)?"^00FF00"+$QW_GS_PRICE:"^FF0000Free")+"^000000";
-
+
switch(select("Basic - Warps","Advanced - Warps","Overseas - Warps","Basic Dungeon warp fee","Advanced Dungeon warp fee","Overseas Dungeon warp fee","Full Healing","Part Healing","Storage","Guild Storage","Back","Exit")) {
case 1:
next;
@@ -388,7 +388,7 @@ L_heal_Part:
if (@healchoice == 2) callsub PHeal,1,0;
if (@healchoice == 3) callsub PHeal,0,1;
goto L_End;
-
+
PHeal:
next;
set @Hp, MaxHp-Hp;
@@ -499,7 +499,7 @@ L_GStorage:
close2;
guildopenstorage;
end;
-
+
L_End:
close;
end;
@@ -523,7 +523,7 @@ L_NoUnlock:
mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place.";
close;
end;
-
+
//=========================Short=On=Zeny===========================
L_Short_on_zeny:
next;
@@ -536,7 +536,7 @@ L_Short_on_zeny:
}
close;
end;
-
+
//===========================Stamp=Card============================
stampcard:
// Counting of the ammount of places you have unlocked
@@ -978,7 +978,6 @@ function script QWS_Tarray {
set @Tmenuref[@Tj],57005; // 57005='dead' in hex
return;
-
//----------------Make Town Menu Function
function QWS_Make_Town_Menu {
@@ -1450,7 +1449,6 @@ function script QWS_Darray {
set @Dmenuref[@Dj],57005; // 57005='dead' in hex
return;
-
//----------------Make Dungeon Menu Function
function QWS_Make_Dungeon_Menu {
@@ -1525,7 +1523,7 @@ function script QWS_DLarray {
function script QWS_Dungeon_Warpra {
function QWS_D_getbin;
function QWS_D_setbin;
-
+
if ((QWS_D_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
mes "[Warpra]";
mes getarg(1)+" unlocked!";
@@ -1538,7 +1536,6 @@ function script QWS_Dungeon_Warpra {
debugmes "QWS_Dungeon_Warpra error, improper syntax?";
return;
-
function QWS_D_setbin {
set @tempsetbindata,1;
if (getarg(0) == 0) goto binset;
@@ -1571,7 +1568,7 @@ binget:
function script QWS_Town_Warpra {
function QWS_T_getbin;
function QWS_T_setbin;
-
+
if ((QWS_T_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
mes "[Warpra]";
mes getarg(1)+" unlocked!";
diff --git a/npc/custom/etc/stock_market.txt b/npc/custom/etc/stock_market.txt
index 060228317..078ce5137 100644
--- a/npc/custom/etc/stock_market.txt
+++ b/npc/custom/etc/stock_market.txt
@@ -431,7 +431,7 @@ S_Buy:
mes $S10N$;
next;
menu "Continue",-,"Cancel",S_Start;
-
+
mes "Enter the name of the share company";
mes "Transaction fee of ^FF0000" + $S_Trans + "z^000000 will apply.";
set @buyname$,"0";
@@ -645,7 +645,6 @@ ACCS11:
next;
goto S_Start;
-
// GM MENU //
GM_Menu:
mes "[Stock Market]";
diff --git a/npc/custom/events/valentinesdayexp.txt b/npc/custom/events/valentinesdayexp.txt
index 5a94bc913..4ed24012d 100644
--- a/npc/custom/events/valentinesdayexp.txt
+++ b/npc/custom/events/valentinesdayexp.txt
@@ -200,7 +200,7 @@ prt_castle,54,34,4 script Carl Orleans#val1 1_M_01,{
mes "Yes? What can I cook for you?";
next;
menu "Black handmade Chocolate, please",-,"I want a White handmade Chocolate...",M_WHITE,"I'm lost, sorry to bother you.",M_End;
-
+
mes "[Carl Orleans]";
mes "Well, I just might be able to fulfill your needs...";
next;
diff --git a/npc/custom/item_signer.txt b/npc/custom/item_signer.txt
index 243ca29c2..ee03c16eb 100644
--- a/npc/custom/item_signer.txt
+++ b/npc/custom/item_signer.txt
@@ -12,7 +12,6 @@
//============================================================
prt_in,24,61,7 script Perchik 1_M_01,{
-
setarray .@item[0],644,3; // Item requirements: <ID>,<Count>{,...} (0 to disable)
setarray .@cost[0],0,5000; // Zeny requirements: <base price>,<price per refine>
diff --git a/npc/custom/quests/kaho_balmung.txt b/npc/custom/quests/kaho_balmung.txt
index 4e598922d..ff581825b 100644
--- a/npc/custom/quests/kaho_balmung.txt
+++ b/npc/custom/quests/kaho_balmung.txt
@@ -12,10 +12,9 @@
//============================================================
prontera,158,356,4 script Royal Messenger 8W_SOLDIER,{
-
setarray .@Req1[0],1161,999,120,984,10,996,10,994,10,995,10,997,10;
setarray .@Req2[0],5013,2298,1,1001,10,996,10,994,10,995,10,997,10;
-
+
mes "[Royal Messenger]";
mes "Welcome to Prontera.";
mes "I am the messenger in charge of the Royal Quests.";
diff --git a/npc/custom/quests/questboard.txt b/npc/custom/quests/questboard.txt
index 3e7a90d9d..e4336a67a 100644
--- a/npc/custom/quests/questboard.txt
+++ b/npc/custom/quests/questboard.txt
@@ -16,7 +16,6 @@
//============================================================
prontera,129,215,5 script Questboard 4_BOARD3,{
-
if(c_run==1){
mes "[^FF7700Questboard^000000]";
mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000";
@@ -40,7 +39,7 @@ prontera,129,215,5 script Questboard 4_BOARD3,{
}
goto L_checkitems;
}
-
+
if(h_run==1){
mes "[^FF7700Questboard^000000]";
mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000";
@@ -69,114 +68,112 @@ prontera,129,215,5 script Questboard 4_BOARD3,{
}
goto L_checkmobs;
}
-
+
L_questmenu:
mes "[^FF7700Questboard^000000]";
mes "Select category:";
next;
-
+
switch(select((.collection)?"Collection Quests":"",
- (.hunting)?"Hunting Quests":"",
- "Exit")) {
-
-case 1:
- set .@collectmenu$, "";
- for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1) {
- if (.@i) set .@collectmenu$,.@collectmenu$+":";
- set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$");
- }
- set .@selection,select(.@collectmenu$);
- if(gettimetick(2) < getd(.@selection + "_collection_delay")){
- set .@time_left, getd(.@selection + "_collection_delay")-gettimetick(2);
- mes "[^FF7700Questboard^000000]";
- if(.@time_left < 60) mes "You have to wait ^0000FF"+.@time_left+" seconds^000000 to do this quest again.";
- if(.@time_left < 3600) mes "You have to wait ^0000FF"+.@time_left/60+" minutes^000000 to do this quest again.";
- mes "You have to wait ^0000FF"+.@time_left/60/60+" hours^000000 to do this quest again.";
- close;
- }
- mes "[^FF7700Questboard^000000]";
- mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000";
- mes "--------------------------------";
- for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_collectionitem")); set .@j,.@j+2) {
- mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
- }
- mes "--------------------------------";
- mes "[Reward]";
- mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000");
- mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000";
- mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000";
- mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000";
- next;
- if(select("Accept:Decline") == 2){
- close;
- }
- if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax"))
- {
- mes "[^FF7700Questboard^000000]";
- mes "Quest accepted.";
- set c_run, 1;
- set currentquest$, .@selection;
- close;
- }
- else
- {
- mes "[^FF7700Questboard^000000]";
- mes "You don't have the required";
- mes "level to do this quest.";
- close;
- }
-
-case 2:
- set .@huntmenu$, "";
- for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1) {
- if (.@i) set .@huntmenu$,.@huntmenu$+":";
- set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
- }
- set .@selection,select(.@huntmenu$);
- if(gettimetick(2) < getd(.@selection + "_hunting_delay")){
- set .@time_left, getd(.@selection + "_hunting_delay")-gettimetick(2);
- mes "[^FF7700Questboard^000000]";
- if(.@time_left < 60) mes "You have to wait ^0000FF"+.@time_left+" seconds^000000 to do this quest again.";
- if(.@time_left < 3600) mes "You have to wait ^0000FF"+.@time_left/60+" minutes^000000 to do this quest again.";
- mes "You have to wait ^0000FF"+.@time_left/60/60+" hours^000000 to do this quest again.";
- close;
- }
- mes "[^FF7700Questboard^000000]";
- mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000";
- mes "--------------------------------";
- for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_huntingmob")); set .@j,.@j+2) {
- mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
- }
- mes "--------------------------------";
- mes "[Reward]";
- mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000");
- mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000";
- mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000";
- mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000";
- next;
- if(select("Accept:Decline") == 2){
- close;
- }
- if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax"))
- {
+ (.hunting)?"Hunting Quests":"",
+ "Exit")) {
+ case 1:
+ set .@collectmenu$, "";
+ for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1) {
+ if (.@i) set .@collectmenu$,.@collectmenu$+":";
+ set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$");
+ }
+ set .@selection,select(.@collectmenu$);
+ if(gettimetick(2) < getd(.@selection + "_collection_delay")){
+ set .@time_left, getd(.@selection + "_collection_delay")-gettimetick(2);
+ mes "[^FF7700Questboard^000000]";
+ if(.@time_left < 60) mes "You have to wait ^0000FF"+.@time_left+" seconds^000000 to do this quest again.";
+ if(.@time_left < 3600) mes "You have to wait ^0000FF"+.@time_left/60+" minutes^000000 to do this quest again.";
+ mes "You have to wait ^0000FF"+.@time_left/60/60+" hours^000000 to do this quest again.";
+ close;
+ }
mes "[^FF7700Questboard^000000]";
- mes "Quest accepted.";
- set h_run, 1;
- set currentquest$, .@selection;
- close;
- }
- else
- {
+ mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000";
+ mes "--------------------------------";
+ for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_collectionitem")); set .@j,.@j+2) {
+ mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
+ }
+ mes "--------------------------------";
+ mes "[Reward]";
+ mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000");
+ mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000";
+ mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000";
+ mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000";
+ next;
+ if(select("Accept:Decline") == 2){
+ close;
+ }
+ if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax"))
+ {
+ mes "[^FF7700Questboard^000000]";
+ mes "Quest accepted.";
+ set c_run, 1;
+ set currentquest$, .@selection;
+ close;
+ }
+ else
+ {
+ mes "[^FF7700Questboard^000000]";
+ mes "You don't have the required";
+ mes "level to do this quest.";
+ close;
+ }
+
+ case 2:
+ set .@huntmenu$, "";
+ for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1) {
+ if (.@i) set .@huntmenu$,.@huntmenu$+":";
+ set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
+ }
+ set .@selection,select(.@huntmenu$);
+ if(gettimetick(2) < getd(.@selection + "_hunting_delay")){
+ set .@time_left, getd(.@selection + "_hunting_delay")-gettimetick(2);
+ mes "[^FF7700Questboard^000000]";
+ if(.@time_left < 60) mes "You have to wait ^0000FF"+.@time_left+" seconds^000000 to do this quest again.";
+ if(.@time_left < 3600) mes "You have to wait ^0000FF"+.@time_left/60+" minutes^000000 to do this quest again.";
+ mes "You have to wait ^0000FF"+.@time_left/60/60+" hours^000000 to do this quest again.";
+ close;
+ }
mes "[^FF7700Questboard^000000]";
- mes "You don't have the required";
- mes "level to do this quest.";
+ mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000";
+ mes "--------------------------------";
+ for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_huntingmob")); set .@j,.@j+2) {
+ mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
+ }
+ mes "--------------------------------";
+ mes "[Reward]";
+ mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000");
+ mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000";
+ mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000";
+ mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000";
+ next;
+ if(select("Accept:Decline") == 2){
+ close;
+ }
+ if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax"))
+ {
+ mes "[^FF7700Questboard^000000]";
+ mes "Quest accepted.";
+ set h_run, 1;
+ set currentquest$, .@selection;
+ close;
+ }
+ else
+ {
+ mes "[^FF7700Questboard^000000]";
+ mes "You don't have the required";
+ mes "level to do this quest.";
+ close;
+ }
+ case 3:
close;
}
-
-case 3:
- close;
- }
-
+
L_checkitems:
for( set .@k,0; .@k < getarraysize(getd("."+currentquest$+"_collectionitem")); set .@k,.@k+2) {
if(countitem(getd("."+currentquest$+"_collectionitem["+.@k+"]"))>=getd("."+currentquest$+"_collectionitem["+(.@k+1)+"]")){
@@ -200,7 +197,7 @@ L_checkitems:
set currentquest$, "";
set c_run, 0;
close;
-
+
L_checkmobs:
set .@goal, (getarraysize(getd("."+currentquest$+"_huntingmob"))/2);
for(set .@i, 1; .@i < getarraysize(getd("."+currentquest$+"_huntingmob")); set .@i,.@i+2){
@@ -214,7 +211,7 @@ L_checkmobs:
}
goto L_checkmobs2;
}
-
+
L_checkmobs2:
if(.@checkmonster<.@goal){
mes "[^FF7700Questboard^000000]";
@@ -248,33 +245,30 @@ OnNPCKillEvent:
continue;
}
end;
-
-OnInit:
+OnInit:
function AddCollection;
function AddHunting;
//Activate/Deactive quest categories here
set .collection, 1;
set .hunting, 1;
-
+
//Quest Delay (seconds)
//24 hours = 86400 seconds
set .quest_delay, 0;
-
+
//Checks if quests are loaded (prevents out of index)
if(.questsloaded==1) end;
- set .questsloaded, 1;
-
- //Add Collection Quests here
- //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);
-
-
- //Add Hunting Quests here
- //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);
-
- end;
-
+ set .questsloaded, 1;
+
+ //Add Collection Quests here
+ //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);
+
+ //Add Hunting Quests here
+ //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);
+
+ end;
function AddCollection {
set .collectionquestcount,.collectionquestcount+1;
diff --git a/npc/custom/quests/tha_statues.txt b/npc/custom/quests/tha_statues.txt
index c4787fcd3..00a7c9a8f 100644
--- a/npc/custom/quests/tha_statues.txt
+++ b/npc/custom/quests/tha_statues.txt
@@ -38,7 +38,6 @@ done:
mes "[Thalos]";
mes "Go search the 2nd Statue!";
close;
-
}
tha_t09,84,99,4 script Mediane HIDDEN_NPC,{
diff --git a/npc/custom/quests/thq/THQS_QuestNPC.txt b/npc/custom/quests/thq/THQS_QuestNPC.txt
index 76790221b..d4e058fb4 100644
--- a/npc/custom/quests/thq/THQS_QuestNPC.txt
+++ b/npc/custom/quests/thq/THQS_QuestNPC.txt
@@ -66,7 +66,7 @@ N_NewQuest:
mes "Would you like me to asign you a Quest?";
next;
menu "Yes I would like a Quest Please.",-,"Sorry Guy no time today.",N_NoTime;
-
+
mes "[Guy]";
mes "Ok lets see what quest we can give you today.";
mes "The quest names in ^FF0000This Colour^000000 mean that they are more challanging then the rest, but have better rewards.";
diff --git a/npc/events/MemorialDay_2008.txt b/npc/events/MemorialDay_2008.txt
index a6c09fe80..c6628ef12 100644
--- a/npc/events/MemorialDay_2008.txt
+++ b/npc/events/MemorialDay_2008.txt
@@ -65,9 +65,7 @@ prontera,182,214,4 script Lauds#Memorial 1_M_MERCHANT,{
mes "Bring me ^FF000030 Fabric and 20 Fluffs^000000.";
Memorial08 = 1;
close;
- }
-
- else if (Memorial08 == 1) {
+ } else if (Memorial08 == 1) {
if (countitem(1059) < 30 || countitem(914) < 20) {
mes "[Mad Sago Lauds]";
mes "What are these? They aren't enough?!";
@@ -94,9 +92,7 @@ prontera,182,214,4 script Lauds#Memorial 1_M_MERCHANT,{
Memorial08 = 2;
close;
}
- }
-
- else if (Memorial08 == 2) {
+ } else if (Memorial08 == 2) {
mes "[Mad Sago Lauds]";
mes "Ah, you have fluffy new towel now I even put your name on it";
next;
@@ -116,22 +112,16 @@ prontera,182,214,4 script Lauds#Memorial 1_M_MERCHANT,{
mes "What a shame! You should go speak to ^FF0000Grast in Prontera^000000.";
Memorial08 = 3;
close;
- }
-
- else if (Memorial08 == 3) {
+ } else if (Memorial08 == 3) {
mes "[Mad Sago Lauds]";
mes "What are you still doing here?";
mes "I told you to go speak to Grast in Prontera!";
close;
- }
-
- else if (Memorial08 == 4 || Memorial08 == 5 || Memorial08 == 6) {
+ } else if (Memorial08 == 4 || Memorial08 == 5 || Memorial08 == 6) {
mes "[Mad Sago Lauds]";
mes "Go help Grast, and then come back.";
close;
- }
-
- else if (Memorial08 == 7) {
+ } else if (Memorial08 == 7) {
mes "[Mad Sago Lauds]";
mes "Oh, you've brought them all.";
mes "Hahaha!";
@@ -151,16 +141,12 @@ prontera,182,214,4 script Lauds#Memorial 1_M_MERCHANT,{
mes "You should be going to the plaque!";
Memorial08 = 8;
close;
- }
-
- else if (Memorial08 == 8) {
+ } else if (Memorial08 == 8) {
mes "[Mad Sago Lauds]";
mes "Stop trying to give me your garbage!";
mes "Go to the plaque at 12 o'clock direction in Prontera for your journey!";
close;
- }
-
- else if (Memorial08 >= 9) {
+ } else if (Memorial08 >= 9) {
.@RandomMsg = rand(1,5);
if (.@RandomMsg == 1) {
mes "[Mad Sago Lauds]";
@@ -191,7 +177,7 @@ prontera,182,214,4 script Lauds#Memorial 1_M_MERCHANT,{
}
}
}
-
+
// Memorial Plaque
//============================================================
prontera,153,286,4 script Memorial Plaque#Memorial 4_BOARD3,{
@@ -199,9 +185,7 @@ prontera,153,286,4 script Memorial Plaque#Memorial 4_BOARD3,{
mes "[" + strcharinfo(0) + "]";
mes "- It's a dusty old plaque.-";
close;
- }
-
- else if (Memorial08 == 8) {
+ } else if (Memorial08 == 8) {
mes "[" + strcharinfo(0) + "]";
mes "- It's a dusty old plaque.-";
mes "'This must be what Lauds was talking about.'";
@@ -210,43 +194,41 @@ prontera,153,286,4 script Memorial Plaque#Memorial 4_BOARD3,{
Memorial08 = 9;
getexp 93750,43750;
goto L_CleanPlaque;
- }
-
- else if (Memorial08 >= 9) {
+ } else if (Memorial08 >= 9) {
goto L_CleanPlaque;
}
-
- L_CleanPlaque:
- mes "- You see a message from the cleaned plaque.-";
- next;
- mes "-Although no sculptured marble should rise to their memory,-";
- mes "-nor engraved stone bear record of their deeds,-";
- mes "-yet will their remembrance be as lasting as the land they honored.-";
- mes "-Daniel Webster-";
- if (Memorial08 == 9) {
- getexp 93750,43750;
- }
- next;
- mes "-There's another message.-";
- next;
- mes "-I may not have gone where I intended to go,-";
- mes "-but I think I have ended up where I needed to be.-";
- mes "- Douglas Adams.-";
- if (Memorial08 == 9) {
- getexp 93750,43750;
- }
- next;
- mes "-This is the last message.-";
- next;
- mes "-True heroism is remarkably sober, very undramatic.-";
- mes "-It is not the urge to surpass all others at whatever cost,-";
- mes "- but the urge to serve others at whatever cost. -";
- mes "- Arthur Ashe -";
- if (Memorial08 == 9) {
- getexp 93750,43750;
- Memorial08 = 10;
- }
- close;
+
+L_CleanPlaque:
+ mes "- You see a message from the cleaned plaque.-";
+ next;
+ mes "-Although no sculptured marble should rise to their memory,-";
+ mes "-nor engraved stone bear record of their deeds,-";
+ mes "-yet will their remembrance be as lasting as the land they honored.-";
+ mes "-Daniel Webster-";
+ if (Memorial08 == 9) {
+ getexp 93750,43750;
+ }
+ next;
+ mes "-There's another message.-";
+ next;
+ mes "-I may not have gone where I intended to go,-";
+ mes "-but I think I have ended up where I needed to be.-";
+ mes "- Douglas Adams.-";
+ if (Memorial08 == 9) {
+ getexp 93750,43750;
+ }
+ next;
+ mes "-This is the last message.-";
+ next;
+ mes "-True heroism is remarkably sober, very undramatic.-";
+ mes "-It is not the urge to surpass all others at whatever cost,-";
+ mes "- but the urge to serve others at whatever cost. -";
+ mes "- Arthur Ashe -";
+ if (Memorial08 == 9) {
+ getexp 93750,43750;
+ Memorial08 = 10;
+ }
+ close;
}
// Grast
@@ -257,9 +239,7 @@ prontera,150,270,4 script Grast#Memorial 4_M_HUMERCHANT,{
mes "Memorial Day is a sad and yet glorious day.";
mes "I wonder how many people remember them...";
close;
- }
-
- else if (Memorial08 == 3) {
+ } else if (Memorial08 == 3) {
mes "[Grast]";
mes "Oh, isn't that a Towel of Memory?";
mes "I'm so glad to meet someone who understands the meaning of Memorial Day.";
@@ -275,9 +255,7 @@ prontera,150,270,4 script Grast#Memorial 4_M_HUMERCHANT,{
mes "I'll be waiting for your return.";
Memorial08 = 4;
close;
- }
-
- else if (Memorial08 == 4) {
+ } else if (Memorial08 == 4) {
if (countitem(501) < 1 || countitem(506) < 1 || countitem(656) < 1 || countitem(602) < 1) {
mes "[Grast]";
mes "Oops, you haven't brought all materials.";
@@ -306,9 +284,7 @@ prontera,150,270,4 script Grast#Memorial 4_M_HUMERCHANT,{
Memorial08 = 5;
close;
}
- }
-
- else if (Memorial08 == 5) {
+ } else if (Memorial08 == 5) {
if (countitem(1065) < 1 || countitem(610) < 1 || countitem(717) < 1 || countitem(747) < 1 || countitem(517) < 1 || countitem(515) < 1) {
mes "[Grast]";
mes "Oops, you haven't brought all materials.";
@@ -333,9 +309,7 @@ prontera,150,270,4 script Grast#Memorial 4_M_HUMERCHANT,{
Memorial08 = 6;
close;
}
- }
-
- else if (Memorial08 == 6) {
+ } else if (Memorial08 == 6) {
if (countitem(643) < 1 || countitem(12018) < 1 || countitem(741) < 1 || countitem(745) < 1) {
mes "[Grast]";
mes "Oops, you haven't brought all materials.";
@@ -388,42 +362,38 @@ prontera,150,270,4 script Grast#Memorial 4_M_HUMERCHANT,{
getitem 12109,1;
close;
}
- }
-
- else if (Memorial08 == 7) {
+ } else if (Memorial08 == 7) {
mes "[Grast]";
mes "Have you met Lauds?";
mes "I hope you'll remember your freedom and happiness are built on thousands of lives sacrificed in war.";
close;
- }
-
- else if (Memorial08 >= 8) {
+ } else if (Memorial08 >= 8) {
mes "[Grast]";
mes "A towel is about the most massively useful thing an adventurer can have.";
close;
}
- L_GiveUp:
- mes "[Grast]";
- mes "Oh, I see. I guess you're quite busy nowadays, huh?";
- mes "No problem; I'll give you all the supplies...";
- next;
- mes "[Grast]";
- mes "There you go.";
- mes "I crushed all the items together into a more compact form for you.";
- mes "You can thank me later for that extra service.";
- mes "Please bring them to Lauds.";
- Memorial08 = 7;
- getitem 7126,1;
- next;
- mes "[Grast]";
- mes "By the way, he had an unfortunate accident, and has kind of lost his mind.";
- mes "Please don't be alarmed even if he starts babbling.";
- close;
-
- L_Continue:
- mes "[Grast]";
- mes "That's a good idea.";
- mes "Then I'll be waiting for your return.";
- close;
+L_GiveUp:
+ mes "[Grast]";
+ mes "Oh, I see. I guess you're quite busy nowadays, huh?";
+ mes "No problem; I'll give you all the supplies...";
+ next;
+ mes "[Grast]";
+ mes "There you go.";
+ mes "I crushed all the items together into a more compact form for you.";
+ mes "You can thank me later for that extra service.";
+ mes "Please bring them to Lauds.";
+ Memorial08 = 7;
+ getitem 7126,1;
+ next;
+ mes "[Grast]";
+ mes "By the way, he had an unfortunate accident, and has kind of lost his mind.";
+ mes "Please don't be alarmed even if he starts babbling.";
+ close;
+
+L_Continue:
+ mes "[Grast]";
+ mes "That's a good idea.";
+ mes "Then I'll be waiting for your return.";
+ close;
}
diff --git a/npc/events/RWC_2012.txt b/npc/events/RWC_2012.txt
index 43b884a0d..faefaa16a 100644
--- a/npc/events/RWC_2012.txt
+++ b/npc/events/RWC_2012.txt
@@ -313,14 +313,14 @@ prontera,147,59,3 script Goldberg#pron 4_M_OILMAN,{
mes "The enchant option in your item will be initialized.";
delitem 6665,1; //RWC_Inicializer
delequip .@part;
-
+
// GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3]
for(.@i = 0; .@i < 4; ++.@i) {
if (.@equip_card[.@i] >= 4700) // Armor Enchant System
.@equip_card[.@i] = 0;
}
getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3];
-
+
close;
}
}
diff --git a/npc/events/christmas_2008.txt b/npc/events/christmas_2008.txt
index 2b6d67eca..c412541cc 100644
--- a/npc/events/christmas_2008.txt
+++ b/npc/events/christmas_2008.txt
@@ -163,81 +163,81 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
}
}
}
+ mes "[Caroller]";
+ mes "You know about Christmas!";
+ mes "Talking about Christmas...";
+ mes "...it's carols!!!";
+ mes "I've been waiting for this for when";
+ mes "Christmas comes around!";
+ next;
+ mes "[Caroller]";
+ mes "But there's been no caroling here and there like before, so we can't feel the Christmas spirit.";
+ next;
+ mes "[Caroller]";
+ mes "So, I installed a Singing Crystal in Prontera...";
+ next;
+ mes "[Caroller]";
+ mes "but that jerk Antonio broke the crystal!";
+ next;
+ mes "[Caroller]";
+ mes "The gift boxes have been changing into monsters since Antonio placed some magic on them, so the monsters ate up the crystal fragments!";
+ next;
+ mes "[Caroller]";
+ mes "I am so devastated, since the Singing Crystal has been the hope of many children around the villages.";
+ next;
+ if (select("There's no other way to carol?:You can hear carols in Lutie.") == 2) {
mes "[Caroller]";
- mes "You know about Christmas!";
- mes "Talking about Christmas...";
- mes "...it's carols!!!";
- mes "I've been waiting for this for when";
- mes "Christmas comes around!";
- next;
- mes "[Caroller]";
- mes "But there's been no caroling here and there like before, so we can't feel the Christmas spirit.";
- next;
- mes "[Caroller]";
- mes "So, I installed a Singing Crystal in Prontera...";
- next;
- mes "[Caroller]";
- mes "but that jerk Antonio broke the crystal!";
- next;
- mes "[Caroller]";
- mes "The gift boxes have been changing into monsters since Antonio placed some magic on them, so the monsters ate up the crystal fragments!";
- next;
- mes "[Caroller]";
- mes "I am so devastated, since the Singing Crystal has been the hope of many children around the villages.";
- next;
- if (select("There's no other way to carol?:You can hear carols in Lutie.") == 2) {
- mes "[Caroller]";
- mes "And just stay there, every Christmas, for your whole life?";
- next;
- mes "["+strcharinfo(0)+"]";
- mes "What? What do you mean?";
- next;
- mes "[Caroller]";
- mes "Oh, nevermind.";
- mes "Ah...";
- close;
- }
- mes "[Caroller]";
- mes "Maybe, it's quite hard to make a jukebox for the villages, but a music box might be possible.";
- next;
- mes "[Caroller]";
- mes "We need the ^0000FFSinging Crystal Pieces^000000 that the monsters ate up.";
- next;
- mes "[Caroller]";
- mes "Please bring me ^0000FF6 Singing Crystal Pieces^000000, and you will be rewarded with presents!";
- next;
- mes "[Caroller]";
- mes "Sounds cool, huh!!";
- next;
- select("........................");
- mes "[Caroller]";
- mes "...Why are you staring at me like that?";
- next;
- mes "[Caroller]";
- mes "You're thinking that we are always getting our plans spoiled, aren't you?";
- next;
- mes "[Caroller]";
- mes "I know that we are not good at controlling stuff, but our rewards are good, right?";
- next;
- select("........................");
- mes "[Caroller]";
- mes "Hey, we treat you good...";
- next;
- select("........................");
- mes "[Caroller]";
- mes "You are so cruel to me!";
- mes "Bad! Bad!";
+ mes "And just stay there, every Christmas, for your whole life?";
next;
- mes "[Caroller]";
- mes "Please, for our children's hope!!!?";
- mes "Please bring me 6 Singing Crystal Pieces from ^0000FFViolent Gift Boxes^000000!";
+ mes "["+strcharinfo(0)+"]";
+ mes "What? What do you mean?";
next;
- emotion e_ok;
mes "[Caroller]";
- mes "They're definitely as harsh as their name.";
- mes "Go on please!";
- iROxmas08carol = 1;
+ mes "Oh, nevermind.";
+ mes "Ah...";
close;
+ }
+ mes "[Caroller]";
+ mes "Maybe, it's quite hard to make a jukebox for the villages, but a music box might be possible.";
+ next;
+ mes "[Caroller]";
+ mes "We need the ^0000FFSinging Crystal Pieces^000000 that the monsters ate up.";
+ next;
+ mes "[Caroller]";
+ mes "Please bring me ^0000FF6 Singing Crystal Pieces^000000, and you will be rewarded with presents!";
+ next;
+ mes "[Caroller]";
+ mes "Sounds cool, huh!!";
+ next;
+ select("........................");
+ mes "[Caroller]";
+ mes "...Why are you staring at me like that?";
+ next;
+ mes "[Caroller]";
+ mes "You're thinking that we are always getting our plans spoiled, aren't you?";
+ next;
+ mes "[Caroller]";
+ mes "I know that we are not good at controlling stuff, but our rewards are good, right?";
+ next;
+ select("........................");
+ mes "[Caroller]";
+ mes "Hey, we treat you good...";
+ next;
+ select("........................");
+ mes "[Caroller]";
+ mes "You are so cruel to me!";
+ mes "Bad! Bad!";
+ next;
+ mes "[Caroller]";
+ mes "Please, for our children's hope!!!?";
+ mes "Please bring me 6 Singing Crystal Pieces from ^0000FFViolent Gift Boxes^000000!";
+ next;
+ emotion e_ok;
+ mes "[Caroller]";
+ mes "They're definitely as harsh as their name.";
+ mes "Go on please!";
+ iROxmas08carol = 1;
+ close;
case 4:
mes "[Caroller]";
@@ -260,7 +260,6 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
mes "It's hot, huh?";
close;
-
case 5:
mes "[Caroller]";
mes "A-N-T-O-N-I-O!!!";
@@ -279,7 +278,7 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
close;
}
}
-
+
if (iROxmas08carol == 1) {
if (countitem(6092) < 6) {
mes "[Caroller]";
@@ -345,7 +344,7 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
close;
}
}
-
+
if (iROxmas08carol == 2) {
if (countitem(1019) < 10 || countitem(1005) < 1 || countitem(7312) < 1 || countitem(938) < 10 || countitem(732) < 1) {
mes "[Caroller]";
@@ -442,7 +441,7 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
mes "All right, what comes to your mind when you think about Christmas?";
next;
switch(select("Carolling:Santa Claus:Gift Boxes:Santa Costume:Not much really...")) {
-
+
case 1:
mes "[Santa Claus]";
mes "Carolling! That's good!";
@@ -471,7 +470,7 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
mes "A bad Santa ruins us good Santa's reputations!";
mes "The World Santa Organization is considering this a grave situation.";
close;
-
+
case 3:
mes "[Santa Claus]";
mes "A gift box! That sounds good!";
@@ -680,7 +679,7 @@ prontera,226,306,4 script Caroller#iROxmas08 1_F_PRIEST,{
mes "There used to be designer who visited my house to make my Santa costumes.";
mes "Do you have any ideas?";
close;
-
+
case 5:
mes "[Santa Claus]";
mes "........................";
diff --git a/npc/events/dumplingfestival.txt b/npc/events/dumplingfestival.txt
index 23a085eb8..e20e4dd2a 100644
--- a/npc/events/dumplingfestival.txt
+++ b/npc/events/dumplingfestival.txt
@@ -10,7 +10,7 @@
//= Ver 1.0- Duplicate of MRO's Dumpling Event
//= 1.01 fixed bugs [Lupus]
//============================================================
-
+
payon,93,81,4 script Exorcist Master Fahae 4_M_BUDDHIST,{
mes "[Exorcist Master Fahae]";
@@ -64,7 +64,7 @@ payon,93,81,4 script Exorcist Master Fahae 4_M_BUDDHIST,{
mes "Here you go, I hope you may succeed in my quest.";
close;
}
-
+
// Monsters
//============================================================
gef_fild00,0,0,0,0 monster Dumpling 1520,20,60000,66000
diff --git a/npc/events/god_se_festival.txt b/npc/events/god_se_festival.txt
index 3b7dd50e8..aed725db5 100644
--- a/npc/events/god_se_festival.txt
+++ b/npc/events/god_se_festival.txt
@@ -120,7 +120,6 @@ yuno,118,192,5 script Rmimi Ravies#gq_fes01 4_F_HUGIRL,{
mes "[Rmimi Ravies]";
mes "Have a good time.";
donpcevent "Rmimi Ravies#gq_fes01::OnStart";
-
announce "["+ strcharinfo(0) +"] member of ["+ getguildname(.@GID) +"] is summoning a 'Valkyrie's Present' in 'Juno'.",bc_all,"0x70dbdb";
close;
}
@@ -390,7 +389,6 @@ OnTimer3900000:
end;
}
-
// Original name: "Festival Manager#god_se_fes02"
rachel,1,1,0 script Festival Manager#gq_fes2 4_F_HUGIRL,{
callfunc "F_GM_NPC";
diff --git a/npc/events/halloween_2009.txt b/npc/events/halloween_2009.txt
index f67841c15..2f3a978e3 100644
--- a/npc/events/halloween_2009.txt
+++ b/npc/events/halloween_2009.txt
@@ -193,17 +193,17 @@ OnInit:
hideonnpc "Trick or Treater#iRO7";
hideonnpc "Trick or Treater#iRO8";
end;
-
+
OnEnableTreat:
enablenpc strnpcinfo(3);
hideonnpc strnpcinfo(3);
end;
-
+
OnTimer15000:
hideonnpc strnpcinfo(3);
disablenpc strnpcinfo(3);
end;
-
+
OnTimer300000:
donpcevent strnpcinfo(3)+"::OnEnableTreat";
stopnpctimer;
diff --git a/npc/events/nguild/nguild_flags.txt b/npc/events/nguild/nguild_flags.txt
index dcd3dbc14..830ded7f9 100644
--- a/npc/events/nguild/nguild_flags.txt
+++ b/npc/events/nguild/nguild_flags.txt
@@ -94,9 +94,6 @@ nguild_alde,74,64,2 duplicate(NGuildAlde) NGuild Aldebaran#a1-18 GUILD_FLAG
nguild_alde,203,150,4 duplicate(NGuildAlde) NGuild Aldebaran#a1-19 GUILD_FLAG
nguild_alde,210,150,4 duplicate(NGuildAlde) NGuild Aldebaran#a1-20 GUILD_FLAG
-
-
-
//============================================================================//
// Castle 2
//============================================================================//
@@ -125,8 +122,6 @@ nguild_gef,17,171,5 duplicate(NGuildGef) NGuild Geffen#g1-10 GUILD_FLAG
nguild_gef,59,16,4 duplicate(NGuildGef) NGuild Geffen#g1-11 GUILD_FLAG
nguild_gef,64,16,4 duplicate(NGuildGef) NGuild Geffen#g1-12 GUILD_FLAG
-
-
//============================================================================//
// Castle 3
//============================================================================//
@@ -155,9 +150,6 @@ nguild_pay,221,116,4 duplicate(NGuildPay) NGuild Payon#f1-9 GUILD_FLAG
nguild_pay,206,108,4 duplicate(NGuildPay) NGuild Payon#f1-10 GUILD_FLAG
nguild_pay,212,108,4 duplicate(NGuildPay) NGuild Payon#f1-11 GUILD_FLAG
-
-
-
//=============================================================================//
// Castle 4
//=============================================================================//
diff --git a/npc/events/valentinesday_2009.txt b/npc/events/valentinesday_2009.txt
index 56195d06a..aaaf74a85 100644
--- a/npc/events/valentinesday_2009.txt
+++ b/npc/events/valentinesday_2009.txt
@@ -314,7 +314,7 @@ prontera,154,185,5 script Event Ring Maker#Val09 4_F_KAFRA7,{
mes "Come back when you're experienced enough to handle the quests.";
close;
}
-
+
if (iROval09ring >= 1) {
mes "[Event Ring Maker]";
mes "The box with the ring, carved with your name, is for the one you love.";
@@ -328,7 +328,7 @@ prontera,154,185,5 script Event Ring Maker#Val09 4_F_KAFRA7,{
mes "Be aware, and always try to stay popular!";
close;
}
-
+
mes "[Event Ring Maker]";
mes "Hi, there, how are ya?";
mes "Come to me if you're interested in the event, 'Who's Valentine's Hottest?'";
@@ -435,7 +435,7 @@ prontera,157,185,4 script Valentine Vote Manager#v 4_F_KAFRA5,{
next;
break;
}
-
+
if (Sex) {
if (countitem(7947) > .@input) {
mes "[Valentine Vote Manager]";
@@ -444,7 +444,7 @@ prontera,157,185,4 script Valentine Vote Manager#v 4_F_KAFRA5,{
next;
break;
}
-
+
if (countitem(7947) < .@input) {
mes "[Valentine Vote Manager]";
mes "Seems like the value you entered is too large.";
@@ -452,7 +452,7 @@ prontera,157,185,4 script Valentine Vote Manager#v 4_F_KAFRA5,{
next;
break;
}
-
+
mes "[Valentine Vote Manager]";
mes "I'll take those silver rings, and count the votes for you.";
mes "Thank you for participating.";
@@ -472,7 +472,7 @@ prontera,157,185,4 script Valentine Vote Manager#v 4_F_KAFRA5,{
next;
break;
}
-
+
if (countitem(7946) < .@input) {
mes "[Valentine Vote Manager]";
mes "Seems like the value you entered is too large.";
@@ -480,7 +480,7 @@ prontera,157,185,4 script Valentine Vote Manager#v 4_F_KAFRA5,{
next;
break;
}
-
+
mes "[Valentine Vote Manager]";
mes "I'll take those gold rings, and count the votes for you.";
mes "Thank you for participating.";
@@ -533,7 +533,7 @@ prt_castle,42,35,3 script Dessert Manager#Val09 1_M_01,{
mes "Annoying, annoying, annoying~~!";
close;
}
-
+
mes "[Charles Orleans]";
mes "Oh, Mademoiselle!";
mes "This little trifling space felt like heaven the minute you walked in!";
@@ -629,5 +629,4 @@ prt_castle,42,35,3 script Dessert Manager#Val09 1_M_01,{
mes "I hope this is just what you wanted, for it bears your beautiful heart inside.";
close;
}
-
}
diff --git a/npc/events/xmas.txt b/npc/events/xmas.txt
index e420f9e6d..be43b3752 100644
--- a/npc/events/xmas.txt
+++ b/npc/events/xmas.txt
@@ -90,7 +90,7 @@ L_Start:
mes "If you get 3 more, I'll give you another.";
mes "Hope you get a good item.";
close;
-
+
L_NotEnuf:
mes "You don't have enough socks as proof.";
mes "Go take down those evil Santas";
diff --git a/npc/instances/SealedShrine.txt b/npc/instances/SealedShrine.txt
index 5bbe81d27..da2244323 100644
--- a/npc/instances/SealedShrine.txt
+++ b/npc/instances/SealedShrine.txt
@@ -120,18 +120,17 @@ monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{
mes "Umm... But it seems that there is a problem here... I'll check quickly. Please wait.";
}
else {
- for (.@i = 1; .@i <= 2; ++.@i) {
- if( instance_attachmap(.@i + "@cata", .@instance) == "" )
- break;
- }
- if( .@i < 2 ) {
- instance_destroy(.@instance);
- close;
+ for (.@i = 1; .@i <= 2; .@i++) {
+ if( instance_attachmap(.@i + "@cata", .@instance) == "" ) {
+ mes "Failed to attach "+.@i+"@cata as a map!";
+ instance_destroy(.@instance);
+ close;
+ }
}
instance_set_timeout 7200,300,.@instance;
instance_init(.@instance);
-
+
mes "Okay... I'll adjust the shrine's seal so that you and your group can enter.";
next;
mes "[Friar Patrick]";
@@ -1456,7 +1455,6 @@ OnTimer70000:
end;
}
-
1@cata,1,1,0 script ins_1f_spawn_mobs -1,{
OnInstanceInit:
.@map$ = instance_mapname("1@cata");
diff --git a/npc/jobs/1-1e/taekwon.txt b/npc/jobs/1-1e/taekwon.txt
index 5f15305c0..e7d94e567 100644
--- a/npc/jobs/1-1e/taekwon.txt
+++ b/npc/jobs/1-1e/taekwon.txt
@@ -417,4 +417,3 @@ payon,157,141,5 script Phoenix#TKJobChange 4_M_MONK,{
close;
}
}
-
diff --git a/npc/jobs/2-1/assassin.txt b/npc/jobs/2-1/assassin.txt
index e88f0adc6..c98fca135 100644
--- a/npc/jobs/2-1/assassin.txt
+++ b/npc/jobs/2-1/assassin.txt
@@ -1482,7 +1482,7 @@ OnTimer187000:
OnDisable:
stopnpctimer;
end;
-
+
OnMyMobDead:
mapannounce "in_moc_16","Hey, what the hell was that?! I told you: No killing monsters!",bc_map;
mapannounce "in_moc_16","I'm bringing you back... *Sigh...*",bc_map;
diff --git a/npc/jobs/2-1/priest.txt b/npc/jobs/2-1/priest.txt
index e28106f69..89573956e 100644
--- a/npc/jobs/2-1/priest.txt
+++ b/npc/jobs/2-1/priest.txt
@@ -1860,4 +1860,3 @@ function script F_FatherYos {
mes "...Acolyte, you don't have any business with me here.";
close;
}
-
diff --git a/npc/jobs/2-1e/StarGladiator.txt b/npc/jobs/2-1e/StarGladiator.txt
index 91ac02ea3..e45d7c576 100644
--- a/npc/jobs/2-1e/StarGladiator.txt
+++ b/npc/jobs/2-1e/StarGladiator.txt
@@ -352,7 +352,7 @@ OnTouch:
mes "You're blocking my sun!";
close;
}
-
+
comodo,172,230,3 script Wandering Master#job_sta 4_M_JOB_ASSASSIN,{
if (Class == Job_Taekwon) {
if (STGL_Q == 1) {
diff --git a/npc/jobs/2-2/crusader.txt b/npc/jobs/2-2/crusader.txt
index c713194de..22e9b917d 100644
--- a/npc/jobs/2-2/crusader.txt
+++ b/npc/jobs/2-2/crusader.txt
@@ -969,8 +969,6 @@ prt_castle,35,151,5 script Patron Knight 4_M_CRU,{
close;
}
-
-
// Actual tests
//============================================================
@@ -1201,7 +1199,6 @@ OnDead:
end;
}
-
job_cru,98,105,4 script Summoner#cr5 WARPNPC,3,3,{
OnTouch:
CRUS_Q = 6;
diff --git a/npc/jobs/2-2a/Professor.txt b/npc/jobs/2-2a/Professor.txt
index 68cac14cf..8fee58494 100644
--- a/npc/jobs/2-2a/Professor.txt
+++ b/npc/jobs/2-2a/Professor.txt
@@ -88,4 +88,3 @@ valkyrie,53,47,3 script Scholar#Valkyrie 2_M_SAGE_OLD,{
mes "Honor to the warriors!";
close;
}
-
diff --git a/npc/jobs/valkyrie.txt b/npc/jobs/valkyrie.txt
index c7cef8107..d2a7108b1 100644
--- a/npc/jobs/valkyrie.txt
+++ b/npc/jobs/valkyrie.txt
@@ -398,4 +398,3 @@ S_Warpchar:
//============================================================
valkyrie,48,73,0 warp valk01#1 1,1,valkyrie,48,64
valkyrie,48,66,0 warp valk01#2 1,1,valkyrie,48,75
-
diff --git a/npc/merchants/dye_maker.txt b/npc/merchants/dye_maker.txt
index bca4ef276..bd2440c19 100644
--- a/npc/merchants/dye_maker.txt
+++ b/npc/merchants/dye_maker.txt
@@ -185,7 +185,7 @@ S_MakeDye:
Zeny -= .@cost;
// get dyestuff
getitem .@dyestuff,1;
-
+
mes "[Dye Maker Java Dullihan]";
mes "Hmm... It came out pretty well. A very rich color. Of course I'll be trying harder to make a more charming color...";
next;
diff --git a/npc/merchants/old_pharmacist.txt b/npc/merchants/old_pharmacist.txt
index 1889ea3b9..15a8206b6 100644
--- a/npc/merchants/old_pharmacist.txt
+++ b/npc/merchants/old_pharmacist.txt
@@ -181,7 +181,7 @@ alberta_in,16,28,4 script Pharmacist 1_M_PUBMASTER,{
mes "What a boring person. If you have something to say, why don't you say it?!";
close;
}
-
+
L_Making:
next;
mes "[Old Pharmacist]";
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index b88fa647a..ff5b78b2d 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -42,7 +42,6 @@
//= 2.19 Improved 'F_InsertComma' function. [Emistry]
//============================================================
-
//////////////////////////////////////////////////////////////////////////////////
// Returns a number with commas based on precision of digits and custom separator.
// -- callfunc "F_InsertComma",<number>{,<precision>,<separator>}
@@ -56,10 +55,10 @@ function script F_InsertComma {
.@value = getarg(0);
.@precision = getarg(1,3);
.@separator$ = getarg( 2,"," );
-
+
.@str$ = ""+.@value;
.@is_negative = ( .@value < 0 );
-
+
.@length = getstrlen( .@str$ ) - .@precision - .@is_negative;
while ( .@length > 0 ) {
.@str$ = insertchar( .@str$, .@separator$ , ( .@length + .@is_negative ) );
@@ -68,7 +67,6 @@ function script F_InsertComma {
return .@str$;
}
-
//////////////////////////////////////////////////////////////////////////////////
// Function that clears job quest variables
//////////////////////////////////////////////////////////////////////////////////
@@ -125,10 +123,10 @@ function script F_ClearGarbage {
RES_SKILL = 0;
//Here you put outdated variables from your outdated EVENTS
//e.g. Is XMAS done? Add the EVENT var clearing code here.
-
+
//due to bugs in BS quest:
wizard_m2 = 0;
-
+
// Old Novice Ground Variables.
NEW_MES_FLAG0 = 0;
NEW_MES_FLAG1 = 0;
@@ -139,11 +137,11 @@ function script F_ClearGarbage {
NEW_LVUP0 = 0;
NEW_LVUP1 = 0;
NEW_JOBLVUP = 0;
-
+
// Old DTS variables that are no longer used.
dtseligible = 0;
MISC_QUEST = MISC_QUEST & ~128;
-
+
return;
}
@@ -160,7 +158,6 @@ function script Job_Change {
return;
}
-
//////////////////////////////////////////////////////////////////////////////////
// Functions used to spiff up dialoges [Lupus]
//////////////////////////////////////////////////////////////////////////////////
@@ -177,7 +174,6 @@ function script F_Rand {
return getarg(rand(getargcount()));
}
-
//////////////////////////////////////////////////////////////////////////////////
// *** Function "F_Sex"
//////////////////////////////////////////////////////////////////////////////////
@@ -188,7 +184,6 @@ function script F_SexMes {
return getarg(Sex);
}
-
//////////////////////////////////////////////////////////////////////////////////
// *** Function "F_Hi"
//////////////////////////////////////////////////////////////////////////////////
@@ -198,7 +193,6 @@ function script F_Hi {
return callfunc("F_Rand","Hi!","Hello!","Good day!","How are you?","Hello there.");
}
-
//////////////////////////////////////////////////////////////////////////////////
// *** Function "F_Bye"
//////////////////////////////////////////////////////////////////////////////////
@@ -208,7 +202,6 @@ function script F_Bye {
return callfunc("F_Rand","Bye. See you again.","Later.","Goodbye.","Good luck!","Have a nice day!","Byebye!!!");
}
-
//////////////////////////////////////////////////////////////////////////////////
// *** Function "F_ItemName"
//////////////////////////////////////////////////////////////////////////////////
@@ -337,14 +330,14 @@ function script F_GetArmorType {
// *********************************************************************
function script Time2Str {
.@time_left = getarg(0) - gettimetick(2);
-
+
.@Days = .@time_left / 86400;
.@time_left -= (.@Days * 86400);
.@Hours = .@time_left / 3600;
.@time_left -= (.@Hours * 3600);
.@Minutes = .@time_left / 60;
.@time_left -= (.@Minutes * 60);
-
+
.@Time$ = "";
if( .@Days > 1 )
.@Time$ += .@Days + " days, ";
@@ -365,6 +358,6 @@ function script Time2Str {
.@Time$ += .@time_left + " seconds";
else if( .@time_left == 1 )
.@Time$ += .@time_left + " second";
-
+
return .@Time$;
}
diff --git a/npc/other/books.txt b/npc/other/books.txt
index 6ad8968b2..aef8a4079 100644
--- a/npc/other/books.txt
+++ b/npc/other/books.txt
@@ -391,7 +391,7 @@ prt_in,168,56,4 script Monster Encyclopedia#prt HIDDEN_NPC,{
}
}
}
-
+
prt_in,159,56,4 script Monster Encyclopedia#2pr HIDDEN_NPC,{
mes "^FF0000[Monster Encyclopedia]^000000";
mes "This is a Monster Encyclopedia";
@@ -1720,7 +1720,6 @@ prt_in,172,96,4 script Monster Encyclopedia#4pr HIDDEN_NPC,{
}
}
-
prt_in,164,96,4 script Monster Encyclopedia#5pr HIDDEN_NPC,{
mes "^FF0000[Dungeon Monster Encyclopedia]^000000";
mes "This is an Encyclopedia describing";
diff --git a/npc/other/comodo_gambling.txt b/npc/other/comodo_gambling.txt
index ea354e490..3d0e2b389 100644
--- a/npc/other/comodo_gambling.txt
+++ b/npc/other/comodo_gambling.txt
@@ -71,7 +71,7 @@ comodo,219,158,6 script Kachua 4_F_02,{
mes "you something from one of my";
mes "collections~";
next;
-
+
if (MaxWeight - Weight < 5500) {
cutin "katsua01.bmp",255;
cutin "katsua03.bmp",2;
@@ -379,7 +379,7 @@ comodo,219,158,6 script Kachua 4_F_02,{
close;
break;
}
-
+
getitem .@item,1;
cutin "katsua01.bmp",255;
diff --git a/npc/other/fortune.txt b/npc/other/fortune.txt
index a14f63fc9..dad407482 100644
--- a/npc/other/fortune.txt
+++ b/npc/other/fortune.txt
@@ -3525,7 +3525,7 @@ payon_in03,75,129,5 script Poring Fortune Teller 4_M_BIBI,{
}
close;
}
-
+
payon_in03,118,119,1 script Ascetic 4W_F_01,2,2,{
mes "[Kissy-Kissy]";
mes "NyangNyangNyang~";
diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt
index d84c94cd3..a31a8f47a 100644
--- a/npc/other/hugel_bingo.txt
+++ b/npc/other/hugel_bingo.txt
@@ -406,7 +406,7 @@ OnInit:
disablenpc "24e#bingo";
disablenpc "25e#bingo";
end;
-
+
OnTouch:
if(@bingoplate[1] == $bingo[$@bingoresult -1]){ @bingo_a1$ = "^ff0000- -^000000"; setarray @bingoplate[1],99; }
else if(@bingoplate[2] == $bingo[$@bingoresult -1]){ @bingo_a2$ = "^ff0000- -^000000"; setarray @bingoplate[2],99; }
diff --git a/npc/other/monster_museum.txt b/npc/other/monster_museum.txt
index fae93fd3e..d39b034da 100644
--- a/npc/other/monster_museum.txt
+++ b/npc/other/monster_museum.txt
@@ -59,7 +59,7 @@ yuno_in03,32,15,3 script Museum Guide 1_F_02,{
mes "Feel free to talk to me anytime.";
close;
}
-
+
yuno_in03,36,21,3 script Deviace#yuno DEVIACE,{
end;
}
@@ -85,7 +85,7 @@ yuno_in03,33,21,1 script #DEVIACE HIDDEN_NPC,{
mes "it's better to be careful with this monster.";
close;
}
-
+
yuno_in03,36,27,3 script Seal#yuno FUR_SEAL,{
end;
}
@@ -111,7 +111,7 @@ yuno_in03,33,27,1 script #FUR_SEAL HIDDEN_NPC,{
mes "for people to produce winter coats.";
close;
}
-
+
yuno_in03,36,33,3 script Sage Worm#yuno SAGEWORM,{
end;
}
@@ -133,7 +133,7 @@ yuno_in03,33,33,1 script #SAGEWORM HIDDEN_NPC,{
mes "indicates, it's usually seen near books or book shelves.";
close;
}
-
+
yuno_in03,39,39,3 script Penomena#yuno PENOMENA,{
end;
}
@@ -159,7 +159,7 @@ yuno_in03,38,39,1 script #PENOMANA HIDDEN_NPC,{
mes "enough to kill its enemy at once.";
close;
}
-
+
yuno_in03,39,44,3 script Galapago#yuno GALAPAGO,{
end;
}
@@ -180,7 +180,7 @@ yuno_in03,37,44,3 script #GALAPAGO HIDDEN_NPC,{
mes "generally laid back monster.";
close;
}
-
+
yuno_in03,15,21,5 script Raydric#yuno RAYDRIC,{
end;
}
@@ -201,7 +201,7 @@ yuno_in03,19,21,1 script #RAYDRIC HIDDEN_NPC,{
mes "and powerful attack strength.";
close;
}
-
+
yuno_in03,15,27,5 script Chepet#yuno CHEPET,{
end;
}
@@ -220,7 +220,7 @@ yuno_in03,19,27,1 script #CHEPET HIDDEN_NPC,{
mes "only a few places.";
close;
}
-
+
yuno_in03,15,33,5 script Violy#yuno VIOLY,{
end;
}
@@ -237,7 +237,7 @@ yuno_in03,19,33,1 script #VIOLY HIDDEN_NPC,{
mes "Exercise extreme caution upon encountering a Violy. Otherwise, it will snatch your soul in no time with its charming song.";
close;
}
-
+
yuno_in03,10,39,5 script Alice#yuno ALICE,{
end;
}
@@ -259,7 +259,7 @@ yuno_in03,12,39,1 script #ALICE HIDDEN_NPC,{
mes "is still a scientific mystery.";
close;
}
-
+
yuno_in03,10,45,5 script Assulter#yuno ASSULTER,{
end;
}
@@ -284,7 +284,7 @@ yuno_in03,12,45,1 script #ASSULTER HIDDEN_NPC,{
mes "is more threatening.";
close;
}
-
+
yuno_in03,38,50,3 script PecoPeco Egg#yuno PECOPECO_EGG,{
end;
}
@@ -316,7 +316,7 @@ yuno_in03,20,96,1 script #WANDER_MAN HIDDEN_NPC,{
mes "stroke of its sword.";
close;
}
-
+
yuno_in03,16,100,5 script Caterpillar#yuno CATERPILLAR,{
end;
}
@@ -338,7 +338,7 @@ yuno_in03,18,100,1 script #CATERPILLAR HIDDEN_NPC,{
mes "Creamy.";
close;
}
-
+
yuno_in03,16,104,5 script Male Thiefbug#yuno THIEF_BUG__,{
end;
}
@@ -356,7 +356,7 @@ yuno_in03,18,104,1 script #THIEF_BUG__ HIDDEN_NPC,{
mes "However, it is stronger than other Thief Bugs because it's designated to protect the females and babies from danger.";
close;
}
-
+
yuno_in03,16,108,5 script Tri Joint#yuno TRI_JOINT,{
end;
}
@@ -376,7 +376,7 @@ yuno_in03,18,108,1 script #TRI_JOINT HIDDEN_NPC,{
mes "Recently, since many Tri Joints have been discovered inside many caves, Sages are very excited to study them to learn more about the evolution of monsters in Rune-Midgard.";
close;
}
-
+
yuno_in03,16,111,5 script Arclouz#yuno ARCLOUSE,{
end;
}
@@ -399,7 +399,7 @@ yuno_in03,18,111,1 script #ARCLOUSE HIDDEN_NPC,{
mes "compared to PecoPecos.";
close;
}
-
+
yuno_in03,16,117,5 script Dragon Tail#yuno DRAGON_TAIL,{
end;
}
@@ -418,7 +418,7 @@ yuno_in03,18,116,1 script #DRAGON_TAIL HIDDEN_NPC,{
mes "a sleeping poison.";
close;
}
-
+
yuno_in03,46,96,3 script Owl Duke#yuno OWL_DUKE,{
end;
}
@@ -443,7 +443,7 @@ yuno_in03,44,96,1 script #OWL_DUKE HIDDEN_NPC,{
mes "aristocratic pompousness.";
close;
}
-
+
yuno_in03,48,100,3 script Marine Sphere#yuno MARINE_SPHERE,{
end;
}
@@ -467,7 +467,7 @@ yuno_in03,46,101,1 script #MARINE_SPHERE HIDDEN_NPC,{
mes "a dangerous chain reaction.";
close;
}
-
+
yuno_in03,48,104,3 script Mandragora#yuno MANDRAGORA,{
end;
}
@@ -498,7 +498,7 @@ yuno_in03,46,105,1 script #MANDRAGORA HIDDEN_NPC,{
mes "from useful in attracting prey.";
close;
}
-
+
yuno_in03,48,108,3 script Geographer#yuno GEOGRAPHER,{
end;
}
@@ -532,7 +532,7 @@ yuno_in03,46,108,1 script #GEOGRAPHER HIDDEN_NPC,{
mes "never be forgotten...";
close;
}
-
+
yuno_in03,48,112,3 script Rafflesia#yuno RAFFLESIA,{
end;
}
@@ -557,7 +557,7 @@ yuno_in03,46,112,1 script #RAFFLESIA HIDDEN_NPC,{
mes "cultivate and save the Rafflesias.";
close;
}
-
+
yuno_in03,48,116,3 script Stem Worm#yuno STEM_WORM,{
end;
}
@@ -601,7 +601,7 @@ yuno_in03,24,122,1 script #BLAZZER HIDDEN_NPC,{
mes "form of communication.";
close;
}
-
+
yuno_in03,28,124,5 script Ride Word#yuno RIDEWORD,{
end;
}
@@ -616,7 +616,7 @@ yuno_in03,28,122,1 script #RIDEWORD HIDDEN_NPC,{
mes "sharp teeth. It exists to attack any living thing nearby.";
close;
}
-
+
yuno_in03,31,124,3 script Megalodon#yuno MEGALODON,{
end;
}
@@ -634,7 +634,7 @@ yuno_in03,31,122,1 script #MEGALODON HIDDEN_NPC,{
mes "undersea travellers outright.";
close;
}
-
+
yuno_in03,35,124,3 script Sleeper#yuno SLEEPER,{
end;
}
@@ -655,7 +655,7 @@ yuno_in03,35,122,1 script #SLEEPER HIDDEN_NPC,{
mes "cause indirect attacks by causing a sand storm.";
close;
}
-
+
yuno_in03,39,124,3 script Ancient Mummy#yuno ANCIENT_MUMMY,{
end;
}
@@ -684,7 +684,7 @@ yuno_in03,39,122,1 script #ANCIENT_MUMMY HIDDEN_NPC,{
mes "attack any living thing nearby.";
close;
}
-
+
yuno_in03,18,122,5 script Incubus#yuno INCUBUS,{
end;
}
@@ -706,7 +706,7 @@ yuno_in03,19,120,1 script #INCUBUS HIDDEN_NPC,{
mes "it can eventually take them to hell.";
close;
}
-
+
yuno_in03,44,120,3 script Succubus#yuno SUCCUBUS,{
end;
}
diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt
index 5e99c97d8..6b52dd870 100644
--- a/npc/other/poring_war.txt
+++ b/npc/other/poring_war.txt
@@ -356,7 +356,7 @@ OnInit:
//============================================================
poring_w01,91,97,3 script Poring#wop_door_all PORING,{
end;
-
+
OnInit:
waitingroom "[Recruiting 10 Battle Participants]",11,"Poring#wop_door_all::OnStartArena",10,500,9;
enablewaitingroomevent;
diff --git a/npc/other/pvp.txt b/npc/other/pvp.txt
index b8d104ce2..70c02d1bc 100644
--- a/npc/other/pvp.txt
+++ b/npc/other/pvp.txt
@@ -314,8 +314,6 @@ function script F_PVP_FSRS {
end;
}
-
-
// Event Contestant Entrance
//============================================================
pvp_room,54,85,4 script Registration Staff#1 8W_SOLDIER,{
diff --git a/npc/other/turbo_track.txt b/npc/other/turbo_track.txt
index e2dd1d661..36a1b4fe1 100644
--- a/npc/other/turbo_track.txt
+++ b/npc/other/turbo_track.txt
@@ -45,7 +45,7 @@ OnStartArena:
donpcevent "Broadcast#"+.@in$+.@in+"::OnEnable";
disablewaitingroomevent strnpcinfo(0);
end;
-
+
OnInit:
if (compare(strnpcinfo(0),"main")) end;
if (compare(strnpcinfo(2),"n1")) {
@@ -66,7 +66,7 @@ turbo_room,77,135,3 duplicate(entrance#tt_main) Normal mode - 4 person 4_F_TELEP
turbo_room,84,135,3 duplicate(entrance#tt_main) Normal mode - 8 person 4_F_TELEPORTER
turbo_room,91,135,3 duplicate(entrance#tt_main) Normal mode - 16 person 4_F_TELEPORTER
turbo_room,72,132,3 duplicate(entrance#tt_main) Solo Mode#n1 4_F_TELEPORTER
-
+
turbo_e_4,298,167,3 script Helper#tt_main 4_F_TELEPORTER,{
mes "[Helper]";
mes "You are now in the";
@@ -96,7 +96,7 @@ OnTouch:
else
warp strnpcinfo(4),59,364;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "Point Give-Away Guy#"+.@w$;
@@ -391,12 +391,12 @@ OnTimer927000:
disablenpc "Flasher_Exit_1#"+.@w$;
disablenpc "Flasher_Exit_2#"+.@w$;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "Master#"+.@w$;
end;
-
+
function RName {
.@s = (getstrlen(getarg(0)) > 2)?(substr(getarg(0),1,2)):(charat(getarg(0),getstrlen(getarg(0))-1));
.@rn$ = ((compare(strnpcinfo(4),"_e_"+.@s))?"Expert mode":"Normal mode")+" - "+.@s+" person";
@@ -1641,7 +1641,6 @@ turbo_n_8,332,279,0 duplicate(snake02#tt_main) snake02#n8 WARPNPC,1,1
turbo_n_16,332,279,0 duplicate(snake02#tt_main) snake02#n16 WARPNPC,1,1
turbo_n_1,332,279,0 duplicate(snake02#tt_main) snake02#n1 WARPNPC,1,1
-
- script snake03#tt_main WARPNPC,1,1,{
OnTouch:
.@turbo2 = rand(1,8);
@@ -1659,7 +1658,6 @@ turbo_n_8,324,270,0 duplicate(snake03#tt_main) snake03#n8 WARPNPC,1,1
turbo_n_16,324,270,0 duplicate(snake03#tt_main) snake03#n16 WARPNPC,1,1
turbo_n_1,324,270,0 duplicate(snake03#tt_main) snake03#n1 WARPNPC,1,1
-
- script snake04#tt_main WARPNPC,1,1,{
OnTouch:
.@turbo2 = rand(1,7);
@@ -1679,7 +1677,7 @@ turbo_n_1,332,270,0 duplicate(snake04#tt_main) snake04#n1 WARPNPC,1,1
- script SnakeHunt#tt_main -1,{
end;
-
+
OnReset:
killmonsterall strnpcinfo(4);
end;
@@ -1947,7 +1945,7 @@ OnTouch:
}
disablenpc "#cos_"+.@w$+"_end";
end;
-
+
function GetNumber {
setarray .@w_n$[1], "n4","n8","n16","e4","e8","e16";
for (.@i = 1; .@i <= getarraysize(.@w_n$); ++.@i) {
@@ -1955,7 +1953,7 @@ OnTouch:
return .@i;
}
}
-
+
OnInit:
.@w$ = callfunc("F_tt");
enablenpc "#cos_"+.@w$+"_end";
@@ -1980,7 +1978,7 @@ OnTouch:
disablenpc "#cos_"+.@w$+"_end2";
enablenpc "#cos_"+.@w$+"_end3";
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "#cos_"+.@w$+"_end2";
@@ -2038,7 +2036,7 @@ OnTouch:
mapannounce strnpcinfo(4),strcharinfo(0) +" has just passed the Flasher Maze!",bc_map,"0x70DBDB";
warp strnpcinfo(4),185,227;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc strnpcinfo(0);
@@ -2361,7 +2359,7 @@ turbo_n_1,114,190,0 duplicate(Flasher#tt_main) Flasher_Exit_2#n1 WARPNPC,1,1
end;
}
}
-
+
OnEnable:
.@w$ = callfunc("F_tt");
enablenpc "Winner Helper#TBT_"+.@w$;
@@ -2403,12 +2401,12 @@ OnTimer25000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"In the meantime, winners must procceed to receive their rewards as soon as possible.",bc_map,"0x33FF66";
end;
-
+
OnTimer28000:
.@w$ = callfunc("F_tt");
if (compare(.@w$,"4")) mapannounce strnpcinfo(4),"Al De Baran Turbo Track is brought to you by...",bc_map,"0x33FF66";
end;
-
+
OnTimer30000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"Thank you for visiting Al De Baran Turbo Track.",bc_map,"0x33FF66";
@@ -2422,7 +2420,7 @@ OnTimer35000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"Al De Baran Turbo Track is brought to you by...",bc_map,"0x33FF66";
end;
-
+
OnTimer36000:
.@w$ = callfunc("F_tt");
if (compare(.@w$,"4")) mapannounce strnpcinfo(4),"[Al De Baran Guild Castle Management Luina]",bc_map,"0x33FF66";
@@ -2450,7 +2448,7 @@ OnTimer48000:
.@w$ = callfunc("F_tt");
if (compare(.@w$,"4")) mapannounce strnpcinfo(4),"Once again, we'd like to thank our sponsors.",bc_map,"0x33FF66";
end;
-
+
OnTimer50000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"[Blacksmith Union]",bc_map,"0x33FF66";
@@ -2460,7 +2458,7 @@ OnTimer52000:
.@w$ = callfunc("F_tt");
if (compare(.@w$,"4")) mapannounce strnpcinfo(4),"Have a good day.",bc_map,"0x33FF66";
end;
-
+
OnTimer55000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"And [Comodo Casino].",bc_map,"0x33FF66";
@@ -2492,17 +2490,17 @@ OnTimer60000:
mapannounce strnpcinfo(4),"Once again, we'd like to thank our sponsors.",bc_map,"0x33FF66";
}
end;
-
+
OnTimer65000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapannounce strnpcinfo(4),"Have a good day.",bc_map,"0x33FF66";
end;
-
+
OnTimer70000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) mapwarp strnpcinfo(4),"turbo_room",72,89;
end;
-
+
OnTimer71000:
.@w$ = callfunc("F_tt");
if (!compare(.@w$,"4")) {
@@ -2525,13 +2523,13 @@ OnTimer71000:
stopnpctimer;
}
end;
-
+
function RName {
.@s = (getstrlen(getarg(0)) > 2)?(substr(getarg(0),1,2)):(charat(getarg(0),getstrlen(getarg(0))-1));
.@rn$ = ((compare(strnpcinfo(4),"_e_"+.@s))?"Expert mode":"Normal mode")+" - "+.@s+" person";
return .@rn$;
}
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "Winner Helper#TBT_"+.@w$;
@@ -2672,7 +2670,7 @@ turbo_n_1,384,167,1 script Guide#TBT_n1 1_M_01,{
end;
}
}
-
+
OnEnable:
.@w$ = callfunc("F_tt");
enablenpc "Guide#TBT_"+.@w$;
@@ -2752,7 +2750,7 @@ OnTimer60000:
donpcevent "Solo Mode#"+.@w$+"::OnEnable";
stopnpctimer;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "Guide#TBT_"+.@w$;
@@ -2766,7 +2764,7 @@ OnTouch:
donpcevent "Turbo Track Guide::OnEnd_"+.@w$;
disablenpc "Notice_Maker1#TBT_"+.@w$;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
enablenpc "Notice_Maker1#TBT_"+.@w$;
@@ -2786,7 +2784,7 @@ OnTouch:
mapannounce strnpcinfo(4),strcharinfo(0) +" is now entering the Single Snail! " + strcharinfo(0) +" is now in the lead!",bc_map,"0xFFFF00";
disablenpc "Notice_Maker3#TBT_"+.@w$;
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
enablenpc "Notice_Maker3#TBT_"+.@w$;
@@ -3625,7 +3623,7 @@ OnTouch:
default: break;
}
end;
-
+
OnInit:
.@w$ = callfunc("F_tt");
disablenpc "bing2#"+.@w$;
@@ -4251,7 +4249,6 @@ turbo_room,93,117,5 script Point Exchange Helper 4_M_TELEPORTER,{
mes "Points you have earned before";
mes "redeeming your points again.";
close;
-
}
tt_point -= 40;
if (BaseLevel < 70) getexp 3000,0;
diff --git a/npc/pre-re/guides/guides_alberta.txt b/npc/pre-re/guides/guides_alberta.txt
index 164aa528b..26a4bc6f1 100644
--- a/npc/pre-re/guides/guides_alberta.txt
+++ b/npc/pre-re/guides/guides_alberta.txt
@@ -48,7 +48,7 @@ alberta,23,238,4 script Guide#alb::AlbGuide 8W_SOLDIER,{
while (.@loop2) {
if (.@wait_button_chk == 0) .@wait_button_chk = 1;
else next;
-
+
switch(select("^FF0000Merchant Guild^000000:Weapon Shop:Tool Shop:Inn:Forge:Cancel")) {
case 1:
mes "[Alberta Guide]";
diff --git a/npc/pre-re/guides/guides_amatsu.txt b/npc/pre-re/guides/guides_amatsu.txt
index 85bd79047..fc27425af 100644
--- a/npc/pre-re/guides/guides_amatsu.txt
+++ b/npc/pre-re/guides/guides_amatsu.txt
@@ -66,7 +66,7 @@ amatsu,207,89,3 script Amatsu Guide#ama 4_F_JPN,{
close;
}
}
-
+
amatsu,251,283,4 script Guide Man#2ama 8_M_JPNSOLDIER,{
mes "[Guide Man]";
mes "Welcome, tourist from Rune-Midgard.";
diff --git a/npc/pre-re/guides/guides_izlude.txt b/npc/pre-re/guides/guides_izlude.txt
index 7961f46da..16bcf2146 100644
--- a/npc/pre-re/guides/guides_izlude.txt
+++ b/npc/pre-re/guides/guides_izlude.txt
@@ -45,7 +45,7 @@ izlude,121,87,6 script Guide#iz 8W_SOLDIER,{
while(.@loop2) {
if (.@wait_button_chk == 0) .@wait_button_chk = 1;
else next;
-
+
switch(select("^FF0000Swordman Association^000000:Swordman Hall:Arena:Izlude Marina:Weapon Shop:Tool Shop:Cancel")) {
case 1:
mes "[Izlude Guide]";
diff --git a/npc/pre-re/guides/guides_morroc.txt b/npc/pre-re/guides/guides_morroc.txt
index 47777fa17..82e233173 100644
--- a/npc/pre-re/guides/guides_morroc.txt
+++ b/npc/pre-re/guides/guides_morroc.txt
@@ -45,7 +45,7 @@ morocc,153,286,6 script Guide#moc::MocGuide 4_M_MOC_SOLDIER,{
while(.@loop2) {
if (.@wait_button_chk == 0) .@wait_button_chk = 1;
else next;
-
+
switch(select("^FF0000Thief Guild^000000:Weapon Shop:Inn:Pub:Mercenary Guild:Forge:Cancel")) {
case 1:
mes "[Morroc Guide]";
diff --git a/npc/pre-re/guides/guides_moscovia.txt b/npc/pre-re/guides/guides_moscovia.txt
index 49975358f..32abb90f6 100644
--- a/npc/pre-re/guides/guides_moscovia.txt
+++ b/npc/pre-re/guides/guides_moscovia.txt
@@ -80,7 +80,6 @@ moscovia,161,76,4 script Moscovia Guide#mosk 4_F_RUSWOMAN1,{
viewpoint 2,223,174,3,0x00FF00;
viewpoint 2,229,208,4,0x3355FF;
close;
-
case 3:
mes "[Moscovia Guide]";
mes "It'd be great to walk about alone.";
diff --git a/npc/pre-re/jobs/1-1/acolyte.txt b/npc/pre-re/jobs/1-1/acolyte.txt
index 9e138d9c6..1f9411f53 100644
--- a/npc/pre-re/jobs/1-1/acolyte.txt
+++ b/npc/pre-re/jobs/1-1/acolyte.txt
@@ -465,4 +465,3 @@ prt_fild00,208,218,6 script Ascetic#3aco 4W_M_02,{
}
}
}
-
diff --git a/npc/pre-re/jobs/1-1/archer.txt b/npc/pre-re/jobs/1-1/archer.txt
index 97ea540c1..d1ba4bf99 100644
--- a/npc/pre-re/jobs/1-1/archer.txt
+++ b/npc/pre-re/jobs/1-1/archer.txt
@@ -241,4 +241,3 @@ payon_in02,64,71,4 script Archer Guildsman#archer 4_M_03,{
close;
}
}
-
diff --git a/npc/pre-re/quests/collection/quest_demonpungus.txt b/npc/pre-re/quests/collection/quest_demonpungus.txt
index d72e3f816..b255e26b5 100644
--- a/npc/pre-re/quests/collection/quest_demonpungus.txt
+++ b/npc/pre-re/quests/collection/quest_demonpungus.txt
@@ -238,5 +238,3 @@ ein_fild01,43,249,0 script Local Villager#hunt 4_M_HUMAN_01,{
close;
}
}
-
-
diff --git a/npc/pre-re/quests/collection/quest_dokebi.txt b/npc/pre-re/quests/collection/quest_dokebi.txt
index 898c353cb..4e9aabd2e 100644
--- a/npc/pre-re/quests/collection/quest_dokebi.txt
+++ b/npc/pre-re/quests/collection/quest_dokebi.txt
@@ -228,5 +228,3 @@ pay_fild10,108,357,5 script Li#Dokebi_Hunt 4_F_01,{
close;
}
}
-
-
diff --git a/npc/pre-re/quests/collection/quest_fabre.txt b/npc/pre-re/quests/collection/quest_fabre.txt
index 5de7e74fd..f5cd2bf19 100644
--- a/npc/pre-re/quests/collection/quest_fabre.txt
+++ b/npc/pre-re/quests/collection/quest_fabre.txt
@@ -225,5 +225,3 @@ gef_fild07,321,193,4 script Langry#Fabre_Hunt 4_M_SAGE_A,{
close;
}
}
-
-
diff --git a/npc/pre-re/quests/collection/quest_frilldora.txt b/npc/pre-re/quests/collection/quest_frilldora.txt
index 95ee22d3c..2b6b9139d 100644
--- a/npc/pre-re/quests/collection/quest_frilldora.txt
+++ b/npc/pre-re/quests/collection/quest_frilldora.txt
@@ -234,5 +234,3 @@ moc_fild17,66,273,5 script Lemly#Frilldora_Hunt 4_F_JOB_ASSASSIN,{
close;
}
}
-
-
diff --git a/npc/pre-re/quests/collection/quest_goat.txt b/npc/pre-re/quests/collection/quest_goat.txt
index ee5c33f54..4f6ae56e3 100644
--- a/npc/pre-re/quests/collection/quest_goat.txt
+++ b/npc/pre-re/quests/collection/quest_goat.txt
@@ -240,4 +240,3 @@ ein_fild06,82,171,0 script Vegetable Farmer#Goat 4_F_SHABBY,{
close;
}
}
-
diff --git a/npc/pre-re/quests/collection/quest_golem.txt b/npc/pre-re/quests/collection/quest_golem.txt
index 8ad2d47b2..0f0ca8e5d 100644
--- a/npc/pre-re/quests/collection/quest_golem.txt
+++ b/npc/pre-re/quests/collection/quest_golem.txt
@@ -226,5 +226,3 @@ moc_fild11,57,138,0 script Private Jeremy#hunt 4_M_MOC_SOLDIER,{
close;
}
}
-
-
diff --git a/npc/quests/skills/novice_skills.txt b/npc/pre-re/quests/skills/novice_skills.txt
index 4e688f639..4e688f639 100644
--- a/npc/quests/skills/novice_skills.txt
+++ b/npc/pre-re/quests/skills/novice_skills.txt
diff --git a/npc/pre-re/scripts_jobs.conf b/npc/pre-re/scripts_jobs.conf
index 4c554e054..491fba8dd 100644
--- a/npc/pre-re/scripts_jobs.conf
+++ b/npc/pre-re/scripts_jobs.conf
@@ -12,3 +12,7 @@ npc: npc/pre-re/jobs/1-1/swordman.txt
npc: npc/pre-re/jobs/1-1/thief.txt
// - Novice
npc: npc/pre-re/jobs/novice/novice.txt
+
+// ------------------------ Skill Quests ------------------------
+// - Novice
+npc: npc/pre-re/quests/skills/novice_skills.txt
diff --git a/npc/quests/first_class/tu_merchant.txt b/npc/quests/first_class/tu_merchant.txt
index a13ec1aa6..23696186e 100644
--- a/npc/quests/first_class/tu_merchant.txt
+++ b/npc/quests/first_class/tu_merchant.txt
@@ -142,8 +142,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "For your final assignment, I will ask you to learn the Vending skill up to Skill Level 4. Of course, once you do, I'll give you a little reward. I'll be waiting, so do your best~";
tu_merchant = 16;
- erasequest 8239;
- setquest 8240;
+ changequest 8239, 8240;
close;
}
@@ -176,8 +175,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "You deserve a little";
mes "reward for your effort~";
tu_merchant = 15;
- erasequest 8238;
- setquest 8239;
+ changequest 8238, 8239;
getexp 162,52;
next;
mes "[Guarnien]";
@@ -188,8 +186,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "Excellent!";
mes "You've actually went above and beyond mastered the Push Cart skill. Great work!";
tu_merchant = 15;
- erasequest 8238;
- setquest 8239;
+ changequest 8238, 8239;
getexp 186,60;
next;
mes "[Guarnien]";
@@ -230,8 +227,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "speed, it shouldn't be a big deal.";
mes "Well done~";
tu_merchant = 15;
- erasequest 8237;
- setquest 8238;
+ changequest 8237, 8239;
getexp 162,52;
next;
mes "[Guarnien]";
@@ -243,8 +239,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "mastered the Push Cart skill.";
mes "You truly deserve a little bit of a reward~";
tu_merchant = 15;
- erasequest 8237;
- setquest 8238;
+ changequest 8237, 8239;
getexp 186,60;
next;
mes "[Guarnien]";
@@ -258,6 +253,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "you do that, I can go on to";
mes "my next lecture.";
tu_merchant = 14;
+ changequest 8237, 8238;
close;
}
case 12:
@@ -275,8 +271,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "as I asked. Please,";
mes "take this little reward~";
tu_merchant = 13;
- erasequest 8236;
- setquest 8237;
+ changequest 8236, 8237;
getexp 126,27;
next;
mes "[Guarnien]";
@@ -289,8 +284,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "mastered Over Charge?";
mes "Most impressive! You deserve a small reward for your work!";
tu_merchant = 13;
- erasequest 8236;
- setquest 8237;
+ changequest 8236, 8237;
getexp 142,33;
next;
mes "[Guarnien]";
@@ -322,8 +316,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "Ah, you've already learned Level 4 Over Charge. Perfect! Let me give you a little reward~";
tu_merchant = 13;
- erasequest 8235;
- setquest 8236;
+ changequest 8235, 8237;
getexp 126,27;
next;
mes "[Guarnien]";
@@ -334,8 +327,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "Amazing! You've already mastered the Over Charge skill! You must have wanted this reward badly~";
tu_merchant = 13;
- erasequest 8235;
- setquest 8236;
+ changequest 8235, 8237;
getexp 142,33;
next;
mes "[Guarnien]";
@@ -346,8 +338,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "Personally, I think you should learn this skill for sure! For your next assignment, learn Over Charge up to Level 4. It shouldn't be too difficult to do.";
tu_merchant = 12;
- erasequest 8235;
- setquest 8236;
+ changequest 8235, 8236;
next;
mes "[Guarnien]";
mes "Once you do that,";
@@ -418,6 +409,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "some reason --to send you there right now. Get ready...!";
next;
tu_merchant = rand(6,8);
+ changequest 8233, 8234;
warp "prontera",155,46;
end;
case 4:
@@ -430,8 +422,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "how to use the Discount skill";
mes "well enough. Good, here's a little reward for your hard work~";
tu_merchant = 5;
- erasequest 8232;
- setquest 8233;
+ changequest 8232, 8233;
getexp 83,11;
next;
mes "[Guarnien]";
@@ -441,8 +432,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "Incredible!";
mes "You've actually mastered the Discount skill! You're such a great student. You deserve a bit of a reward!";
tu_merchant = 5;
- erasequest 8232;
- setquest 8233;
+ changequest 8232, 8233;
getexp 97,18;
next;
mes "[Guarnien]";
@@ -476,8 +466,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "Here, take this";
mes "small reward~";
tu_merchant = 5;
- erasequest 8231;
- setquest 8232;
+ changequest 8231, 8233;
getexp 83,11;
next;
mes "[Guarnien]";
@@ -488,8 +477,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "Incredible!";
mes "You've actually mastered the Discount skill! You're such a great student. You deserve a bit of a reward!";
tu_merchant = 5;
- erasequest 8231;
- setquest 8232;
+ changequest 8231, 8233;
getexp 97,18;
next;
mes "[Guarnien]";
@@ -506,8 +494,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "Still, you can't ignore the fact that bargaining is an essential skill for a Merchant! Come back to me when you're ready~";
tu_merchant = 4;
- erasequest 8231;
- setquest 8232;
+ changequest 8231, 8232;
close;
}
case 2:
@@ -530,8 +517,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "Well, since you're still green, I feel awfully sorry if you've wasted Zeny. Why don't you take this as compensation?";
tu_merchant = 3;
- erasequest 8230;
- setquest 8231;
+ changequest 8230, 8231;
getexp 70,12;
next;
mes "[Guarnien]";
@@ -540,8 +526,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
} else {
mes "Okay. Now I think we're ready for me to discuss the ^871F78Discount^000000 skill. Come back when you'd like me to tell you more about it, okay?";
tu_merchant = 3;
- erasequest 8230;
- setquest 8231;
+ changequest 8230,8231;
close;
}
case 1:
@@ -553,7 +538,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
next;
mes "[Guarnien]";
.@chk_soji = getskilllv(MC_INCCARRY);
- if(.@chk_soji > 3 && .@chk_soji < 10){
+ if(.@chk_soji > 3 && .@chk_soji <= 10){
mes "Ah. I can tell that you have. Not bad! By now you should be able to learn the ^871F78Discount^000000 skill, but I'll teach you about that later.";
next;
mes "[Guarnien]";
@@ -569,8 +554,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "[Guarnien]";
mes "I see in your eyes that you've already learned to appraise items. Haha, although having that knowledge is reward in itself, let me give you something extra!";
tu_merchant = 2;
- erasequest 8229;
- setquest 8230;
+ changequest 8229, 8230;
getexp 58,11;
getitem 1351,1; //Battle_Axe
next;
@@ -588,8 +572,7 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "Alright, next time";
mes "I'll talk about the Mammonite skill. For now, let me take a little bit of a break from all of this arduous lecture. ^666666*Whew!*^000000";
tu_merchant = 2;
- erasequest 8229;
- setquest 8230;
+ changequest 8229, 8230;
close;
}
@@ -638,7 +621,6 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
if(getskilllv(MC_IDENTIFY)){
mes "I see in your eyes that you've already learned to appraise items. Haha, although having that knowledge is reward in itself, let me give you something extra!";
tu_merchant = 2;
- erasequest 8229;
setquest 8230;
getexp 58,11;
getitem 1351,1; //Battle_Axe
@@ -658,7 +640,6 @@ alberta_in,70,51,5 script Guarnien 4W_M_02,{
mes "skill later. I always manage";
mes "to forget about that!";
tu_merchant = 2;
- erasequest 8229;
setquest 8230;
close;
}
diff --git a/npc/quests/first_class/tu_sword.txt b/npc/quests/first_class/tu_sword.txt
index dc2b4109c..b200e246f 100644
--- a/npc/quests/first_class/tu_sword.txt
+++ b/npc/quests/first_class/tu_sword.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Fix up by Jukka
//===== Current Version: =====================================
-//= 1.6
+//= 1.7
//===== Description: =========================================
//= [Official Conversion]
//= Swordman training quest.
@@ -15,6 +15,7 @@
//= 1.4 Misc. updates. [L0ne_W0lf]
//= 1.5 Added Renewal Izlude coordinates.
//= 1.6 Added Pre-Renewal support. [Euphy]
+//= 1.7 Fixed quest log linking [KirieZ]
//============================================================
// Shurank
@@ -213,6 +214,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Next time, I will tell you more about the Magnum Break skill.";
mes "I'll be here when you're ready to learn more.";
tu_swordman = 22;
+ changequest 8227,8228;
close;
case 13:
mes "You should leave as soon as possible to meet Dequ'ee in Geffen. You do remember where to find him, don't you?";
@@ -227,8 +229,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "From that gleen of toughness upon your skin, I see now that I was foolish to ask. Well done~";
tu_swordman = 13;
- erasequest 8221;
- setquest 8222;
+ changequest 8221, 8222;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -275,8 +276,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
next;
mes "[Shurank]";
mes "Since you've learned the Endure skill already, I don't think I need to explain it any further. You've done well.";
- erasequest 8221;
- setquest 8222;
+ changequest 8221, 8222;
tu_swordman = 13;
next;
mes "[Shurank]";
@@ -292,8 +292,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "From that gleen of toughness upon your skin, I see now that I was foolish to ask. Well done~";
tu_swordman = 13;
- erasequest 8221;
- setquest 8222;
+ changequest 8221, 8222;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -357,8 +356,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "Since you've learned the Endure skill already, I don't think I need to explain it any further. You've done well.";
tu_swordman = 13;
- erasequest 8221;
- setquest 8222;
+ changequest 8220, 8222;
next;
mes "[Shurank]";
mes "Ah, once again, I have";
@@ -372,8 +370,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "Hm. But judging from the gleen of toughness on your skin, I suppose teaching you about Endure would be a waste of your time. Well done!";
tu_swordman = 13;
- erasequest 8221;
- setquest 8222;
+ changequest 8220, 8222;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -398,6 +395,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "Ah, I see that you have a fairly good understanding of the Provoke skill. Let me reward you in this small way for your efforts.";
tu_swordman = 10;
+ changequest 8219, 8220;
if (RENEWAL_EXP)
getexp 112,0;
else
@@ -415,6 +413,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "an outstanding Swordman.";
mes "Here is a small reward...";
tu_swordman = 10;
+ changequest 8219, 8220;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -462,11 +461,13 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "Alright, come back to me when you become sufficiently skilled in the use of Provoke. In the meantime, keep training.";
tu_swordman = 9;
+ changequest 8218,8219;
close;
} else if((.@chk_provoke > 4) && (.@chk_provoke < 10)){
mes "[Shurank]";
mes "Ah, I see that you have a fairly good understanding of the Provoke skill. Let me reward you in this small way for your efforts.";
tu_swordman = 10;
+ changequest 8218,8220;
if (RENEWAL_EXP)
getexp 112,0;
else
@@ -484,6 +485,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "an outstanding Swordman.";
mes "Here is a small reward...";
tu_swordman = 10;
+ changequest 8218,8220;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -562,13 +564,13 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Now I ask that you train yourself in the use of Provoke. Come back";
mes "to me when you have a sufficient understanding of the use of the Provoke skill.";
tu_swordman = 9;
- changequest 8218,8219;
+ changequest 8217,8219;
close;
} else if((.@chk_provoke > 4) && (.@chk_provoke < 10)){
mes "[Shurank]";
mes "Ah, I see that you have a fairly good understanding of the Provoke skill. Let me reward you in this small way for your efforts.";
tu_swordman = 10;
- changequest 8219,8220;
+ changequest 8217,8220;
if (RENEWAL_EXP)
getexp 112,0;
else
@@ -586,10 +588,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "an outstanding Swordman.";
mes "Here is a small reward...";
tu_swordman = 10;
- completequest 8218;
- completequest 8219;
- completequest 8220;
- setquest 8221;
+ changequest 8217,8220;
if (RENEWAL_EXP)
getexp 126,0;
else
@@ -706,6 +705,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
}
mes "[Shurank]";
mes "By now, I believe that you know enough about the Increase HP Recovery skill. Next time, I shall teach you what I know about the Provoke skill.";
+ changequest 8214, 8215;
close;
case 3:
mes "If you want to be";
@@ -725,6 +725,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Here's a small prize in recognition of your efforts thus far. But don't relax yet! You still have a long way to go before grasping";
mes "all of the basics.";
tu_swordman = 4;
+ changequest 8213, 8214;
if (RENEWAL_EXP)
getexp 97,0;
else
@@ -763,6 +764,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Here's a little reward for all of your hard work. I hope you realize the importance of using Bash as";
mes "you grow stronger.";
tu_swordman = 3;
+ changequest 8212, 8213;
if (RENEWAL_EXP)
getexp 83,0;
else
@@ -777,6 +779,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Here's a small prize in recognition of your efforts thus far. But don't relax yet! You still have a long way to go before grasping";
mes "all of the basics.";
tu_swordman = 4;
+ changequest 8212, 8214;
if (RENEWAL_EXP)
getexp 97,0;
else
@@ -815,6 +818,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Still, for your training efforts, let me give you a humble reward. But remember, we still have more";
mes "of the fundamentals to cover!";
tu_swordman = 2;
+ changequest 8211, 8212;
if (RENEWAL_EXP)
getexp 58,0;
else
@@ -847,7 +851,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "[Shurank]";
mes "For your efforts and patience, I offer you this small reward. Please take it and grow even stronger...";
tu_swordman = 3;
- setquest 8211;
+ changequest 8211, 8213;
if (RENEWAL_EXP)
getexp 83,0;
else
@@ -865,6 +869,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Here's a small prize in recognition of your efforts thus far. But don't relax yet! You still have a long way to go before grasping";
mes "all of the basics.";
tu_swordman = 4;
+ changequest 8211, 8214;
if (RENEWAL_EXP)
getexp 97,0;
else
@@ -928,7 +933,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Still, for your training efforts, let me give you a humble reward. But remember, we still have more";
mes "of the fundamentals to cover!";
tu_swordman = 2;
- changequest 8211,8212;
+ setquest 8212;
if (RENEWAL_EXP)
getexp 58,0;
else
@@ -954,7 +959,7 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Still, for your training efforts, let me give you a humble reward. But remember, we still have more";
mes "of the fundamentals to cover!";
tu_swordman = 3;
- changequest 8212,8213;
+ setquest 8213;
if (RENEWAL_EXP)
getexp 83,0;
else
@@ -972,9 +977,6 @@ izlude_in,82,163,3 script Shurank 4_M_JOB_KNIGHT1,{
mes "Here's a small prize in recognition of your efforts thus far. But don't relax yet! You still have a long way to go before grasping";
mes "all of the basics.";
tu_swordman = 4;
- completequest 8211;
- completequest 8212;
- completequest 8213;
setquest 8214;
if (RENEWAL_EXP)
getexp 97,0;
diff --git a/npc/quests/lvl4_weapon_quest.txt b/npc/quests/lvl4_weapon_quest.txt
index e55a57afc..449d3d705 100644
--- a/npc/quests/lvl4_weapon_quest.txt
+++ b/npc/quests/lvl4_weapon_quest.txt
@@ -2807,13 +2807,13 @@ niflheim,187,280,3 script Hein#lv4 4_M_NFDEADMAN,{
mes "[Hein]";
mes "Ready? This is";
mes "what I wrote down...";
- if (.@npchand == 1) {
+ if (.@npchand1 == 1) {
mes "Scissors";
}
- else if (.@npchand == 2) {
+ else if (.@npchand1 == 2) {
mes "Rock";
}
- else if (.@npchand == 3) {
+ else if (.@npchand1 == 3) {
mes "Paper";
}
if (.@npchand2 == 1) {
diff --git a/npc/quests/newgears/2010_headgears.txt b/npc/quests/newgears/2010_headgears.txt
index c2a44eacb..844cf5d23 100644
--- a/npc/quests/newgears/2010_headgears.txt
+++ b/npc/quests/newgears/2010_headgears.txt
@@ -1,16 +1,16 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= 2010 Headgear Quest
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= Quests For Headgears:
//= Flower Of Fairy, NeckTie, Hair Brush
//= Status Of Baby Angel, Frog Cap, Solo Play Box
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 Converted from the official Aegis script. [Dastgir]
-//============================================================
+//============================================================
gonryun,149,189,0 script Yotang#Flower_Of_Fairy 1_M_04,{
mes "[Yotang]";
@@ -709,7 +709,6 @@ gef_fild07,108,161,4 script Roda Frog#Frog_Cap RODA_FROG,1,1,{
close2;
donpcevent "Roda Frog#Frog_Cap::OnDisable";
end;
-
}
else if (2009_hat == 5) {
if (questprogress(5004,HUNTING) == 1) {
@@ -827,7 +826,6 @@ OnTouch:
close;
}
-
// 6. Making the new headgear Solo Playing Box 1,2 ()5448,5449)
alberta,120,206,3 script Alonie#Solo_Play_Box 4_M_UMKID,{
if (2009_1_hat == 0) {
@@ -948,7 +946,6 @@ alberta,120,206,3 script Alonie#Solo_Play_Box 4_M_UMKID,{
mes "Go and kill";
mes "^FF000040 Arclouses and 30 High Orcs^000000!";
close;
-
}
else if (2009_1_hat == 3) {
if ((questprogress(1108,HUNTING) == 2) && (questprogress(1105,HUNTING) == 2)) {
@@ -1109,5 +1106,4 @@ alberta,120,206,3 script Alonie#Solo_Play_Box 4_M_UMKID,{
close;
}
end;
-
}
diff --git a/npc/quests/quests_lighthalzen.txt b/npc/quests/quests_lighthalzen.txt
index 7e34a9729..6cadc346a 100644
--- a/npc/quests/quests_lighthalzen.txt
+++ b/npc/quests/quests_lighthalzen.txt
@@ -3082,7 +3082,6 @@ lighthalzen,337,232,3 script Maku 4_M_LGTPOOR,{
end;
}
-
yuno_in04,107,14,5 script Student 4_M_SAGE_A,{
if (friendship == 7 || friendship == 8) {
mes "[Joey Choryee]";
@@ -9787,8 +9786,6 @@ OnTimer190000:
end;
}
-
-
lhz_in01,182,35,0 script File Search Engine HIDDEN_NPC,{
if((lhz_boss > 28) && (lhz_boss < 35))
diff --git a/npc/quests/quests_nameless.txt b/npc/quests/quests_nameless.txt
index e43318e8a..d14ddaa8e 100644
--- a/npc/quests/quests_nameless.txt
+++ b/npc/quests/quests_nameless.txt
@@ -1147,8 +1147,6 @@ OnInit:
end;
}
-
-
nameless_i,168,257,0 script outtoin_01#mo WARPNPC,1,1,{
end;
diff --git a/npc/quests/skills/hunter_skills.txt b/npc/quests/skills/hunter_skills.txt
index b85aa3d42..b0b4f7bf7 100644
--- a/npc/quests/skills/hunter_skills.txt
+++ b/npc/quests/skills/hunter_skills.txt
@@ -373,4 +373,3 @@ pay_arche,109,169,3 script Arpesto 4_M_05,{
close;
}
}
-
diff --git a/npc/re/cities/dewata.txt b/npc/re/cities/dewata.txt
index fe6b661a3..4e96f7b33 100644
--- a/npc/re/cities/dewata.txt
+++ b/npc/re/cities/dewata.txt
@@ -496,7 +496,7 @@ dewata,89,191,6 script Small Shrine#dew1 CLEAR_NPC,{
"Lover","Girl friend","Boy friend"; //128
setarray .@index[0],
1,1,2,2,2,2,4,4,8,8,8,16,16,16,16,16,32,32,32,32,32,32,64,64,64,128,128,128;
-
+
if (.@good_luck == 7 || .@good_luck == 77 || .@good_luck == 777 || .@good_luck == 7777)
.@bonus = 1;
for(.@i = 0; .@i<getarraysize(.@wishes$); ++.@i) {
diff --git a/npc/re/cities/eclage.txt b/npc/re/cities/eclage.txt
index 35984cd64..51b7ae764 100644
--- a/npc/re/cities/eclage.txt
+++ b/npc/re/cities/eclage.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= General Eclage NPC.
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= Eclage Town NPC
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 Converted from the official Aegis script. [Dastgir]
-//============================================================
+//============================================================
ecl_in02,96,22,3 script sign#prison_inn 2_BOARD1,{
mes "[North] Prison";
@@ -51,7 +51,6 @@ ecl_in02,164,56,3 script Receptionist#Laphine 4_F_FAIRYKID2,{
percentheal 100,100;
warp "ecl_in02",167,49;
end;
-
case 2:
if (Zeny < 5000) {
mes "[Receptionist]";
diff --git a/npc/re/cities/izlude.txt b/npc/re/cities/izlude.txt
index 6c6734cd1..875a2039f 100644
--- a/npc/re/cities/izlude.txt
+++ b/npc/re/cities/izlude.txt
@@ -83,7 +83,7 @@ prt_fild08d,350,219,4 duplicate(Guard_izlude) Guard#izlude_d 8W_SOLDIER
// Channel Warper
//============================================================
function script F_IzludeChannel {
- mes "[Izlude Copy Warper]";
+ mes "[Channel Warp Official]";
mes "Izlude is a verly lively place is it not?";
mes "I am here to help make Izlude feel more smooth!";
mes "I can send you to another copy of Izlude.";
@@ -98,8 +98,187 @@ function script F_IzludeChannel {
}
close;
}
-izlude,122,105,5 script Izlude Copy Warper 1_M_WIZARD,{ callfunc "F_IzludeChannel",":Go to copy 2:Go to copy 3:Go to copy 4:Go to copy 5"; }
-izlude_a,122,105,5 script Izlude Copy Warper#_a 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1::Go to copy 3:Go to copy 4:Go to copy 5"; }
-izlude_b,122,105,5 script Izlude Copy Warper#_b 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2::Go to copy 4:Go to copy 5"; }
-izlude_c,122,105,5 script Izlude Copy Warper#_c 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2:Go to copy 3::Go to copy 5"; }
-izlude_d,122,105,5 script Izlude Copy Warper#_d 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2:Go to copy 3:Go to copy 4:"; }
+
+izlude,122,105,5 script Channel Warp Official 1_M_WIZARD,{ callfunc "F_IzludeChannel",":Go to copy 2:Go to copy 3:Go to copy 4:Go to copy 5"; }
+izlude_a,122,105,5 script Channel Warp Official#_a 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1::Go to copy 3:Go to copy 4:Go to copy 5"; }
+izlude_b,122,105,5 script Channel Warp Official#_b 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2::Go to copy 4:Go to copy 5"; }
+izlude_c,122,105,5 script Channel Warp Official#_c 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2:Go to copy 3::Go to copy 5"; }
+izlude_d,122,105,5 script Channel Warp Official#_d 1_M_WIZARD,{ callfunc "F_IzludeChannel","Go to copy 1:Go to copy 2:Go to copy 3:Go to copy 4:"; }
+
+// Talking NPCs
+//============================================================
+izlude,143,205,7 script Talkative Kid#iz 4_F_KID2,{
+ end;
+
+ OnTimer64000:
+ npctalk "I used all my Novice Red Potions. What should I do?";
+ end;
+
+ OnTimer72000:
+ npctalk "Where is the shop?";
+ end;
+
+ OnTimer136000:
+ npctalk "Idiot! You do not know about the 'shortcut window'?";
+ end;
+
+ OnTimer144000:
+ npctalk "The items in your inventory can be dragged and put in the shortcut window.";
+ end;
+
+ OnTimer212000:
+ npctalk "I got so many beginner's items in the Academy!";
+ end;
+
+ OnTimer276000:
+ npctalk "They even gave me weapons and a shield!";
+ end;
+
+ OnTimer284000:
+ npctalk "Just press <Ctrl+~key> to open the map you have.";
+ end;
+
+ OnTimer344000:
+ npctalk "Then do you want to go Criatura Academy with me? I'm learning how to battle from Instructor Subino!";
+ end;
+
+ OnTimer348000:
+ npctalk "The Academy is in North side of Izlude. Let's go~!";
+ end;
+
+ OnTimer416000:
+ npctalk "It's a system to guide you to a destination.";
+ end;
+
+ OnTimer424000:
+ npctalk "In the basic menu, please click the [Navigation] button.";
+ end;
+
+ OnTimer492000:
+ npctalk "Whee, Ain't gonna use your brain? Please type /where in the chat window now!";
+ end;
+
+ OnTimer552000:
+ npctalk "In this case, you can push the <Enter> key.";
+ end;
+
+ OnTimer560000:
+ npctalk "We are just repeating the same dialog. HaHaha.";
+ end;
+
+ OnTimer565000:
+ initnpctimer;
+ end;
+
+ OnInit:
+ initnpctimer;
+ end;
+}
+
+izlude_a,143,205,7 duplicate(Talkative Kid#iz) Talkative Kid#iza 4_F_KID2
+izlude_b,143,205,7 duplicate(Talkative Kid#iz) Talkative Kid#izb 4_F_KID2
+izlude_c,143,205,7 duplicate(Talkative Kid#iz) Talkative Kid#izc 4_F_KID2
+izlude_d,143,205,7 duplicate(Talkative Kid#iz) Talkative Kid#izd 4_F_KID2
+
+izlude,146,205,7 script Talkative Adventurer#iz 4_M_KID1,{
+ end;
+
+ OnTimer69000:
+ npctalk "You can buy potion from Merchants.";
+ end;
+
+ OnTimer77000:
+ npctalk "It's the Potion image in the mini map.";
+ end;
+
+ OnTimer131000:
+ npctalk "Is there any way to use items easily?";
+ end;
+
+ OnTimer141000:
+ npctalk "Shortcut window? The slots at the top of the screen? How can I use it?";
+ end;
+
+ OnTimer149000:
+ npctalk "For inventory, do you mean 'item' menu? Oh, it is!";
+ end;
+
+ OnTimer217000:
+ npctalk "I have a bunch of potions?";
+ end;
+
+ OnTimer281000:
+ npctalk "What?! I should go to the Academy now!";
+ end;
+
+ OnTimer279000:
+ npctalk "Where is Izlude? In the center?";
+ end;
+
+ OnTimer339000:
+ npctalk "I do not know what to do.";
+ end;
+
+ OnTimer349000:
+ npctalk "Oh yea? I want to know so many things~ I will go with you!";
+ end;
+
+ OnTimer411000:
+ npctalk "Navigation, What is that?";
+ end;
+
+ OnTimer421000:
+ npctalk "Oh-! Should I search for a Kafra Employee?";
+ end;
+
+ OnTimer487000:
+ npctalk "What is the town name?";
+ end;
+
+ OnTimer497000:
+ npctalk "I cannot see the part where I can write something in the chat window?";
+ end;
+
+ OnTimer557000:
+ npctalk "Oh you smarty...";
+ end;
+
+ OnTimer555000:
+ npctalk "A while ago, one Novice talked to me like hey 'Talkative Adventurer'?. HaHaha.";
+ end;
+
+ OnTimer565000:
+ initnpctimer;
+ end;
+
+ OnInit:
+ initnpctimer;
+ end;
+}
+
+izlude_a,146,205,7 duplicate(Talkative Adventurer#iz) Talkative Adventurer#iza 4_M_KID1
+izlude_b,146,205,7 duplicate(Talkative Adventurer#iz) Talkative Adventurer#izb 4_M_KID1
+izlude_c,146,205,7 duplicate(Talkative Adventurer#iz) Talkative Adventurer#izc 4_M_KID1
+izlude_d,146,205,7 duplicate(Talkative Adventurer#iz) Talkative Adventurer#izd 4_M_KID1
+
+prt_fild08,338,217,7 script Resting Adventurer#iz 4_F_SITDOWN,{
+ end;
+
+ OnTimer60000:
+ npctalk "You know what? If you are sitting, HP and SP recovery is faster.";
+ end;
+
+ OnTimer65000:
+ npctalk "Sitting is possible if your basic job skill level is more than 3. Shortcut is pressing the <INSERT> key.";
+ initnpctimer;
+ end;
+
+ OnInit:
+ initnpctimer;
+ end;
+}
+
+prt_fild08a,338,217,7 duplicate(Resting Adventurer#iz) Resting Adventurer#iza 4_F_SITDOWN
+prt_fild08b,338,217,7 duplicate(Resting Adventurer#iz) Resting Adventurer#izb 4_F_SITDOWN
+prt_fild08c,338,217,7 duplicate(Resting Adventurer#iz) Resting Adventurer#izc 4_F_SITDOWN
+prt_fild08d,338,217,7 duplicate(Resting Adventurer#iz) Resting Adventurer#izd 4_F_SITDOWN
diff --git a/npc/re/events/halloween_2014.txt b/npc/re/events/halloween_2014.txt
index 5b81a2777..69eeab721 100644
--- a/npc/re/events/halloween_2014.txt
+++ b/npc/re/events/halloween_2014.txt
@@ -45,7 +45,6 @@
mes "Let's take a look at it.";
next;
if (countitem("Captured_Soul") > 4 && countitem("Black_Soul") > 0) {
-
mes "[Mighty Priest]";
mes "Wow, this is so strong!";
mes "You may be better than our priests!";
@@ -994,7 +993,7 @@ niflheim,194,189,3 script Loru#14hal 4_LOLI_RURI,{
getitem Trans_Candy_Yellow, 10;
getitem Trans_Candy_Green, 10;
erasequest 14461;
- setquest 14464;
+ setquest 14464;
close;
} else {
mes "[Loru]";
@@ -1380,7 +1379,7 @@ niflheim,193,186,6 script Bonfire Spirit#14hal 4_TRACE,{
OnTimer27000:
donpcevent "Bonfire Spirit#14hal::OnEnable";
- end;
+ end;
}
//= Sister / Nun
@@ -1558,7 +1557,7 @@ prt_church,96,91,4 script Spiritual Sister#14hal 1_F_PRIEST,5,5,{
delitem Holy_Water, 6;
getitem Sacred_Rosary, 1;
erasequest 14452;
- setquest 14453;
+ setquest 14453;
close;
} else {
mes "[Sister Haley]";
diff --git a/npc/re/instances/BuwayaCave.txt b/npc/re/instances/BuwayaCave.txt
index 2333a2428..908c15e2f 100644
--- a/npc/re/instances/BuwayaCave.txt
+++ b/npc/re/instances/BuwayaCave.txt
@@ -89,7 +89,7 @@ ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{
}
instance_set_timeout 3600,300,.@instance;
instance_init(.@instance);
-
+
mes "[Guard]";
mes "I will open up the tunnel to ^0000ff"+.@md_name$+"^000000.";
mes "I wish you good luck.";
diff --git a/npc/re/instances/EclageInterior.txt b/npc/re/instances/EclageInterior.txt
index 88fc414ba..d28d7cf64 100644
--- a/npc/re/instances/EclageInterior.txt
+++ b/npc/re/instances/EclageInterior.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= Eclage Instance Script
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= Eclage Interior Instance
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 Converted from the official Aegis script. [Dastgir]
-//============================================================
+//============================================================
ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{
.@party_id = getcharid(1);
@@ -19,7 +19,7 @@ ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{
mes "Only the party leader will enter. Please create your party.";
close;
}
-
+
if (getpartyleader(.@party_id,2) != getcharid(0)) {
mes "-! Warning !-";
mes "This current quest will be held at Memorial dungeon.";
@@ -52,7 +52,6 @@ ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{
mes "Given the tight internal security, you should prepare yourself.";
mes "Wait here for a minute.";
close;
-
case 2:
mes "[Shenime]";
mes "It's not an easy task.";
@@ -73,7 +72,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{
switch (select("Enter it.:Forget it.")) {
case 1:
.@party_id = getcharid(1);
-
+
if (has_instance("1@ecl") == "") {
mes "It is closed shut.";
close;
@@ -101,7 +100,6 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{
mes "This current quest will be held at Memorial dungeon.";
mes "Only the party leader will enter. Please create your party.";
close;
-
case 2:
close;
}
@@ -110,10 +108,8 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{
mes "It's also a place where the lighting is set up to make Orb seem more beautiful.";
mes "It is closed shut.";
close;
- end;
}
-
1@ecl,58,69,3 script Shenime#ecl01 4_F_FAIRY,{
mes "[Shenime]";
mes "Oh, what's going on here?";
@@ -167,16 +163,16 @@ OnInstanceInit:
1@ecl,53,83,0 script #sndmaster HIDDEN_WARP_NPC,10,10,{
end;
-
+
OnInstanceInit:
.mob_summoned = 0;
disablenpc instance_npcname(strnpcinfo(0));
end;
-
+
OnEnable:
initnpctimer;
end;
-
+
OnReset:
killmonster instance_mapname("1@ecl"),instance_npcname("#sndmaster")+"::OnMyMobDead";
stopnpctimer;
@@ -191,19 +187,19 @@ OnTimer2000:
hideoffnpc instance_npcname("Suspicious Creature#7");
hideoffnpc instance_npcname("Suspicious Creature#8");
end;
-
+
OnTimer3000:
hideonnpc instance_npcname("#sndmaster");
stopnpctimer;
end;
-
+
OnMyMobDead:
if (mobcount(instance_mapname("1@ecl"),instance_npcname("#sndmaster")+"::OnMyMobDead") == 0) {
donpcevent instance_npcname("Shenime#ecl01")+"::OnEnable";
mapannounce instance_mapname("1@ecl"),"Shenime: Good, I got here just in time.",bc_map,"0xffff00"; //FW_NORMAL 12 0 0
}
end;
-
+
OnTouch:
if (.mob_summoned) end;
mes "Upon eliminating the intruders near the Orb, another strange-looking creatures appeared.";
@@ -368,20 +364,20 @@ OnInstanceInit:
warp "1@ecl",146,29;
end;
}
-
+
1@ecl,148,29,3 script Loki#ecl01 4_M_ROKI2,{
mes "[Loki]";
mes "It seems like this guy next to me has a lot more to say than I do.";
mes "Why don't you explain to him first?";
close;
-}
-
+}
+
1@ecl,147,30,3 script Nydhog#ecl01 4_F_NYDHOG,{
mes "[Guardian Nydhog]";
mes "I think you should talk to Hisie first.";
close;
}
-
+
1@ecl,144,27,5 script Hisie#ecl01 4_M_FARIY_HISIE,{
cutin "hisie01",0;
mes "[Hisie]";
@@ -495,4 +491,4 @@ OnInstanceInit:
cutin "",255;
warp "ecl_in03",57,76;
end;
-} \ No newline at end of file
+}
diff --git a/npc/re/instances/MalangdoCulvert.txt b/npc/re/instances/MalangdoCulvert.txt
index 0751b46a2..6f23195cc 100644
--- a/npc/re/instances/MalangdoCulvert.txt
+++ b/npc/re/instances/MalangdoCulvert.txt
@@ -418,7 +418,7 @@ mal_in01,160,34,4 script Missing, the Cleaner 4_CAT_SAILOR2,{
}
instance_set_timeout 3600,300,.@instance;
instance_init(.@instance);
-
+
mes "^3333FF"+.@md_name$+"^000000 - Reserving";
mes "After making the reservation, you";
mes "have to select Enter the Culvert.";
diff --git a/npc/re/instances/OctopusCave.txt b/npc/re/instances/OctopusCave.txt
index c55d5e2bf..6c3be5199 100644
--- a/npc/re/instances/OctopusCave.txt
+++ b/npc/re/instances/OctopusCave.txt
@@ -101,7 +101,7 @@ mal_dun01,151,235,5 script Starfish 4_ASTER,{
}
instance_set_timeout 3600,300,.@instance;
instance_init(.@instance);
-
+
mes "[Starfish]";
mes "I will open the gate for a while to ^0000ff"+.@md_name$+"^000000.";
mes "Please catch that pervert octopus,";
diff --git a/npc/re/instances/WolfchevLaboratory.txt b/npc/re/instances/WolfchevLaboratory.txt
index 6eadd612e..08ac36161 100644
--- a/npc/re/instances/WolfchevLaboratory.txt
+++ b/npc/re/instances/WolfchevLaboratory.txt
@@ -837,7 +837,7 @@ lhz_cube,233,24,4 script Sorcerer#Bio4Reward 4_M_UMDANCEKID,{
mes "[Pudding]";
mes "OKAY! In which equipment you want to dwell the power?";
next;
- setarray .@parts[0], EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_LOW;
+ setarray .@parts[0], EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_TOP;
for(.@i = 0; .@i < 7; .@i++) {
if(!getequipisequiped(.@parts[.@i])) {
switch(.@i) {
@@ -936,14 +936,14 @@ lhz_cube,233,24,4 script Sorcerer#Bio4Reward 4_M_UMDANCEKID,{
.@position = EQI_ACC_R;
break;
case 8:
- if(!getequipisequiped(EQI_HEAD_LOW)) {
+ if(!getequipisequiped(EQI_HEAD_TOP)) {
mes "[Pudding]";
mes "Hey.. Are you not wearing any Helm?";
close2;
enable_items;
end;
}
- .@position = EQI_HEAD_LOW;
+ .@position = EQI_HEAD_TOP;
break;
}
.@refine_count = getequiprefinerycnt(.@position);
diff --git a/npc/re/jobs/1-1/acolyte.txt b/npc/re/jobs/1-1/acolyte.txt
index 3ba4bcce9..91817e071 100644
--- a/npc/re/jobs/1-1/acolyte.txt
+++ b/npc/re/jobs/1-1/acolyte.txt
@@ -330,4 +330,3 @@ prt_fild00,208,218,6 script Ascetic#3aco 4W_M_02,{
}
}
}
-
diff --git a/npc/re/jobs/2e/kagerou_oboro.txt b/npc/re/jobs/2e/kagerou_oboro.txt
index c9f639d67..b60dcc85b 100644
--- a/npc/re/jobs/2e/kagerou_oboro.txt
+++ b/npc/re/jobs/2e/kagerou_oboro.txt
@@ -1,17 +1,17 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Kagerou / Oboro Job Quest
-//===== By: ==================================================
+//===== By: ==================================================
//= (1.0) Dastgir, M45T3R
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.1.1
//===== Description: =========================================
-//= [Official Conversion]
+//= [Official Conversion]
//= Job change Quest from Ninja -> Kagerou / Oboro.
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0.0 Initial Release. [Dastgir, M45T3R]
//= 1.1.0 Structure Clean-Up. [Euphy]
//= 1.1.1 Updated questlog commands. [Kisuka]
-//============================================================
+//============================================================
// Starting the Quest
//============================================================
diff --git a/npc/re/jobs/novice/academy.txt b/npc/re/jobs/novice/academy.txt
new file mode 100644
index 000000000..f9449f398
--- /dev/null
+++ b/npc/re/jobs/novice/academy.txt
@@ -0,0 +1,14213 @@
+//===== Hercules Script ========================================================
+//= Criatura Academy
+//===== By: ====================================================================
+//= Kisuka (1.0)
+//===== Current Version: =======================================================
+//= 1.0.1
+//===== File Encoding ==========================================================
+//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8.
+//===== Description: ===========================================================
+//= Teaches the player about the basics.
+//= Also contains Novice skill quests for First Aid and Trick Dead.
+//===== Additional Comments: ===================================================
+//= 1.0.0 Initial Release. [Kisuka]
+//= 1.0.1 Converted item constants to IDs and added hair coupon. [Kisuka]
+//==============================================================================
+
+// - Captain Carocc (Ship)
+// -----------------------------------------------------------------------------
+iz_int,100,91,3 script Captain Carocc#iz_int 4_M_REINDEER,{
+ if(Class == Job_Novice) {
+ cutin "fly_trock", 2;
+ if(!questprogress(7471)) {
+ mes "[Captain Carocc]";
+ mes "Had a good dream?";
+ mes "Soon, we will get to ^4d4fffIzlude^000000";
+ next;
+ mes "[Captain Carocc]";
+ mes "And you can talk to other people like you just talked to me.";
+ next;
+ cutin "tutorial01",3;
+ mes "!- Information -!";
+ mes "^4d4fffLeft mouse click allows basic game controls.";
+ mes "Such as conversation with NPC, movement, and attacks.^000000";
+ next;
+ cutin "fly_trock",2;
+ mes "[Captain Carocc]";
+ mes "Many youngsters visit the ^4d4fffRune Midgard Kingdom^000000 to chase their dreams.";
+ mes "Izlude is a satellite city of Prontera, the capital of the Rune Midgard Kingdom.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Izlude always welcomes young adventurers like you who have just started their journey to the World.";
+ mes "You are one of them of course.";
+ next;
+ mes "[Captain Carocc]";
+ mes "I would like to tell you more stories, but it's time to get ready for arrival.";
+ mes "There is an academy in Izlude for newcomers like yourself.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Let me give you more details later.";
+ mes "See you back at the harbor deck.";
+ next;
+ mes "[Captain Carocc]";
+ mes "To get off this ship, you should enter the ^4d4fffShining Portal^000000 over there.";
+ mes "All transportation is made through the portals.";
+ setquest 7471;
+ completequest 7471;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Captain Carocc]";
+ mes "Now, we are here in Izlude~";
+ mes "Go through that ^4d4fffShining Portal^000000 and exit outside.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Let's talk more when we get off to the deck.";
+ mes "There are lots of things I want to teach you.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+}
+
+iz_int01,100,91,3 duplicate(Captain Carocc#iz_int) Captain Carocc#iz_int01 4_M_REINDEER
+iz_int02,100,91,3 duplicate(Captain Carocc#iz_int) Captain Carocc#iz_int02 4_M_REINDEER
+iz_int03,100,91,3 duplicate(Captain Carocc#iz_int) Captain Carocc#iz_int03 4_M_REINDEER
+iz_int04,100,91,3 duplicate(Captain Carocc#iz_int) Captain Carocc#iz_int04 4_M_REINDEER
+
+// - Lumin (Ship)
+// -----------------------------------------------------------------------------
+iz_int,91,81,3 script Lumin#iz_int 4_M_NOV_RUMIN,{
+ if(Class == Job_Novice) {
+ if(!questprogress(7471)) {
+ mes "[Lumin]";
+ mes "............";
+ mes "...?";
+ next;
+ cutin "fly_trock",2;
+ mes "[Captain Carocc]";
+ mes "Hey, you awake now?";
+ mes "That fella without much talk, I rescued him from the ocean.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Think he lost his memory.";
+ mes "I gave him a new name 'Lumin'. But, just call him Lu...";
+ next;
+ mes "[Captain Carocc]";
+ mes "And you can talk to other people like you just talked to me.";
+ next;
+ cutin "tutorial01",3;
+ mes "!- Information -!";
+ mes "^4d4fffLeft mouse click allows basic game control.";
+ mes "Such as conversation with NPC, movement, and attacks.^000000";
+ next;
+ cutin "fly_trock",2;
+ mes "[Captain Carocc]";
+ mes "Many youngsters visit the ^4d4fffRune Midgard Kingdom^000000 to chase their dreams.";
+ mes "Izlude is a satellite city of Prontera, the capital of the Rune Midgard Kingdom.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Izlude always welcomes young adventurers like you who have just started their journey to the World.";
+ mes "You are one of them of course.";
+ next;
+ mes "[Captain Carocc]";
+ mes "I would like to tell you more stories, but it's time to get ready for arrival.";
+ mes "There is an academy in Izlude for newcomers like yourself.";
+ next;
+ mes "[Captain Carocc]";
+ mes "Let me give you more detail later.";
+ mes "See you back at the harbor deck.";
+ next;
+ mes "[Captain Carocc]";
+ mes "To get off this ship, you should enter the ^4d4fffShining Portal^000000 over there.";
+ mes "All transportation is made through those portals.";
+ setquest 7471;
+ completequest 7471;
+ next;
+ cutin "nov_lumin01",0;
+ mes "[Lumin]";
+ mes "Yes.";
+ next;
+ cutin "fly_trock",2;
+ mes "[Carocc]";
+ mes "Oh, boy.";
+ mes "What cute reaction.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "nov_lumin01",0;
+ mes "[Lumin]";
+ mes ".....";
+ next;
+ select("Should I introduce myself?", "My name is ~!");
+ mes "["+strcharinfo(0)+"]";
+ mes "I am "+strcharinfo(0)+"!";
+ next;
+ mes "[Lu]";
+ mes ".....";
+ next;
+ mes "[Lu]";
+ mes ".....";
+ mes "....So?";
+ next;
+ mes "- Lu just walked away with a cynical look on his face.";
+ next;
+ cutin "fly_trock",2;
+ mes "[Carocc]";
+ mes "He's just shy, you know.";
+ mes "You will see him again in Izlude, be good to him please.";
+ next;
+ mes "[Carocc]";
+ mes "From now on, I'll be driving this ship around Izlude.";
+ mes "Let's go, shall we?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+}
+
+iz_int01,91,81,3 duplicate(Lumin#iz_int) Lumin#iz_int01 4_M_NOV_RUMIN
+iz_int02,91,81,3 duplicate(Lumin#iz_int) Lumin#iz_int02 4_M_NOV_RUMIN
+iz_int03,91,81,3 duplicate(Lumin#iz_int) Lumin#iz_int03 4_M_NOV_RUMIN
+iz_int04,91,81,3 duplicate(Lumin#iz_int) Lumin#iz_int04 4_M_NOV_RUMIN
+
+// - Captain Carocc
+// -----------------------------------------------------------------------------
+izlude,198,213,3 script Captain Carocc#iz 4_M_REINDEER,5,5,{
+ cutin "fly_trock.bmp", 2;
+ if (Class == Job_Novice && BaseLevel < 15) {
+ if (questprogress(4269) == 2) {
+ if (questprogress(7471) == 2 || questprogress(7472) > 0) {
+ mes "[Carocc]";
+ mes "Oh, "+strcharinfo(0)+"!";
+ mes "Why are you here at the wharf?";
+ mes "I guess you are doing well at the academy.";
+ next;
+ mes "[Carocc]";
+ mes "I'm going to be docking and reparing the ship here for a while.";
+ mes "I will be taking the same route I tried before.";
+ next;
+ } else {
+ mes "[Carocc]";
+ mes "Hmm? You must be a student of the Criatura Academy?";
+ mes "Were you on my ship?";
+ mes "Hmm I can't remember.";
+ next;
+ mes "[Carocc]";
+ mes "Well, anything is fine.";
+ mes "Shall I go easy on you since you said you were a student of the Academy?";
+ mes "I am still the captain of the ship, regardless.";
+ next;
+ }
+ mes "[Carocc]";
+ mes "I plan on taking off as soon as the repairs are complete.";
+ mes "The route will open with ^4d4dffPharos Lighthouse^000000 by then.";
+ close;
+ } else {
+ if (questprogress(7471) == 2) {
+ if (!questprogress(7472)) {
+ mes "[Carocc]";
+ mes "This is Izlude.";
+ mes "The best city for you to take wings to your dreams.";
+ next;
+ mes "[Carocc]";
+ mes "Although I don't have any particular feelings for you,";
+ mes "I've seen a lot of young people like you, while operating the ship.";
+ next;
+ mes "[Carocc]";
+ mes "There were those among them who succeeded and failed and went back after being unable to adjust.";
+ mes "I want you to have a successful start with this place.";
+ next;
+ mes "[Carocc]";
+ mes "Did you know this?";
+ mes "Izlude has a new Institute for budding adventurers like you!";
+ next;
+ select("You mean the Academy?");
+ mes "[Carocc]";
+ mes "Yes! It's called the ^4d4dffRoyal Criatura Academy^000000.";
+ mes "Founded by the Rune Midgard lineage to help out new adventurers.";
+ next;
+ mes "[Carocc]";
+ mes "A friend of mine works there, so I 'll give you the introduction to him.";
+ mes "He could make a lot of things easier for you.";
+ next;
+ mes "[Carocc]";
+ mes "He usually talks to new adventurers near the entrance of the academy.";
+ mes "Go and meet him there.";
+ next;
+ if (!questprogress(7473)) {
+ mes "[Carocc]";
+ mes "His name is ^4d4dffHun^000000";
+ mes "I will mark his spot on the map so go to see him.";
+ setquest 7472;
+ viewpoint 1,122,207,0,0x4d4dff;
+ next;
+ mes "!- Information -!";
+ mes "The ^4d4dffMini map can be seen on the right top of the screen.";
+ mes "You can zoom in with +, zoom out with -. The waypoint from the NPC will be marked on it. ^000000";
+ next;
+ cutin "tutorial02.bmp", 4;
+ mes "!- Information -!";
+ mes "Received a Quest from ^4d4dff Captain Carocc.";
+ mes "The quest content can be checked from the quest window.";
+ next;
+ mes "!- Information -!";
+ mes "Quest window can be opened by pressing ^4d4dffAlt + u^000000 keys together.";
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "If you need more help with the map, press <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI>here";
+ mes "Yes, the part that says 'Hun'.";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dffThe icon during talk <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> means a link to navigation directions.";
+ cutin "navi01.bmp", 4;
+ next;
+ mes "!- Information -!";
+ mes "If you press info after selecting a task in the objectives^4d4dff,";
+ mes "an arrow pointing to the location of the objective will pop up along with the navigation help.";
+ cutin "navi02.bmp", 4;
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "Anyway, my friend will help you register with the academy";
+ mes "I hope it can help you for your future.";
+ close;
+ } else {
+ select("I know who you're talking about.");
+ mes "[Carocc]";
+ mes "Then there's no worry.";
+ mes "He'll introduce you to the academy.";
+ next;
+ mes "[Carocc]";
+ mes "OK. I will show you the direction. You try it again.";
+ mes "By the way, did I tell you his name? His name is ^4d4dffHun^000000";
+ viewpoint 1,122,207,1,0x4d4dff;
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff Mini map can be seen on the right top of the screen.";
+ mes "You can zoom in with +, zoom out with -. The waypoint from the NPC will be marked on it. ^000000";
+ next;
+ mes "[Carocc]";
+ mes "If you need more help with the map, press <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> here";
+ mes "Yes, the part that says [Hun].";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff the icon during talk <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> means";
+ mes "a link to navigation directions.";
+ cutin "navi01.bmp", 4;
+ next;
+ mes "!- Information -!";
+ mes "If you press info after selecting a task in the objectives^4d4dff,";
+ mes "an arrow pointing to the location of the objective will pop up along with navigation help";
+ cutin "navi02.bmp", 4;
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "Anyway, my friend will help you register with the academy";
+ mes "I hope it will help you out in your journey";
+ close;
+ }
+ } else if (questprogress(7472) == 1) {
+ mes "[Carocc]";
+ mes "If you want, you can step forward to the world right away.";
+ mes "However, I recommend you visit the Academy first.";
+ next;
+ mes "[Carocc]";
+ mes "The world is a lonely place to be alone.";
+ mes "The Academy has people you can make as lifetime companions.";
+ next;
+ mes "[Carocc]";
+ mes "My friend Hun will be around the academy entrance.";
+ mes "If you don't know the way I'll point it out to you again.";
+ viewpoint 1,122,207,0,0x4d4dff;
+ next;
+ mes "[Carocc]";
+ mes "If you need more help with the map, press <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI>here";
+ mes "Yes, the part that says ''Hun''.";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff the icon during talk <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> means";
+ mes "a link to navigation directions.";
+ cutin "navi01.bmp", 4;
+ next;
+ mes "!- Information -!";
+ mes "If you press info after selecting a task in the objectives^4d4dff,";
+ mes "an arrow pointing to the location of the objective will pop up along with navigation help.";
+ cutin "navi02.bmp", 4;
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "Anyway, my friend will help you register with the academy.";
+ mes "I hope it will help you out in your journey.";
+ close;
+ } else {
+ mes "[Carocc]";
+ mes "Oh, " + strcharinfo(0) + "!";
+ mes "Still being dilligent?";
+ mes "I've been busy, also.";
+ mes "I was reparing the ship.";
+ next;
+ mes "[Carocc]";
+ mes "I'll be taking off as soon as the repairs are complete.";
+ mes "At that time, the sailing route to ^4d4dffPharos lighthouse ^000000 will be opened.";
+ mes "Be excited for it.";
+ close;
+ }
+ } else {
+ if (!questprogress(7472)) {
+ mes "[Carocc]";
+ mes "Hello?";
+ mes "Is it your first time on Izlude?";
+ next;
+ switch(select("Hello?", "Let me get on the ship!", "I don't know what to do.")) {
+ case 1:
+ mes "[Carocc]";
+ mes "You look strong and able!";
+ mes "I like able people like you!";
+ mes "Always be healthy and strong as you are now.";
+ close;
+ case 2:
+ mes "[Carocc]";
+ mes "I usually travel to ^4d4dffPharos Lighthouse^000000.";
+ mes "But I'm resting up due to some problems.";
+ next;
+ mes "[Carocc]";
+ mes "If it's Alberta or Byalan Island, talk to the next sailor.";
+ close;
+ case 3:
+ mes "[Carocc]";
+ mes "Hmm? You said you didn't know what to do.";
+ mes "Since you're at Izlude, why don't you visit ^4d4dffCriatura Academy^000000?";
+ next;
+ mes "[Carocc]";;
+ mes "Izlude has the Institute for budding adventurers like you";
+ mes "A friend of mine works there, so I'll give you the introduction to him.";
+ next;
+ mes "[Carocc]";
+ mes "He ususally talks to new adventurers near the entrance of an academy.";
+ mes "Go and meet him personally.";
+ next;
+ if (!questprogress(7473)) {
+ mes "[Carocc]";
+ mes "His name is ^4d4dffHun^000000";
+ mes "I will mark his location on the map so go to see him.";
+ setquest 7472;
+ viewpoint 1,122,207,0,0x4d4dff;
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff Mini map can be seen on the right top of the screen.";
+ mes "You can zoom in with +, zoom out with -. The waypoint from the NPC will be marked on it. ^000000";
+ next;
+ mes "!- Information -!";
+ mes "Received a Quest from ^4d4dffCaptain Carocc.";
+ mes "Contents of your Quest can be monitored on the Quest information window.";
+ next;
+ mes "!- Information -!";
+ mes "Quest window can be opened by pressing the ^4d4dffAlt + u^000000 key.";
+ next;
+ mes "[Carocc]";
+ mes "If you need more help with the map, press <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> here";
+ mes "Yes, the part that says [Hun].";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff the icon during talk <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> means";
+ mes "a link to navigation directions.";
+ cutin "navi01.bmp", 4;
+ next;
+ mes "!- Information -!";
+ mes "If you press info after selecting a task in the objectives^4d4dff,";
+ mes "an arrow pointing to the location of the objective will pop up along with navigation help";
+ cutin "navi02.bmp", 4;
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "Anyway, my friend will help you register with the academy";
+ mes "I hope it will help you out in your journey";
+ close;
+ } else {
+ select("I know who you're talking about.");
+ mes "[Carocc]";
+ mes "Then there's no worry.";
+ mes "He'll introduce you to the academy.";
+ next;
+ mes "[Carocc]";
+ mes "OK. I will show you the direction. You try it again.";
+ mes "By the way, did I tell you his name? His name is ^4d4dffHun^000000";
+ viewpoint 1,122,207,1,0x4d4dff;
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff Mini map can be seen on the right top of the screen.";
+ mes "You can zoom in with +, zoom out with -. The waypoint from the NPC will be marked on it. ^000000";
+ next;
+ mes "[Carocc]";
+ mes "If you need more help with the map, press <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> here";
+ mes "Yes, the part that says [Hun].";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff the icon during talk <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> means";
+ mes "a link to navigation directions.";
+ cutin "navi01.bmp", 4;
+ next;
+ mes "!- Information -!";
+ mes "If you press info after selecting a task in the objectives^4d4dff,";
+ mes "an arrow pointing to the location of the objective will pop up along with navigation help";
+ cutin "navi02.bmp", 4;
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "Anyway, my friend will help you register with the academy";
+ mes "I hope it will help you out in your journey";
+ close;
+ }
+ }
+ } else if (questprogress(7472) == 1) {
+ mes "[Carocc]";
+ mes "Ah, it's you.";
+ mes "This guy has also decided to register at Criatura Academy.";
+ mes "This might be a good destiny for you. Hope you and him can be good friends.";
+ next;
+ cutin "nov_lumin01.bmp", 0;
+ mes "[Lumin]";
+ mes ".........";
+ next;
+ cutin "", 255;
+ mes "[Carocc]";
+ mes "If you want, you can step forward to the world right away.";
+ mes "However, I recommend you visit the Academy first.";
+ next;
+ mes "[Carocc]";
+ mes "The world is a lonely place to be alone.";
+ mes "The Academy has people you could make into lifetime companions.";
+ next;
+ mes "[Carocc]";
+ mes "My friend <NAVI>[Hun]<INFO>izlude,122,207</INFO></NAVI> will be around the academy entrance.";
+ mes "If you don't know the way I'll point it out to you again.";
+ viewpoint 1,122,207,1,0x4d4dff;
+ next;
+ mes "[Carocc]";
+ mes "then, Good luck!";
+ close;
+ } else {
+ mes "[Carocc]";
+ mes "Oh, We meet again.";
+ mes "Do you by any chance need a ship?";
+ mes "I usually travel to the port in Paros.";
+ mes "If you need to go to Paros later, come see me.";
+ close;
+ }
+ }
+ }
+ } else {
+ if (questprogress(7471) == 2 || questprogress(7472) > 0) {
+ mes "[Carocc]";
+ mes "It's been a while!";
+ mes "Looking at your expression, you must be doing well.";
+ next;
+ switch(select("Take me to Pharos Lighthouse", "To Alberta", "Talk")) {
+ case 1:
+ mes "[Carocc]";
+ mes "Do you want to go to Pharos Lighthouse on the southern coast of Morocc?";
+ mes "The fee is 2800 zeny. I have a crew that needs payment so this fee is non-negotiable.";
+ next;
+ if(select("To Pharos Lighthouse!", "Cancel") == 1) {
+ if (Zeny > 2799) {
+ mes "[Carocc]";
+ mes "Let us travel with the wing in our hair.";
+ Zeny -= 2800;
+ close2;
+ cutin "", 255;
+ warp "cmd_fild07", 92, 129;
+ end;
+ } else {
+ mes "[Carocc]";
+ mes "Sorry but you are short of the boarding fee.";
+ mes "I need 2800z to operate.";
+ close;
+ }
+ }
+ mes "[Carocc]";
+ mes "OK.";
+ mes "Do you know this, by the way?";
+ mes "^4d4dffThere's a Rogue hideout at Pharos Lighthouse^000000.";
+ mes "You already knew this?";
+ close;
+ case 2:
+ mes "[Carocc]";
+ mes "I thought you knew that I only go to Pharos?";
+ mes "Ask the sailor over there, he's the one that goes there frequently.";
+ next;
+ mes "[Carocc]";
+ mes "There are plenty of other ships that travel to Alberta and Byalan Islands.";
+ close;
+ case 3:
+ mes "[Carocc]";
+ mes "Hmm. I'm content with the well being of you and other adventurers who passed me by.";
+ next;
+ mes "[Carocc]";
+ mes "Lumin must be doing well too.";
+ mes "I wonder why you feel like my own child even though we've only met from the sea.";
+ close;
+ }
+ } else {
+ mes "[Carocc]";
+ mes "I am Carocc, the caption of this ship.";
+ mes "Do you need a ship?";
+ next;
+ if(select("Pharos Lighthouse - 2800z", "Don't need it.") == 1) {
+ if (Zeny > 2799) {
+ mes "[Carocc]";
+ mes "Let us travel with the wind in our hair.";
+ Zeny -= 2800;
+ close2;
+ cutin "", 255;
+ warp "cmd_fild07", 92, 129;
+ end;
+ } else {
+ mes "[Carocc]";
+ mes "Sorry but you are short of the boarding fee.";
+ mes "I need 2800z to operate.";
+ close;
+ }
+ }
+ mes "[Carocc]";
+ mes "Then use it next time.";
+ close;
+ }
+ }
+ cutin "", 255;
+ end;
+
+ OnInit:
+ questinfo 7472, QTYPE_QUEST, 1, Job_Novice;
+ //SetQuestLevel 7472 1 14
+ //SetQuestQuest 7472 7473 0
+ end;
+
+ OnTouch:
+ if (Class == Job_Novice && BaseLevel < 15 && !questprogress(4269))
+ emotion e_gasp;
+ else
+ emotion e_heh;
+ end;
+}
+
+izlude_a,198,213,3 duplicate(Captain Carocc#iz) Captain Carocc#iz_a 4_M_REINDEER,5,5
+izlude_b,198,213,3 duplicate(Captain Carocc#iz) Captain Carocc#iz_b 4_M_REINDEER,5,5
+izlude_c,198,213,3 duplicate(Captain Carocc#iz) Captain Carocc#iz_c 4_M_REINDEER,5,5
+izlude_d,198,213,3 duplicate(Captain Carocc#iz) Captain Carocc#iz_d 4_M_REINDEER,5,5
+
+// - Criatura Academy Staff
+// - Teaches the player about the Inventory.
+// -----------------------------------------------------------------------------
+izlude,122,207,3 script Criatura Academy Staff#0 4_M_KHKYEL,3,3,{
+ if (!checkweight(1304, 3)) {
+ mes "Quest cannot be continued due to the overfilled inventory.";
+ mes "Continue the quest after organizing the inventory.";
+ close;
+ }
+ viewpoint 2,122,207,1,0xFFFFFF;
+ if (Class == Job_Novice && BaseLevel < 15) {
+ if (questprogress(7472) == 1) {
+ mes "[Hun]";
+ mes "Oh.. you must be the adventurer Carocc was talking about.";
+ mes "I don't know where your homeland is but Midgard is a good place to start your life's journey.";
+ next;
+ mes "[Hun]";
+ mes "It's a good sight to see new adventurers start their journey.";
+ mes "You must be tired. Need a drink?";
+ completequest 7472;
+ getexp 200, 0;
+ setquest 7473;
+ getitem 531, 1; // Apple_Juice
+ next;
+ mes "[Hun]";
+ mes "You can open the Item window by clicking on the 'item' icon on top left portion of the screen.";
+ next;
+ mes "[Hun]";
+ mes "The items are automatically catagorized by 'consumables' 'equipment' 'etcetera' and 'personal' suitable for each use.";
+ mes "It will do the automatic sorting per indiviaul useage to";
+ next;
+ mes "[Hun]";
+ mes "Either ^4d4dff double click on the item^000000 you intend to use";
+ mes "or drag it onto^4d4dff the equipment window and use it^000000";
+ next;
+ cutin "tutorial03.bmp", 4;
+ mes "!- Information -!";
+ mes "^4d4dffItems can be used or equipped with simply double-clicking.";
+ mes "Item window can be opened with shortcut key Alt+E";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff Equipped items can be checked with Alt+ Q";
+ mes "Items can also be dragged onto the location where you wish to equip it.";
+ next;
+ cutin "", 255;
+ mes "[Hun]";
+ mes "For detailed info on individual items^4d4dff, right click ^000000 on that item.";
+ mes "You can check the detailed info on the item.";
+ next;
+ cutin "tutorial04.bmp", 4;
+ mes "!- Information -!";
+ mes "^4d4dffRight-clicking on the item icon^4d4dff brings up detailed info on the item.";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dffWhen you select other players, you can trade, party up with them with the community window that pops up.";
+ next;
+ cutin "", 255;
+ mes "[Hun]";
+ mes "Ok now ^4d4dffdrink the apple juice that I gave you^000000.";
+ close;
+ } else {
+ if (!questprogress(7473)) {
+ mes "[Hun]";
+ mes "Hey there.";
+ mes "Rest up for a bit.";
+ next;
+ mes "[Hun]";
+ mes "It's joyous to see new adventurers starting out.";
+ mes "You want something to drink while you are resting?";
+ setquest 7473;
+ getitem 531, 1; // Apple_Juice
+ next;
+ mes "[Hun]";
+ mes "Right clicking on the item icon ^4d4dffon the basic item window at the upper left corner brings up the detailed info on the item";
+ next;
+ mes "[Hun]";
+ mes "The items are automatically catagorized by 'consumables' 'equipment' 'etcetera' and 'personal' suitable for each use.";
+ mes "It will do the automatic sorting per indiviaul useage to";
+ next;
+ mes "[Hun]";
+ mes "Either ^4d4dffdouble click on the item^000000 you intend to use";
+ mes "or drag it onto^4d4dff the equipment window and use it^000000";
+ next;
+ mes "[Hun]";
+ mes "For detailed info on individual items^4d4dff, right-click ^000000 on the item.";
+ mes "You can check the detailed info on the item.";
+ next;
+ cutin "tutorial04.bmp", 3;
+ mes "!- Information -!";
+ mes "Right clicking on the item icon ^4d4dffbrings up the detailed info on the item";
+ next;
+ mes "!- Information -!";
+ mes "When you select on other players^4d4dff you can trade, party up with them with the community window that pops up.";
+ next;
+ cutin "", 255;
+ mes "[Hun]";
+ mes "Ok now ^4d4dffdrink the apple juice that I gave you^000000.";
+ close;
+ } else if (questprogress(7473) == 1) {
+ if (countitem(531) > 0) {
+ mes "[Hun]";
+ mes "Consume the apple juice that I gave you in your inventory.";
+ mes "Then we'll talk.";
+ close;
+ } else {
+ if (questprogress(4269) > 0) {
+ mes "[Hun]";
+ mes "How's the taste?";
+ mes "Pretty good-taste of sweet and sour, right? It might not be much but it also has healing properties.";
+ next;
+ mes "[Hun]";
+ mes "I want to give you more but that was the last of it";
+ mes "Anyways here's some potions. They'll come in handy when you start fighting.";
+ completequest 7473;
+ getitem 569, 30; // Novice_Potion
+ getexp 200, 0;
+ next;
+ mes "[Hun]";
+ mes "Criatura Academy is a good place to build up experience for the future.";
+ mes "And I'm not just saying this because I work here.";
+ next;
+ mes "[Hun]";
+ mes "I'm for real... haha";
+ close;
+ } else {
+ mes "[Hun]";
+ mes "How's the taste?";
+ mes "Pretty good-taste of sweet and sour, right? It might not be much but it also has healing properties.";
+ next;
+ mes "[Hun]";
+ mes "I want to give you more but that was the last of it";
+ mes "Anyways here's some potions. They'll come in handy when you start fighting.";
+ completequest 7473;
+ getitem 569, 30; // Novice_Potion
+ getexp 200, 0;
+ next;
+ mes "[Hun]";
+ mes "What do you plan to do from now on?";
+ mes "Have you found a place to stay?";
+ next;
+ switch(select("I need help with that", "Anything will do really.", "Don't worry.")) {
+ case 1:
+ mes "[Hun]";
+ mes "But still, though.";
+ mes "It's tough to be out alone in a new place.";
+ mes "That's why Criatura Academy is there.";
+ next;
+ mes "[Hun]";
+ mes "Carocc sent you to me probably for the same reason.";
+ mes "Even though I'm just a work-hand here, I could show you around.";
+ next;
+ mes "[Hun]";
+ mes "If you follow this road up to north, you can see";
+ mes "<NAVI>[the Academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ mes "Anybody can enroll, so take advantage of it.";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "Sorry to interrupt.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits";
+ close;
+ case 2:
+ mes "[Hun]";
+ mes "How optimistic of you.";
+ mes "If you need help, feel free to visit Criatura Academy any time.";
+ next;
+ mes "[Hun]";
+ mes "There's no requirement or payment to enroll so it would be a great help to you.";
+ mes "When you go through this way to the north, you'll find";
+ mes "<NAVI>[the academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ next;
+ mes "[Hun]";
+ mes "If there are more adventurers like you, the future will be brighter.";
+ mes "Hahahaha.";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "Sorry to interrupt.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits";
+ close;
+ case 3:
+ mes "[Hun]";
+ mes "You already have a plan laid out?";
+ mes "Well prepared.";
+ mes "But just in case, if you are curious about the Criatura Academy, make a visit.";
+ next;
+ mes "[Hun]";
+ mes "When you go through this way to the north, you'll find";
+ mes "<NAVI>[the academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ mes "What is well, is well- isn't it?";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "You are correct.";
+ mes "Preperation is the key.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits.";
+ close;
+ }
+ }
+ }
+ } else {
+ if (!questprogress(4269)) {
+ mes "[Hun]";
+ mes "It's you..";
+ mes "What do you plan to do from now on?";
+ mes "Have you found a place to stay?";
+ next;
+ switch(select("I need help with that", "Anything will do really.", "Don't worry.")) {
+ case 1:
+ mes "[Hun]";
+ mes "But still, though.";
+ mes "It's tough to be out alone in a new place.";
+ mes "That's why Criatura Academy is there.";
+ next;
+ mes "[Hun]";
+ mes "Carocc sent you to me probably for the same reason.";
+ mes "Even though I'm just a work-hand here, I could show you around.";
+ next;
+ mes "[Hun]";
+ mes "If you follow this road up to north, you can see";
+ mes "<NAVI>[the Academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ mes "Anybody can enroll, so take advantage of it.";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "Sorry to interrupt.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits";
+ close;
+ case 2:
+ mes "[Hun]";
+ mes "How optimistic of you.";
+ mes "If you need help, feel free to visit Criatura Academy any time.";
+ next;
+ mes "[Hun]";
+ mes "There's no requirement or payment to enroll so it would be a great help to you.";
+ mes "When you go through this way to the north, you'll find";
+ mes "<NAVI>[the academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ next;
+ mes "[Hun]";
+ mes "If there are more adventurers like you, the future will be brighter.";
+ mes "Hahahaha.";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "Sorry to interrupt.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits";
+ close;
+ case 3:
+ mes "[Hun]";
+ mes "You already have a plan laid out?";
+ mes "Well prepared.";
+ mes "But just in case, if you are curious about the Criatura Academy, make a visit.";
+ next;
+ mes "[Hun]";
+ mes "When you go through this way to the north, you'll find";
+ mes "<NAVI>[the academy building]<INFO>iz_ac01,100,39</INFO></NAVI>.";
+ mes "What is well, is well- isn't it?";
+ next;
+ emotion e_gasp, 0, "Information Staff#"+strnpcinfo(2);
+ mes "[Information Staff]";
+ mes "You are correct.";
+ mes "Preperation is the key.";
+ mes "But ^4d4dff if you need location info, please ask me.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "Hun's information has limits.";
+ close;
+ }
+ } else {
+ mes "[Hun]";
+ mes "Criatura Academy is a good place to build up experience for the future.";
+ mes "I'm not saying this just because I work here.";
+ next;
+ mes "[Hun]";
+ mes "For real... hahahaha";
+ close;
+ }
+ }
+ }
+ } else {
+ mes "[Hun]";
+ mes "The Royal Criatura Academy was founded to help budding adventurers on their initial journey.";
+ next;
+ mes "[Hun]";
+ mes "Although I'm but a work-hand here, it makes me happy to see students graduate here and become fine members of society.";
+ close;
+ }
+
+ OnInit:
+ questinfo 7473, QTYPE_QUEST, 1, Job_Novice;
+ //SetQuestLevel 7473 1 14
+ end;
+
+ OnTouch:
+ if (!questprogress(4269))
+ emotion e_gasp;
+ else
+ emotion e_heh;
+ end;
+}
+
+izlude_a,122,207,3 duplicate(Criatura Academy Staff#0) Criatura Academy Staff#a 4_M_KHKYEL,3,3
+izlude_b,122,207,3 duplicate(Criatura Academy Staff#0) Criatura Academy Staff#b 4_M_KHKYEL,3,3
+izlude_c,122,207,3 duplicate(Criatura Academy Staff#0) Criatura Academy Staff#c 4_M_KHKYEL,3,3
+izlude_d,122,207,3 duplicate(Criatura Academy Staff#0) Criatura Academy Staff#d 4_M_KHKYEL,3,3
+
+// - Information Staff
+// - Teaches the player about the Mini-Map through a quick quest.
+// -----------------------------------------------------------------------------
+izlude,120,207,4 script Information Staff#0 8W_SOLDIER,{
+ if (!checkweight(1304, 3)) {
+ mes "Quest cannot be continued due to the invenory being full.";
+ mes "Please try it again after re-organizing your items.";
+ close;
+ }
+
+ if (BaseLevel < 15 && !questprogress(7474)) {
+ mes "[Information Staff]";
+ mes "Hi, how are you?";
+ mes "I am in charge of navigation directions for Izlude's key locations";
+ mes "I wish to propose a simple game along with the navigation, would that be ok?";
+ next;
+ if(select("Sure, let's play!", "I already know them all.") == 1) {
+ mes "[Information Staff]";
+ mes "First of all, how to check the mini-map.";
+ mes "You can check your location through the mini-map at the top right of the screen";
+ next;
+ mes "[Information Staff]";
+ mes "If you receive information on a town or a city, a waypoint ^4d4dff+^000000 can be marked on the map.";
+ next;
+ mes "[Information Staff]";
+ mes "Press ^4d4dff [Ctrl] and [ ~ ] on your keyboard and you can see the world map^000000.";
+ next;
+ mes "[Information Staff]";
+ mes "Through the ^4d4dff world map you can check the location of you, your party members and the level of monsters in the area.^000000";
+ next;
+ mes "[Information Staff]";
+ mes "This is useful info to remember.";
+ mes "Now then, should we play a simple game?";
+ next;
+ mes "[Information Staff]";
+ mes "I will ^4d4dff mark three specific locations on the mini-map.^000000";
+ mes "Please ^4d4dffvisit those locations ^000000 using the waypoints as reference.";
+ next;
+ mes "[Information Staff]";
+ mes "Think of it as a treasure hunt and go.";
+ mes "I've hidden some useful items there.";
+ viewpoint 1,179,75,1,0xCCFFFF;
+ viewpoint 1,45,94,2,0x00FF00;
+ viewpoint 1,207,167,3,0xFFEB46;
+ setquest 7474;
+ next;
+ mes "[Information Staff]";
+ mes "Vist me again after going by all three locations.";
+ mes "I will check up on it.";
+ next;
+ mes "[Information Staff]";
+ mes "Ah, there' somebody who started out right before you!";
+ mes "If you don't hurry that person will take all the items!";
+ mes "So, run!";
+ npcskill "AL_INCAGI", 10, 10, 10;
+ close;
+ }
+ mes "[Information Staff]";
+ mes "Do you need information on all the locations of Izlude?";
+ mes "By clicking on the introduced ^B9062F[base camp name]^000000, I will offer you guidance so follow the ^B9062FRed Arrows^000000.";
+ next;
+ while(1) {
+ switch(select("[ Main facilities ]", "[ Guide & Helper ]", "Mini map marking removal", "End Conversation")) {
+ case 1:
+ while (1) {
+ switch(select("[ Criatura Academy ]", "[ Wharf ]", "[ Airship (International) ]", "[ Arena ]", "[ Shop ]", "[ Swordman Guild ]", "[ Enchant Association ]", "[ Blacksmith's Workshop ]", "Go back to the previous menu")) {
+ case 1:
+ mes "[Information Staff]";
+ mes "If you are the first time adventurer,";
+ mes "<NAVI>[Criatura Academy]<INFO>iz_ac01,100,39,</INFO></NAVI>";
+ mes "can offer a lot of info and help.";
+ mes "Do you need additonal directions?";
+ viewpoint 1, 128, 260, 0, 0xFFD269;
+ next;
+ continue;
+ case 2:
+ mes "[Information Staff]";
+ mes "Through the <NAVI>[Wharf]<INFO>izlude,197,205,</INFO></NAVI> in the north east,";
+ mes "^8B4513Alberta^000000 or ^8B4513the Byalan Island^000000 can be visted.";
+ mes "you can go.";
+ next;
+ mes "[Information Staff]";
+ mes "Byalan Island is the scary place with ^8B4513 Izlude dungeon^000000 in it.";
+ mes "";
+ mes "Do you need additional directions?";
+ viewpoint 1, 197, 205, 1, 0xFFFF00;
+ next;
+ continue;
+ case 3:
+ mes "[Information Staff]";
+ mes "To the southeast, the <NAVI>[Airship]<INFO>izlude,206,75,</INFO></NAVI>";
+ mes "will be connected with the Capital of the republic of Schwarzwald -^8B4513 Yuno^000000, and";
+ mes "The capital of the Arunapeltsdom -^8B4513 Rachel ^000000.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 210, 73, 2, 0xFF0A82;
+ next;
+ continue;
+ case 4:
+ mes "[Information Staff]";
+ mes "The <NAVI>[Arena]<INFO>izlude,213,161,</INFO></NAVI> located in the east";
+ mes "is for testing your battle ability.";
+ mes "It's an excellent place.";
+ mes "I will mark the location on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 213, 161, 3, 0xFFFF54;
+ next;
+ continue;
+ case 5:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Shop]<INFO>izlude,110,182,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 108, 179, 4, 0xFFAAFF;
+ next;
+ continue;
+ case 6:
+ mes "[Information Staff]";
+ mes "<NAVI>[Swordman guild]<INFO>izlude,51,172,</INFO></NAVI> is the place to manage the job transfer to a swordman.";
+ mes "I will mark the location of the swordman guild on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 52, 172, 5, 0xFFDA70;
+ next;
+ continue;
+ case 7:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Enchant Association]<INFO>izlude,97,125,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 97, 125, 6, 0xFFDA70;
+ next;
+ continue;
+ case 8:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Blacksmith's Workshop]<INFO>izlude,153,126,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 153, 126, 7, 0xFFAAFF;
+ next;
+ continue;
+ case 9:
+ break;
+ }
+ break;
+ }
+ break;
+ case 2:
+ while (1) {
+ switch(select("[ Eden Group Teleporter ]", "[ Kafra Employee ]", "[ Mesmerizer ]", "[ Wedding Secretary ]", "[ Mercenary Guild Official ]", "[ Taming Merchant ]", "Go back to the previous menu")) {
+ case 1:
+ mes "[Information Staff]";
+ mes "For now, I will mark the location of the";
+ mes "<NAVI>[Eden Group Teleporter]<INFO>izlude,131,148,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 131, 148, 8, 0xFF0A82;
+ next;
+ continue;
+ case 2:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Kafra Employee]<INFO>izlude,128,148,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 128, 148, 9, 0xFFFF54;
+ next;
+ continue;
+ case 3:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Mesmerizer]<INFO>izlude,124,127,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 125, 127, 10, 0xFF0064;
+ next;
+ continue;
+ case 4:
+ mes "[Information Staff]";
+ mes "If you want to visit ^8B4513Jawaii^000000 - the resort place for a couple,";
+ mes "talk to the <NAVI>[Wedding Secretary]<INFO>izlude,180,224,</INFO></NAVI>.";
+ mes "Just ask the question about it.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 180, 224, 11, 0xFFFF00;
+ next;
+ continue;
+ case 5:
+ mes "[Information Staff]";
+ mes "If you need to know about the Mercenary Guild, go west and speak to the";
+ mes "<NAVI>[Mercenary Guild Official]<INFO>izlude,47,170,</INFO></NAVI>.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 47, 170, 12, 0xFFDA70;
+ next;
+ continue;
+ case 6:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Taming Merchant]<INFO>izlude,118,163,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 118, 163, 13, 0xFF0064;
+ next;
+ continue;
+ case 7:
+ break;
+ }
+ break;
+ }
+ break;
+ case 3:
+ mes "[Information Staff]";
+ mes "I will erase the marks.";
+ mes "Do you need additional directions?";
+ viewpoint 2, 197, 205, 1, 0xFF0000;
+ viewpoint 2, 210, 73, 2, 0xFF0000;
+ viewpoint 2, 213, 161, 3, 0xFF0000;
+ viewpoint 2, 108, 179, 4, 0xFF0000;
+ viewpoint 2, 52, 172, 5, 0xFF0000;
+ viewpoint 2, 97, 125, 6, 0xFF0000;
+ viewpoint 2, 153, 126, 7, 0xFF0000;
+ viewpoint 2, 131, 148, 8, 0xFF0000;
+ viewpoint 2, 128, 148, 9, 0xFF0000;
+ viewpoint 2, 125, 127, 10, 0xFF0000;
+ viewpoint 2, 180, 224, 11, 0xFF0000;
+ viewpoint 2, 47, 170, 12, 0xFF0000;
+ viewpoint 2, 118, 163, 13, 0xFF0000;
+ next;
+ break;
+ case 4:
+ mes "[Information Staff]";
+ mes "Have a wonderful adventure.";
+ mes "Good bye~~!";
+ close;
+ }
+ }
+ } else if (questprogress(7474) == 1) {
+ if ((questprogress(7475) + questprogress(7476) + questprogress(7477)) > 2) {
+ mes "[Information Staff]";
+ mes "What's with the long face?";
+ mes "It looks like you found all the locations I marked.";
+ next;
+ mes "[Lumin]";
+ mes "Turtle...";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ select("What'd you call me?");
+ mes "[Lumin]";
+ mes "Because you are too slow.";
+ mes "Yes, it is. I have been waiting for you for what seems like forever.";
+ next;
+ mes "[Lumin]";
+ mes ".......Shall I share with you?";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ if(select("I don't need your sympathy.", "!!!!!") == 1) {
+ mes "[Lumin]";
+ mes "Is that so?";
+ mes "Captain always told me to help the poor people.";
+ mes "But you get rid of my chance to help.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Ahhh. Irritating.";
+ next;
+ } else {
+ mes "[Lumin]";
+ mes "Well, now we can divide 7 to 3?";
+ mes "I am OK with 6 to 4.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[" + strcharinfo(0) + "]";
+ mes "This guy...";
+ next;
+ }
+ cutin "", 255;
+ mes "[Information Staff]";
+ mes "Ahhh, you two calm down.";
+ mes "Lumin took them all.";
+ mes ""+ strcharinfo(0) + " I will give you one set separately.";
+ next;
+ mes "[Information Staff]";
+ mes "Think of the reason, it was my fault to leave one person's but sent both of you.";
+ next;
+ cutin "nov_lumin03.bmp", 2;
+ mes "[Lumin]";
+ mes "Simple and fair decision.";
+ mes "OK. Now I am going.";
+ mes "See you again, my friend.";
+ next;
+ cutin "", 255;
+ mes "[Information Staff]";
+ mes "Aren't you two friends?";
+ mes "You guys both seemed friendly enough right?";
+ next;
+ mes "[Information Staff]";
+ mes "Well, this is my present for you.";
+ mes "Hope it will be useful.";
+ completequest 7474;
+ erasequest 7475;
+ erasequest 7476;
+ erasequest 7477;
+ getexp 300, 20;
+ getitem 12323, 20; // N_Fly_Wing
+ getitem 12324, 10; // N_Butterfly_Wing
+ getitem 569, 20; // Novice_Potion
+ next;
+ mes "[Information Staff]";
+ mes "Have a wonderful journey.";
+ close;
+ } else {
+ mes "[Information Staff]";
+ mes "You have not found the treasure I hid.";
+ mes "Here are the locations again.";
+ mes "Hurry up!";
+ viewpoint 1,179,75,1,0xccffff;
+ viewpoint 1,45,94,2,0x00ff00;
+ viewpoint 1,207,167,3,0xFFEB46;
+ close;
+ }
+ } else {
+ mes "[Information Staff]";
+ mes "This is Izlude - the satellite city of Prontera.";
+ mes "Do you need directions?";
+ next;
+ mes "[Information Staff]";
+ mes "If you click on the ^B9062F[area name]^000000, I can ^B9062Fnavigate^000000 a path for you to follow.";
+ next;
+ while(1) {
+ switch(select("[ Main facilities ]", "[ Guide & Helper ]", "Mini map marking removal", "End Conversation")) {
+ case 1:
+ while (1) {
+ switch(select("[ Criatura Academy ]:[ Wharf ]:[ Airship (International) ]:[ Arena ]:[ Shop ]:[ Swordman Guild ]:[ Enchant Association ]:[ Blacksmith's Workshop ]:Go back to the previous menu")) {
+ case 1:
+ mes "[Information Staff]";
+ mes "If you are the first time adventurer,";
+ mes "<NAVI>[Criatura Academy]<INFO>iz_ac01,100,39,</INFO></NAVI>";
+ mes "can offer a lot of info and help.";
+ mes "Do you need additonal directions?";
+ viewpoint 1, 128, 260, 0, 0xFFD269;
+ next;
+ continue;
+ case 2:
+ mes "[Information Staff]";
+ mes "Through the <NAVI>[Wharf]<INFO>izlude,197,205,</INFO></NAVI> in the north east,";
+ mes "^8B4513Alberta^000000 or ^8B4513the Byalan Island^000000 can be visted.";
+ mes "you can go.";
+ next;
+ mes "[Information Staff]";
+ mes "Byalan Island is the scary place with ^8B4513 Izlude dungeon^000000 in it.";
+ mes "";
+ mes "Do you need additional directions?";
+ viewpoint 1, 197, 205, 1, 0xFFFF00;
+ next;
+ continue;
+ case 3:
+ mes "[Information Staff]";
+ mes "To the southeast, the <NAVI>[Airship]<INFO>izlude,206,75,</INFO></NAVI>";
+ mes "will be connected with the Capital of the republic of Schwarzwald -^8B4513 Yuno^000000, and";
+ mes "The capital of the Arunapeltsdom -^8B4513 Rachel ^000000.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 210, 73, 2, 0xFF0A82;
+ next;
+ continue;
+ case 4:
+ mes "[Information Staff]";
+ mes "The <NAVI>[Arena]<INFO>izlude,213,161,</INFO></NAVI> located in the east";
+ mes "is for testing your battle ability.";
+ mes "It's an excellent place.";
+ mes "I will mark the location on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 213, 161, 3, 0xFFFF54;
+ next;
+ continue;
+ case 5:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Shop]<INFO>izlude,110,182,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 108, 179, 4, 0xFFAAFF;
+ next;
+ continue;
+ case 6:
+ mes "[Information Staff]";
+ mes "<NAVI>[Swordman guild]<INFO>izlude,51,172,</INFO></NAVI> is the place to manage the job transfer to a swordman.";
+ mes "I will mark the location of the swordman guild on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 52, 172, 5, 0xFFDA70;
+ next;
+ continue;
+ case 7:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Enchant Association]<INFO>izlude,97,125,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 97, 125, 6, 0xFFDA70;
+ next;
+ continue;
+ case 8:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Blacksmith's Workshop]<INFO>izlude,153,126,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 153, 126, 7, 0xFFAAFF;
+ next;
+ continue;
+ case 9:
+ break;
+ }
+ break;
+ }
+ break;
+ case 2:
+ while (1) {
+ switch(select("[ Eden Group Teleporter ]:[ Kafra Employee ]:[ Mesmerizer ]:[ Wedding Secretary ]:[ Mercenary Guild Official ]:[ Taming Merchant ]:Go back to the previous menu")) {
+ case 1:
+ mes "[Information Staff]";
+ mes "For now, I will mark the location of the";
+ mes "<NAVI>[Eden Group Teleporter]<INFO>izlude,131,148,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 131, 148, 8, 0xFF0A82;
+ next;
+ continue;
+ case 2:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Kafra Employee]<INFO>izlude,128,148,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 128, 148, 9, 0xFFFF54;
+ next;
+ continue;
+ case 3:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Mesmerizer]<INFO>izlude,124,127,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 125, 127, 10, 0xFF0064;
+ next;
+ continue;
+ case 4:
+ mes "[Information Staff]";
+ mes "If you want to visit ^8B4513Jawaii^000000 - the resort place for a couple,";
+ mes "talk to the <NAVI>[Wedding Secretary]<INFO>izlude,180,224,</INFO></NAVI>.";
+ mes "Just ask the question about it.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 180, 224, 11, 0xFFFF00;
+ next;
+ continue;
+ case 5:
+ mes "[Information Staff]";
+ mes "If you need to know about the Mercenary Guild, go west and speak to the";
+ mes "<NAVI>[Mercenary Guild Official]<INFO>izlude,47,170,</INFO></NAVI>.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 47, 170, 12, 0xFFDA70;
+ next;
+ continue;
+ case 6:
+ mes "[Information Staff]";
+ mes "I will mark the location of the";
+ mes "<NAVI>[Taming Merchant]<INFO>izlude,118,163,</INFO></NAVI>";
+ mes "on the mini map.";
+ mes "Do you need additional directions?";
+ viewpoint 1, 118, 163, 13, 0xFF0064;
+ next;
+ continue;
+ case 7:
+ break;
+ }
+ break;
+ }
+ break;
+ case 3:
+ mes "[Information Staff]";
+ mes "I will erase the marks.";
+ mes "Do you need additional directions?";
+ viewpoint 2, 197, 205, 1, 0xFF0000;
+ viewpoint 2, 210, 73, 2, 0xFF0000;
+ viewpoint 2, 213, 161, 3, 0xFF0000;
+ viewpoint 2, 108, 179, 4, 0xFF0000;
+ viewpoint 2, 52, 172, 5, 0xFF0000;
+ viewpoint 2, 97, 125, 6, 0xFF0000;
+ viewpoint 2, 153, 126, 7, 0xFF0000;
+ viewpoint 2, 131, 148, 8, 0xFF0000;
+ viewpoint 2, 128, 148, 9, 0xFF0000;
+ viewpoint 2, 125, 127, 10, 0xFF0000;
+ viewpoint 2, 180, 224, 11, 0xFF0000;
+ viewpoint 2, 47, 170, 12, 0xFF0000;
+ viewpoint 2, 118, 163, 13, 0xFF0000;
+ next;
+ break;
+ case 4:
+ mes "[Information Staff]";
+ mes "Have a wonderful adventure.";
+ mes "Good bye~~!";
+ close;
+ }
+ }
+ }
+
+ OnInit:
+ // AddQuestInfo 7474 1 0
+ // SetQuestLevel 7474 1 14
+ // AddQuestInfo 7495 1 0
+ // SetQuestQuest 7495 7475 1
+ // SetQuestQuest 7495 7476 1
+ // SetQuestQuest 7495 7477 1
+ end;
+}
+
+izlude_a,120,207,4 duplicate(Information Staff#0) Information Staff#a 8W_SOLDIER
+izlude_b,120,207,4 duplicate(Information Staff#0) Information Staff#b 8W_SOLDIER
+izlude_c,120,207,4 duplicate(Information Staff#0) Information Staff#c 8W_SOLDIER
+izlude_d,120,207,4 duplicate(Information Staff#0) Information Staff#d 8W_SOLDIER
+
+// - Airship Sign
+// -----------------------------------------------------------------------------
+izlude,179,75,3 script Airship#iz 4_BULLETIN_BOARD2,3,3,{
+ .@total = questprogress(7475) + questprogress(7476) + questprogress(7477);
+ if (questprogress(7474)) {
+ if (!questprogress(7475)) {
+ mes "==== Airship Information====";
+ mes "";
+ mes "Izlude - Juno - Rachel";
+ mes "";
+ mes "Travellers bound for either the ^4d4dffSchwarzwalt Republic^000000 or ^4d4dffArunafeltz^000000 may board the airship here.";
+ next;
+ if (.@total == 1) {
+ mes "Except the signboard of the free airship, nothing can be found.";
+ next;
+ select("Where's the hidden treasure?");
+ mes "[Lumin]";
+ mes "Yo.";
+ mes "Sorry pal I got here first.";
+ mes "Should've used a Fly wing like I did.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Why do these wings teleport?";
+ mes "I guess because they're from Creamy monsters...";
+ next;
+ mes "[Lumin]";
+ mes "As the captain said, seeing is believing. The world is full of mysteries.";
+ next;
+ cutin "", 255;
+ mes "Seems like Lumin beat you again.";
+ mes "Better get to the next location before Lumin does.";
+ setquest 7475;
+ viewpoint 2,179,75,1,0xFF0000;
+ close;
+ } else if (.@total > 1) {
+ mes "[Lumin]";
+ mes ".......";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Muahahahaha.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ if(select("Are you kidding me?!", "Where's the treasure?") == 1) {
+ mes "[Lumin]";
+ mes "No...";
+ mes "Meeting three times in one day must be destiny.";
+ mes "You and I can be friends.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ select("Or Frenemies!");
+ mes "[Lumin]";
+ mes "Frene-what? Oh well I'm done with the mission.";
+ mes "Take care.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "[" + strcharinfo(0) + "]";
+ mes "Are you even listening to me?!";
+ setquest 7475;
+ viewpoint 2,179,75,1,0xFF0000;
+ next;
+ mes "^4d4dff...I have to report the result to the Information Staff...^000000.";
+ close;
+ }
+ mes "[Lumin]";
+ mes "Ooo Butterfly Wings.";
+ mes "If I hand it over to you, you'll just waste 'em so I'll just keep them.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Come on this is just friendly competition.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "I am doing this for you to make you stronger.";
+ mes "Now, so long.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "^4d4dff...I have to report the result to the Information staff...^000000.";
+ setquest 7475;
+ viewpoint 2,179,75,1,0xFF0000;
+ close;
+ } else {
+ mes "Except for the signboard of the free airship, nothing particular was found.";
+ next;
+ select("Why is there nothing here?");
+ mes "[Lumin]";
+ mes "Of course.";
+ mes "I already packed it in my bag.";
+ mes "There were Butterfly Wings here.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ select("So can I have some?");
+ mes "[Lumin]";
+ mes "That's not fair, I was here first so they're mine.";
+ mes "You better get to the next stop faster if you want the prize.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Well, then.....";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "Lumin disappeared with his long hair in the air.";
+ mes "......";
+ setquest 7475;
+ viewpoint 2,179,75,1,0xFF0000;
+ close;
+ }
+ } else {
+ mes "==== Airship Information ====";
+ mes "";
+ mes "Izlude - Juno - Rachel";
+ mes "";
+ mes "Travellers bound for either the ^4d4dffSchwarzwalt Republic^000000 or ^4d4dffArunafeltz^000000 may board the airship here.";
+ close;
+ }
+ } else {
+ mes "==== Airship Information ====";
+ mes "";
+ mes "Izlude - Juno - Rachel";
+ mes "";
+ mes "Travellers bound for either the ^4d4dffSchwarzwalt Republic^000000 or ^4d4dffArunafeltz^000000 may board the airship here.";
+ close;
+ }
+
+ OnInit:
+ // AddQuestInfo 7475 0 0
+ // SetQuestQuest 7475 7474 1
+ end;
+
+ OnTouch:
+ if (questprogress(7474) == 1 && !questprogress(7475))
+ emotion e_gasp;
+ end;
+}
+
+izlude_a,179,75,3 duplicate(Airship#iz) Airship#iz_a 4_BULLETIN_BOARD2,3,3
+izlude_b,179,75,3 duplicate(Airship#iz) Airship#iz_b 4_BULLETIN_BOARD2,3,3
+izlude_c,179,75,3 duplicate(Airship#iz) Airship#iz_c 4_BULLETIN_BOARD2,3,3
+izlude_d,179,75,3 duplicate(Airship#iz) Airship#iz_d 4_BULLETIN_BOARD2,3,3
+
+// - Arena Sign
+// -----------------------------------------------------------------------------
+izlude,207,167,3 script Arena#iz 4_BULLETIN_BOARD2,3,3,{
+ .@total = questprogress(7475) + questprogress(7476) + questprogress(7477);
+ if (questprogress(7474) == 1) {
+ if (!questprogress(7476)) {
+ mes "== Challenge! Arena! ==";
+ mes "";
+ mes "Breath taking battle with monsters!";
+ mes "Where is your limit?";
+ mes "PvE party with your comrad!";
+ mes "All these at Arena!!";
+ next;
+ if (.@total == 1) {
+ mes "Except for the Arena promtional board, nothing can be found here.";
+ next;
+ select("Nothing again?");
+ mes "[Lumin]";
+ mes "Hmmm. Its not nothing....";
+ mes "There were potions here...";
+ mes "I was tired of waiting for you so I took it too.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "But why does this potion never make me full?";
+ mes "*gulp*";
+ mes "Oh well looks like it's all gone.";
+ next;
+ cutin "", 255;
+ mes "Lumin beat you again.";
+ mes "Better beat him to the last spot.";
+ setquest 7476;
+ viewpoint 2,207,167,3,0xFF0000;
+ close;
+ } else if (.@total > 1) {
+ mes "[Lumin]";
+ mes ".......";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Muahahaha.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ switch(select("Are you kidding me?!", "Where's the treasure?") == 1) {
+ mes "[Lumin]";
+ mes "No...";
+ mes "Meeting three times in one day must be destiny.";
+ mes "You and I can be friends.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ select("Or Frenemies!");
+ mes "[Lumin]";
+ mes "Frene-what? Oh well I'm done with the mission.";
+ mes "Take care.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "[" + strcharinfo(0) + "]";
+ mes "Are you even listening to me?!";
+ setquest 7476;
+ viewpoint 2,207,167,3,0xFF0000;
+ next;
+ mes "^4d4dff...I have to report the result to the Information Staff...^000000.";
+ close;
+ }
+ mes "[Lumin]";
+ mes "Red potions.";
+ mes "If I hand it over to you, you'll just waste 'em so I'll just keep them.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Come on this is just friendly competition.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "I am doing this for you to make you stronger.";
+ mes "Now, so long.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "^4d4dff...I have to report of the result to Information staff...^000000.";
+ setquest 7476;
+ viewpoint 2,207,167,3,0xFF0000;
+ close;
+ } else {
+ mes "Except for the Arena promotion signboard, nothing can be found.";
+ next;
+ select("Why is there nothing?");
+ mes "[Lumin]";
+ mes "Of course.";
+ mes "I already packed it.";
+ mes "There were Red Potion hidden here.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ select("So can I have some?");
+ mes "[Lumin]";
+ mes "That's not fair, I was here first so they're mine.";
+ mes "You better get to the next stop faster if you want the prize.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Well, then.....";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "Lumin disappeared with his long hair in the air.";
+ mes "This guy...";
+ setquest 7476;
+ viewpoint 2,207,167,3,0xFF0000;
+ close;
+ }
+ } else {
+ mes "== Challenge! Arena! ==";
+ mes "";
+ mes "Breath taking battle with monsters!";
+ mes "Where is your limit?";
+ mes "PvE party with your comrad!";
+ mes "All these at Arena!!";
+ close;
+ }
+ } else {
+ mes "== Challenge! Arena! ==";
+ mes "";
+ mes "Breath taking battle with monsters!";
+ mes "Where is your limit?";
+ mes "PvE party with your comrad!";
+ mes "All these at Arena!!";
+ close;
+ }
+
+ OnInit:
+ // AddQuestInfo 7476 0 0
+ // SetQuestQuest 7476 7474 1
+ end;
+
+ OnTouch:
+ if (questprogress(7474) == 1 && !questprogress(7476))
+ emotion e_gasp;
+ end;
+}
+
+izlude_a,207,167,3 duplicate(Arena#iz) Arena#iz_a 4_BULLETIN_BOARD2,3,3
+izlude_b,207,167,3 duplicate(Arena#iz) Arena#iz_b 4_BULLETIN_BOARD2,3,3
+izlude_c,207,167,3 duplicate(Arena#iz) Arena#iz_c 4_BULLETIN_BOARD2,3,3
+izlude_d,207,167,3 duplicate(Arena#iz) Arena#iz_d 4_BULLETIN_BOARD2,3,3
+
+// - Bulletin Board
+// -----------------------------------------------------------------------------
+izlude,45,94,3 script Bulletin Board#iz 4_BULLETIN_BOARD2,3,3,{
+ .@total = questprogress(7475) + questprogress(7476) + questprogress(7477);
+ if (questprogress(7474) == 1) {
+ if (!questprogress(7477)) {
+ mes "==== Information ====";
+ mes "";
+ mes "Prontera Field.";
+ mes "The city of Prontera is located to the north.";
+ next;
+ if (.@total == 1) {
+ mes "Except for the simple signboard, nothing can be found here.";
+ next;
+ select("Where's the treasure?");
+ mes "[Lumin]";
+ mes "Yo.";
+ mes "Sorry but I am quicker than you.";
+ mes "There were Fly Wings here..";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "In fact, I don't like Fly's wings.";
+ mes "Flies are so dirty.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "By the way, why is one of the convenient transportations fly wing shaped?";
+ mes "Perhaps you know?";
+ next;
+ mes "[Lumin]";
+ mes "...you don't know.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "Defeated by Lumin again.";
+ mes "Keep calm and find the next location.";
+ setquest 7477;
+ viewpoint 2,45,94,2,0xFF0000;
+ close;
+ } else if (.@total > 1) {
+ mes "[Lumin]";
+ mes ".......";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "...Hello";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ if(select("Are you kidding me?!", "Where's the treasure?") == 1) {
+ mes "[Lumin]";
+ mes "No...";
+ mes "Meeting three times in one day must be destiny.";
+ mes "You and I can be friends.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ select("Or Frenemies!");
+ mes "[Lumin]";
+ mes "Frene-what? Oh well I'm done with the mission.";
+ mes "Take care.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "[" + strcharinfo(0) + "]";
+ mes "Are you even listening to me?!";
+ setquest 7477;
+ viewpoint 2,45,94,2,0xFF0000;
+ next;
+ mes "^4d4dff...I have to report the result to the Information Staff...^000000.";
+ close;
+ }
+ mes "[Lumin]";
+ mes "Fly Wings.";
+ mes "If I hand them over to you, you'll just waste 'em so I think I'll keep them.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Come on this is just friendly competition.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "I am doing this for you to make you stronger.";
+ mes "Now, so long.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "^4d4dff...I have to report of the result to Information staff...^000000.";
+ setquest 7477;
+ viewpoint 2,45,94,2,0xFF0000;
+ close;
+ } else {
+ mes "Except for the simple signboard, nothing can be found.";
+ next;
+ select("Why is there nothing?");
+ mes "[Lumin]";
+ mes "Of course.";
+ mes "Fly's wings were here so I already packed them in my bag.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ select("So can I have some?");
+ mes "[Lumin]";
+ mes "That's not fair, I was here first so they're mine.";
+ mes "You better get to the next stop faster if you want the prize.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Well, then.....";
+ next;
+ cutin "", 255;
+ mes "Lumin disappeared with his long hair in the air.";
+ mes "This guy....";
+ setquest 7477;
+ viewpoint 2,45,94,2,0xFF0000;
+ close;
+ }
+ } else {
+ mes "==== Information ====";
+ mes "";
+ mes "Prontera Field.";
+ mes "The city of Prontera is located to the north.";
+ close;
+ }
+ } else {
+ mes "==== Information ====";
+ mes "";
+ mes "Prontera Field.";
+ mes "The city of Prontera is located to the north.";
+ close;
+ }
+
+ OnInit:
+ // AddQuestInfo 7477 0 0
+ // SetQuestQuest 7477 7474 1
+ end;
+
+ OnTouch:
+ if (questprogress(7474) == 1 && !questprogress(7477))
+ emotion e_gasp;
+ end;
+}
+
+izlude_a,45,94,3 duplicate(Bulletin Board#iz) Bulletin Board#iz_a 4_BULLETIN_BOARD2,3,3
+izlude_b,45,94,3 duplicate(Bulletin Board#iz) Bulletin Board#iz_b 4_BULLETIN_BOARD2,3,3
+izlude_c,45,94,3 duplicate(Bulletin Board#iz) Bulletin Board#iz_c 4_BULLETIN_BOARD2,3,3
+izlude_d,45,94,3 duplicate(Bulletin Board#iz) Bulletin Board#iz_d 4_BULLETIN_BOARD2,3,3
+
+// - Therapist (Red Herb Quest + First Aid)
+// - Gives the player a basic quest and teaches them First Aid.
+// -----------------------------------------------------------------------------
+iz_ac01,59,43,3 script Therapist#ac 4_M_6THPRIN1,{
+ if (!checkweight(1304, 3)) {
+ mes "Quest cannot be continued due to the overfilled inventory.";
+ mes "Please try it again after organizing the items.";
+ close;
+ }
+ mes "[Therapist]";
+ if(questprogress(4269) == 2) {
+ mes "Are you a student?";
+ mes "Do you have any problem in your body?";
+ next;
+ .@menu$ = "Help me!:Teach me the First Aid Skill:^ff0000Red Herb Quest^000000:Save Location";
+ } else {
+ mes "This is the dispensary of the Royal Criatura Academy.";
+ mes "How can I help you?";
+ next;
+ .@menu$ = "Help me!:First Aid Skill::I want to rest.";
+ }
+ switch(select(.@menu$)) {
+ case 1:
+ if (BaseLevel <= 20) {
+ mes "[Therapist]";
+ mes "Are you injured?";
+ mes "Even the emergency treatment didn't work for you?";
+ next;
+ npcskill "AL_HEAL", 3, 50, 60;
+ percentheal 0, 50;
+ mes "[Therapist]";
+ mes "Is that good enough?";
+ mes "Have you recovered?";
+ mes "If you are sane, go to bed and rest before you go.";
+ close;
+ } else {
+ mes "[Therapist]";
+ mes "I feel sorry for you but...";
+ mes "I can only give my free healing service to those under base level 20.";
+ mes "You don't look like you're going to die anyways.";
+ next;
+ mes "[Therapist]";
+ mes "Just take a rest here until you've recovered.";
+ mes "There are lots of vacant beds!";
+ close;
+ }
+ break;
+ case 2:
+ if (getskilllv("NV_FIRSTAID")) {
+ mes "[Therapist]";
+ mes "You already know about First Aid.";
+ mes "We both are busy. Don't bother me.";
+ close;
+ } else {
+ mes "[Therapist]";
+ mes "You are commendable!";
+ mes "First Aid is a skill that transfers SP to HP during emergency situations.";
+ next;
+ mes "[Therapist]";
+ mes "Recovery ratio is very minimal...";
+ mes "It can help you avoid dying but won't give you much HP.";
+ specialeffect2 EF_BEGINSPELL6;
+ specialeffect2 EF_SPELLBREAKER;
+ next;
+ mes "[Therapist]";
+ mes "Press ^4d4dffALT + S^000000 to open your Skill window to see your skills.";
+ skill "NV_FIRSTAID", 1, 0;
+ skill_nov = 3;
+ getexp 1000, 40;
+ next;
+ mes "[Therapist]";
+ mes "If you press ^4d4dffF12^000000...";
+ mes "The shortcut window will open up with nine small compartments to register your skills to.";
+ next;
+ mes "[Therapist]";
+ mes "Dragging the right hand corner at the shortcut window, you can open up more skill shortcut pages.";
+ next;
+ mes "[Therapist]";
+ mes "It is a simple use.. ^4d4dff Each slot responds to individual keys from F1 to F9^000000.";
+ mes "Needed skills or items can be immediately used after registering on the corresponding slots.";
+ next;
+ cutin "tutorial05.bmp", 4;
+ mes "!- Information -!";
+ mes "You can register needed items or skills at ^4d4dff shortcut slots by dragging the icons.";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dff The registered items and equipment at^4d4dff the slots can be immediately used or armed by pressing the reponding F1 - F9 keys.";
+ next;
+ mes "!- Information -!";
+ mes "By setting the ^4d4dffshortcut keys as you want, you can use the responding shortcut key.";
+ next;
+ mes "!- Information -!";
+ mes "^4d4dffyou may register the frequently using items and skills, and use them at your convenience.";
+ cutin "", 255;
+ next;
+ mes "[Therapist]";
+ mes "Now open the skill window and register [First Aid] as shortcut key, then use it.";
+ mes "You will find it is more covenient to use this way.";
+ close;
+ }
+ case 3:
+ if (!questprogress(7478)) {
+ mes "[Therapist]";
+ mes "Have you investigated the growing plants in the field?";
+ mes "^4d4dff Red Plant, Blue Plant, Green Plant, White Plant^000000etc..";
+ next;
+ mes "[Therapist]";
+ mes "You can get different colored herbs from the various plants.";
+ mes "Processing herbs turns to be a various useful potions.";
+ next;
+ mes "[Therapist]";
+ mes "Now, shall we collect the Red Herb with your hands?";
+ next;
+ mes "[Therapist]";
+ mes "A ^4d4dffRed Plant is growing near the academy building.^000000.";
+ mes "I secretly planted it for today.";
+ mes "Go and get ^4d4dff1 Red Herb^000000.";
+ setquest 7478;
+ close;
+ } else if (questprogress(7478) == 1) {
+ if (countitem(507) > 0) {
+ mes "[Therapist]";
+ mes "You got it.";
+ mes "^4d4dffYou could eat this herb and get the benefit of it immediately but it will be more efficient if you make it into a potion.^000000.";
+ next;
+ mes "[Therapist]";
+ mes "Herbs vary their virtues according to their color.";
+ mes "^4d4dffGreen Herbs^000000 detox you.";
+ mes "^4d4dffBlue Herbs^000000 recover your SP.";
+ next;
+ mes "[Therapist]";
+ mes "Any other?";
+ mes "Well, HP is recovering like this red herb.";
+ mes "This like this... Make a nectar and put it into a bottle....";
+ next;
+ mes "[Therapist]";
+ mes "This becomes the recovering potion possible to take anywhere, anytime.";
+ mes "I will give it to you as souvenir.";
+ mes "And also give you the recipe to make potions easily.";
+ next;
+ mes "[Therapist]";
+ mes "This is the book for the simple combination of potion use.";
+ mes "You can make it easily by ^4d4dffusing the combination kit or cooking tool^000000.";
+ completequest 7478;
+ getexp 2000, 50;
+ getitem 569, 30; // Novice_Potion
+ getitem 11058, 1; // Novice_Combi_Book
+ getitem 12849, 10; // Combination_Kit
+ getitem 507, 1; // Red_Herb
+ getitem 512, 1; // Apple
+ next;
+ mes "[Therapist]";
+ mes "Not only potions but also other easily attainable things can be turned to various tools. Please make use of them.";
+ next;
+ mes "[Therapist]";
+ mes "For your trial to make it, I gave you a Red Herb and one Apple,";
+ mes "How about making it with the combination kit?";
+ next;
+ mes "[Therapist]";
+ mes "Read the combination kit by ^4d4dffright-clicking^000000, and ^4d4dffclick the book shaped icon^000000 which will open up the explanation window.";
+ close;
+ } else {
+ mes "[Therapist]";
+ mes "Why don't you learn about the virtues of herbs?";
+ mes "Bring one Red Herb by beating the growing Red Herb near the academy building.";
+ next;
+ mes "[Therapist]";
+ mes "You can find it near the entrance of the academy.";
+ close;
+ }
+ } else {
+ mes "[Therapist]";
+ mes "I already let you know about the basic medical botany.";
+ mes "By the way, there is something called a ^4d4dffShining Plant^000000 here on Rune Midgard.";
+ next;
+ mes "[Therapist]";
+ mes "Nobody knows which herb comes out from this plant.";
+ mes "Once I got the fruit of Yggdrasil.";
+ next;
+ mes "[Therapist]";
+ mes "And, in the Alberta merchant guild, there is an old man making potions.";
+ mes "You can ask him for help.";
+ next;
+ mes "[Therapist]";
+ mes "^4d4dffAlchemist^000000 or ^4d4dffBiochemist^000000 or the higher class job ^4d4dff Geneticist^000000 are all good at creating potions.";
+ next;
+ mes "[Therapist]";
+ mes "If you want to have a well-made potion, it may be a good idea to ask for a specialist.";
+ close;
+ }
+ case 4:
+ mes "[Therapist]";
+ mes "I see...";
+ mes "For emergency situations, in case you've fainted and want to be brought back here, I will save your current location.";
+ savepoint "iz_ac01", 45, 46;
+ close;
+ }
+
+ OnInit:
+ // AddQuestInfo 7478 0 0
+ // SetQuestQuest 7478 4269 2
+ end;
+}
+
+iz_ac01_a,59,43,3 duplicate(Therapist#ac) Therapist#ac_a 4_M_6THPRIN1
+iz_ac01_b,59,43,3 duplicate(Therapist#ac) Therapist#ac_b 4_M_6THPRIN1
+iz_ac01_c,59,43,3 duplicate(Therapist#ac) Therapist#ac_c 4_M_6THPRIN1
+iz_ac01_d,59,43,3 duplicate(Therapist#ac) Therapist#ac_d 4_M_6THPRIN1
+
+// - Cultivated Red Plant (Red Herb Quest)
+// -----------------------------------------------------------------------------
+izlude,141,251,0 script Cultivated Red Plant#0 RED_PLANT,3,3,{
+ end;
+
+ OnTouch:
+ if (questprogress(7478) == 1 && !questprogress(7479))
+ donpcevent "Cultivated Red Plant#"+strnpcinfo(2)+"::OnDisable";
+ end;
+
+ OnDisable:
+ specialeffect EF_STEAL;
+ disablenpc "Cultivated Red Plant#"+strnpcinfo(2);
+ emotion e_gasp, 1;
+ emotion e_heh, 0, "Academy Student#"+strnpcinfo(2);
+ initnpctimer;
+ end;
+
+ OnTimer30000:
+ enablenpc "Cultivated Red Plant#"+strnpcinfo(2);
+ stopnpctimer;
+ end;
+}
+
+izlude_a,141,251,0 duplicate(Cultivated Red Plant#0) Cultivated Red Plant#a RED_PLANT,3,3
+izlude_b,141,251,0 duplicate(Cultivated Red Plant#0) Cultivated Red Plant#b RED_PLANT,3,3
+izlude_c,141,251,0 duplicate(Cultivated Red Plant#0) Cultivated Red Plant#c RED_PLANT,3,3
+izlude_d,141,251,0 duplicate(Cultivated Red Plant#0) Cultivated Red Plant#d RED_PLANT,3,3
+
+// - Academy Student (Red Herb Quest)
+// -----------------------------------------------------------------------------
+izlude,140,249,7 script Academy Student#0 4_M_NOV_RUMIN,{
+ if (!checkweight(1304, 3)) {
+ mes "Your inventory is too full so you can't continue this quest.";
+ mes "Please try it again after organizing the items.";
+ close;
+ }
+ if (questprogress(7478) == 1 && !questprogress(7479)) {
+ specialeffect EF_STEAL, AREA, "Cultivated Red Plant#"+strnpcinfo(2);
+ donpcevent "Cultivated Red Plant#"+strnpcinfo(2)+"::OnDisable";
+ emotion e_gasp, 1;
+ emotion e_heh;
+ mes "[Lumin]";
+ mes "Hey there Turtle";
+ mes "You are really slow.";
+ mes "This Red Plant is no longer useful for you.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ if(select("What are you talking about?", "Who're you?") == 1) {
+ mes "[Lumin]";
+ mes "You heard me.";
+ mes "Aren't you here to collect the Red Plant for the Academy Therapist.";
+ next;
+ mes "[Lumin]";
+ mes "But, But something weird just happened.";
+ mes "It happened right before my eyes.";
+ next;
+ } else {
+ if (questprogress(7472) > 0 || questprogress(7474) > 1) {
+ mes "[Lumin]";
+ mes "Did you lose your memory?";
+ mes "If the captain hears about it, he'll cry.";
+ mes "It is still ok as long as I remember you.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ } else {
+ mes "[Lumin]";
+ mes "Lumin.";
+ mes ".......";
+ mes "How about being happy?";
+ cutin "nov_lumin04.bmp", 2;
+ next;
+ }
+ }
+ mes "[Lumin]";
+ mes "Anyway, let me explain it to you, I have just cut all the leaves of this Red Plant.";
+ mes "You can't collect the Red Plant anymore.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ select("Ok so give me a ^ff0000Red Herb^000000");
+ mes "[Lumin]";
+ mes "OK... then...";
+ mes "I don't even need it anyways. I already know all about basic medical botany.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ select("Then, why did you do it?");
+ mes "[Lumin]";
+ mes "I didn't do it!";
+ mes "I was just standing here.";
+ cutin "nov_lumin05.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "Here take this Red Herb.";
+ cutin "nov_lumin01.bmp", 2;
+ setquest 7479;
+ completequest 7479;
+ getitem 507, 1; // Red_Herb
+ next;
+ mes "[Lumin]";
+ mes "Ah... see it's growing back.";
+ enablenpc "Cultivated Red Plant#"+strnpcinfo(2);
+ close2;
+ } else {
+ if (Class == Job_Novice) {
+ if (questprogress(7478) == 1) {
+ mes "[Lumin]";
+ mes "I guess you should go back to the Therapist.";
+ mes "He's probably waiting for you..";
+ cutin "nov_lumin01.bmp", 2;
+ close2;
+ } else {
+ mes "He seems to think of something deeply.";
+ mes "Disregard it.";
+ close;
+ }
+ } else {
+ if (questprogress(7479) == 2) {
+ mes "[Criatura Student]";
+ mes ".......";
+ next;
+ mes "This student looks familiar...";
+ close;
+ } else {
+ mes "[Criatura Student]";
+ mes ".......";
+ close;
+ }
+ }
+ }
+ cutin "", 255;
+ end;
+
+ OnInit:
+ //AddQuestInfo 7479 1 0
+ //SetQuestQuest 7479 7478 1
+ end;
+}
+
+izlude_a,140,249,7 duplicate(Academy Student#0) Academy Student#a 4_M_NOV_RUMIN
+izlude_b,140,249,7 duplicate(Academy Student#0) Academy Student#b 4_M_NOV_RUMIN
+izlude_c,140,249,7 duplicate(Academy Student#0) Academy Student#c 4_M_NOV_RUMIN
+izlude_d,140,249,7 duplicate(Academy Student#0) Academy Student#d 4_M_NOV_RUMIN
+
+// - Instructor Argos (Trick Dead Quest)
+// -----------------------------------------------------------------------------
+izlude,140,260,3 script Instructor Argos#iz 4_M_LIEMAN,{
+ if (Class != Job_Novice && getskilllv("NV_TRICKDEAD") != 0) {
+ mes "[Instructor Argos]";
+ mes "snoring... snoring...";
+ close;
+ }
+ if (questprogress(15001) == 2) {
+ mes "[Instructor Argos]";
+ mes "snoring... snoring...";
+ close;
+ }
+ if (!questprogress(15001, PLAYTIME)) {
+ mes "- ......";
+ next;
+ mes "- A man is lying here";
+ mes "- he's barely breathing.";
+ next;
+ mes "- Is this maybe...?!";
+ next;
+ mes "- an accident...";
+ mes "- yes, this is a murder!";
+ mes "- There's a murderer here!";
+ next;
+ mes "- I swear on some old person's grave";
+ mes "- I will solve this case!";
+ next;
+ mes "[Instructor Argos]";
+ mes "Yawn. Who are you making so much noise next to me...";
+ next;
+ select("You aren't dead?");
+ emotion e_omg, 1;
+ mes "[Instructor Argos]";
+ mes "Dead?! Who....?";
+ mes "me? Pu ha ha ha!!";
+ next;
+ emotion e_heh;
+ mes "[Instructor Argos]";
+ mes "Sorry for laughing. Ha ha ha!";
+ mes "I was just taking a nap because the weather is good.";
+ next;
+ select("But you weren't breathing...");
+ mes "[Instructor Argos]";
+ mes "Ahh...... that?";
+ mes "Right it makes sense that you misunderstood.";
+ next;
+ mes "[Instructor Argos]";
+ mes "I used the skill<^ff0000Play Dead^000000> because I didn't want to be disturbed by monsters or someone else.";
+ next;
+ mes "[Instructor Argos]";
+ mes "I never thought someone would think of me as an actual dead body.";
+ next;
+ mes "[Instructor Argos]";
+ mes "Oh, I see... you are a new novice who just has arrived here?";
+ next;
+ mes "[Instructor Argos]";
+ mes "I guess it is unexpected and surprising but do you want to learn <^ff0000Play Dead^000000>?";
+ next;
+ mes "[Instructor Argos]";
+ mes "I am sure that it will help you. How do you think about it?";
+ next;
+ if(select("I am sorry but I am busy.", "I want to learn it!") == 1) {
+ mes "[Instructor Argos]";
+ mes "Really ? If you are busy then fine by me.";
+ mes "I should keep sleeping.";
+ mes "yawning...";
+ close;
+ }
+ mes "[Instructor Argos]";
+ mes "You made a right decision!";
+ mes "I want to teach you for good.";
+ emotion e_no1;
+ next;
+ mes "[Instructor Argos]";
+ mes "A novice does not know the potential power of himself nor how strong the enemy is.";
+ next;
+ mes "[Instructor Argos]";
+ mes "There is a studious type of novice who studies well..but i guess we are not.";
+ next;
+ mes "[Instructor Argos]";
+ mes "Just take prompt action.";
+ mes "And sometimes you'll be defeated by stong enemies...";
+ next;
+ mes "[Instructor Argos]";
+ mes "Huh? You're right this is my story.";
+ mes "I was getting sick of being defeated.";
+ next;
+ mes "[Instructor Argos]";
+ mes "One day, a good idea came to my mind. If I pretend to be dead when I find a strong enemy...";
+ next;
+ mes "[Instructor Argos]";
+ mes "I was faced with the risk of death, because I was not good at pretending to be dead.";
+ mes "Even when I look back at that time. it is still thrilling...";
+ emotion e_wah;
+ next;
+ mes "[Instructor Argos]";
+ mes "let's continue to talk";
+ mes "So ever since then, Playing Dead started working out for me!";
+ next;
+ mes "[Instructor Argos]";
+ mes "And then...";
+ mes "I could not hold a breath for a long time.";
+ mes "That was a problem!";
+ mes "Clever monsters were checking out my breath!";
+ next;
+ mes "[Instructor Argos]";
+ mes "So I had to train myself to hold my breath for a long time.";
+ next;
+ mes "[Instructor Argos]";
+ mes "Sounds complicated.. but it is quite simple.";
+ next;
+ mes "[Instructor Argos]";
+ mes "If you feel like you can not beat the enemy, when a strong one appears, just fall down on the ground and pretend to be dead.";
+ next;
+ mes "[Instructor Argos]";
+ mes "I will put you on a brief test whether you hold you breathe or not.";
+ next;
+ mes "[Instructor Argos]";
+ mes "Hold a breath for 20 seconds, then talk to me later. I won't admit you if you talk to me before that time is over!";
+ next;
+ mes "[Instructor Argos]";
+ mes "Start!";
+ close2;
+ setquest 15001;
+ end;
+ } else if (questprogress(15001, PLAYTIME) == 1) {
+ mes "[Instructor Argos]";
+ mes "What? You aren't able to hold your breath for even 20 seconds?";
+ mes "You can't learn this skill until you are able to hold it!";
+ next;
+ mes "[Instructor Argos]";
+ mes "Hold breath for 20 seconds again!";
+ mes "Then talk to me.";
+ close2;
+ erasequest 15001;
+ setquest 15001;
+ end;
+ } else {
+ mes "- Learned the <^ff0000Play Dead^000000>skill.";
+ completequest 15001;
+ skill "NV_TRICKDEAD", 1, 0;
+ skill_nov = 6;
+ next;
+ mes "[Instructor Argos]";
+ mes "Okay, good job.";
+ mes "If you have strong patience like that, it will save you. There will be no monsters that can hurt you.";
+ next;
+ mes "[Instructor Argos]";
+ mes "The <^ff0000Play Dead^000000> skill is in your skill list which you can open by pressing <Alt + S>, Please do not forget to use it, it will save you when you are in a danger.";
+ next;
+ mes "[Instructor Argos]";
+ mes "If you grow up and get another job, then you do not need this skill so do not spare it! Wse it when you need to and don't hesitate.";
+ next;
+ mes "[Instructor Argos]";
+ mes "I need to get some sleep, do not wake me up. Yawn.";
+ close;
+ }
+
+ OnInit:
+ questinfo 15001, QTYPE_QUEST, 0, Job_Novice;
+ end;
+}
+
+izlude_a,140,260,3 duplicate(Instructor Argos#iz) Instructor Argos#iz_a 4_M_LIEMAN
+izlude_b,140,260,3 duplicate(Instructor Argos#iz) Instructor Argos#iz_b 4_M_LIEMAN
+izlude_c,140,260,3 duplicate(Instructor Argos#iz) Instructor Argos#iz_c 4_M_LIEMAN
+izlude_d,140,260,3 duplicate(Instructor Argos#iz) Instructor Argos#iz_d 4_M_LIEMAN
+
+// - Academy Receptionist
+// - Gives player some basic equipment and starts Academy quests.
+// -----------------------------------------------------------------------------
+iz_ac01,100,39,5 script Academy Receptionist#1 4_F_01,{
+ if (questprogress(7117) == 1) { erasequest 7117; }
+ if (questprogress(7118) == 1) { erasequest 7118; }
+ if (questprogress(7119) == 1) { erasequest 7119; }
+ if (questprogress(7120) == 1) { erasequest 7120; }
+ if (questprogress(7121) == 1) { erasequest 7121; }
+ if (questprogress(7122) == 1) { erasequest 7122; }
+ if (questprogress(7123) == 1) { erasequest 7123; }
+ if (questprogress(7124) == 1) { erasequest 7124; }
+ if (questprogress(7126) == 1) { erasequest 7126; }
+ if (questprogress(7127) == 1) { erasequest 7127; }
+
+ if (questprogress(4269) == 2) {
+ mes "[Receptionist]";
+ mes "Hello, " + strcharinfo(0) +".";
+ mes "How are you today?";
+ mes "I am in charge guiding you here in the Academy.";
+ } else {
+ mes "[Receptionist]";
+ mes "Welcome to our Academy. I am in charge with the guide and registration for Novice education courses.";
+ }
+ next;
+ while(1) {
+ mes "[Receptionist]";
+ mes "What can I do for you?";
+ next;
+ if(questprogress(4269) == 2)
+ .@menu$ = ":What's inside and outside the Academy.:Trainer location guide.:End Coversation.";
+ else
+ .@menu$ = "Register for the Academy:Explanation about the Academy:Location for trainers:Coversation finished";
+ switch(select(.@menu$)) {
+ case 1:
+ if (Class == Job_Novice) {
+ if (!checkweight(1301, 10)) {
+ mes "- As you are overloaded with too many items, quest can't be continued.-";
+ close;
+ }
+ mes "[Receptionist]";
+ mes "Let me see... Your name is... " + strcharinfo(0) + ".";
+ mes "I will make a new registration for you.";
+ mes "You can choose the course freely and each course has individual features.";
+ next;
+ mes "[Receptionist]";
+ mes "And this is the the basic equipment for the educational course.";
+ mes "Please make a good use of it.";
+ mes "Be careful with it as it won't be provided again.";
+ setquest 4269;
+ completequest 4269;
+ getitem 2352, 1; // Novice_Plate
+ getitem 2510, 1; // Novice_Hood
+ getitem 2414, 1; // Novice_Boots
+ getitem 5055, 1; // Novice_Egg_Cap
+ getitem 1243, 1; // Novice_Knife
+ getitem 2112, 1; // Novice_Guard
+ getitem 18730, 1; // Criatura_Academy_Hat
+ getitem 6593, 1; // Criatura_Hair_Coupon
+ getitem 569, 300; // Novice_Potion
+ next;
+ mes "[Receptionist]";
+ mes "It is your first step to be an adventurer that you have made a visit to us.";
+ getexp 100,100;
+ next;
+ mes "[Receptionist]";
+ mes "On our next meeting, I anticipate you will grow up a bit more.";
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ } else {
+ mes "[Receptionist]";
+ mes "One who is not a Novice can't attend the educational course.";
+ next;
+ mes "[Receptionist]";
+ mes "However, a part of the educational course except the character cultivation can be freely attended. So, you may look around the Academy and neighboring places.";
+ close;
+ }
+ case 2:
+ switch(select("What's on the 1st floor", "What's on the 2nd floor", "Explanation about towns", "End Conversation")) {
+ case 1:
+ mes "[Receptionist]";
+ mes "The first floor is equipped with instructors that give you lessons on how the world works here in Rune Midgard.";
+ next;
+ mes "[Receptionist]";
+ mes "First of all, at the dispensary, you can learn how to recover your physical strength and learn a skill to heal your HP";
+ next;
+ mes "[Receptionist]";
+ mes "At the armory, you can get simple training about battling monsters in Rune Midgard.";
+ next;
+ mes "[Receptionist]";
+ mes "At the cafeteria, you can practice cooking and and will learn its many benefits.";
+ next;
+ break;
+ case 2:
+ mes "[Receptionist]";
+ mes "At the 2nd floor, there are trainers that will teach you about the different job classes in the world.";
+ next;
+ mes "[Receptionist]";
+ mes "Listen to the trainers and decide for yourself which job suits your personal style.";
+ next;
+ break;
+ case 3:
+ mes "[Receptionist]";
+ mes "This town is called 'Izlude' the satellite and port city of the Capital City of the Rune-Midgarts Kingdom Prontera.";
+ next;
+ mes "[Receptionist]";
+ mes "This town was re-organized to suit the education of Novices.";
+ next;
+ break;
+ case 4:
+ mes "[Receptionist]";
+ mes "Please find me, if you need anything else.";
+ //if (Class == Job_Novice)
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ }
+ break;
+ case 3:
+ while(1) {
+ switch(select("Game Mechanic Tutorial Instructors", "1st job trainers", "Return to the previous menu", "End Conversation")) {
+ case 1:
+ mes "[Receptionist]";
+ mes "Left-Click your mouse on the name of the trainer you are looking for and I will give guide you to them.";
+ next;
+ mes "<NAVI>[Therapist]<INFO>iz_ac01,59,43</INFO></NAVI>, status recovery trainer";
+ mes "<NAVI>[Subino]<INFO>iz_ac01,59,83</INFO></NAVI>, battle trainer";
+ mes "<NAVI>[Mainz]<INFO>iz_ac01,134,47</INFO></NAVI>, abnormal stats trainer";
+ mes "<NAVI>[Dakuwazu]<INFO>iz_ac01,147,47</INFO></NAVI>, Cooking Trainer.";
+ mes "<NAVI>[Han]<INFO>izlude,153,126</INFO></NAVI>, Refining Trainer.";
+ mes "<NAVI>[Mounds]<INFO>izlude,96,125</INFO></NAVI> Enchanting Trainer.";
+ mes "<NAVI>[Cream Puff]<INFO>iz_ac02,143,55</INFO></NAVI>, Class Aptitude Test.";
+ next;
+ mes "[Receptionist]";
+ mes "Is that helpful?";
+ next;
+ if(select("Just a moment.", "I have to leave.") == 1) {
+ break;
+ } else {
+ if (Class == Job_Novice) {
+ mes "[Receptionist]";
+ mes "I believe you'll become nicer on our next meeting. Try your best~~~";
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ } else {
+ mes "[Receptionist]";
+ mes "Please find me, if you need anything else.";
+ close;
+ }
+ }
+ break;
+ case 2:
+ mes "[Receptionist]";
+ mes "Left-Click your mouse on the name of the trainer you are looking for and I will give guide you to them.";
+ next;
+ mes "Swordman Instructor <NAVI>[Adric]<INFO>iz_ac02,62,51</INFO></NAVI>";
+ mes "Acolyte Instructor <NAVI>[Alice]<INFO>iz_ac02,156,169</INFO></NAVI>";
+ mes "Archer Instructor <NAVI>[Marlbron]<INFO>iz_ac02,65,109</INFO></NAVI>";
+ mes "Mage Instructor <NAVI>[Chuck]<INFO>iz_ac02,148,110</INFO></NAVI> ";
+ mes "Thief Instructor <NAVI>[Mayssel]<INFO>iz_ac02,52,136</INFO></NAVI>";
+ mes "Merchant Instructor <NAVI>[Salim]<INFO>iz_ac02,50,169</INFO></NAVI>";
+ mes "Ninja Instructor <NAVI>[Ninja Guide]<INFO>iz_ac02,140,139</INFO></NAVI>";
+ mes "Gunslinger Instructor<NAVI>[Lusa]<INFO>iz_ac02,142,85</INFO></NAVI>";
+ mes "Taekwon Instructor <NAVI>[Arang]<INFO>iz_ac02,70,85</INFO></NAVI>";
+ next;
+ mes "[Receptionist]";
+ mes "Is that helpful?";
+ next;
+ if(select("Just a moment.", "I have to leave.") == 1) {
+ break;
+ } else {
+ if (Class == Job_Novice) {
+ mes "[Receptionist]";
+ mes "I believe you'll become nicer on our next meeting. Try your best~~~";
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ } else {
+ mes "[Receptionist]";
+ mes "Please find me, if you need anything else.";
+ close;
+ }
+ }
+ break;
+ case 3:
+ break;
+ case 4:
+ mes "[Receptionist]";
+ mes "Please find me, if you need anything else.";
+ if (Class == Job_Novice)
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ }
+ }
+ break;
+ case 4:
+ mes "[Receptionist]";
+ mes "Please find me, if you need anything else.";
+ if (Class == Job_Novice)
+ //ConsumeSpecialItem Inspector_Certificate_
+ close;
+ }
+ }
+
+ OnInit:
+ questinfo 4269, QTYPE_QUEST, 0, Job_Novice;
+ end;
+}
+
+iz_ac01_a,100,39,5 duplicate(Academy Receptionist#1) Academy Receptionist#1_a 4_F_01
+iz_ac01_b,100,39,5 duplicate(Academy Receptionist#1) Academy Receptionist#1_b 4_F_01
+iz_ac01_c,100,39,5 duplicate(Academy Receptionist#1) Academy Receptionist#1_c 4_F_01
+iz_ac01_d,100,39,5 duplicate(Academy Receptionist#1) Academy Receptionist#1_d 4_F_01
+
+// - Trainer Mainz
+// - Teaches the player about Status Effects (poison, stun, etc).
+// -----------------------------------------------------------------------------
+iz_ac01,134,47,5 script Trainer Mainz#ac 4_M_KY_KNT,4,4,{
+ if (!questprogress(4269)) {
+ mes "[Mainz]";
+ mes "Ha ah....";
+ mes "What should I do with this lunchbox?";
+ close;
+ }
+ if (questprogress(15000) == 1) {
+ if (!checkweight(1201, 1) || (MaxWeight - Weight) < 40) {
+ mes "- Here, just moment!! -";
+ mes "- As you are overloaded with too many items in your inventory -";
+ mes "- You can't receive the items anymore -";
+ mes "- Let yourself enlightened -";
+ mes "- and please try again -";
+ close;
+ }
+ mes "[Mainz]";
+ mes "Are you ready to learn about abnormal statuses? I promise that I won't trick you anymore. I am a ''trainer'' after all right?";
+ next;
+ mes "[Mainz]";
+ mes "First of all, I'll tell you about <^FF0000Poison^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "As you already experienced, when you are poisoned, your body turns purple and you lose a little HP every second.";
+ next;
+ mes "[Mainz]";
+ mes "You can't lose HP forever so you won't die from poison.";
+ next;
+ mes "[Mainz]";
+ mes "Experiencing is believing! I will put you in a poisoned status.";
+ next;
+ mes "[Mainz]";
+ mes "See what happens to you in the poisoned status.";
+ next;
+ sc_start SC_POISON, 30000, 0;
+ mes "You are- <^FF0000Poisoned^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_POISON;
+ mes "[Mainz]";
+ mes "Did you see what is the poisoned status? After a certain period of time, you could be detoxicated, but if you're being attached, it is dangerous to expect being detoxicated naturally.";
+ next;
+ mes "[Mainz]";
+ mes "Refer to the detoxicants such as <^0022FFGreen Herb^000000>, <^0022FFGreen Potion^000000>, <^0022FFPanacea^000000> and <^0022FFRoyal Jelly^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "Next, I'll tell you about<^FF0000 Stun^000000.";
+ next;
+ mes "[Mainz]";
+ mes "While in the Stun status, stars will circle around your head and you can't move basically you'll be ''defenseless''.";
+ next;
+ mes "[Mainz]";
+ mes "As you are defenseless, you can't move, use skills, and use items.";
+ mes "So, it is impossible to recover from it by yourself.";
+ next;
+ mes "[Mainz]";
+ mes "The exceptional case is you can recover from it by the skill called <^0022FFGentle Touch-Cure^000000> if you are a Sura.";
+ next;
+ mes "[Mainz]";
+ mes "You can recover with skills such as the Priest's <^0022FFRecovery ^000000> or the Arch Bishop's <^0022FFLauda Ramus^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in the Stun status!";
+ next;
+ sc_start SC_STUN, 30000, 0;
+ mes "<^FF0000 Stun ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_STUN;
+ mes "[Mainz]";
+ mes "How was it?";
+ mes "Didn't you feel oppressed since you couldn't move?";
+ next;
+ mes "[Mainz]";
+ mes "Imagine that you are in that status and monsters are rushing to you...";
+ mes "Believe me it'll happen.";
+ emotion e_wah;
+ next;
+ mes "[Mainz]";
+ mes "This time, I will teach you about <^FF0000Sleep^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "In Sleep status, you fall asleep with a <Zzz> popped up over your head.";
+ next;
+ mes "[Mainz]";
+ mes "Same as the Stun status, you are defenseless, but the difference is you can recover from the enemy's attack.";
+ next;
+ mes "[Mainz]";
+ mes "But in Sleep status, the possibility to be hit by ''Critical'' attacks from enemy's attack is increased, you are in danger and exposed a severe damage.";
+ next;
+ mes "[Mainz]";
+ mes "For your reference, recovery by yourself is impossible and is only possible with the <^0022FF Recovery ^000000>skill of a Priest.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in the Sleep status.";
+ next;
+ sc_start SC_SLEEP, 30000, 0;
+ mes "<^FF0000 Sleep ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_SLEEP;
+ mes "[Mainz]";
+ mes "How was it? It isn't fun to imagine being asleep in front of a dangerous enemy is it?";
+ next;
+ mes "[Mainz]";
+ mes "Sleep is good for recovery but not necessarily good while you're in the middle of a battle.";
+ emotion e_flash;
+ next;
+ mes "[Mainz]";
+ mes "Lastly, I will teach you about <^FF0000 Silence ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "In Silence status, you can't use any magic skills and a <...> will appear above your head.";
+ next;
+ mes "[Mainz]";
+ mes "But all attacks are not impossible. Normal attacks can still be done while silenced.";
+ next;
+ mes "[Mainz]";
+ mes "In the silence status, you can merely still physically attack or recover by using potions.";
+ next;
+ mes "[Mainz]";
+ mes "It's possible to recover with the items such as<^0022FF Green Herb^000000>, <^0022FFGreen Potion^000000>, <^0022FFPanacea^000000> and <^0022FFRoyal Jelly^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in Sleep status.";
+ next;
+ sc_start SC_SILENCE, 30000, 0;
+ mes "<^FF0000Silence^000000>";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_SILENCE;
+ mes "[Mainz]";
+ mes "It's frustrating to not be able to use your skills right?";
+ next;
+ mes "[Mainz]";
+ mes "Especially, when you are a high class depending upon the skills rather than physical attacks or in Sleep status during the battle, you will be damaged severely.";
+ next;
+ mes "[Mainz]";
+ mes "In addtion, there are other statuses like Darkness, Frozen, Curse, Stone, Confusion etc, but I can let you experience all of them.";
+ next;
+ mes "[Mainz]";
+ mes "I hope this was helpful for you to experience some of the things that you will see out in the world.";
+ next;
+ mes "[Mainz]";
+ mes "Whenever you want to experience an abnormal status, please come to me.";
+ next;
+ mes "[Mainz]";
+ mes "As an apology for the lunchbox matter, I will give you a small gift.";
+ next;
+ mes "[Mainz]";
+ mes "Wish you have good luck in your adventures!";
+ completequest 15000;
+ getitem 512, 10; // Apple
+ getexp 180, 100;
+ close;
+ } else if (questprogress(4269) && !questprogress(15000)) {
+ mes "[Mainz]";
+ mes "Hey, you there!";
+ mes "By any chance, are you a training beginner?";
+ emotion e_flash;
+ next;
+ mes "[Mainz]";
+ mes "I'm Trainer Mainz; and I'm in charge of education at this Academy.";
+ next;
+ mes "[Mainz]";
+ mes "Which course?";
+ mes "It is not important so I will let you know later.";
+ next;
+ mes "[Mainz]";
+ mes "You must be very exhausted after having to read and learn so much right?";
+ next;
+ mes "[Mainz]";
+ mes "Of course, you are... Oh, you poor thing.";
+ next;
+ mes "[Mainz]";
+ mes "There's a person who can help you when you need it.";
+ mes "Do you know who is it?";
+ next;
+ mes "[Mainz]";
+ mes "That's me!";
+ next;
+ mes "[Mainz]";
+ mes "What does that mean?";
+ mes "It means I have prepared a special gift just for your exhausted self!";
+ next;
+ mes "[Mainz]";
+ mes "A lunchbox for you!!! Hahahaha!";
+ next;
+ mes "[Mainz]";
+ mes "Since I'm not the one who made it don't worry.";
+ mes "My beloved wife prepared it. So, just be my guest and enjoy!";
+ next;
+ if(select("Don't take it.", "Take it.") == 1) {
+ mes "[Mainz]";
+ mes "You don't want to have this lunchbox? I guess it's your loss then.";
+ next;
+ mes "[Mainz]";
+ mes "Should I just take it for myself then?";
+ close2;
+ emotion e_sigh;
+ end;
+ }
+ mes "[Mainz]";
+ mes "Yes... You made a right decision.";
+ mes "Please keep in mind that I really wanted to have it but since you look exhausted I offered it to you first!";
+ emotion e_no1;
+ next;
+ mes "- You open the lunchbox and there is some type of food inside ¡©";
+ next;
+ mes "[Mainz]";
+ mes "Wahahahat! Don't hesitate and just take it!";
+ mes "It will refresh you from your fatigue!";
+ mes "Eat it~~ Eat it~~";
+ next;
+ mes "- Since you're tired and starved you're obliged to take the box -";
+ next;
+ mes ".........";
+ next;
+ sc_start SC_POISON, 60000, 0;
+ mes "- You eat the food and suddenly feel a sharp pain in your stomach. Your vision seems to be blurry too -";
+ next;
+ mes "[Mainz]";
+ mes "Oh... what happened to you?";
+ mes "You don't look too good!";
+ emotion e_what;
+ next;
+ mes "[Mainz]";
+ mes "Oh, man...";
+ mes "I think you've been poisoned.";
+ next;
+ mes "[Mainz]";
+ mes "I will give you an antidote. You might get better if you take it.";
+ next;
+ mes "- You reluctantly take the antidote -";
+ sc_end SC_POISON;
+ percentheal 100, 0;
+ next;
+ mes "[Mainz]";
+ mes "Well, how the heck were you poisoned?";
+ next;
+ mes "[Mainz]";
+ mes "By the way, I heard that there's a ghost wandering around the Royal Criatura Academy.";
+ next;
+ mes "[Mainz]";
+ mes "I think the ghost must have poisoned you.";
+ next;
+ mes "- You roll your eyes at Mainz -";
+ mes "- Mainz turns his head as if he doesn't notice -";
+ emotion e_bzz;
+ next;
+ mes "[Mainz]";
+ mes "Ehem! Anyway, I am sorry.";
+ mes "Please understand there is no malice.";
+ next;
+ mes "[Mainz]";
+ mes "All of these are for you...";
+ mes "Want to know what I mean?";
+ next;
+ mes "[Mainz]";
+ mes "There are various kinds of monsters on the Rune Midgard continent. And some of them can poison you or put you in abnormal conditions.";
+ next;
+ mes "[Mainz]";
+ mes "Usually, anybody is too embarrassed to admit being poisoned without knowing. I just did it on purpose to let you have the experience in case it happens out in the real world.";
+ next;
+ mes "[Mainz]";
+ mes "Understand that I didn't intend to pass my wife's lunchbox as if it was a present. It was just another lesson from the Criatura Academy.";
+ emotion e_otl;
+ next;
+ mes "[Mainz]";
+ mes "As an apology, I would like to inform you of several abnormal statuses you might experience in the Rune Midgard Continent.";
+ next;
+ mes "[Mainz]";
+ mes "Don't decline it! Being ready to learn so speak to me again.";
+ setquest 15000;
+ close2;
+ emotion e_sry;
+ end;
+ } else {
+ mes "[Mainz]";
+ mes "Are you here for an explanation about the abnormal statuses? What makes you anxious?";
+ next;
+ while(1) {
+ switch(select("<^FF0000Poison^000000>", "<^FF0000Stun^000000>", "<^FF0000Sleep^000000>", "<^FF0000Silence ^000000>", "I have no questions.")) {
+ case 1:
+ mes "[Mainz]";
+ mes "I'll tell you about <^FF0000Poison^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "As you already experienced, when you are poisoned, your body turns purple and you lose a little HP every second.";
+ next;
+ mes "[Mainz]";
+ mes "You can't lose HP forever so you won't die from poison.";
+ next;
+ mes "[Mainz]";
+ mes "Experiencing is believing! I will put you in a poisoned status.";
+ next;
+ mes "[Mainz]";
+ mes "See what happens to you in the poisoned status.";
+ next;
+ sc_start SC_POISON, 30000, 0;
+ mes "You are- <^FF0000Poisoned^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_POISON;
+ mes "[Mainz]";
+ mes "Did you see what is the poisoned status? After a certain period of time, you could be detoxicated, but if you're being attached, it is dangerous to expect being detoxicated naturally.";
+ next;
+ mes "[Mainz]";
+ mes "Refer to the detoxicants such as <^0022FFGreen Herb^000000>, <^0022FFGreen Potion^000000>, <^0022FFPanacea^000000> and <^0022FFRoyal Jelly^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "What else are you anxious about?";
+ next;
+ break;
+ case 2:
+ mes "[Mainz]";
+ mes "I'll tell you about <^FF0000Stun^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "While in the Stun status, stars will circle around your head and you can't move basically you'll be ''defenseless''.";
+ next;
+ mes "[Mainz]";
+ mes "As you are defenseless, you can't move, use skills, and use items.";
+ mes "So, it is impossible to recover from it by yourself.";
+ next;
+ mes "[Mainz]";
+ mes "The exceptional case is you can recover from it by the skill called <^0022FFGentle Touch-Cure^000000> if you are a Sura.";
+ next;
+ mes "[Mainz]";
+ mes "You can recover with skills such as the Priest's <^0022FFRecovery ^000000> or the Arch Bishop's <^0022FFLauda Ramus^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in the Stun status!";
+ next;
+ sc_start SC_STUN, 30000, 0;
+ mes "<^FF0000 Stun ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_STUN;
+ mes "[Mainz]";
+ mes "How was it?";
+ mes "Didn't you feel oppressed since you couldn't move?";
+ next;
+ mes "[Mainz]";
+ mes "Imagine that you are in that status and monsters are rushing to you...";
+ mes "Believe me it'll happen.";
+ emotion e_wah;
+ next;
+ mes "[Mainz]";
+ mes "What else are you anxious about?";
+ next;
+ break;
+ case 3:
+ mes "[Mainz]";
+ mes "I will teach you about <^FF0000Sleep^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "In Sleep status, you fall asleep with a <Zzz> popped up over your head.";
+ next;
+ mes "[Mainz]";
+ mes "Same as the Stun status, you are defenseless, but the difference is you can recover from the enemy's attack.";
+ next;
+ mes "[Mainz]";
+ mes "But in Sleep status, the possibility to be hit by ''Critical'' attacks from enemy's attack is increased, you are in danger and exposed a severe damage.";
+ next;
+ mes "[Mainz]";
+ mes "For your reference, recovery by yourself is impossible and is only possible with the <^0022FF Recovery ^000000>skill of a Priest.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in the Sleep status.";
+ next;
+ sc_start SC_SLEEP, 30000, 0;
+ mes "<^FF0000 Sleep ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_SLEEP;
+ mes "[Mainz]";
+ mes "How was it? It isn't fun to imagine being asleep in front of a dangerous enemy is it?";
+ next;
+ mes "[Mainz]";
+ mes "Sleep is good for recovery but not necessarily good while you're in the middle of a battle.";
+ emotion e_flash;
+ next;
+ mes "[Mainz]";
+ mes "What else are you anxious about?";
+ next;
+ break;
+ case 4:
+ mes "[Mainz]";
+ mes "I will teach you about <^FF0000 Silence ^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "In Silence status, you can't use any magic skills and a <...> will appear above your head.";
+ next;
+ mes "[Mainz]";
+ mes "But all attacks are not impossible. Normal attacks can still be done while silenced.";
+ next;
+ mes "[Mainz]";
+ mes "In the silence status, you can merely still physically attack or recover by using potions.";
+ next;
+ mes "[Mainz]";
+ mes "It's possible to recover with the items such as<^0022FF Green Herb^000000>, <^0022FFGreen Potion^000000>, <^0022FFPanacea^000000> and <^0022FFRoyal Jelly^000000>.";
+ next;
+ mes "[Mainz]";
+ mes "Let me show you what will happen in Sleep status.";
+ next;
+ sc_start SC_SILENCE, 30000, 0;
+ mes "<^FF0000Silence^000000>";
+ next;
+ mes "[Mainz]";
+ mes "......";
+ next;
+ sc_end SC_SILENCE;
+ mes "[Mainz]";
+ mes "It's frustrating to not be able to use your skills right?";
+ next;
+ mes "[Mainz]";
+ mes "Especially, when you are a high class depending upon the skills rather than physical attacks or in Sleep status during the battle, you will be damaged severely.";
+ next;
+ mes "[Mainz]";
+ mes "Do you have any more questions?";
+ next;
+ break;
+ case 5:
+ mes "[Mainz]";
+ mes "If you don't have any more questions, would you please have my lunchbox on behalf of me?";
+ mes "No?";
+ next;
+ mes "[Mainz]";
+ mes "Haaaaa...";
+ mes "What should I do with this lunchbox?";
+ close2;
+ emotion e_sigh;
+ end;
+ }
+ }
+ }
+
+ OnTouch:
+ emotion e_otl;
+ end;
+}
+
+iz_ac01_a,134,47,5 duplicate(Trainer Mainz#ac) Trainer Mainz#ac_a 4_M_KY_KNT,4,4
+iz_ac01_b,134,47,5 duplicate(Trainer Mainz#ac) Trainer Mainz#ac_b 4_M_KY_KNT,4,4
+iz_ac01_c,134,47,5 duplicate(Trainer Mainz#ac) Trainer Mainz#ac_c 4_M_KY_KNT,4,4
+iz_ac01_d,134,47,5 duplicate(Trainer Mainz#ac) Trainer Mainz#ac_d 4_M_KY_KNT,4,4
+
+// - Odd Novice
+// - Introduces the player to the concept of Super Novices.
+// -----------------------------------------------------------------------------
+iz_ac01,36,52,3 script Odd Novice#ac 4_M_SIT_NOVICE,{
+ mes "[Odd Novice]";
+ mes "Ahaaa~~ sticking at the dispensary.";
+ mes "Playing hooky is cool and awesome.";
+ if (Class == Job_Novice) {
+ mes "while XXXXXX, but what are you?";
+ mes "Are you the same kind of XXXXX?";
+ next;
+ .@choice = rand(1,10);
+ if (.@choice < 3) {
+ mes "[Odd Novice]";
+ mes "Hmmm... you look like you have some talent.";
+ mes "Being in a good mood, shall I show you something newfangled?";
+ next;
+ switch(select("Newfangled?", "Who are you..?", "Why are you here?", "End Conversation")) {
+ case 1:
+ .@message = 1;
+ break;
+ case 2:
+ .@message = 2;
+ break;
+ case 3:
+ .@message = 3;
+ break;
+ case 4:
+ .@message = 4;
+ break;
+ }
+ } else {
+ switch(select("Who are you..?", "Why are you here?", "End Conversation")) {
+ case 1:
+ .@message = 2;
+ break;
+ case 2:
+ .@message = 3;
+ break;
+ case 3:
+ .@message = 4;
+ break;
+ }
+ }
+ switch(.@message)
+ {
+ case 1:
+ mes "[Odd Novice]";
+ mes "I may look ordinary to you but I have a newfangled talent.";
+ mes "Not my fault, if you are shocked at seeing it.";
+ next;
+ mes "[Odd Novice]";
+ mes "OK. Where should I start?";
+ mes "First, Bash!";
+ specialeffect2 EF_BASH;
+ next;
+ mes "[Odd Novice]";
+ mes "Hehehe.. Surprised?";
+ mes "I'm just pretending...";
+ mes "It's not a real punch.";
+ next;
+ mes "[Odd Novice]";
+ mes "Looks like you were surprised!";
+ specialeffect2 EF_BLESSING;
+ next;
+ mes "[Odd Novice]";
+ mes "Just keep calm";
+ mes "and have a potion";
+ mes "But that's not the last of it.";
+ specialeffect2 EF_STEAL;
+ next;
+ mes "[Odd Novice]";
+ mes "I have stolen one thread of your hair.";
+ mes "I don't believe in Voodooism.";
+ mes "Regard it as your luck.";
+ next;
+ mes "[Odd Novice]";
+ mes "The last one is a flame, to say the least!";
+ mes "How about it? Newfangled.";
+ mes "Idling away too long,";
+ mes "All the skills learnt over your shoulder could be used.";
+ specialeffect EF_SIGHT, "Odd Novice#nk1";
+ next;
+ mes "[Odd Novice]";
+ mes "Ugh, all my SP is gone...";
+ mes "and wasted... I am tired.";
+ mes "I am going back to rest.";
+ mes "So long, Bye-bye~~ Don't bother me anymore.";
+ close;
+ case 2:
+ if (.@choice == 10) {
+ mes "[Odd Novice]";
+ mes "What? You, disturbing me.";
+ mes "Get away from me kid you're botherin' me.";
+ close;
+ } else {
+ switch(rand(1, 3)) {
+ case 1:
+ mes "[Odd Novice]";
+ mes "Me? I'm Novice.";
+ mes "What? Strange? You seein' me for the first time?";
+ next;
+ mes "[Odd Novice]";
+ mes "If I look shabby, you should go find a mirror.";
+ mes "You and I are wearing the same thing pal.";
+ close;
+ case 2:
+ mes "[Odd Novice]";
+ mes "I'm what you call a Novice of all Novices.";
+ mes "A Jack of all trades but a master of none.";
+ next;
+ mes "[Odd Novice]";
+ mes "If you don't graduate from school and hang around and only mimic other's lifesstyles you'll end up like me.";
+ next;
+ mes "[Odd Novice]";
+ mes "Genius and idiot has a paper thin difference.";
+ mes "Those of versatility but of no special capability, that is the Super Novice.";
+ mes "That's what everyone calls us.";
+ close;
+ case 3:
+ mes "[Odd Novice]";
+ mes "A rose by any other name...";
+ mes "I am what I am. A Super Novice!";
+ close;
+ }
+ }
+ case 3:
+ if (.@choice == 10) {
+ mes "[Odd Novice]";
+ mes "What? You, disturbing me.";
+ mes "Get away from me kid you're botherin' me.";
+ close;
+ } else {
+ if (getskilllv(NV_BASIC) > 8) {
+ mes "[Odd Novice]";
+ mes "You, talking like this, why don't you go and change your job already instead of hanging around here?";
+ mes "Hmm, did you want to be like me maybe?";
+ next;
+ mes "[Odd Novice]";
+ mes "Aha~ If you want all the different skills...";
+ next;
+ mes "[Odd Novice]";
+ mes "If you do like I do, then you will be a great Super Novice.";
+ close;
+ } else {
+ switch(rand(1, 3)) {
+ case 1:
+ mes "[Odd Novice]";
+ mes "Hmmm. Dirty mouth!";
+ mes "When I was at your age,";
+ mes "If I recklessly spoke like you, I was dragged to the backside mountain, and then...";
+ next;
+ mes "[Odd Novice]";
+ mes "OK... that's enough..";
+ mes "Now I am in a good mood?";
+ mes "When I am using good words,";
+ mes "go away silently, yes?";
+ close;
+ case 2:
+ mes "[Odd Novice]";
+ mes "Are you idling around at school?";
+ mes "I don't need to tell you about it.";
+ mes "If you are loafing around here,";
+ mes "Once grown up, you will be a man like me.";
+ mes "Scary, isn't it?";
+ next;
+ mes "[Odd Novice]";
+ mes "I know, I know, before we are found by a teacher or even worse the principal.";
+ mes "Go away, gooooooawaaaaaayyyyyyyyy~";
+ close;
+ case 3:
+ mes "[Odd Novice]";
+ mes "Well,";
+ mes "What am I doing?";
+ mes "I became like this, in the blink of an eye.";
+ next;
+ mes "[Odd Novice]";
+ mes "By nature, I had a great dream...";
+ mes "Haaaa~~ Because I dreamt of too many things to do?";
+ close;
+ }
+ }
+ }
+ case 4:
+ mes "[Odd Novice]";
+ mes "Yes, yes, take your way...";
+ mes "I am the Novice of pride and loneliness.";
+ mes "I can enjoy myself.";
+ close;
+ }
+ }
+ close;
+}
+
+iz_ac01_a,36,52,3 duplicate(Odd Novice#ac) Odd Novice#ac_a 4_M_SIT_NOVICE
+iz_ac01_b,36,52,3 duplicate(Odd Novice#ac) Odd Novice#ac_b 4_M_SIT_NOVICE
+iz_ac01_c,36,52,3 duplicate(Odd Novice#ac) Odd Novice#ac_c 4_M_SIT_NOVICE
+iz_ac01_d,36,52,3 duplicate(Odd Novice#ac) Odd Novice#ac_d 4_M_SIT_NOVICE
+
+// - Shop Helper
+// - Teaches the player about Shops and Currency.
+// -----------------------------------------------------------------------------
+izlude,115,181,5 script Shop Helper#iz 4_F_KHELLISIA,{
+ if (!checkweight(1301, 3)) {
+ mes "- Quest cannot be continued due to your overfilled inventory. -";
+ close;
+ }
+
+ if(Class == Job_Novice) {
+ if(!questprogress(1237)) {
+ mes "[Shop Helper Leonie]";
+ mes "How are you doing with your basic studies?";
+ mes "You need to learn about the shop information.";
+ next;
+ if(select("I'm doing fine myself!", "Ok I'll listen!") == 1) {
+ mes "[Shop Helper Leonie]";
+ mes "If you listen carefully, I will give you a souvenir.";
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ mes "Wise choise.";
+ mes "Rune Midgard has many shops and many variety of currencies.";
+ mes "So you need to listen to me well to use them accordingly.";
+ setquest 1237;
+ close;
+ }
+ if(!questprogress(1238)) {
+ mes "[Shop Helper Leonie]";
+ mes "Let's start.";
+ } else if(questprogress(1238) == 1) {
+ if(countitem(501) > 0) {
+ mes "[Shop Helper Leonie]";
+ mes "Ok 1 ^0000ffRed Potion^000000.";
+ mes "For now on you can use them at a field in a dungeon.";
+ mes "As a reward I'll give you a couple of ^ff0000Fly Wing^000000s.";
+ completequest 1238;
+ setquest 1239;
+ getitem 12323, 50; // N_Fly_Wing
+ getexp 1300, 100;
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ mes "Go to the shop and buy one ^0000ffRed Potion^000000 and bring it back.";
+ mes "You have that much money, right?";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "If not, go hunt monsters in the vicnity and then when you sell their loot you should make enough money.";
+ next;
+ if(select("I will do it.", "Question about the shop.") == 1) {
+ mes "[Shop Helper Leonie]";
+ mes "Let's go into the next lesson.";
+ mes "Hurry back.";
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ } else {
+ if(!questprogress(1240)) {
+ mes "[Shop Helper Leonie]";
+ mes "We'll do the next lesson.";
+ mes "In your future travels.";
+ mes "You will acquire many items in your inventory.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "Among those items, there will be ones that you can't drop or trade, these are for quests. These are important items but often times you will also find them to be a burden.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "In those times, sell what you can to shops in order to decrease your inventory.";
+ mes "I'll give you an example.";
+ mes "Go to a shop to unload it.";
+ next;
+ switch(select("I don't want to do it.", "I will do it.", "Question about the shop.")) {
+ case 1:
+ mes "[Shop Helper Leonie]";
+ mes "Stingy person!";
+ close;
+ case 2:
+ mes "[Shop Helper Leonie]";
+ mes "About shop variety.";
+ mes "You can buy these items everywhere in the world.";
+ mes "Go sell one ^ff0000Poor Can^000000 that I gave you to the shop.";
+ completequest 1239;
+ setquest 1240;
+ getitem 6426,1; // Bad_Can
+ close;
+ case 3:
+ mes "[Shop Helper Leonie]";
+ break;
+ }
+ } else if(questprogress(1240) == 1) {
+ if(!countitem(6426)) {
+ mes "[Shop Helper Leonie]";
+ mes "You went and sold the ^ff0000Poor Can^000000.";
+ mes "Good work, here's the reward for it.";
+ mes "The things I haven't told you, you will learn throughout your travels.";
+ completequest 1240;
+ getitem 12324,10; // N_Butterfly_Wing
+ getexp 1000,50;
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ mes "You are now in trial period.";
+ mes "Go sell the Poor Can and come back after selling it.";
+ next;
+ if(select("I will do it.", "Question about the shop.") == 1) {
+ mes "[Shop Helper Leonie]";
+ mes "About shop variety.";
+ mes "You can buy these items everywhere in the world.";
+ mes "Go sell one ^ff0000Poor Can^000000 that I gave you to the shop.";
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ }
+ }
+ }
+ if(Class != Job_Novice || questprogress(1240) == 2) {
+ mes "[Shop Helper Leonie]";
+ mes "Anything else?";
+ next;
+ if(select("No", "Yes, there are lot.") == 1) {
+ mes "[Shop Helper Leonie]";
+ mes "Goodbye.";
+ mes "The things I haven't told you, you will learn throughout your travels.";
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ }
+ while(1) {
+ mes "What would you like to know?";
+ next;
+ set .@menu$,"Shop types:Currency types:Cash Shop:"+(Class == Job_Novice && !questprogress(1238)?"Experience training.":"No, I know enough.");
+ switch(select(.@menu$)) {
+ case 1:
+ mes "[Shop Helper Leonie]";
+ mes "You can buy weapons and armor at various armory merchants in each town.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "Healing potions and movement consummables can be found at Tool Shops.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "You'll also find merchants selling items for refining.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "So when you go into a town, try figuring out what shops there are for your benefit.";
+ if(questprogress(1237) == 1)
+ completequest 1237;
+ next;
+ mes "[Shop Helper Leonie]";
+ break;
+ case 2:
+ mes "[Shop Helper Leonie]";
+ mes "Kafras and most NPC merchants use ^ff0000Zeny^000000 but Malangdo and some of the Ash Vacuum worlds use different types of currency.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "They are ^ff0000Silvervine Fruit^000000, ^ff0000Splendide Coins^000000, they can be bought at Cash Shop or acquired through quests. The fruits and coins that are collected this way.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "They can be exchanged with unique equipments or gears.";
+ mes "So, if you have plans to venture out to these areas, be sure to collect them.";
+ if(questprogress(1237) == 1)
+ completequest 1237;
+ next;
+ mes "[Shop Helper Leonie]";
+ break;
+ case 3:
+ mes "[Shop Helper Leonie]";
+ mes "The icon on the right side called Cash Shop, if you click on it, whether you're in a town, dungeon, or field, you can still buy items anywhere you want.";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "The cash you need to buy the items can be charged on the website.";
+ if(questprogress(1237) == 1)
+ completequest 1237;
+ next;
+ mes "[Shop Helper Leonie]";
+ break;
+ case 4:
+ if(Class == Job_Novice && !questprogress(1238)) {
+ mes "[Shop Helper Leonie]";
+ mes "Let's do a simple tutorial.";
+ mes "Go to the shop and buy one ^0000ffRed Potion^000000 and bring it back.";
+ mes "You have that much money, right?";
+ next;
+ mes "[Shop Helper Leonie]";
+ mes "If not, go hunt monsters in the vicnity and then when you sell their loot you should make enough money.";
+ next;
+ if(select("That's too tedious.", "I will do it.") == 1) {
+ mes "[Shop Helper Leonie]";
+ mes "Are you that lazy?";
+ mes "I am watching!";
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ mes "Let's go into the next lesson.";
+ mes "Hurry back.";
+ if(questprogress(1237) == 1)
+ completequest 1237;
+ setquest 1238;
+ close;
+ }
+ mes "[Shop Helper Leonie]";
+ mes "That's a relief that you know enough.";
+ mes "If you have more questions, please ask me again.";
+ close;
+ }
+ }
+
+ OnInit:
+ questinfo 1237, QTYPE_QUEST, 0;
+ end;
+}
+
+izlude_a,115,181,5 duplicate(Shop Helper#iz) Shop Helper#iz_a 4_F_KHELLISIA
+izlude_b,115,181,5 duplicate(Shop Helper#iz) Shop Helper#iz_b 4_F_KHELLISIA
+izlude_c,115,181,5 duplicate(Shop Helper#iz) Shop Helper#iz_c 4_F_KHELLISIA
+izlude_d,115,181,5 duplicate(Shop Helper#iz) Shop Helper#iz_d 4_F_KHELLISIA
+
+// - Attribute Expert
+// - Teaches the player about Attributes.
+// -----------------------------------------------------------------------------
+iz_ac01,53,74,3 script Attribute Expert#ac 1_M_WIZARD,{
+ mes "[Attribute Expert]";
+ mes "Are you a new student? Ask me anything if you have questions about atttribute. I am an attribute expert.";
+ next;
+ while(1) {
+ switch(select("What are attributes?", "Harmony of attributes", "Experience of attribute", "End Conversation")) {
+ case 1:
+ mes "[Attribute Expert]";
+ mes "All materials in the world have their own attributes.";
+ next;
+ mes "[Attribute Expert]";
+ mes "There are many types of attributes. There are 4 elemental attributes ^0D6EF2Water^000000, ^006600Wind^000000, ^FF0000Fire^000000, ^B97246Earth^000000.";
+ next;
+ mes "[Attribute Expert]";
+ mes "There are more uncommon ones like... Neutral, Poison, Holy, Dark, Angel, Undead.";
+ mes "There are more types than you think right?";
+ next;
+ mes "[Attribute Expert]";
+ mes "All right, here's the question which attribute do we belong to?";
+ next;
+ if(select("Water", "Wind", "Fire", "Earth", "Neutral", "Poison", "Holy", "Dark", "Angel", "Undead") == 5) {
+ mes "[Attribute Expert]";
+ mes "Correct! You are good. Yes we belong to the Neutral attribute.";
+ next;
+ break;
+ } else {
+ mes "[Attribute Expert]";
+ mes "Do you think so?";
+ mes "We belong to the Neutral.";
+ next;
+ break;
+ }
+ next;
+ mes "[Attribute Expert]";
+ mes "Then, why do we need attributes? Maybe you know the answer... right?";
+ next;
+ break;
+ case 2:
+ mes "[Attribute Expert]";
+ mes "Everything needs to balance with something srong and something weak. So ^3131FFbalance and harmony^000000 comes along all the time.";
+ next;
+ mes "[Attribute Expert]";
+ mes "Balance and harmony is strongly related to your power as well. So remember well.";
+ next;
+ while(1) {
+ switch(select("Water", "Fire", "Earth", "Wind", "Etc...", "I already know")) {
+ case 1:
+ mes "[Attribute Expert]";
+ mes "^0D6EF2Water^000000 is stronger than ^FF0000Fire^000000, so they give bonus damage to anything with Fire attribute!";
+ mes "But it is weak to ^006600Wind^000000.";
+ next;
+ mes "[Attribute Expert]";
+ mes "Examples of monsters with the Water Attribute are Poring and Roda Frog... have you heard of those monsters?";
+ next;
+ continue;
+ case 2:
+ mes "[Attribute Expert]";
+ mes "^FF0000Fire^000000 is stronger than ^B97246Earth^000000, so they give bonus damage to anything with Earth attribute!";
+ mes "Examples of monsters with the Fire Attribute are Drops and Picky.";
+ next;
+ mes "[Attribute Expert]";
+ mes "Examples of monsters with the Fire Attribute are Drops and Picky.";
+ next;
+ continue;
+ case 3:
+ mes "[Attribute Expert]";
+ mes "^B97246Earth^000000 is stronger than ^006600Wind^000000, so they give bonus damage to anything with Wind attribute!";
+ mes "But it is weak to ^FF0000Fire^000000.";
+ next;
+ mes "[Attribute Expert]";
+ mes "Examples of monsters with the Earth Attribute are Pupa and Fabre.";
+ next;
+ continue;
+ case 4:
+ mes "[Attribute Expert]";
+ mes "^006600Wind^000000 is stronger than ^0D6EF2Water^000000, so they give bonus damage to anything with Water attribute!";
+ mes "But it is weak to ^B97246Earth^000000.";
+ next;
+ mes "[Attribute Expert]";
+ mes "Examples of monsters with the Wind Attribute are ChonChon and Hornet.";
+ next;
+ continue;
+ case 5:
+ mes "[Attribute Expert]";
+ mes "^3131FFPoison^000000 is stronger than Fire, Wind, and Earth, but weak at Undead attribute.";
+ next;
+ continue;
+ case 6:
+ mes "[Attribute Expert]";
+ mes "It is important.. Isn't it?";
+ next;
+ break;
+ }
+ break;
+ }
+ break;
+ case 3:
+ if (!questprogress(2299)) {
+ mes "[Attribute Expert]";
+ mes "Do you want to experience an attribute?";
+ next;
+ mes "[Attribute Expert]";
+ mes "All right, do you see those ^3131FFFire Eggs^000000 over there?";
+ mes "Go over there and smack one of them.";
+ mes "Don't worry about destroying it either.";
+ setquest 2299;
+ close;
+ } else if (questprogress(2299) == 1) {
+ mes "[Attribute Expert]";
+ mes "How is it? Have you ever attacked to Fire Eggs?";
+ next;
+ switch(select("Yes", "No", "I want to quit.")) {
+ case 1:
+ mes "[Attribute Expert]";
+ mes "How much damage did you give?";
+ next;
+ input .@input, 1, 100000;
+ if (.@input < 10) {
+ mes "[Attribute Expert]";
+ mes "Oh man, "+.@input+"! Are you even trying?";
+ mes "You're barely hitting it.";
+ next;
+ } else if (.@input > 9 && .@input < 100001) {
+ mes "[Attribute Expert]";
+ mes "You are good I guess...";
+ next;
+ } else {
+ mes "[Attribute Expert]";
+ mes "But wait that's impossible.";
+ close;
+ }
+ mes "[Attribute Expert]";
+ mes "All right. Class is over.";
+ next;
+ mes "[Attribute Expert]";
+ mes "I am not sure if you remember monsters with ^FF0000Fire^000000 are weak against ^0D6EF2Water^000000.";
+ next;
+ mes "[Attribute Expert]";
+ mes "I will give the ^0D6EF2Water^000000 attribute to you as a present.";
+ mes "If you attack the Fire Eggs again you should do more damage now.";
+ next;
+ mes "[Attribute Expert]";
+ mes "There is only one more chance!";
+ mes "Hurry up, the attribute magic will be gone if you take more time thanks for joining to my class.";
+ completequest 2299;
+ // ConsumeSpecialItem 12115
+ if (Class == Job_Novice)
+ getexp 100, 20;
+ close;
+ case 2:
+ mes "[Attribute Expert]";
+ mes "Go and smack those eggs over there.";
+ mes "The egg of an ant is strong so don't worry about destroying them too much.";
+ close;
+ case 3:
+ mes "[Attribute Expert]";
+ mes "There is nothing I can do. But I will help you anytime if you need.";
+ erasequest 2299;
+ close;
+ }
+ } else {
+ mes "[Attribute Expert]";
+ mes "Magic basically consists of different attribute attacks. There is another way of giving the attribute to your weapon by using skill or item. You will learn more the longer you play. Good luck!";
+ close;
+ }
+ break;
+ case 4:
+ mes "[Attribute Expert]";
+ mes "Are you getting interested in the depth of the different attributes?";
+ close;
+ }
+ }
+
+ OnInit:
+ questinfo 2299, QTYPE_NONE, 0;
+ end;
+}
+
+iz_ac01_a,53,74,3 duplicate(Attribute Expert#ac) Attribute Expert#ac_a 1_M_WIZARD
+iz_ac01_b,53,74,3 duplicate(Attribute Expert#ac) Attribute Expert#ac_b 1_M_WIZARD
+iz_ac01_c,53,74,3 duplicate(Attribute Expert#ac) Attribute Expert#ac_c 1_M_WIZARD
+iz_ac01_d,53,74,3 duplicate(Attribute Expert#ac) Attribute Expert#ac_d 1_M_WIZARD
+
+iz_ac01,47,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01,50,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01,53,68,0,0 monster Lv 10 2408,1,5000,0,0
+iz_ac01,56,68,0,0 monster Lv 10 2408,1,5000,0,0
+
+iz_ac01_a,47,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_a,50,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_a,53,68,0,0 monster Lv 10 2408,1,5000,0,0
+iz_ac01_a,56,68,0,0 monster Lv 10 2408,1,5000,0,0
+
+iz_ac01_b,47,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_b,50,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_b,53,68,0,0 monster Lv 10 2408,1,5000,0,0
+iz_ac01_b,56,68,0,0 monster Lv 10 2408,1,5000,0,0
+
+iz_ac01_c,47,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_c,50,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_c,53,68,0,0 monster Lv 10 2408,1,5000,0,0
+iz_ac01_c,56,68,0,0 monster Lv 10 2408,1,5000,0,0
+
+iz_ac01_d,47,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_d,50,68,0,0 monster Lv 10 (Fire) 2413,1,5000,0,0
+iz_ac01_d,53,68,0,0 monster Lv 10 2408,1,5000,0,0
+iz_ac01_d,56,68,0,0 monster Lv 10 2408,1,5000,0,0
+
+// - Dacquoise
+// - Teaches the player about Cooking.
+// -----------------------------------------------------------------------------
+iz_ac01,147,50,3 script Dacquoise#ac 4_COOK,{
+ if (!checkweight(1304, 3)) {
+ mes "Why are you carrying so much stuff?";
+ mes "Put them down and come back.";
+ close;
+ }
+ if (Class == Job_Novice || (questprogress(14154) == 1 || questprogress(14155) == 1 || questprogress(14156) == 1 || questprogress(14157) == 1)) {
+ if (!new_cook) {
+ mes "[Dacquoise]";
+ mes "What an alluring smell!";
+ next;
+ mes "[Eclaire]";
+ mes "Various dishes to stimulate the five senses. Oh, its heaven!";
+ next;
+ mes "[Mille Feuille]";
+ mes "It's not an accident that you came here!";
+ next;
+ mes "[Dacquoise]";
+ mes "What's your name stranger?";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes ""+strcharinfo(0)+", hello.";
+ next;
+ emotion e_no1;
+ mes "[Dacquoise]";
+ mes "I am Dacquoise, the pupil of the legendary chef of Rune Midgard, ^0000cdCharles Orleans^000000.";
+ next;
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "And we are also club members of Sir Orleans' ^0000cdfan club- Loverleans^000000.";
+ next;
+ emotion e_lv,"Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Orlean belongs to all of us!";
+ next;
+ emotion e_sob;
+ mes "[Dacquoise]";
+ mes "Ah, what do all the fools of the land eat?";
+ next;
+ mes "[Dacquoise]";
+ mes "Fruits? Of course you can eat it raw, but isn't it art when you see the red strawberries laying on top of a creampie?";
+ next;
+ mes "[Eclaire]";
+ mes "Bread? Of course you can eat it plain, but can you resist the fantastic harmony of meat and cheese and vegetables in a perfect sandwich?";
+ next;
+ mes "[Mille Feuille]";
+ mes "I like the steamed horse feet of Minourus!";
+ next;
+ mes "[Dacquoise]";
+ mes "If you eat a dedicated meal, you can ^0000cd raise a specific stats^000000 and additionally, ^0000cdrecover your health^000000, so what's the reason not to cook?";
+ next;
+ mes "[Eclaire]";
+ mes "You, do you want to know more about cooking?";
+ next;
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Will you exeprience the various spectrums of cooking?";
+ next;
+ if(select("I'm not interested, excuse me...", "Wow! I want to know more!") == 1) {
+ mes "[Dacquoise]";
+ mes "Really? Okay then... come back whenever you change your mind.";
+ next;
+ mes "[Eclaire]";
+ mes "I have a hunch that you will come back again!";
+ next;
+ mes "[Mille Feuille]";
+ mes "Don't forget to pound your chest if you choke on sweet potato!";
+ close;
+ }
+ emotion e_no1;
+ mes "[Dacquoise]";
+ mes "Ok, we will be kind guides to the journey of cooking!!";
+ next;
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "It's ok with me, asking me everthing you want to know.";
+ next;
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Kindness is our spice~";
+ next;
+ switch(select("Cooking Benefits", "Cooking Methods", "Actually, I have to go...")) {
+ case 1:
+ mes "[Dacquoise]";
+ mes "Aha! You want to know about the benefits of cooking? Cooked meals have two benefits!";
+ next;
+ emotion e_gasp;
+ mes "[Dacquoise]";
+ mes "First, ^0000cdincreased stats!^000000 Baaam!!";
+ next;
+ mes "[Eclaire]";
+ mes "Cooking is divided into 6 catagories. Each will raise up ^0000cdStr, Agi, Vit, Int, Dex, Luk^000000.";
+ next;
+ mes "[Mille Feuille]";
+ mes "The amount of the stat increase changes depending on the level of cooking.";
+ next;
+ emotion e_gasp;
+ mes "[Dacquoise]";
+ mes "And the next benefit? Babam!";
+ next;
+ mes "[Eclaire]";
+ mes "^0000cdHP and SP recovery^000000 effect!";
+ next;
+ mes "[Mille Feuille]";
+ mes "This also differs with cooking levels, and some only recover HP.";
+ next;
+ mes "[Dacquoise]";
+ mes "How is it? Sounds yummy right?";
+ next;
+ mes "[Eclaire]";
+ mes "Your level is too low to experience the effects right now. If you level up more you will experience and cry for the effect of cooking.";
+ next;
+ mes "[Mille Feuille]";
+ mes "Prepare lace handkerchief.";
+ next;
+ select("How can I cook?");
+ mes "[Dacquoise]";
+ mes "There you go! Now you seem interested!";
+ next;
+ mes "[Dacquoise]";
+ mes "But haste is waste in cooking! Proper cooking requires preparation.";
+ next;
+ mes "[Eclaire]";
+ mes "Only the one who is well prepared can enter the world of cooking!";
+ next;
+ mes "[Mille Feuille]";
+ mes "Preparation, it's not hard!";
+ next;
+ mes "[Dacquoise]";
+ mes "Preparation can also be split into two stages.";
+ next;
+ emotion e_gasp;
+ break;
+ case 2:
+ mes "[Dacquoise]";
+ mes "Right, cooking needs some preparation. This can also be divided into two catagories.";
+ next;
+ emotion e_gasp,"Dacquoise#"+strnpcinfo(2);
+ break;
+ case 3:
+ emotion e_an;
+ mes "[Dacquoise]";
+ mes "What is this? What a waste of time!";
+ next;
+ emotion e_ag, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "I thought we were going to get more members!";
+ next;
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Never show up again!!";
+ close;
+ }
+ mes "[Dacquoise]";
+ mes "First, you need a ^0000cdCookbook.^000000";
+ next;
+ mes "[Eclaire]";
+ mes "Let's say you have a mountain of ingredients, but you don't know what to do with them?";
+ next;
+ mes "[Mille Feuille]";
+ mes "That's when you open the Cookbook.";
+ next;
+ mes "[Dacquoise]";
+ mes "You need a Cookbook to know how to prepare the ingredients for cooking.";
+ next;
+ mes "[Eclaire]";
+ mes "So how can I get these Cookbooks?";
+ next;
+ mes "[Mille Feuille]";
+ mes "Cookbook can be earned ^0000cdthrough Quest^000000s or can be found by hunting ^0000cdmonster^000000s.";
+ next;
+ emotion e_gasp;
+ mes "[Dacquoise]";
+ mes "After getting the Cookbook, next preperation is!";
+ mes "The ^0000cdingredients!^000000.";
+ next;
+ mes "[Eclaire]";
+ mes "You can't cook without ingredients! Even a novice knows that!";
+ next;
+ mes "[Mille Feuille]";
+ mes "You can get ingredients by beating or smashing ^0000cdmonster^000000 or you can buy them from a ^0000cdCooking Ingredient Merchant^000000.";
+ next;
+ mes "[Dacquoise]";
+ mes "Cooking requires some preparation but the benefits are well worth it.";
+ next;
+ mes "[Dacquoise]";
+ mes "And one thing to remember, there is ^0000cd a potential to fail in cooking^000000. Be careful as it depends on your cookwares and cooking level.";
+ next;
+ if(new_cook == 1) {
+ select("I want to cook!");
+ mes "[Dacquoise]";
+ mes "That's the spirit! Let's cook for real!";
+ mes "Get prepared and come back!";
+ emotion e_no1;
+ } else {
+ mes "[Eclaire]";
+ mes "We are not responsible even if it fails!";
+ }
+ new_cook = 1;
+ close;
+ } else if (new_cook >= 1) {
+ if(questprogress(14154) == 1 || questprogress(14155) == 1 || questprogress(14156) == 1 || questprogress(14157) == 1) {
+ mes "[Dacquoise]";
+ mes "Did you bring them all?";
+ next;
+ if(select("Yes! I did!", "No, I gave up.") == 2) {
+ mes "[Dacquoise]";
+ mes "I used my valuable time to introduce the cooking world to you.";
+ mes "Then you just give up?";
+ emotion e_an;
+ next;
+ mes "[Eclaire]";
+ mes "You have insulted us!";
+ emotion e_ag, 0, "Eclaire#"+strnpcinfo(2);
+ next;
+ mes "[Mille Feuille]";
+ mes "Come back again, if you want to learn later~ I guess...";
+ emotion e_dots, 0, "Mille Feuille#"+strnpcinfo(2);
+ close2;
+ if(questprogress(14154) == 1)
+ erasequest 14154;
+ if(questprogress(14155) == 1)
+ erasequest 14155;
+ if(questprogress(14156) == 1)
+ erasequest 14156;
+ if(questprogress(14157) == 1)
+ erasequest 14157;
+ end;
+ }
+ mes "[Dacquoise]";
+ mes "Can I have a look?";
+ next;
+ if(questprogress(14154) == 1 && countitem(705) > 0 && countitem(511) > 0 && countitem(507) > 0) {
+ mes "[Dacquoise]";
+ mes "You brough what I need! Okay, then I will cook for you as I promised.";
+ mes "Time to move like greased lightning!!!!";
+ emotion e_flash;
+ next;
+ mes "[Eclaire]";
+ mes "Go hunting after eating this. You will feel your power enhanced.";
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ next;
+ mes "[Mille Feuille]";
+ mes "If you really want to cook, go and see ^0000ffSir. Charles Orleans at the basement of Prontera castle^000000!!";
+ mes "Kya... Sir Orleans!!";
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ close2;
+ delitem 705, 1; // Clover
+ delitem 511, 1; // Green_Herb
+ delitem 507, 1; // Red_Herb
+ getitem 11551, 1; // Savory_Herb_Salad
+ erasequest 14154;
+ end;
+ }
+ if(questprogress(14155) == 1 && countitem(512) > 0 && countitem(515) > 1) {
+ mes "[Dacquoise]";
+ mes "You brough what I need! Okay, then I will cook for you as I promised.";
+ mes "Time to move like greased lightning!!!!";
+ emotion e_flash;
+ next;
+ mes "[Eclaire]";
+ mes "Try this. It will make you run like you are a flying bee.";
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ next;
+ mes "[Mille Feuille]";
+ mes "If you really want to cook, go and see ^0000ffSir. Charles Orleans at the basement of Prontera castle^000000!! You must be attracted by him!!";
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ close2;
+ delitem 512, 1; // Apple
+ delitem 515, 2; // Carrot
+ getitem 11552, 1; // Apple_Carrot_Salad
+ erasequest 14155;
+ end;
+ }
+ if(questprogress(14156) == 1 && countitem(909) > 0 && countitem(914) > 0 && countitem(949) > 0) {
+ mes "[Dacquoise]";
+ mes "You brough what I need! Okay, then I will cook for you as I promised.";
+ mes "Time to move like greased lightning!!!!";
+ emotion e_flash;
+ next;
+ mes "[Eclaire]";
+ mes "Can you feel unknown power coursing through your veins? You're eating it!";
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ next;
+ mes "[Mille Feuille]";
+ mes "If you are really curious about the cooking, go seek Sir. Charles Orleans at the basement of Prontera Castle.";
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ close2;
+ delitem 909, 1; // Jellopy
+ delitem 914, 1; // Fluff
+ delitem 949, 1; // Feather
+ getitem 11553, 1; // Casual_Stew
+ erasequest 14156;
+ end;
+ }
+ if(questprogress(14157) == 1 && countitem(512) > 0 && countitem(705) > 0) {
+ mes "[Dacquoise]";
+ mes "You brough what I need! Okay, then I will cook for you as I promised.";
+ mes "Time to move like greased lightning!!!!";
+ emotion e_flash;
+ next;
+ mes "[Eclaire]";
+ mes "If you eat this. You will never miss your target!";
+ mes "In fact, never miss the target for level 1!";
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ next;
+ mes "[Mille Feuille]";
+ mes "Go and see Sir. Charles Orleans at the basement of Prontera castle!!";
+ mes "You can learn real cooking from him!";
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ close2;
+ delitem 512, 1; // Apple
+ delitem 705, 1; // Clover
+ getitem 11554, 1; // Golden_Roasted_Apple
+ erasequest 14157;
+ end;
+ }
+ mes "[Dacquoise]";
+ mes "What do you want me to do without ingredients? Go and get them myself?";
+ close;
+ }
+ if(new_cook == 2) {
+ mes "[Dacquoise]";
+ mes "You came back to me again because you want to cook, right?";
+ next;
+ mes "[Eclaire]";
+ mes "So what do you want to cook?";
+ next;
+ mes "[Mille Feuille]";
+ mes "Oh? That kid is back again. "+strcharinfo(0)+" right? So what do you want?";
+ next;
+ } else {
+ mes "[Dacquoise]";
+ mes "Are you ready? Then making is believing! Let's cook!";
+ next;
+ mes "[Eclaire]";
+ mes "For this demonstration the duration of the cooking will be shortened.";
+ next;
+ mes "[Mille Feuille]";
+ mes "The cooking we are about to show you requires a recipe and cooking equipment but it is difficult for novices so I will cook for you.";
+ next;
+ emotion e_bzz;
+ mes "[Dacquoise]";
+ mes "Why are you saying you will make them?";
+ next;
+ emotion e_hmm, 0, "Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Ah, Why not?";
+ next;
+ mes "[Dacquoise]";
+ mes "I am the leader of this flame cooking trio chefs!";
+ next;
+ emotion e_omg, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "What?!! When was that decided?";
+ next;
+ emotion e_no;
+ mes "[Dacquoise]";
+ mes "Is there anyone who is older than me?";
+ next;
+ emotion e_omg, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "Age! There is nothing I can do with it.";
+ next;
+ emotion e_ok,"Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "Just because you're one year older, you want to automatically be rejected. Anyone have an objection?";
+ next;
+ emotion e_an;
+ mes "[Dacquoise]";
+ mes "Quiet!";
+ next;
+ mes "[Dacquoise]";
+ mes "So what do you want to make? Int and Luk meals would have no benefit to you, so I prepared the other 4 foods.";
+ next;
+ }
+ switch(select("Fragrant Herb Mix", "Crunchy Salad", "Mixed Shabu Shabu", "Golden Apple Roast")) {
+ case 1:
+ // Fragrant Herb Mix
+ mes "[Dacquoise]";
+ mes "^0000cdFragrant Herb Mix^000000. It increases ^0000cdStr^000000.";
+ next;
+ mes "[Equazu]";
+ mes "It's usually eaten by people of strength.";
+ next;
+ mes "[Mille Feuille]";
+ mes "Ingredients- ^0000cd 1 Clover, 1 Green Herb, 1 Red Herb^000000.";
+ next;
+ cutin "·ç³ªÆ½Ä«µå.bmp", 3;
+ mes "[Dacquoise]";
+ mes "Clover and the Red Herb are dropped by Lunatic or Fabre monsters wandering everywhere on the field outside Izlude.";
+ next;
+ cutin "Æĺ긣īµå.bmp", 3;
+ mes "[Eclaire]";
+ mes "Green Herbs are dropped by Fabres.";
+ next;
+ cutin "", 255;
+ mes "[Mille Feuille]";
+ mes "We can cook once you bring all the ingredients.";
+ close2;
+ new_cook = 2;
+ setquest 14154;
+ end;
+ case 2:
+ // Crunchy Salad
+ mes "[Dacquoise]";
+ mes "Crunchy Salad. This I really like. You know your cooking.";
+ next;
+ mes "[Eclaire]";
+ mes "Crunchy Salad increases ^0000cdAgi^000000. Good for fast attacks and avoiding damage from monsters.";
+ next;
+ mes "[Mille Feuille]";
+ mes "Ingredients are ^0000cd 1 Apple & 2 Carrots^000000.";
+ next;
+ cutin "Æ÷¸µÄ«µå.bmp", 3;
+ mes "[Dacquoise]";
+ mes "Apples are dropped by Porings bouncing around the field outside of Izlude.";
+ next;
+ cutin "·ç³ªÆ½Ä«µå.bmp", 3;
+ mes "[Eclaire]";
+ mes "Carrots are given by Lunatics.";
+ next;
+ cutin "", 255;
+ mes "[Mille Feuille]";
+ mes "If you bring all the ingredients we can cook.";
+ close2;
+ new_cook = 2;
+ setquest 14155;
+ end;
+ case 3:
+ // Mixed Shabu Shabu
+ mes "[Dacquoise]";
+ mes "Scary ^0000cdAnything ShabuShabu!^000000 This raises ^0000cdVit^000000. Even a small portion makes you full.";
+ next;
+ mes "[Eclaire]";
+ mes "If you eat this, you can feel less pain from monsters.";
+ next;
+ mes "[Mille Feuille]";
+ mes "Ingredients are ^0000cd 1 Jellopy, 1 Fluff, 1 Feather^000000.";
+ next;
+ cutin "Æ÷¸µÄ«µå.bmp", 3;
+ mes "[Dacquoise]";
+ mes "Jellopy are dropped by Porings bouncing around the field of Izlude.";
+ next;
+ cutin "Æĺ긣īµå.bmp", 3;
+ mes "[Eclaire]";
+ mes "Fluff can be received from Fabre or Lunatic.";
+ next;
+ cutin "·ç³ªÆ½Ä«µå.bmp", 3;
+ mes "[Mille Feuille]";
+ mes "Feathers are dropped by Lunatics or Fabres.";
+ next;
+ cutin "", 255;
+ mes "[Dacquoise]";
+ mes "When you bring all the ingredients I'll make them for you.";
+ close2;
+ new_cook = 2;
+ setquest 14156;
+ end;
+ case 4:
+ // Golden Apple Roast
+ mes "[Dacquoise]";
+ mes "^0000cdGolden Apple Toast~^000000 shiny golden glaze... It tastes as good as it looks.";
+ next;
+ mes "[Eclaire]";
+ mes "This raises ^0000cdDex^000000. It is mainly enjoyed by Archers who want to increase his attacking power or by people to increase their hit rate.";
+ next;
+ mes "[Mille Feuille]";
+ mes "Ingredients are-^0000cd 1 Apple & 1 Clover^000000.";
+ next;
+ cutin "Æ÷¸µÄ«µå.bmp", 3;
+ mes "[Dacquoise]";
+ mes "Apple can be found in Porings in the field outside of Izlude.";
+ next;
+ cutin "·ç³ªÆ½Ä«µå.bmp", 3;
+ mes "[Eclaire]";
+ mes "Clovers are dropped by Lunatics or Fabre in the field outside Izlude.";
+ next;
+ cutin "", 255;
+ mes "[Mille Feuille]";
+ mes "When you bring all the ingredients I'll make them for you.";
+ close2;
+ new_cook = 2;
+ setquest 14157;
+ end;
+ }
+ } else {
+ emotion e_no1;
+ mes "[Dacquoise]";
+ mes "I am Dacquoise, the pupil of the legendary chef of Rune Midgard, ^0000cdCharles Orleans^000000.";
+ next;
+ emotion e_no1, 0, "Eclaire#"+strnpcinfo(2);
+ mes "[Eclaire]";
+ mes "Steaks not only increase stats but also recover both your HP and SP.";
+ next;
+ emotion e_lv, 0, "Mille Feuille#"+strnpcinfo(2);
+ mes "[Mille Feuille]";
+ mes "If you really want to cook, go and see^0000cd Sir. Charles Orleans at the basement of Prontera castle^000000!! You must be attracted by him!!";
+ close;
+ }
+ } else {
+ mes "[Dacquoise]";
+ mes "Looks like you're no longer a beginner. Are you cooking these days?";
+ next;
+ mes "[Eclaire]";
+ mes "If not why don't we start?";
+ next;
+ mes "[Mille Feuille]";
+ mes "Steaks not only increase stats but also recover both your HP and SP.";
+ next;
+ mes "[Flame Cook Trio Chefs]";
+ mes "If you really want to cook, go and meet ^0000cdSir. Charles Olreans at the basement of the Prontera castle^000000! You must be attracted by him.";
+ close;
+ }
+
+ OnInit:
+ questinfo 14154, QTYPE_QUEST, 1, Job_Novice;
+ questinfo 14155, QTYPE_QUEST, 1, Job_Novice;
+ questinfo 14156, QTYPE_QUEST, 1, Job_Novice;
+ questinfo 14157, QTYPE_QUEST, 1, Job_Novice;
+ end;
+}
+
+iz_ac01_a,147,50,3 duplicate(Dacquoise#ac) Dacquoise#ac_a 4_COOK
+iz_ac01_b,147,50,3 duplicate(Dacquoise#ac) Dacquoise#ac_b 4_COOK
+iz_ac01_c,147,50,3 duplicate(Dacquoise#ac) Dacquoise#ac_c 4_COOK
+iz_ac01_d,147,50,3 duplicate(Dacquoise#ac) Dacquoise#ac_d 4_COOK
+
+// - General Store Owner
+// - Sells the player the Novice Combination Book and Kit.
+// -----------------------------------------------------------------------------
+iz_ac01,68,49,3 script General Store Owner#ac 4_F_03,{
+ if (!checkweight(1304, 3)) {
+ mes "Quest cannot be continued due to the overfilled inventory.";
+ mes "Please try it again after organizing the items.";
+ close;
+ }
+ mes "[Querrie]";
+ mes "Are you interested in the beginner's guild?";
+ mes "I am selling Combination books and kits.";
+ next;
+ mes "[Querrie]";
+ mes "To the Criatura students below level 20, a special sale is going on. Hope you to buy a lot!!!";
+ next;
+ switch(select("Novice Combination Book", "Combination Kit", "Cancel.")) {
+ case 1:
+ if (questprogress(4269) && questprogress(7478)) {
+ mes "[Querrie]";
+ mes "Have you been treated by the Therapist?";
+ mes "At the medical botany class, you may receive a guild book.";
+ next;
+ if(select("Ah... is that so?", "I lost it.") == 1) {
+ mes "[Querrie]";
+ mes "Later, buy a lot of the guild combination kits~~~";
+ mes "I am selling them at a jaw dropping price to students below base level 20.";
+ close;
+ }
+ mes "[Querrie]";
+ mes "Say what?";
+ } else {
+ mes "[Querrie]";
+ mes "You mean the combination book.";
+ }
+ mes "A book costs you 1000z.";
+ next;
+ if(select("Buy", "Don't buy.") == 2) {
+ mes "[Querrie]";
+ mes "Use it next time.";
+ } else {
+ if (Zeny >= 1000) {
+ mes "[Querrie]";
+ mes "Here you are.";
+ mes "This book is for the beginners. But it will allow you combine the useful tools together, if you use it correctly.";
+ Zeny -= 1000;
+ getitem 11058, 1; // Novice_Combi_Book
+ } else {
+ mes "[Querrie]";
+ mes "The book price is 1000 zeny.";
+ mes "You seem to be short of zeny.";
+ }
+ }
+ close;
+ case 2:
+ if(BaseLevel <= 20) {
+ mes "[Querrie]";
+ mes "Breaking news! Special sale for you only!";
+ mes "One combination kit only for 30z!";
+ mes "How many do you need?";
+ } else {
+ mes "[Querrie]";
+ mes "No sales today.";
+ mes "One combination kit costs you 500z.";
+ mes "Tell me how many pieces you need?";
+ }
+ next;
+ input .@input;
+ if(!.@input) {
+ mes "[Querrie]";
+ mes "Well, you don't need to buy it now.";
+ mes "Use it next time.";
+ close;
+ }
+ if(.@input > 99) {
+ mes "[Querrie]";
+ mes "How many pieces do you need?";
+ mes "You can buy up to 99 at once.";
+ close;
+ }
+ set .@cost, .@input * (BaseLevel <= 20 ? 30 : 500);
+ mes "[Querrie]";
+ mes .@input+" combination kits will cost you "+.@cost+".... zeny.";
+ if(Zeny < .@cost) {
+ mes "You look short of money for that amount.";
+ close;
+ }
+ mes "Thank you. Come back again.";
+ Zeny -= .@cost;
+ getitem 12849, .@input; // Combination_Kit
+ close;
+ case 3:
+ close;
+ }
+}
+
+iz_ac01_a,68,49,3 duplicate(General Store Owner#ac) General Store Owner#ac_a 4_F_03
+iz_ac01_b,68,49,3 duplicate(General Store Owner#ac) General Store Owner#ac_b 4_F_03
+iz_ac01_c,68,49,3 duplicate(General Store Owner#ac) General Store Owner#ac_c 4_F_03
+iz_ac01_d,68,49,3 duplicate(General Store Owner#ac) General Store Owner#ac_d 4_F_03
+
+// - Battle Instructor
+// - Gives the player monster hunting quests.
+// -----------------------------------------------------------------------------
+iz_ac01,59,83,3 script Battle Instructor#08 4_M_NOV_HUNT,{
+ if(!checkweight(1201, 1) || (MaxWeight - Weight) < 2000) {
+ mes "- You have too many items.";
+ mes "- Clear inventory and try again.";
+ close;
+ }
+ if(Class == Job_Novice) {
+ if(questprogress(4269) == 2) {
+ if(JobLevel == 10) {
+ mes "[Battle Instructor Subino]";
+ mes "You shouldn't be like this, you are high enough to change your job.";
+ mes "I won't stop you even if you stay still...";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "Try to talk to ^ff0000each job instructor^000000 on the 2nd floor of the Academy if you aren't sure what job you want still.";
+ for(set .@i,0; .@i<6; set .@i,.@i+1) {
+ set .@quest_id,11339+.@i;
+ setarray .@bexp[0],90,90,135,200,0,120;
+ setarray .@jexp[0],50,50,100,175,0,90;
+ setarray .@material[0],909,515,914,939,0,915;
+ setarray .@count[0],5,1,3,3,0,2;
+
+ if(.@quest_id == 11343)
+ continue;
+ if(questprogress(.@quest_id,HUNTING) == 1)
+ erasequest .@quest_id;
+ else if(questprogress(.@quest_id,HUNTING) == 2) {
+ erasequest .@quest_id;
+ if(countitem(.@material[.@i]) >= .@count[i]) {
+ delitem .@material[.@i],.@count[.@i];
+ getexp .@bexp[.@i],.@jexp[.@i];
+ getitem 7059, 1; // Cargo_Free_Ticket
+ }
+ }
+ }
+ close;
+ }
+ mes "[Battle Instructor Subino]";
+ mes "Welcome!";
+ mes "I am ^ff0000Battle Instructor Subino^000000.";
+ mes "I ^ff0000provice a simple request^000000 to help you to grow up as good a soldier as fast as you can, so look around.";
+ next;
+ switch(select("Check requests", "Warp me to the Field", "End Conversation")) {
+ case 1:
+ switch(select("The most delicious in the world (1~3):Carrots are delicious (1~3):Fabre rolling clothes (4~6):Barrier!! (4~6):"+(BaseLevel<7?"":"Buzzing~ (7~10)")+":Stop.")) {
+ case 1:
+ if(!questprogress(11338)) {
+ setquest 11338;
+ completequest 11338;
+ }
+ if(questprogress(11339,HUNTING) < 2) {
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Poring^000000s are very cute monsters when you see them.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "They drop Jellopy which are regarded as a main cooking material in Criatura Academy so we always need to hunt Porings.";
+ next;
+ }
+ callsub L_Quest,11339,90,50,909,5,"Poring","can easily be found","Hunt","Jellopies";
+ case 2:
+ if(!questprogress(11338)) {
+ setquest 11338;
+ completequest 11338;
+ }
+ if(questprogress(11340,HUNTING) < 2) {
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Lunatic^000000s are very cute animal that live near Prontera.";
+ mes "Tender...Soft...Very cute... It is very cute........";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "It always bring ^ff0000Carrot^000000s with it, so it is easy to get a delicious carrot by hunting them.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "A carrot has lots of fibrous cells and contains vitamin A and carotin so it is good for eyes!";
+ next;
+ }
+ callsub L_Quest,11340,90,50,515,1,"Lunatic","is easily found","Catch","Carrot";
+ case 3:
+ if(!questprogress(11338)) {
+ setquest 11338;
+ completequest 11338;
+ }
+ if(questprogress(11341,HUNTING) < 2) {
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Fabre^000000 is the most common bug which is usually seen in Rune Midgard Kingdom..";
+ mes "It is a worm but it is very popular because it looks cute.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "Most of the clothes provided by Criatura Academy are made from ^ff0000Fluff^000000 from Fabres. It makes very strong and warm fabric.";
+ next;
+ }
+ callsub L_Quest,11341,135,100,914,3,"Fabre","is easily found","Hunt","Fluffs";
+ case 4:
+ if(!questprogress(11338)) {
+ setquest 11338;
+ completequest 11338;
+ }
+ if(questprogress(11344,HUNTING) < 2) {
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Pupa^000000 is the intermediate stage of a Fabre before transforming into a Creamy.";
+ mes "The process of a larva turning into a buttefly is mysterious.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "As a Fabre transforms to a Creamy I hope that all Novices turn to be great adventurers! So ^ff0000Chrysalis^000000.";
+ next;
+ }
+ callsub L_Quest,11344,120,90,915,2,"Pupa","is easily found","Hunt","Chrysalises";
+ case 5:
+ if(!questprogress(11338)) {
+ setquest 11338;
+ completequest 11338;
+ }
+ if(questprogress(11342,HUNTING) < 2) {
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Hornet^000000s are a group of bees that live near Prontera under control of the Queen bee Mistress.";
+ mes "Not aggressive... They only attack with their stingers when they are in danger.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "There is a study about using the poison extracted from their stingers to make an antidote in Criatura Academy.";
+ next;
+ }
+ callsub L_Quest,11342,200,175,939,3,"Hornet","are found","Hunt","Bee Stings";
+ case 6:
+ mes "[Battle Instructor Subino]";
+ mes "You don't seem to be interested.";
+ mes "Come back again if you change your mind.";
+ close;
+ }
+ case 2:
+ mes "[Battle Instructor Subino]";
+ mes "Ok, I'll send you to the West field of Izlude.";
+ mes "Be sure you know how to get back.";
+ close2;
+ warp "prt_fild"+strnpcinfo(2), 344, 213;
+ end;
+ case 3:
+ mes "[Battle Instructor Subino]";
+ mes "You don't seem to be interested.";
+ mes "Come back again if you change your mind.";
+ close;
+ }
+ }
+ mes "[Battle Instructor Subino]";
+ mes "You didn't register with the ^ff0000Criatura Academy^000000 yet?";
+ mes "It requires a simple procedure so go and register.";
+ mes "You can register at the ^ff0000information center of academy^000000.";
+ close;
+ } else {
+ mes "[Battle Instructor Subino]";
+ mes "You don't seem to need my help.";
+ mes "You'd better look around somewhere else or go to the wider world.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "Visit the ^ff0000support of the class guild (Lv. 10~20) or check out the Eden Group (Lv. 15~100)^000000.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "^ff0000Ask the staff of each job on the second floor about the location of each class guild^000000 and you will find the ^ff0000Eden Group Headquarters^000000 where you can find easy hunt quests.";
+ next;
+ mes "[Battle Instructor Subino]";
+ mes "It is ^ff0000displayed in the map of right screen^000000, so search for it.";
+ mes "If you do not know, then you should get a help from a ^ff0000Town Guide^000000.";
+ close;
+ }
+
+ L_Quest:
+ if(!questprogress(getarg(0),HUNTING)) {
+ if(select("Take quest.", "Stop.") == 2) {
+ mes "[Battle Instructor Subino]";
+ mes "You don't seem to be interested.";
+ mes "Come back again if you change your mind.";
+ close;
+ }
+ mes "[Battle Instructor Subino]";
+ if(getarg(0) == 11342) {
+ mes getarg(5)+"s "+getarg(6)+" in ^ff0000West field of Prontera^000000.";
+ mes getarg(5)+"s are difficult to catch for a Novice... But if you gather more Novices, you can do it.";
+ next;
+ mes "[Battle Instructor Subino]";
+ } else
+ mes getarg(5)+" "+getarg(6)+" at the ^ff0000West field of Izlude^000000.";
+ mes getarg(7)+" ^ff0000"+(getarg(0)==11344?"5":"10")+" "+getarg(5)+"s^000000 and bring ^ff0000"+getarg(4)+" "+getarg(8)+"^000000.";
+ mes "You can check received quests by pressing ^ff0000Alt + U^000000.";
+ setquest getarg(0);
+ close;
+ } else if(questprogress(getarg(0),HUNTING) == 1) {
+ if(select("End Conversation", "Give up on the quest.") == 2) {
+ mes "[Battle Instructor Subino]";
+ mes "Will you really give up on the quest?";
+ next;
+ if(select("End Conversation", "Give up for sure.") == 2) {
+ mes "[Battle Instructor Subino]";
+ mes "You can challenge the quest as long as you need my help so come to me anytime.";
+ erasequest getarg(0);
+ }
+ }
+ close;
+ } else {
+ if(countitem(getarg(3)) < getarg(4)) {
+ mes "[Battle Instructor Subino]";
+ mes "You don't have enough ^ff0000"+getarg(8)+"^000000.";
+ mes "Do better!";
+ next;
+ if(select("End Conversation", "Give up on the quest.") == 2) {
+ mes "[Battle Instructor Subino]";
+ mes "Will you really give up on the quest?";
+ next;
+ if(select("End Conversation", "Yes, give up.") == 2) {
+ mes "[Battle Instructor Subino]";
+ mes "You can challenge the quest as long as you need my help so come to me anytime.";
+ erasequest getarg(0);
+ }
+ }
+ close;
+ }
+ mes "[Battle Instructor Subino]";
+ mes "Wow..!!";
+ mes "Well done!!";
+ erasequest getarg(0);
+ delitem getarg(3), getarg(4);
+ getexp getarg(1), getarg(2);
+ getitem 7059, 1; // Cargo_Free_Ticket
+ close;
+ }
+
+ OnInit:
+ //questinfo QTYPE_QUEST,4269,2,0,0,1,0,EAJ_NOVICE;
+ end;
+}
+
+iz_ac01_a,59,83,3 duplicate(Battle Instructor#08) Battle Instructor#08a 4_M_NOV_HUNT
+iz_ac01_b,59,83,3 duplicate(Battle Instructor#08) Battle Instructor#08b 4_M_NOV_HUNT
+iz_ac01_c,59,83,3 duplicate(Battle Instructor#08) Battle Instructor#08c 4_M_NOV_HUNT
+iz_ac01_d,59,83,3 duplicate(Battle Instructor#08) Battle Instructor#08d 4_M_NOV_HUNT
+
+// - Adept Adventurer
+// - Teaches the player about Pets.
+// -----------------------------------------------------------------------------
+iz_ac01,45,80,5 script Adept Adventurer#ac 4_M_JOB_BLACKSMITH,{
+ if (questprogress(2298) > 1) {
+ mes "[Adept Adventurer]";
+ mes "Any questions about getting a monster to become a pet?";
+ next;
+ while(1) {
+ switch(select("Taming a monster", "Hatching the egg", "Monitoring pet's status", "Feeding", "Performances", "Removing the accessory", "Transforming back to egg", "End Conversation")) {
+ case 1:
+ mes "[Adept Adventurer]";
+ mes "Only some monsters can become pets and they all have different things to tame them.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Each monster that can be tamed requires a specific ^3131FFtaming item^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "To begin taming,";
+ mes "^3131FFdouble click^000000 the taming item in your inventory and select which monster to tame.";
+ cutin "pet_ex_01.bmp", 3;
+ next;
+ mes "[Adept Adventurer]";
+ mes "Press ^3131FFClick^000000 in the center of the pop-up slot machine to tame the monster..";
+ cutin "pet_ex_02.bmp", 3;
+ next;
+ cutin "", 255;
+ mes "[Adept Adventurer]";
+ mes "If successful, the monster will be tranformed into an egg!";
+ next;
+ break;
+ case 2:
+ mes "[Adept Adventurer]";
+ mes "Hatching requires you to have a ^3131FF<Pet Incubator>^000000 to awaken a monster in the egg.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Most towns have a ^3131FF<Pet Groomer>^000000 where you can buy the ^3131FF<Pet Incubator>^000000.";
+ mes "Ask the town guide for the location of the Pet Groomer if you can't find them.";
+ next;
+ break;
+ case 3:
+ mes "[Adept Adventurer]";
+ mes "^3131FFRight-click^000000 on your pet and select ^3131ffCheck the Pet Status^000000 to check on its status. Or you can press ^3131FF<Alt+J>^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "This will open up the Status Window. Here you can change the pet's ^3131FFname^000000 as well as check their ^3131FFHunter^000000 and ^3131FFIntimacy^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "There are some special pets that gives special skills when their ^3131FFIntimacy^000000 level becomes Loyal. Most pets start off as shy and time and food changes that.";
+ next;
+ break;
+ case 4:
+ mes "[Adept Adventurer]";
+ mes "<Pet Food> is normal food for pets but some pets prefer other foods. You should keep enough with you so your pet doesn't get hungry.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Pets will ^3131FFrun away^000000 if they are too full or too hungry. So make sure you check your pets hunger status frequently!";
+ next;
+ break;
+ case 5:
+ mes "[Adept Adventurer]";
+ mes "Some pets will show a special performance when they are in a good mood.";
+ next;
+ break;
+ case 6:
+ mes "[Adept Adventurer]";
+ mes "Some pets can even wear accessory items.";
+ mes "^3131FF<Pet Groomer>^000000 will sell some pet accessory items but some monsters will also drop pet accessory items as well.";
+ next;
+ break;
+ case 7:
+ mes "[Adept Adventurer]";
+ mes "I think it is better off experiencing more together than transforming back to the eggs?";
+ next;
+ break;
+ case 8:
+ mes "[Adept Adventurer]";
+ mes "Come back again when you have another question.";
+ close;
+ }
+ }
+ }
+ if (!questprogress(2293)) {
+ mes "[Adventurer's Pet]";
+ mes "I am hungry~ Feed me first, then let's walk around~";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Calm down now, here you go!";
+ next;
+ mes "[Adventurer's Pet]";
+ mes "Phew, it was good. I'm full.";
+ next;
+ if(select("A talking monster!", "Ignore it.") == 2) {
+ mes "[Adept Adventurer]";
+ mes "Pets make the best companions for lonely journeys...";
+ close;
+ }
+ mes "[Adept Adventurer]";
+ mes "Once it was a dangerous monster, now it is my closest friend. This is my ^3131FFpet^000000 which is called as Debbie Ruchi.";
+ next;
+ if(select("What is a pet?", "End Conversation") == 2) {
+ mes "[Adventurer's Pet]";
+ mes "Yawn~ I am bored to death!";
+ close;
+ }
+ mes "[Adept Adventurer]";
+ mes "Well they're loyal ^3131FFmonster^000000s that stand by your side.";
+ next;
+ select("Does it help you fight?");
+ mes "[Adept Adventurer]";
+ mes "It doesn't help me battle but it helps by giving me bonus ^3131FFstats^000000 and other bonus effects.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "All these things are possible when ^3131FFIntimacy^000000 with your pet is very high.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Intimacy requires a time commitment and a lot of food. Food is the way to any being's loyalty right? ha ha";
+ next;
+ if(select("How do I get a pet?", "End Conversation") == 2) {
+ mes "[Adept Adventurer]";
+ mes "Pets make the best companions for lonely journeys...";
+ close;
+ }
+ mes "[Adept Adventurer]";
+ mes "Do you need a pet?";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Hmm then let's go to the Academy Gardens together!";
+ mes "I'll show you how it's done.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Talk to me when you are ready to go to the garden!";
+ setquest 2293;
+ close;
+ } else {
+ mes "[Adept Adventurer]";
+ mes "Shall we go to the garden of Criatura Academy?";
+ next;
+ if(select("Send me now!", "Stay") == 1) {
+ mes "[Adept Adventurer]";
+ mes "All right, come this way.";
+ close2;
+ warp "new_1-3", 95, 171;
+ end;
+ }
+ mes "[Adept Adventurer]";
+ mes "If you want, I will guide you anytime.";
+ close;
+ }
+
+ OnInit:
+ questinfo 2298, QTYPE_QUEST, 0;
+ end;
+}
+
+iz_ac01_a,45,80,5 duplicate(Adept Adventurer#ac) Adept Adventurer#ac_a 4_M_JOB_BLACKSMITH
+iz_ac01_b,45,80,5 duplicate(Adept Adventurer#ac) Adept Adventurer#ac_b 4_M_JOB_BLACKSMITH
+iz_ac01_c,45,80,5 duplicate(Adept Adventurer#ac) Adept Adventurer#ac_c 4_M_JOB_BLACKSMITH
+iz_ac01_d,45,80,5 duplicate(Adept Adventurer#ac) Adept Adventurer#ac_d 4_M_JOB_BLACKSMITH
+
+// - Adventurer's Pet
+// -----------------------------------------------------------------------------
+iz_ac01,43,80,7 script Adventurer's Pet#ac 4_DEVIRUCHI,{
+ end;
+
+ OnTimer60000:
+ switch(rand(1, 4)) {
+ case 1:
+ npctalk "Yawn~ I am so bored!";
+ break;
+ case 2:
+ npctalk "Red Potion.. Is it delicious? Herb does not look delicious.. I bet that is bitter.";
+ break;
+ case 3:
+ npctalk "Ha. You are lucky to have this Devi.";
+ break;
+ case 4:
+ npctalk "Isn't the floor cold? Well.. For me, Undead is more familiar.";
+ break;
+ }
+
+ initnpctimer;
+ end;
+
+ OnInit:
+ initnpctimer;
+ end;
+}
+
+iz_ac01_a,43,80,7 duplicate(Adventurer's Pet#ac) Adventurer's Pet#ac_a 4_DEVIRUCHI
+iz_ac01_b,43,80,7 duplicate(Adventurer's Pet#ac) Adventurer's Pet#ac_b 4_DEVIRUCHI
+iz_ac01_c,43,80,7 duplicate(Adventurer's Pet#ac) Adventurer's Pet#ac_c 4_DEVIRUCHI
+iz_ac01_d,43,80,7 duplicate(Adventurer's Pet#ac) Adventurer's Pet#ac_d 4_DEVIRUCHI
+
+// - Monster Spawn
+// -----------------------------------------------------------------------------
+new_1-3,0,0,0,0 monster Little Poring 2398,30,50000,0,0
+
+// - Adept Adventurer (Cont...)
+// - Teaches the player about Pets.
+// -----------------------------------------------------------------------------
+new_1-3,92,169,5 script Adept Adventurer#new_1-3 4_M_JOB_BLACKSMITH,{
+ if (questprogress(2298) == 2) {
+ mes "[Adept Adventurer]";
+ mes "Any questions about the cute pet?";
+ next;
+ while(1) {
+ switch(select("Taming a monster", "Hatching the egg", "Monitoring pet's status", "Feeding", "Performances", "Removing the accessory", "Transforming back to egg", "End Conversation")) {
+ case 1:
+ mes "[Adept Adventurer]";
+ mes "Only some monsters can become pets and they all have different things to tame them.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Each monster that can be tamed requires a specific ^3131FFtaming item^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "To begin taming,";
+ mes "^3131FFdouble click^000000 the taming item in your inventory and select which monster to tame.";
+ cutin "pet_ex_01.bmp", 3;
+ next;
+ mes "[Adept Adventurer]";
+ mes "Press ^3131FFClick^000000 in the center of the pop-up slot machine to tame the monster..";
+ cutin "pet_ex_02.bmp", 3;
+ next;
+ cutin "", 255;
+ mes "[Adept Adventurer]";
+ mes "If successful, the monster will be tranformed into an egg!";
+ next;
+ break;
+ case 2:
+ mes "[Adept Adventurer]";
+ mes "Hatching requires you to have a ^3131FF<Pet Incubator>^000000 to awaken a monster in the egg.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Most towns have a ^3131FF<Pet Groomer>^000000 where you can buy the ^3131FF<Pet Incubator>^000000.";
+ mes "Ask the town guide for the location of the Pet Groomer if you can't find them.";
+ next;
+ break;
+ case 3:
+ mes "[Adept Adventurer]";
+ mes "^3131FFRight-click^000000 on your pet and select ^3131ffCheck the Pet Status^000000 to check on its status. Or you can press ^3131FF<Alt+J>^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "This will open up the Status Window. Here you can change the pet's ^3131FFname^000000 as well as check their ^3131FFHunter^000000 and ^3131FFIntimacy^000000.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "There are some special pets that gives special skills when their ^3131FFIntimacy^000000 level becomes Loyal. Most pets start off as shy and time and food changes that.";
+ next;
+ break;
+ case 4:
+ mes "[Adept Adventurer]";
+ mes "<Pet Food> is normal food for pets but some pets prefer other foods. You should keep enough with you so your pet doesn't get hungry.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Pets will ^3131FFrun away^000000 if they are too full or too hungry. So make sure you check your pets hunger status frequently!";
+ next;
+ break;
+ case 5:
+ mes "[Adept Adventurer]";
+ mes "Some pets will show a special performance when they are in a good mood.";
+ next;
+ break;
+ case 6:
+ mes "[Adept Adventurer]";
+ mes "Some pets can even wear accessory items.";
+ mes "^3131FF<Pet Groomer>^000000 will sell some pet accessory items but some monsters will also drop pet accessory items as well.";
+ next;
+ break;
+ case 7:
+ mes "[Adept Adventurer]";
+ mes "I think it is better off experiencing more together than transforming back to the eggs?";
+ next;
+ break;
+ case 8:
+ mes "[Adept Adventurer]";
+ mes "Come back again when you have another question.";
+ close;
+ }
+ }
+ }
+ if (!questprogress(2293)) {
+ mes "[Adept Adventurer]";
+ mes "You can return to the Academy through the portal to the north.";
+ close;
+ } else if (questprogress(2293) == 1) {
+ mes "[Adept Adventurer]";
+ mes "Would you look at that...Porings growing in the garden of the closed Criatura Academy like little Jelly Babies.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Not all monsters in Rune Midgards are our for your blood, just most of them.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Take a look at that, looks like that ^3131FFPoring^000000 has something to say to you";
+ completequest 2293;
+ setquest 2294;
+ close;
+ } else {
+ if (questprogress(2296) == 1) {
+ mes "[Adept Adventurer]";
+ mes "If you are confused, Please check the quest status by pressing ^3131FF<Alt+U>^000000 anytime.";
+ next;
+ if(select("How to gain Unripe Apples", "End Conversation") == 1) {
+ mes "[Adept Adventurer]";
+ mes "You'd want to go to the Dispensary to learn how to make ^3131FFUnripe Apple^000000s.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "One of the staff there should have a ^3131FFItem compounding book^000000 for novices, ^3131FFHow to make Unripe Apples^000000 is one of the subjects.";
+ close;
+ }
+ }
+ if (questprogress(2297) == 1) {
+ mes "[Adept Adventurer]";
+ mes "So you used the taming item on the Little Porings, then they turned into eggs?";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Ha ha ha, don't fret my pet.";
+ mes "You just cleared ^3131FFtaming^000000.";
+ next;
+ select("Taming?");
+ mes "[Adept Adventurer]";
+ mes "Yep, it means you are ready to be a friend like me and Debbie Ruchi.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "There are lots of different monsters and tames out there.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "If you successfully tame it you end up with a little egg.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "So congratulations again for passing the test, the friendship test!";
+ mes "Ask anytime whenever you have a question about cute pets.";
+ next;
+ mes "[Adept Adventurer]";
+ mes "Do you see the shivering poring over there? Go easy on the lil' blighter, okay?";
+ completequest 2297;
+ setquest 2298;
+ close;
+ }
+ mes "[Adept Adventurer]";
+ mes "If you are confused, Please check the quest status by clicking ^3131FF<Alt+U>^000000 anytime.";
+ close;
+ }
+}
+
+// - Friendly Poring
+// -----------------------------------------------------------------------------
+new_1-3,99,169,3 script Friendly Poring#ac 4_PORING,{
+ if (!checkweight(1301, 3)) {
+ mes "[Poring]";
+ mes "You have too many items to continue the quest.";
+ next;
+ mes "[Poring]";
+ mes "Open inventory with ^3131FFAlt+E^000000 key, if you find unnecessaty items, sell them to ^3131FFmerchant^000000 or put into ^3131FFwarehouse^000000 by using kafra service~.";
+ close;
+ }
+ if (!questprogress(2294)) {
+ mes "[Poring]";
+ mes "Help me novice...";
+ close;
+ } else if (questprogress(2294) == 1) {
+ mes "[Poring]";
+ mes "Dear oh dear...what do we have 'ere?";
+ next;
+ if(select("What happend?", "Ignore him/it?") == 2) {
+ mes "[Poring]";
+ mes "Oh dear, oh dear...";
+ close;
+ }
+ mes "[Poring]";
+ mes "Wot a sad state of affairs.";
+ next;
+ mes "[Poring]";
+ mes "That geeza' ghostring got defeated out in his dungeon and came here to pick on other monsters like me.";
+ next;
+ mes "[Poring]";
+ mes "I'm too low level to stop 'im, you can hear them cheering now...";
+ next;
+ mes "[Ghostring]";
+ mes "Oi you lot! Tell me wot I want to hear!";
+ emotion e_gasp, 0, "Ghostring#cupet";
+ next;
+ mes "[Unskilled Poring]";
+ mes "Ghostring's the strongest in the world!";
+ emotion e_paper, 0, "Cowardly Poring#pet_1";
+ emotion e_paper, 0, "Unskilled Poring#pet_2";
+ emotion e_paper, 0, "Foolish Poring#pet_3";
+ next;
+ mes "[Ghostring]";
+ mes "What kind of monster I am?";
+ emotion e_gasp, 0, "Ghostring#cupet";
+ next;
+ mes "[Unskilled Poring]";
+ mes "Ghostring's da Boss!";
+ emotion e_paper, 0, "Cowardly Poring#pet_1";
+ emotion e_paper, 0, "Unskilled Poring#pet_2";
+ emotion e_paper, 0, "Foolish Poring#pet_3";
+ next;
+ mes "[Ghostring]";
+ mes "Bwa ha ha ha~";
+ emotion e_heh, 0, "Ghostring#cupet";
+ next;
+ emotion e_sob, 0, "Friendly Poring#ac";
+ mes "[Poring]";
+ mes "Bleedin' shame...";
+ mes "Little Porings takin' up with a git like that and not bein' cute anymore.";
+ next;
+ mes "[Poring]";
+ mes "The Little Porings aren't bad'uns, they've just not been to the outside world.";
+ next;
+ mes "[Poring]";
+ mes "If this keeps up, all of the Porings in Rune Midgard'll be under the sway of Ghostring.";
+ next;
+ if(select("Can I help you?", "Too bad.") == 2) {
+ mes "[Poring]";
+ mes "Oh dear, oh dear.....";
+ close;
+ }
+ mes "[Poring]";
+ mes "Now that you mention it sir, I could use some help.";
+ next;
+ mes "[Unskilled Poring]";
+ mes "Wot's Dat? Onna them Poring's talkin' to a huumie.";
+ mes "Shall we beat him up?";
+ emotion e_paper, 0, "Cowardly Poring#pet_1";
+ emotion e_paper, 0, "Unskilled Poring#pet_2";
+ emotion e_paper, 0, "Foolish Poring#pet_3";
+ next;
+ mes "[Poring]";
+ mes "Blimey!";
+ mes "Help me! Save me!";
+ emotion e_omg, 0, "Friendly Poring#ac";
+ next;
+ select("What can I do to help?");
+ mes "[Poring]";
+ mes "I do have a good idea!";
+ mes "Come over here!";
+ completequest 2294;
+ setquest 2295;
+ close;
+ } else if (questprogress(2295) == 1) {
+ mes "[Poring]";
+ mes "This is ^3131FFunripe apple^000000.";
+ mes "The favorite items for Little Poring to eat.";
+ next;
+ mes "[Poring]";
+ mes "Maybe you can use it to tempt them away from listenin' to Ghostring.";
+ next;
+ mes "[Poring]";
+ mes "^3131FFDouble click the unripe apple^000000 that I gave you and ^3131FFselect^000000 a ^3131FFLittle Poring^000000 that you fancy.";
+ cutin "pet_ex_01.bmp", 3;
+ next;
+ mes "[Poring]";
+ mes "TThe click the centre of the slot machine.";
+ cutin "pet_ex_02.bmp", 3;
+ next;
+ mes "[Poring]";
+ mes "That'll lure them from out of Ghostring's influence.";
+ cutin "", 255;
+ completequest 2295;
+ setquest 2296;
+ getitem 12846, 5; // Little_Unripe_Apple
+ close;
+ } else if (questprogress(2296) == 1) {
+ if (countitem(9062) > 0) {
+ mes "[Poring]";
+ mes "Ello' mate. Were you successful? Where are the lil' bleeders?";
+ next;
+ select("Show eggs");
+ mes "[Poring]";
+ mes "Steady on now guv'na...";
+ mes "What did you do to Unskilled Poring!?!? Novice!!!!!!";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "I used the unripe apples that you gave me, then they turned into eggs.";
+ next;
+ emotion e_sob, 0, "Friendly Poring#ac";
+ mes "[Poring]";
+ mes "Oh, guess I didn't expect they'd be turned into pets so easily!";
+ next;
+ mes "["+strcharinfo(0)+"]";
+ mes "Yeah, don't worry, I'll make sure to";
+ mes "give them a good home.";
+ completequest 2296;
+ setquest 2297;
+ close;
+ } else {
+ mes "[Poring]";
+ mes "^3131FFDouble click the unripe apple^000000 that I gave you and ^3131FFselect^000000 your preferred ^3131FFLittle Poring^000000.";
+ cutin "pet_ex_01.bmp", 3;
+ next;
+ mes "[Poring]";
+ mes "The all you have to do is ^3131FF click ^0000 the middle of the slot machine.";
+ cutin "pet_ex_02.bmp", 3;
+ next;
+ mes "[Poring]";
+ mes "It may fail, but keep trying to lure way those Little Porings!";
+ close;
+ }
+ } else if (questprogress(2297) == 1) {
+ mes "[Poring]";
+ mes "Have you ever heard about the changes of a novice from adept adventurer?";
+ close;
+ } else if (questprogress(2298) == 1) {
+ mes "[Poring]";
+ mes "Unripe Apples are the item to tame.";
+ mes "It will only work on the Little Porings hopping around.";
+ next;
+ mes "[Poring]";
+ mes "If you're going to make them a cute pet...";
+ mes "You must take care of your Little Poring!";
+ next;
+ select("What?");
+ mes "[Poring]";
+ mes "Even before that Ghostring came here, the Little Porings were kind of cowardly.";
+ next;
+ mes "[Poring]";
+ mes "Since they've never been out in the real world, sort of like human novices.";
+ next;
+ mes "[Poring]";
+ mes "You're just starting out on your adventure, right? You will visit many towns and meet many people and encounter the frightful Boss Monsters.";
+ next;
+ mes "[Poring]";
+ mes "Won't you consider taking one of these chavs with you?";
+ next;
+ mes "[Poring]";
+ mes "They're smeggin' talkative, but they'll be loyal friends!";
+ next;
+ mes "[Poring]";
+ mes "I'd say that the ^31311F Adept adventurer ^000000 knows lots of things about pets, so you can ask him about your new Little Poring Friend.";
+ next;
+ mes "[Poring]";
+ mes "By the way, you should have a ^3131FFportable egg incubator ^000000.";
+ mes "It was dropped by a careless ^3131FFPet Groomer^000000 traveling through.";
+ next;
+ mes "[Poring]";
+ mes "I will also give you the Little Poring's favorite ^3131FFapple juice^000000, so make sure that it stays fed all the time!";
+ next;
+ mes "[Poring]";
+ mes "Oi, Little Poring.";
+ mes "I look forward to seeing you once you've explored Rune Midgards!";
+ mes "Cheers mate.";
+ completequest 2298;
+ if (Class == Job_Novice)
+ getexp 500, 50;
+ getitem 531, 3; // Apple_Juice
+ getitem 643, 1; // Pet_Incubator
+ close;
+ } else {
+ mes "[Poring]";
+ mes "Take good care of your Little Poring. Ask the adept adventurer if you have any questions about cute pets!";
+ close;
+ }
+}
+
+// - Ghostring
+// -----------------------------------------------------------------------------
+new_1-3,108,165,3 script Ghostring#cupet 4_GHOSTRING,{
+ mes "[Ghostring]";
+ mes "I am da biggest and da meanest Ghostring!";
+ close;
+}
+
+// - Little Porings
+// -----------------------------------------------------------------------------
+new_1-3,105,165,5 script Cowardly Poring#pet_1 LITTLE_PORING,{ end; }
+new_1-3,105,164,5 script Unskillful Poring#pet_2 LITTLE_PORING,{ end; }
+new_1-3,105,163,5 script Foolish Poring#pet_3 LITTLE_PORING,{ end; }
+
+// - Kafra Guide Trainer
+// - Teaches the player about Kafra Services.
+// -----------------------------------------------------------------------------
+iz_ac01,95,46,5 script Kafra Guide Trainer#ac 4_F_KAFRA1,{
+ cutin "kafra_01.bmp", 2;
+ if (questprogress(4269) == 2) {
+ mes "[Kafra Guide Trainer]";
+ mes "Welcome, Kafra service is always close to your heart";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "For those who are using the Kafra service for the first time.";
+ mes "Kafra service offers thorough information rundown~!";
+ next;
+ while(1) {
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Tell us what you would like to know";
+ mes "about the Kafra service~!";
+ next;
+ switch(select("Saving", "Storage Service", "Teleport Service", "Use of Pushcart Service", "Check Other Information", "Cancel")) {
+ case 1:
+ mes "[Kafra Guide Trainer]";
+ mes "Save service is for when you ^8B4513die in battle^000000 or use an item like ^8B4513Butterfly Wings^000000, you will be sent back to your Save Location.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Easy to understand~?";
+ mes "You want to try the Save service~?";
+ next;
+ if(select("No", "Yes")) {
+ mes "[Kafra Guide Trainer]";
+ mes "Don't be afraid of it~!";
+ mes "Save service doesn't swallow you.";
+ mes "If you change your mind, you would better try it definitely~!";
+ } else {
+ mes "[Kafra Guide Trainer]";
+ mes "Well~ then, for now, ^8B4513Izlude Square^000000 where the Criatura Academy is located will be saved as your save point~!.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Voila~!";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "It's already done. Easy huh?";
+ savepoint "izlude", 128, 98;
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Now, when you use a ^006400Butterfly Wing^000000, it will send you to the last saved location.";
+ }
+ break;
+ case 2:
+ mes "[Kafra Guide Trainer]";
+ mes "Storage service is a place where you can safely store your items.";
+ mes "Your items can be accessed by all characters in your account.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "To use the storage, you need to be over Novice Job Level 6 and higher.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "For a small fee, most Kafra Employees will let you open your storage.";
+ mes "You can even buy Kafra Cards from the Item Mall to open storage from anywhere!";
+ mes "Do you want to use the storage?";
+ next;
+ if(select("No", "Yes")) {
+ mes "[Kafra Guide Trainer]";
+ mes "Storage is necessary for you to survive so use it regularly.";
+ } else {
+ if (getskilllv("NV_BASIC") < 6) {
+ mes "[Kafra Guide Trainer]";
+ mes "To use the storage, you need to be raised the beginner level 6 and higher.";
+ } else if (countitem(7059) || Zeny >= 500) {
+ if (countitem(7059)) {
+ delitem 7059, 1; // Cargo_Free_Ticket
+ } else {
+ Zeny -= 500;
+ RESRVPTS += 5;
+ }
+ mes "[Kafra Guide Trainer]";
+ mes "I'll open the storage~.";
+ mes "Thanks for using~!";
+ close2;
+ cutin "", 255;
+ openstorage;
+ end;
+ } else {
+ mes "[Kafra Guide Trainer]";
+ mes "Dear customer, you don't have enough money~!";
+ mes "You need 500 zeny to use the storage~!";
+ }
+ }
+ break;
+ case 3:
+ mes "[Kafra Guide Trainer]";
+ mes "Teleport service is a service that sends you to various locations throughout Rune Midgard.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Different Kafra Employees have different teleport locations to send you to so you need to talk to them to find out where they're teleporting to.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Ok, so for educational purposes I'm offering a free teleport service here at the Academy.";
+ mes "Why don't you try it out?~!";
+ next;
+ if(select("No", "Yes")) {
+ mes "[Kafra Guide Trainer]";
+ mes "You afraid of having your cells spliced or something? Don't worry this is perfectly safe~!";
+ mes "This is an essential service~";
+ mes "So, you better get used to it ok?";
+ break;
+ } else {
+ switch(select("Academy 1st floor Great Hall", "Academy 2nd floor Principal's Office", "Izlude southern entrance", "Use later")) {
+ case 1:
+ cutin "", 255;
+ warp "iz_ac01", 97, 86;
+ end;
+ case 2:
+ cutin "", 255;
+ warp "iz_ac02", 101, 36;
+ end;
+ case 3:
+ mes "[Kafra Guide Trainer]";
+ mes "This will take you to the outside of the Criatura Academy, is that ok?";
+ mes "If you want to come back to the academy, find the entrance to the north of Izlude.";
+ next;
+ if(select("No", "Yes")) {
+ mes "[Kafra Guide Trainer]";
+ mes "You afraid of having your cells spliced or something? Don't worry this is perfectly safe~!";
+ break;
+ } else {
+ cutin "", 255;
+ warp "izlude", 128, 98;
+ end;
+ }
+ break;
+ case 4:
+ mes "[Kafra Guide Trainer]";
+ mes "You afraid of having your cells spliced or something? Don't worry this is perfectly safe~!";
+ break;
+ }
+ }
+ break;
+ case 4:
+ mes "[Kafra Guide Trainer]";
+ mes "Pushcart service is used for those who have the job ^8B4513Merchant^000000.";
+ mes "To rent a Pushcart Merchants pay a small zeny fee and that's it.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "If you aren't a Merchant class or if you haven't learned the Cart Skill then you can't use this Kafra service.";
+ break;
+ case 5:
+ mes "[Kafra Guide Trainer]";
+ mes "Among the other services we provide, there is a Customer point service system from Kafra!";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Every time you use a Kafra Service you get Special Reserve Points~";
+ mes "You can use these points at the Kafra Headquarters in Aldebaran to trade for certain items.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "Here, I'll show you how many Special Reserve Points you currently have.";
+ next;
+ if(select("Check Special Reserve Points.", "Cancel") == 2) {
+ mes "[Kafra Guide Trainer]";
+ mes "Even later~~!!";
+ mes "Please check your accumulated customer points~!";
+ } else {
+ mes "[Kafra Guide Trainer]";
+ mes ""+strcharinfo(0)+", your accummulated points are "+RESRVPTS+" points.";
+ next;
+ mes "[Kafra Guide Trainer]";
+ mes "You can exchange your";
+ mes "Special Reserve Points for";
+ mes "rewards at the Kafra Main Office in Al De Baran. Please use our";
+ mes "convenient services to see the benefits of our rewards program.";
+ }
+ break;
+ case 6:
+ mes "[Kafra Guide Trainer]";
+ mes "Our Kafra service is doing our best to give you the best satisfaction that you deserve as a customer.";
+ mes "Thanks for using us.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ mes "[Kafra Guide Trainer]";
+ mes "First, you need to complete your^8B4513 registration^000000 at the Academy's front desk.";
+ mes "If you go to the first floor,";
+ mes "there'll be someone";
+ mes "to take your registration.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+}
+
+iz_ac01_a,95,46,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#ac_a 4_F_KAFRA1
+iz_ac01_b,95,46,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#ac_b 4_F_KAFRA1
+iz_ac01_c,95,46,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#ac_c 4_F_KAFRA1
+iz_ac01_d,95,46,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#ac_d 4_F_KAFRA1
+
+iz_ac01,89,103,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#01 4_F_KAFRA1
+iz_ac01_a,89,103,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#01_a 4_F_KAFRA1
+iz_ac01_b,89,103,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#01_b 4_F_KAFRA1
+iz_ac01_c,89,103,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#01_c 4_F_KAFRA1
+iz_ac01_d,89,103,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#01_d 4_F_KAFRA1
+
+iz_ac02,101,176,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#02 4_F_KAFRA1
+iz_ac02_a,101,176,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#02_a 4_F_KAFRA1
+iz_ac02_b,101,176,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#02_b 4_F_KAFRA1
+iz_ac02_c,101,176,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#02_c 4_F_KAFRA1
+iz_ac02_d,101,176,5 duplicate(Kafra Guide Trainer#ac) Kafra Guide Trainer#02_d 4_F_KAFRA1
+
+// =============================================================================
+// = Miscellaneous NPCS
+// =============================================================================
+
+// - Wedding Secretary
+// - Teaches the player about in-game Marriage & Adoption mechanics.
+// -----------------------------------------------------------------------------
+izlude,102,150,5 script Wedding Secretary#iz 1_F_LIBRARYGIRL,{
+ if (Class == Job_Novice) {
+ mes "[Wedding Secretary]";
+ mes "You are the just a beginner.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Everything looks new and unfamiliar, doesn't it? Isn't it all exiciting?";
+ next;
+ mes "[Wedding Secretary]";
+ mes "What can be a more exciting start than a marriage in your life?";
+ next;
+ } else {
+ mes "[Wedding Secretary]";
+ mes "Are you in love?";
+ next;
+ }
+ mes "[Wedding Secretary]";
+ mes "I am the Wedding Secretary sent here for those people wanting to join their lives to another.";
+ next;
+ while(1) {
+ mes "[Wedding Secretary]";
+ mes "Please ask anything you are concerned with about marriage!";
+ next;
+ switch(select("How to get married.", "Benefits of marriage", "Adoption", "Shut up!")) {
+ case 1:
+ mes "[Wedding Secretary]";
+ mes "Concluding the ceremony between two lovers is really the most beautiful and special event in one's life.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "However, being together requires several procedures.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "First, the two of you wishing to get married have to be at least base level ^0000cd45^000000 or higher, meaning you should be at the level responsible for your life and your finances.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Next, you need to prepare some tokens of appreciation. Men need a ^0000cdTuxedo^000000 Ladies need a ^0000cdWedding Dress^000000 and both need to have ^0000cdDiamond Ring^000000s as the symbol of everlasting love.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "You will also need to provide a fee of ^0000cd1 million Zeny^000000.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Having prepared all of these things, you must create a party with just the two of you and go to the ^0000cdProntera Cathedral^000000.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "There, another ^0000cdWedding Secretary^000000 like me is wating for you. When you speak to her, she will give more details of what to do.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "I hope that you will meet a great fiance and enjoy a happy marriage!";
+ next;
+ break;
+ case 2:
+ mes "[Wedding Secretary]";
+ mes "To say the least, the benefit of marriage is being together forever!";
+ next;
+ mes "[Wedding Secretary]";
+ mes "After the wedding ceremony, you can enjoy a sweet honeymoon at the ^0000cdJawaii^000000 resort only for you.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "And, upon marriage you will both get a ^0000cd special skill^000000.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Two of these skills are called ^0000cdLoving Touch^000000 and ^0000cdUndying Love^000000 which are used to sacrifice HP or SP and send it to your partner.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "But among them, the skill called ^0000cdRomantic Rendezvous^000000 is the most romantic one, enabling you to summon your partner to you from anywhere in the world.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Aren't these skill great? Don't you want to get married right now?";
+ next;
+ break;
+ case 3:
+ mes "[Wedding Secretary]";
+ mes "Being together is wonderful but people without experience of it in the past couldn't understand the full Euphoria of being a parent.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Married couple can adopt other characters as their children.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "^0000cdKids of extended jobs such as Taekwon boy/girl, Gunslinger or Ninja can't be adopted^000000.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "And any prospecting parents need to be at least base level ^0000cd70^000000, meaning you should be at the level responsible enough to be parents.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Having made a family, ^0000cdaSkill to be used among the family^000000 will be earned.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "There is another skill enables you to concrete your bond such as being able to summon your child when you miss them or not losing your earned level if you die during battle.";
+ next;
+ mes "[Wedding Secretary]";
+ mes "Cute charms coming from your kid is a bonus~";
+ next;
+ break;
+ case 4:
+ emotion e_omg;
+ mes "[Wedding Secretary]";
+ mes "Your mother didn't teach you right?";
+ mes "Mercy on you. You are ignorant of the beauty of love!!!";
+ close;
+ }
+ }
+}
+
+izlude_a,102,150,5 duplicate(Wedding Secretary#iz) Wedding Secretary#iz_a 1_F_LIBRARYGIRL
+izlude_b,102,150,5 duplicate(Wedding Secretary#iz) Wedding Secretary#iz_b 1_F_LIBRARYGIRL
+izlude_c,102,150,5 duplicate(Wedding Secretary#iz) Wedding Secretary#iz_c 1_F_LIBRARYGIRL
+izlude_d,102,150,5 duplicate(Wedding Secretary#iz) Wedding Secretary#iz_d 1_F_LIBRARYGIRL
+
+// - Mom
+// -----------------------------------------------------------------------------
+izlude,95,146,5 script Mom#iz 4_F_CAVE1,{
+ mes "[Mom]";
+ mes "Honey~~~";
+ next;
+ mes "[Dad]";
+ mes "Yep~~";
+ next;
+ mes "[Mom]";
+ mes "Did you see Etinifni playing at the backyard?";
+ next;
+ mes "[Dad]";
+ mes "Nope~~";
+ next;
+ emotion e_an;
+ mes "[Mom]";
+ mes "He's out again? Never stays in the house!! Shall I use it?";
+ next;
+ mes "[Dad]";
+ mes "Leave him alone~ He may be playing somewhere.";
+ next;
+ emotion e_an;
+ mes "[Mom]";
+ mes "You spoil him too much!";
+ next;
+ mes "[Mom]";
+ mes "^0000cd[Come to me, honey~]^000000";
+ next;
+ enablenpc "Etinifni#"+strnpcinfo(2);
+ specialeffect EF_PORTAL, AREA, "Etinifni#"+strnpcinfo(2);
+ mes "[Etinifni]";
+ mes "What's up? Where am I?";
+ next;
+ mes "[Mom]";
+ mes "Here!";
+ next;
+ emotion e_ag, 0, "Etinifni#"+strnpcinfo(2);
+ mes "[Etinifni]";
+ mes "Ah... Again!! I have been out hunting Orcs.";
+ next;
+ mes "[Mom]";
+ mes "I told you stop hunting! Go and buy us milk!";
+ next;
+ mes "[Etinifni]";
+ mes "Why am I just your errand boy? Go, get me a brother!";
+ next;
+ mes "[Mom]";
+ mes "What? This moron?!";
+ next;
+ emotion e_sigh, 0, "Etinifni#"+strnpcinfo(2);
+ mes "[Etinifni]";
+ mes "OK. I will do it.";
+ next;
+ disablenpc "Etinifni#"+strnpcinfo(2);
+ emotion e_sob, 0, "Dad#"+strnpcinfo(2);
+ mes "[Dad]";
+ mes "I am sorry... Dad has no power over your mom.";
+ close;
+}
+
+izlude_a,95,146,5 duplicate(Mom#iz) Mom#iz_a 4_F_CAVE1
+izlude_b,95,146,5 duplicate(Mom#iz) Mom#iz_b 4_F_CAVE1
+izlude_c,95,146,5 duplicate(Mom#iz) Mom#iz_c 4_F_CAVE1
+izlude_d,95,146,5 duplicate(Mom#iz) Mom#iz_d 4_F_CAVE1
+
+// - Dad
+// -----------------------------------------------------------------------------
+izlude,97,147,3 script Dad#iz 1_M_JOBGUIDER,{
+ mes "[Dad]";
+ mes "Got this boy ten years ago after years of childlessness.";
+ next;
+ mes "[Dad]";
+ mes "He is the apple of my eyes to me, but my wife is too strict on him.";
+ next;
+ mes "[Dad]";
+ mes "So, I am always worrying if the only son might be spoiled.";
+ next;
+ mes "[Dad]";
+ mes "Maybe all parents worry?";
+ close;
+}
+
+izlude_a,97,147,3 duplicate(Dad#iz) Dad#iz_a 1_M_JOBGUIDER
+izlude_b,97,147,3 duplicate(Dad#iz) Dad#iz_b 1_M_JOBGUIDER
+izlude_c,97,147,3 duplicate(Dad#iz) Dad#iz_c 1_M_JOBGUIDER
+izlude_d,97,147,3 duplicate(Dad#iz) Dad#iz_d 1_M_JOBGUIDER
+
+// - Etinifni
+// -----------------------------------------------------------------------------
+izlude,97,144,1 script Etinifni#iz 4_M_DEWBOY,{
+ mes "[Etinifni]";
+ mes "Once you have time, come to Orc Dungeon!";
+ close;
+
+ OnInit:
+ disablenpc "Etinifni#"+strnpcinfo(2);
+ end;
+}
+
+izlude_a,97,144,1 duplicate(Etinifni#iz) Etinifni#iz_a 4_M_DEWBOY
+izlude_b,97,144,1 duplicate(Etinifni#iz) Etinifni#iz_b 4_M_DEWBOY
+izlude_c,97,144,1 duplicate(Etinifni#iz) Etinifni#iz_c 4_M_DEWBOY
+izlude_d,97,144,1 duplicate(Etinifni#iz) Etinifni#iz_d 4_M_DEWBOY
+
+// - Romantic Male
+// -----------------------------------------------------------------------------
+izlude,99,138,3 script Romantic Male#iz 4_M_SITDOWN,{
+ emotion e_ho;
+ mes "[Romantic Male]";
+ mes "Let's go~~ together hand in hand~~ Put everything aside ~~ in the dark blue night of Jawaii~~ under the stars~~";
+ next;
+ mes "[Romantic Male]";
+ mes "We are leaving for Jawaii-the place of our honeymoon to celebrate our 10th wedding anniversary!";
+ next;
+ emotion e_lv;
+ mes "[Romantic Male]";
+ mes "Are you lifting up our good old memories renting my wedding dress and your tuxedo!! It will strenghthen our relationship, won't it?";
+ next;
+ specialeffect EF_HEARTCASTING, AREA, "Romantic Female#"+strnpcinfo(2);
+ emotion e_kis, 0, "Romantic Female#"+strnpcinfo(2);
+ mes "[Romantic Male]";
+ mes "Honey~~ I love you!! Sweetheart~";
+ next;
+ emotion e_kis2;
+ mes "[Romantic Male]";
+ mes "No!! I love you more than you do!!";
+ close;
+}
+
+izlude_a,99,138,3 duplicate(Romantic Male#iz) Romantic Male#iz_a 4_M_SITDOWN
+izlude_b,99,138,3 duplicate(Romantic Male#iz) Romantic Male#iz_b 4_M_SITDOWN
+izlude_c,99,138,3 duplicate(Romantic Male#iz) Romantic Male#iz_c 4_M_SITDOWN
+izlude_d,99,138,3 duplicate(Romantic Male#iz) Romantic Male#iz_d 4_M_SITDOWN
+
+// - Romantic Female
+// -----------------------------------------------------------------------------
+izlude,97,138,5 script Romantic Female#iz 4_F_SITDOWN,{
+ mes "[Romantic Female]";
+ mes "Shout like this when I miss you, honey!!";
+ next;
+ emotion e_lv, 0, "Romantic Female#"+strnpcinfo(2);
+ mes "[Romantic Female]";
+ mes "^0000cd[I miss you.]^000000";
+ next;
+ mes "[Romantic Female]";
+ mes "Then, you run towards me leaving everything behind,~ don't you?";
+ next;
+ mes "[Romantic Female]";
+ mes "I will definitely do as you call me!!";
+ next;
+ mes "[Romantic Female]";
+ mes "You are tired of sitting, aren't you?";
+ next;
+ specialeffect EF_HEARTCASTING, AREA, "Romantic Female#"+strnpcinfo(2);
+ emotion e_kis, 0, "Romantic Female#"+strnpcinfo(2);
+ mes "[Romantic Female]";
+ mes "My sweetheart!!! I love you!!!";
+ next;
+ mes "[Romantic Male]";
+ mes "Yes, thank you for sharing your SP! You are also tired, aren't you?";
+ next;
+ specialeffect EF_HEARTCASTING, AREA, "Romantic Male#"+strnpcinfo(2);
+ emotion e_kis2, 0, "Romantic Male#"+strnpcinfo(2);
+ mes "[Romantic Male]";
+ mes "My sweetheart!! I love you!!!";
+ next;
+ emotion e_lv, 0, "Romantic Female#"+strnpcinfo(2);
+ mes "[Romantic Female]";
+ mes "Kia~ You are Coolest!!!";
+ close;
+}
+
+izlude_a,97,138,5 duplicate(Romantic Female#iz) Romantic Female#iz_a 4_F_SITDOWN
+izlude_b,97,138,5 duplicate(Romantic Female#iz) Romantic Female#iz_b 4_F_SITDOWN
+izlude_c,97,138,5 duplicate(Romantic Female#iz) Romantic Female#iz_c 4_F_SITDOWN
+izlude_d,97,138,5 duplicate(Romantic Female#iz) Romantic Female#iz_d 4_F_SITDOWN
+
+// - Manufacturing Maniac
+// -----------------------------------------------------------------------------
+izlude,93,143,3 script Manufacturing Maniac#0 -1,{
+ mes "[Manufacturing Maniac]";
+ mes "Hi~! I am an Alchemist.";
+ mes "It's one of the second jobs after Merchant.";
+ next;
+ mes "[Manufacturing Maniac]";
+ mes "I am making a potion.";
+ mes "I came to izlude to make potions at a quiet place.";
+ mes "I feel that quiet places help to increase the rate of success.";
+ mes "I am feeling good!";
+ close;
+
+ OnTimer30000:
+ .@npc_potion = rand(1,2);
+ if (.@npc_potion == 1) {
+ emotion e_no1;
+ specialeffect EF_PHARMACY_OK;
+ } else {
+ emotion e_omg;
+ specialeffect EF_PHARMACY_FAIL;
+ }
+ end;
+
+ OnTimer35000:
+ stopnpctimer;
+
+ OnInit:
+ initnpctimer;
+ end;
+}
+
+izlude_a,93,143,3 duplicate(Manufacturing Maniac#0) Manufacturing Maniac#a 2_M_ALCHE
+izlude_b,93,143,3 duplicate(Manufacturing Maniac#0) Manufacturing Maniac#b 2_M_ALCHE
+izlude_c,93,143,3 duplicate(Manufacturing Maniac#0) Manufacturing Maniac#c 2_M_ALCHE
+izlude_d,93,143,3 duplicate(Manufacturing Maniac#0) Manufacturing Maniac#d 2_M_ALCHE
+
+// - Repairing Blacksmith
+// -----------------------------------------------------------------------------
+izlude,147,131,5 script Repairing Blacksmith#0 4_F_JOB_BLACKSMITH,5,7,{
+ mes "[Working Blacksmith]";
+ mes "The guy sitting over there has been staring at Wagzak. I was told that only one knife is left after losing all weapons?";
+ next;
+ mes "[Working Blacksmith]";
+ mes "He can use safe refining... I don't understand why he takes such risks.";
+ close;
+
+ OnTouch:
+ specialeffect EF_REPAIRWEAPON;
+ end;
+}
+
+izlude_a,147,131,5 duplicate(Repairing Blacksmith#0) Repairing Blacksmith#a 4_F_JOB_BLACKSMITH,5,7
+izlude_b,147,131,5 duplicate(Repairing Blacksmith#0) Repairing Blacksmith#b 4_F_JOB_BLACKSMITH,5,7
+izlude_c,147,131,5 duplicate(Repairing Blacksmith#0) Repairing Blacksmith#c 4_F_JOB_BLACKSMITH,5,7
+izlude_d,147,131,5 duplicate(Repairing Blacksmith#0) Repairing Blacksmith#d 4_F_JOB_BLACKSMITH,5,7
+
+// - Refining Maniac
+// -----------------------------------------------------------------------------
+izlude,148,122,5 script Refining Maniac#iz 4_M_SITDOWN,{
+ mes "[Refining Maniac]";
+ mes "Shh...! Be quiet.";
+ mes "I am focusing on ^3131FFrefining^000000.";
+ next;
+ if(select("What is refining?", "Good luck.") == 2) {
+ mes "[Refining Maniac]";
+ mes "Come on.. Co..me on...!!";
+ close;
+ }
+ mes "[Refining Maniac]";
+ mes "Some equipment except some specific ones can be enhanced by ^3131FFrefining^000000.";
+ next;
+ mes "[Refining Maniac]";
+ mes "Weapons get increased ^3131FFAttack Power^000000, so the more you refine them the stronger they become.";
+ next;
+ mes "[Refining Maniac]";
+ mes "Each weapon level has a different refining safe point. So it's important to pay attention when refining.";
+ mes "If you break it you lose it.";
+ next;
+ mes "[Refining Maniac]";
+ mes "I'm trying to get to +10 right now... All my training is for this!";
+ next;
+ mes "[Refining Maniac]";
+ mes "Please ask to the owner of refining, I have a important mission +10!";
+ close;
+}
+
+izlude_a,148,122,5 duplicate(Refining Maniac#iz) Refining Maniac#iz_a 4_M_SITDOWN
+izlude_b,148,122,5 duplicate(Refining Maniac#iz) Refining Maniac#iz_b 4_M_SITDOWN
+izlude_c,148,122,5 duplicate(Refining Maniac#iz) Refining Maniac#iz_c 4_M_SITDOWN
+izlude_d,148,122,5 duplicate(Refining Maniac#iz) Refining Maniac#iz_d 4_M_SITDOWN
+
+// - Otter Samssoon
+// - Allows the player to change their hair style and color once.
+// -----------------------------------------------------------------------------
+iz_ac01,69,36,3 script Otter Samssoon#ac 4W_SAILOR,{
+ mes "[Otter Samssoon]";
+ mes "Welcome~";
+ mes "I am Samssoon~! I am a royal hair designer otter sent to academy.";
+ next;
+ mes "[Otter Samssoon]";
+ mes "If you take ^ff0000Criatura Hair Coupon^000000, they change your hairstyle for free! So do not miss this ^ff0000once in a lifetime^000000 chance~";
+ next;
+ switch(select("Read style book.", "Change hair style.", "How to get a coupon", "Stop.")) {
+ case 1:
+ mes "[Otter Samssoon]";
+ mes "Oh my~ I am sure any hair style will suit you! You really have a good style~";
+ mes "There are many styles so pick ^ff0000from page 1 to 19^000000.";
+ mes "If you want to stop, say 0.";
+ next;
+ input .@style;
+ if(.@style > 19) {
+ mes "[Otter Samssoon]";
+ mes "Oh my!!? Honey~ You can use a coupon for the hair style in here~";
+ close;
+ } else if(!.@style) {
+ mes "[Otter Samssoon]";
+ mes "Did you decide? Which style??";
+ mes "I want to touch your hair with my hands~ Honey~";
+ close;
+ } else {
+ callsub L_cutin, .@style;
+ mes "[Otter Samssoon]";
+ switch(.@style) {
+ case 1:
+ if(Sex) {
+ mes "Oh my!!? 'Play Dead' cut?";
+ mes "This looks neat and relaxed.. So popular style.";
+ } else {
+ mes "Oh my!!? 'First Aid' cut?";
+ mes "This is and adorable style.";
+ mes "I guess it looks good on you too!!";
+ }
+ break;
+ case 2:
+ if(Sex) {
+ mes "Oh my!!? 'Two Handed Sword Mastery' cut?";
+ mes "You... You know the famous D..? He has exactly the same style!";
+ } else {
+ mes "Oh my!!? 'Bash' cut?";
+ mes "This style gives strong curls on both side hair.";
+ }
+ break;
+ case 3:
+ if(Sex) {
+ mes "Oh my!!? 'Napalm Beat' cut?";
+ mes "It has well arranges hair line that makes feel charisma.";
+ } else {
+ mes "Oh my!!? 'Frost Diver' cut?";
+ mes "It is mysterious style that gives cold and warm feeling at the same time.";
+ }
+ break;
+ case 4:
+ if(Sex) {
+ mes "Oh my!!? 'Double Strafe' cut?";
+ mes "Natural hair is shaking by wind.. Clean and good feeling.";
+ } else {
+ mes "Oh my!!? 'Arrow Shower' cut?";
+ mes "Cool and nice shaggy cut makes good style.";
+ }
+ break;
+ case 5:
+ if(Sex) {
+ mes "Oh my!!? 'Angelus' cut?";
+ mes "Calm and piety feeling.. Not boring style.";
+ } else {
+ mes "Oh my!!? 'Heal' cut?";
+ mes "Feminine style give healing feeling.";
+ }
+ break;
+ case 6:
+ if(Sex) {
+ mes "Oh my!!? 'Push Cart' cut?";
+ mes "Big Kar is motivated for this style with a romance of a man.";
+ } else {
+ mes "Oh my!!? 'Vending' cut?";
+ mes "Royal ladies like this style. Make good money style.";
+ }
+ break;
+ case 7:
+ if(Sex) {
+ mes "Oh my!!? 'Envenom' cut?";
+ mes "Tough style makes addicted.";
+ } else {
+ mes "Oh my!!? 'Double Attack' cut?";
+ mes "Whoever will dash twice for this style.";
+ mes "Ponytail is important.";
+ }
+ break;
+ case 8:
+ if(Sex) {
+ mes "Oh my!!? 'Bowling Bash' cut?";
+ mes "This style makes a nice guy to challenge.";
+ mes "Just a giving a glance can steal the heart.";
+ } else {
+ mes "Oh my!!? 'Gloria' cut?";
+ mes "This style is ultimately gorgeous and graceful.";
+ }
+ break;
+ case 9:
+ if(Sex) {
+ mes "Oh my!!? 'Venom Dust' cut?";
+ mes "This style has special ending line that looks fatal.";
+ } else {
+ mes "Oh my!!? 'SP Recovery' cut?";
+ mes "This style has neat cutting that inspires.";
+ }
+ break;
+ case 10:
+ if(Sex) {
+ mes "Oh my!!? 'Turn Undead' cut?";
+ mes "This style is like a cold city man who is strong enough to kill a monster.";
+ } else {
+ mes "Oh my!!? 'Prepare Potion' cut?";
+ mes "This style has a liquid medicine motive so it makes feel cure.";
+ }
+ break;
+ case 11:
+ if(Sex) {
+ mes "Oh my!!? 'Dragonology' cut?";
+ mes "This style is intelligent style of mysterious dragon.";
+ } else {
+ mes "Oh my!!? 'Grand Cross' cut?";
+ mes "Well trimmed hair cut line gives trust.";
+ }
+ break;
+ case 12:
+ if(Sex) {
+ mes "Oh my!!? 'Mace Mastery' cut?";
+ mes "Look fresh and look neat with wax treatment.";
+ } else {
+ mes "Oh my!!? 'Intimidate' cut?";
+ mes "This style is very familiar.";
+ }
+ break;
+ case 13:
+ if(Sex) {
+ mes "Oh my!!? 'Thunder Storm' cut?";
+ mes "This style has natural attractive perm which is like hitting by thunder storm.";
+ } else {
+ mes "Oh my!!? 'Spiritual Sphere";
+ mes "Calm and a little bit looks like a boy cut draw attention.";
+ }
+ break;
+ case 14:
+ if(Sex) {
+ mes "Oh my!!? 'Encore' cut?";
+ mes "Rocker's favorite style.. Even the name itself..";
+ } else {
+ mes "Oh my!!? 'Gypsy's Kiss' cut?";
+ mes "The hair.. Kind to everyone.. Neat and round hair line is very soft and charming.";
+ }
+ break;
+ case 15:
+ if(Sex) {
+ mes "Oh my!!? 'Grimtooth' cut?";
+ mes "The style with edge.";
+ } else {
+ mes "Oh my!!? 'Counter Attack' cut?";
+ mes "It is the style that looks cold and arrogant. Hard to talk to..";
+ mes "But might be nice to boyfriend..?";
+ }
+ break;
+ case 16:
+ if(Sex) {
+ mes "Oh my!!? 'Blitz Beat' cut?";
+ mes "It is the style my senior invented after he broke up with his girlfriends 5 times.";
+ } else {
+ mes "Oh my!!? 'Anke Snare' cut?";
+ mes "It is killing style.. No one can take eyes off!";
+ }
+ break;
+ case 17:
+ if(Sex) {
+ mes "Oh my!!? 'Find Ore' cut?";
+ mes "This style seems to bring encounter or find unexpected things while walking on the street.";
+ } else {
+ mes "Oh my!!? 'Hammer Fall' cut?";
+ mes "Stunning hair with attraction.";
+ }
+ break;
+ case 18:
+ if(Sex) {
+ mes "Oh my!!? 'Fire Pillar' cut?";
+ mes "Everyone used to have this hair style.. Which means that was a trend of an era.";
+ } else {
+ mes "Oh my!!? 'Jupitel Thunder'";
+ mes "Fresh style by giving light waves on both side hairs.";
+ }
+ break;
+ case 19:
+ if(Sex) {
+ mes "Oh my!!? 'Guillotine Fist'";
+ mes "It is like one-shot style.. Like a real man. Right?";
+ } else {
+ mes "Oh my!!? 'Whirlwind' cut?";
+ mes "It is cool style which flows with wind. Lah, lah, lah, lah ~";
+ }
+ break;
+ }
+ close2;
+ cutin "", 255;
+ end;
+ }
+ close;
+ case 2:
+ if(!countitem(6593)) {
+ mes "[Otter Samssoon]";
+ mes "Come on.. Honey~";
+ mes "You should bring ^ff0000'Criatura Hair Coupon'^000000 for changing hair...";
+ close;
+ }
+ mes "[Otter Samssoon]";
+ mes "Honey~ What style do you want?";
+ mes "You are totally my style. So I am very excited~~";
+ mes "Pick the style from page 1 to 19.";
+ next;
+ input .@style;
+ if(.@style > 19) {
+ mes "[Otter Samssoon]";
+ mes "Come on.. Honey~ You can use a coupon for the hair style in here~";
+ close;
+ } else if(!.@style) {
+ mes "[Otter Samssoon]";
+ mes "Oh my!!? You do not want to?";
+ close;
+ } else if(getlook(1) == .@style) {
+ mes "[Otter Samssoon]";
+ mes "Come on.. Honey~ That is the same style you have.";
+ mes "Do you want to try something new?";
+ close;
+ }
+ callsub L_cutin, .@style;
+ mes "[Otter Samssoon]";
+ mes "Style ("+.@style+")?";
+ mes "It feels like this.. How is it?";
+ next;
+ if(select("Good.", "No.") == 1) {
+ if(!getlook(6)) {
+ mes "[Otter Samssoon]";
+ mes "Right!";
+ mes "Honey! What about dying hair as well?";
+ mes "Dying hair also included in this service.";
+ next;
+ switch(select("Passionate Red:Sweet Yellow:Fatal Purple:Glamourous Orange:Comfortable Green:Clear Blue:Transparent White:Dark Black:Stop.")) {
+ case 1:
+ .@pallete = 8;
+ break;
+ case 2:
+ .@pallete = 1;
+ break;
+ case 3:
+ .@pallete = 2;
+ break;
+ case 4:
+ .@pallete = 3;
+ break;
+ case 5:
+ .@pallete = 4;
+ break;
+ case 6:
+ .@pallete = 5;
+ break;
+ case 7:
+ .@pallete = 6;
+ break;
+ case 8:
+ .@pallete = 7;
+ break;
+ case 9:
+ mes "[Otter Samssoon]";
+ mes "No?";
+ mes "Do you need more time? If you want to keep the same color, then select the same one.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ nude;
+ mes "[Otter Samssoon]";
+ mes "Relax, it is almost done~";
+ next;
+ mes "[Otter Samssoon]";
+ mes "- Sha sha shak shak shak -";
+ mes "- Chikak, crack, crack.. -";
+ mes "- Snap, snap, snap.. Crack -";
+ next;
+ delitem 6593, 1; // Criatura_Hair_Coupon
+ cutin "", 255;
+ mes "[Otter Samssoon]";
+ mes "Oh my! Oh my! Oh my!";
+ mes "This hair style no.("+.@style+") suits to you looks good~";
+ mes "What do you think?";
+ setlook 1, .@style;
+ setlook 6, .@pallete;
+ next;
+ mes "[Otter Samssoon]";
+ mes "I want to take care of your style..";
+ mes "But I have no choice to select customers because I belong to here.";
+ next;
+ mes "[Otter Samssoon]";
+ mes "For changing to new style, ^ff0000Alberta or Lighthalzen^000000.";
+ mes "For dying hair, ^ff0000Prontera or Lighthalzen^000000.";
+ close;
+ }
+ mes "[Otter Samssoon]";
+ mes "Honey~ You don't like it?";
+ mes "Ahem.. Do you want to read style book again?";
+ mes "Take your time and tell me when you decide~ Okay?~";
+ close;
+ case 3:
+ mes "[Otter Samssoon]";
+ mes "You can receive ^ff0000criatura hair coupon^000000 from ^ff0000academy receptionist for novice at academy front desk or eden group^000000";
+ next;
+ mes "[Otter Samssoon]";
+ mes "They don't give you for free.. Well..";
+ mes "The equipment you had received when you arrived at academy?";
+ mes "They change ^ff0000egg shell for novice^000000 to coupon?";
+ next;
+ mes "[Otter Samssoon]";
+ mes "This service has started since I came here. So.. No free service if you have no coupon~";
+ close;
+ case 4:
+ mes "[Otter Samssoon]";
+ mes "Oh my!!? Honey, you are not going to change hair?";
+ mes "You look nice now rough style.";
+ close;
+ }
+
+ L_cutin:
+ if(Sex) {
+ if(getarg(0) < 10)
+ cutin "hair_m_0"+getarg(0),4;
+ else
+ cutin "hair_m_"+getarg(0),4;
+ } else {
+ if(getarg(0) < 10)
+ cutin "hair_f_0"+getarg(0),4;
+ else
+ cutin "hair_f_"+getarg(0),4;
+ }
+ return;
+}
+
+iz_ac01_a,69,36,3 duplicate(Otter Samssoon#ac) Otter Samssoon#ac_a 4W_SAILOR
+iz_ac01_b,69,36,3 duplicate(Otter Samssoon#ac) Otter Samssoon#ac_b 4W_SAILOR
+iz_ac01_c,69,36,3 duplicate(Otter Samssoon#ac) Otter Samssoon#ac_c 4W_SAILOR
+iz_ac01_d,69,36,3 duplicate(Otter Samssoon#ac) Otter Samssoon#ac_d 4W_SAILOR
+
+// - Lady
+// -----------------------------------------------------------------------------
+iz_ac01,138,69,3 script Lady#ac 1_F_ORIENT_02,{
+ mes "[Lady]";
+ mes "^3377FF Is the east window enlightened? Pecopeco is singing.^000000";
+ next;
+ mes "[Lady]";
+ mes "^3377FF Haven't the kids feeding Picky awaken yet?^000000";
+ next;
+ mes "[Lady]";
+ mes "^3377FF When are you going to Morocc over the dessert?^000000";
+ next;
+ mes "[Lady]";
+ mes "... Anonymous...";
+ next;
+ mes "[Lady]";
+ mes "You have a pretty name... Anonymous... I am attacted by your work.";
+ emotion e_lv;
+ close;
+}
+
+iz_ac01_a,138,69,3 duplicate(Lady#ac) Lady#ac_a 1_F_ORIENT_02
+iz_ac01_b,138,69,3 duplicate(Lady#ac) Lady#ac_b 1_F_ORIENT_02
+iz_ac01_c,138,69,3 duplicate(Lady#ac) Lady#ac_c 1_F_ORIENT_02
+iz_ac01_d,138,69,3 duplicate(Lady#ac) Lady#ac_d 1_F_ORIENT_02
+
+// - Eclaire
+// -----------------------------------------------------------------------------
+iz_ac01,149,46,3 script Eclaire#ac 4_F_KAFRA7,{
+ mes "[Eclaire]";
+ mes "Cooking is caring!";
+ close;
+}
+
+iz_ac01_a,149,46,3 duplicate(Eclaire#ac) Eclaire#ac_a 4_F_KAFRA7
+iz_ac01_b,149,46,3 duplicate(Eclaire#ac) Eclaire#ac_b 4_F_KAFRA7
+iz_ac01_c,149,46,3 duplicate(Eclaire#ac) Eclaire#ac_c 4_F_KAFRA7
+iz_ac01_d,149,46,3 duplicate(Eclaire#ac) Eclaire#ac_d 4_F_KAFRA7
+
+// - Mille Feuille
+// -----------------------------------------------------------------------------
+iz_ac01,150,50,3 script Mille Feuille#ac 4_F_KAFRA8,{
+ emotion e_lv;
+ mes "[Mille Feuille]";
+ mes "Ahh. Hey is Sir. Orleons doing well?";
+ close;
+}
+
+iz_ac01_a,150,50,3 duplicate(Mille Feuille#ac) Mille Feuille#ac_a 4_F_KAFRA8
+iz_ac01_b,150,50,3 duplicate(Mille Feuille#ac) Mille Feuille#ac_b 4_F_KAFRA8
+iz_ac01_c,150,50,3 duplicate(Mille Feuille#ac) Mille Feuille#ac_c 4_F_KAFRA8
+iz_ac01_d,150,50,3 duplicate(Mille Feuille#ac) Mille Feuille#ac_d 4_F_KAFRA8
+
+// - Chef
+// -----------------------------------------------------------------------------
+iz_ac01,160,50,3 script Chef#ac 4_F_GODEMOM,{
+ mes "[Chef]";
+ mes "Are you the new Criatura trainee?";
+ mes "Then go look for Dacquoise.";
+ next;
+ mes "[Chef]";
+ mes "I also learned from Sir. Charles Orleans.";
+ mes "Everyone became happy from eating my meals.";
+ next;
+ mes "[Chef]";
+ mes "Now it is my pleasure to feed the newbies of the Academy....";
+ close;
+}
+
+iz_ac01_a,160,50,3 duplicate(Chef#ac) Chef#ac_a 4_F_GODEMOM
+iz_ac01_b,160,50,3 duplicate(Chef#ac) Chef#ac_b 4_F_GODEMOM
+iz_ac01_c,160,50,3 duplicate(Chef#ac) Chef#ac_c 4_F_GODEMOM
+iz_ac01_d,160,50,3 duplicate(Chef#ac) Chef#ac_d 4_F_GODEMOM
+
+// - Hungry Trainee
+// -----------------------------------------------------------------------------
+iz_ac01,159,32,3 script Hungry Trainee#ac 4_M_SIT_NOVICE,{
+ mes "[Hungry Trainee]";
+ mes "Wonder when my order will get taken... it's already been an hour...";
+ mes "Look at the helpers lingering on the side...";
+ next;
+ emotion e_an, 0, "Scholarship Trainee#"+strnpcinfo(2);
+ mes "[Scholarship Trainee]";
+ mes "Ugh... this guy...";
+ mes "I already told you eight hundred times! It's buffet style! Ah!";
+ next;
+ mes "[Hungry Trainee]";
+ mes "Buffet? What's that? Can you eat it?";
+ mes "You look down on me because I'm from the country, don't you?";
+ next;
+ emotion e_ag;
+ mes "[Hungry Trainee]";
+ mes "Don't tell me it's not difficult to understand! Explain it to me!";
+ close;
+}
+
+iz_ac01_a,159,32,3 duplicate(Hungry Trainee#ac) Hungry Trainee#ac_a 4_M_SIT_NOVICE
+iz_ac01_b,159,32,3 duplicate(Hungry Trainee#ac) Hungry Trainee#ac_b 4_M_SIT_NOVICE
+iz_ac01_c,159,32,3 duplicate(Hungry Trainee#ac) Hungry Trainee#ac_c 4_M_SIT_NOVICE
+iz_ac01_d,159,32,3 duplicate(Hungry Trainee#ac) Hungry Trainee#ac_d 4_M_SIT_NOVICE
+
+// - Scholarship Trainee
+// -----------------------------------------------------------------------------
+iz_ac01,164,36,3 script Scholarship Trainee#ac 1_F_PUBGIRL,{
+ mes "[Scholarship Trainee]";
+ mes "I've worked at many different places, but this place is the strangest.";
+ close;
+}
+
+iz_ac01_a,164,36,3 duplicate(Scholarship Trainee#ac) Scholarship Trainee#ac_a 1_F_PUBGIRL
+iz_ac01_b,164,36,3 duplicate(Scholarship Trainee#ac) Scholarship Trainee#ac_b 1_F_PUBGIRL
+iz_ac01_c,164,36,3 duplicate(Scholarship Trainee#ac) Scholarship Trainee#ac_c 1_F_PUBGIRL
+iz_ac01_d,164,36,3 duplicate(Scholarship Trainee#ac) Scholarship Trainee#ac_d 1_F_PUBGIRL
+
+// - Broke Trainee
+// -----------------------------------------------------------------------------
+iz_ac01,133,34,5 script Broke Trainee#ac 4_M_SITDOWN,{
+ mes "[Broke Trainee]";
+ mes "Since the prices have risen I try to get my belly full at every chance I get.";
+ next;
+ mes "[Broke Trainee]";
+ mes "It's been 21 hours since I've been here.";
+ mes "It's a buffet so you can eat without time limit.";
+ next;
+ mes "[Broke Trainee]";
+ mes "Eat and digest, eat and digest, heh.";
+ mes "Do you want to join?";
+ close;
+}
+
+iz_ac01_a,133,34,5 duplicate(Broke Trainee#ac) Broke Trainee#ac_a 4_M_SITDOWN
+iz_ac01_b,133,34,5 duplicate(Broke Trainee#ac) Broke Trainee#ac_b 4_M_SITDOWN
+iz_ac01_c,133,34,5 duplicate(Broke Trainee#ac) Broke Trainee#ac_c 4_M_SITDOWN
+iz_ac01_d,133,34,5 duplicate(Broke Trainee#ac) Broke Trainee#ac_d 4_M_SITDOWN
+
+// - Noisy Trainee
+//-----------------------------------------------------------------------------
+iz_ac02,152,79,3 script Noisy Trainee#ac 4_M_HUBOY,{
+ if (Class == Job_Novice) {
+ mes "[Noisy Trainee]";
+ mes "Hey, do you know about the gunslinger's own weapon?";
+ next;
+ if(select("Don't know", "Know") == 2) {
+ mes "[Noisy Trainee]";
+ mes "Cha, yeah right!";
+ close;
+ }
+ mes "[Noisy Trainee]";
+ mes "I guessed you were.";
+ next;
+ mes "[Noisy Trainee]";
+ mes "Gunslinger handles 5 kinds of guns and each gun has its own character.";
+ next;
+ select("What character?");
+ mes "[Noisy Trainee]";
+ mes "Hahahaha~ I am also taking the lesson, but I don't know the details as I haven't become a gunslinger.";
+ next;
+ mes "[Noisy Trainee]";
+ mes "I heard that as it was a dangerous weapon they don't let us use them yet!";
+ close;
+ } else if (Class == Job_Gunslinger) {
+ mes "[Noisy Trainee]";
+ mes "Oh Mr. gunslinger!! Nice.";
+ close;
+ } else {
+ mes "[Noisy Trainee]";
+ mes "What? Why did you take the other job rather than being a nice gunslinger?";
+ close;
+ }
+}
+
+iz_ac02_a,152,79,3 duplicate(Noisy Trainee#ac) Noisy Trainee#ac_a 4_M_HUBOY
+iz_ac02_b,152,79,3 duplicate(Noisy Trainee#ac) Noisy Trainee#ac_b 4_M_HUBOY
+iz_ac02_c,152,79,3 duplicate(Noisy Trainee#ac) Noisy Trainee#ac_c 4_M_HUBOY
+iz_ac02_d,152,79,3 duplicate(Noisy Trainee#ac) Noisy Trainee#ac_d 4_M_HUBOY
+
+// - Quiet Trainee
+// -----------------------------------------------------------------------------
+iz_ac02,143,77,3 script Quite Trainee#ac 4_F_KID2,{
+ if (Class == Job_Novice) {
+ mes "[Quiet Trainee]";
+ switch(rand(1, 5)) {
+ case 1:
+ mes "Are you coming to take the lesson for gunslinger?";
+ break;
+ case 2:
+ mes "Ms. Lusa really looks pretty.";
+ break;
+ case 3:
+ mes "I wish to be a gunslinger, like her.";
+ break;
+ case 4:
+ mes "I hope I finish my lessons soon!";
+ break;
+ case 5:
+ mes "Learning is too difficult...";
+ break;
+ }
+ close;
+ } else if (Class == Job_Gunslinger) {
+ mes "[Quiet Trainee]";
+ mes "You are a gunslinger? You look great! I want to become a gunslinger......";
+ close;
+ } else {
+ mes "[Quiet Trainee]";
+ mes "Desperado is the bullet... Blable... Ranged attack... Physics....";
+ next;
+ mes "You can't hear her clearly because of her small voice.";
+ close;
+ }
+}
+
+iz_ac02_a,143,77,3 duplicate(Quite Trainee#ac) Quite Trainee#ac_a 4_F_KID2
+iz_ac02_b,143,77,3 duplicate(Quite Trainee#ac) Quite Trainee#ac_b 4_F_KID2
+iz_ac02_c,143,77,3 duplicate(Quite Trainee#ac) Quite Trainee#ac_c 4_F_KID2
+iz_ac02_d,143,77,3 duplicate(Quite Trainee#ac) Quite Trainee#ac_d 4_F_KID2
+
+// - Frightened Trainee
+// -----------------------------------------------------------------------------
+iz_ac02,159,79,7 script Frightened Trainee#ac 4_F_HUGIRL,{
+ mes "[Frightened Trainee]";
+ mes "That man looks too scary.";
+ close;
+}
+
+iz_ac02_a,159,79,7 duplicate(Frightened Trainee#ac) Frightened Trainee#ac_a 4_F_HUGIRL
+iz_ac02_b,159,79,7 duplicate(Frightened Trainee#ac) Frightened Trainee#ac_b 4_F_HUGIRL
+iz_ac02_c,159,79,7 duplicate(Frightened Trainee#ac) Frightened Trainee#ac_c 4_F_HUGIRL
+iz_ac02_d,159,79,7 duplicate(Frightened Trainee#ac) Frightened Trainee#ac_d 4_F_HUGIRL
+
+// - Ragie
+// - Teaches the player about Transcendent and Third classes.
+// -----------------------------------------------------------------------------
+iz_ac02,149,43,3 script Ragie#ac 1_M_BARD,{
+ mes "[Ragie]";
+ mes "A sudden poetic inspiration hit me!";
+ next;
+ mes "[Ragie]";
+ mes "^3377FFIn the night of the Byalan Island under the moonlight, sitting alone in Izlude^000000";
+ next;
+ mes "[Ragie]";
+ mes "^3377FFWearing Tzurugie on my belly, in the deep anxiety,^000000";
+ next;
+ mes "[Ragie]";
+ mes "^3377FFHearing I made a fortune from somewhere, killing me softly.^000000";
+ next;
+ mes "[Ragie]";
+ mes "........";
+ next;
+ mes "[Ragie]";
+ mes "How about it? It is excellent, isn't it?";
+ next;
+ mes "[Ragie]";
+ mes "I will ^FF0000transcend ^000000 and ^FF00003rd job change^000000. Become a nice Minstrel, I can play with a famous Wanderer like Mr. Igoo.";
+ next;
+ while (1) {
+ switch(select("What is transcending?", "What is the 3rd job change?", "Who is Igoo?", "End Conversation")) {
+ case 1:
+ if (ADVJOB != 0) {
+ mes "[Ragie]";
+ mes "You seem to already know what it is!";
+ next;
+ } else {
+ mes "[Ragie]";
+ mes "Transcending is great. Very great.";
+ next;
+ mes "[Ragie]";
+ mes "Basically the 2nd job adventurer gains the base level 99 and job level 50, on then can that person transcend.";
+ next;
+ mes "[Ragie]";
+ mes "Once you transcend, you can go back to the base level Novice.";
+ next;
+ mes "[Ragie]";
+ mes "It is very hard to start your adventure again. However, there is a merit to the hardship.";
+ next;
+ mes "[Ragie]";
+ mes "The most important merit is to learn new skills at a new upgraded level. In my case, I could transfer to not an ordinary Bard but a Minstrel.";
+ next;
+ mes "[Ragie]";
+ mes "Indeed, be careful as you can only follow the way of the job you chose before transcending.";
+ next;
+ mes "[Ragie]";
+ mes "If you are interested in transcending, recommend you visit the Sage castle in ^FF0000Juno^000000. I may be far behind for it.";
+ next;
+ }
+ break;
+ case 2:
+ if (BaseLevel > 99) {
+ mes "[Ragie]";
+ mes "Oh, you know very well, don't you?";
+ next;
+ } else {
+ mes "[Ragie]";
+ mes "The 3rd job change is obviously a new job.";
+ next;
+ mes "[Ragie]";
+ mes "Adventurers with the 2nd job or can be transferred to the 3rd job class once gaining the base level 99 and the job level more than 50.";
+ next;
+ mes "[Ragie]";
+ mes "For example, a Bard like me was an Archer in the beginning. Now I became a Bard. As I am diligently adventuring, I may be able to change jobs to a third job.";
+ next;
+ mes "[Ragie]";
+ mes "Ah, of course, though I don't make transfer, I could be Minstrel as my final target. However, I won't compromise with the reality. Someday I will be the best Minstrel.";
+ next;
+ mes "[Ragie]";
+ mes "So, if you transfer, you could first be Novice and be a Bard. But someday I could be Minstrel, couldn't I?";
+ next;
+ mes "[Ragie]";
+ mes "Choice is always on you. Be ambitious, adventurer. Someday I will sing an encouraging song for you.";
+ next;
+ }
+ break;
+ case 3:
+ mes "[Ragie]";
+ mes "No! You don't know the most beautiful girl Wanderer Igoo in this era?";
+ next;
+ mes "[Ragie]";
+ mes "Haven't you heard about [Volume 1 - Lost Poring] or [Volume 2 : Poring my love]?";
+ next;
+ mes "[Ragie]";
+ mes "Then, have you never heard the songs like [It's a Good day for an OCA] or [Baphomet I hardly knew you]";
+ next;
+ mes "[Ragie]";
+ mes "A beautiful Wanderer from Comodo at the age of 20. Not only Midgard but also wherever her wandering troupe goes, a fan club follows.";
+ next;
+ mes "[Ragie]";
+ mes "I am ^FF0000Ragie^000000 in charge with the Rune Midgard branch head of Igoo's informal fan club! As Igoo has gone to the 2nd world, I am taking a rest for a while. But she will be back soon.";
+ next;
+ mes "[Ragie]";
+ mes "As I am still a low level of adventurer, I haven't followed her to the 2nd world... See! I will make great efforts and follow her everywhere.";
+ next;
+ mes "[Ragie]";
+ mes "Ahaa. No sweat no sweat. It is useless to tell such a story to those ignorant.";
+ next;
+ break;
+ case 4:
+ mes "[Ragie]";
+ mes "Ah! I happened to come up with another great poetic inspiration.. Take a memo.. Memo..";
+ close;
+ }
+ }
+}
+
+iz_ac02_a,149,43,3 duplicate(Ragie#ac) Ragie#ac_a 1_M_BARD
+iz_ac02_b,149,43,3 duplicate(Ragie#ac) Ragie#ac_b 1_M_BARD
+iz_ac02_c,149,43,3 duplicate(Ragie#ac) Ragie#ac_c 1_M_BARD
+iz_ac02_d,149,43,3 duplicate(Ragie#ac) Ragie#ac_d 1_M_BARD
+
+// - Lady Harvesting Herbs
+// -----------------------------------------------------------------------------
+pay_fild08,153,83,1 script Lady Harvesting Herbs#2 1_F_ORIENT_02,{
+ mes "[Lady]";
+ mes "There is a town called Payon to the east. Taking a long way to the south, you can even reach Alberta.";
+ next;
+ mes "[Lady]";
+ mes "Payon is the wonderful city. There you can be transferred to an Archer or to a Taekwon. And a nice Dungeon there. If you have time, please make a visit.";
+ emotion e_heh;
+ close;
+}
+
+// - Signs
+// -----------------------------------------------------------------------------
+- script ::ac_board -1,{
+ end;
+}
+
+iz_ac01,93,76,5 duplicate(ac_board) [Armory]#ac 2_BULLETIN_BOARD
+iz_ac01_a,93,76,5 duplicate(ac_board) [Armory]#ac_a 2_BULLETIN_BOARD
+iz_ac01_b,93,76,5 duplicate(ac_board) [Armory]#ac_b 2_BULLETIN_BOARD
+iz_ac01_c,93,76,5 duplicate(ac_board) [Armory]#ac_c 2_BULLETIN_BOARD
+iz_ac01_d,93,76,5 duplicate(ac_board) [Armory]#ac_d 2_BULLETIN_BOARD
+
+iz_ac01,106,76,3 duplicate(ac_board) [Library]#ac 2_BULLETIN_BOARD
+iz_ac01_a,106,76,3 duplicate(ac_board) [Library]#ac_a 2_BULLETIN_BOARD
+iz_ac01_b,106,76,3 duplicate(ac_board) [Library]#ac_b 2_BULLETIN_BOARD
+iz_ac01_c,106,76,3 duplicate(ac_board) [Library]#ac_c 2_BULLETIN_BOARD
+iz_ac01_d,106,76,3 duplicate(ac_board) [Library]#ac_d 2_BULLETIN_BOARD
+
+iz_ac01,106,44,3 duplicate(ac_board) [Cafeteria]#ac 2_BULLETIN_BOARD
+iz_ac01_a,106,44,3 duplicate(ac_board) [Cafeteria]#ac_a 2_BULLETIN_BOARD
+iz_ac01_b,106,44,3 duplicate(ac_board) [Cafeteria]#ac_b 2_BULLETIN_BOARD
+iz_ac01_c,106,44,3 duplicate(ac_board) [Cafeteria]#ac_c 2_BULLETIN_BOARD
+iz_ac01_d,106,44,3 duplicate(ac_board) [Cafeteria]#ac_d 2_BULLETIN_BOARD
+
+iz_ac01,93,44,5 duplicate(ac_board) [Dispensary]#ac 2_BULLETIN_BOARD
+iz_ac01_a,93,44,5 duplicate(ac_board) [Dispensary]#ac_a 2_BULLETIN_BOARD
+iz_ac01_b,93,44,5 duplicate(ac_board) [Dispensary]#ac_b 2_BULLETIN_BOARD
+iz_ac01_c,93,44,5 duplicate(ac_board) [Dispensary]#ac_c 2_BULLETIN_BOARD
+iz_ac01_d,93,44,5 duplicate(ac_board) [Dispensary]#ac_d 2_BULLETIN_BOARD
+
+iz_ac01,103,89,3 duplicate(ac_board) [Great Hall]#ac 2_BULLETIN_BOARD
+iz_ac01_a,103,89,3 duplicate(ac_board) [Great Hall]#ac_a 2_BULLETIN_BOARD
+iz_ac01_b,103,89,3 duplicate(ac_board) [Great Hall]#ac_b 2_BULLETIN_BOARD
+iz_ac01_c,103,89,3 duplicate(ac_board) [Great Hall]#ac_c 2_BULLETIN_BOARD
+iz_ac01_d,103,89,3 duplicate(ac_board) [Great Hall]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,98,170,5 duplicate(ac_board) [Merchant Classroom]#2 2_BULLETIN_BOARD
+iz_ac02_a,98,170,5 duplicate(ac_board) [Merchant Classroom]#2_a 2_BULLETIN_BOARD
+iz_ac02_b,98,170,5 duplicate(ac_board) [Merchant Classroom]#2_b 2_BULLETIN_BOARD
+iz_ac02_c,98,170,5 duplicate(ac_board) [Merchant Classroom]#2_c 2_BULLETIN_BOARD
+iz_ac02_d,98,170,5 duplicate(ac_board) [Merchant Classroom]#2_d 2_BULLETIN_BOARD
+
+iz_ac02,109,170,3 duplicate(ac_board) [Acolyte Classroom]#2 2_BULLETIN_BOARD
+iz_ac02_a,109,170,3 duplicate(ac_board) [Acolyte Classroom]#2_a 2_BULLETIN_BOARD
+iz_ac02_b,109,170,3 duplicate(ac_board) [Acolyte Classroom]#2_b 2_BULLETIN_BOARD
+iz_ac02_c,109,170,3 duplicate(ac_board) [Acolyte Classroom]#2_c 2_BULLETIN_BOARD
+iz_ac02_d,109,170,3 duplicate(ac_board) [Acolyte Classroom]#2_d 2_BULLETIN_BOARD
+
+iz_ac02,98,140,5 duplicate(ac_board) [Thief Classroom]#ac 2_BULLETIN_BOARD
+iz_ac02_a,98,140,5 duplicate(ac_board) [Thief Classroom]#ac_a 2_BULLETIN_BOARD
+iz_ac02_b,98,140,5 duplicate(ac_board) [Thief Classroom]#ac_b 2_BULLETIN_BOARD
+iz_ac02_c,98,140,5 duplicate(ac_board) [Thief Classroom]#ac_c 2_BULLETIN_BOARD
+iz_ac02_d,98,140,5 duplicate(ac_board) [Thief Classroom]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,109,140,3 duplicate(ac_board) [Ninja Classroom]#ac 2_BULLETIN_BOARD
+iz_ac02_a,109,140,3 duplicate(ac_board) [Ninja Classroom]#ac_a 2_BULLETIN_BOARD
+iz_ac02_b,109,140,3 duplicate(ac_board) [Ninja Classroom]#ac_b 2_BULLETIN_BOARD
+iz_ac02_c,109,140,3 duplicate(ac_board) [Ninja Classroom]#ac_c 2_BULLETIN_BOARD
+iz_ac02_d,109,140,3 duplicate(ac_board) [Ninja Classroom]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,98,110,5 duplicate(ac_board) [Archer Classroom]#ac 2_BULLETIN_BOARD
+iz_ac02_a,98,110,5 duplicate(ac_board) [Archer Classroom]#ac_a 2_BULLETIN_BOARD
+iz_ac02_b,98,110,5 duplicate(ac_board) [Archer Classroom]#ac_b 2_BULLETIN_BOARD
+iz_ac02_c,98,110,5 duplicate(ac_board) [Archer Classroom]#ac_c 2_BULLETIN_BOARD
+iz_ac02_d,98,110,5 duplicate(ac_board) [Archer Classroom]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,109,110,3 duplicate(ac_board) [Mage Classroom]#ac 2_BULLETIN_BOARD
+iz_ac02_a,109,110,3 duplicate(ac_board) [Mage Classroom]#ac_a 2_BULLETIN_BOARD
+iz_ac02_b,109,110,3 duplicate(ac_board) [Mage Classroom]#ac_b 2_BULLETIN_BOARD
+iz_ac02_c,109,110,3 duplicate(ac_board) [Mage Classroom]#ac_c 2_BULLETIN_BOARD
+iz_ac02_d,109,110,3 duplicate(ac_board) [Mage Classroom]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,98,80,5 duplicate(ac_board) [Taekwon Classroom]#2 2_BULLETIN_BOARD
+iz_ac02_a,98,80,5 duplicate(ac_board) [Taekwon Classroom]#2_a 2_BULLETIN_BOARD
+iz_ac02_b,98,80,5 duplicate(ac_board) [Taekwon Classroom]#2_b 2_BULLETIN_BOARD
+iz_ac02_c,98,80,5 duplicate(ac_board) [Taekwon Classroom]#2_c 2_BULLETIN_BOARD
+iz_ac02_d,98,80,5 duplicate(ac_board) [Taekwon Classroom]#2_d 2_BULLETIN_BOARD
+
+iz_ac02,109,80,3 duplicate(ac_board) [Gunslinger Classroom]#0 2_BULLETIN_BOARD
+iz_ac02_a,109,80,3 duplicate(ac_board) [Gunslinger Classroom]#a 2_BULLETIN_BOARD
+iz_ac02_b,109,80,3 duplicate(ac_board) [Gunslinger Classroom]#b 2_BULLETIN_BOARD
+iz_ac02_c,109,80,3 duplicate(ac_board) [Gunslinger Classroom]#c 2_BULLETIN_BOARD
+iz_ac02_d,109,80,3 duplicate(ac_board) [Gunslinger Classroom]#d 2_BULLETIN_BOARD
+
+iz_ac02,98,50,5 duplicate(ac_board) [Swordman Classroom]#2 2_BULLETIN_BOARD
+iz_ac02_a,98,50,5 duplicate(ac_board) [Swordman Classroom]#2_a 2_BULLETIN_BOARD
+iz_ac02_b,98,50,5 duplicate(ac_board) [Swordman Classroom]#2_b 2_BULLETIN_BOARD
+iz_ac02_c,98,50,5 duplicate(ac_board) [Swordman Classroom]#2_c 2_BULLETIN_BOARD
+iz_ac02_d,98,50,5 duplicate(ac_board) [Swordman Classroom]#2_d 2_BULLETIN_BOARD
+
+iz_ac02,109,50,3 duplicate(ac_board) [Lounge]#ac 2_BULLETIN_BOARD
+iz_ac02_a,109,50,3 duplicate(ac_board) [Lounge]#ac_a 2_BULLETIN_BOARD
+iz_ac02_b,109,50,3 duplicate(ac_board) [Lounge]#ac_b 2_BULLETIN_BOARD
+iz_ac02_c,109,50,3 duplicate(ac_board) [Lounge]#ac_c 2_BULLETIN_BOARD
+iz_ac02_d,109,50,3 duplicate(ac_board) [Lounge]#ac_d 2_BULLETIN_BOARD
+
+iz_ac02,107,180,3 duplicate(ac_board) [Principal's Office]#a 2_BULLETIN_BOARD
+iz_ac02_a,107,180,3 duplicate(ac_board) [Principal's Office]#aa 2_BULLETIN_BOARD
+iz_ac02_b,107,180,3 duplicate(ac_board) [Principal's Office]#ab 2_BULLETIN_BOARD
+iz_ac02_c,107,180,3 duplicate(ac_board) [Principal's Office]#ac 2_BULLETIN_BOARD
+iz_ac02_d,107,180,3 duplicate(ac_board) [Principal's Office]#ad 2_BULLETIN_BOARD
+
+
+// =============================================================================
+// = Job NPCs
+// =============================================================================
+
+//= Cream Puff
+//= Gives the player a personality test to determine the class they should be.
+//==============================================================================
+iz_ac02,143,55,3 script Cream Puff#ac 4_M_KID1,{
+ cutin "choucream_n.bmp", 2;
+ if (Class == Job_Novice) {
+ emotion e_what;
+ mes "[Cream Puff]";
+ mes "You are a novice? right?";
+ next;
+ } else {
+ emotion e_sigh;
+ mes "[Cream Puff]";
+ mes "Class aptitude test is nonsense for those who already have a job.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Cream Puff]";
+ mes "You haven't decided your job yet?";
+ next;
+ if(select("No... how did you know?", "I decided.") == 2) {
+ cutin "choucream_d.bmp",2;
+ emotion e_sigh;
+ mes "[Cream Puff]";
+ mes "Have you already decided? Ok then.";
+ next;
+ mes "[Cream Puff]";
+ mes "I wanted you to take the Class aptitude test for fun...";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "choucream_e.bmp",2;
+ emotion e_flash;
+ mes "[Cream Puff]";
+ mes "Oh, that is good.";
+ mes "What is the ^0000FFClass aptitude test^000000.";
+ mes "I have one book left. Do you want to try? I won't say it will be help for sure but it will be fun.";
+ next;
+ while(1) {
+ switch(select("Class aptitude test?", "Take the Class aptitude test.", "stop.")) {
+ case 1:
+ cutin "choucream_n.bmp",2;
+ mes "[Cream Puff]";
+ mes "The Class aptitude test is a test for recommending jobs by reviewing your personality and capability with the answers.";
+ next;
+ mes "[Cream Puff]";
+ mes "It has 3 types of test and each one give 30 minutes to finish.";
+ next;
+ emotion e_what;
+ mes "[Cream Puff]";
+ mes "If you have free time and have not decided your job... how about taking this test?";
+ next;
+ continue;
+ case 2:
+ break;
+ case 3:
+ cutin "choucream_d.bmp",2;
+ emotion e_pif;
+ mes "[Cream Puff]";
+ mes "All right. Good bye.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ break;
+ }
+ cutin "choucream_e.bmp",2;
+ mes "[Cream Puff]";
+ mes "Shall we start?";
+ next;
+ mes "[Cream Puff]";
+ mes "The first type of question is about taking an action for a given situation.";
+ next;
+ mes "In the middle of the dark, you're walking on the street of Prontera when suddenly you hear someone scream.";
+ next;
+ mes "'Aaaahh!! Don't hurt me ~'";
+ next;
+ mes "You run to the place and see someone surrounded by punks. Because of your sudden appearace, the punks are surprised.";
+ next;
+ mes "What would be your reaction to this situation?";
+ next;
+ switch(select("Fight against the punks", "Cast Magic.", "Call for Guards.", "Throw rocks at them.")) {
+ case 1:
+ .@question_01$ = "You subdue them easily.";
+ .@swordman_p = .@swordman_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ break;
+ case 2:
+ .@question_01$ = "You cast a spell on them.";
+ .@magician_p = .@magician_p + 1;
+ break;
+ case 3:
+ .@question_01$ = "You call for help and Guards come to your aid.";
+ .@acolyte_p = .@acolyte_p + 1;
+ break;
+ case 4:
+ .@question_01$ = "You skillfully throw rocks at the punks.";
+ .@archer_p = .@archer_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ break;
+ }
+ mes ""+.@question_01$+"";
+ next;
+ mes "After clear up the mess, you approach the person who was being attacked.";
+ mes "Do you think the person who was surrounded by punks is a man or a woman?";
+ next;
+ if(select("Man", "Woman") == 1) {
+ .@question_02_01$ = "he";
+ .@question_02_02$ = "son";
+ } else {
+ .@question_02_01$ = "she";
+ .@question_02_02$ = "daughter";
+ }
+ mes "The situation of encountering the gangs were like this";
+ next;
+ mes "You find out that "+.@question_02_01$+" is the "+.@question_02_02$+" of very rich family in Alberta and Punks attacked while "+.@question_02_01$+" was on an errand for the family";
+ next;
+ mes "What kind of errand was he doing?";
+ next;
+ switch(select("Delivering an important object", "Deliver a small souvenir", "Deliver a message")) {
+ case 1:
+ .@swordman_p = .@swordman_p + 1;
+ .@archer_p = .@archer_p + 1;
+ .@magician_p = .@magician_p + 1;
+ break;
+ case 2:
+ .@thief_p = thief_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ break;
+ case 3:
+ .@acolyte_p = .@acolyte_p + 1;
+ break;
+ }
+ mes "For your bravery, "+.@question_02_01+" becomes your friend and decides to go on a trip.";
+ mes "Where is "+.@question_02_01+" going?";
+ next;
+ switch(select("Capital city, Prontera", "Mountain city, Payon", "Port city, Alberta", "Magic city, Geffen", "Satelite city, Izlude", "Desert city, Morocc", "Industrial city, Einbroch", "World of natural life, Amatsu", "Garden city, Hugel")) {
+ case 1:
+ .@acolyte_p = .@acolyte_p + 1;
+ break;
+ case 2:
+ .@taekwon_p = .@taekwon_p + 1;
+ break;
+ case 3:
+ .@merchant_p = .@merchant_p + 1;
+ break;
+ case 4:
+ .@magician_p = .@magician_p + 1;
+ break;
+ case 5:
+ .@swordman_p = .@swordman_p + 1;
+ break;
+ case 6:
+ .@thief_p = .@thief_p + 1;
+ break;
+ case 7:
+ .@gunslinger_p = .@gunslinger_p + 1;
+ break;
+ case 8:
+ .@ninja_p = .@ninja_p + 1;
+ break;
+ case 9:
+ .@archer_p = .@archer_p + 1;
+ break;
+ }
+ mes "You're having a great time. Do you feel like something will be happening or not?";
+ next;
+ if(select("Happening:Not happening.") == 1) {
+ .@thief_p = .@thief_p + 1;
+ .@swordman_p = .@swordman_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ .@magician_p = .@magician_p + 1;
+ .@thief_p = .@thief_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ mes "[Cream Puff]";
+ mes "Now for the second test. Choose the best answer in your own opinion.";
+ next;
+ mes "[Cream Puff]";
+ mes "2nd type of question is to select a word or sentence which is closest to yourself.";
+ next;
+ switch(select("Study", "Exercise", "Service", "Violence")) {
+ case 1:
+ .@magician_p = .@magician_p + 1;
+ break;
+ case 2:
+ .@thief_p = .@thief_p + 1;
+ .@swordman_p = .@swordman_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ break;
+ case 3:
+ .@acolyte_p = .@acolyte_p + 1;
+ break;
+ case 4:
+ .@thief_p = .@thief_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ break;
+ }
+ if(select("Change", "Preservation") == 1) {
+ .@magician_p = .@magician_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ }
+ switch(select("Consumer", "Seller", "Producer")) {
+ case 1:
+ .@swordman_p = .@swordman_p + 1;
+ .@thief_p = .@thief_p + 1;
+ .@acolyte_p = .@acolyte_p + 1;
+ .@archer_p = .@archer_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ break;
+ case 2:
+ .@merchant_p = .@merchant_p + 1;
+ break;
+ case 3:
+ .@magician_p = .@magician_p + 1;
+ break;
+ }
+ if(select("Speedy", "Cautious") == 1) {
+ .@thief_p = .@thief_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ } else {
+ .@archer_p = .@archer_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ if(select("Theory", "Experience") == 1) {
+ .@magician_p = .@magician_p + 1;
+ } else {
+ .@swordman_p = .@swordman_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ }
+ mes "[Cream Puff]";
+ mes "2nd type of question is done. It was simple. Right ? Let's move to next.";
+ next;
+ mes "[Cream Puff]";
+ mes "Now for the third test. Please choose (Yes) or (No) to each question.";
+ next;
+ mes "Do you always pick up money that you find on the ground?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@merchant_p = .@merchant_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ }
+ mes "If you had the same name as someone of the opposite sex, would that make you less attracted to them?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@ninja_p = .@ninja_p + 1;
+ .@archer_p = .@archer_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ mes "Do you like to be able to carry a lot of items at once?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@swordman_p = .@swordman_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ } else {
+ .@magician_p = .@magician_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ }
+ mes "Do you like to read books?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@taekwon_p = .@taekwon_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }else {
+ .@ninja_p = ninja_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ }
+ mes "You read everything in a magazine?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@magician_p = .@magician_p + 1;
+ } else {
+ .@archer_p = archer_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ mes "Do you take the time to worry about what you are wearing?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@merchant_p = .@merchant_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ } else {
+ .@swordman_p = .@swordman_p + 1;
+ .@thief_p = .@thief_p + 1;
+ }
+ mes "Do you tell others what kind of fancy foods you've eaten recently?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@thief_p = .@thief_p + 1;
+ .@swordman_p = .@swordman_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@taekwon_p = .@taekwon_p + 1;
+ }
+ mes "Do you write things down in a notebook often?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@magician_p = .@magician_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ } else {
+ .@thief_p = .@thief_p + 1;
+ .@archer_p = .@archer_p + 1;
+ }
+ mes "Do you consider yourself attractive?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@ninja_p = .@ninja_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@swordman_p = .@swordman_p + 1;
+ }
+ mes "Do you like to be in areas where a lot of people gather?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@swordman_p = .@swordman_p + 1;
+ } else {
+ .@archer_p = .@archer_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ }
+ mes "Do you like the idea of living a single life?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@thief_p = .@thief_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ }
+ mes "Do you like to keep your distance from others?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@gunslinger_p = .@gunslinger_p + 1;
+ .@archer_p = .@archer_p + 1;
+ } else {
+ .@taekwon_p = .@taekwon_p + 1;
+ }
+ mes "Do you think that having a good hiding space is important in battle?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@magician_p = .@magician_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ .@archer_p = .@archer_p + 1;
+ } else {
+ .@taekwon_p = .@taekwon_p + 1;
+ .@magician_p = .@magician_p + 1;
+ }
+ mes "Would you defend your friend even if you knew they were wrong?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@swordman_p = .@swordman_p + 1;
+ } else {
+ .@thief_p = .@thief_p + 1;
+ .@ninja_p = .@ninja_p + 1;
+ }
+ mes "Would you try to convince an enemy not to fight you with logic?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@archer_p = .@archer_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@archer_p = .@archer_p + 1;
+ }
+ mes "Can you sit still in the same place for a long time?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@taekwon_p = .@taekwon_p + 1;
+ .@thief_p = .@thief_p + 1;
+ } else {
+ .@archer_p = .@archer_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ mes "Do you think that you can take a punch straight to the gut from an Orc?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@swordman_p = .@swordman_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ } else {
+ .@magician_p = .@magician_p + 1;
+ .@thief_p = .@thief_p + 1;
+ }
+ mes "Do you make up nicknames for your friends?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@gunslinger_p = .@gunslinger_p + 1;
+ .@archer_p = .@archer_p + 1;
+ } else {
+ .@acolyte_p = .@acolyte_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ }
+ mes "Do you always have a plan B for various situations?";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@thief_p = .@thief_p + 1;
+ .@gunslinger_p = .@gunslinger_p + 1;
+ } else {
+ .@gunslinger_p = .@gunslinger_p + 1;
+ .@merchant_p = .@merchant_p + 1;
+ }
+ mes "I think about something else while talking to others.";
+ next;
+ if(select("Yes", "No") == 1) {
+ .@magician_p = .@agician_p + 1;
+ } else {
+ .@ninja_p = .@ninja_p + 1;
+ .@archer_p = .@archer_p + 1;
+ }
+ mes "[Cream Puff]";
+ mes "Class aptitude test is finished with 1,2 and 3rd test. Please wait for a moment.";
+ next;
+ cutin "choucream_d.bmp",2;
+ mes "[Cream Puff]";
+ mes "It requires to manually calculate as you know.";
+ next;
+ setarray .@points[0],.@swordman_p,.@magician_p,.@archer_p,.@merchant_p,.@thief_p,.@acolyte_p,.@taekwon_p,.@gunslinger_p,.@ninja_p;
+ .@max = .@points[0];
+ for(.@i = 1; .@i < 9; .@i = .@i+1) {
+ if(.@points[.@i] >= .@max) {
+ .@max = .@points[.@i];
+ .@ele = .@i;
+ }
+ }
+ set .@who_job, .@ele + 1;
+ mes "[Cream Puff]";
+ mes "All right!!!! It's done!!!!!!!!";
+ next;
+ cutin "choucream_e.bmp", 2;
+ mes "[Cream Puff]";
+ mes "Finished calculating. Math is always difficult.";
+ next;
+ mes "[Cream Puff]";
+ mes "According to the Class aptitude test!";
+ next;
+ mes "[Cream Puff]";
+ if (.@who_job == 1) {
+ .@job_name$ = "Swordman";
+ mes "The one who wants to be a hero with stong belief and wants to influence on the world.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who wants to protect the weak.";
+ } else if (.@who_job == 2) {
+ .@job_name$ = "Mage";
+ mes "The one who is curious about knowing everything and independently work alone.";
+ next;
+ mes "[Cream Puff]";
+ mes "the one who has good judgement, not out-going, analyzing and insightful and likes to observe...";
+ } else if (.@who_job == 3) {
+ .@job_name$ = "Archer";
+ mes "The one who is romantic and understands the feeling of others and tries to be understood by others as well.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who wants to spend time finding out who they are.";
+ } else if (.@who_job == 4) {
+ .@job_name$ = "Merchant";
+ mes "the one who is good at reading the mind of others and is decisive.";
+ next;
+ mes "[Cream Puff]";
+ mes "the one who is strongly interested in achieving and target-driving and responsible.";
+ } else if (.@who_job == 5) {
+ .@job_name$ = "Thief";
+ mes "The one who wants to have fun is optimistic who loves adventure.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who wants to find out something exciting and wants to donate to the world in his own way.";
+ } else if (.@who_job == 6) {
+ .@job_name$ = "Acolyte";
+ mes "The one who has a great heart to help others and understand.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who wants to be loved and wants to care for others.";
+ } else if (.@who_job == 7) {
+ .@job_name$ = "Taekwon boy/girl";
+ mes "the one who has sound mind from right training.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who tries hard everyday with certain belief and tries to make people understand.";
+ } else if (.@who_job == 8) {
+ .@job_name$ = "Gunslinger";
+ mes "The one who is called as a justice giver but also gives chaos and fear.";
+ next;
+ mes "[Cream Puff]";
+ mes "The one who tries to balance between justice and chaos.";
+ } else if (.@who_job == 9) {
+ .@job_name$ = "Ninja";
+ mes "The one who does not want to get attention.";
+ next;
+ mes "[Cream Puff]";
+ mes "and who is persistant without giving up until reaching the target.";
+ } else {
+ mes "An error occurred.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ next;
+ emotion e_no1;
+ mes "[Cream Puff]";
+ mes "^8014EB"+.@job_name$+"^000000 is a good matching job for you.";
+ next;
+ cutin "choucream_n.bmp", 2;
+ mes "[Cream Puff]";
+ mes "Hmm, it says.";
+ next;
+ mes "[Cream Puff]";
+ mes "You do not have to choose the job from Class aptitude test. That is only just for fun.";
+ next;
+ emotion e_what;
+ mes "[Cream Puff]";
+ mes "If you want, I will send it to the class that was recommended by the aptitude result.";
+ next;
+ if(select("Send me now.", "It's okay, I'm still deciding.") == 2) {
+ mes "[Cream Puff]";
+ mes "Ok, you know what you want I guess.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Cream Puff]";
+ mes "Your recommended job is "+.@job_name$+". I will send you to where you can talk to that job professional.";
+ close2;
+ switch(.@who_job) {
+ case 1:
+ warp "iz_ac02",84,49;
+ break;
+ case 2:
+ warp "iz_ac02",123,109;
+ break;
+ case 3:
+ warp "iz_ac02",84,109;
+ break;
+ case 4:
+ warp "iz_ac02",84,169;
+ break;
+ case 5:
+ warp "iz_ac02",84,139;
+ break;
+ case 6:
+ warp "iz_ac02",122,169;
+ break;
+ case 7:
+ warp "iz_ac02",84,79;
+ break;
+ case 8:
+ warp "iz_ac02",123,79;
+ break;
+ case 9:
+ warp "iz_ac02",123,139;
+ break;
+ default:
+ warp "iz_ac02",123,49;
+ break;
+ }
+ cutin "", 255;
+ end;
+}
+
+iz_ac02_a,143,55,3 duplicate(Cream Puff#ac) Cream Puff#ac_a 4_M_KID1
+iz_ac02_b,143,55,3 duplicate(Cream Puff#ac) Cream Puff#ac_b 4_M_KID1
+iz_ac02_c,143,55,3 duplicate(Cream Puff#ac) Cream Puff#ac_c 4_M_KID1
+iz_ac02_d,143,55,3 duplicate(Cream Puff#ac) Cream Puff#ac_d 4_M_KID1
+
+// =============================================================================
+// = Gunslinger
+// =============================================================================
+
+// - Lusa
+// - Teaches the player about Gunslinger class.
+// -----------------------------------------------------------------------------
+iz_ac02,142,85,6 script Lusa#ac 4_F_GUNSLINGER,{
+ if (!checkweight(1301, 1)) {
+ mes "- Quest can't be continued as your overloaded items. -";
+ close;
+ }
+ cutin "aca_gung_01.bmp", 2;
+ if (Class == Job_Novice) {
+ if (questprogress(4269) != 2) {
+ mes "[Lusa]";
+ mes "Oh! I am sorry but in order to take the class, y'all have to register first. Ya come back here after registration at that there counter on the 1st floor, ya hear?";
+ close2;
+ // ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ }
+ .@has_manual = 0;
+ setarray .@manuals[0],2819,2820,2821,2822,2823,2824,2942,2941,2940;
+ for (.@i = 0; .@i < 9; .@i++) {
+ if (isequippedcnt(.@manuals[.@i]))
+ .@has_manual = 1;
+ }
+ for (.@i = 0; .@i < 9; .@i++) {
+ if (countitem(.@manuals[.@i]))
+ .@has_manual = 1;
+ }
+ emotion e_awsm;
+ mes "[Lusa]";
+ mes "Gosh Darnit! You are cuter then a piglet! Are ya trying ta learn to be a ^ff0000Gunslinger^000000?";
+ next;
+ if (.@has_manual == 1) {
+ .@menu$ = "What is a Gunslinger?:Can I try out the skills?:Becoming a Gunslinger?:How can I try out the skills?:Cancel";
+ } else {
+ .@menu$ = "What is a Gunslinger?:Can I try out the skills?:Becoming a Gunslinger?::Cancel";
+ }
+ switch(select(.@menu$)) {
+ case 1:
+ emotion e_lv;
+ mes "[Lusa]";
+ mes "You're so cute! A ^ff0000Gunslinger^000000 who has true grit wield his weapons bringing justice in these wild times.";
+ next;
+ mes "[Lusa]";
+ if (Sex == 1)
+ mes "Ya, know you remind me of my little brother, that varmint couldn't shoot the broadside of a barn.. at least not until I taught him.";
+ else
+ mes "Ya, know you remind me of my little sister, that scamp couldn't shoot the broadside of barn.. At least not until I taught her.";
+ next;
+ mes "[Lusa]";
+ mes "Now y'all need to understand, guns aren't some little thing that you just swing at an animal, you don't wiggle those there fingers and shock them to death.";
+ next;
+ mes "[Lusa]";
+ mes "No! You shoot things, which means ya need to aim straight. This takes alot of ^ff0000dexterity^000000 on the part of the gunslinger.";
+ next;
+ mes "[Lusa]";
+ mes "Now before ya go running off shooting dem guns in the air, all high fallootin and dancing around. Ya need to understand that this isn't an easy job!";
+ next;
+ mes "[Lusa]";
+ mes "Bullets cost zeny so you need to be sure that everything you shoot is worth the price! We attack at range so that nasty cur with the pig sticker doesn't rustle your jimmies!";
+ next;
+ mes "[Lusa]";
+ mes "Y'all understand?";
+ next;
+ while(1) {
+ switch(select("Ranged attack?", "Why is ammo expensive?", "Job Change Test?", "Yes~!!")) {
+ case 1:
+ mes "[Lusa]";
+ mes "Those low tech barbarians need both Strength and Dexterity in order to fight properly. This isn't true for gunslingers.";
+ next;
+ mes "[Lusa]";
+ mes "Why our dexterity influences both attack power and accuracy! Remember, Talk slowly but think quickly!";
+ next;
+ break;
+ case 2:
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "Do y'all see lots of factories around here? Mines? Alchemical labs? All these things take zeny to run and thats how they fund it!";
+ next;
+ break;
+ case 3:
+ mes "[Lusa]";
+ mes "Some other jobs may think it is safe enough to hand any yonkle the strength to seriously hurt someone.";
+ next;
+ mes "[Lusa]";
+ mes "But we have to see that you have grit! Remember, fast is good but accurate is better.";
+ next;
+ break;
+ case 4:
+ break;
+ }
+ cutin "aca_gung_01.bmp", 2;
+ break;
+ }
+ mes "[Lusa]";
+ mes "Y'all can come back now if you gets any more questions.";
+ close2;
+ //ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Lusa]";
+ mes "They tell me Criatura Academy is for the novices not yet decided what job to take.";
+ next;
+ mes "[Lusa]";
+ mes "They hired me, gun and all, to show you how to be a gunslinger!";
+ next;
+ mes "[Lusa]";
+ mes "Would you like me to show you how?";
+ next;
+ if(select("Yes mam!", "No, thanks.") == 2) {
+ mes "[Lusa]";
+ mes "Hrmm, you didn't look like you had the grit any how.";
+ close2;
+ //ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ }
+ mes "[Lusa]";
+ if (.@has_manual == 1) {
+ mes "Hey! What kind of con is this?! You already had a manual!";
+ } else {
+ getitem 2941, 1; // Gunslinger_Manual
+ mes "Here take this manual, I ain't too good at that there book learnin' but I can answer your questions.";
+ }
+ next;
+ mes "[Lusa]";
+ mes "If you need the battle training, visit <NAVI>[Subino]<INFO>iz_ac01,59,83</INFO></NAVI>.";
+ close2;
+ //ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ case 3:
+ if (Upper == 2) {
+ emotion e_slur;
+ mes "[Lusa]";
+ mes "Oh, sorry! Children cannot become Gunslingers!";
+ next;
+ mes "[Lusa]";
+ mes "Perhaps you should talk to your parents about other professions.";
+ close2;
+ // ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ }
+ mes "[Lusa]";
+ mes "Are you going to learn to shoot as a gunslinger?";
+ next;
+ if (JobLevel < 10) {
+ mes "[Lusa]";
+ mes "Wooo doggy! You aren't ready for the big city yet!";
+ next;
+ mes "[Lusa]";
+ mes "Get to ^ff0000Job Level: ^0000ff10^000000 and come back here and I will help ya!";
+ close2;
+ //ConsumeSpecialItem Inspector_Certificate_
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lusa]";
+ mes "Y'all ready to take the test to become a gunslinger?";
+ next;
+ }
+ if(select("Wait a moment.", "Send me.") == 1) {
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "When ya are ready, come to me!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Lusa]";
+ mes "Okay then, you should find a^ff0000 Mr. Master Miller^000000 and ask him about the test.";
+ next;
+ mes "[Lusa]";
+ mes "Remember, if you find yourself in a hole, the first thing to do is stop digging!";
+ close2;
+ warp "que_ng", 150, 167;
+ end;
+ case 4:
+ mes "[Lusa]";
+ mes "Y'all need help with that book?";
+ next;
+ while(1) {
+ switch(select("How do I use this book?", "I can't find the skill.", "I don't have a gun....", "No more questions now.")) {
+ case 1:
+ mes "[Lusa]";
+ mes "Oh.. I think I know what the problem is,";
+ next;
+ mes "[Lusa]";
+ mes "Ta use the guide, first ya need to equip it. ^ff0000 To open the equipment window the Shortcut key is Alt + E.^000000";
+ next;
+ mes "[Lusa]";
+ mes "Sometimes I forget ta do that too! ^ff0000Drag the item from your inventory to the appropriate slot in the equipment window. Alternatively you can double click the item in inventory.^000000";
+ next;
+ break;
+ case 2:
+ mes "[Lusa]";
+ mes "Y'all need ta learn how to use the skill?";
+ next;
+ mes "[Lusa]";
+ mes "^ff0000To open the skill window use the short cut Alt + S. The skill will be located in the ETC tab.^000000";
+ next;
+ mes "[Lusa]";
+ mes "^ff0000You can then drag the skill to your hot bar for easy use!.^000000";
+ next;
+ mes "[Lusa]";
+ mes "... and thats how I learned that When in doubt, let your peco do the thinkin'.";
+ next;
+ break;
+ case 3:
+ mes "[Lusa]";
+ mes "Well, I don't think that you are quite ready to get a shootin iron. So the training book only shows ya skills that don't need guns.";
+ next;
+ break;
+ case 4:
+ break;
+ }
+ mes "[Lusa]";
+ mes "Do ya have any other questions?";
+ next;
+ }
+ mes "[Lusa]";
+ mes "If ya need more questions you can always come back ta me.";
+ close2;
+ cutin "", 255;
+ end;
+ case 5:
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (Class == Job_Gunslinger) {
+ if (!nov_3_guns && BaseLevel < 21) {
+ mes "[Lusa]";
+ mes "Oh! Are you just darling, a newly minted gunslinger!";
+ next;
+ mes "[Lusa]";
+ mes "Why your shootin iron looks shinier then a silver zeny! Do ya need anything?";
+ next;
+ if(select("Can you help me get to Einbroch?", "No, thanks.") == 1) {
+ mes "[Lusa]";
+ mes "Sure, why not? Make sure to spend some time trainin!";
+ next;
+ mes "[Lusa]";
+ mes "Get over there ya scamp!";
+ close2;
+ warp "que_ng", 150, 167;
+ end;
+ }
+ mes "[Lusa]";
+ mes "Oh, I am glad to hear that you are so strong!";
+ close2;
+ cutin "", 255;
+ end;
+ } else if (nov_3_guns > 0 && nov_3_guns < 7) {
+ mes "[Lusa]";
+ mes "Ah, still in basic training eh? You're not carelessly using Butterfly Wings, right?";
+ next;
+ mes "[Lusa]";
+ mes "Are you going to Einbroch to complete basic training?";
+ next;
+ if(select("Can you help me get to Einbroch?", "No, I have other things to do.") == 1) {
+ mes "[Lusa]";
+ mes "Sure, why not? Make sure to spend some time trainin!";
+ next;
+ mes "[Lusa]";
+ mes "Get over there ya scamp!";
+ close2;
+ warp "que_ng", 150, 167;
+ end;
+ }
+ mes "[Lusa]";
+ mes "Oh, is that so? If you wish to go to Einbroch but not take the Airship, come speak to me.";
+ mes "Because you're still training, I will send you there for free.";
+ close2;
+ cutin "", 255;
+ end;
+ } else if (nov_3_guns == 7) {
+ emotion e_ok;
+ mes "[Lusa]";
+ mes "Ah you're back, and now wearing lovely Gunslinger clothing! It suits you well, congratulations!";
+ next;
+ mes "[Lusa]";
+ mes "I just received the news from my brother regarding your achievement of completing basic training.";
+ next;
+ select("Brother?");
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "Huh? My brother did not tell you? My brother is the one in charge of Basic Training.";
+ next;
+ mes "[Lusa]";
+ mes "Louie and Lusa are very similar names, right?";
+ next;
+ select("I guess so...");
+ cutin "aca_gung_01.bmp", 2;
+ mes "[Lusa]";
+ mes "Ha ha~ Well, our relationship is not really that important.";
+ next;
+ mes "[Lusa]";
+ mes "I have been assigned to conduct Combat Training for the Gunslinger guild.";
+ next;
+ select("Why you?");
+ mes "[Lusa]";
+ mes "Gunslingers are very fond of freedom, so the Guild had limited choices to choose from.";
+ next;
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "They suddenly called me to do this. Frankly I think it's a bit absurd.";
+ next;
+ mes "[Lusa]";
+ mes "But on the basis of there being no previous Combat Training before, I have agreed to help.";
+ next;
+ mes "[Lusa]";
+ mes "So it was decided that we would use this opporunity to help get rid of some of the monsters near Prontera and Izlude.";
+ next;
+ mes "[Lusa]";
+ mes "It should help the people of those areas that are plagued by the same monsters every day.";
+ next;
+ mes "[Lusa]";
+ mes "In accordance with the principles of guilds, the Combat Training is not mandatory.";
+ next;
+ mes "[Lusa]";
+ mes "Once you complete a task, talk to me again to complete to process.";
+ next;
+ nov_3_guns = 8;
+ erasequest 5148;
+ mes "[Lusa]";
+ mes "Well that's all! If a task proves to be too difficult you can cancel at any time, so please don't worry.";
+ close2;
+ cutin "", 255;
+ end;
+ } else if (nov_3_guns == 8 && BaseLevel < 21) {
+ .@gun_quest_01 = questprogress(5149, HUNTING);
+ .@gun_quest_02 = questprogress(5150, HUNTING);
+ .@gun_quest_03 = questprogress(5151, HUNTING);
+ .@gun_quest_04 = questprogress(5152, HUNTING);
+
+ if (!.@gun_quest_01 && !.@gun_quest_02 && !.@gun_quest_03 && !.@gun_quest_04) {
+ mes "[Lusa]";
+ mes "Haven't started your basic combat training yet have you? What do you want to know about training?";
+ next;
+ switch(select("How long can I train for?", "Where do I receive tasks for training?", "Why do combat training?", "Cancel")) {
+ case 1:
+ mes "[Lusa]";
+ mes "Basic combat training can be performed until Base Level 20.";
+ next;
+ mes "[Lusa]";
+ mes "You must've thought that the training would be pretty low because this is still the beginning.";
+ close2;
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Lusa]";
+ mes "Sorry! Did I not mention this?";
+ next;
+ mes "[Lusa]";
+ mes "You can choose any task you wish from the requests on my desk near the entrance.";
+ close2;
+ cutin "", 255;
+ end;
+ case 3:
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "Right, ah, why? Well, The Gunslinger guild didn't have any combat training in the beginning.";
+ next;
+ mes "[Lusa]";
+ mes "So they suddenly asked me to perform combat training for new recruits.";
+ next;
+ mes "[Lusa]";
+ mes "This training is not mandatory if you do not want to do it.";
+ close2;
+ cutin "", 255;
+ end;
+ case 4:
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ .@gun_tok = 0;
+ if (.@gun_quest_01 == 2 || .@gun_quest_02 == 2 || .@gun_quest_03 == 2 || .@gun_quest_04 == 2) {
+ if (.@gun_quest_01 == 2) {
+ mes "[Lusa]";
+ mes "You finished <Assignment A>?";
+ next;
+ mes "[Lusa]";
+ mes "Wow! You did perfectly! I have confirmed the 10 Hornets. Kids will be happy.";
+ next;
+ erasequest 5149;
+ getexp 700, 450;
+ getitem 7059, 1; // Cargo_Free_Ticket
+ mes "After looking over the report, you receive experience and a Kafra Storage Coupon.";
+ next;
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_02 == 2) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You finished <Assignment B>?";
+ else
+ mes "You finished <Assignment B> too?";
+ next;
+ mes "[Lusa]";
+ mes "Wow! You did perfect! I have confirmed the 10 Roda Frogs. Tonight I should get a good sleep.";
+ next;
+ erasequest 5150;
+ getexp 950, 590;
+ getitem 7059, 1; // Cargo_Free_Ticket
+ mes "After looking over the report, you receive experience and a Kafra Storage Coupon.";
+ next;
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_03 == 2) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You finished <Assignment C>?";
+ else
+ mes "You finished <Assignment C> too?";
+ next;
+ mes "[Lusa]";
+ mes "Wow! You did perfect! I have confirm the 10 Savage Babes. Students who want to develop specialist pets must be very happy.";
+ next;
+ erasequest 5151;
+ getexp 850, 540;
+ getitem 7059, 1; // Cargo_Free_Ticket
+ mes "After looking over the report, you receive experience and a Kafra Storage Coupon.";
+ next;
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_04 == 2) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You finished <Assignment D>?";
+ else
+ mes "You finished <Assignment D> too?";
+ next;
+ mes "[Lusa]";
+ mes "Wow! You did perfect! I have confirmed the 10 Rockers. Were they hard to catch?";
+ next;
+ erasequest 5152;
+ getexp 690, 470;
+ getitem 7059, 1; // Cargo_Free_Ticket
+ mes "After looking over the report, you receive experience and a Kafra Storage Coupon.";
+ next;
+ }
+ mes "[Lusa]";
+ mes "I have finished processing your completed tasks. Would you like to cancel any existing tasks?";
+ next;
+ if(select("Yes", "No") == 2) {
+ mes "[Lusa]";
+ mes "Okay, good luck continuing your training!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ .@gun_quest_01 = questprogress(5149, HUNTING);
+ .@gun_quest_02 = questprogress(5150, HUNTING);
+ .@gun_quest_03 = questprogress(5151, HUNTING);
+ .@gun_quest_04 = questprogress(5152, HUNTING);
+ if (!.@gun_quest_01 || !.@gun_quest_02 || !.@gun_quest_03 || !.@gun_quest_04) {
+ mes "[Lusa]";
+ mes "Huh? You do not have any assignments to cancel. Are you sure you have them?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ if (.@gun_quest_01 == 1 || .@gun_quest_02 == 1 || .@gun_quest_03 == 1 || .@gun_quest_04 == 1) {
+ mes "[Lusa]";
+ mes "You still have some assignments, are they too difficult? Do you want to cancel them?";
+ next;
+ if(select("Cancel Assignment", "Nevermind") == 2) {
+ mes "[Lusa]";
+ mes "Well then, continue to impress!";
+ close;
+ cutin "", 255;
+ end;
+ }
+ .@gun_tok = 0;
+ if (.@gun_quest_01 == 1) {
+ mes "[Lusa]";
+ mes "You are currently doing <Assignment A>.";
+ next;
+ mes "[Lusa]";
+ mes "Hornets are not easy to deal with, huh? Do you want to cancel the assignment?";
+ next;
+ mes "[Lusa]";
+ mes "If you do cancel the assignment, you will be unable to receive the reward you know?";
+ next;
+ if(select("Cancel Assignment", "Nevermind") == 1) {
+ erasequest 5149;
+ mes "[Lusa]";
+ mes "Oh... Hornets are too tough?";
+ next;
+ mes "[Lusa]";
+ mes "I have cancelled <Assignment A>. Now you don't have to worry about it.";
+ next;
+ }
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_02 == 1) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You are currently doing <Assignment B>.";
+ else
+ mes "You are also currently doing <Assignment B>.";
+ next;
+ mes "[Lusa]";
+ mes "Roda Frogs are not easy to deal with, huh? Do you want to cancel the assignment?";
+ next;
+ mes "[Lusa]";
+ mes "If you do cancel the assignment, you will be unable to receive the reward you know?";
+ next;
+ if(select("Cancel Assignment", "Nevermind") == 1) {
+ erasequest 5150;
+ mes "[Lusa]";
+ mes "Oh... Roda Frogs are too tough?";
+ next;
+ mes "[Lusa]";
+ mes "I have cancelled <Assignment B>. Now you don't have to worry about it.";
+ next;
+ }
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_03 == 1) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You are currently doing <Assignment C>.";
+ else
+ mes "You are also currently doing <Assignment C>.";
+ next;
+ mes "[Lusa]";
+ mes "Savage Babe are not easy to deal with, huh? Do you want to cancel the assignment?";
+ next;
+ mes "[Lusa]";
+ mes "If you do cancel the assignment, you will be unable to receive the reward you know?";
+ next;
+ if(select("Cancel Assignment", "Nevermind") == 1) {
+ erasequest 5151;
+ mes "[Lusa]";
+ mes "Oh... Savage Babe are too tough?";
+ next;
+ mes "[Lusa]";
+ mes "I have cancelled <Assignment C>. Now you don't have to worry about it.";
+ next;
+ }
+ .@gun_tok = 1;
+ }
+ if (.@gun_quest_04 == 1) {
+ mes "[Lusa]";
+ if (.@gun_tok == 0)
+ mes "You are currently doing <Assignment D>.";
+ else
+ mes "You are also currently doing <Assignment D>.";
+ mes "[Lusa]";
+ mes "Rockers are not easy to deal with, huh? Do you want to cancel the assignment?";
+ next;
+ mes "[Lusa]";
+ mes "If you do cancel the assignment, you will be unable to receive the reward you know?";
+ next;
+ if(select("Cancel Assignment", "Nevermind") == 1) {
+ erasequest 5152;
+ mes "[Lusa]";
+ mes "Oh... Rockers are too tough?";
+ next;
+ mes "[Lusa]";
+ mes "I have cancelled <Assignment D>. Now you don't have to worry about it.";
+ next;
+ }
+ }
+ mes "[Lusa]";
+ mes "I have cancelled all the assignments you wished to cancel. If you have a hard time with any others, please come see me.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (nov_3_guns == 8 && BaseLevel > 20) {
+ .@gun_quest_01 = questprogress(5149, HUNTING);
+ .@gun_quest_02 = questprogress(5150, HUNTING);
+ .@gun_quest_03 = questprogress(5151, HUNTING);
+ .@gun_quest_04 = questprogress(5152, HUNTING);
+ .@gun_quest_all = .@gun_quest_01 + .@gun_quest_02 + .@gun_quest_03 + .@gun_quest_04;
+ mes "[Lusa]";
+ mes "Times flies, your basic training is coming to an end!";
+ next;
+ mes "[Lusa]";
+ mes "You have worked hard during this period! You have become a good marksman.";
+ next;
+ if (.@gun_quest_all > 0) {
+ mes "[Lusa]";
+ mes "However, you have still not completed your tasks.";
+ next;
+ mes "[Lusa]";
+ mes "You cannot receive any rewards if you do not complete the tasks assigned to you.";
+ next;
+ if(select("What?! I'll go complete them!", "I'm done with training!") == 1) {
+ mes "[Lusa]";
+ mes "Take care!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (.@gun_quest_01 == 2)
+ getexp 700, 450;
+ if (.@gun_quest_02 == 2)
+ getexp 950, 590;
+ if (.@gun_quest_03 == 2)
+ getexp 850, 540;
+ if (.@gun_quest_04 == 2)
+ getexp 690, 470;
+
+ if (questprogress(5149))
+ erasequest 5149;
+ if (questprogress(5150))
+ erasequest 5150;
+ if (questprogress(5151))
+ erasequest 5151;
+ if (questprogress(5152))
+ erasequest 5152;
+ if (.@gun_quest_01 == 2 || .@gun_quest_02 == 2 || .@gun_quest_03 == 2 || .@gun_quest_04 == 2) {
+ getitem 7059, 1; // Cargo_Free_Ticket
+ mes "After looking over the report, you receive experience and a Kafra Storage Coupon.";
+ }
+ next;
+ }
+ nov_3_guns = 9;
+ mes "[Lusa]";
+ mes "Your Gunslinger basic training is now over.";
+ close2;
+ cutin "", 255;
+ end;
+ } else if (nov_3_guns == 9) {
+ mes "[Lusa]";
+ mes "Oh my god! It's you again!";
+ next;
+ select("How are you?");
+ mes "[Lusa]";
+ mes "Same old, same old. Every day teaching newbies about Gunslingers. But I love it.";
+ next;
+ mes "[Lusa]";
+ mes "Oh yeah! My brother said he hasn't seen you for a long time. Be sure to take some time to visit him.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lusa]";
+ mes "Howdy! It's nice to see you again.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Lusa]";
+ mes "Howdy!";
+ mes "Huh! You seem to have transferred into a different class, why have you come here?";
+ next;
+ if(select("To become a Gunslinger", "Leave") == 2) {
+ cutin "aca_gung_02.bmp", 2;
+ mes "[Lusa]";
+ mes "Huh? Huh? Where are you going?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Lusa]";
+ mes "You cannot have more than one job. But you seem really serious to learn.";
+ next;
+ mes "[Lusa]";
+ mes "Since this is my job, and because it's no trouble, I will give you a simple explaination!";
+ next;
+ mes "[Lusa]";
+ mes "Gunslingers is a class with long-range attacks. However, unlike arrows, bullets are expensive. This tends to give beginners some reason for concern.";
+ next;
+ mes "[Lusa]";
+ mes "Is that enough?";
+ next;
+ select("Isn't that a little too simple?");
+ mes "[Lusa]";
+ mes "Huh, is it? What else do you want to know?";
+ next;
+ while(1) {
+ switch(select("Stats", "Skills", "Weapons", "Nevermind.")) {
+ case 1:
+ mes "[Lusa]";
+ mes "Gunslingers is a long-range attack class, so hand agility (DEX) will be very important.";
+ next;
+ mes "[Lusa]";
+ mes "If you want to increase your attack power, then you must strengthen your hands.";
+ next;
+ break;
+ case 2:
+ mes "[Lusa]";
+ mes "Gunslinger skills are not like other classes. Each weapon type has skills that can be specifically used with them.";
+ next;
+ mes "[Lusa]";
+ mes "Like with other classes, there is no standard toward which skills you should learn.";
+ next;
+ break;
+ case 3:
+ mes "[Lusa]";
+ mes "Gunslingers have five different kinds of guns.";
+ next;
+ mes "[Lusa]";
+ mes "Revolvers have low hit rates, but the attack speed is fast.";
+ next;
+ mes "[Lusa]";
+ mes "Rifles are average in their performance, and is typically the weapon of choice for new Gunslingers.";
+ next;
+ mes "[Lusa]";
+ mes "Shotguns have strong attack power, but pretty low attack speeds.";
+ next;
+ mes "[Lusa]";
+ mes "Gatling guns have quite a fast attack speed, but the attack power is low.";
+ next;
+ mes "[Lusa]";
+ mes "Gernade Launchers can be used for strong ground attacks, but the bullets will be consumed quickly.";
+ next;
+ break;
+ case 4:
+ mes "[Lusa]";
+ mes "Phew~ I hope I answered all your questions. This is the first time I've seen someone want to study other classes.";
+ next;
+ mes "[Lusa]";
+ mes "Take care!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Lusa]";
+ mes "Do you have any other questions?";
+ next;
+ }
+ mes "[Lusa]";
+ mes "Phew~ I hope I answered all your questions. This is the first time I've seen someone want to study other classes.";
+ next;
+ mes "[Lusa]";
+ mes "Take care!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "", 255;
+ end;
+}
+
+iz_ac02_a,142,85,6 duplicate(Lusa#ac) Lusa#ac_a 4_F_GUNSLINGER
+iz_ac02_b,142,85,6 duplicate(Lusa#ac) Lusa#ac_b 4_F_GUNSLINGER
+iz_ac02_c,142,85,6 duplicate(Lusa#ac) Lusa#ac_c 4_F_GUNSLINGER
+iz_ac02_d,142,85,6 duplicate(Lusa#ac) Lusa#ac_d 4_F_GUNSLINGER
+
+// - Lusa's desk
+// -----------------------------------------------------------------------------
+iz_ac02,131,82,4 script Lusa's Desk#ac CLEAR_NPC,{
+ if (nov_3_guns == 8) {
+ mes "[Lusa's Desk]";
+ mes "There are lots of files on the desk, they seem to be tasks from Prontera and Izlude residents.";
+ next;
+ } else {
+ mes "[Lusa's Desk]";
+ mes "There is a stack of papers on the desk.";
+ close;
+ }
+ while(1) {
+ .@gun_quest_01 = questprogress(5149, HUNTING);
+ .@gun_quest_02 = questprogress(5150, HUNTING);
+ .@gun_quest_03 = questprogress(5151, HUNTING);
+ .@gun_quest_04 = questprogress(5152, HUNTING);
+
+ if (!.@gun_quest_01)
+ .@gque_01$ = "^000000Available^000000";
+ else if (.@gun_quest_01 == 1)
+ .@gque_01$ = "^0000FFIn Progress^000000";
+ else if (.@gun_quest_01 == 2)
+ .@gque_01$ = "^FF0000Not Available^000000";
+ else
+ .@gque_01$ = "^FF0000Error^000000";
+
+ if (!.@gun_quest_02)
+ .@gque_02$ = "^000000Available^000000";
+ else if (.@gun_quest_02 == 1)
+ .@gque_02$ = "^0000FFIn Progress^000000";
+ else if (.@gun_quest_02 == 2)
+ .@gque_02$ = "^FF0000Not Available^000000";
+ else
+ .@gque_02$ = "^FF0000Error^000000";
+
+ if (!.@gun_quest_03)
+ .@gque_03$ = "^000000Available^000000";
+ else if (.@gun_quest_03 == 1)
+ .@gque_03$ = "^0000FFIn Progress^000000";
+ else if (.@gun_quest_03 == 2)
+ .@gque_03$ = "^FF0000Not Available^000000";
+ else
+ .@gque_03$ = "^FF0000Error^000000";
+
+ if (!.@gun_quest_04)
+ .@gque_04$ = "^000000Available^000000";
+ else if (.@gun_quest_04 == 1)
+ .@gque_04$ = "^0000FFIn Progress^000000";
+ else if (.@gun_quest_04 == 2)
+ .@gque_04$ = "^FF0000Not Available^000000";
+ else
+ .@gque_04$ = "^FF0000Error^000000";
+
+ switch(select("Assignment A ("+.@gque_01$+")", "Assignment B ("+.@gque_02$+")", "Assignment C ("+.@gque_03$+")", "Assignment D ("+.@gque_04$+")", "Cancel")) {
+ case 1:
+ if (!.@gun_quest_01) {
+ mes "This is the <Assignment A> information.";
+ mes "Client: Children";
+ mes "On the outskirts of the village is a very bad Hornet, because of this, the children cannot play outside. Please get rid of 10 Hornets.";
+ next;
+ if(select("Take Assignment", "Look at Other Assignments", "Cancel") == 1) {
+ setquest 5149;
+ mes "You have received ^A2563E<Assignment A>^000000 details. Please press ALT + U to check them.";
+ next;
+ }
+ } else if (.@gun_quest_01 == 1) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I am already doing this task currently. Lusa said if I ever wanted to abondon the assignment that I should talk to her.";
+ next;
+ } else if (.@gun_quest_01 == 2) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I have already completed this assignment. I should talk to Lusa for my reward.";
+ next;
+ }
+ break;
+ case 2:
+ if (!.@gun_quest_02) {
+ mes "This is the <Assignment B> information.";
+ mes "Client: Resident H";
+ mes "Recently, Roda Frogs have been keeping me awake at night. Get rid of 10 Roda Frogs so I can get a good nights rest.";
+ next;
+ if(select("Take Assignment", "Look at Other Assignments", "Cancel") == 1) {
+ setquest 5150;
+ mes "You have received ^A2563E<Assignment B>^000000 details. Please press ALT + U to check them.";
+ next;
+ }
+ } else if (.@gun_quest_02 == 1) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I am already doing this task currently. Lusa said if I ever wanted to abondon the assignment that I should talk to her.";
+ next;
+ } else if (.@gun_quest_02 == 2) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I have already completed this assignment. I should talk to Lusa for my reward.";
+ next;
+ }
+ break;
+ case 3:
+ if (!.@gun_quest_03) {
+ mes "This is the <Assignment C> information.";
+ mes "Client: Cute Pet Research Student";
+ mes "I want a cute pet of my own to walk around with. Can you help me catch 10 Savage Babes?";
+ next;
+ if(select("Take Assignment", "Look at Other Assignments", "Cancel") == 1) {
+ setquest 5151;
+ mes "You have received ^A2563E<Assignment C>^000000 details. Please press ALT + U to check them.";
+ next;
+ }
+ } else if (.@gun_quest_03 == 1) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I am already doing this task currently. Lusa said if I ever wanted to abondon the assignment that I should talk to her.";
+ next;
+ } else if (.@gun_quest_03 == 2) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I have already completed this assignment. I should talk to Lusa for my reward.";
+ next;
+ }
+ break;
+ case 4:
+ if (!.@gun_quest_04) {
+ mes "This is the <Assignment D> information.";
+ mes "Client: Volunteer Bards";
+ mes "I heard some Rockers were having a singing contest, but I got lost, can you help me catch 10 Rockers? One day Rockers will disappear from the world!";
+ next;
+ if(select("Take Assignment", "Look at Other Assignments", "Cancel") == 1) {
+ setquest 5152;
+ mes "You have received ^A2563E<Assignment D>^000000 details. Please press ALT + U to check them.";
+ next;
+ }
+ } else if (.@gun_quest_04 == 1) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I am already doing this task currently. Lusa said if I ever wanted to abondon the assignment that I should talk to her.";
+ next;
+ } else if (.@gun_quest_04 == 2) {
+ mes "["+strcharinfo(0)+"]";
+ mes "I have already completed this assignment. I should talk to Lusa for my reward.";
+ next;
+ }
+ break;
+ case 5:
+ break;
+ }
+ mes "[Lusa's desk]";
+ mes "There are lots of files on the desk, they seem to be tasks from Prontera and Izlude residents.";
+ next;
+ }
+}
+
+iz_ac02_a,131,82,4 duplicate(Lusa's Desk#ac) Lusa's Desk#ac_a CLEAR_NPC
+iz_ac02_b,131,82,4 duplicate(Lusa's Desk#ac) Lusa's Desk#ac_b CLEAR_NPC
+iz_ac02_c,131,82,4 duplicate(Lusa's Desk#ac) Lusa's Desk#ac_c CLEAR_NPC
+iz_ac02_d,131,82,4 duplicate(Lusa's Desk#ac) Lusa's Desk#ac_d CLEAR_NPC
+
+// - Staff sent by guild
+// -----------------------------------------------------------------------------
+iz_ac02,162,86,4 script Guild Staff#ac 4W_M_02,{
+ if (!checkweight(1301, 1)) {
+ mes "- You are carrying too many items. -";
+ close;
+ }
+ if (nov_3_guns < 8) {
+ mes "[Sharp Snake's Fang]";
+ mes "Yesssssss? I wass sssent by the academy.";
+ close;
+ } else if (nov_3_guns > 7) {
+ disable_items;
+ }
+ mes "[Sharp Snake's Fang]";
+ mes "I am ^A2563ESharp Snake's Fang^000000 from the Gunslinger Guild. What do you need?";
+ next;
+ if(select("Exchange Guns", "Just Saying Hello") == 2) {
+ mes "[Sharp Snake's Fang]";
+ mes "You seem to be that guy our brother mentioned.";
+ next;
+ mes "[Sharp Snake's Fang]";
+ mes "You don't need to worry, he said you're doing great!";
+ close2;
+ enable_items;;
+ end;
+ }
+ mes "[Sharp Snake's Fang]";
+ mes "Do you wish to exchange your guild issued weapon?";
+ next;
+ mes "[Sharp Snake's Fang]";
+ mes "Let's first check your gun's condition.";
+ next;
+ if (getequipname(EQI_HAND_R) == "") {
+ mes "[Sharp Snake's Fang]";
+ mes "If you want to proceed, you need to have your weapon equipped.";
+ close2;
+ enable_items;
+ end;
+ } else {
+ .@gun = getequipid(EQI_HAND_R);
+ }
+ mes "[Sharp Snake's Fang]";
+ mes "Let's see...";
+ next;
+ if (.@gun == Novice_Revolver) {
+ .@gun_code$ = "RV";
+ .@now_gun$ = "Revolver";
+ mes "[Sharp Snake's Fang]";
+ mes "You want to exchange your Guild issued Revolver?";
+ next;
+ } else if (.@gun == Novice_Rifle) {
+ .@gun_code$ = "RF";
+ .@now_gun$ = "Rifle";
+ mes "[Sharp Snake's Fang]";
+ mes "You want to exchange your Guild issued Rifle?";
+ next;
+ } else if (.@gun == Novice_Shotgun) {
+ .@gun_code$ = "SG";
+ .@now_gun$ = "Shotgun";
+ mes "[Sharp Snake's Fang]";
+ mes "You want to exchange your Guild issued Shotgun?";
+ next;
+ } else if (.@gun == Novice_Gatling) {
+ .@gun_code$ = "GT";
+ .@now_gun$ = "Gatling";
+ mes "[Sharp Snake's Fang]";
+ mes "You want to exchange your Guild issued Gatling Gun?";
+ next;
+ } else if (.@gun == Novice_Grenade_Launcher) {
+ .@gun_code$ = "GL";
+ .@now_gun$ = "Grenade Launcher";
+ mes "[Sharp Snake's Fang]";
+ mes "You want to exchange your Guild issued Grenade Launcher?";
+ next;
+ } else {
+ mes "[Sharp Snake's Fang]";
+ mes "The gun you are using is was not provided by the guild.";
+ close;
+ }
+ mes "[Sharp Snake's Fang]";
+ mes "The gun looks to be in good condition.";
+ next;
+ mes "[Sharp Snake's Fang]";
+ mes "Please select the novice weapon you wish to exchange for your "+.@now_gun$+"!";
+ next;
+ switch(select("Exchange for Revolver", "Exchange for Rifle", "Exchange for Shotgun", "Exchange for Gatling Gun", "Exchange for Grenade Launcher", "Cancel")) {
+ case 1:
+ if (.@gun == 13116) {
+ mes "[Sharp Snake's Fang]";
+ mes "You already have that gun, just use it!";
+ close2;
+ enable_items;
+ end;
+ } else {
+ delequip EQI_HAND_R;
+ getitem 13116, 1; // Novice_Revolver
+ }
+ break;
+ case 2:
+ if (.@gun == 13180) {
+ mes "[Sharp Snake's Fang]";
+ mes "You already have that gun, just use it!";
+ close2;
+ enable_items;
+ end;
+ } else {
+ delequip EQI_HAND_R;
+ getitem 13180, 1; // Novice_Rifle
+ }
+ break;
+ case 3:
+ if (.@gun == 13181) {
+ mes "[Sharp Snake's Fang]";
+ mes "You already have that gun, just use it!";
+ close2;
+ enable_items;
+ end;
+ } else {
+ delequip EQI_HAND_R;
+ getitem 13181, 1; // Novice_Shotgun
+ }
+ break;
+ case 4:
+ if (.@gun == 13182) {
+ mes "[Sharp Snake's Fang]";
+ mes "You already have that gun, just use it!";
+ close2;
+ enable_items;
+ end;
+ } else {
+ delequip EQI_HAND_R;
+ getitem 13182, 1; // Novice_Gatling
+ }
+ break;
+ case 5:
+ if (.@gun == 13183) {
+ mes "[Sharp Snake's Fang]";
+ mes "You already have that gun, just use it!";
+ close2;
+ enable_items;
+ end;
+ } else {
+ delequip EQI_HAND_R;
+ getitem 13183, 1; // Novice_Grenade_Launcher
+ }
+ break;
+ case 6:
+ break;
+ }
+ mes "[Sharp Snake's Fang]";
+ mes "Gun control management number ^FF0000"+.@gun_code$+""+rand(0,9)+""+rand(0,9)+""+rand(0,9)+""+rand(0,9)+""+rand(0,9)+""+rand(0,9)+"^000000.";
+ next;
+ mes "[Sharp Snake's Fang]";
+ mes "Are there any issues?";
+ next;
+ select("No issues.");
+ mes "[Sharp Snake's Fang]";
+ mes "Cherish your gun!";
+ close2;
+ enable_items;
+ end;
+}
+
+iz_ac02_a,162,86,4 duplicate(Guild Staff#ac) Guild Staff#ac_a 4W_M_02
+iz_ac02_b,162,86,4 duplicate(Guild Staff#ac) Guild Staff#ac_b 4W_M_02
+iz_ac02_c,162,86,4 duplicate(Guild Staff#ac) Guild Staff#ac_c 4W_M_02
+iz_ac02_d,162,86,4 duplicate(Guild Staff#ac) Guild Staff#ac_d 4W_M_02
+
+// =============================================================================
+// = Taekwon
+// =============================================================================
+
+// - Arang
+// -----------------------------------------------------------------------------
+iz_ac02,70,85,5 script Arang#ac 4_F_TAEKWON,{
+ mes "[Arang]";
+ mes "Hi, Good morning!";
+ emotion e_ho;
+ cutin "arang03.bmp", 0;
+ next;
+ if (Class == Job_Novice) {
+ if (questprogress(4269) == 2) {
+ if (nov_3_taekwon == 1) {
+ if (JobLevel >= 10) {
+ cutin "arang01.bmp", 0;
+ mes "[Arang]";
+ mes "It's time to choose your job? How about Taekwon "+(Sex ? "boy" : "girl")+"? You may be a nice adult like me.";
+ next;
+ }
+ while (1) {
+ switch(select("People following the Taekwon way", "I want to follow the Taekwon way!!!", "Good morning! Now it is...", "End Conversation")) {
+ case 1:
+ mes "[Arang]";
+ mes "Do you want to know about taekwon boy/girl? You want to be a cool guy like me right?";
+ next;
+ mes "[Arang]";
+ mes "Make the world wonderful by making a strong body with the right spirit. That's the Taekwondo motto!";
+ next;
+ mes "[Arang]";
+ mes "Later if you are trained to be a stronger body, you can change your job to ^FF0000Taekwon Master^000000 or a ^FF0000 Soul Linker ^000000.";
+ next;
+ mes "[Arang]";
+ mes "It is not an easy way. So I don't like to recommend it to you if you aren't fully prepared. But it is definitely a nice and great way to follow!!";
+ next;
+ if (isequipped(2942) > 0 || countitem(2942) > 0) {
+ mes "[Arang]";
+ mes "Introduction to the class may let you know about what Taekwon in more detail.";
+ next;
+ } else {
+ mes "[Arang]";
+ mes "If you are really anxious about Taekown, I would like to recommend you a brief introduction. Will you use it?";
+ next;
+ if(select("After I look around more.", "Yes, let's do this!") == 1) {
+ mes "[Arang]";
+ mes "Every adventurer may have their own job! Hope you can find what you want!";
+ next;
+ } else {
+ getitem 2942, 1; // Taekwon_Manual
+ mes "[Arang]";
+ mes "Go to the [Misc] tab on Skill Window after equipping the Manual and there you will see some skills.";
+ next;
+ mes "[Arang]";
+ mes "^FF0000Flying Kick^000000 is the skill to approach rapidly and attack the enemy! It fully contains the typical feature of Taekwon!";
+ next;
+ mes "[Arang]";
+ mes "^FF0000Warm Wind^000000 is the skill to change the feature of attacks. This is the essential skill for ^FF0000Taekwon unable to use weapons^000000.";
+ next;
+ mes "[Arang]";
+ mes "While taking the Quest, experience the skills of a Taekwon! You could meet an adept trainer on the 1st floor.";
+ next;
+ }
+ }
+ break;
+ case 2:
+ mes "[Arang]";
+ mes "Want to follow the Taekwon way? Let me see....";
+ next;
+ if (JobLevel >= 10) {
+ mes "[Arang]";
+ mes "Taekwon is the tough way training himself rather than learning from somebody. However, if you want to follow, I will recommend you to a trainer.";
+ next;
+ mes "[Arang]";
+ mes "Training is on you, but he will give you the direction for training. I can take you about there. Want to go now?";
+ next;
+ if(select("Let me think a little more.", "Let's go!!") == 1) {
+ mes "[Arang]";
+ mes "Choose it with discretion. It is a matter of your future adventure.";
+ next;
+ } else {
+ mes "[Arang]";
+ mes "You can find a boy with the same appearance as me, when you get in the town through ^FF0000 the west entrance^000000, and continue follow the way ^FF0000to the north^000000 after passing the pub house but just before the archer town.";
+ next;
+ setquest 13101;
+ cutin "", 255;
+ warp "pay_fild08", 148, 76;
+ end;
+ }
+ } else {
+ mes "[Arang]";
+ mes "To follow the Taekwon way, you have to get to job level 10. To be a Taekwon, train yourself until you get to job level 10!";
+ next;
+ mes "[Arang]";
+ mes "If you feel difficult in training alone, make a visit to the trainer on the 1st floor.";
+ next;
+ }
+ break;
+ case 3:
+ mes "[Arang]";
+ mes "Ahahaha.. It is already time? While I am inside... Don't worry.";
+ next;
+ break;
+ case 4:
+ mes "[Arang]";
+ mes "Have a good day!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ cutin "arang01.bmp", 0;
+ mes "[Arang]";
+ mes "If you are interested in being a Taekwon making a healthy body with strong sprit, you can learn a lot here.";
+ next;
+ mes "[Arang]";
+ mes "What do you think? Are you interested in being a Taekwon? I don't push you to do! But if you do, I may become your trainer.. So..";
+ cutin "arang02.bmp", 0;
+ next;
+ if(select("I have interest!", "I have interest in you!") == 1) {
+ mes "[Arang]";
+ mes "Is that so!? You are!? Yaho! Now I am a teacher! Now, ask me whatever!";
+ nov_3_taekwon = 1;
+ emotion e_heh;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Arang]";
+ mes "Hahaha.. You are interested in me?";
+ emotion e_an;
+ cutin "arang03.bmp", 0;
+ next;
+ mes "Suddenly, you see Arang's foot flying towards you.";
+ specialeffect2 EF_TRIPLEATTACK;
+ emotion e_wah, 1;
+ next;
+ cutin "", 255;
+ mes "All you see are stars...";
+ sc_start SC_BLIND,10000,0;
+ sc_start SC_STUN,10000,0;
+ percentheal -90, 0;
+ setquest 13102;
+ close2;
+ warp "iz_ac01", 53, 49;
+ end;
+ }
+ } else {
+ mes "[Arang]";
+ mes "You look like a naive beginner? If you want to get in the class, come after registering on the 1st floor.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (nov_3_taekwon > 0) {
+ if (Class == Job_Taekwon) {
+ mes "[Arang]";
+ mes "Are you diligently training? Once you are trained well, you could become a Taekwon Master or a Soul Linker.";
+ close2;
+ } else if (Class == Job_Star_Gladiator) {
+ mes "[Arang]";
+ mes "You became a nice Taekwon Master!? Please keep in mind power is followed by responsibility.";
+ close2;
+ } else if (Class == Job_Soul_Linker) {
+ mes "[Arang]";
+ mes "Handling spirits is a very delicate job to do, I heard. Excellent! The adventurer led by me has grown up like this.";
+ close2;
+ } else {
+ mes "[Arang]";
+ mes "Ehra! I thought you followed the Taekwon way~~ it is regretful but everyone has their own life, hehe.";
+ close2;
+ }
+ } else {
+ mes "[Arang]";
+ mes "I am propagating the way of Taekwons!";
+ close2;
+ }
+ }
+ cutin "", 255;
+ end;
+}
+
+iz_ac02_a,70,85,5 duplicate(Arang#ac) Arang#ac_a 4_F_TAEKWON
+iz_ac02_b,70,85,5 duplicate(Arang#ac) Arang#ac_b 4_F_TAEKWON
+iz_ac02_c,70,85,5 duplicate(Arang#ac) Arang#ac_c 4_F_TAEKWON
+iz_ac02_d,70,85,5 duplicate(Arang#ac) Arang#ac_d 4_F_TAEKWON
+
+iz_ac01,53,49,0 script #acKick HIDDEN_NPC,5,5,{
+ end;
+
+ OnTouch:
+ if (questprogress(13102) == 1) {
+ mes "As I can't recall, I feel the shock that something hit me on my head.";
+ mes "^FF0000I should look for somebody to heal me nearby.^000000.";
+ erasequest 13102;
+ close;
+ } else if (questprogress(13102) == 2) {
+ erasequest 13102;
+ end;
+ }
+}
+
+iz_ac01_a,53,49,0 duplicate(#acKick) #acKick_a HIDDEN_NPC,5,5
+iz_ac01_b,53,49,0 duplicate(#acKick) #acKick_b HIDDEN_NPC,5,5
+iz_ac01_c,53,49,0 duplicate(#acKick) #acKick_c HIDDEN_NPC,5,5
+iz_ac01_d,53,49,0 duplicate(#acKick) #acKick_d HIDDEN_NPC,5,5
+
+// =============================================================================
+// = Archer
+// =============================================================================
+
+// - Archer Teacher (Marlbron)
+// -----------------------------------------------------------------------------
+iz_ac02,65,109,5 script Archer Teacher#ac 4_M_ARCHER,{
+ if (!checkweight(1304, 3)) {
+ mes "Why are you carrying so much with you? Unload it somewhere and come back.";
+ close;
+ }
+ if (Class == Job_Archer) {
+ if (nov_3_archer == 0) {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Emmm. This is?";
+ next;
+ mes "[Marlbron]";
+ mes "You were never trained by me.";
+ mes "Then, I have no interest in you.";
+ close2;
+ cutin "", 255;
+ end;
+ } else if (nov_3_archer > 0 && nov_3_archer < 9) {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "I see you received a complete education in Payon.";
+ next;
+ mes "[Marlbron]";
+ mes "Then again... you may want to learn more.";
+ next;
+ mes "[Marlbron]";
+ mes "Either way, there is nothing I can teach you.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gsmi.bmp", 2;
+ mes "[Marlbron]";
+ mes "Ah~ You've become a skilled Archer.";
+ next;
+ mes "[Marlbron]";
+ mes "The difference is great now compared to when you were a novice!";
+ next;
+ mes "[Marlbron]";
+ mes "Because of my teachings, you have grown very fast!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (Class == Job_Novice) {
+ if (questprogress(4269) == 2) {
+ if (nov_3_archer == 0) {
+ cutin "gsmi.bmp", 2;
+ mes "[Marlbron]";
+ mes "Sniff sniff! It is the smell of a novice!";
+ mes "Nice to meet you!!!";
+ mes "What brought you here?";
+ next;
+ mes "[Marlbron]";
+ mes "I can guess most, but hehehehe~~";
+ mes "Please feel comfortable and tell me everything you want!";
+ next;
+ cutin "", 255;
+ if(select("I get bored! Play with me!", "Tell me about Archers.") == 1) {
+ cutin "gbad.bmp", 2;
+ mes "[Marlbron]";
+ mes "What? Bored? Play with you?";
+ mes "You think this is just some kids playground?";
+ next;
+ mes "[Marlbron]";
+ mes "If you are bored, walk around and punch a monster in the face and see what happens.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "gsmi.bmp", 2;
+ mes "[Marlbron]";
+ mes "Oh dear~ another sheep here to get a free lesson from me.";
+ next;
+ mes "[Marlbron]";
+ mes "The main point of Archers is to use bows to attack enemies quickly from a long distance.";
+ next;
+ mes "[Marlbron]";
+ mes "Only problem is they are physically weak.";
+ mes "But, it doesn't matter if they are trained correctly.";
+ next;
+ while(1) {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "What do you want to know about an Archer? I will tell you everything~";
+ mes "With my full explanation~, you can be an excellent one.";
+ next;
+ switch(select("Archer's stats", "Archer's skills", "I want to become an Archer.", "Nevermind")) {
+ case 1:
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Are you curious about the Archer's stats?";
+ mes "Do you know the most necessary stats for Archers?";
+ next;
+ mes "[Marlbron]";
+ mes "That is ^0000cdDex^000000.";
+ next;
+ mes "[Marlbron]";
+ mes "To raise up the attacking power in other jobs, Str should be raised but Archers vary in accordance with their Dex figures.";
+ next;
+ mes "[Marlbron]";
+ mes "Here is a simple question! What is the name of the stat determining the Archer's attacking power?";
+ next;
+ select("Dex!");
+ cutin "gsmi.bmp", 2;
+ mes "[Marlbron]";
+ mes "You are correct~~";
+ next;
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "If you want to know more about the role of other stats, ^0000cdopen the status window by pressing ALT+Q.^000000";
+ next;
+ mes "[Marlbron]";
+ mes "If you are curious about stats except Dex, you can check it out.";
+ mes "If you have a job later, you can reset the stats anyway.";
+ next;
+ mes "[Marlbron]";
+ mes "Hey, just click this and that!";
+ next;
+ cutin "", 255;
+ break;
+ case 2:
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Hmm. You are interested in skills? Then, let's study ^0000cd skill^000000s.";
+ next;
+ mes "[Marlbron]";
+ mes "I thought you would better experience the skill than talking, so I prepared the experience of the archer's skill in a manual.";
+ next;
+ mes "[Marlbron]";
+ mes "Archer have a lot of very useful skills.";
+ mes "But regretfully as most of them are skills useful only with arrows and bows, you can't experience them.";
+ next;
+ mes "[Marlbron]";
+ mes "There is a useful skill without a bow... Called ^0000cdImprove Concentration^000000";
+ next;
+ mes "[Marlbron]";
+ mes "At the same time, it will reveal hidden enemies nearby.";
+ next;
+ mes "[Marlbron]";
+ mes "If you want to know more anout skill, then open the skill window by pressing the key ^0000cdALT+S^000000";
+ next;
+ mes "[Marlbron]";
+ mes "When you scoll the mouse on the skill icon, there pops up the details about the skill. Please read it.";
+ next;
+ mes "[Marlbron]";
+ mes "To use skills, click the skill icon on the skill window. Then drag and register it on the ^0000cdshortcut window^000000 to use conveniently.";
+ next;
+ mes "[Marlbron]";
+ mes "Will you go and find a hunting teacher on the 1st floor? if you do not want, then no need.";
+ next;
+ mes "[Marlbron]";
+ mes "But he may train you with a lot of useful hunting skills for you.";
+ mes "<NAVI>^4D4DFF[Battle Trainer Subino]^000000<INFO>iz_ac01,59,83,</INFO></NAVI>";
+ mes "You may visit him.";
+ next;
+ if (questprogress(14158) != 2) {
+ setquest 14158;
+ completequest 14158;
+ getitem 2822, 1; // Archer_Manual
+ }
+ cutin "", 255;
+ end;
+ case 3:
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Do you want to become an^0000cd Archer^000000?";
+ mes "It hasn't been a long time since we met together. But I am sad about saying good bye to you.";
+ next;
+ mes "[Marlbron]";
+ mes "Let me check a little while, before you change your job you have to be at job level 10.";
+ next;
+ if (JobLevel == 10) {
+ mes "[Marlbron]";
+ mes "Change conditions satisfied!!";
+ next;
+ mes "[Marlbron]";
+ mes "Do you really want to become an Archer?";
+ next;
+ if(select("Yes, change me to an Archer.", "Let me think of it a little while.") == 1) {
+ mes "[Marlbron]";
+ mes "First, let me explain some things to you about the Job Change.";
+ next;
+ mes "[Marlbron]";
+ mes "An Archer's hometown is ^0000cdPayon^000000; Which has a very long history.";
+ next;
+ mes "[Marlbron]";
+ mes "When you are feeling fatigued, you can go there.";
+ mes "You will be given a warm hometown welcome.";
+ next;
+ mes "[Marlbron]";
+ mes "The Archers Guild is located to the ^0000cdNorth of Payon Archer Village^000000.";
+ next;
+ mes "[Marlbron]";
+ mes "I will take you to the gates of Payon.";
+ mes "I would love to accompany you the rest of the way, but you must do this alone.";
+ mes "I'll give you the directions which you must remember.";
+ next;
+ cutin "paymap1.bmp", 3;
+ mes "[Marlbron]";
+ mes "Here is where I will send you to.";
+ mes "Once you arrive, you will see the area marked by this ^0000cdRed Circle^000000. Go through there, then...";
+ next;
+ cutin "paymap2.bmp", 3;
+ mes "[Marlbron]";
+ mes "You will reach the village of Payon.";
+ mes "Follow the direction of the ^0000cdRed Arrow^000000, you will enter ^0000cdArcher Village^000000.";
+ next;
+ cutin "paymap3.bmp", 3;
+ mes "[Marlbron]";
+ mes "Once you get there, make your way to the ^0000cdCircled Area^000000. Here you will find the ^0000cdArcher Job Change Guild^000000.";
+ mes "Got it? Easy to find, right?";
+ next;
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Due to satellite navigation, you shouldn't worry about getting lost.";
+ mes "However, if you are still worried, you can ask the local ^0000cdGuide^000000 where to go.";
+ next;
+ mes "[Marlbron]";
+ mes "You can find me after your visit to the guild.";
+ next;
+ mes "[Marlbron]";
+ mes "Now then, I wish you success in becoming an Archer. Until next time!";
+ close2;
+ cutin "", 255;
+ nov_3_archer = 1;
+ setquest 14142;
+ warp "pay_fild01", 339, 346;
+ end;
+ }
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Yes, come back and see me after reconsideration.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Hmmm. You are a little bit short of Job Level.";
+ mes "Are you coming back after more training?";
+ next;
+ mes "[Marlbron]";
+ mes "Visit <NAVI>^4D4DFF[Battle Trainer Subino]^000000<INFO>iz_ac01,59,83,</INFO></NAVI>";
+ mes "at Armory on the 1st floor.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ case 4:
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Really? Then, don't be lazy but get some training.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else if (nov_3_archer == 1) {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Why are you still here? Are you not going to become an Archer?";
+ mes "Are you going to pursue a different job?";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Well? How is it being an Archer?";
+ mes "The student has surpassed the teacher, as the saying goes.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (questprogress(4269) == 1) {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "You don't seem to be fully registered at the Academy yet.";
+ mes "Hurry and complete your registration.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gnor.bmp", 2;
+ mes "[Marlbron]";
+ mes "Did you directly come here without the entrance application for Critura Academy yet?";
+ mes "You are too in a hurry. Rush to go to the 1st floor for application, and come back to me.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ cutin "gbad.bmp", 2;
+ mes "[Marlbron]";
+ mes "Why are you of a different job snooping around here?";
+ next;
+ mes "[Marlbron]";
+ mes "Don't snoop around and get out of here!!";
+ close2;
+ cutin "", 255;
+ end;
+ }
+}
+
+iz_ac02_a,65,109,5 duplicate(Archer Teacher#ac) Archer Teacher#ac_a 4_M_ARCHER
+iz_ac02_b,65,109,5 duplicate(Archer Teacher#ac) Archer Teacher#ac_b 4_M_ARCHER
+iz_ac02_c,65,109,5 duplicate(Archer Teacher#ac) Archer Teacher#ac_c 4_M_ARCHER
+iz_ac02_d,65,109,5 duplicate(Archer Teacher#ac) Archer Teacher#ac_d 4_M_ARCHER
+
+// =============================================================================
+// = Swordsman
+// =============================================================================
+
+// - Swordman Trainer (Adric)
+// - Teaches the player about the Swordman class.
+// -----------------------------------------------------------------------------
+iz_ac02,60,51,5 script Swordman Trainer#ac 4_M_SWORDMAN,{
+ if (!checkweight(1301, 3)) {
+ mes "- Quest cannot be continued due to your overfilled inventory. -";
+ close;
+ }
+ cutin "aca_sword.bmp", 2;
+ if (questprogress(4269) != 2) {
+ mes "[Trainer Adric]";
+ mes "You want to learn about Swordsman?";
+ mes "If you want to take the class you must register.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Go and register at the counter on the 1st floor!";
+ cutin "", 255;
+ close;
+ }
+ if (Class == Job_Novice) {
+ if (!nov_3_swordman) {
+ mes "[Trainer Adric]";
+ mes "You want to become a swordsman?";
+ mes "Great decision.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Fight on the frontline with large swords,";
+ mes "Bringing victory and with a high defense to protect your comrades.";
+ mes "Simply put, we're the best.";
+ next;
+ mes "[Trainer Adric]";
+ mes "What do you think?";
+ mes "You want to become a Swordsman here?";
+ next;
+ switch(select("No thanks", "I want to test Swordsman Skills!", "Change me right now!")) {
+ case 1:
+ mes "[Trainer Adric]";
+ mes "Since you're not intersted in this opportunity,";
+ next;
+ mes "[Trainer Adric]";
+ mes "Go hunt Porings and stay";
+ mes "as a novice forever!";
+ cutin "", 255;
+ close;
+ case 2:
+ mes "[Trainer Adric]";
+ mes "Calm down, lets's start over.";
+ mes "First, I'll give you a ^FF0000Swordman Manual^000000";
+ mes "Read it carefuly before asking any questions.";
+ getitem 2819, 1; // Swordman_Manual
+ nov_3_swordman = 1;
+ setquest 1229;
+ cutin "", 255;
+ close;
+ case 3:
+ if (JobLevel < 10) {
+ mes "[Trainer Adric]";
+ mes "If you want to become a Swordman,";
+ mes "You should reach over ^006400Base level 10^000000,";
+ mes "And become more than ^006400beginner's skill level 9^000000.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Get taught here and follow the steps.";
+ cutin "", 255;
+ close;
+ } else {
+ mes "[Trainer Adric]";
+ mes "It seems you have learned enough.";
+ mes "Head over to the Swordsman Guild";
+ mes "to continue your change into a Swordsman!";
+ next;
+ mes "[Trainer Adric]";
+ mes "The Swordsman Guild is located";
+ mes "to the west of the Izlude Plaza Center.";
+ mes "It should be very easy to find.";
+ cutin "", 255;
+ nov_3_swordman = 4;
+ erasequest 1230;
+ close;
+ }
+ }
+ } else if (nov_3_swordman == 1) {
+ mes "[Trainer Adric]";
+ mes "If you are equipped with a ^FF0000Swordman Manual^000000";
+ mes "You'll be able to experience the basic skills of the swordsman.";
+ mes "Now let's study the basics of Swordsman skills.";
+ next;
+ while(1) {
+ switch(select("Swordman key points", "Heightened Attack and defense.", "Related stats", "Additional Swordman classes?", "I learned enough already.")) {
+ case 1:
+ mes "[Trainer Adric]";
+ mes "Swordsman uses strong constitution; shrugs off damage easily from foes and when in a party, is a leader and the protector of others.";
+ next;
+ continue;
+ case 2:
+ mes "[Trainer Adric]";
+ mes "Swordsman prefer to use spears, two-handed swords or combination sword and shield.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Also the swordsman's vitality is normally high making them able to carry massive amounts of weight.";
+ next;
+ continue;
+ case 3:
+ mes "[Trainer Adric]";
+ mes "Desired stats are usually ^0000FFStr^000000, ^0000FFAgi^000000, ^0000FFVit^000000, ^0000FFDex^000000";
+ mes "Of course this is all up to you";
+ next;
+ mes "[Trainer Adric]";
+ mes "^0000FFVit^000000 affects^FF0000HP recovery rate^000000.";
+ mes "^0000FFStr^000000 affects ^FF0000 strength and attacking power^000000.";
+ mes "^0000FFDex^00000 increases ^FF0000 accuracy of your attack^000000,";
+ next;
+ mes "[Trainer Adric]";
+ mes "^0000FFAgi^000000 increases ^FF0000 attacking speed^000000 and ^FF0000 evasion rate^000000,";
+ mes "^0000FFLuk^000000 affects ^FF0000 probability of critical ^000000.";
+ next;
+ continue;
+ case 4:
+ mes "[Trainer Adric]";
+ mes "After changing to a Swordsman you can change to a ^0000FF Knight ^000000 or ^0000FFCrusader^000000.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Go raise your strength while figuring out if you're offensive or defensive.";
+ mes "This is something you should do.";
+ next;
+ continue;
+ case 5:
+ break;
+ }
+ break;
+ }
+ mes "[Trainer Adric]";
+ mes "The study material can be retaught by Neals the assitant trainer.";
+ mes "Remember this.";
+ nov_3_swordman = 2;
+ if (questprogress(1229))
+ erasequest 1229;
+ setquest 1230;
+ cutin "", 255;
+ close;
+ } else if (nov_3_swordman == 2) {
+ if (JobLevel < 10) {
+ mes "[Trainer Adric]";
+ mes "Using the Swordman Manual I gave you train by hunting monsters.";
+ mes "Go to the Battle Instructor Subino on the first floor Armory room.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Raise your level to ^006400job level 10^000000 and get to ^006400 beginner's skill level 9^000000, come back here again.";
+ nov_3_swordman = 3;
+ if (questprogress(1230))
+ erasequest 1230;
+ cutin "", 255;
+ close;
+ } else {
+ mes "[Trainer Adric]";
+ mes "Since you have enough job levels,";
+ mes "you don't need any more lecturing.";
+ next;
+ switch(select("Then I will stop.", "But I want to listen more.", "I want to be a Swordsman right away!")) {
+ case 1:
+ mes "[Trainer Adric]";
+ mes "You surpassed the study material to raise your level.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Impressive.";
+ cutin "", 255;
+ close;
+ case 2:
+ mes "[Trainer Adric]";
+ mes "There's nothing else special to teach you.";
+ mes "Everything I taught you if you remember them well, that's all you need.";
+ next;
+ mes "[Trainer Adric]";
+ mes "If you need additional training,";
+ mes "Go to the Battle Instructor Subino";
+ mes "on the first floor Armory room.";
+ next;
+ switch(select("This is very tedious.", "I need more training.", "I want to be a Swordsman right away!")) {
+ case 1:
+ mes "[Trainer Adric]";
+ mes "A simple No would've sufficed.";
+ cutin "", 255;
+ close;
+ case 2:
+ mes "[Trainer Adric]";
+ mes "Go to the Battle Instructor Subino on the first floor Armory room.";
+ mes "If you think you're ready, come back here.";
+ mes "You need to change to a Swordsman job soon!";
+ nov_3_swordman = 3;
+ if (questprogress(1230))
+ erasequest 1230;
+ cutin "", 255;
+ close;
+ case 3:
+ mes "[Trainer Adric]";
+ mes "It seems you have learned enough.";
+ mes "Head over to the Swordsman Guild";
+ mes "to continue your transfer to a Swordsman!";
+ next;
+ mes "[Trainer Adric]";
+ mes "The Swordsman Guild is located";
+ mes "to the west of the Izlude Plaza Center.";
+ mes "It should be very easy to find.";
+ cutin "", 255;
+ nov_3_swordman = 4;
+ erasequest 1230;
+ close;
+ }
+ case 3:
+ mes "[Trainer Adric]";
+ mes "It seems you have learned enough.";
+ mes "Head over to the Swordsman Guild";
+ mes "to continue your change into a Swordsman!";
+ next;
+ mes "[Trainer Adric]";
+ mes "The Swordsman Guild is located";
+ mes "to the west of the Izlude Plaza Center.";
+ mes "It should be very easy to find.";
+ cutin "", 255;
+ nov_3_swordman = 4;
+ if (questprogress(1230))
+ erasequest 1230;
+ close;
+ }
+ }
+ } else if (nov_3_swordman == 3) {
+ if (JobLevel < 10) {
+ mes "[Trainer Adric]";
+ mes "You still don't have enough to become a Swordman.";
+ next;
+ mes "[Trainer Adric]";
+ mes "If you need some battle training find Subino on the first floor Armory of the Academy.";
+ cutin "", 255;
+ close;
+ } else {
+ mes "[Trainer Adric]";
+ mes "It seems you have learned enough.";
+ mes "Head over to the Swordsman Guild";
+ mes "to continue your change into a Swordsman!";
+ next;
+ mes "[Trainer Adric]";
+ mes "The Swordsman Guild is located";
+ mes "to the west of the Izlude Plaza Center.";
+ mes "It should be very easy to find.";
+ cutin "", 255;
+ nov_3_swordman = 4;
+ if (questprogress(1230))
+ erasequest 1230;
+ close;
+ }
+ } else if (nov_3_swordman == 4) {
+ mes "[Trainer Adric]";
+ mes "During this period, you must train really hard.";
+ next;
+ mes "[Trainer Adric]";
+ mes "Continue to improve your abilities to change to an amazing job!";
+ cutin "", 255;
+ close;
+ }
+ } else if (Class == Job_Swordman) {
+ mes "[Trainer Adric]";
+ mes "You're already a Swordsman!";
+ next;
+ mes "[Trainer Adric]";
+ mes "There's nothing else special to teach you.";
+ cutin "", 255;
+ close;
+ } else {
+ mes "[Trainer Adric]";
+ mes "Hey! You already have a job!";
+ next;
+ mes "[Trainer Adric]";
+ mes "Go away!";
+ cutin "", 255;
+ close;
+ }
+}
+
+iz_ac02_a,60,51,5 duplicate(Swordman Trainer#ac) Swordman Trainer#ac_a 4_M_SWORDMAN
+iz_ac02_b,60,51,5 duplicate(Swordman Trainer#ac) Swordman Trainer#ac_b 4_M_SWORDMAN
+iz_ac02_c,60,51,5 duplicate(Swordman Trainer#ac) Swordman Trainer#ac_c 4_M_SWORDMAN
+iz_ac02_d,60,51,5 duplicate(Swordman Trainer#ac) Swordman Trainer#ac_d 4_M_SWORDMAN
+
+// - Swordman Assistant (Neals)
+// -----------------------------------------------------------------------------
+iz_ac02,53,48,5 script Swordman Assistant#ac 4_M_KY_KNT,{
+ if (questprogress(4269) != 2) {
+ mes "[Assitant Trainer Neals]";
+ mes "You want to learn about Swordsman?";
+ mes "If you want to take the class you must register and come back here.";
+ close;
+ }
+ if (Class == Job_Novice && JobLevel >= 10) {
+ mes "[Assitant Trainer Neals]";
+ mes "As you are at the enough job level, you don't need any more lecturing.";
+ next;
+ if(select("Then I will stop.", "Become a swordsman right away!") == 1) {
+ mes "[Assitant Trainer Neals]";
+ mes "Before the training starts, you already raised your level.";
+ mes "Impressive.";
+ close;
+ }
+ mes "[Assitant Trainer Neals]";
+ mes "It seems that you have fully grown.";
+ mes "Head to the Swordsman Guild to become a swordsman!";
+ next;
+ mes "[Assitant Trainer Neals]";
+ mes "The Swordsman Guild is located in Izlude square";
+ mes "From the center, go west.";
+ mes "It should be easy to find.";
+ cutin "", 255;
+ if (questprogress(1230))
+ erasequest 1230;
+ close;
+ } else {
+ if (Class == Job_Swordman) {
+ mes "[Assitant Trainer Neals]";
+ mes "You are now a swordsman!";
+ mes "There's nothing else special to teach you.";
+ close;
+ } else if (Class != Job_Novice) {
+ mes "[Assitant Trainer Neals]";
+ mes "You already have another job!";
+ mes "Go away!";
+ close;
+ } else {
+ if (questprogress(1229) == 2) {
+ mes "[Assitant Trainer Neals]";
+ mes "Let's repeat the prerequisite of Swordsmanhood, this is a review study!";
+ next;
+ while(1) {
+ switch(select("Swordman key points", "Heightened Attack and defense.", "Related stats","Additional Swordman classes?", "I learned enough already.")) {
+ case 1:
+ mes "[Assitant Trainer Neals]";
+ mes "Swordsman uses strong constitution; shrugs off damage easily from foes and when in a party, is a leader and the protector of others.";
+ next;
+ break;
+ case 2:
+ mes "[Assitant Trainer Neals]";
+ mes "Swordsman prefer to use spears, two-handed swords or combination sword and shield.";
+ next;
+ mes "[Assitant Trainer Neals]";
+ mes "Also the swordsman's vitality is normally high making them able to carry massive amounts of weight.";
+ next;
+ break;
+ case 3:
+ mes "[Assitant Trainer Neals]";
+ mes "Desired stats are usually ^0000FFStr^000000, ^0000FFAgi^000000, ^0000FFVit^000000, ^0000FFDex^000000 Of course this is all up to you";
+ next;
+ mes "[Assitant Trainer Neals]";
+ mes "^0000FFVit^000000 affects^FF0000HP recovery rate^000000.";
+ mes "^0000FFStr^000000 affects ^FF0000 strength and attacking power^000000.";
+ mes "^0000FFDex^00000 increases ^FF0000 accuracy of your attack^000000.";
+ next;
+ mes "[Trainer Adric]";
+ mes "^0000FFAgi^000000 increases ^FF0000 attacking speed^000000 and ^FF0000 evasion rate^000000.";
+ mes "^0000FFLuk^000000 affects ^FF0000 probability of critical ^000000.";
+ next;
+ break;
+ case 4:
+ mes "[Assitant Trainer Neals]";
+ mes "After changing to a Swordsman you can change to a ^0000FF Knight ^000000 or ^0000FFCrusader^000000.";
+ next;
+ mes "[Assitant Trainer Neals]";
+ mes "Go raise your strength while figuring out if you're offensive or defensive.";
+ mes "This is something you should do.";
+ break;
+ case 5:
+ mes "[Assitant Trainer Neals]";
+ mes "Ask again anytime.";
+ mes "I'll answer everything!";
+ close;
+ }
+ mes "[Assitant Trainer Neals]";
+ mes "Let's repeat the prequisite of swordsmanhood,";
+ mes "this is a review study!";
+ next;
+ }
+ } else {
+ mes "[Assitant Trainer Neals]";
+ mes "Feeble people like you can become a gallant Swordsman soon.";
+ mes "Yes, you can. Be ambitious.";
+ close;
+ }
+ }
+ }
+}
+
+iz_ac02_a,53,48,5 duplicate(Swordman Assistant#ac) Swordman Assistant#ac_a 4_M_KY_KNT
+iz_ac02_b,53,48,5 duplicate(Swordman Assistant#ac) Swordman Assistant#ac_b 4_M_KY_KNT
+iz_ac02_c,53,48,5 duplicate(Swordman Assistant#ac) Swordman Assistant#ac_c 4_M_KY_KNT
+iz_ac02_d,53,48,5 duplicate(Swordman Assistant#ac) Swordman Assistant#ac_d 4_M_KY_KNT
+
+// =============================================================================
+// = Magician
+// =============================================================================
+
+// - Mage Chuck
+// -----------------------------------------------------------------------------
+iz_ac02,148,110,3 script Mage Chuck#ac 4_M_JOB_WIZARD,{
+ cutin "nov_magicsoul01.bmp", 2;
+ if (Class == Job_Novice) {
+ if (questprogress(4269) == 2) {
+ mes "[Mage Chuck]";
+ mes "I am the one in charge of magic studies in Criatura Academy";
+ mes "^0000FFA genius Mage^000000~!";
+ mes "^0000FFMage Chuck^000000.";
+ next;
+ mes "[Mage Chuck]";
+ mes "Someone like you who has magic talent but doesn't know how to become a Mage.";
+ mes "For a ^FF0000Novice^000000 like you I'm offering my training.";
+ next;
+ mes "[Mage Chuck]";
+ mes "How about it?";
+ mes "Do you wanna try out my priceless lessons?";
+ next;
+ if(select("I will learn.", "No thanks!") == 2) {
+ mes "[Mage Chuck]";
+ mes "If you don't listen to me, you'll regret of it.";
+ next;
+ mes "[Mage Chuck]";
+ mes "When you change your mind, come back to me.";
+ } else {
+ mes "[Mage Chuck]";
+ mes "Good! If that's your decision, I will do my best.";
+ mes "How much you learn depends on your own effort.";
+ next;
+ mes "[Mage Chuck]";
+ mes "To become a Mage, you need to be very studious.";
+ mes "Ask me what you want to learn!";
+ while(1) {
+ next;
+ switch(select("What is a Mage's primary role?", "What ^8B4513stats^000000 are good for Mage?", "What are Mage's ^8B4513skill^000000s?", "Can I try some skills?!", "I want to ^8B451Cchange job^000000 to Mage!", "I'll get back to you later")) {
+ case 1:
+ mes "[Mage Chuck]";
+ mes "A Mage's primary role is to use magic to inflict powerful attacks.";
+ next;
+ mes "[Mage Chuck]";
+ mes "We have low defense but have various attack ^006400skills^000000.";
+ mes "Be careful about the damage you take as a Mage.";
+ next;
+ mes "[Mage Chuck]";
+ mes "If you remember these little things you can become a great Mage.";
+ mes "Walk with pride as you grow in magic power~";
+ next;
+ mes "[Mage Chuck]";
+ mes "Anything else you want to know about Mages?";
+ break;
+ case 2:
+ mes "[Mage Chuck]";
+ mes "Doesn't a Mage remind you something solid?";
+ next;
+ mes "[Mage Chuck]";
+ mes "Sheer physical force is for brutes who increase their ^006400STR^000000.";
+ mes "For a ^0000FFgenius Mage^000000 like myself that's a waste.";
+ next;
+ mes "[Mage Chuck]";
+ mes "Become wise and clever with your^006400 mind power^000000.";
+ mes "This is Mage's primary attribute- ^006400INT^000000, it's what's most important!";
+ next;
+ mes "[Mage Chuck]";
+ mes "If you remember these little things you can become a great Mage.";
+ mes "Walk with pride as you grow in magic power~";
+ next;
+ mes "[Mage Chuck]";
+ mes "Anything else you want to know about Mages?";
+ break;
+ case 3:
+ mes "[Mage Chuck]";
+ mes "Mages have powerful magical skills.";
+ mes "The basis of these skills are the attributes ^006400<Water, Wind, Earth, Fire>^000000.";
+ next;
+ mes "[Mage Chuck]";
+ mes "As each element has its own^006400 range attack magic^000000, these are useful when dealing with many enemies~!!";
+ next;
+ mes "[Mage Chuck]";
+ mes "Ok enough talk.";
+ mes "I will show you my power by offering a demonstration.";
+ mes "You should be honored to be witnessing this!";
+ next;
+ mes "[Mage Chuck]";
+ switch(rand(1, 7)) {
+ case 1:
+ mes "Detecting hidden enemies";
+ mes "^006400Sight^000000 !!!!";
+ specialeffect EF_SIGHT;
+ break;
+ case 2:
+ mes "Deflect all physical attacks";
+ mes "^006400Safety Wall^000000!!!!";
+ specialeffect EF_GLASSWALL;
+ break;
+ case 3:
+ mes "Fire damage premier ~!!!";
+ mes "^006400Fire Ball^000000!!!!";
+ specialeffect EF_FIREBALL;
+ break;
+ case 4:
+ mes "Wall of Fire~!!";
+ mes "^006400Fire Wall^000000!!!!";
+ specialeffect EF_FIREWALL;
+ break;
+ case 5:
+ mes "Want a taste of thunder?";
+ mes "^006400Lightening Bolt^000000!!!!";
+ specialeffect EF_LIGHTBOLT;
+ break;
+ case 6:
+ mes "Get lost in the storm!";
+ mes "^006400Thunder Storm^000000!!!!";
+ specialeffect EF_THUNDERSTORM;
+ break;
+ case 7:
+ mes "What killed the dinosaurs?";
+ mes "The Ice Age!";
+ mes "^006400Frost Diver^000000!!!!";
+ specialeffect EF_FROSTDIVER2;
+ break;
+ }
+ next;
+ mes "[Mage Chuck]";
+ mes "Doesn't it shake your heart to see my skills?";
+ mes "You won't get hurt so don't worry~!";
+ next;
+ mes "[Mage Chuck]";
+ mes "Anything else you want to know about Mages?";
+ break;
+ case 4:
+ if (isequippedcnt(2824) > 0 || countitem(2824) > 0) {
+ mes "[Mage Chuck]";
+ mes "I think you already received a ^FF0000Mage Manual^000000~!";
+ mes "I can't offer you two of them.";
+ mes "One is good enough~!";
+ next;
+ mes "[Mage Chuck]";
+ mes "Try out the skills after equipping the^006400 Mage Manual^000000.";
+ mes "Then hunt with the skills given to you in your skill window.";
+ next;
+ mes "[Mage Chuck]";
+ mes "Anything else you want to know about Mages?";
+ } else {
+ if (checkweight(607, 1)) {
+ mes "[Mage Chuck]";
+ mes "Right, you must be set with your heart firm on becoming a Mage.";
+ next;
+ mes "[Mage Chuck]";
+ mes "OK! Then I'll give you a chance to taste what it is to become a Mage.";
+ mes "Take this ^006400Mage Manual^000000.";
+ mes "I'll let you borrow it!";
+ next;
+ mes "[Mage Chuck]";
+ mes "Try out the skills after equipping the^006400 Mage Manual^000000.";
+ mes "Then hunt with the skills given to you in your skill window.";
+ next;
+ mes "[Mage Chuck]";
+ mes "It's a valuable item so don't lose it.";
+ mes "If you want to become a genius ^0000FFMage^000000 like me, follow in my path.";
+ getitem 2824, 1; // Mage_Manual
+ break;
+ } else {
+ mes "[Mage Chuck]";
+ mes "If you want to become a Mage lighten up your inventory load.";
+ next;
+ mes "[Mage Chuck]";
+ mes "Anything else you want to know about Mages?";
+ }
+ }
+ break;
+ case 5:
+ if (questprogress(9264) == 2) {
+ mes "[Mage Chuck]";
+ mes "Ah~ you want to change to a magician?";
+ next;
+ mes "[Mage Chuck]";
+ mes "I seem to have used a great deal of magic sending you before...";
+ mes "Because of too many students like you, I cannot send you again!";
+ next;
+ mes "[Mage Chuck]";
+ mes "If you really want to go, then please go speak to the Kafra Staff and use their Teleport Service.";
+ } else {
+ mes "[Mage Chuck]";
+ mes "Ah~ you want to change to a magician?";
+ next;
+ mes "[Mage Chuck]";
+ mes "To change your job to a magician, you must visit the Magician's Guild.";
+ mes "I can send you close to there, but...";
+ next;
+ mes "[Mage Chuck]";
+ mes "You must first reach ^006400Job level 10^000000 and ^006400Basic Skill level 9^000000.";
+ next;
+ if(getskilllv("NV_BASIC") < 9) {
+ mes "[Mage Chuck]";
+ mes "You don't seem ready!";
+ mes "If you want to change your job, you must first be ^006400Job level 10^000000 and ^006400Basic Skill level 9^000000.";
+ mes "Then come back and see me!";
+ next;
+ mes "[Mage Chuck]";
+ mes "What else do you want to know about magicians?";
+ } else {
+ mes "[Mage Chuck]";
+ mes "Ah, it seems that you already have those requirements!";
+ mes "Do you want to change your job immediately?";
+ next;
+ if(select("No", "Yes") == 1) {
+ mes "[Mage Chuck]";
+ mes "Okay, when you have decided please come back!";
+ next;
+ mes "[Mage Chuck]";
+ mes "What else do you want to know about magicians?";
+ } else {
+ mes "[Mage Chuck]";
+ mes "In that case, I'll use magic to send you near ^8B4513Geffen^000000, where the Magician's Guild is.";
+ mes "It is there that you will be able to become a magician.";
+ next;
+ mes "[Mage Chuck]";
+ mes "Once I send you, you will speak to the ^0000FFMage's Guild Guide^000000.";
+ mes "They will be able to assist you further.";
+ mes "Let's go! I'm ready to send you there!";
+ next;
+ mes "[Mage Chuck]";
+ mes "Whoosh Whoosh";
+ mes "Ooo... Ooo... Hum... Hmm!";
+ mes "Teleport!";
+ cutin "", 255;
+ next;
+ setquest 9264;
+ savepoint "geffen", 120, 38;
+ warp "gef_fild07", 88, 205;
+ end;
+ }
+ }
+ }
+ break;
+ case 6:
+ mes "[Mage Chuck]";
+ mes "Yes~ Go meet other teachers then come back.";
+ mes "Of course, Mages are most alluring of them all.~";
+ next;
+ mes "[Mage Chuck]";
+ mes "You'll choose Mage again I have no doubt about it~~!!";
+ mes "Haha see you later~";
+ break;
+ }
+ break;
+ }
+ }
+ } else {
+ mes "[Mage Chuck]";
+ mes "First you'll have to complete your ^8B4513registration^000000 at the Academy front desk.";
+ mes "If you go to the 1st floor of the academy someone will help you register.";
+ }
+ } else {
+ mes "[Mage Chuck]";
+ mes "You're no longer the innocent ^8b4513Novice^000000 who doesn't know anything~?";
+ mes "I don't have anything to teach you~!";
+ }
+ close2;
+ cutin "", 255;
+ end;
+}
+
+iz_ac02_a,148,110,3 duplicate(Mage Chuck#ac) Mage Chuck#ac_a 4_M_JOB_WIZARD
+iz_ac02_b,148,110,3 duplicate(Mage Chuck#ac) Mage Chuck#ac_b 4_M_JOB_WIZARD
+iz_ac02_c,148,110,3 duplicate(Mage Chuck#ac) Mage Chuck#ac_c 4_M_JOB_WIZARD
+iz_ac02_d,148,110,3 duplicate(Mage Chuck#ac) Mage Chuck#ac_d 4_M_JOB_WIZARD
+
+// - Magician's Guild Guide
+// -----------------------------------------------------------------------------
+gef_fild07,90,208,6 script #acmageguide HIDDEN_NPC,7,7,{
+ end;
+
+ OnTouch:
+ if (questprogress(9264) == 1) {
+ mes "[Magician's Guild Guide]";
+ mes "It seems that you've come from Criatura Academy.";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "You look a little exhausted...";
+ mes "Though.. to become a magician is exhausting in a way...";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "First off, my task is to guide you to the Mage's guild!";
+ mes "Go straight to the right!";
+ mes "After ^8B4513crossing the bridge^000000, you will see the entrance to ^FF0000Geffen^000000!";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Once there,";
+ mes "You should find our <NAVI>^4D4DFF[Magician's Guild Guide]^000000<INFO>geffen,43,123,</INFO></NAVI>.";
+ mes "Speak to him, he will continue to guide you to the Magician's Guild!";
+ nov_3_magician = 2;
+ completequest 9264;
+ erasequest 9264;
+ setquest 9265;
+ close;
+ }
+}
+
+// - Magician's Guild Guide
+// -----------------------------------------------------------------------------
+gef_fild07,89,208,6 script Magician's Guild Guide#1 2_F_MAGICMASTER,{
+ if (questprogress(9265) == 1) {
+ mes "[Magician's Guild Guide]";
+ mes "First off, my task is to guide you to the Mage's guild!";
+ mes "Go straight to the right!";
+ mes "After ^8B4513crossing the bridge^000000, you will see the entrance to ^FF0000Geffen^000000!";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Once there,";
+ mes "You should find our <NAVI>^4D4DFF[Magician's Guild Guide]^000000<INFO>geffen,43,123,</INFO></NAVI>.";
+ mes "Speak to him, he will continue to guide you to the Magician's Guild!";
+ } else {
+ mes "[Magician's Guild Guide]";
+ mes "I am in charge of bringing ^8B4513Criatura Academy^000000 students to the Mage's guild.";
+ mes "These days the academy has a lot of new students so I'm happy to be working.";
+ }
+ close;
+
+ OnInit:
+ //AddQuestInfo 9265 1 0
+ //SetQuestQuest 9265 9264 1
+ end;
+}
+
+// - Magician's Guild Guide
+// -----------------------------------------------------------------------------
+geffen,43,123,6 script Magician's Guild Guide#2 2_F_MAGICMASTER,{
+ if (questprogress(9265) == 1) {
+ mes "[Magician's Guild Guide]";
+ mes "Ah, you made it all the way here. Very good for an academy student!";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Before this step-by-step guide, they would get lost and frustrated.";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Anyways, let's keep this short.";
+ mes "I will now tell you the route to the Mage's Guild!";
+ mes "The way to go is quite simple...";
+ mes "From here, go toward 11 o'clock, you will see the Mage's Guild.";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Just go inside, and upstairs a little to find the";
+ mes "<NAVI>^4D4DFF[Mage Guildsman]^000000<INFO>geffen_in,164,124,</INFO></NAVI>";
+ mes "From there, he will assist you in becoming a Mage.";
+ completequest 9265;
+ erasequest 9265;
+ setquest 9266;
+ } else if (questprogress(9266) == 1) {
+ mes "[Magician's Guild Guide]";
+ mes "The way to go is quite simple...";
+ mes "From here, go toward 11 o'clock, you will see the Mage's Guild.";
+ next;
+ mes "[Magician's Guild Guide]";
+ mes "Just go inside, and upstairs a little to find the";
+ mes "<NAVI>^4D4DFF[Mage Guildsman]^000000<INFO>geffen_in,164,124,</INFO></NAVI>";
+ mes "From there, he will assist you in becoming a Mage.";
+ } else {
+ mes "[Magician's Guild Guide]";
+ mes "I am in charge of bringing ^8B4513Criatura Academy^000000 students to the Mage's guild.";
+ mes "These days the academy has a lot of new students so I'm happy to be working.";
+ }
+ close;
+
+ OnInit:
+ //AddQuestInfo 9266 1 0
+ //SetQuestQuest 9266 9265 1
+ end;
+}
+
+// =============================================================================
+// = Merchant
+// =============================================================================
+
+// - Salim Hamid
+// -----------------------------------------------------------------------------
+iz_ac02,50,169,3 script Salim Hamid#ac 1_M_MERCHANT,{
+ disable_items;
+ if (!checkweight(714, 3) || (MaxWeight - Weight) < 10000) {
+ mes "- As you are overloaded with so many items, quest can't be proceeded. -";
+ close;
+ }
+ if (BaseLevel > 15 || Class != Job_Novice) {
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Ehm?";
+ mes "This class only for Novices just starting their adventure.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Looking at you, you seem like you need some help. How about going to another place?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (questprogress(4269) < 1) {
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Oh~";
+ mes "At a glance, hey, you like the lost baby sheep.. Here the non registered passengers are prohibited.";
+ next;
+ mes "[Salim Hamid]";
+ mes "If you want to look around this area without physical prohibiton, you would better register first at the info desk at the Academy entrance.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (JobLevel >= 10) {
+ cutin "aca_salim01.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Ho Oh~";
+ mes "You look like you're ready to change to a first job.";
+ next;
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "How about it? Are you interested in the way of the Merchant? If so, I may be helpful for you.";
+ next;
+ if(select("Not interest.", "Interested.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Oh.. No...";
+ mes "Well, there is no way. Our Criatura Academy put the priority to the adventurer's choice.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Salim Hamid]";
+ mes "Good~ Then, I will send you to the town of Alberta. There you can become a merchant.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Do not go elsewhere, immediately enter the town.";
+ mes "Find the <NAVI>[Forge]<INFO>alberta_in,75 48</INFO></NAVI>.";
+ next;
+ if(select("Not yet ready.", "I'm Ready!") == 1) {
+ mes "[Salim Hamid]";
+ mes "Yes, I understand. When you are ready, let me see you again.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Salim Hamid]";
+ mes "Good~ Please go to the Forge and find me.";
+ close2;
+ setquest 12307;
+ cutin "", 255;
+ warp "pay_fild03", 388, 68;
+ end;
+ }
+ } else {
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "Hahaha. "+strcharinfo(0)+" you have completed the Merchant theory course at the Criatura Academy.";
+ next;
+ mes "[Salim Hamid]";
+ mes "When you want to test the other battle skills in the Merchant's Manual,";
+ mes "visit <NAVI>[Battle Trainer Subino]<INFO>iz_ac01,59,83</INFO></NAVI> on the 1st floor.";
+ next;
+ mes "[Salim Hamid]";
+ mes "You can fully experience the battle related practice through him.";
+ next;
+ mes "[Salim Hamid]";
+ mes "The guide for the next course "+strcharinfo(0)+" will be serviced when you reach job level 10. Good luck.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (questprogress(12302) < 1) {
+ cutin "aca_salim02.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Oh~";
+ mes "Hey, you like a lost sheep. Do you know why you've come here?";
+ next;
+ if(select("Don't Know", "Know.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Oh... you don't?";
+ next;
+ } else {
+ mes "[Salim Hamid]";
+ mes "Oh~ you seem like a quick learner.";
+ next;
+ }
+ mes "[Salim Hamid]";
+ mes "Well, I should at least give a briefing.";
+ next;
+ cutin "aca_salim01.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "I am ^0000ffSalim Hamid^000000 in charge with training the merchant course here at the Criatura Academy.";
+ next;
+ mes "[Salim Hamid]";
+ mes "This classroom is for Merchant applicants. In fact, this room is mainly for doing the finacial management of the Criatura Academy.";
+ next;
+ cutin "aca_salim02.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Next time, if you want to observe the merchant course, you can visit me, Salim Hamid and register.";
+ setquest 12302;
+ completequest 12302;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (questprogress(12303) < 1) {
+ cutin "aca_salim01.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Oh~ You came back. Do you want to experience the Merchant training course? It is a little bit difficult to the average beginner.";
+ next;
+ if(select("No thanks!", "Sign me up!.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Oh~ though it is a bit hard, it is worth learning. Sadly, there's no other way.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Salim Hamid]";
+ mes "Oh, yes... Then, first will you register your name in this student list?";
+ next;
+ if(select("Refuse.", "Put your name on the list.") == 1) {
+ cutin "aca_salim03.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Resistance from the beginning? This isn't the way to start training.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "aca_salim01.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Ummm~ Your name is...";
+ mes "^0000ff"+ strcharinfo(0) +"^000000...... right?";
+ next;
+ mes "[Salim Hamid]";
+ mes "First to observe the Merchant course, you need to have the Merchant mindset. A trader with less than 100 zeny could not be called a Merchant.";
+ next;
+ cutin "aca_salim02.bmp", 2;
+ mes "[Salim Hamid]";
+ mes ""+ strcharinfo(0) +"^000000 come back to me with 100 Zeny in hand before the next class.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Of course, that money won't be taken. It is only A test to see your basic mindset to being a Merchant. Good luck.";
+ setquest 12303;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(12303) == 1) {
+ if (Zeny >= 100) {
+ cutin "aca_salim02.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Wow, you really came back with 100 zeny in hand. I feel your desire to learn clearly.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Now. I will give you a Merchant's manual. Equipped with it. Press Alt + S key and look at the skill window.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Clicking the [MISC] tab on the skill window, you can see the Merchant manual skills.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Now~ as we should go to the next course, equip the guide and see the skill, then speak to me again.";
+ getitem 2823, 1; // Merchant_Manual
+ completequest 12303;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "aca_salim02.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Hohohong.. Test is not easy? Will you give it up now?";
+ next;
+ if(select("Can't do it.", "Give it up.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Will you? 100 zeny isn't hard to get pal.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Salim Hamid]";
+ mes "Yes, come back to me when you change your mind.";
+ erasequest 12303;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+ if (questprogress(12304) < 1) {
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Now, how about attending the class concerning various basic skills which merchants should have for making money.";
+ next;
+ mes "[Salim Hamid]";
+ mes "This might be better for you to learn from the steward working on the field next door. Go to him for the Merchant theory course, then return to me.";
+ setquest 12304;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(12304) == 1) {
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Haven't you gone to him for the class? Go to the steward next to me and return after completing the Merchant skill theory.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (questprogress(12305) < 1) {
+ mes "[Salim Hamid]";
+ mes "Have you come after a good lesson from the steward concerning what a Merchant can do?";
+ next;
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "By any chance, "+strcharinfo(0)+" do you have mind to learn more about Merchants here?";
+ next;
+ if(select("I will look around at more jobs.", "Let me do it a little more.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Yes, your open mind is good for you. As this academy has many other lecturers besides Merchants.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Whenever you feel like learning again, come back to me "+strcharinfo(0)+".";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Salim Hamid]";
+ mes "Is that so? OK, now how about learning the major effects of Merchant's stats? If you are ready, speak to me.";
+ setquest 12305;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(12305) == 1) {
+ cutin "aca_salim01.bmp", 2;
+ mes "[Salim Hamid]";
+ mes "Trader's stats are classified as two major series. One is for manufacturing, the other is for battle.";
+ next;
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "Of course, these are for farther down in the future. At this moment, you are even short of stats to invest DEX enabling you to hunt a monster.";
+ next;
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "But, there is a big difference between your knowledge of the basic rules and being ignorant of it.";
+ mes "Let's learn about it one by one.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Now, what series do we start with?";
+ next;
+ while(1) {
+ switch(select("Already know it.", "Battle Stats.", "Crafting Stats.")) {
+ case 1:
+ mes "[Salim Hamid]";
+ mes "It will be OK as it is, won't it?";
+ next;
+ if(select("I already know all of them.", "Please make another explanation.") == 1) {
+ mes "[Salim Hamid]";
+ mes "Yes, you are "+strcharinfo(0)+" I am pleased to meet a quick-to-learn student like you. It also saves my time.";
+ next;
+ } else {
+ mes "[Salim Hamid]";
+ mes "Aha~ I think I got you wrong. Let's start the lecture again.";
+ next;
+ }
+ break;
+ case 2:
+ mes "[Salim Hamid]";
+ mes "Being in a trader role, the stats affecting the figure of battle power are two ^4d4fffSTR & DEX^000000.";
+ next;
+ mes "[Salim Hamid]";
+ mes "STR is related to the basic attacking power, DEX is to hit ratio and recovery from damage.";
+ next;
+ mes "[Salim Hamid]";
+ mes "In you future, according to the 2nd and 3rd jobs you choose, you can learn additional attacking stats such ^4d4fffINT or AGI^000000.";
+ next;
+ mes "[Salim Hamid]";
+ mes "To back up your shortage, you can increase LUK a little.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Rather than worry yourself, it may be a good idea to learn from other Merchants. You know ask others for advice.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Any other questions?";
+ next;
+ break;
+ case 3:
+ mes "[Salim Hamid]";
+ mes "The stats concerning crafting is simpler than that concerning battle. Only difficulty is how to cultivate it.";
+ next;
+ mes "[Salim Hamid]";
+ mes "It is common that you increase ^4d4fffDEX & LUK^000000 as the base and, if you have surplus, you invest the rest in ^4d4fffINT^000000.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Of course, the allocation of the portion should be properly adjusted in accordance with your equipments and the status you are in.";
+ next;
+ mes "[Salim Hamid]";
+ mes "One thing you should keep in mind is it may be a very boring and ascetic way to grow alone as Merchant specializing in crafting.";
+ next;
+ mes "[Salim Hamid]";
+ mes "If possible, make use of your friends and their items if you can.";
+ mes "This is my personal opinion only.";
+ mes "It is absolutely not the official standpoint of the Criatura Academy.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Any other questions?";
+ next;
+ break;
+ }
+ }
+ mes "[Salim Hamid]";
+ mes "Then, it is the end of this class.";
+ mes "If you have more questions about Merchants, please make other visits.";
+ completequest 12305;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if (questprogress(12306) < 1) {
+ mes "[Salim Hamid]";
+ mes "You came back again. "+strcharinfo(0)+" this time, shall we have a practical training by doing a simple errand?";
+ next;
+ mes "[Salim Hamid]";
+ mes "Can you see the noisy vending machine at the corner of this classroom? It was originally a soft drink vending machine but swallows coin very much...";
+ next;
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "Anyway, due to this reason, it is now being used for the trainees' practice of skills. Please check the prices for Garlet and Zargon.";
+ next;
+ mes "[Salim Hamid]";
+ mes "But! You should come back wit the information about ^4d4fffthe discounted prices equipped with the merchant's manual and applied with the discount rate^000000.";
+ next;
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Don't buy them. Just come back with the checked prices only. Can you do it?";
+ next;
+ if(select("I will do it next time.", "I will do it.") == 1) {
+ mes "[Salim Hamid]";
+ mes "OK. Then you challenge it next time.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Salim Hamid]";
+ mes "Good~ I will see you later.";
+ setquest 12306;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(12306) == 1) {
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "Yes. Let's see the prices you checked.";
+ next;
+ switch(select("I will come back after rechecking them.:Garlet 39z Zargon 450z:Garlet 37z Zargon 448z:Garlet 37z Zargon 446z:Garlet 37z Zargon 444z")) {
+ case 1:
+ mes "[Salim Hamid]";
+ mes "OK. You come back after rechecking them in detail.";
+ close2;
+ cutin "", 255;
+ end;
+ case 4:
+ mes "[Salim Hamid]";
+ mes "OK~ You correctly checked the prices equipped with Merchant's Manual.";
+ next;
+ cutin "aca_salim01",2;
+ mes "[Salim Hamid]";
+ mes "Perhaps, if you become a Merchant and use the high level of discount skill, you can buy what you want at much cheaper prices.";
+ next;
+ mes "[Salim Hamid]";
+ mes "The practice of overcharge will be the same.";
+ next;
+ cutin "aca_salim02",2;
+ mes "[Salim Hamid]";
+ mes "You don't need to practice the overcharge as well. You experience it while selling items earned during the other courses.";
+ next;
+ mes "[Salim Hamid]";
+ mes "Now the Merchant training at the Academy is finished.";
+ completequest 12306;
+ close2;
+ cutin "", 255;
+ end;
+ default:
+ cutin "aca_salim03",2;
+ mes "[Salim Hamid]";
+ mes "Did you correctly check them?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+}
+
+iz_ac02_a,50,169,3 duplicate(Salim Hamid#ac) Salim Hamid#ac_a 1_M_MERCHANT
+iz_ac02_b,50,169,3 duplicate(Salim Hamid#ac) Salim Hamid#ac_b 1_M_MERCHANT
+iz_ac02_c,50,169,3 duplicate(Salim Hamid#ac) Salim Hamid#ac_c 1_M_MERCHANT
+iz_ac02_d,50,169,3 duplicate(Salim Hamid#ac) Salim Hamid#ac_d 1_M_MERCHANT
+
+// - Steward Aydin
+// -----------------------------------------------------------------------------
+iz_ac02,53,171,3 script Steward Aydin#ac 4_M_MANAGER,{
+ disable_items;
+ if (!checkweight(714, 3) || (MaxWeight - Weight) < 10000) {
+ mes "- As you are overloaded with so many items, quest can't be proceeded.";
+ close;
+ }
+ if(questprogress(12304) == 1) {
+ mes "[Steward Aydin]";
+ mes "Mr. Hamid sent you here. Nice to meet you. Being busy in organizing the account book, I will make time for you.";
+ next;
+ mes "[Steward Aydin]";
+ mes "There are many ways to make margin on trading.. A threat, a concillation, black-market dealings, etc.";
+ next;
+ mes "[Steward Aydin]";
+ mes "If necessary, even various violent and bloody shortcuts (wow this guy is serious!)";
+ next;
+ mes "[Steward Aydin]";
+ mes "OH wait, what did I tell you?";
+ mes "These are legally prohibited behaviors. So, Merchants will be given two skills. Those are ^4d4fffOvercharge and Discount^000000..";
+ next;
+ mes "[Steward Aydin]";
+ mes "Besides, there are some other helpful skills such as ^4d4fffPush Cart Vending, Item Appraisal^000000 etc.. Which are not related directly to them though.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Any questions among them?";
+ next;
+ while(1) {
+ switch(select("I already know all of them.", "Overcharge & Discount", "Other skills", "Item Appraisal")) {
+ case 1:
+ mes "[Steward Aydin]";
+ mes "Really are you OK with it?";
+ next;
+ if(select("Wait I know it all.", "No, please explain them again.") == 1) {
+ mes "[Steward Aydin]";
+ mes "Ho O~ You don't have any questions?";
+ mes "OK. You are a person of practice rather than of theory.";
+ next;
+ mes "[Steward Aydin]";
+ mes "The additional lecture will be provided by Mr. Salim Hamid. Ah. I have something to give you.";
+ next;
+ mes "[Steward Aydin]";
+ mes "This is a box containing the defective equipments leaving from the inventory organization here.";
+ mes "Please practice the Item Appraisal skill in the Merchant Manual with it.";
+ next;
+ mes "[Steward Aydin]";
+ mes "I anticipate to see you next time in a good shape.";
+ completequest 12304;
+ getitem 12847, 1; // Old_Equipment_Box
+ close;
+ }
+ mes "[Steward Aydin]";
+ mes "Ho O~ Sorry but I got you wrong.";
+ mes "Let's start the class.";
+ next;
+ break;
+ case 2:
+ mes "[Steward Aydin]";
+ mes "It is simple to use Overcharge and Discount.";
+ next;
+ mes "[Steward Aydin]";
+ mes "These two skills are passive skills. If you become familiar with these, "+strcharinfo(0)+" these will automatically perform in trading with merchant NPC without your operation.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Once you've learned Overcharge, when selling commodities to a merchant NPC, you can gain the sales money composed of the regular sales price plus additional money as per the Overcharge skill level.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Oppositely, Discount is the skill, on your buying commodities from a merchant NPC, you can purchase it at the price discounted on the regular selling price as per the skill level.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Be carefult that these two skills are to be used only in trading with usual merchant's NPC, not with other manufacturing NPC or among adventurers.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Do you have more questions?";
+ next;
+ break;
+ case 3:
+ mes "[Steward Aydin]";
+ mes "Enlarge Weight Limit, Push Cart, Vending. These three skills have close relationships.";
+ next;
+ mes "[Steward Aydin]";
+ mes "First talking about ^4d4fffEnlarge Weight Limit^000000 skill, is the skill to increase th character's basic earned points. It is an automatic operational passive skill when you learn it.";
+ next;
+ mes "[Steward Aydin]";
+ mes "This earned point skill reaching a certain level, you can use the skill called ^4d4fffPush Cart^000000";
+ next;
+ mes "[Steward Aydin]";
+ mes "But this Push Cart skill has the disadvantage of the slowdown of moving speed, though the advantage of high loading capacity.";
+ next;
+ mes "[Steward Aydin]";
+ mes "When this Push Cart skill reaches at a certain level, you can use the skill called ^4d4fffVending^000000. This is used to sell your own items to other players.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Besides these, is there any more questions?";
+ next;
+ break;
+ case 4:
+ mes "[Steward Aydin]";
+ mes "Item Appraisal skill is a supplementary skill rather than the essential one.";
+ next;
+ mes "[Steward Aydin]";
+ mes "If you learn this skill you can identify items without having to use a Magnifying Glass Item.";
+ next;
+ mes "[Steward Aydin]";
+ mes "Besides these, is there any more questions?";
+ next;
+ break;
+ }
+ }
+ } else {
+ mes "[Steward Aydin]";
+ mes "I am very busy clearing an account book, so how about talking next time?";
+ close;
+ }
+}
+
+iz_ac02_a,53,171,3 duplicate(Steward Aydin#ac) Steward Aydin#ac_a 4_M_MANAGER
+iz_ac02_b,53,171,3 duplicate(Steward Aydin#ac) Steward Aydin#ac_b 4_M_MANAGER
+iz_ac02_c,53,171,3 duplicate(Steward Aydin#ac) Steward Aydin#ac_c 4_M_MANAGER
+iz_ac02_d,53,171,3 duplicate(Steward Aydin#ac) Steward Aydin#ac_d 4_M_MANAGER
+
+// =============================================================================
+// = Thief
+// =============================================================================
+
+// - Guest Lecturer Mayssel
+// - Teaches the player about the Thief class.
+// -----------------------------------------------------------------------------
+iz_ac02,52,136,3 script Guest Lecturer Mayssel#0 4_F_MAYSEL,{
+ if (!checkweight(1301, 3)) {
+ mes "Quest cannot be continued due to the overfilled inventory.";
+ mes "Please try it again after organizing the items.";
+ close;
+ }
+
+ if (questprogress(4269) > 0 && Class == Job_Novice) {
+ if (!questprogress(7480)) {
+ mes "[Lumin]";
+ mes ".......... Then";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "gc_mayssel05.bmp", 1;
+ mes "[Mayssel]";
+ mes "I see, Lu make it as you want.";
+ next;
+ select("Uh, hi...");
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "I am sorry...";
+ mes "Are you a student of Criatura Academy?";
+ mes "I didn't intend to ignore you.";
+ mes "He is also one of the students in this class.";
+ next;
+ mes "[Mayssel]";
+ mes "Hello " + strcharinfo(0) + "";
+ mes "I am Mayssel the section chief of the Veins section of the Assassin Guild.";
+ mes "I came here to give you some information about the Thief class.";
+ next;
+ mes "[Mayssel]";
+ mes "Do you want to know about the Thief class?";
+ next;
+ if(select("Yes, please.", "No, I won't be a Thief.") == 2) {
+ mes "[Mayssel]";
+ mes "If you want it....";
+ cutin "gc_mayssel05.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Mayssel]";
+ mes "Well a thief is commonly thought of as a criminal.";
+ mes "But our guild is not about taking from those that are in need of it.";
+ next;
+ mes "[Mayssel]";
+ mes "First, we should make it clear.";
+ mes "We don't steal other's belongings.";
+ next;
+ mes "[Lumin]";
+ mes "How about monsters?";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "[Mayssel]";
+ mes "Now monsters...";
+ cutin "gc_mayssel03.bmp", 1;
+ next;
+ mes "[Verkhasel]";
+ mes "Hey, take it easy.";
+ mes "You said it was a mission for something important. But only a place like this...";
+ cutin "gc_verkhasel01.bmp", 2;
+ next;
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "I was upset...";
+ mes "Let me continue.";
+ mes "A Thief uses techniques that common thieves use to be fast and nimble.";
+ next;
+ mes "[Mayssel]";
+ mes "We use stealth to blend into our surroundings and strike our foes.";
+ next;
+ mes "[Mayssel]";
+ mes "Our primary weapon is a dagger and we compensate their attack strength by adding poison property to our attacks.";
+ next;
+ mes "[Mayssel]";
+ mes "The higher class jobs in Thief class are Assassin and Rogue.";
+ mes "Verkhasel is a Guillotine Cross which is the third class of the Assassin Job.";
+ mes "and......";
+ next;
+ mes "[Mayssel]";
+ mes "Mr. Vicente... I called Dumk..";
+ cutin "gc_mayssel02.bmp", 1;
+ next;
+ mes "[Vicente]";
+ mes "Ah, that is... Mayssel..";
+ mes "As you know well about Master.";
+ mes "I can explain about Rogues to you.";
+ next;
+ mes "[Mayssel]";
+ mes "I see...";
+ mes "" + strcharinfo(0) + " Sorry but you can learn about the Shadow Chaser class from them.";
+ cutin "gc_mayssel03.bmp", 1;
+ next;
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "Anyway, these two gentlemen will help you.";
+ mes "^4d4dffCome back to me after speaking to Verkhasel and Vicente.^000000";
+ setquest 7480;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7480) == 1) {
+ if (questprogress(7481) > 0 && questprogress(7482) > 0) {
+ mes "[Mayssel]";
+ mes "Have you learned something about Thief, Assassin and Rogue?";
+ mes "You don't need to understand everything right now.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ if (BaseLevel > 12) {
+ mes "[Mayssel]";
+ mes "I only play the role to inform you of there is this one that one...";
+ mes "The next course is how to use the experience guide... Let's skim it over.";
+ next;
+ mes "[Mayssel]";
+ mes "The guide for skill experience provided by the academy can be used up to level 12.";
+ mes "Regretfully, only the explanation is available for you.";
+ next;
+ mes "[Mayssel]";
+ mes "If you want to be a Thief, you just come back here.";
+ mes "I can help you with the 1st step of the job change.";
+ next;
+ mes "[Mayssel]";
+ mes "Thank you for your hard work.";
+ cutin "gc_mayssel02.bmp", 1;
+ completequest 7480;
+ erasequest 7481;
+ erasequest 7482;
+ setquest 7483;
+ completequest 7483;
+ getexp 800, 50;
+ getitem 569, 30; // Novice_Potion
+ getitem 12325, 20; // N_Magnifier
+ } else {
+ mes "[Mayssel]";
+ mes "I only play the role to inform you of there is this one that one...";
+ mes "Then, let's talk about the Thief's skills.";
+ next;
+ mes "[Mayssel]";
+ mes "I will give you the guide to borrow the thief's skill temporarily.";
+ mes "Organize the guide items, you can see the useful skills on the 'ETC' skill window.";
+ next;
+ mes "[Mayssel]";
+ mes "By making use of the guide, you may take the missions being asked by Verkhasel and Vicente.";
+ completequest 7480;
+ erasequest 7481;
+ erasequest 7482;
+ setquest 7483;
+ getitem 2820, 1; // Thief_Manual
+ }
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Mayssel]";
+ mes "Verkhasel and Vicente will give you various information related to the higher class jobs.";
+ mes "So, come back to me after listening to them.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ mes "[Mayssel]";
+ mes "Preparation for real battle is next.";
+ next;
+ if(select("I see...", "I won't do it.") == 1) {
+ mes "[Mayssel]";
+ mes "I will compensate for you when your mission is completed.";
+ mes "Come back to me after speaking to Verkhasel and Vicente.";
+ } else {
+ mes "[Mayssel]";
+ mes "I see..";
+ mes "This course is now cancelled.";
+ erasequest 7480;
+ }
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (!questprogress(7483)) {
+ mes "[Mayssel]";
+ mes "Have you learned something about Thief, Assassin and Rogue?";
+ mes "You don't need to understand everything right now.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ if (BaseLevel > 12) {
+ mes "[Mayssel]";
+ mes "I only play the role to inform you of there is this one that one...?";
+ mes "The next course is how to use the experience guide... Let's skim it over.";
+ next;
+ mes "[Mayssel]";
+ mes "The guide for skill experience provided by the academy can be used up to level 12.";
+ mes "Regretfully, only the explanation is available for you.";
+ next;
+ mes "[Mayssel]";
+ mes "If you want to be a Thief, you just come back here.";
+ mes "I can help you with the 1st step of the job change.";
+ next;
+ mes "[Mayssel]";
+ mes "You've worked hard.";
+ cutin "gc_mayssel02.bmp", 1;
+ completequest 7480;
+ erasequest 7481;
+ erasequest 7482;
+ setquest 7483;
+ completequest 7483;
+ getexp 800, 50;
+ getitem 569, 30; // Novice_Potion
+ getitem 12325, 20; // N_Magnifier
+ } else {
+ mes "[Mayssel]";
+ mes "I only play the role to inform you of there is this one that one...";
+ mes "Then, let's talk about the Thief's skills.";
+ next;
+ mes "[Mayssel]";
+ mes "I will give you the guide to borrow the thief's skill temporarily.";
+ mes "Organize the guide items, you can see the useful skills on the 'ETC' skill window.";
+ next;
+ mes "[Mayssel]";
+ mes "By making use of the guide, you may take the missions being asked by Verkhasel and Vicente.";
+ completequest 7480;
+ erasequest 7481;
+ erasequest 7482;
+ setquest 7483;
+ getitem 2820, 1; // Thief_Manual
+ }
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7483) == 1) {
+ if (questprogress(7484) > 1 && questprogress(7485) > 1) {
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "Have you got a sense what it is to be a Thief?";
+ mes "If you want to use the skill like double attack, visit ^4d4dffMr. Subino on the 1st floor^000000.";
+ next;
+ mes "[Mayssel]";
+ mes "<NAVI>[Battle Trainer Subino]<INFO>iz_ac01,59,83</INFO></NAVI> will give you several battle missions.";
+ next;
+ mes "[Mayssel]";
+ mes "I hope you experience other skills with battle Quests.";
+ mes "Double attack is somewhat an exciting skill.";
+ next;
+ mes "[Mayssel]";
+ mes "Make a decision after you've at least experienced it.";
+ mes "You still have a long way and enough time before you make a decision... Think of it deeply.";
+ next;
+ mes "[Mayssel]";
+ mes "If you want to be a Thief, you just come back here.";
+ mes "I can help you with the 1st step of the job change.";
+ next;
+ mes "[Mayssel]";
+ mes "Thank you for you hard work.";
+ completequest 7483;
+ getexp 800, 50;
+ getitem 569, 30; // Novice_Potion
+ getitem 12325, 20; // N_Magnifier
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "In the battle training, the actual fighting is more important than theory.";
+ mes "To use the skill once is better than all this talking.";
+ next;
+ mes "[Mayssel]";
+ mes "If you carry out the mission asked by Verkhasel and Vicente, I will go to the next class.";
+ next;
+ if(select("I see.", "I won't do it.") == 1) {
+ mes "[Mayssel]";
+ mes "I will compensate for you when your mission is complete.";
+ mes "Come back to me after listening to Verkhasel and Vicente.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Mayssel]";
+ mes "I see.";
+ mes "This course is now cancelled.";
+ mes "The ongoing lower courses are cancelled.";
+ next;
+ if(select("No.", "Yes, cancel the course.") == 1) {
+ mes "[Mayssel]";
+ mes "Fortunately...";
+ mes "Good to see you have patience.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Mayssel]";
+ mes "All the ongoing courses are cancelled.";
+ mes "These are not your aptitude.";
+ nude;
+ if (countitem(2820) > 0)
+ delitem 2820, countitem(2820); // Thief_Manual
+ erasequest 7483;
+ erasequest 7484;
+ erasequest 7485;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "What are you curious about?";
+ mes "If you want to know about battle, visit <NAVI>[Battle Trainer Subino]<INFO>iz_ac01_c,59,83</INFO></NAVI>.";
+ next;
+ switch(select("Change job to Thief.", "Thief Stat Explanation", "Thief Skill Explanation", "Not curious about it.")) {
+ case 1:
+ if (JobLevel > 9) {
+ mes "[Mayssel]";
+ mes "You made up your mind.";
+ mes "Welcome to the world of shadows.";
+ cutin "gc_mayssel02.bmp", 1;
+ next;
+ cutin "gc_mayssel01.bmp", 1;
+ mes "[Mayssel]";
+ mes "If you are ready, I will send you to the deserts of Morroc to embrace the shadows.";
+ mes "The journey will be both strange and challenging.";
+ next;
+ if(select("At once please.", "I need more time.") == 2) {
+ mes "[Mayssel]";
+ mes "Yes, after a sufficient survey of other jobs, you may make a decision.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Mayssel]";
+ mes "^4d4dffFind the Pyramid^000000 in the ^4d4dffNorthwest^000000 of Morroc.";
+ close2;
+ cutin "", 255;
+ warp "morocc", 30, 290;
+ end;
+ } else {
+ mes "[Mayssel]";
+ mes "I'm sorry but you are short of job levels to change your job.";
+ next;
+ mes "[Mayssel]";
+ mes "Level composes of Base level and Job level.";
+ mes "Job level is what determines your current job.";
+ next;
+ mes "[Mayssel]";
+ mes "^4d4dffThe 1st job condition condition is job level 10.^000000";
+ mes "You need more experience so fight more and level up first.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ case 2:
+ mes "[Mayssel]";
+ mes "You want to know more about stats?";
+ mes "As Vicente already told you, stats don't have a fixed answer.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ mes "[Mayssel]";
+ mes "If I choose one among them,";
+ mes "^4d4dffAGI is related to flee ability^000000,";
+ mes "^4d4dffDex is related with hit ratio";
+ mes "STR raises physical attacking power^000000";
+ next;
+ mes "[Mayssel]";
+ mes "Vit, Luk, Int are valued according your target chosen.";
+ mes "For your reference, Verkhasel has high level of Luk.";
+ mes "A weapon called Katar is good for Critical.";
+ next;
+ mes "[Mayssel]";
+ mes "But thief's primary weapon is a dagger.";
+ mes "In the end, you have only to supplement your weak point, after evaluating you and your enemy.";
+ next;
+ mes "[Mayssel]";
+ mes "If your attack doesn't hit the enemy, you come to think of the hit ratio.";
+ mes "Hope you find the right stats that are suitable to your fighting style.";
+ close2;
+ cutin "", 255;
+ end;
+ case 3:
+ mes "[Mayssel]";
+ mes "Which skill are you curious about?";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ while(1) {
+ switch(select("Improve Dodge", "Double attack", "Hiding and Steal", "Envenom and Detoxify", "Not curious about it.")) {
+ case 1:
+ mes "[Mayssel]";
+ mes "As the name implies, ^4d4dffthis skill increases a certain amount of evasion ratio^000000";
+ mes "You want to avoid taking damage from enemy attack, don't you?";
+ next;
+ break;
+ case 2:
+ mes "[Mayssel]";
+ mes "^4d4dffThis skill allows you to deal two damages with only one attack.^000000";
+ mes "Even though this dagger looks poor, it can damage your enemy severely by the fast two attacks.";
+ next;
+ break;
+ case 3:
+ mes "[Mayssel]";
+ mes "^4d4dffHiding means exactly that... to hide.^000000";
+ next;
+ mes "[Mayssel]";
+ mes "^4d4dffSteal is the skill of stealing enemy's items^000000.";
+ mes "You can steal one item from one enemy.";
+ next;
+ break;
+ case 4:
+ mes "[Mayssel]";
+ mes "^4d4dffEnvenom is used to poison your enemy.^000000";
+ mes "If poisoned, it can make a physical attacks slowly eat away at your foe.";
+ next;
+ mes "[Mayssel]";
+ mes "Oppositely, the name implies, Detoxify removes poison status.";
+ next;
+ break;
+ case 5:
+ mes "[Mayssel]";
+ mes "It is good you have enough knowledge.";
+ mes "Supplementary the field experiences will make you perfect.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ case 4:
+ mes "[Mayssel]";
+ mes "Is that so?";
+ mes "Like other job guilds, there is a limit learned through theory.";
+ mes "I would like to recommend you to experience battle first-hand.";
+ cutin "gc_mayssel01.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+ } else {
+ if (!questprogress(4269)) {
+ mes "[Mayssel]";
+ mes "You are a stranger.";
+ mes "Excuse me but I was invited to explain about the jobs for the students,";
+ mes "I have no words to tell you.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ mes "[Mayssel]";
+ mes "It is almost miracle to meet you and me living far away from the light of ground.";
+ mes "We should abide by the regulations.";
+ next;
+ mes "[Mayssel]";
+ mes "Attending the class, first you may be a student of Criatura Academy.";
+ next;
+ mes "[Mayssel]";
+ mes "However, if you want the information about the thief job itself, I will let you know.";
+ next;
+ switch(select("About the useful stats for a Thief", "About Thief's primary skills", "Not curious about it.")) {
+ case 1:
+ mes "[Mayssel]";
+ mes "You want to know more about stats?";
+ mes "As Vicente already told you, stats don't have a fixed answer.";
+ next;
+ mes "[Mayssel]";
+ mes "If I choose one among them,";
+ mes "^4d4dffAGI is related to flee ability^000000,";
+ mes "^4d4dffDex is related with hit ratio";
+ mes "STR raises physical attacking power^000000";
+ next;
+ mes "[Mayssel]";
+ mes "Vit, Luk, Int are valued according your target chosen.";
+ mes "For your reference, Verkhasel has high level of Luk.";
+ mes "A weapon called Katar is good for Critical.";
+ next;
+ mes "[Mayssel]";
+ mes "But thief's primary weapon is a dagger.";
+ mes "In the end, you have only to supplement your weak point, after evaluating you and your enemy.";
+ next;
+ mes "[Mayssel]";
+ mes "If your attack doesn't hit the enemy, you come to think of the hit ratio.";
+ mes "Hope you find the right stats that are suitable to your fighting style.";
+ close2;
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Mayssel]";
+ mes "Which skill are you curious about?";
+ next;
+ while(1) {
+ switch(select("Improve Dodge", "Double attack", "Hiding and Steal", "Envenom and Detoxify", "Not curious about it.")) {
+ case 1:
+ mes "[Mayssel]";
+ mes "As the name implies, ^4d4dffthis skill increases a certain amount of evasion ratio^000000";
+ mes "You want to avoid taking damage from enemy attack, don't you?";
+ next;
+ break;
+ case 2:
+ mes "[Mayssel]";
+ mes "^4d4dffThis skill allows you to deal two damages with only one attack.^000000";
+ mes "Even though this dagger looks poor, it can damage your enemy severely by the fast two attacks.";
+ next;
+ break;
+ case 3:
+ mes "[Mayssel]";
+ mes "^4d4dffHiding means exactly that... to hide.^000000";
+ next;
+ mes "[Mayssel]";
+ mes "^4d4dffSteal is the skill of stealing enemy's items^000000.";
+ mes "You can steal one item from one enemy.";
+ next;
+ break;
+ case 4:
+ mes "[Mayssel]";
+ mes "^4d4dffEnvenom is used to poison your enemy.^000000";
+ mes "If poisoned, it can make a physical attacks slowly eat away at your foe.";
+ next;
+ mes "[Mayssel]";
+ mes "Oppositely, the name implies, Detoxify removes poison status.";
+ next;
+ break;
+ case 5:
+ mes "[Mayssel]";
+ mes "It is good you have enough knowledge.";
+ mes "Supplementary the field experiences will make you perfect.";
+ cutin "gc_mayssel05.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ case 3:
+ mes "[Mayssel]";
+ mes "After you register as a student, you can take lessons and gain more experience.";
+ cutin "gc_mayssel01.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (Class == Job_Thief) {
+ mes "[Mayssel]";
+ mes "You are on the way of thief.";
+ mes "Thief is the 1st job.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ mes "[Mayssel]";
+ mes "Someday, you would transfer to the 2nd job.";
+ mes "It would be better to think of whether becoming a Log or an Assassin now.";
+ cutin "gc_mayssel02.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Mayssel]";
+ mes "You don't look familiar.";
+ mes "In order to attend this class, you must first become a student of Criatura Academy.";
+ cutin "gc_mayssel01.bmp", 1;
+ next;
+ mes "[Mayssel]";
+ mes "What information would you like to know about the Thief job?";
+ next;
+ switch(select("About the useful stats for a Thief", "About Thief's primary skills", "Not curious about it.")) {
+ case 1:
+ mes "[Mayssel]";
+ mes "You want to know more about stats?";
+ mes "There are no perfect answers for useful stats.";
+ next;
+ mes "[Mayssel]";
+ mes "If I choose one among them,";
+ mes "^4d4dffAGI is related to flee ability^000000,";
+ mes "^4d4dffDex is related with hit ratio";
+ mes "STR raises physical attacking power^000000";
+ next;
+ mes "[Mayssel]";
+ mes "Vit, Luk, Int are valued according your target chosen.";
+ mes "For your reference, Verkhasel has high level of Luk.";
+ mes "A weapon called Katar is good for Critical.";
+ next;
+ mes "[Mayssel]";
+ mes "But thief's primary weapon is a dagger.";
+ mes "In the end, you have only to supplement your weak point, after evaluating you and your enemy.";
+ next;
+ mes "[Mayssel]";
+ mes "If your attack doesn't hit the enemy, you come to think of the hit ratio.";
+ mes "Hope you find the right stats that are suitable to your fighting style.";
+ close2;
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Mayssel]";
+ mes "Which skill are you curious about?";
+ next;
+ while(1) {
+ switch(select("Improve Dodge", "Double attack", "Hiding and Steal", "Envenom and Detoxify", "Not curious about it.")) {
+ case 1:
+ mes "[Mayssel]";
+ mes "As the name implies, ^4d4dffthis skill increases a certain amount of evasion ratio^000000";
+ mes "You want to avoid taking damage from enemy attack, don't you?";
+ next;
+ break;
+ case 2:
+ mes "[Mayssel]";
+ mes "^4d4dffThis skill allows you to deal two damages with only one attack.^000000";
+ mes "Even though this dagger looks poor, it can damage your enemy severely by the fast two attacks.";
+ next;
+ break;
+ case 3:
+ mes "[Mayssel]";
+ mes "^4d4dffHiding means exactly that... to hide.^000000";
+ next;
+ mes "[Mayssel]";
+ mes "^4d4dffSteal is the skill of stealing enemy's items^000000.";
+ mes "You can steal one item from one enemy.";
+ next;
+ break;
+ case 4:
+ mes "[Mayssel]";
+ mes "^4d4dffEnvenom is used to poison your enemy.^000000";
+ mes "If poisoned, it can make a physical attacks slowly eat away at your foe.";
+ next;
+ mes "[Mayssel]";
+ mes "Oppositely, the name implies, Detoxify removes poison status.";
+ next;
+ break;
+ case 5:
+ mes "[Mayssel]";
+ mes "It is good you have enough knwledge.";
+ mes "Supplementary the field experiences will make you perfect.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ break;
+ case 3:
+ mes "[Mayssel]";
+ mes "After you register as a student, you can take lessons and gain more experience.";
+ cutin "gc_mayssel01.bmp", 1;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+ }
+
+ OnInit:
+ //AddQuestInfo 7480 0 0
+ //SetQuestQuest 7480 4269 2
+ //SetQuestJob 7480 NOVICE
+ //AddQuestInfo 7483 0 0
+ //SetQuestQuest 7483 7481 1
+ //SetQuestQuest 7483 7482 1
+ //AddQuestInfo 7495 0 0
+ //SetQuestQuest 7495 7484 2
+ //SetQuestQuest 7495 7485 3
+ end;
+}
+
+iz_ac02_a,52,136,3 duplicate(Guest Lecturer Mayssel#0) Guest Lecturer Mayssel#a 4_F_MAYSEL
+iz_ac02_b,52,136,3 duplicate(Guest Lecturer Mayssel#0) Guest Lecturer Mayssel#b 4_F_MAYSEL
+iz_ac02_c,52,136,3 duplicate(Guest Lecturer Mayssel#0) Guest Lecturer Mayssel#c 4_F_MAYSEL
+iz_ac02_d,52,136,3 duplicate(Guest Lecturer Mayssel#0) Guest Lecturer Mayssel#d 4_F_MAYSEL
+
+// - Vicente
+// - Teaches the player about the Thief class.
+// -----------------------------------------------------------------------------
+iz_ac02,49,134,5 script Vicente#ac 4_M_HUMAN_02,{
+ if (questprogress(4269) > 0 && Class == Job_Novice) {
+ if (!questprogress(7480)) {
+ mes "[Vicente]";
+ mes "Are you curious about the thief job?";
+ mes "Mayssel will give you the details about it.";
+ mes "But, you must be a student of Criatura Academy.";
+ cutin "sc_vicente01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7480) == 1) {
+ if (!questprogress(7481)) {
+ mes "[Vicente]";
+ mes "Hmmm. Thief.... Then, I need to explain to you about stats, too.";
+ cutin "sc_vicente01.bmp", 2;
+ next;
+ mes "[Vicente]";
+ mes "First, ^4d4dffStr power, Agi agility, Dex hit,^000000 these theree elements are all good for a Thief.";
+ mes "Supplementary elements are Int intelligence, Vit vitality, Luk luck.";
+ next;
+ mes "[Vicente]";
+ mes "As ^4d4dffStr raises the physical attacking power, it will be your tool to raises your attacking power against a Thief and Rogue who primarily use daggers^000000.";
+ mes "And, I will raise your limit of carrying items, which means you can load more items.";
+ next;
+ mes "[Vicente]";
+ mes "^4d4dffAgi is to raise your evasion ratio and Aspd attacking speed.^000000 Simply speaking, you become nimble.";
+ next;
+ mes "[Vicente]";
+ mes "Agi is one of the very important figures as you- a thief wearing a light armor have to evade the enemy's attack rather than facing it head on.";
+ next;
+ mes "[Vicente]";
+ mes "And ^4d4dffDex to hit your attack^000000 is unforgettable.";
+ mes "You can do anything once your attack succeeds.";
+ next;
+ mes "[Vicente]";
+ mes "In addition, there are those who are fighting in the War of Emperium with ^4d4dffthe raised VIT energy level to increase their HP vitality^000000.";
+ next;
+ mes "[Vicente]";
+ mes "Among the Rogue skills, there is a skill called 'Intimidate' with which you can learn and use other's skills,";
+ mes "there are some who^4d4dffinvest to Intelligence to use the learned magic from this spell^000000.";
+ next;
+ mes "[Vicente]";
+ mes "We I can tell which one is the right choice.";
+ mes "According to the individual tastes and purposes, you have to split your ability.";
+ mes "But...";
+ next;
+ mes "[Vicente]";
+ mes "Rogues are for ^4d4dffdisarming the enemy's armor^000000 or ^4d4dffstealing better than a thief^000000.";
+ mes "or ^4d4dff fall back after suddenly being attacked^000000";
+ next;
+ mes "[Vicente]";
+ mes "Hmmhmmm. It may look cowardish but it is upgraded from a thief.";
+ mes "As it can have a better eyesight and do the art.";
+ cutin "sc_vicente03.bmp", 2;
+ next;
+ select("Haaaaam...", "Is that so?");
+ mes "[Vicente]";
+ mes ".........you were boring.";
+ mes "Among the thief's skills, there is an item called 'Improve Dodge'.";
+ mes "The stats related to evasion ratio is..";
+ cutin "sc_vicente02.bmp", 2;
+ next;
+ if(select("Dex !!", "Agi !!") == 1) {
+ mes "[Lumin]";
+ mes "Don't mess around with me too much.";
+ mes "It's Agi.";
+ cutin "nov_lumin02.bmp", 0;
+ next;
+ select("Ah, yes...");
+ mes "[Lumin]";
+ mes "Compensation is?";
+ cutin "nov_lumin01.bmp", 0;
+ next;
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Ahhh, yes...";
+ mes "I will give a gift for Lumin.";
+ next;
+ cutin "sc_vicente03.bmp", 2;
+ mes "[Vicente]";
+ mes "Now I will finish my class.";
+ mes "Important thing is not theory like what we are talking about.";
+ mes "Actual fighting!! Actual fighting is key!!";
+ setquest 7481;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Vicente]";
+ mes "Oh, fortunately you have been in the class.";
+ mes "I didn't feel easy as your face look very boring.";
+ mes "Now, shall we keep going on?";
+ cutin "sc_vicente03.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "...... Compensation is?";
+ cutin "nov_lumin02.bmp", 0;
+ next;
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Ah,,, thank you for your pointout.";
+ mes "Be successful!";
+ next;
+ cutin "sc_vicente03.bmp", 2;
+ mes "[Vicente]";
+ mes "Important thing is not theory but actual fighting.";
+ mes "Do you agree?";
+ setquest 7481;
+ getitem 569, 30; // Novice_Potion
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (!questprogress(7486)) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Talking about Rogue,";
+ mes "It is not a cowardish job as the others complain.";
+ next;
+ mes "[Lumin]";
+ mes ".....Don't you have a strange hobby?";
+ mes "Taking off other's clothings.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "sc_vicente02.bmp", 2;
+ mes "[Vicente]";
+ mes "What.. What a thing to say!";
+ mes "Lu, you shouldn't say such things!";
+ mes "Rogue is the upper level to a thief.";
+ next;
+ cutin "nov_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes "Eummm. I won't be a Log.";
+ mes "How about you?";
+ next;
+ if(select("Eh? Me? I don't want to be.", "Me.. I like... Rogue...") == 1) {
+ mes "[Lumin]";
+ mes "Ok. Then you take the bloody way with me.";
+ mes "Becoming a shadow in the dark....";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ select("I don't want to be a thief.", ".... I'm scared!");
+ mes "[Lumin]";
+ mes "... a headache.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ cutin "sc_vicente04.bmp", 2;
+ mes "[Vicente]";
+ mes "Hahahaha. Stop talking about the scary story.";
+ next;
+ cutin "nov_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes ".. Hng..";
+ setquest 7486;
+ completequest 7486;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lumin]";
+ mes "Is that so?";
+ mes "It is an astonishing fighting skill to make the enemy disarmed and disabled.";
+ mes "I thumb up the skill.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "sc_vicente02.bmp", 2;
+ mes "[Vicente]";
+ mes "Will you say a different story from what you told before?";
+ mes "Haha.. To me, Master is good enough, doing the same thing to me.";
+ setquest 7486;
+ completequest 7486;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Vicente]";
+ mes "Keung....";
+ mes "I am losing my excitement.";
+ cutin "sc_vicente04.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ if (!questprogress(7483)) {
+ mes "[Vicente]";
+ mes "If you wish to continue along the path of the Thief, speak to Mayssel.";
+ mes "Her information should be helpful.";
+ cutin "sc_vicente01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7483) == 1) {
+ if (BaseLevel > 12) {
+ if (!questprogress(7484)) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Hmmm. It is about the thief's skill using the manual.";
+ mes "By the way, this manual is only available for experience up to level 12.";
+ next;
+ mes "[Vicente]";
+ mes "The actual exercise of ^4d4dffstealing from monster's items^000000 skill was planned but";
+ mes "you may need to know what it is... No need to do the actual exercise.";
+ next;
+ mes "[Vicente]";
+ mes "I will regard my course as completed.";
+ mes "By the way, what is stealing all about?";
+ next;
+ switch(select("Stealing other's items!", "Stealing monster's items!", "Stealing other's enemy!", "Don't know.")) {
+ case 1:
+ mes "[Vicente]";
+ mes "Wrong! That would be a terrible thing to do.";
+ mes "You can't go around stealing people's things.";
+ cutin "sc_vicente02.bmp", 2;
+ next;
+ break;
+ case 2:
+ mes "[Vicente]";
+ mes "Correct!";
+ mes "You have a good memory£¡";
+ cutin "sc_vicente03.bmp", 2;
+ next;
+ break;
+ case 3:
+ mes "[Vicente]";
+ mes "You like doing that?";
+ mes "That is a terrible thing to do.";
+ next;
+ break;
+ case 4:
+ break;
+ }
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Yes, we steal monster items.";
+ mes "the higher your skill level and the higher your hit ratio is, the success ratio also becomes higher.";
+ next;
+ mes "[Vicente]";
+ mes "Anyway, here I will finish my class.";
+ mes "If you want to continue, there is no way as your level is too high.";
+ setquest 7484;
+ completequest 7484;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7484) == 1) {
+ if (countitem(7049) > 0) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Oh, excellent!";
+ mes "Keep the stone as a souvenir.";
+ completequest 7484;
+ getexp 800, 0;
+ next;
+ mes "[Vicente]";
+ mes "Anyway, you seem to be skilled enough to continue.";
+ mes "Go speak to Mayssel.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Hmmm. It is about the thief's skill using the manual.";
+ mes "By the way, this manual is only available for experience up to level 12.";
+ next;
+ mes "[Vicente]";
+ mes "The actual exercise of ^4d4dffstealing from monster's items^000000 skill was planned but";
+ mes "you may need to know what it is... No need to do the actual exercise.";
+ next;
+ mes "[Vicente]";
+ mes "I will regard my course as completed.";
+ mes "By the way, what is stealing all about?";
+ next;
+ switch(select("Stealing other's items!", "Stealing monster's items!", "Stealing other's enemy!", "Don't know.")) {
+ case 1:
+ mes "[Vicente]";
+ mes "Wrong! That would be a terrible thing to do.";
+ mes "You can't go around stealing people's things.";
+ cutin "sc_vicente02.bmp", 2;
+ next;
+ break;
+ case 2:
+ mes "[Vicente]";
+ mes "Correct!";
+ mes "You have a good memory£¡";
+ cutin "sc_vicente03.bmp", 2;
+ next;
+ break;
+ case 3:
+ mes "[Vicente]";
+ mes "You like doing that?";
+ mes "That is a terrible thing to do.";
+ next;
+ break;
+ case 4:
+ break;
+ }
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Yes, we steal monster items.";
+ mes "the higher your skill level and the higher your hit ratio is, the success ratio also becomes higher.";
+ next;
+ mes "[Vicente]";
+ mes "Anyway, here I will finish my class.";
+ mes "If you want to continue, there is no way as your level is too high.";
+ setquest 7484;
+ completequest 7484;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+ if (!questprogress(7484)) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Hmmm. What?";
+ mes "You are talking about the use of thief skills by using the manual?";
+ mes "First, equip the Thief Manual.";
+ next;
+ mes "[Vicente]";
+ mes "You can either double click ^4d4dff the items to be equipped^000000 or drag it to the equipment window.";
+ next;
+ mes "[Vicente]";
+ mes "Then, open the skill window, you can find the added skills in the 'Misc' tab.";
+ mes "You can even set the skills in the shortcut bar.";
+ next;
+ mes "[Vicente]";
+ mes "Now, out of them, there is a skill called ^4d4dff Steal^000000.";
+ next;
+ mes "[Vicente]";
+ mes "Here is an assignment.";
+ mes "Can you see the ornamental Poring cage?";
+ mes "Steal ^4d4dff one Stone from Poring by using the Steal skill.^000000";
+ next;
+ mes "[Vicente]";
+ mes "Steal has a possibility to fail so don't quit.";
+ mes "Good luck.";
+ setquest 7484;
+ npcskill "AL_BLESSING", 10, 60, 60;
+ percentheal 0, 100;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7484) == 1) {
+ if (countitem(7049) > 0) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Oh, excellent!";
+ mes "Keep the stone as a souvenir.";
+ completequest 7484;
+ getexp 800, 0;
+ next;
+ mes "[Vicente]";
+ mes "Anyway, it is good enough for your skill experience purpose, let's finish the class here.";
+ mes "If you haven't finished Mr. Verkhasel's assignment, keep going with it.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Steal one Stone from a Poring.";
+ mes "Wasn't it fun?";
+ next;
+ if(select("It didn't give me a stone.", "I won't do it.") == 1) {
+ mes "[Vicente]";
+ mes "Hmmm? All porings were stolen of their stones?";
+ mes "I will summon Porings again, and you, try it once again.";
+ donpcevent "#nbacStone01::OnReset";
+ donpcevent "#nbacStone02::OnReset";
+ donpcevent "#nbacStone03::OnReset";
+ npcskill "AL_BLESSING", 10, 60, 60;
+ percentheal 0, 100;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Vicente]";
+ mes "Hmmm. Is that so?";
+ mes "This is not your aptitude.";
+ mes "I see. This mission is now cancelled.";
+ erasequest 7484;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ cutin "sc_vicente01.bmp", 1;
+ mes "[Vicente]";
+ mes "Ahhh. Boring, Boring...";
+ mes "Now I can understand why Master ran away.";
+ mes "I want to go home.";
+ next;
+ cutin "gc_verkhasel01.bmp", 2;
+ mes "[Verkhasel]";
+ mes "So do I.";
+ mes "Mayssel... what did she think of...";
+ next;
+ mes "[Lumin]";
+ mes "Hmmm. Did she go AWOL?";
+ cutin "nov_lumin01.bmp", 0;
+ next;
+ cutin "gc_verkhasel01.bmp", 2;
+ mes "[Verkhasel]";
+ mes "Are you kidding me?!";
+ mes "Would you rather be carrying out a fatal mission!?!";
+ next;
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "Ah... I don't like it.";
+ mes "I would rather evaluate jewelry sitting at the workshop as usual...";
+ next;
+ cutin "gc_mayssel03.bmp", 1;
+ mes "[Mayssel]";
+ mes ".... .. ..";
+ mes "I will accept Verkhassel's wish.";
+ mes "Don't worry hohoho...";
+ next;
+ cutin "", 255;
+ mes "The mood is becoming gloomy.";
+ mes "Should I get out of here?";
+ close;
+ }
+ } else {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "You are doing well.";
+ mes "I hope to see you again someday.";
+ next;
+ mes "[Vicente]";
+ mes "Ah, for your reference, I am operating a small workshop in Lighthalzen.";
+ mes "Visit me there someday.";
+ next;
+ mes "[Vicente]";
+ mes "Perhaps, I won't forget you...";
+ mes "Haha...";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ if (!questprogress(4269)) {
+ cutin "sc_vicente01.bmp", 2;
+ mes "[Vicente]";
+ mes "You are not a student of Criatura Academy.";
+ mes "If you want more explanation about this job, you better register as a student of the Academy.";
+ next;
+ mes "[Vicente]";
+ mes "Though only novices can register...";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ if (Class == Job_Thief) {
+ cutin "sc_vicente03.bmp", 2;
+ mes "[Vicente]";
+ mes "Oh, you became a good thief.";
+ mes "Don't you want to be a shadow chaser in your future?";
+ next;
+ mes "[Vicente]";
+ mes "This is the higher class applied by the elite Rogues of good artistry.";
+ next;
+ mes "[Vicente]";
+ mes "Above job level 40, any Thief can be transferred to a Rogue anytime.";
+ mes "Fortunately, the sailing service from Izlude wharf to Pharos lighthouse is available!!";
+ next;
+ cutin "gc_verkhasel02.bmp", 0;
+ mes "[Verkhasel]";
+ mes "First, is it courteous to ask whether you can be a Rogue or not?";
+ mes "If it is an application for an Assassin, what happens to you?";
+ next;
+ cutin "sc_vicente03.bmp", 2;
+ mes "[Vicente]";
+ mes "Haha. You like a bloody job?";
+ next;
+ cutin "sc_vicente04.bmp", 2;
+ mes "[Vicente]";
+ mes "Haha... Calm down...";
+ mes "Don't respond to every tiny matter..";
+ next;
+ cutin "", 255;
+ mes "The atmosphere became very tense.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "sc_vicente03.bmp", 2;
+ mes "[Vicente]";
+ mes "Welcome to the Criatura Academy.";
+ mes "Here, I am teaching the basics to the people wishing to be a Thief.";
+ next;
+ mes "[Vicente]";
+ mes "So, in other words, I am handling the Novices wanting to be thieves.";
+ mes "Haha...";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+
+ OnInit:
+ //AddQuestInfo 7481 0 0
+ //SetQuestQuest 7481 7480 1
+ //AddQuestInfo 7484 0 0
+ //SetQuestQuest 7484 7483 1
+ end;
+}
+
+iz_ac02_a,49,134,5 duplicate(Vicente#ac) Vicente#ac_a 4_M_HUMAN_02
+iz_ac02_b,49,134,5 duplicate(Vicente#ac) Vicente#ac_b 4_M_HUMAN_02
+iz_ac02_c,49,134,5 duplicate(Vicente#ac) Vicente#ac_c 4_M_HUMAN_02
+iz_ac02_d,49,134,5 duplicate(Vicente#ac) Vicente#ac_d 4_M_HUMAN_02
+
+// - Verkhasel
+// - Teaches the player about the Thief class.
+// -----------------------------------------------------------------------------
+iz_ac02,55,134,3 script Verkhasel#ac 4_M_GUILLOTINE,{
+ if (questprogress(4269) > 0 && Class == Job_Novice) {
+ if (!questprogress(7480)) {
+ mes "[Verkhasel]";
+ mes "What? It interrupts me.";
+ cutin "gc_verkhasel01.bmp", 0;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7480) == 1) {
+ if (!questprogress(7482)) {
+ mes "[Verkhasel]";
+ mes "Eheee, Eheee, It can't be a joke.";
+ mes "Mayssel's class...";
+ mes "Did you call upon me for this kind of nasty thing?";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ select("...Let's keep working?");
+ mes "[Lumin]";
+ mes "It's a pity. That man is scary.";
+ mes "But as long as I am with you, don't be afraid of him.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Verkhasel]";
+ mes "What are you talking about this time?";
+ mes "In the beginning, Lue.. You should not be here...";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ cutin "nov_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes ".........Who am I?";
+ mes "Assistant.... Trainer?";
+ next;
+ cutin "gc_verkhasel02.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Zt...";
+ mes "Well, which one are you curious about?";
+ next;
+ cutin "gc_verkhasel01.bmp", 0;
+ .@ok_chk = 0;
+ while(1) {
+ switch(select("Double Attack", "Envenom", "Improve Dodge and Hide", "About you", "That's enough.")) {
+ case 1:
+ mes "[Verkhasel]";
+ mes "You may already know the primary weapon of a Thief is a dagger.";
+ mes "A Thief's specialty is the ^4d4dffDouble Attack^000000 by a dagger.";
+ next;
+ mes "[Verkhasel]";
+ mes "If you are short of attacking power, it can be covered at a certain degree.";
+ mes "Any other questions?";
+ .@ok_chk = .@ok_chk + 1;
+ next;
+ continue;
+ case 2:
+ mes "[Verkhasel]";
+ mes "There is a skill called ^4d4dffEnvenom^000000 to intoxicate your enemy with poison and";
+ mes "the other skill called ^4d4dffDetoxify^000000 to remove the poisoned status.";
+ next;
+ mes "[Verkhasel]";
+ mes "You can tell the poisoned status by its very pretty purple color.";
+ next;
+ mes "[Verkhasel]";
+ mes "In case, you are poisoned, venom will decrease your vitality rapidly,";
+ mes "you either detoxify right away or take the antidote potion.";
+ next;
+ mes "[Verkhasel]";
+ mes "If you have more interest in poison, you may be an assassin.";
+ mes "They officially use poison.";
+ mes "Then next!";
+ .@ok_chk = .@ok_chk + 1;
+ next;
+ continue;
+ case 3:
+ mes "[Verkhasel]";
+ mes "Thiefs train the skill called ^4d4dffImprove Dodge^000000.";
+ mes "This makes the enemy powerless by evading its attack.";
+ next;
+ mes "[Verkhasel]";
+ mes "Rather than being patient after being hit, it is more suitable for a less defensive thief to avoid from it fast.";
+ mes "Being this reason, agility [AGI] can't be neglected.";
+ next;
+ mes "[Verkhasel]";
+ mes "^4d4dffHiding^000000 is the skill for refuge.";
+ mes "If successful, others can't see you.";
+ next;
+ mes "[Verkhasel]";
+ mes "Ah, as it is said you can't cheat a ghost.... You would be found by evil.";
+ mes "Also sensitive insects recognize it...";
+ next;
+ mes "[Verkhasel]";
+ mes "Other than these, it will be useful for avoiding emergency situations.";
+ mes "When you become higher jobs like Rogue or Assassin, you can learn more useful skills like Refuge.";
+ .@ok_chk = .@ok_chk + 1;
+ next;
+ continue;
+ case 4:
+ mes "[Verkhasel]";
+ mes "Me? I am a chief of the Guillotine Cross.";
+ mes "......";
+ next;
+ cutin "nov_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes "As one of the assassins, I am in charge of punishing the law violators, as the member of the execution group.";
+ mes "For your reference, the primary weapon of Verkhasel is Katar.";
+ next;
+ select("How do you know that?");
+ mes "[Lumin]";
+ mes "That's my hope.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Oh.. Smart funk~~";
+ mes "That's enough, Lu.";
+ mes "Any more questions?";
+ next;
+ continue;
+ case 5:
+ if (.@ok_chk == 0) {
+ mes "[Verkhasel]";
+ mes "You can steal one item from one enemy.";
+ mes "I feel mortified at stopping here, but it's worse to be neglected...";
+ next;
+ } else {
+ mes "[Verkhasel]";
+ mes "OK.";
+ mes "Considering your favor not to ignore me, let's finish it now.";
+ next;
+ }
+ break;
+ }
+ break;
+ }
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Honestly, I don't think you need to know the details about the thief's skills.";
+ mes "Then, just be aware there is something like that..";
+ next;
+ mes "[Verkhasel]";
+ mes "I mean it is good enough now.";
+ setquest 7482;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Anything else you're curious about?";
+ mes "I will give you an answer after you finish Mayssel's class.";
+ next;
+ mes "[Verkhasel]";
+ mes "I mean that she knows it.";
+ mes "Mayssel will do it for you.";
+ next;
+ cutin "nov_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes "Lazy boy.";
+ mes "Tell me the truth... You are annoying..";
+ next;
+ cutin "gc_verkhasel02.bmp", 0;
+ mes "[Verkhasel]";
+ mes ".......You........";
+ mes "Zt.. I don't know the enemy..";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (questprogress(7483) == 1) {
+ if (BaseLevel > 12) {
+ if (!questprogress(7485)) {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Actual experience assignments about the skill?";
+ mes "To do it, your level is too high.";
+ mes "I can't use the guide.";
+ next;
+ mes "[Verkhasel]";
+ mes "Originally, I will let you hunt porings with envenom.";
+ mes "No way, if I can't use the skill....";
+ next;
+ mes "[Verkhasel]";
+ mes "Envenom is the skill to poison.";
+ mes "If not poison him, you can damage to him due to the characteristic of venom.";
+ next;
+ mes "[Verkhasel]";
+ mes "Keep in mind of these. That might be good enough for you.";
+ mes "As it is the class to let you know what you can do.";
+ mes "Let's finish the skill experience.";
+ mes "Check with Mayssel.";
+ setquest 7485;
+ completequest 7485;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(7485) == 1) {
+ if (questprogress(7485, HUNTING) == 2) {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "You are doing well.";
+ mes "Envenom has the poison effect and can damage from venom itself.";
+ next;
+ mes "[Verkhasel]";
+ mes "The skill experience is now enough.";
+ mes "Check it with Mayssel.";
+ completequest 7485;
+ getexp 800, 0;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "You can't equip the Thief Manual?";
+ mes "Your level is too high.";
+ mes "There is no other way.";
+ next;
+ mes "[Verkhasel]";
+ mes "Envenom is the skill to poison.";
+ mes "If not poison him, you can damage to him due to the characteristic of venom.";
+ next;
+ mes "[Verkhasel]";
+ mes "Keep in mind of these. That might be good enough for you.";
+ mes "As it is the class to let you know what you can do.";
+ mes "Let's finish the skill experience.";
+ mes "Check with Mayssel.";
+ completequest 7485;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+
+ if (!questprogress(7485)) {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "This is about the use of skill.";
+ mes "Now if you were an assassin, shall I let you test the skills related to venom which you may continue to use?";
+ next;
+ mes "[Verkhasel]";
+ mes "Load the thief guide receved by Mayssel and open the skill window by pressing Alt+S key,";
+ mes "Register Envenom regisstered on the ETC compartment, by pressing shortcut key^000000";
+ next;
+ mes "[Verkhasel]";
+ mes "Then, approach the Poring's cage in the center of this room and";
+ mes "Aim at Poring, and ^4d4dff' hunt one poring by using";
+ next;
+ mes "[Verkhasel]";
+ mes "That's my assignment to you.";
+ mes "You definitely use envenom to Poring in this room.";
+ mes "don't go out faraway to find Porings.";
+ setquest 7485;
+ next;
+ cutin "nov_lumin02.bmp", 2;
+ mes "[Lumin]";
+ mes "Eummm.";
+ mes "It's sad..";
+ mes "Please accept my condolence in advance, as you can't experience envenom... hehehe...";
+ next;
+ select("What are you talking about?");
+ mes "[Lumin]";
+ mes "From now, I am going to hunt Poring..";
+ mes "...Don't misunderstand me for challenging you, as such I want to make a bet with you.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "Lumin is betting win or loose.";
+ close;
+ } else if (questprogress(7485) == 1) {
+ if (questprogress(7485, HUNTING) == 2) {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "You are doing well.";
+ mes "Envenom has the poison effect and can damage from venom itself.";
+ next;
+ mes "[Verkhasel]";
+ mes "The skill experience is now enough.";
+ mes "Check it with Mayssel.";
+ completequest 7485;
+ getexp 800, 0;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "Come close to a poring cage and use envenom to poring.";
+ mes "You must do it only to porings in this room.";
+ next;
+ if(select("I see..", "I won't do it.") == 1) {
+ mes "[Verkhasel]";
+ mes "OK. Until you kill all the porings in the cage, attack them with venom.";
+ percentheal 0, 100;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Verkhasel]";
+ mes "These are not your aptitude.";
+ mes "I will cancel my assignment, and the other assignments from Mayssel to be cancelled by her.";
+ next;
+ if(select("Cancel.", "I will continue..") == 1) {
+ mes "[Verkhasel]";
+ mes "Cancel the mission to hunt poring with envenom.";
+ erasequest 7485;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Verkhasel]";
+ mes "Have you changed your mind?";
+ mes "Then, until you kill all the poring in the cage, keep attacking them with envenom.";
+ percentheal 0, 100;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Verkhasel]";
+ mes "Now you fully understand what skill venom is..";
+ mes "As you completed my assignment, go and check it with Mayssel.";
+ cutin "gc_verkhasel01.bmp", 0;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Verkhasel]";
+ mes "You are the bung finished Mayssel's class complete.";
+ mes "Any more questions, ask Mayssel.";
+ mes "It is the end of my class.";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ mes "[Verkhasel]";
+ mes "If you become a thief, we may meet together in far future..";
+ mes "If you become an assassin.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ if (!questprogress(4269)) {
+ mes "[Verkhasel]";
+ mes "There is no words to tell you guy not belonging to our academy.";
+ mes "In fact, I pulled out here unwillingly, I don't have mind to be kind of you...";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ mes "[Mayssel]";
+ mes "Wait, Verkhasel.....";
+ mes "Don't get even with other innocent....";
+ mes "How about helping my class for me?";
+ cutin "gc_mayssel03.bmp", 1;
+ next;
+ cutin "", 255;
+ mes "... everyone seems tense..";
+ close;
+ } else {
+ if (Class == Job_Thief) {
+ mes "[Verkhasel]";
+ mes "Yo~ You...";
+ mes "What do you want to be?";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ if(select("An Assassin!", "A Rogue!") == 1) {
+ mes "[Lumin]";
+ mes "Welcome to your joining in the way of bloody darness.";
+ mes "My comrad.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ cutin "gc_verkhasel02.bmp", 0;
+ mes "[Verkhasel]";
+ mes "..............";
+ mes "(Verkhasel glancing at sky)";
+ mes "...";
+ mes "... Ha...!";
+ next;
+ cutin "", 255;
+ mes "The mood is becoming strange.";
+ close;
+ } else {
+ mes "[Verkhasel]";
+ mes "Go over there.";
+ cutin "gc_verkhasel01.bmp", 0;
+ next;
+ cutin "sc_vicente04.bmp", 2;
+ mes "[Vicente]";
+ mes "Oh... Mr. Verkhasel...";
+ mes "Don't play like this among a family.";
+ mes "Why are you dividing us into teams?";
+ next;
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "I've never been in your family.";
+ mes "Originally, you are not a Rogue.";
+ mes "You were only a merchant.";
+ next;
+ cutin "sc_vicente02.bmp", 2;
+ mes "[Vicente]";
+ mes "Oh.. No.. What a dirty word.";
+ mes "Have I asked you for buying something from me?";
+ next;
+ cutin "gc_mayssel03.bmp", 1;
+ mes "[Mayssel]";
+ mes "..........You look friendly.. Two of you...";
+ next;
+ cutin "", 255;
+ mes "The mood has become tense.";
+ close;
+ }
+ } else {
+ cutin "gc_verkhasel01.bmp", 0;
+ mes "[Verkhasel]";
+ mes "You are the guy knows everything you need.";
+ mes "Are you coming to watch only? Emmm?";
+ mes "Why don't you help the juniors without watch only?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ }
+
+ OnInit:
+ //AddQuestInfo 7482 0 0
+ //SetQuestQuest 7482 7480 1
+ //AddQuestInfo 7485 0 0
+ //SetQuestQuest 7485 7483 1
+ end;
+}
+
+iz_ac02_a,55,134,3 duplicate(Verkhasel#ac) Verkhasel#ac_a 4_M_GUILLOTINE
+iz_ac02_b,55,134,3 duplicate(Verkhasel#ac) Verkhasel#ac_b 4_M_GUILLOTINE
+iz_ac02_c,55,134,3 duplicate(Verkhasel#ac) Verkhasel#ac_c 4_M_GUILLOTINE
+iz_ac02_d,55,134,3 duplicate(Verkhasel#ac) Verkhasel#ac_d 4_M_GUILLOTINE
+
+// - Lumin
+// -----------------------------------------------------------------------------
+iz_ac02,62,139,3 script Lumin#ac 4_M_NOV_RUMIN,{
+ if (!checkweight(1301, 3)) {
+ mes "Quest cannot be continued due to the overfilled inventory.";
+ mes "Please try it again after organizing the items.";
+ close;
+ }
+ if (!questprogress(7487, HUNTING)) {
+ if (questprogress(7485) == 2) {
+ mes "[Lumin]";
+ mes "Your eagerness and efforst to complete mission moved me to offer something.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "^4d4dff It is to hunt all 4 Porings here within 30 seconds^000000.";
+ mes "If you do, I will yield to you all the earned item in my hand.";
+ next;
+ select("If I fail?");
+ mes "[Lumin]";
+ mes "It is our bet. You have to give up yours as you lost.";
+ mes "Emmm. As I am generous, I will receive ^4d4dff10 beginner's red potions^000000.";
+ next;
+ if(select("Give Up.", "I Accept.") == 1) {
+ mes "[Lumin]";
+ mes ".... Eh...";
+ mes "Coward!";
+ cutin "nov_lumin02.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lumin]";
+ mes ".... Good!";
+ mes "Now, ^4d4dff speak to me once you finish hunting 4 porings in 30 seconds.^000000";
+ setquest 7487;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Lumin]";
+ mes "The intoxicated enemies won't die only from poisoning.";
+ mes "They only come close to death.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes ".. Why do Porings turn their back?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (questprogress(7487, HUNTING) == 1) {
+ if (questprogress(7487, PLAYTIME) == 2) {
+ mes "[Lumin]";
+ mes "... 30 seconds have passed and you have not yet hunted 4 porings.";
+ mes "Then, it is not interesting.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "If you don't like do it... no way.";
+ mes "As I am generous, I disregard the bet this time.";
+ erasequest 7487;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lumin]";
+ mes "You may be too busy in^4d4dff hunting 4 porings in 30 seconds.^000000";
+ mes "Hey, time passes now...";
+ cutin "nov_lumin01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else if (questprogress(7487, HUNTING) == 2) {
+ if (questprogress(7487, PLAYTIME) == 1) {
+ mes "[Lumin]";
+ mes "Oh... You are very powerful!";
+ mes "Now then, as agreed I will give you everything I have.";
+ cutin "nov_lumin03.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "I've had a lot of fun because of you!";
+ cutin "nov_lumin05.bmp", 2;
+ completequest 7487;
+ getexp 800, 50;
+ getitem 512, 3; // Apple
+ getitem 511, 2; // Green_Herb
+ getitem 569, 22; // Novice_Potion
+ getitem 622, 1; // Rainbow_Carrot
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lumin]";
+ mes "Regretfully, 30 seconds has passed.";
+ cutin "nov_lumin02.bmp", 2;
+ mes ".....";
+ next;
+ mes "[Lumin]";
+ mes "I will give them to you anyways.";
+ mes "Come on, take it.";
+ cutin "nov_lumin03.bmp", 2;
+ completequest 7487;
+ getexp 800, 50;
+ getitem 512, 22; // Apple
+ next;
+ select("Why are you treating me like this?", "Didn't I loose?");
+ mes "[Lumin]";
+ mes "You spent time with me.";
+ mes "Get it free. I stole them from Porings.";
+ cutin "nov_lumin05.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ if (Class == Job_Novice) {
+ mes "[Lumin]";
+ mes "We may meet again.";
+ mes "Becoming familiar with others is pleasrue and sad.";
+ cutin "nov_lumin02.bmp", 2;
+ next;
+ mes "[Lumin]";
+ mes "... It may be in trouble if it dies upfront...";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Lumin]";
+ mes "At last, the day comes.";
+ cutin "nov_lumin01.bmp", 2;
+ next;
+ cutin "", 255;
+ mes "Lumin changing clothes piece by piece.";
+ specialeffect2 EF_SPHERE;
+ specialeffect2 EF_SPHERE;
+ classchange "Lumin#"+strnpcinfo(2), 4_M_THIEF_RUMIN;
+ next;
+ cutin "thf_lumin01.bmp", 2;
+ mes "[Lumin]";
+ mes "I was carrying out my mission.";
+ next;
+ select("No need to make an excuse....");
+ mes "[Lumin]";
+ mes "At least to you, I don't want to be a stranger.";
+ mes "Forget what you saw today, as I have to introduce to the way of Thief Guild as many people as possible.";
+ cutin "thf_lumin05.bmp", 2;
+ close2;
+ specialeffect2 EF_SPHERE;
+ specialeffect2 EF_SPHERE;
+ classchange "Lumin#"+strnpcinfo(2), 4_M_NOV_RUMIN;
+ cutin "", 255;
+ end;
+ }
+ }
+
+ OnInit:
+ //AddQuestInfo 7487 0 0
+ //SetQuestQuest 7487 7485 1
+ end;
+}
+
+iz_ac02_a,62,139,3 duplicate(Lumin#ac) Lumin#ac_a 4_M_NOV_RUMIN
+iz_ac02_b,62,139,3 duplicate(Lumin#ac) Lumin#ac_b 4_M_NOV_RUMIN
+iz_ac02_c,62,139,3 duplicate(Lumin#ac) Lumin#ac_c 4_M_NOV_RUMIN
+iz_ac02_d,62,139,3 duplicate(Lumin#ac) Lumin#ac_d 4_M_NOV_RUMIN
+
+// - Porings
+// -----------------------------------------------------------------------------
+iz_ac02,1,1,0 script #nbacStone01 CLEAR_NPC,{
+ end;
+
+ OnInit:
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnReset:
+ killmonster strnpcinfo(4),"#"+strnpcinfo(2)+"::OnMyMobDead";
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnMyMobDead:
+ .@dead_num = mobcount(""+strnpcinfo(4)+"", "#"+strnpcinfo(2)+"::OnMyMobDead");
+ if (.@dead_num < 1)
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnSpawn:
+ monster strnpcinfo(4),59,143,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),60,143,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),61,143,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),62,143,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ end;
+}
+
+iz_ac02_a,1,1,0 duplicate(#nbacStone01) #nbacStone01_a CLEAR_NPC
+iz_ac02_b,1,1,0 duplicate(#nbacStone01) #nbacStone01_b CLEAR_NPC
+iz_ac02_c,1,1,0 duplicate(#nbacStone01) #nbacStone01_c CLEAR_NPC
+iz_ac02_d,1,1,0 duplicate(#nbacStone01) #nbacStone01_d CLEAR_NPC
+
+// --
+iz_ac02,1,1,0 script #nbacStone02 CLEAR_NPC,{
+ end;
+
+ OnInit:
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnReset:
+ killmonster strnpcinfo(4),"#"+strnpcinfo(2)+"::OnMyMobDead";
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnMyMobDead:
+ .@dead_num = mobcount(""+strnpcinfo(4)+"", "#"+strnpcinfo(2)+"::OnMyMobDead");
+ if (.@dead_num < 1)
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnSpawn:
+ monster strnpcinfo(4),59,137,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),60,137,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),61,137,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),62,137,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ end;
+}
+
+iz_ac02_a,1,1,0 duplicate(#nbacStone02) #nbacStone02_a CLEAR_NPC
+iz_ac02_b,1,1,0 duplicate(#nbacStone02) #nbacStone02_b CLEAR_NPC
+iz_ac02_c,1,1,0 duplicate(#nbacStone02) #nbacStone02_c CLEAR_NPC
+iz_ac02_d,1,1,0 duplicate(#nbacStone02) #nbacStone02_d CLEAR_NPC
+
+// --
+iz_ac02,1,1,0 script #nbacStone03 CLEAR_NPC,{
+ end;
+
+ OnInit:
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnReset:
+ killmonster strnpcinfo(4),"#"+strnpcinfo(2)+"::OnMyMobDead";
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnMyMobDead:
+ .@dead_num = mobcount(""+strnpcinfo(4)+"", "#"+strnpcinfo(2)+"::OnMyMobDead");
+ if (.@dead_num < 1)
+ donpcevent "#"+strnpcinfo(2)+"::OnSpawn";
+ end;
+
+ OnSpawn:
+ monster strnpcinfo(4),59,131,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),60,131,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),61,131,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ monster strnpcinfo(4),62,131,"Poring",R_PORING,1,"#"+strnpcinfo(2)+"::OnMyMobDead";
+ end;
+}
+
+iz_ac02_a,1,1,0 duplicate(#nbacStone03) #nbacStone03_a CLEAR_NPC
+iz_ac02_b,1,1,0 duplicate(#nbacStone03) #nbacStone03_b CLEAR_NPC
+iz_ac02_c,1,1,0 duplicate(#nbacStone03) #nbacStone03_c CLEAR_NPC
+iz_ac02_d,1,1,0 duplicate(#nbacStone03) #nbacStone03_d CLEAR_NPC
+
+// =============================================================================
+// = Acolyte
+// =============================================================================
+
+// - Acolyte Leader Alice
+// -----------------------------------------------------------------------------
+iz_ac02,156,169,5 script Acolyte Leader Alice#2 4_F_ACOLYTE,{
+ if (questprogress(4269) < 1) {
+ mes "[Alice Yisha]";
+ mes "Did you ^ff0000register with the Criatura Academy^000000?";
+ mes "You can register at ^ff0000information center of Criatura Academy^000000.";
+ cutin "acact_03.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "It is annoying... but you need to register so you can receive ^ff0000lots of education and service of Criatura Academy^000000.";
+ cutin "acact_01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ if (questprogress(11343) == 0) {
+ mes "[Alice Yisha]";
+ mes "oh Odin!";
+ mes "Nice to meet you.";
+ mes "I am Alice Yisha ^ff0000in charge of Acolytes^000000.";
+ cutin "acact_01.bmp", 2;
+ setquest 11343;
+ completequest 11343;
+ next;
+ } else {
+ mes "[Alice Yisha]";
+ mes "Welcome~";
+ mes "Glad to meet you again.";
+ cutin "acact_01.bmp", 2;
+ if (questprogress(11343) == 1)
+ completequest 11343;
+ next;
+ }
+ if (Class == Job_Novice) {
+ mes "[Alice Yisha]";
+ mes "If you did not select Acolyte as a job, why don't you study more about it?";
+ cutin "acact_01.bmp", 2;
+ next;
+ .@menu$ = "What is an Acolyte?:Battle Acolyte:Support Acolyte:Change job class to Acolyte.:End Conversation";
+ } else {
+ mes "[Alice Yisha]";
+ mes "I guess you do not need my help any more.";
+ mes "Do you have any questions about Acolytes?";
+ cutin "acact_03.bmp", 2;
+ next;
+ .@menu$ = "What is an Acolyte?:Battle Acolyte:Support Acolyte::End Conversation";
+ }
+ switch(select(.@menu$)) {
+ case 1:
+ mes "[Alice Yisha]";
+ mes "An acolyte serves ^ff0000Odin^000000 so it can use ^ff0000Holy skills^000000 according to the will of Odin.";
+ cutin "acact_02.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "Most skills are based on ^ff0000the purpose of treatment or aid^000000 so it is a very important job for ^ff0000party hunting^000000.";
+ cutin "acact_03.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "It is a ^ff0000hybrid job^000000 which can change ^ff0000attack type^000000 depends on increased status, but the range of weapon is narrow because they don't use fatal killing weapons for religious reason.";
+ close2;
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Alice Yisha]";
+ mes "An acolyte is categorized as ^ff0000support type^000000 and ^ff0000physical attack type^000000.";
+ next;
+ switch(select("Support type", "Attack type", "Stop.")) {
+ case 1:
+ mes "[Alice Yisha]";
+ mes "^ff0000INT^000000 is important status for ^ff0000support type Acolytes^000000.";
+ mes "^ff0000INT^000000 enhances ^ff0000treatment function^000000 and increases ^ff0000SP^000000 which is necessary for using skills.";
+ mes "It also helps ^ff0000SP recovery^000000.";
+ cutin "acact_02.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "But aid type acolyte has a weakness point such as ^ff0000It is difficult to hunt alone^000000.";
+ mes "So it goes huning with ^ff0000party^000000 or use ^ff0000heal^000000 skill to monsters with ^ff0000fire-attribute^000000.";
+ next;
+ mes "[Alice Yisha]";
+ mes "It is like ^ff0000heal skill with holly power is fatal to undead with fire-attribute^000000.";
+ cutin "acact_01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ case 2:
+ mes "[Alice Yisha]";
+ mes "The important status FOR ^ff0000physical attack type^000000 acolyte is ^ff0000STR, VIT, AGI, DEX^000000.";
+ mes "The status seem to be complicated compare to support type but it is simple indeed.";
+ cutin "acact_02.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "^ff0000STR is the power, increases attack power, VIT is physical power, AGI is attack , speed and dodge, DEX increases hitting rate and skill casting speed.";
+ cutin "acact_01.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "For the character of ^ff0000Attack type^000000, ^ff0000DEX^000000 will be most important status...no?";
+ mes "If the attack does not hit the enemy, the attack is meaningless.";
+ mes "You may increase STR, VIT, AGI according to your style.";
+ next;
+ mes "[Alice Yisha]";
+ mes "You might think an Acolyte is not strong enough because it has no attack type skill, it enables use of sub essential skills which enhance the powers as much as you want. It helps your stable hunting.";
+ close2;
+ cutin "", 255;
+ end;
+ case 3:
+ mes "[Alice Yisha]";
+ mes "Ask me anything if you have more questions.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ case 3:
+ mes "[Alice Yisha]";
+ mes "An acolyte has lots of skills.";
+ mes "All those skills are useful.";
+ next;
+ mes "[Alice Yisha]";
+ mes "^ff0000Heal^000000 is for the wounds, It is also used to attack undead with opposite attribute.";
+ mes "Increase the power related to ^ff0000speed^000000 and ^ff0000[Increase Agi]^000000 to increase ^ff0000movement speed^000000";
+ mes "^ff0000[Blessing]^000000 can ^ff0000enhance^000000 ^ff0000STR, INT, DEX^000000 at the same time.";
+ next;
+ mes "[Alice Yisha]";
+ mes "^ff0000[Teleport]^000000 is to ^ff0000move^000000 to other places.";
+ mes "^ff0000[Warp Portal]^000000 can open a gate to the ^ff0000Places saved in memory^000000.";
+ mes "There are still more skills as well.";
+ next;
+ mes "[Alice Yisha]";
+ mes "Ask ^ff0000if you want to experience skills of an Acolyte, ask the sister next to you^000000.";
+ mes "Now I am reading an introductory skill.";
+ emotion e_omg, 0, "A Nun#"+strnpcinfo(2);
+ close2;
+ cutin "", 255;
+ end;
+ case 4:
+ mes "[Alice Yisha]";
+ mes "oh my!";
+ mes "So.. you decided to be an Acolyte?";
+ mes "Odin welcomes you.";
+ cutin "acact_02.bmp", 2;
+ next;
+ mes "[Alice Yisha]";
+ mes "Do you truly wish to become a servant of God?";
+ mes "Let's see whether you are ready for it or not... Hmm...";
+ next;
+ if (BaseLevel > 14) {
+ mes "[Alice Yisha]";
+ mes "Please visit ^ff0000Father Mareusis^000000 at the church in the ^ff0000northeast corner^000000 of ^ff0000Prontera.^000000";
+ mes "At ^ff0000Job Level 10^000000 you can join the ministry.";
+ cutin "acact_01.bmp", 2;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (JobLevel < 10) {
+ mes "[Alice Yisha]";
+ mes "Oh my?! You haven't accomplished the basic practice yet?! You have long way to go! Come again after increasing your job level!";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Alice Yisha]";
+ mes "Wonderful! I'll transfer you to the local ministry at Prontera.";
+ mes "^ff0000Please visit Father Mareusis at the church in the northeast corner of Prontera.^000000";
+ mes "At ^ff0000Job Level 10^000000 you can join the ministry.";
+ cutin "acact_01.bmp", 2;
+ next;
+ if(select("Go to the field south of Prontera", "End Conversation") == 2) {
+ mes "[Alice Yisha]";
+ mes "Ask me anything if you have more questions.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Alice Yisha]";
+ mes "Good, I wish you luck~";
+ mes "Let's go~";
+ close2;
+ cutin "", 255;
+ warp "prt_fild08", 170, 369;
+ end;
+ }
+ case 5:
+ mes "[Alice Yisha]";
+ mes "Ask me anything if you have more questions.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+}
+
+iz_ac02_a,156,169,5 duplicate(Acolyte Leader Alice#2) Acolyte Leader Alice#2_a 4_F_ACOLYTE
+iz_ac02_b,156,169,5 duplicate(Acolyte Leader Alice#2) Acolyte Leader Alice#2_b 4_F_ACOLYTE
+iz_ac02_c,156,169,5 duplicate(Acolyte Leader Alice#2) Acolyte Leader Alice#2_c 4_F_ACOLYTE
+iz_ac02_d,156,169,5 duplicate(Acolyte Leader Alice#2) Acolyte Leader Alice#2_d 4_F_ACOLYTE
+
+// - A nun
+// -----------------------------------------------------------------------------
+iz_ac02,152,165,5 script A Nun#2 4_F_SISTER,{
+ if (JobLevel > 10 || Class != Job_Novice) {
+ mes "[A nun]";
+ mes "Wow... this academy is amazing?";
+ mes "It was not like this when I used to train in the past.";
+ close;
+ } else {
+ if (!checkweight(1119, 3)) {
+ mes "- You have too many items. Clear inventory and try again. -";
+ close;
+ }
+ if (!questprogress(4269)) {
+ mes "[A nun]";
+ mes "Wow... this academy is amazing?";
+ mes "It was not like this when I used to train in the past.";
+ next;
+ mes "[A nun]";
+ mes "You can ^ff0000register^000000 at the ^ff0000information center of the Criatura Academy^000000, it will be a great help.";
+ close;
+ } else {
+ mes "[A nun]";
+ mes "Ahem..~";
+ mes "Who are you?";
+ mes "Are you interested in this ^ff0000introductory course^000000?";
+ next;
+ mes "[A nun]";
+ mes "This introductory manual is mysterious! It enables the ^ff0000use a couple of an Acolyte's skill^000000.";
+ mes "Will you borrow it?";
+ next;
+ if(select("Take the Acolyte Course.", "Stop.") == 2) {
+ mes "[A nun]";
+ mes "Well.. if you are not interested.. fine.";
+ mes "murmuring";
+ close;
+ }
+ if (isequippedcnt(2821) > 0 || countitem(2821) > 0) {
+ mes "[A nun]";
+ mes "You already have one.";
+ mes "We do not give two.";
+ close;
+ } else {
+ mes "[A nun]";
+ mes "Then, use it for good.";
+ mes "^ff0000Equip (double click or drag to equipment window)^000000 and open the ^ff0000skill window(Alt+S)^000000 to see the skills in manual.";
+ getitem 2821, 1; // Acolyte_Manual
+ close;
+ }
+ }
+ }
+}
+
+iz_ac02_a,152,165,5 duplicate(A Nun#2) A Nun#2_a 4_F_SISTER
+iz_ac02_b,152,165,5 duplicate(A Nun#2) A Nun#2_b 4_F_SISTER
+iz_ac02_c,152,165,5 duplicate(A Nun#2) A Nun#2_c 4_F_SISTER
+iz_ac02_d,152,165,5 duplicate(A Nun#2) A Nun#2_d 4_F_SISTER
+
+// =============================================================================
+// = Ninja
+// =============================================================================
+
+// - Ninja Guide (Ko Ori)
+// - Teaches the player about the Ninja class.
+// -----------------------------------------------------------------------------
+iz_ac02,140,139,5 script Ninja Guide#ac 4_M_NINJA_BLUE,{
+ cutin "aca_ninja_k.bmp", 2;
+ if (Class != Job_Novice) {
+ if (Upper != 0) {
+ mes "[Ninja Guide]";
+ mes "I do not wish to speak to you. Leave now...";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ if (Class == Job_Ninja) {
+ if (!questprogress(4268)) {
+ mes "[Ninja Guide]";
+ mes "If you want to be trained as a Ninja, just visit Hono O, who is at the room next to where you upgraded.";
+ setquest 4268;
+ close2;
+ cutin "", 255;
+ end;
+ } else if (questprogress(4268) == 1) {
+ mes "[Ko Ori]";
+ mes "If you want to be trained as a Ninja, just visit Hono O, who is at the room next to where you upgraded.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Ko Ori]";
+ mes "How was it?";
+ mes "Although he is very blunt, he does care very deeply about newcomers.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ } else {
+ mes "[Ninja Guide]";
+ mes "I am the guide to the way of the Ninja for newcomers.";
+ next;
+ mes "[Ninja Guide]";
+ mes "I am not interested in the people who are already on their path.";
+ mes "Take your leave now...";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ } else {
+ if(Upper == 2) {
+ mes "[Ninja Guide]";
+ mes "A child cannot accept the life of the Ninja.";
+ mes "It is not easy to qualify for such a life, so do not feel sorry...";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ if(questprogress(4269) != 2) {
+ mes "[Ninja Guide]";
+ mes "First of all, you must enroll in the Academy and visit me again.";
+ mes "Everything has to follow the correct procedures and being clumsy is no excuse.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Ninja Guide]";
+ mes "Hmmm. So a new beginner has come eh?";
+ mes "Why are you here?";
+ next;
+ switch(select("Explanation about the Ninja.", "I decided to be a Ninja.", "I don't have any business here.")) {
+ case 1:
+ while(1) {
+ mes "[Ninja Guide]";
+ mes "A beginner wishing to be a Ninja....";
+ mes "Ask me what you are curious about.";
+ next;
+ switch(select("What can I do if I become a Ninja?", "What is required to become a Ninja?", "I want to experience Ninja skills.", "I don't have any worries about Ninjas.")) {
+ case 1:
+ mes "[Ninja Guide]";
+ mes "Ninja is a profession that allows you to attack while sneaking for maximum damage.";
+ mes "As Ninja has various kinds of deception skills, which is good for soloing.";
+ next;
+ mes "[Ninja Guide]";
+ mes "Not only can you learn Ninja technique similarly as magic, you can also make direct attacks, deal critical damage or throw knives at enemies.";
+ next;
+ mes "[Ninja Guide]";
+ mes "But you can't do all of these things perfectly without sufficient equipment.";
+ mes "You will take more damage than others if you are hit.";
+ next;
+ mes "[Ninja Guide]";
+ mes "Therefore, if the person who is not completely weary of this world chooses this job, with no discretion, they will not fail.";
+ next;
+ break;
+ case 2:
+ mes "[Ninja Guide]";
+ mes "Ninja can be trained in a variety of courses.";
+ mes "Everything has both one merit and one demerit.";
+ mes "You would better make your own decision after profound consideration.";
+ next;
+ mes "[Ninja Guide]";
+ mes "There are two major status which affect the degree of damages.";
+ mes "One is ^ff0000Power^000000, the other is ^ff0000Intelligence^000000,";
+ mes "Power affects the damages by^8E2323 physical attacks^000000 and^8E2323 throwing attacks^000000.";
+ mes "Intelligence affects the damage by ^8E2323 Ninja's skill ^000000";
+ next;
+ mes "[Ninja Guide]";
+ mes "In addition to these, you can learn";
+ mes "other statuses not from the professional trainers like us";
+ mes "but from the trainers teaching the basic skills for battle.";
+ next;
+ mes "[Ninja Guide]";
+ mes "For example, to raise up the hit rate,";
+ mes "What should you do?";
+ mes "To raise the defense, what do you wear? Etc...";
+ next;
+ break;
+ case 3:
+ if (countitem(2940) > 0) {
+ mes "[Ninja Guide]";
+ mes "You can equip this manual to experience some skills.";
+ mes "Open up your skill window by pressing <Alt+S> and find the skills in the Misc TAB.";
+ next;
+ mes "[Ninja Guide]";
+ mes "The Academy has a trainer downstairs who will give you battle field training. Meet him and train your skills.";
+ next;
+ mes "[Ninja Guide]";
+ mes "He will give you some quests to complete. Use the Manual to help you in battle.";
+ if (countitem(13295) < 10)
+ getitem 13295, 10; // Light_Shuriken
+ next;
+ } else {
+ mes "[Ninja Guide]";
+ mes "Make every useful moment count.";
+ mes "You can equip this manual to experience some skills.";
+ mes "Open up your skill window by pressing <Alt+S> and find the skills in the Misc TAB.";
+ getitem 2940, 1; // Ninja_Manual
+ getitem 13295, 10; // Light_Shuriken
+ next;
+ mes "[Ninja Guide]";
+ mes "The Academy has a trainer downstairs who will give you battle field training. Meet him and train your skills.";
+ next;
+ mes "[Ninja Guide]";
+ mes "He will give you some quests to complete. Use the Manual to help you in battle.";
+ next;
+ }
+ break;
+ case 4:
+ mes "[Ninja Guide]";
+ mes "Do you understand everything I told you?";
+ mes "That's all... You don't have any questions?";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ break;
+ case 2:
+ if (getskilllv("NV_BASIC") < 9) {
+ mes "[Ninja Guide]";
+ mes "I appreicate your braveness but, first of all, you have to be familiar with the current profession.";
+ next;
+ mes "[Ninja Guide]";
+ mes "Before you decide to become a Ninja,";
+ mes "you need to come back after reaching the novice's job level 9. Then, I will accept you.";
+ close2;
+ cutin "", 255;
+ end;
+ } else {
+ mes "[Ninja Guide]";
+ mes "This may be your last warning.";
+ mes "Becoming a Ninja means leading a difficult life.";
+ next;
+ mes "[Ninja Guide]";
+ mes "As Ninja don't belong to a guild, it is easily obtainable to Novices.";
+ mes "Make sure your decision is final!";
+ next;
+ if(select("I will reconsider.", "I already made up my mind.") == 1) {
+ mes "[Ninja Guide]";
+ mes "Well thought actions can often bring good results.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ mes "[Ninja Guide]";
+ mes "If you're so assertive, I have no choice but to guide you there.";
+ next;
+ mes "[Ninja Guide]";
+ mes "I will send you close to where you can change your job.";
+ next;
+ mes "[Ninja Guide]";
+ mes "I will give you a special hint.";
+ mes "Amatsu town is where you are going to arrive. Find the hidden tunnel in a vacant house.";
+ next;
+ mes "[Ninja Guide]";
+ mes "There you will meet a person who will guide you to becoming a Ninja.";
+ next;
+ mes "[Ninja Guide]";
+ mes "If you get lost in the town, well there is no way... Being ninja requires a level of observation power.";
+ next;
+ mes "-Select ^ff0000Confirm^000000 to go to Amatsu.";
+ cutin "", 255;
+ next;
+ if(select("Confirm", "Cancel") == 1)
+ warp "amatsu", 112, 141;
+ mes "[Ninja Guide]";
+ mes "............";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ case 3:
+ mes "[Ninja Guide]";
+ mes "......";
+ next;
+ mes "[Ninja Guide]";
+ mes "I have no words to say, if you don't have any business with me.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ }
+ cutin "", 255;
+ end;
+}
+
+iz_ac02_a,140,139,5 duplicate(Ninja Guide#ac) Ninja Guide#ac_a 4_M_NINJA_BLUE
+iz_ac02_b,140,139,5 duplicate(Ninja Guide#ac) Ninja Guide#ac_b 4_M_NINJA_BLUE
+iz_ac02_c,140,139,5 duplicate(Ninja Guide#ac) Ninja Guide#ac_c 4_M_NINJA_BLUE
+iz_ac02_d,140,139,5 duplicate(Ninja Guide#ac) Ninja Guide#ac_d 4_M_NINJA_BLUE
+
+
+// =============================================================================
+// = Enchanting / Upgrading NPCs
+// =============================================================================
+
+// - Refinery Owner Han
+// -----------------------------------------------------------------------------
+izlude,153,126,1 script Refinery Owner Han#iz 4_M_02,{
+ if (!checkweight(1301, 1)) {
+ mes "- Cannot progress with the dialogue because you have too many items. -";
+ close;
+ }
+ .@jerun_tutorial = questprogress(5153) + questprogress(5154) + questprogress(5155) + questprogress(5156);
+ if (.@jerun_tutorial == 0) {
+ mes "[Refinery Owner Han]";
+ mes "Hello? My name is Han to lead the next generation of refining culture in Rune Midguard.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Entering this market lately, if I don't have old customers, it is not easy to operate. So, I do the advertising by myself.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Are you interested in ^3E86C3refining^000000 to make your items strong?";
+ next;
+ if(select("I have no interest.", "refining? Is it edible?") == 1) {
+ emotion e_sry;
+ mes "[Refinery Owner Han]";
+ mes "Ah, I am sorry. I caught a busy man.";
+ close;
+ }
+ mes "[Refinery Owner Han]";
+ mes "Refining means to strenghthen your equipments with ^3E86C3rare metal^000000 obtainable from monsters and so on.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "If weapons are refined, their attacking power increases. If shields are refined, their defensive power increasesand helps to reduce pain against monster's hits on you.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "So you kind of get the jist of it right?";
+ next;
+ select("Oh... refining...");
+ mes "[Refinery Owner Han]";
+ mes "Yes, that's it. Refining is good but it can get addicting.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "I don't usually do it, but will give you a special chance to experience refining.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Whatever 1st level weapon level can be used it doesn't matter! If you use the ^3E86C3refining machine Wagjak^000000 over there!!";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "^I will give you ^FD4F02just! one refining service free of charge.^000000.";
+ next;
+ select("Only once?");
+ setquest 5153;
+ mes "[Refinery Owner Han]";
+ mes "Hey I need to make a living you know! Don't go telling everyone I'm doing this for free ok?";
+ close;
+ } else if (.@jerun_tutorial == 1) {
+ mes "[Refinery Owner Han]";
+ mes "You haven't used the refining machine Wagjak.";
+ next;
+ switch(select("Refining Machine Wagjak", "Why is it called Wagjak?", "Anything else I should know?", "Cancel")) {
+ case 1:
+ mes "[Refinery Owner Han]";
+ mes "The refining machine Wagjak is a machine I made after 8 years of research.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "I made it for more precious refining. It is my personal refining machine. Well, thanks to it, I have made several contracts.";
+ close;
+ case 2:
+ mes "[Refinery Owner Han]";
+ mes "The name doesn't mean anything it's just a name. Wagjak! What a weird name right?";
+ close;
+ case 3:
+ mes "[Refinery Owner Han]";
+ mes "Absolutely!";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "But I subscribe to the idea that seeing is believing... You know what I mean? Try it out yourself instead of asking questions.";
+ close;
+ case 4:
+ break;
+ }
+ } else if (.@jerun_tutorial == 2) {
+ mes "[Refinery Owner Han]";
+ mes "Ohoh... as you don't have a service coupon.. You may have already used Wagjak...";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "I hope you have a brief understanding of refining.";
+ next;
+ select("Anything else I should know?");
+ mes "[Refinery Owner Han]";
+ mes "Yes, yes, we have... Safety refining indications and refining price... such small things...";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "For an explanation ^3E86C3weapon levels^000000 & ^3E86C3safety refining^000000...";
+ next;
+ setquest 5154;
+ mes "[Refinery Owner Han]";
+ mes "You can learn from ^3E86C3Mr. Taddae^000000 selling Phracon and Emveteracon";
+ close;
+ } else if (.@jerun_tutorial == 3) {
+ mes "[Refinery Owner Han]";
+ mes "I recommend you visit and listen to Mr. Tadde about weapon levels and safe refining.";
+ close;
+ } else if (.@jerun_tutorial == 4) {
+ mes "[Refinery Owner Han]";
+ mes "Did you get a good lesson? Did he explain it well enough?";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Just between us, there is a rumor that lots of employees complain about me.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "I sent you there to monitor the situation.";
+ next;
+ select("So?");
+ mes "[Refinery Owner Han]";
+ mes "I will adopt it in the performance rating. By the way, how was Mr. Tadde's lesson?";
+ next;
+ switch(select("It was excellent.", "It was just OK.", "It was so-so.")) {
+ case 1:
+ mes "[Refinery Owner Han]";
+ mes "He did a good job...";
+ next;
+ break;
+ case 2:
+ mes "[Refinery Owner Han]";
+ mes "Hmm. Is that so? I see... I'll have to jot this down...";
+ next;
+ break;
+ case 3:
+ mes "[Refinery Owner Han]";
+ mes "Hmm.. It was like that... I see.";
+ next;
+ break;
+ }
+ mes "[Refinery Owner Han]";
+ mes "Now! I'm done organizing..";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Next is the explanation about ^3E86C3refining effect^000000 and ^3E86C3refining price^000000.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "^3E86C3Mr. Locas^000000 is in charge with refinement with Oridecon gemstones.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Go speak with Mr. Locas's about the refining effect and refining price.";
+ next;
+ setquest 5155;
+ mes "[Refinery Owner Han]";
+ mes "Ah!! I ask for your favor this time, either.";
+ close;
+ } else if (.@jerun_tutorial == 5) {
+ mes "[Refinery Owner Han]";
+ mes "Go and see ^3E86C3Mr. Locas^000000 in charge with refining Oridecon stone for the refining effect and refining price.";
+ close;
+ } else if (.@jerun_tutorial == 6) {
+ mes "[Refinery Owner Han]";
+ mes "Did you get a good lesson? Did he explain it well enough?";
+ next;
+ switch(select("He was good great.", "It was just OK.", "So-so..")) {
+ case 1:
+ mes "[Refinery Owner Han]";
+ mes "Mr. Locas explained it to you well.";
+ next;
+ break;
+ case 2:
+ mes "[Refinery Owner Han]";
+ mes "Just OK? Hmmm.";
+ next;
+ break;
+ case 3:
+ mes "[Refinery Owner Han]";
+ mes "Oh no.. You were not satisfied with his explanations...";
+ next;
+ break;
+ }
+ mes "[Refinery Owner Han]";
+ mes "I see. I will jot that down.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "By the way, I have finished all the explanations about refining. Any further questions?";
+ next;
+ if(select("No questions at all.", "I have some questions...") == 1) {
+ mes "[Refinery Owner Han]";
+ mes "I see.. But just in case...";
+ next;
+ } else {
+ mes "[Refinery Owner Han]";
+ mes "Ah, is that so? Don't worry.";
+ next;
+ }
+ mes "[Refinery Owner Han]";
+ mes "If you have any further questions, come and see me. I will give you full explanations again.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "And this is a compensation for your lesson. I hope to see you frequently in the future.";
+ next;
+ setquest 5156;
+ completequest 5156;
+ if (Class == Job_Novice)
+ getexp 1200, 500;
+ mes "Got a lesson about the refining and Kafra storage free coupon.";
+ getitem 7059, 1; // Cargo_Free_Ticket
+ close;
+ } else if (.@jerun_tutorial == 8) {
+ mes "[Refinery Owner Han]";
+ mes "How are you doing?";
+ next;
+ switch(select("Hi!!", "How is the morale of the employees?", "Question is....", "Cancel")) {
+ case 1:
+ mes "[Refinery Owner Han]";
+ mes "How are you? Haven't seen you long time.. Please pay more frequent visits and do refining.";
+ close;
+ case 2:
+ mes "[Refinery Owner Han]";
+ mes "Just as before, labor-management consensus have achieved.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "We understand the employees' complaints and prepared the resolutions.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "Perhaps from that reason, I can hear any other complaints from them.";
+ close;
+ case 3:
+ mes "[Refinery Owner Han]";
+ mes "You have a question..";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "But I haven't told you anything in the beginning.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "It might be better for you to ask questions of the staff you met before.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "You can ask the explanations concerning ^FD4F02 weapon levels^000000 and ^FD4F02saftey refining ^000000, to ^142CEBMr. Tadde^000000, concerning ^FD4F02 refining price^000000 and ^FD4F02 refining effect^000000, ^142CEB to Mr. Locas^000000.";
+ next;
+ mes "[Refinery Owner Han]";
+ mes "He will give you kind answers.";
+ next;
+ close;
+ case 4:
+ break;
+ }
+ close;
+ } else {
+ mes "[Refinery Owner Han]";
+ mes "Something strange must've happened. If this continues, please contact customer service.";
+ close;
+ }
+
+ OnInit:
+ //AddQuestInfo 5153 1 0
+ //SetQuestLevel 5153 1 20
+ end;
+}
+
+izlude_a,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_a 4_M_02
+izlude_b,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_b 4_M_02
+izlude_c,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_c 4_M_02
+izlude_d,153,126,1 duplicate(Refinery Owner Han#iz) Refinery Owner Han#iz_d 4_M_02
+
+// - Refining Machine Wagjak
+// -----------------------------------------------------------------------------
+- script ::izludeWagjak -1,{
+ disable_items;
+ mes "[Refining Machine Wagjak]";
+ mes "-Ddarritt!-";
+ mes "Wagjak Starting... completed..";
+ mes "Checking the user.. Completed.";
+ mes "Select the refining equipment.";
+ next;
+ setarray .@position$[1],"Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
+ .@menu$ = "";
+ for(set .@i,1; .@i<=10; set .@i,.@i+1)
+ .@menu$ = .@menu$+(getequipisequiped(.@i)?getequipname(.@i):.@position$[.@i]+" - [Unarmed]")+":";
+ .@part = select(.@menu$);
+ if(!getequipisequiped(.@part)) {
+ mes "[Refining Machine Wagjak]";
+ mes "^ff0000- Error number 000"+.@part+" -^000000";
+ mes "Item is not equipped.";
+ close2;
+ enable_items;
+ end;
+ }
+ mes "[Refining Machine Wagjak]";
+ mes "Searching for the equipment information - completed.";
+ next;
+ if (!getequipisenableref(.@part)) {
+ mes "[Refining Machine Wagjak]";
+ mes "^FF0000- error number 4444 -^000000";
+ mes "This item cannot be refined.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (!getequipisidentify(.@part)) {
+ mes "[Refining Machine Wagjak]";
+ mes "^FF0000- error number 5555 -^000000";
+ mes "This item has not yet been identified.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (getequiprefinerycnt(.@part) >= 10) {
+ mes "[Refining Machine Wagjak]";
+ mes "^FF0000- error number 1010 -^000000";
+ mes "At the current version, you can do refining up to level 10.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (questprogress(5153) == 1) {
+ if (getequipweaponlv(.@part) == 1) {
+ mes "[Refining Machine Wagjak]";
+ mes "Type : 1 level weapon";
+ mes "Charge : Phracon, 1000 zeny";
+ mes "Service usage coupon sensed. No charge to be requested. Will you refine?";
+ next;
+ if(select("Refine.", "Don't Refine.") == 2) {
+ mes "[Refining Machine Wagjak]";
+ mes "Cancel the refining.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (getequippercentrefinery(.@part) < 100) {
+ mes "[Refining Machine Wagjak]";
+ mes "-Ddarritt!-";
+ mes "The user's confirmation required.";
+ mes "You are attempting unsafe refining. If refining fails, the equipment will be destroyed. Will you continue?";
+ next;
+ if(select("Refine.", "Don't Refine.") == 2) {
+ mes "[Refining Machine Wagjak]";
+ mes "Refining has been cancelled as per the user's request.";
+ close2;
+ enable_items;
+ end;
+ }
+ }
+ if (getequippercentrefinery(.@part) <= rand(100)) {
+ failedrefitem .@part;
+ mes "[Refining Machine Wagjak]";
+ mes "Result : Fail";
+ mes "refining failed. The equipment was destroyed.";
+ close2;
+ enable_items;
+ end;
+ } else {
+ successrefitem .@part;
+ mes "[Refining Machine Wagjak]";
+ mes "Result : Success";
+ mes "Congratulations!! You succeeded in refining.";
+ completequest 5153;
+ next;
+ mes "[Refining Machine Wagjak]";
+ mes "Service usage coupon was used.";
+ close2;
+ enable_items;
+ end;
+ }
+ }
+ }
+ switch(getequipweaponlv(.@part)) {
+ case 0:
+ .@type$ = "Armor";
+ .@material = Elunium;
+ .@price = 20000;
+ break;
+ case 1:
+ .@type$ = "Level 1 weapon";
+ .@material = Phracon;
+ .@price = 1000;
+ break;
+ case 2:
+ .@type$ = "Level 2 weapon";
+ .@material = Emveretarcon;
+ .@price = 2000;
+ break;
+ case 3:
+ .@type$ = "Level 3 weapon";
+ .@material = Oridecon;
+ .@price = 10000;
+ break;
+ case 4:
+ .@type$ = "Level 4 weapon";
+ .@material = Oridecon;
+ .@price = 20000;
+ break;
+ }
+ mes "[Refining Machine Wagjak]";
+ mes "Type : "+ .@type$ +"";
+ mes "Charge : "+ getitemname(.@material) +", "+ .@price +" zeny";
+ mes "Above money will be charged. Will you refine?";
+ next;
+ if(select("Refine.", "Don't Refine.") == 2) {
+ mes "[Refining Machine Wagjak]";
+ mes "Refining has been cancelled as per the user's request.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (getequippercentrefinery(.@part) < 100) {
+ mes "[Refining Machine Wagjak]";
+ mes "-Ddarritt!-";
+ mes "The user's confirmation required.";
+ mes "You are attempting unsafe refining. If refining fails, the equipment will be destroyed. Will you continue?";
+ next;
+ if(select("Refine.", "Don't Refine.") == 2) {
+ mes "[Refining Machine Wagjak]";
+ mes "Refining has been cancelled as per the user's request.";
+ close2;
+ enable_items;
+ end;
+ }
+ }
+ if (countitem(.@material) > 0 && Zeny >= .@price) {
+ delitem .@material, 1;
+ Zeny -= .@material;
+ } else {
+ mes "[Refining Machine Wagjak]";
+ mes "^FF0000- error number 8282 -^000000";
+ mes "You are short of refining price.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (getequippercentrefinery(.@part) <= rand(100)) {
+ failedrefitem .@part;
+ mes "[Refining Machine Wagjak]";
+ mes "Result : Fail";
+ mes "refining failed. The equipment was destroyed.";
+ } else {
+ successrefitem .@part;
+ mes "[Refining Machine Wagjak]";
+ mes "Result : Success";
+ mes "Congratulations!! You succeeded in refining.";
+ }
+ close2;
+ enable_items;
+ end;
+}
+
+izlude,153,121,3 duplicate(izludeWagjak) Refining Machine Wagjak::iz 2_MONEMUS
+izlude_a,153,121,3 duplicate(izludeWagjak) Refining Machine Wagjak::iz_a 2_MONEMUS
+izlude_b,153,121,3 duplicate(izludeWagjak) Refining Machine Wagjak::iz_b 2_MONEMUS
+izlude_c,153,121,3 duplicate(izludeWagjak) Refining Machine Wagjak::iz_c 2_MONEMUS
+izlude_d,153,121,3 duplicate(izludeWagjak) Refining Machine Wagjak::iz_d 2_MONEMUS
+
+// - Tadde
+// -----------------------------------------------------------------------------
+izlude,145,122,7 script Tadde#iz 4_M_04,{
+ if (!checkweight(1301, 1)) {
+ mes "- As you have too many items in your inventory, Quest can't be continued -";
+ close;
+ }
+ if (questprogress(5154) == 1) {
+ mes "[Tadde]";
+ mes "Welcome. The owner told me to explain to you about ^3E86C3the weapon levels^000000 and ^3E86C3safety refining.^000000.";
+ next;
+ mes "[Tadde]";
+ mes "In fact, it is better to get to know while questing yourself. But anyway if you have any questions, please ask to me.";
+ next;
+ while(1) {
+ switch(select("Weapon level", "Safety refining.", "Finish the question.")) {
+ case 1:
+ mes "[Tadde]";
+ mes "Weapons have level, whereas Armors don't. The more ^3E86C3upscaled a weapon^000000 is, the higher the weapon level is.";
+ next;
+ mes "[Tadde]";
+ mes "That means ^A20B09the upscaled weapons are more difficult to obtain.^000000.";
+ next;
+ mes "[Tadde]";
+ mes "Considering the customers coming to refine, the ones for refining level 1,2 weapons are more than those for level 3,4 weapons.";
+ next;
+ continue;
+ case 2:
+ mes "[Tadde]";
+ mes "Safety refining differs from the levels of Armor or weapon, so basically each level has a ^3E86C3different safe upgrade level.^000000";
+ next;
+ while(1) {
+ switch(select("Level 1 Weapon", "Level 2 Weapon", "Level 3 Weapon", "Level 4 Weapon", "Armor", "Question finished")) {
+ case 1:
+ mes "[Tadde]";
+ mes "Level 1 weapons are safe when refined up to ^A20B09+7^000000. The lower the level of weapon is, the higher the figure of the refining is possible.";
+ next;
+ mes "[Tadde]";
+ mes "Of course, it has stronger effect than level 1 weapon.";
+ next;
+ continue;
+ case 2:
+ mes "[Tadde]";
+ mes "Level 2 weapons are safe when refined up to ^A20B09+6^000000, even though refining figure is lower than level 1 weapon.";
+ next;
+ mes "[Tadde]";
+ mes "Of course, it has stronger effect than level 1 weapon.";
+ next;
+ continue;
+ case 3:
+ mes "[Tadde]";
+ mes "Level 3 weapons are safe when refined up to ^A20B09+5^000000. Simply speaking, it looks like the safety refining goes down by 1 according to each weapon level.";
+ next;
+ mes "[Tadde]";
+ mes "The higher the weapon is, the increasing effect of +1 becomes higher as well.";
+ next;
+ continue;
+ case 4:
+ mes "[Tadde]";
+ mes "Level 4 weapons are safe up to ^A20B09+4^000000. Numbers of level 4 weapons are so rare that not so many customers bring them here.";
+ next;
+ mes "[Tadde]";
+ mes "As it is one of the most luxurious weapons, the effect of refining is the strongest.";
+ next;
+ continue;
+ case 5:
+ mes "[Tadde]";
+ mes "Armors are safe when refined up to^A20B09+4^000000, just like a level 4 weapon.";
+ next;
+ mes "[Tadde]";
+ mes "As most refiners are used to making weapons it's hard for them to safely upgrade armors.";
+ next;
+ continue;
+ case 6:
+ mes "[Tadde]";
+ mes "You look like you've had enough explanations about the safety refining.";
+ next;
+ break;
+ }
+ break;
+ }
+ continue;
+ case 3:
+ break;
+ }
+ break;
+ }
+ completequest 5154;
+ mes "[Tadde]";
+ mes "Your questions end. If you have more questions later, come to me any time.";
+ close;
+ }
+ mes "[Tadde]";
+ mes "We sell metals for refining iron or steel weapons here!";
+ mes "We have ^007777Phracons^000000 for level 1 weapons, and ^007777Emveretarcons^000000 for level 2 weapons.";
+ next;
+ switch(select("Phracon - 200 zeny.", "Emveretarcon - 1000 zeny.", "Ask for other metals.")) {
+ case 1:
+ mes "[Tadde]";
+ mes "How many would you like? Enter '0' if you want to end.";
+ next;
+ while(1) {
+ input .@amount, 0, 501;
+ if (.@amount == 0) {
+ mes "[Tadde]";
+ mes "Trade ended.";
+ close;
+ } else if (.@amount > 500) {
+ mes "[Tadde]";
+ mes "Please reduce your quantity to 500 or less.";
+ next;
+ } else {
+ break;
+ }
+ }
+ .@sell = .@amount * 200;
+ .@item_weight = .@amount * 200;
+ if (Zeny < .@sell) {
+ mes "[Tadde]";
+ mes "Oh dear...my apologies, but you don't have enough money.";
+ mes "I'm sorry we can't give it to you cheaper...we're only a small business.";
+ close;
+ }
+ if ((MaxWeight - Weight) < .@item_weight) {
+ mes "[Tadde]";
+ mes "Er...please sorts your inventory before you take these...";
+ close;
+ }
+ Zeny -= .@sell;
+ getitem 1010, .@amount; // Phracon
+ mes "[Tadde]";
+ mes "This is what you wanted. Thank you very much!";
+ close;
+ case 2:
+ mes "[Tadde]";
+ mes "How many would you like? Enter '0' if you want to end.";
+ next;
+ while(1) {
+ input .@amount, 0, 501;
+ if (.@amount == 0) {
+ mes "[Tadde]";
+ mes "Trade ended.";
+ close;
+ } else if (.@amount > 500) {
+ mes "[Tadde]";
+ mes "Please reduce your quantity to 500 or less.";
+ next;
+ } else {
+ break;
+ }
+ }
+ .@sell = .@amount * 1000;
+ .@item_weight = .@amount * 200;
+ if (Zeny < .@sell) {
+ mes "[Tadde]";
+ mes "Oh dear...my apologies, but you don't have enough money.";
+ mes "I'm sorry we can't give it to you cheaper...we're only a small business.";
+ close;
+ }
+ if ((MaxWeight - Weight) < .@item_weight) {
+ mes "[Tadde]";
+ mes "Er...please sorts your inventory before you take these...";
+ close;
+ }
+ getitem 1011, .@amount; // Emveretarcon
+ Zeny -= .@sell;
+ mes "[Tadde]";
+ mes "This is what you wanted. Thank you very much!";
+ close;
+ case 3:
+ mes "[Tadde]";
+ mes "Any questions about the weapon level and safety refining?";
+ next;
+ while(1) {
+ switch(select("Weapon level", "Safety refining.", "Finish the question.")) {
+ case 1:
+ mes "[Tadde]";
+ mes "Weapons have level, whereas Armors don't. The more ^3E86C3upscaled a weapon^000000 is, the higher the weapon level is.";
+ next;
+ mes "[Tadde]";
+ mes "That means ^A20B09the upscaled weapons are more difficult to obtain.^000000.";
+ next;
+ mes "[Tadde]";
+ mes "Considering the customers coming to refine, the ones for refining level 1,2 weapons are more than those for level 3,4 weapons.";
+ next;
+ break;
+ case 2:
+ mes "[Tadde]";
+ mes "Safety refining differs from the levels of Armor or weapon, so basically each level has a ^3E86C3different safe upgrade level.^000000";
+ next;
+ while(1) {
+ switch(select("Level 1 Weapon", "Level 2 Weapon", "Level 3 Weapon", "Level 4 Weapon", "Armor", "Question finished")) {
+ case 1:
+ mes "[Tadde]";
+ mes "Level 1 weapons are safe when refined up to ^A20B09+7^000000. The lower the level of weapon is, the higher the figure of the refining is possible.";
+ next;
+ mes "[Tadde]";
+ mes "Of course, it has stronger effect than level 1 weapon.";
+ next;
+ break;
+ case 2:
+ mes "[Tadde]";
+ mes "Level 2 weapons are safe when refined up to ^A20B09+6^000000, even though refining figure is lower than level 1 weapon.";
+ next;
+ mes "[Tadde]";
+ mes "Of course, it has stronger effect than level 1 weapon.";
+ next;
+ break;
+ case 3:
+ mes "[Tadde]";
+ mes "Level 3 weapons are safe when refined up to ^A20B09+5^000000. Simply speaking, it looks like the safety refining goes down by 1 according to each weapon level.";
+ next;
+ mes "[Tadde]";
+ mes "The higher the weapon is, the increasing effect of +1 becomes higher as well.";
+ next;
+ break;
+ case 4:
+ mes "[Tadde]";
+ mes "Level 4 weapons are safe up to ^A20B09+4^000000. Numbers of level 4 weapons are so rare that not so many customers bring them here.";
+ next;
+ mes "[Tadde]";
+ mes "As it is one of the most luxurious weapons, the effect of refining is the strongest.";
+ next;
+ break;
+ case 5:
+ mes "[Tadde]";
+ mes "Armors are safe when refined up to^A20B09+4^000000, just like a level 4 weapon.";
+ next;
+ mes "[Tadde]";
+ mes "As most refiners are used to making weapons it's hard for them to safely upgrade armors.";
+ next;
+ break;
+ case 6:
+ mes "[Tadde]";
+ mes "You look like you've had enough explanations about the safety refining.";
+ next;
+ break;
+ }
+ }
+ break;
+ case 3:
+ break;
+ }
+ }
+ mes "[Tadde]";
+ mes "This is all I can explain to you.";
+ next;
+ mes "[Tadde]";
+ mes "The explanations about the charge and effect of the safe refining will be covered by Mr. Locas.";
+ close;
+ }
+}
+
+izlude_a,145,122,7 duplicate(Tadde#iz) Tadde#iz_a 4_M_04
+izlude_b,145,122,7 duplicate(Tadde#iz) Tadde#iz_b 4_M_04
+izlude_c,145,122,7 duplicate(Tadde#iz) Tadde#iz_c 4_M_04
+izlude_d,145,122,7 duplicate(Tadde#iz) Tadde#iz_d 4_M_04
+
+// - Locas
+// -----------------------------------------------------------------------------
+izlude,155,132,3 script Locas#iz 4_M_02,{
+ if (!checkweight(1301, 1)) {
+ mes "- As you have too many items in your inventory, Quest can't be continued. -";
+ close;
+ }
+ if (questprogress(5155) == 1) {
+ mes "[Locas]";
+ mes "You are the one sent by the owner. What did he order me to do?";
+ next;
+ select("You have a lot of complaints, don't you?");
+ mes "[Locas]";
+ mes "Yes, I do. Absolutely, the owner will threaten me with his stupid performance ratings.";
+ next;
+ mes "[Locas]";
+ mes "He isn't the man he used to be.";
+ next;
+ mes "[Locas]";
+ mes "He thinks if somebody leaves, a replacement will show up immediately.";
+ next;
+ mes "[Locas]";
+ mes "Anyway, the employee should do what the owner wants him to do... Ask me your questions.";
+ next;
+ while(1) {
+ switch(select("Refining Price", "Fefining Effect", "End the Conversation.")) {
+ case 1:
+ mes "[Locas]";
+ mes "Perhaps the most important thing my owner thinks is this...";
+ next;
+ mes "[Locas]";
+ mes "From the word itself, refining price is ^3E86C3 the charge to refine once^000000.";
+ next;
+ mes "[Locas]";
+ mes "But, there are ^3E86C3differences in the essential material according the zeny and weapon level.^000000.";
+ next;
+ while(1) {
+ switch(select("Level 1 Weapon", "Level 2 Weapon", "Level 3 Weapon", "level 4 Weapon", "Armor", "Questions Finished")) {
+ case 1:
+ mes "[Locas]";
+ mes "Refining of level 1 weapons requires ^3E86C3Phracon and 1000 zeny^000000.";
+ next;
+ mes "[Locas]";
+ mes "As Phracon is the most popular metal, you can get it from monsters but also from Tadde at 200 zeny.";
+ next;
+ continue;
+ case 2:
+ mes "[Locas]";
+ mes "Refining level 2 weapons requires ^3E86C3Emveretarcon and 2,000 zeny^000000.";
+ next;
+ mes "[Locas]";
+ mes "Emveretarcon is also a relatively popular metal. You can get it either from monsters or from Tadde at 1000 zeny.";
+ next;
+ continue;
+ case 3:
+ mes "[Locas]";
+ mes "Refining of level 3 weapons requires ^3E86C3 Oridecon and 10,000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Oridecon is such a rare metal that I don't sell it... But,";
+ next;
+ mes "[Locas]";
+ mes "If you have 5 Rough Oridecon obtainable from some monsters, you can refine them to make one Oridecon.";
+ next;
+ continue;
+ case 4:
+ mes "[Locas]";
+ mes "Refining level 4 weapons requires ^3E86C3 Oridecon and 20,000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Elunium is as rare a metal as Oridecon, like Oridecon, if you bring me 5 Rough Elunium obtainable from some monsters, I will refine them to make a Elunium for you.";
+ next;
+ continue;
+ case 5:
+ mes "[Locas]";
+ mes "Refining the Armor requires ^3E86C3Elunium and 20000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Elunium is as rare a metal as Oridecon, like Oridecon, if you bring me 5 Rough Elunium obtainable from some monsters, I will refine them to make a Elunium for you.";
+ next;
+ continue;
+ case 6:
+ mes "[Locas]";
+ mes "You look like you've had enough explanations about the refining prices.";
+ next;
+ break;
+ }
+ break;
+ }
+ continue;
+ case 2:
+ mes "[Locas]";
+ mes "I think you are now knowledgeable enough about refining.";
+ next;
+ mes "[Locas]";
+ mes "Now I will explain to you about ^3E86C3the effect of refining^000000.";
+ next;
+ mes "[Locas]";
+ mes "This time I won't give you explanations about individual items. It is better you do the physical experiences by yourself instead of verbal explanations.";
+ next;
+ mes "[Locas]";
+ mes "Anyway, here are the explanations. From level 1 weapon,";
+ next;
+ mes "[Locas]";
+ mes "1 level weapon has ^A20B09the attacking power increased 2^000000 by each +1 refining. Do you understand?";
+ next;
+ select("Well???");
+ mes "[Locas]";
+ mes "I thought my explanations to you were easy, but it wasn't...";
+ next;
+ mes "[Locas]";
+ mes "So, if you refine a knife with 17 attacking power and by +1, it will become 19 attacking power.. Like this.";
+ next;
+ mes "[Locas]";
+ mes "In fact, there is no need to talk too much here. You just experience it later.";
+ next;
+ mes "[Locas]";
+ mes "Level 2 weapon will add ^A20B093^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Level 3 weapon will add ^A20B095^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Lastly, level 4 weapon will add ^A20B097^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Ah, I missed the Armor. The Armor can be add ^A20B091^000000 to the defense power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Well, by now the explanations were only for the effect of the safe refining....";
+ next;
+ mes "[Locas]";
+ mes "You would better learn yourself ^A20B09the effect of over refining^000000 regardless of potential risk.";
+ next;
+ mes "[Locas]";
+ mes "If I tell you all the details, it is likely you start reading an epic novel of 10,000 pages, I'll tell you the ending of it.";
+ next;
+ mes "[Locas]";
+ mes "One thing to be clear is you should be careful about destroying your equipment if you get over-eager.";
+ next;
+ continue;
+ case 3:
+ break;
+ }
+ break;
+ }
+ mes "[Locas]";
+ mes "Seems like, you don't have any further questions. Thank you for listening to a long story.";
+ next;
+ completequest 5155;
+ mes "[Locas]";
+ mes "You can say anything to my owner. The performance rating doesn't mean much to our technicians.";
+ close;
+ } else {
+ mes "[Locas]";
+ mes "If you bring me 5 Rough Oridecon or Elunium, I will immediately make them to Oridecon or Elunium.";
+ next;
+ }
+ switch(select("Refining Oridecon", "Refining Elunium", "Other questions.")) {
+ case 1:
+ mes "[Locas]";
+ mes "Will you refine 5 Rough Oridecon to one Oridecon?";
+ next;
+ if(select("Exchange 5 for 1", "Exchange all.") == 1) {
+ if (countitem(756) > 4) {
+ delitem 756, 5; // Oridecon_Stone
+ getitem 984, 1; // Oridecon
+ mes "[Locas]";
+ mes "Refined Rough Oridecon to Oridecon.";
+ close;
+ } else {
+ mes "[Locas]";
+ mes "Are you kidding me?";
+ mes "You should bring me 5 Rough Oridecon to refine for one Oridecon.";
+ close;
+ }
+ } else {
+ if (countitem(756) > 4) {
+ .@ston_max = countitem(756) / 5;
+ .@ston_full = .@ston_max * 5;
+ delitem 756, .@ston_full; // Oridecon_Stone
+ getitem 984, .@ston_max; // Oridecon
+ mes "[Locas]";
+ mes "Refined "+.@ston_full+" Rough Oridecon into "+.@ston_max+" Oridecon. Thank you for your business.";
+ close;
+ } else {
+ mes "[Locas]";
+ mes "Are you kidding me?";
+ mes "You should bring me 5 Rough Oridecon to refine for one Oridecon.";
+ close;
+ }
+ }
+ case 2:
+ mes "[Locas]";
+ mes "Will you refine 5 Rough Elunium to one Elunium?";
+ next;
+ if(select("Exchange 5 for 1", "Exchange all.") == 1) {
+ if (countitem(757) > 4) {
+ delitem 757, 5; // Elunium_Stone
+ getitem 985, 1; // Elunium
+ mes "[Locas]";
+ mes "Refined Rough Elunium to Elunium.";
+ close;
+ } else {
+ mes "[Locas]";
+ mes "Are you kidding me?";
+ mes "You should bring me 5 Rough Elunium to refine for one Elunium.";
+ close;
+ }
+ } else {
+ if (countitem(757) > 4) {
+ .@ston_max = countitem(757) / 5;
+ .@ston_full = .@ston_max * 5;
+ delitem 757, .@ston_full; // Elunium_Stone
+ getitem 985, .@ston_max; // Elunium
+ mes "[Locas]";
+ mes "Refined "+.@ston_full+" Rough Elunium into "+.@ston_max+" Elunium. Thank you for your business.";
+ close;
+ } else {
+ mes "[Locas]";
+ mes "Are you kidding me?";
+ mes "You should bring me 5 Rough Elunium to refine for one Elunium.";
+ close;
+ }
+ }
+ case 3:
+ mes "[Locas]";
+ mes "Do you have any questions about refining?";
+ next;
+ mes "[Locas]";
+ mes "Though I can't explain a lot.... What's your question?";
+ next;
+ while(1) {
+ switch(select("refining price", "refining effect", "Finish the explanation.")) {
+ case 1:
+ mes "[Locas]";
+ mes "©öFrom the word itself, refining price is ^3E86C3 the price for refining once^000000.";
+ next;
+ mes "[Locas]";
+ mes "But, there are differences in the essential material according the (zeny) and weapon level.";
+ next;
+ while(1) {
+ switch(select("Level 1 Weapon", "Level 2 Weapon", "Level 3 Weapon", "Level 4 Weapon", "Armor", "Question Finished")) {
+ case 1:
+ mes "[Locas]";
+ mes "Refining of level 1 weapons requires ^3E86C3Phracon and 1000 zeny^000000.";
+ next;
+ mes "[Locas]";
+ mes "As Phracon is the most popular metal, you can get it from monsters but also from Tadde at 200 zeny.";
+ next;
+ continue;
+ case 2:
+ mes "[Locas]";
+ mes "Refining level 2 weapons requires ^3E86C3Emveretarcon and 20,000 zeny^000000.";
+ next;
+ mes "[Locas]";
+ mes "Emveretarcon is also a relatively popular metal. You can get it either from monsters or from Tadde at 1000 zeny.";
+ next;
+ continue;
+ case 3:
+ mes "[Locas]";
+ mes "Refining of level 3 weapons requires ^3E86C3 Oridecon and 10,000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Oridecon is such a rare metal that I don't sell it... But,";
+ next;
+ mes "[Locas]";
+ mes "If you have 5 Rough Oridecon obtainable from some monsters, you can refine them to make one Oridecon.";
+ next;
+ continue;
+ case 4:
+ mes "[Locas]";
+ mes "Refining level 4 weapons requires ^3E86C3 Oridecon and 20,000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Elunium is as rare a metal as Oridecon, like Oridecon, if you bring me 5 Rough Elunium obtainable from some monsters, I will refine them to make a Elunium for you.";
+ next;
+ continue;
+ case 5:
+ mes "[Locas]";
+ mes "Refining the Armor requires ^3E86C3Elunium and 20000 zeny.^000000.";
+ next;
+ mes "[Locas]";
+ mes "Elunium is as rare a metal as Oridecon, like Oridecon, if you bring me 5 Rough Elunium obtainable from some monsters, I will refine them to make a Elunium for you.";
+ next;
+ continue;
+ case 6:
+ mes "[Locas]";
+ mes "You look like you've had enough explanations about the refining prices.";
+ next;
+ break;
+ }
+ break;
+ }
+ continue;
+ case 2:
+ mes "[Locas]";
+ mes "As I think it would be better for you to experience the effect of refining rather than explantion, I really give you a brief explanation about it.";
+ next;
+ mes "[Locas]";
+ mes "Let's start from level 1 weapon.";
+ next;
+ mes "[Locas]";
+ mes "1 level weapon has ^A20B09the attacking power increased 2^000000 by each +1 refining. Do you understand?";
+ next;
+ select("Well???");
+ mes "[Locas]";
+ mes "I thought my explanations to you were easy, but it wasn't...";
+ next;
+ mes "[Locas]";
+ mes "So, if you refine a knife with 17 attacking power and by +1, it will become 19 attacking power.. Like this.";
+ next;
+ mes "[Locas]";
+ mes "In fact, there is no need to talk too much here. You just experience it later.";
+ next;
+ mes "[Locas]";
+ mes "Level 2 weapon will add ^A20B093^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Level 3 weapon will add ^A20B095^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Lastly, level 4 weapon will add ^A20B097^000000 to the attacking power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Ah, I missed the Armor. The Armor can be add ^A20B091^000000 to the defense power per each refining level.";
+ next;
+ mes "[Locas]";
+ mes "Well, by now the explanations were only for the effect of the safe refining....";
+ next;
+ mes "[Locas]";
+ mes "You would better learn yourself ^A20B09the effect of over refining^000000 regardless of potential risk.";
+ next;
+ mes "[Locas]";
+ mes "If I tell you all the details, it is likely you start reading an epic novel of 10,000 pages, I'll tell you the ending of it.";
+ next;
+ mes "[Locas]";
+ mes "One thing to be clear is you should be careful about destroying your equipment if you get over-eager.";
+ next;
+ continue;
+ case 3:
+ break;
+ }
+ break;
+ }
+ mes "[Locas]";
+ mes "Thank you for your listening to a long story. This is all I can explain you.";
+ next;
+ mes "[Locas]";
+ mes "Regarding the levels of weapons and safety refining, consult with Mr. Tadde. He will kindly answer to you.";
+ close;
+ }
+}
+
+izlude_a,155,132,3 duplicate(Locas#iz) Locas#iz_a 4_M_02
+izlude_b,155,132,3 duplicate(Locas#iz) Locas#iz_b 4_M_02
+izlude_c,155,132,3 duplicate(Locas#iz) Locas#iz_c 4_M_02
+izlude_d,155,132,3 duplicate(Locas#iz) Locas#iz_d 4_M_02
+
+// - Enchanter Mounds
+// - Teaches the player about enchanting.
+// -----------------------------------------------------------------------------
+izlude,96,125,7 script Enchanter Mounds#iz 4_CAT_SAILOR2,{
+ if (!checkweight(1301, 1)) {
+ mes "- As you have too many items in your inventory, Quest can't be continued -";
+ close;
+ }
+ disable_items;
+ .@in_tutorial = questprogress(5157) + questprogress(5158) + questprogress(5159);
+ if (.@in_tutorial == 0) {
+ mes "[Mounds]";
+ mes "Welcome. Welcome to the enchant association. I am ^142CEB Mounds^000000- head of Izlude branch of the Enchant association.";
+ next;
+ select("Oh... a cat can speak???");
+ mes "[Mounds]";
+ mes "Have you never seen a talking cat?";
+ next;
+ mes "[Mounds]";
+ mes "There is an island called ^FD4F02 Malangdo^000000 where only cats live and I am from there.";
+ next;
+ mes "[Mounds]";
+ mes "There are cats like me who can speak the human language very well, but some cats speaking human and cat language are a mess.";
+ next;
+ mes "[Mounds]";
+ mes "Well, that can be checked in Malangdo later are you interested in ^FD4F02Enchantments^000000?";
+ next;
+ select("Enchant Association?");
+ mes "[Mounds]";
+ mes "The Enchant Association is the group made by those of us who can enchant.";
+ next;
+ mes "[Mounds]";
+ mes "This association is composed of two divisions of ^FD4F02the socket enchant division^000000 and ^FD4F02 the hidden enchant division^000000.";
+ next;
+ mes "[Mounds]";
+ mes "Maybe, are you curious about each division?";
+ next;
+ while(1) {
+ switch(select("Socket Enchant?", "Hidden Enchant", "Question finished")) {
+ case 1:
+ mes "[Mounds]";
+ mes "You are curious about the socket enchant.. Here is the explantion.";
+ next;
+ mes "[Mounds]";
+ mes "From unknown reason, There has been existing ^FD4F02card slots^000000 on the equipments obtainable from monsters.";
+ next;
+ mes "[Mounds]";
+ mes "People started to question, 'Can we make a device to insert cards to these?'";
+ next;
+ mes "[Mounds]";
+ mes "At last, one day a man called ^142CEBSeyablem^000000 showed up with the technology of socket enchant.";
+ next;
+ mes "[Mounds]";
+ mes "Nobody knew how he got the technology....";
+ next;
+ mes "[Mounds]";
+ mes "Someday later, a younger brother of Seyablem called ^142CEBLeyablem^000000 introduced a different device from his brother to socket enchant other equipments.";
+ next;
+ mes "[Mounds]";
+ mes "Many people using the brothers' socket enchanting services, they stole the technology";
+ next;
+ select("Ok seems simple enough...");
+ mes "[Mounds]";
+ mes "The brothers happened to join the enchant association. And from time to time, they teach the technology to us in Malangdo.";
+ next;
+ mes "[Mounds]";
+ mes "Learning the technology diligently, some day will come when others can do socket enchants.";
+ next;
+ mes "[Mounds]";
+ mes "Ah, my story went off topic.";
+ next;
+ mes "[Mounds]";
+ mes "Well, conclusion is this, socket enchant means to add a card socket to the common equipment being sold at any shops.";
+ next;
+ mes "[Mounds]";
+ mes "It is called socket enchant. Are you curious about the other division?";
+ next;
+ break;
+ case 2:
+ mes "[Mounds]";
+ mes "Ah ! Are you curious about the hidden enchant?";
+ next;
+ mes "[Mounds]";
+ mes "OK. First, I have to let you know how the hidden enchnat skill was born.";
+ next;
+ mes "[Mounds]";
+ mes "The original inventor was looking for a way to unlock the 4th slot of a 3 slotted weapon.";
+ next;
+ mes "[Mounds]";
+ mes "So he studied the technology to make use of the remaining slot.";
+ next;
+ mes "[Mounds]";
+ mes "When the study was finally successful he taught it to his apprentices and was never heard from again.";
+ next;
+ mes "[Mounds]";
+ mes "His technology reinforced the equipment with a gem that had special properties similar to monster cards.";
+ next;
+ mes "[Mounds]";
+ mes "That technology has been developed and improved to make the current ^FD4F02 Enchant association ^000000";
+ next;
+ mes "[Mounds]";
+ mes "Briefly speaking, to make a stronger equipment with a special enchantment is the hidden enchant.";
+ next;
+ mes "[Mounds]";
+ mes "Are you curious about the other division?";
+ next;
+ break;
+ case 3:
+ break;
+ }
+ break;
+ }
+ mes "[Mounds]";
+ mes "You don't have any further questions.";
+ next;
+ mes "[Mounds]";
+ mes "Later, if you want to experience the hidden enchant or socket enchant, I will give you a hand.";
+ next;
+ setquest 5157;
+ mes "[Mounds]";
+ mes "Come to me anytime.";
+ close;
+ } else if (.@in_tutorial == 1) {
+ mes "[Mounds]";
+ mes "Welcome.. Ah, we've met before right?";
+ next;
+ mes "[Mounds]";
+ mes "Are you coming to experience the hidden enchant or the socket enchant?";
+ next;
+ if(select("I am just passing by.", "Came to experience it.") == 1) {
+ mes "[Mounds]";
+ mes "You may be on the way to Prontera. Be careful and come back.";
+ close;
+ }
+ mes "[Mounds]";
+ mes "You want an experience.";
+ next;
+ mes "[Mounds]";
+ mes "The experience course starts from the experience of the simple socket enchant.";
+ next;
+ mes "[Mounds]";
+ mes "For this, you need material. Will you buy a cotton shirt at Izlude Armor shop?";
+ next;
+ setquest 5158;
+ mes "[Mounds]";
+ mes "When you bring the cotton shirt, we will immediately start ^FD4F02the socket enchnat experience^000000 course.";
+ close;
+ } else if (.@in_tutorial == 2) {
+ mes "[Mounds]";
+ if (countitem(2302) > 0) {
+ mes "Oh this is a socketed shirt already!";
+ next;
+ mes "[Mounds]";
+ mes "Bring us the normal shirt without holes.";
+ close;
+ } else if (countitem(2301) > 0) {
+ mes "It must be a plain cotton shirt.";
+ next;
+ } else {
+ mes "When you bring the plain cotton shirt from the Armor shop, we will start the socket enchant experience.";
+ close;
+ }
+ mes "[Mounds]";
+ mes "Not like all other enchants, the socket enchant is being worked without items installed.";
+ next;
+ mes "[Mounds]";
+ mes "Then, let's start the socket enchant.";
+ next;
+ mes "[Mounds]";
+ mes "One!";
+ next;
+ mes "[Mounds]";
+ mes "One! Two!";
+ next;
+ mes "[Mounds]";
+ mes "One! Two! Three!";
+ next;
+ specialeffect2 EF_SANCTUARY;
+ completequest 5158;
+ delitem 2301, 1; // Cotton_Shirt
+ getitem 2302, 1; // Cotton_Shirt_
+ mes "[Mounds]";
+ mes "You have suceeded in socket enchant.";
+ close;
+ } else if (.@in_tutorial == 3) {
+ mes "[Mounds]";
+ mes "Have you checked the equipment? It now has an empty slot in it.";
+ next;
+ mes "[Mounds]";
+ mes "But, like this time the success rate is not always ^FD4F02100%^000000 as you are still in the studying phase.";
+ next;
+ mes "[Mounds]";
+ mes "Please keep in mind that there always risks of failure and if failed, the equipment will be broken.";
+ next;
+ mes "[Mounds]";
+ mes "If you want to know more about the socket enchant, go and consult with Leyablem or Seyablem who are working at Prontera or Payon.";
+ next;
+ select("I see.");
+ mes "[Mounds]";
+ mes "Now it's time for your experiencing the hidden enchant.";
+ next;
+ mes "[Mounds]";
+ mes "Equipped with the just socket enchanted cotton shirt, get the hidden enchant from";
+ next;
+ setquest 5159;
+ mes "[Mounds]";
+ mes "Almond J, the cat in charge with the hidden enchant over there.";
+ close;
+ } else if (.@in_tutorial == 4) {
+ mes "[Mounds]";
+ mes "Get the hidden enchant from Almond J with wearing the cotton shirt socket enchanted.";
+ close;
+ } else if (.@in_tutorial == 5) {
+ mes "[Mounds]";
+ mes "Eh? You came earlier than expected? I though it might take time after listening to all the explanations.";
+ next;
+ select("Explain about the situation.");
+ mes "[Mounds]";
+ mes "Keuh~~ It happened....";
+ next;
+ mes "[Mounds]";
+ mes "I should beware of you, when you were making a big noise to do the hidden enchant.";
+ next;
+ mes "[Mounds]";
+ mes "Anyway, I am sorry.. Though it is short, I will make the explanation for you.";
+ next;
+ mes "[Mounds]";
+ mes "Have you checked the hidden enchant?";
+ next;
+ if(select("Yes, I have.", "No. I haven't.") == 1) {
+ mes "[Mounds]";
+ mes "As you have checked it already, my explanation became easy.";
+ next;
+ } else {
+ mes "[Mounds]";
+ mes "Hmmm. Recommend you examine the condition of your cotton shirt, opening item window.";
+ next;
+ }
+ mes "[Mounds]";
+ mes "As you have checked it already, my explanation became easy.";
+ next;
+ mes "[Mounds]";
+ mes "As I explained you just before, the hidden enchant is the work to insert to weapoon or Armor a gem with a special option into the equipment.";
+ next;
+ mes "[Mounds]";
+ mes "As you know it, if you checked, you may notice something new was at the no. 3 and 4 slots at the bottom of item information window.";
+ next;
+ mes "[Mounds]";
+ mes "Hidden enchant is being proceeded with the similar equipment worn as Almond J's.";
+ next;
+ mes "[Mounds]";
+ mes "Of course, there are some other places to do the hidden enchants.";
+ next;
+ if(select("Satisfied.", "A little short.") == 1) {
+ mes "[Mounds]";
+ mes "It is fortunate. Do you have any experience to be added? If so, please write it to me.";
+ next;
+ } else {
+ mes "[Mounds]";
+ mes "Experience seems not be satisfactory with you. Can you write me what was it?";
+ next;
+ mes "[Mounds]";
+ mes "I will refer it for planning the next experience.";
+ next;
+ }
+ input .@advice$;
+ mes "[Mounds]";
+ mes "Thank you for your valuable advice.";
+ next;
+ mes "[Mounds]";
+ mes "Thank you for your patience listening to my boring explanation.";
+ next;
+ mes "[Mounds]";
+ mes "This is a small gift hoping your continuous support for our enchant association.";
+ next;
+ completequest 5157;
+ if (Class == Job_Novice) {
+ getexp 1200, 500;
+ mes "Received the explanation about the enchants, some experience and Kafra storage free coupon.";
+ } else {
+ mes "Received the explanation and Kafra free storage coupon.";
+ }
+ getitem 7059, 1; // Cargo_Free_Ticket
+ next;
+ mes "[Mounds]";
+ mes "Then, I will see you later.";
+ close;
+ } else if (.@in_tutorial == 6) {
+ mes "[Mounds]";
+ mes "Welcome to the enchant association. I am Mounds - head of Izlude branch of Enchant association.";
+ next;
+ mes "[Mounds]";
+ mes "Eh? Your appreance is familiar. Have we met before?";
+ next;
+ mes "[Mounds]";
+ mes "As I can't remember all the people I met as they are too many, strangely you have a face not to forget.";
+ next;
+ mes "[Mounds]";
+ mes "Perhaps, are you here to learn about enchanting? I will kindly explain you about it.";
+ next;
+ while(1) {
+ switch(select("Socket enchant", "Hidden enchant", "Give regards", "No questions at all.")) {
+ case 1:
+ mes "[Mounds]";
+ mes "Socket enchant is the skill to make card slots appear in Weapon or Armor.";
+ next;
+ mes "[Mounds]";
+ mes "When you meet the Seyablem and Leyablem brothers around the towns of Rune Midgard they can help you with this service.";
+ next;
+ mes "[Mounds]";
+ mes "If they fail to put a new slot in your item say farewell to it...";
+ next;
+ mes "[Mounds]";
+ mes "It's usually a good idea to have more than 1 item to add a slot to because it can fail a lot sometimes.";
+ next;
+ break;
+ case 2:
+ mes "[Mounds]";
+ mes "Hidden enchant means to put enchanted gems into the hidden slots of an item.";
+ next;
+ mes "[Mounds]";
+ mes "You have to be wearing the item that is being enchanted as it uses the wearers fortune as the success rate.";
+ next;
+ mes "[Mounds]";
+ mes "Many places are providing the various hidden enchant service in different ways, if you have time, please visit one of them.";
+ next;
+ break;
+ case 3:
+ mes "[Mounds]";
+ mes "News? Enchant association doesn't have a big issue going on.";
+ next;
+ mes "[Mounds]";
+ mes "Ah!! I remember that Almond J sent with me from Izlude branch wanted to do advertising...";
+ next;
+ mes "[Mounds]";
+ mes "He drafted the initiative for the free service of hidden enchant to the beginner's weapons. I approved it as it looked a good idea.";
+ next;
+ mes "[Mounds]";
+ mes "What? If you have a beginners weapon, it may not hurt to try it.";
+ next;
+ break;
+ case 4:
+ mes "[Mounds]";
+ mes "Come to me whenever you have a question about the enchant association.";
+ close;
+ }
+ mes "[Mounds]";
+ mes "Any other questions?";
+ next;
+ }
+ } else {
+ mes "[Mounds]";
+ mes "Something strange must've happened. If this continues, please contact customer service.";
+ close;
+ }
+
+ OnInit:
+ //AddQuestInfo 5157 1 0
+ //SetQuestLevel 5157 1 20
+ end;
+}
+
+izlude_a,96,125,7 duplicate(Enchanter Mounds#iz) Enchanter Mounds#iz_a 4_CAT_SAILOR2
+izlude_b,96,125,7 duplicate(Enchanter Mounds#iz) Enchanter Mounds#iz_b 4_CAT_SAILOR2
+izlude_c,96,125,7 duplicate(Enchanter Mounds#iz) Enchanter Mounds#iz_c 4_CAT_SAILOR2
+izlude_d,96,125,7 duplicate(Enchanter Mounds#iz) Enchanter Mounds#iz_d 4_CAT_SAILOR2
+
+// - Enchanter Almond J
+// - Teaches the player about enchanting.
+// -----------------------------------------------------------------------------
+izlude,108,139,7 script Enchanter Almond J#iz 4_CAT_SAILOR3,{
+ if (!checkweight(1301, 1)) {
+ mes "- As you have too many items in your inventory, Quest can't be continued -";
+ close;
+ }
+ disable_items;
+ .@in_tutorial = (questprogress(5157) + questprogress(5158) + questprogress(5159));
+ if (.@in_tutorial < 4) {
+ mes "[Almond J]";
+ mes "Hello, I am Almon J of the enchant association.~";
+ next;
+ mes "[Almond J]";
+ mes "If you have anything to do with the enchant association, please consult with Mounds inside.";
+ close2;
+ enable_items;
+ end;
+ } else if (.@in_tutorial == 4) {
+ .@equip = getequipid(EQI_ARMOR);
+ .@part = EQI_ARMOR;
+ mes "[Almond J]";
+ mes "Welcome.. I have been waiting for you. Are you coming for the hidden enchant service on your cotton shirt?";
+ next;
+ if(select("Ench? Whatis?", "Yes.") == 1) {
+ mes "[Almond J]";
+ mes "Eummm?";
+ next;
+ mes "[Almond J]";
+ mes "What happened?";
+ close;
+ }
+ mes "[Almond J]";
+ mes "Oh... finally you came...";
+ next;
+ mes "[Almond J]";
+ mes "Has your ^142cebCotton Shirt[1]^000000 been equipped? Shall we start now? Ready?";
+ next;
+ select("You look excited.");
+ mes "[Almond J]";
+ mes "Heh... is that so? Frankly, it is my first time... I am really excited.";
+ next;
+ mes "[Almond J]";
+ mes "Are you ready? Yes? Do it now. Now!!";
+ next;
+ if(select("Hidden enchant start!!", "Wait for a while.") == 2) {
+ mes "[Almond J]";
+ mes "Heh? Eh? Hik?! Come here quick.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (!.@equip) {
+ mes "[Almond J]";
+ mes "Please come back after you have equipped the Cotton Shirt.";
+ close2;
+ enable_items;
+ end;
+ }
+ if (getequipid(EQI_ARMOR) == Cotton_Shirt_) {
+ .@refineCount = getequiprefinerycnt(EQI_ARMOR);
+ } else {
+ mes "[Almond J]";
+ mes "Hing, it is not a normal Cotton Shirt.";
+ close2;
+ enable_items;
+ end;
+ }
+ mes "[Almond J]";
+ mes "Now!! Start the first hidden enchant!! Start!!!!!";
+ next;
+ specialeffect2 EF_REPAIRWEAPON;
+ progressbar "ffff00", 2;
+ completequest 5159;
+ delequip .@part;
+ setarray .@equip_card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
+ getitem2 2302,1,1,.@refineCount,0,.@equip_card[0],.@equip_card[1],SP50,HP100; // Cotton_Shirt_
+ mes "[Almond J]";
+ mes "Zzazanzn!! Completed!!";
+ next;
+ select("Wow, that was quick.");
+ mes "[Almond J]";
+ mes "How about it? Don't you think the hidden enchant is great? Any chance to do another hidden enchant?";
+ next;
+ mes "[Almond J]";
+ mes "It's fun. I want to do it again. Hey, another trial Ok? Aaaaa!!! I want to do the hidden enchant again.";
+ next;
+ mes "Gradually you are getting into your own world. You better go back to Mounds.";
+ close2;
+ enable_items;
+ end;
+ } else if (.@in_tutorial == 5) {
+ mes "[Almond J]";
+ mes "How about it? Don't you think the hidden enchant is great? Any chance to do another hidden enchant?";
+ next;
+ mes "[Almond J]";
+ mes "It's fun. I want to do it again. Hey, another trial Ok? Aaaaa!!! I want to do the hidden enchant again.";
+ next;
+ mes "Gradually you are getting into your own world. You better go back to Mounds.";
+ close2;
+ enable_items;
+ end;
+ } else if (.@in_tutorial == 6) {
+ mes "[Almond J]";
+ mes "Heh heh... how are you? I am doing a ^142CEB service of free hidden enchant for the beginner's weapon to advertise the enchant association.^000000.";
+ next;
+ } else {
+ mes "[Almond J]";
+ mes "Something strange must've happened. If this continues, please contact customer service.";
+ close2;
+ enable_items;
+ end;
+ }
+ mes "[Almond J]";
+ mes "As you are still a beginner, you don't have a very, very, very functional jewelry, but soon you will have.";
+ next;
+ mes "[Almond J]";
+ mes "How about it? Will you try the hidden enchant for the beginner's weapon free of charge?";
+ next;
+ switch(select("Hidden enchant start!!", "What weapons are you enchanting?", "Just passing by.")) {
+ case 1:
+ break;
+ case 2:
+ mes "[Almond J]";
+ mes "Ah!! Weapons? Hehehe.. I didn't explain it to you enough.";
+ next;
+ mes "[Almond J]";
+ mes "The weapon to be serviced with the free hidden enchant has the ^FD4F02Novice^000000 name in front of the weapon.";
+ next;
+ mes "[Almond J]";
+ mes "^FD4F02For Novices-";
+ mes "Cutter, Mace, Rod, Axe, Etc.";
+ close2;
+ enable_items;
+ end;
+ case 3:
+ mes "[Almond J]";
+ mes "Ye?!?!?!?!?!";
+ mes "Where are you going? You should do the hidden enchant before going.";
+ close2;
+ enable_items;
+ end;
+ }
+
+ .@part = EQI_HAND_R;
+ .@equip = getequipid(.@part);
+ .@equip_refine = getequiprefinerycnt(.@part);
+ setarray .@equip_card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
+
+ if (!.@equip) {
+ mes "[Almond J]";
+ mes "Hehehe... hidden enchant makes me excited. But you should come back with your weapon armed.";
+ close2;
+ enable_items;
+ end;
+ }
+ mes "[Almond J]";
+ switch(.@equip) {
+ case 1243: // Novice_Knife
+ mes "It is!! ^142ceb the Novice Knife^000000.";
+ next;
+ mes "[Almond J]";
+ mes "But this weapon might be strange to add a hidden enchant? Sorry.";
+ close2;
+ enable_items;
+ end;
+ case 1381: // N_Battle_Axe
+ case 1545: // N_Mace
+ case 1639: // N_Rod
+ case 1742: // N_Composite_Bow
+ case 13040: // N_Cutter
+ case 13041: // N_Main_Gauche
+ case 13116: // Novice_Revolver
+ case 13180: // Novice_Rifle
+ case 13181: // Novice_Shotgun
+ case 13182: // Novice_Gatling
+ case 13183: // Novice_Grenade_Launcher
+ case 13415: // N_Falchion
+ mes "It is!! The ^142ceb"+ getequipname(EQI_HAND_R) +"^000000.";
+ next;
+ break;
+ default:
+ mes "Ehee.. It is not a Novice Weapon. Leaving this expensive weapon to us and if broken... I'm not taking that chance.";
+ close2;
+ enable_items;
+ end;
+ }
+ setarray .@enchantments[1],4700,4701,4702,4730,4731,4732,4740,4741,4742,4710,4711,4712,4720,4721,4722,4750,4751,4752,4760,4766,4764,4786,4791,4795,4800,4811,4832,4818,4815;
+ .@enchant1 = rand(1, 35);
+ .@enchant2 = rand(1, 35);
+
+ if (.@enchant1 > 29)
+ .@enchant1 = 0;
+ else
+ .@enchant1 = .@enchantments[.@enchant1];
+
+ if (.@enchant2 > 29)
+ .@enchant2 = 0;
+ else
+ .@enchant2 = .@enchantments[.@enchant2];
+
+ mes "[Almond J]";
+ mes "It is a good weapon Then!! Let's start the hidden enchant!!";
+ next;
+ specialeffect2 EF_REPAIRWEAPON;
+ progressbar "ffff00", 3;
+ delequip .@part;
+ getitem2 .@equip,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@enchant1,.@enchant2;
+ mes "[Almond J]";
+ mes "Zzazanzn!! Completed!!";
+ mes "As I'm too excited, I can't check the options. Please check it yourself.";
+ close2;
+ enable_items;
+ end;
+}
+
+izlude_a,108,139,7 duplicate(Enchanter Almond J#iz) Enchanter Almond J#iz_a 4_CAT_SAILOR3
+izlude_b,108,139,7 duplicate(Enchanter Almond J#iz) Enchanter Almond J#iz_b 4_CAT_SAILOR3
+izlude_c,108,139,7 duplicate(Enchanter Almond J#iz) Enchanter Almond J#iz_c 4_CAT_SAILOR3
+izlude_d,108,139,7 duplicate(Enchanter Almond J#iz) Enchanter Almond J#iz_d 4_CAT_SAILOR3
+
+// = Repair Man
+// =============================================================================
+izlude,158,130,4 script Repair Man#iz 4_M_04,{
+ mes "[Repair Man]";
+ mes "Repairing broken equipment!! If you have broken equipment, bring it to me anytime.";
+ next;
+ switch(select("Repair it.", "Nothing to be repaired now.", "What is repairing?")) {
+ case 1:
+ .@broken = getbrokencount();
+ if (!.@broken) {
+ mes "[Repair Man]";
+ mes "You must treat your equipment carefully... as you don't have anything to be repaired.";
+ close;
+ }
+ .@cost = 5000 * .@broken;
+ mes "[Repair Man]";
+ mes "Hmmm... let's see... oh.. hmm...";
+ next;
+ mes "[Repair Man]";
+ mes "------------------------";
+ mes "Damaged Equipment Estimate";
+ mes "Damaged Equipment: ^FF0000"+ .@broken +"?000000";
+ mes "Fee: ^0000FF"+ .@cost +" Zeny^000000";
+ mes "------------------------";
+ mes "Would you like to proceed with the repair?";
+ next;
+ if(select("Yes", "No") == 2) {
+ mes "[Repair Man]";
+ mes "Well, I don't care. After all, it's not my equipment. However, leaving equipment unchecked is not a wise choice.";
+ close;
+ }
+ if (Zeny < .@cost) {
+ mes "[Repair Man]";
+ mes "The repair cost is 5000 Zeny per damaged equipment. You do not have enough money.";
+ close;
+ }
+ Zeny -= .@cost;
+ repairall;
+ mes "[Repair Man]";
+ mes "The repair has been completed. Be sure to take good care of your equipment.";
+ close;
+ case 2:
+ mes "[Repair Man]";
+ mes "If you don't have any equipment to be repaired, you may not have something to talk with me about.";
+ close;
+ case 3:
+ mes "[Repair Man]";
+ mes "A specific skill or boss monster could break your equipment frequently.";
+ next;
+ mes "[Repair Man]";
+ mes "This doesn't mean that your equipment is gone forever like what happens during refining.";
+ next;
+ mes "[Repair Man]";
+ mes "When your item breaks this way, they won't perform normally...";
+ next;
+ mes "[Repair Man]";
+ mes "In this case, bring it to me, and I will repair it back to new at the cost of 5000 zeny for each equipment.";
+ close;
+ }
+}
+
+izlude_a,158,130,4 duplicate(Repair Man#iz) Repair Man#iz_a 4_M_04
+izlude_b,158,130,4 duplicate(Repair Man#iz) Repair Man#iz_b 4_M_04
+izlude_c,158,130,4 duplicate(Repair Man#iz) Repair Man#iz_c 4_M_04
+izlude_d,158,130,4 duplicate(Repair Man#iz) Repair Man#iz_d 4_M_04
+
+// =============================================================================
+// = Old Novice Training Grounds
+// = These NPCs will teleport any stuck player to the new starting area.
+// =============================================================================
+new_1-1,53,114,3 script Training Instructor#1a 4_F_03,{
+ mes "[Training Instructor]";
+ mes "The training grounds have been revised.";
+ mes "I will send you to Izlude.";
+ close2;
+ erasequest 7117, 7127;
+ if (strnpcinfo(4) == "new_1-1" || strnpcinfo(4) == "new_1-2" || strnpcinfo(4) == "new_1-3" || strnpcinfo(4) == "new_1-4") {
+ .@warp$ = "iz_int";
+ } else if (strnpcinfo(4) == "new_2-1" || strnpcinfo(4) == "new_2-2" || strnpcinfo(4) == "new_2-3" || strnpcinfo(4) == "new_2-4") {
+ .@warp$ = "iz_int01";
+ } else if (strnpcinfo(4) == "new_3-1" || strnpcinfo(4) == "new_3-2" || strnpcinfo(4) == "new_3-3" || strnpcinfo(4) == "new_3-4") {
+ .@warp$ = "iz_int02";
+ } else if (strnpcinfo(4) == "new_4-1" || strnpcinfo(4) == "new_4-2" || strnpcinfo(4) == "new_4-3" || strnpcinfo(4) == "new_4-4") {
+ .@warp$ = "iz_int03";
+ } else if (strnpcinfo(4) == "new_5-1" || strnpcinfo(4) == "new_5-2" || strnpcinfo(4) == "new_5-3" || strnpcinfo(4) == "new_5-4") {
+ .@warp$ = "iz_int04";
+ }
+ savepoint .@warp$, 98, 88;
+ warp .@warp$, 98, 88;
+ end;
+}
+
+new_1-2,100,29,4 duplicate(Training Instructor#1a) Training Instructor#1b 4_F_03
+new_1-2,100,105,3 duplicate(Training Instructor#1a) Training Instructor#1c 4_F_03
+new_1-2,161,182,5 duplicate(Training Instructor#1a) Training Instructor#1d 4_F_03
+new_1-2,33,172,4 duplicate(Training Instructor#1a) Training Instructor#1e 4_F_03
+new_1-4,100,29,1 duplicate(Training Instructor#1a) Training Instructor#1f 4_F_03
+new_2-1,53,114,3 duplicate(Training Instructor#1a) Training Instructor#2a 4_F_03
+new_2-2,100,29,4 duplicate(Training Instructor#1a) Training Instructor#2b 4_F_03
+new_2-2,100,105,3 duplicate(Training Instructor#1a) Training Instructor#2c 4_F_03
+new_2-2,161,182,5 duplicate(Training Instructor#1a) Training Instructor#2d 4_F_03
+new_2-2,33,172,4 duplicate(Training Instructor#1a) Training Instructor#2e 4_F_03
+new_2-3,96,30,4 duplicate(Training Instructor#1a) Training Instructor#2f 4_F_03
+new_2-4,100,29,1 duplicate(Training Instructor#1a) Training Instructor#2g 4_F_03
+new_3-1,53,114,3 duplicate(Training Instructor#1a) Training Instructor#3a 4_F_03
+new_3-2,100,29,4 duplicate(Training Instructor#1a) Training Instructor#3b 4_F_03
+new_3-2,100,105,3 duplicate(Training Instructor#1a) Training Instructor#3c 4_F_03
+new_3-2,161,182,5 duplicate(Training Instructor#1a) Training Instructor#3d 4_F_03
+new_3-2,33,172,4 duplicate(Training Instructor#1a) Training Instructor#3e 4_F_03
+new_3-3,96,30,4 duplicate(Training Instructor#1a) Training Instructor#3f 4_F_03
+new_3-4,100,29,1 duplicate(Training Instructor#1a) Training Instructor#3g 4_F_03
+new_4-1,53,114,3 duplicate(Training Instructor#1a) Training Instructor#4a 4_F_03
+new_4-2,53,114,3 duplicate(Training Instructor#1a) Training Instructor#4b 4_F_03
+new_4-2,100,105,3 duplicate(Training Instructor#1a) Training Instructor#4c 4_F_03
+new_4-2,161,182,5 duplicate(Training Instructor#1a) Training Instructor#4d 4_F_03
+new_4-2,33,172,4 duplicate(Training Instructor#1a) Training Instructor#4e 4_F_03
+new_4-3,96,30,4 duplicate(Training Instructor#1a) Training Instructor#4f 4_F_03
+new_4-4,100,29,1 duplicate(Training Instructor#1a) Training Instructor#4g 4_F_03
+new_5-1,53,114,3 duplicate(Training Instructor#1a) Training Instructor#5a 4_F_03
+new_5-2,100,29,4 duplicate(Training Instructor#1a) Training Instructor#5b 4_F_03
+new_5-2,100,105,3 duplicate(Training Instructor#1a) Training Instructor#5c 4_F_03
+new_5-2,161,182,5 duplicate(Training Instructor#1a) Training Instructor#5d 4_F_03
+new_5-2,33,172,4 duplicate(Training Instructor#1a) Training Instructor#5e 4_F_03
+new_5-3,96,30,4 duplicate(Training Instructor#1a) Training Instructor#5f 4_F_03
+new_5-4,100,29,1 duplicate(Training Instructor#1a) Training Instructor#5g 4_F_03
diff --git a/npc/re/jobs/novice/novice.txt b/npc/re/jobs/novice/novice.txt
index aa991e8c3..bc7bf572c 100644
--- a/npc/re/jobs/novice/novice.txt
+++ b/npc/re/jobs/novice/novice.txt
@@ -2267,7 +2267,7 @@ S_Warp:
savepoint getarg(0),getarg(1),getarg(2);
warp getarg(0),getarg(3),getarg(4);
end;
-
+
OnTouch:
emotion e_gasp;
end;
diff --git a/npc/re/merchants/coin_exchange.txt b/npc/re/merchants/coin_exchange.txt
index cabd9753b..7b553e0bd 100644
--- a/npc/re/merchants/coin_exchange.txt
+++ b/npc/re/merchants/coin_exchange.txt
@@ -1006,7 +1006,7 @@ ecl_in01,33,98,5 script Herb Merchant Plafina#e 4_M_FAIRYKID2,{
delitem Splendide_Coin,.cost[.@item]*.@buy; //Splendide_Coin
getitem .items[.@item],.@buy;
close;
-
+
OnInit:
setarray .items[0],Snow_Flip,Peony_Mommy,Slapping_Herb,Yggdrasil_Dust;
setarray .cost[0],5,5,1,1; //Splendide Coins
@@ -1028,7 +1028,6 @@ ecl_in01,67,39,4 script Replication Expert Paltu 4_M_FAIRYKID4,{
mes "[Paltu]";
mes "Really? Hmm?";
close;
-
case 2:
mes "[Paltu]";
mes "One can say that there's no one better in Eclage than I at utilizing magic resistance.";
@@ -1124,7 +1123,7 @@ ecl_in01,67,39,4 script Replication Expert Paltu 4_M_FAIRYKID4,{
C_Boy's_Cap;
if ((countitem(Splendide_Coin) >= 50) && (countitem(Crystal_Mirror) >= 4) && countitem(Angel_Magic_Power) && (countitem(Azure_Jewel) >= 10) && (countitem(Cardinal_Jewel) >= 10) && (countitem(Blue_Jewel) >= 10) && (countitem(Golden_Jewel) >= 10) && (countitem(Bluish_Green_Jewel) >= 10))
.@item_check =1;
-
+
for(.@i = 0; .@i<getarraysize(.@items); .@i++) {
if (.@item_check && countitem(.@items[.@i]))
.@menu$ = .@menu$+getitemname(.@items[.@i])+" (^2502FDAble to Replicate^000000):";
@@ -1213,4 +1212,4 @@ ecl_in01,67,39,4 script Replication Expert Paltu 4_M_FAIRYKID4,{
mes "Good. This is a satisfying result.";
mes "I'll do even a better job next time. Please tell others about my work. Have a good day~";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/merchants/diamond.txt b/npc/re/merchants/diamond.txt
index 80fcb88de..73b09802a 100644
--- a/npc/re/merchants/diamond.txt
+++ b/npc/re/merchants/diamond.txt
@@ -27,21 +27,21 @@
mes "The ^FF82FF'17 Carat Diamond'^000000 is currently on sale for a cheap price!!";
mes "If valuable diamonds interest you then listen up!";
next;
-
+
mes .@npc$;
mes "You can give the diamond as a gift to your lover.";
mes "The receiver of the ^FF82FF'17 Carat Diamond'^000000 will cherish it";
mes "and treasure you in their heart.";
emotion e_loud;
next;
-
+
mes .@npc$;
mes "What? You don't have a lover?";
mes "You can still just hang on to it for yourself.";
mes "The enchanting aura of the ^FF82FF'17 Carat Diamond'^000000 is likely";
mes "to bring love into your life.";
next;
-
+
mes .@npc$;
mes "Known as the captivating diamond of diamonds...";
mes "It is the ^FF82FF'17 Carat Diamond'^000000!";
@@ -61,33 +61,28 @@
mes "dug up from Morroc is unspeakable!";
emotion e_omg;
next;
-
mes .@npc$;
mes "Some claim that this is the very same diamond";
mes "that was seen by Kachua in Comodo!";
next;
-
if (select("End Conversation:How much is it?") == 1) {
mes .@npc$;
mes "It's rather inexpensive!";
mes "If you're interested, talk to me any time!";
close;
}
-
mes .@npc$;
mes "Of course! The most important thing is price!";
mes "As I've said earlier, the ^FF82FF'17 Carat Diamond'^000000 has been";
mes "appraised as a 17 carat diamond.";
mes "There aren't many like it in the world.";
next;
-
mes .@npc$;
mes "The price is a mere 500 million zeny!";
mes "There is also a 1,000,000z service fee.";
mes "Compared to the quality of the diamond";
mes "this is a small price to pay.";
next;
-
if (select("^828282It's too expensive.^000000:I'll buy it.") == 1) {
mes .@npc$;
mes "To say that a diamond such as the";
@@ -95,7 +90,6 @@
mes "you leave me speechless.";
close;
}
-
mes .@npc$;
mes "OOOH! I knew from the moment I saw you that you were the rightful";
mes "owner of this wonderful diamond.";
@@ -103,38 +97,31 @@
mes "I believe this diamond will suit you quite well.";
mes "All I need from you is to complete this contract.";
next;
-
while(1) {
if (select("^B9062FI will sign the contract.^000000:^828282Nevermind, I changed my mind.^000000") == 2) {
mes .@npc$;
mes "I see, that's too bad..";
close;
}
-
mes .@npc$;
mes "What is your name?";
next;
-
mes "[" + strcharinfo(0) + "]";
mes "My name is " + strcharinfo(0) + ".";
next;
-
mes .@npc$;
mes "Alright then, please sign here.";
next;
-
input .@charname$;
if (.@charname$ == strcharinfo(0)) {
mes .@npc$;
mes "Okay, good.";
mes "All that is left now is payment.";
next;
-
if (Zeny >= 501000000) {
mes .@npc$;
mes ". . . . . .";
next;
-
mes .@npc$;
mes "Calculating the price and service fee..";
mes "501,000,000 zeny.";
@@ -143,7 +130,6 @@
Zeny -= 501000000;
getitem 6024, 1;
next;
-
mes .@npc$;
mes "You may exchange the diamond back for zeny at any time.";
mes "However, there will be a 1,000,000z service fee.";
@@ -180,32 +166,26 @@
emotion e_dots;
close;
}
-
mes .@npc$;
mes "I see. After I receive your signature, ";
mes "You must offer your ^FF82FF'17 Carat Diamond'^000000.";
mes "Also don't forget there is a 1,000,000z service fee!";
next;
-
mes .@npc$;
mes "What is your name?";
next;
-
mes "[" + strcharinfo(0) + "]";
mes "My name is " + strcharinfo(0) + ".";
next;
-
mes .@npc$;
mes "Alright then, please sign here.";
next;
-
while (1) {
if (select("Sign:Don't Sign") == 2) {
mes .@npc$;
mes "The trade cannot be completed without your signature.";
close;
}
-
input .@charname$;
if (.@charname$ == strcharinfo(0)) {
mes .@npc$;
@@ -213,7 +193,6 @@
mes "I will now take your ^FF82FF'17 Carat Diamond'^000000..";
mes "You will receive ^0000FF499,000,000z^000000 afterwards.";
next;
-
mes .@npc$;
mes "Thank you for your business.";
mes "Whenever you need a ^FF82FF'17 Carat Diamond'^000000,";
diff --git a/npc/re/merchants/ninja_craftsman.txt b/npc/re/merchants/ninja_craftsman.txt
index a88069e99..cb6d47cd9 100644
--- a/npc/re/merchants/ninja_craftsman.txt
+++ b/npc/re/merchants/ninja_craftsman.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= Ninja Weapon and Armor
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= Ninja Armor and Weapon Craftsman
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 Official Conversion. [Dastgir]
-//============================================================
+//============================================================
que_ng,21,72,6 script Master Craftsman Gyo#arm 4_M_RASWORD,{
mes "[Gyo]";
mes "How would you define victory?";
@@ -55,7 +55,7 @@ que_ng,21,72,6 script Master Craftsman Gyo#arm 4_M_RASWORD,{
mes "Looks like you need more time to decide.";
close;
}
-
+
L_Menu:
.@item_make = getarg(0);
while(1){
@@ -177,7 +177,7 @@ L_Menu:
}
next;
}
-
+
L_Ingredients:
switch(getarg(0)){
case 2172: //Wolf_Armguard
@@ -190,7 +190,6 @@ L_Ingredients:
return "you'll need a Special Ninja Suit with a slot and 10 Dark Pieces";
}
end;
-
}
que_ng,23,70,6 script Master Craftsman Ki#weap 4_DST_SOLDIER,{
@@ -231,7 +230,7 @@ que_ng,23,70,6 script Master Craftsman Ki#weap 4_DST_SOLDIER,{
mes "Think carefully~~";
close;
}
-
+
L_Menu:
.@item_make = getarg(0);
while(1){
@@ -336,7 +335,7 @@ L_Menu:
}
next;
}
-
+
L_Ingredients:
switch(getarg(0)){
case 13076: //Raksasa_Dagger
@@ -347,5 +346,4 @@ L_Ingredients:
return "you need one Huuma Calm Mind Shuriken and 100 Broken Shurikens";
}
end;
-
}
diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt
index 33d23450c..d184af61d 100644
--- a/npc/re/merchants/shadow_refiner.txt
+++ b/npc/re/merchants/shadow_refiner.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= Shadow Refiner
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= [Aegis Conversion]
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 First Version [Dastgir]
-//============================================================
+//============================================================
itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{
disable_items;
@@ -61,7 +61,7 @@ itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{
.@mate$[1] = "^8C8C8C"+ getitemname(.@s_weapon2[.@index]) +"^000000";
.@miss[1] = 1;
}
- if (getequiprefinerycnt(.@SelectedPart) > 6 && countitem(.@s_weapon3[.@index]))
+ if (getequiprefinerycnt(.@SelectedPart) > 6 && countitem(.@s_weapon3[.@index]))
.@mate$[2] = getitemname(.@s_weapon3[.@index]);
else {
.@mate$[2] = "^8C8C8C"+ getitemname(.@s_weapon3[.@index]) +"^000000";
diff --git a/npc/re/mobs/champion.txt b/npc/re/mobs/champion.txt
index d880fb2d4..cbbee88dd 100644
--- a/npc/re/mobs/champion.txt
+++ b/npc/re/mobs/champion.txt
@@ -318,4 +318,4 @@ kh_dun02,0,0,0,0 monster Furious Alicel 2909,2,300000,0
c_tower3,0,0,0,0 monster Elusive Alarm 2910,2,300000,0
ra_san05,0,0,0,0 monster Swift Agav 2911,2,300000,0
abyss_03,0,0,0,0 monster Solid Acidus 2912,2,300000,0
-abyss_02,0,0,0,0 monster Acidus Ringleader 2913,2,300000,0 \ No newline at end of file
+abyss_02,0,0,0,0 monster Acidus Ringleader 2913,2,300000,0
diff --git a/npc/re/mobs/dungeons/treasure.txt b/npc/re/mobs/dungeons/treasure.txt
index b18d5fd62..41d90c34c 100644
--- a/npc/re/mobs/dungeons/treasure.txt
+++ b/npc/re/mobs/dungeons/treasure.txt
@@ -3,11 +3,12 @@
//===== By: ==================================================
//= Athena (1.0)
//===== Current Version: =====================================
-//= 1.3
+//= 1.4
//===== Additional Comments: =================================
//= 1.1 Official kRO 10.1 spawns [Playtester]
//= 1.2 More accurate spawns [Playtester]
//= 1.3 Corrected MVP spawn variance. [L0ne_W0lf]
+//= 1.4 Added 14.2 Novice Version as part of Academy update. [Kisuka]
//============================================================
//==================================================
@@ -116,3 +117,64 @@ treasure02,100,85,0,0 monster Hydra 1068,1,300000,100000,1
treasure02,101,85,0,0 monster Hydra 1068,1,300000,100000,1
treasure02,0,0,0,0 monster Ghostring 1120,1,1980000,1200000,1
treasure02,101,151,8,8 boss_monster Drake 1112,1,7200000,600000,1
+
+//==================================================
+// treasure_n1 - Izlude Sunken Ship 1F
+//==================================================
+treasure_n1,0,0,0,0 monster Red Mushroom 1085,10,50000,0,0
+treasure_n1,0,0,0,0 monster Black Mushroom 1084,10,50000,0,0
+treasure_n1,160,54,13,13 monster Red Mushroom 1085,10,50000,0,0
+treasure_n1,160,54,13,13 monster Black Mushroom 1084,10,50000,0,0
+treasure_n1,160,54,13,13 monster Dead Plankton 2404,10,50000,0,0
+treasure_n1,0,0,0,0 monster Red Plant 1078,5,50000,0,0
+treasure_n1,0,0,0,0 monster Green Plant 1080,5,50000,0,0
+treasure_n1,0,0,0,0 monster Yellow Plant 1081,5,50000,0,0
+treasure_n1,0,0,0,0 monster Blue Plant 1079,5,50000,0,0
+treasure_n1,0,0,0,0 monster White Plant 1082,5,50000,0,0
+treasure_n1,0,0,0,0 monster Zombie 1015,1,100000,0,0
+treasure_n1,0,0,0,0 monster Zombie 1015,1,100000,0,0
+treasure_n1,68,47,9,9 monster Weak Skeleton 2405,4,8000,0,0
+treasure_n1,106,42,9,9 monster Roda Frog 1012,3,60000,0,0
+treasure_n1,32,37,9,9 monster Roda Frog 1012,6,60000,0,0
+treasure_n1,69,112,9,9 monster Spore 1014,3,20000,0,0
+treasure_n1,35,112,9,9 monster Spore 1014,3,20000,0,0
+treasure_n1,35,112,9,9 monster Roda Frog 1012,3,20000,0,0
+treasure_n1,111,111,9,9 monster Roda Frog 1012,3,60000,0,0
+treasure_n1,111,111,9,9 monster Dead Plankton 2404,5,60000,0,0
+treasure_n1,69,174,9,9 monster Dead Plankton 2404,7,120000,0,0
+treasure_n1,82,155,9,9 monster Spore 1014,4,60000,0,0
+treasure_n1,55,155,9,9 monster Spore 1014,2,60000,0,0
+treasure_n1,22,160,0,0 monster Weak Skeleton 2405,3,8000,0,0
+treasure_n1,163,155,13,13 monster Weak Skeleton 2405,5,8000,0,0
+treasure_n1,163,155,13,13 monster Zombie 1015,1,8000,0,0
+
+//==================================================
+// treasure_n2 - Izlude Sunken Ship 2F
+//==================================================
+treasure_n2,0,0,0,0 monster Red Mushroom 1085,10,50000,0,0
+treasure_n2,0,0,0,0 monster Black Mushroom 1084,10,50000,0,0
+treasure_n2,150,40,13,13 monster Weak Soldier Skeleton 2406,3,50000,0,0
+treasure_n2,150,40,13,13 monster Weak Skeleton 2405,5,50000,0,0
+treasure_n2,0,0,0,0 monster Red Plant 1078,5,50000,0,0
+treasure_n2,0,0,0,0 monster Green Plant 1080,5,50000,0,0
+treasure_n2,0,0,0,0 monster Yellow Plant 1081,5,50000,0,0
+treasure_n2,0,0,0,0 monster Blue Plant 1079,5,50000,0,0
+treasure_n2,0,0,0,0 monster White Plant 1082,5,50000,0,0
+treasure_n2,100,50,13,13 monster Weak Skeleton 2405,7,30000,0,0
+treasure_n2,100,50,13,13 monster Dead Plankton 2404,5,30000,0,0
+treasure_n2,50,40,13,13 monster Weak Soldier Skeleton 2406,3,50000,0,0
+treasure_n2,50,40,13,13 monster Weak Skeleton 2405,5,50000,0,0
+treasure_n2,40,75,5,3 monster Zombie 1015,2,60000,0,0
+treasure_n2,40,75,5,5 monster Dead Plankton 2404,4,60000,0,0
+treasure_n2,50,140,5,5 monster Weak Skeleton 2405,10,60000,0,0
+treasure_n2,50,140,5,5 monster Weak Soldier Skeleton 2406,5,60000,0,0
+treasure_n2,160,140,5,5 monster Weak Skeleton 2405,5,60000,0,0
+treasure_n2,160,140,5,5 monster Weak Soldier Skeleton 2406,3,60000,0,0
+treasure_n2,160,140,5,2 monster Zombie 1015,3,60000,0,0
+treasure_n2,160,70,13,13 monster Weak Skeleton 2405,5,30000,0,0
+treasure_n2,160,70,13,13 monster Dead Plankton 2404,7,30000,0,0
+treasure_n2,155,40,9,9 monster Zombie 1015,3,120000,0,0
+treasure_n2,100,85,13,13 monster Weak Soldier Skeleton 2406,2,50000,0,0
+treasure_n2,100,160,13,13 monster Weak Soldier Skeleton 2406,5,120000,0,0
+treasure_n2,100,160,13,13 monster Weak Skeleton 2405,7,200000,0,0
+treasure_n2,100,160,13,13 monster Dead Plankton 2404,4,60000,0,0
diff --git a/npc/re/mobs/fields/niflheim.txt b/npc/re/mobs/fields/niflheim.txt
index 2446ec0e0..245ce4c7c 100644
--- a/npc/re/mobs/fields/niflheim.txt
+++ b/npc/re/mobs/fields/niflheim.txt
@@ -125,7 +125,7 @@ OnInit:
monster "niflheim",83,216,"Loli Ruri",1505,1,strnpcinfo(3)+"::OnInvasionMonsters";
break;
}
-
+
monster "niflheim",154,95,"Disguise",1506,1,strnpcinfo(3)+"::OnInvasionMonsters";
monster "niflheim",115,65,"Disguise",1506,1,strnpcinfo(3)+"::OnInvasionMonsters";
monster "niflheim",330,195,"Disguise",1506,1,strnpcinfo(3)+"::OnInvasionMonsters";
diff --git a/npc/re/mobs/fields/prontera.txt b/npc/re/mobs/fields/prontera.txt
index 7968cbdc0..9d3746be8 100644
--- a/npc/re/mobs/fields/prontera.txt
+++ b/npc/re/mobs/fields/prontera.txt
@@ -89,25 +89,31 @@ prt_fild07,225,110,5,5 monster Black Mushroom 1084,3,360000,180000,1
//==================================================
// prt_fild08 - Prontera Field
//==================================================
-prt_fild08,0,0,0,0 monster Poring 1002,140,5000,0,0
-prt_fild08,0,0,0,0 monster Lunatic 1063,40,5000,0,0
-prt_fild08,0,0,0,0 monster Fabre 1007,40,5000,0,0
+prt_fild08,0,0,0,0 monster Poring 1002,110,5000,0,0
+prt_fild08,0,0,0,0 monster Lunatic 1063,100,5000,0,0
+prt_fild08,0,0,0,0 monster Fabre 1007,100,5000,0,0
+prt_fild08,0,0,0,0 monster Little Poring 2398,30,50000,0,0
//==================================================
// prt_fild08 - Duplicates
//==================================================
-prt_fild08a,0,0,0,0 monster Poring 1002,140,5000,0,0
-prt_fild08b,0,0,0,0 monster Poring 1002,140,5000,0,0
-prt_fild08c,0,0,0,0 monster Poring 1002,140,5000,0,0
-prt_fild08d,0,0,0,0 monster Poring 1002,140,5000,0,0
-prt_fild08a,0,0,0,0 monster Lunatic 1063,40,5000,0,0
-prt_fild08b,0,0,0,0 monster Lunatic 1063,40,5000,0,0
-prt_fild08c,0,0,0,0 monster Lunatic 1063,40,5000,0,0
-prt_fild08d,0,0,0,0 monster Lunatic 1063,40,5000,0,0
-prt_fild08a,0,0,0,0 monster Fabre 1007,40,5000,0,0
-prt_fild08b,0,0,0,0 monster Fabre 1007,40,5000,0,0
-prt_fild08c,0,0,0,0 monster Fabre 1007,40,5000,0,0
-prt_fild08d,0,0,0,0 monster Fabre 1007,40,5000,0,0
+prt_fild08a,0,0,0,0 monster Poring 1002,110,5000,0,0
+prt_fild08a,0,0,0,0 monster Lunatic 1063,100,5000,0,0
+prt_fild08a,0,0,0,0 monster Fabre 1007,100,5000,0,0
+prt_fild08a,0,0,0,0 monster Little Poring 2398,30,50000,0,0
+prt_fild08b,0,0,0,0 monster Poring 1002,110,5000,0,0
+prt_fild08b,0,0,0,0 monster Lunatic 1063,100,5000,0,0
+prt_fild08b,0,0,0,0 monster Fabre 1007,100,5000,0,0
+prt_fild08b,0,0,0,0 monster Little Poring 2398,30,50000,0,0
+prt_fild08c,0,0,0,0 monster Poring 1002,110,5000,0,0
+prt_fild08c,0,0,0,0 monster Lunatic 1063,100,5000,0,0
+prt_fild08c,0,0,0,0 monster Fabre 1007,100,5000,0,0
+prt_fild08c,0,0,0,0 monster Little Poring 2398,30,50000,0,0
+prt_fild08d,0,0,0,0 monster Poring 1002,110,5000,0,0
+prt_fild08d,0,0,0,0 monster Lunatic 1063,100,5000,0,0
+prt_fild08d,0,0,0,0 monster Fabre 1007,100,5000,0,0
+prt_fild08d,0,0,0,0 monster Little Poring 2398,30,50000,0,0
+
//==================================================
// prt_fild09 - Prontera Field
diff --git a/npc/re/mobs/fields/umbala.txt b/npc/re/mobs/fields/umbala.txt
index f33c07db8..d346dbc3b 100644
--- a/npc/re/mobs/fields/umbala.txt
+++ b/npc/re/mobs/fields/umbala.txt
@@ -11,7 +11,7 @@
//============================================================
//==================================================
-// um_fild01 - Luluka Forest
+// um_fild01 - Luluka Forest
//==================================================
um_fild01,0,0,0,0 monster Dryad 1493,60,5000,0,0
um_fild01,0,0,0,0 monster Stone Shooter 1495,25,5000,0,0
@@ -23,7 +23,7 @@ um_fild01,0,0,0,0 monster Yellow Plant 1081,10,180000,90000,1
um_fild01,0,0,0,0 monster Shining Plant 1083,5,180000,90000,1
//==================================================
-// um_fild02 - Hoomga Forest
+// um_fild02 - Hoomga Forest
//==================================================
um_fild02,0,0,0,0 monster Wootan Fighter 1499,40,5000,0,0
um_fild02,0,0,0,0 monster Stone Shooter 1495,15,5000,0,0
@@ -33,7 +33,7 @@ um_fild02,0,0,0,0 monster Red Plant 1078,5,180000,90000,1
um_fild02,0,0,0,0 monster Yellow Plant 1081,5,180000,90000,1
//==================================================
-// um_fild03 - Kalala Swamp
+// um_fild03 - Kalala Swamp
//==================================================
um_fild03,0,0,0,0 monster Parasite 1500,60,5000,0,0
um_fild03,0,0,0,0 monster Stone Shooter 1495,15,5000,0,0
@@ -44,7 +44,7 @@ um_fild03,0,0,0,0 monster Green Plant 1080,10,180000,90000,1
um_fild03,0,0,0,0 monster Shining Plant 1083,2,180000,90000,1
//==================================================
-// um_fild04 - Hoomga Jungle
+// um_fild04 - Hoomga Jungle
//==================================================
um_fild04,0,0,0,0 monster Wild Rose 1261,30,5000,0,0
um_fild04,0,0,0,0 monster Stone Shooter 1495,15,5000,0,0
diff --git a/npc/re/quests/cupet.txt b/npc/re/quests/cupet.txt
index 3e339e168..03f5f69dc 100644
--- a/npc/re/quests/cupet.txt
+++ b/npc/re/quests/cupet.txt
@@ -13,9 +13,8 @@
// 1st NPC
- script CPM1 4_M_ALCHE_C,{
-
.@npc$ = "[Cute Pet Manager]";
-
+
setarray .@tame_id[0],619,620,622,623,624,627,628,629,630;
setarray .@tame_amount[0],3,3,3,3,3,3,3,3,3;
setarray .@hunt_id[0],909,909,705,916,935,919,919,940,921;
@@ -29,7 +28,6 @@
mes .@tame_amount + " times for a taming item.";
mes "You can't exchange anymore.";
next;
-
mes "[Cute Pet Manager]";
mes "Besides me, there are other";
mes "Cute Pet Managers. If you want";
@@ -37,16 +35,14 @@
mes "you go and see them.";
close;
}
-
- callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_one,.@tame_gets,.@hunt_id2,.@hunt_amount2;
+ callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_one,.@tame_gets,.@hunt_id2,.@hunt_amount2;
}
// 2nd NPC
- script CPM2 4_M_ALCHE_C,{
-
.@npc$ = "[Cute Pet Manager]";
-
+
setarray .@tame_id[0],621,625,632,631,633,634,635,636,659,637,639,640;
setarray .@tame_amount[0],2,2,2,2,2,2,2,2,2,2,2,2;
setarray .@hunt_id[0],938,935,925,7033,945,942,931,901,1094,1021,936,1035;
@@ -61,7 +57,6 @@
mes .@tame_amount + " times for a taming item.";
mes "You can't exchange anymore.";
next;
-
mes "[Cute Pet Manager]";
mes "Besides me, there are other";
mes "Cute Pet Managers. If you want";
@@ -69,16 +64,14 @@
mes "you go and see them.";
close;
}
-
- callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_two,.@tame_gets,.@hunt_id2,.@hunt_amount2;
+ callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_two,.@tame_gets,.@hunt_id2,.@hunt_amount2;
}
// 3rd NPC
- script CPM3 4_M_ALCHE_C,{
-
.@npc$ = "[Cute Pet Manager]";
-
+
setarray .@tame_id[0],638,626,641,661,660,642;
setarray .@tame_amount[0],1,1,1,1,1,1;
setarray .@hunt_id[0],1020,943,1038,7047,1970,923;
@@ -94,7 +87,6 @@
mes .@tame_amount + " times for a taming item.";
mes "You can't exchange anymore.";
next;
-
mes "[Cute Pet Manager]";
mes "Besides me, there are other";
mes "Cute Pet Managers. If you want";
@@ -102,9 +94,8 @@
mes "you go and see them.";
close;
}
-
- callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_three,.@tame_gets,.@hunt_id2,.@hunt_amount2;
+ callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_three,.@tame_gets,.@hunt_id2,.@hunt_amount2;
}
function script cute_pet_manager {
@@ -123,7 +114,6 @@ function script cute_pet_manager {
mes "who is in charge of public relations";
mes "for the New Upgraded Cute Pet system.";
next;
-
mes "[Cute Pet Manager]";
mes "If you have any concerns regarding";
mes "the Cute Pet system I am here to guide you.";
@@ -132,18 +122,15 @@ function script cute_pet_manager {
mes "then I will tell you the monster";
mes "that you can tame with the item.";
next;
-
mes "Also I will explain what materials";
mes "you need to bring in order to";
mes "get the taming item.";
next;
-
mes "[Cute Pet Manager]";
mes "If you already brought materials";
mes "to exchange for the taming item,";
mes "I can exchange it for taming items immediately.";
next;
-
mes "[Cute Pet Manager]";
mes "However, there is a limit";
mes "for exchanging taming items.";
@@ -151,17 +138,14 @@ function script cute_pet_manager {
mes getarg(6) + " times. So please make sure";
mes "how many times you have exchanged.";
next;
-
mes "[Cute Pet Manager]";
mes "So, which taming item do you want?";
mes "Please choose one from the list.";
next;
-
// Create Menu System
for (.@a = 0; .@a < getarraysize(getarg(0)); ++.@a) {
.@menu$ += (.@menu$ == "" ? "" : ":") + getitemname(getelementofarray(getarg(0), .@a));
}
-
// Query Player Choice
.@choice = select(.@menu$) - 1;
@@ -173,7 +157,6 @@ function script cute_pet_manager {
.@mob_id = getelementofarray(getarg(4), .@choice);
.@hunt_id2 = getelementofarray(getarg(7), .@choice);
.@hunt_amount2 = getelementofarray(getarg(8), .@choice);
-
dispbottom "Tame ID: " + .@tame_id;
dispbottom "Tame Amount: " + .@tame_amount;
dispbottom "Hunt ID: " + .@hunt_id;
@@ -182,28 +165,23 @@ function script cute_pet_manager {
dispbottom "Mob ID: " + .@mob_id;
dispbottom "Hunt ID2: " + .@hunt_id2;
dispbottom "Hunt Amount2: " + .@hunt_amount2;
-
if (.@hunt_id2) { .@hunt2_count = countitem(.@hunt_id2); }
if (countitem(.@hunt_id) >= .@hunt_amount && countitem(6083) > 0 && .@hunt2_count >= .@hunt_amount2) {
-
mes "[Cute Pet Manager]";
mes "Ah, you have gathered all items";
mes "with your friends. You can now";
mes "exchange for an " + getitemname(.@tame_id) + ".";
mes "Do you want to exchange with me?";
next;
-
- if (select("Exchange:Don't Exchange") == 2) {
+ if (select("Exchange:Don't Exchange") == 2) {
mes "[Cute Pet Manager]";
mes "You don't? You will come back again.";
close;
}
-
delitem .@hunt_id, .@hunt_amount;
delitem 6083, 1;
set getarg(5), getarg(5) + 1;
getitem .@tame_id, .@tame_amount;
-
mes "[Cute Pet Manager]";
mes "Wise choice.";
mes "I hope you and your pet get along.";
diff --git a/npc/re/quests/eden/100-110.txt b/npc/re/quests/eden/100-110.txt
index 486a4b6e6..c0065b293 100644
--- a/npc/re/quests/eden/100-110.txt
+++ b/npc/re/quests/eden/100-110.txt
@@ -782,7 +782,7 @@ moc_para01,37,95,5 script Gelkah#1 4_F_GELKA,{
.@ran = rand(1,1000);
if (.@amount == 1) {
if (.@ran <= 100)
- setarray .@item[0],Blue_Potion,2;
+ setarray .@item[0],Blue_Potion,2;
else if (.@ran <= 200)
setarray .@item[0],White_Slim_Potion,10;
else if (.@ran == 333)
diff --git a/npc/re/quests/eden/111-120.txt b/npc/re/quests/eden/111-120.txt
index b8bd667f1..a8ea81361 100644
--- a/npc/re/quests/eden/111-120.txt
+++ b/npc/re/quests/eden/111-120.txt
@@ -1135,7 +1135,6 @@ S_Hunting:
mes "You finished researching about "+ getarg(.@i+2) +". Thank you.";
getexp 700000,getarg(.@i+1);
break;
-
}
erasequest .@quest_id;
next;
diff --git a/npc/re/quests/eden/131-140.txt b/npc/re/quests/eden/131-140.txt
index b40c4167f..e23b6a83d 100644
--- a/npc/re/quests/eden/131-140.txt
+++ b/npc/re/quests/eden/131-140.txt
@@ -573,7 +573,7 @@ S_Erasequest:
mes "I'll ask someone else to take care of the rest of the Satan Morroc Incarnations, then!";
break;
case 3:
- mes "I'll need to ask another adventurer to help with the Scaraba!";
+ mes "I'll need to ask another adventurer to help with the Scaraba!";
}
break;
case 2:
@@ -584,7 +584,7 @@ S_Erasequest:
getexp 1100000,300000;
break;
case 2:
- mes "Was the story of Satan Morroc worth putting to song? Great work!";
+ mes "Was the story of Satan Morroc worth putting to song? Great work!";
getexp 1100000,200000;
break;
case 3:
diff --git a/npc/re/quests/eden/eden_quests.txt b/npc/re/quests/eden/eden_quests.txt
index 1d25e17d3..1ac4f83f1 100644
--- a/npc/re/quests/eden/eden_quests.txt
+++ b/npc/re/quests/eden/eden_quests.txt
@@ -4037,7 +4037,7 @@ S_Enchant:
delitem getarg(0),1;
para_2nd04 = 4;
changequest 7240,7241;
- getitem2 getarg(0),1,1,0,0,0,0,.@1st,.@2nd;
+ getitem2 getarg(0),1,1,0,0,0,0,.@1st,.@2nd;
mes "[Thorn]";
mes "Ok, seems that the enhancement went well.";
mes "If you don't like the result then you can come back again tomorrow.";
diff --git a/npc/re/quests/newgears/2012_headgears.txt b/npc/re/quests/newgears/2012_headgears.txt
index 167817a10..2f61d22f8 100644
--- a/npc/re/quests/newgears/2012_headgears.txt
+++ b/npc/re/quests/newgears/2012_headgears.txt
@@ -462,8 +462,8 @@ moc_para01,41,169,3 script Reno#2012hat 1_M_WIZARD,{
Corsair, -1, 300, Enhanced_Corsair,
Bone_Helm_, 1, 300, Enhanced_Bone_Helm,
Helm_Of_Angel, -1, 300, Enhanced_Helm_Of_Angel,
- Helm_Of_Sun, 0, 1000, Enhanced_Helm_Of_Sun,
- Helm_Of_Sun_, 1, 100, Enhanced_Helm_Of_Sun,
+ // Helm_Of_Sun, 0, 1000, Enhanced_Helm_Of_Sun,
+ Helm_Of_Sun_, 1, 300, Enhanced_Helm_Of_Sun,
Variant_Shoes, -1, 300, Enhanced_Variant_Shoes,
Ring_Of_Flame_Lord,-1, 300, Good_Ring_Of_Flame_Lord,
Ring_Of_Resonance, -1, 300, Good_Ring_Of_Resonance,
diff --git a/npc/re/quests/quests_dewata.txt b/npc/re/quests/quests_dewata.txt
index db78bce54..821ee6d8d 100644
--- a/npc/re/quests/quests_dewata.txt
+++ b/npc/re/quests/quests_dewata.txt
@@ -1285,7 +1285,6 @@ dew_fild01,114,275,4 script Lero#dew_drink 4_M_DEWMAN,{
mes "Once you bring the oil palm nuts, Mr. Memo will exchange them with oil.";
close;
} else if ((.@j & 2) || (.@j & 8) || (.@j & 32)) {
-
// .@i[]: <required amount>,<quest ID>,<reward amount>,<free weight>
if (.@j & 2)
setarray .@i[0],20,5046,10,5000;
diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt
index 10bb003e5..f3d16473d 100644
--- a/npc/re/quests/quests_dicastes.txt
+++ b/npc/re/quests/quests_dicastes.txt
@@ -902,7 +902,6 @@ dic_in01,40,270,2 script Transport Dept. 2 Mgr 4_MAN_BENKUNI,{
close;
}
-
dic_in01,40,193,1 script Papyrus#0001 4_MAN_NITT,{
if (!checkweight(1201,1)) {
mes "You have too many items in your inventory.";
@@ -3985,7 +3984,6 @@ dic_in01,245,119,4 script Shay#ep133_13 4_M_ACROSS,{
setarray .@quest, 7194,7195,7196;
setarray .@item, 6306,6305,6307;
setarray .@str$, "bloodstain","frozen piece of skin","strange magical stone fragment";
-
.@size = getarraysize(.@item);
for (.@i = 0; .@i < .@size; ++.@i) {
if (countitem(.@item[.@i])) {
@@ -4800,7 +4798,6 @@ dic_fild01,231,174,5 script BK#ep133_18 4_M_MERCAT2,{
.@size = getarraysize(.@npc$);
for (.@i = 0; .@i < .@size; ++.@i)
if (.@n$ == .@npc$[.@i]) .@type = .@i;
-
if (ep13_3_secret == 10) {
if (.@npc$[.@type] == "Rock Pile") {
mes "There are many piles of rock around because of the unstable crustal movements.";
@@ -7332,7 +7329,7 @@ dic_in01,42,264,3 script Adventurer Clerk#ep133 4_MAN_NITT,{
mes "I'm done. Hehe";
close;
}
-
+
// Enchant Constants
// Ex: .@dex[1]: DEX + 1 | .@cri[5]: CRI + 5 | .@eva[12]: FLEE + 12
.@matk[1] = 4760; .@matk[2] = 4761;
@@ -7342,13 +7339,13 @@ dic_in01,42,264,3 script Adventurer Clerk#ep133 4_MAN_NITT,{
.@dex[1] = 4720; .@dex[2] = 4721; .@dex[3] = 4722;
.@int[1] = 4710; .@int[2] = 4711; .@int[3] = 4712;
.@agi[1] = 4730; .@agi[2] = 4731; .@agi[3] = 4732;
-
+
// Enchant attribute is determined by the digit position of variable value (ep13_3_<type>).
// For example, assume the variable value is 516:
// .@f_<slot>[<index>]
// slot: 2 3 4
- // index: 5 1 6
-
+ // index: 5 1 6
+
// Enchant Format
if (compare(.@v$,"ring")) setarray .@f_2[1],.@agi[1],.@agi[2],.@int[1],.@int[2],.@dex[1],.@dex[2];
else setarray .@f_2[1],.@agi[1],.@agi[2],.@agi[3],.@int[1],.@int[2],.@int[3],.@dex[1],.@dex[2],.@dex[3];
diff --git a/npc/re/quests/quests_eclage.txt b/npc/re/quests/quests_eclage.txt
index 918a8edd3..3b4e7ba0f 100644
--- a/npc/re/quests/quests_eclage.txt
+++ b/npc/re/quests/quests_eclage.txt
@@ -1,15 +1,15 @@
-//===== Hercules Script ======================================
+//===== Hercules Script ======================================
//= Eclage Quests
-//===== By: ==================================================
+//===== By: ==================================================
//= Dastgir
-//===== Current Version: =====================================
+//===== Current Version: =====================================
//= 1.0
-//===== Description: =========================================
+//===== Description: =========================================
//= Quests of Eclage
//= Contains All Quest of Eclage
-//===== Additional Comments: =================================
+//===== Additional Comments: =================================
//= 1.0 Converted from the official Aegis script. [Dastgir]
-//============================================================
+//============================================================
// Teleport Cats
//============================================================
@@ -63,7 +63,7 @@ ecl_fild01,118,311,4 script Teleport Cat No.1#1 4_M_BOSSCAT,{
}
warp .maps$[.@mindex[.@i]],.x[.@mindex[.@i]],.y[.@mindex[.@i]];
end;
-
+
OnInit:
setarray .maps$,"bif_fild02","ecl_fild01","spl_fild02","mid_camp","man_fild02","dic_fild01"; //Map Names //2,4,8,16,32,64
setarray .x,291,116,51,180,133,159; //X-Co-ordinate of Maps
@@ -89,7 +89,7 @@ dic_fild01,161,266,4 duplicate(Teleport Cat No.1#1) Teleport Cat No.6#6 4_M_BOSS
//============================================================
ecl_fild01,97,322,0 script #ep14_2Entrance WARPNPC,3,3,{
end;
-
+
OnTouch:
if (ep14_2_oliver < 3) {
mes "[Security Guard]";
@@ -552,7 +552,6 @@ eclage,102,32,4 script Fairy Carpenter#ep14_2 4_M_FAIRYKID2,{
ep14_2_oliver = 4;
setquest 11312;
close;
-
case 3:
mes "[Fairy Carpenter]";
mes "You can't get past here until it's repaired, so please be careful.";
@@ -792,7 +791,6 @@ eclage,102,32,4 script Fairy Carpenter#ep14_2 4_M_FAIRYKID2,{
ep14_2_oliver = 7;
changequest 11314,11315;
close;
-
}
else if (ep14_2_oliver == 7) {
mes "[Carpenter Fon]";
@@ -2312,7 +2310,7 @@ ecl_in01,70,88,4 script Sack Merchant#ep14_2 4_M_MERCAT1,{
eclage,292,265,0 script #ep14_2Yube Entrance WARPNPC,2,2,{
end;
-
+
OnTouch:
if (ep14_2_oliver < 15) {
mes "- Looks like the door is locked. -";
@@ -3326,7 +3324,6 @@ eclage,282,255,4 script Wuhari#eclbig 4_M_FAIRYKID6,{
mes "Oh, no, no. I am sure you are really busy. I'm sorry to have asked such a favor.";
ep14_2_big = 1;
close;
-
case 2:
mes "[" + strcharinfo(PC_NAME) + "]";
mes "Sure. It's not a big deal.";
@@ -4132,10 +4129,9 @@ ecl_in02,149,117,4 script Wuhuru#eclbig 4_M_FAIRYFREAK,{
mes "......";
close;
}
-end;
+ end;
}
-
eclage,200,272,4 script Masione#eclbig 4_F_FAIRYKID2,{
if (checkweight(Knife,1) == 0 || (MaxWeight - Weight)<2000) {
mes "- Stop Here!! -";
@@ -4285,7 +4281,6 @@ eclage,163,228,4 script Goatie#eclbig 4_F_FAIRYKID3,{
}
}
-
eclage,170,195,4 script Svery#eclbig 4_M_FAIRYKID2,{
if (checkweight(Knife,1) == 0 || (MaxWeight - Weight) < 2000) {
mes "- Stop Here!! -";
@@ -4412,7 +4407,6 @@ eclage,170,195,4 script Svery#eclbig 4_M_FAIRYKID2,{
close;
}
-
eclage,126,151,4 script Pompe#eclbig 4_M_FAIRYKID3,{
if (checkweight(Knife,1) == 0 || (MaxWeight - Weight) < 2000) {
mes "- Stop Here!! -";
@@ -4503,7 +4497,6 @@ eclage,126,151,4 script Pompe#eclbig 4_M_FAIRYKID3,{
close;
}
-
ecl_fild01,70,285,4 script Giranni#eclbig 4_F_FAIRY2,{
if (checkweight(Knife,1) == 0 || (MaxWeight - Weight) < 2000) {
mes "- Stop Here!! -";
@@ -4608,7 +4601,7 @@ ecl_fild01,70,285,4 script Giranni#eclbig 4_F_FAIRY2,{
next;
mes "[" + strcharinfo(PC_NAME) + "]";
mes "Hmm? Where did it go? Did I drop it on the way?";
- close;
+ close;
}
mes "- You describe the corpse that you found in the field and show the piece of wing -";
next;
@@ -4701,7 +4694,6 @@ ecl_fild01,70,285,4 script Giranni#eclbig 4_F_FAIRY2,{
close;
}
-
ecl_fild01,269,165,4 script A Laphine corpse#eclbig 4_FAIRYDEADLEAF,{
if (checkweight(Knife,1) == 0 || (MaxWeight - Weight) < 2000) {
mes "- Stop Here!! -";
@@ -4996,8 +4988,7 @@ ecl_in01,50,104,4 duplicate(Choir member#eclbig01) Choir member#eclbig03 4_M_FAI
ecl_in01,52,104,4 duplicate(Choir member#eclbig01) Choir member#eclbig04 4_M_FAIRYKID
ecl_in01,54,104,4 duplicate(Choir member#eclbig01) Choir member#eclbig05 4_M_FAIRYKID
-
-// Mystery Burglary Quest
+// Mystery Burglary Quest
//============================================================
eclage,156,51,6 script #hidden_eclage HIDDEN_NPC,3,3,{
end;
@@ -5037,7 +5028,7 @@ OnTouch:
mes "It's probably nothing.";
mes "I should just go on my way~";
close;
- }
+ }
}
}
@@ -7538,7 +7529,7 @@ ecl_in04,208,194,3 script Daughter Luen#eclage2 4_F_FAIRYKID2,{
mes "I'll think about it more and";
mes "figure out who the robber is...";
close;
- }
+ }
case 2:
mes "[" + strcharinfo(PC_NAME) + "]";
mes "I... I guess";
@@ -7882,7 +7873,7 @@ ecl_in04,208,194,3 script Daughter Luen#eclage2 4_F_FAIRYKID2,{
ep14_2_detect = 10;
break;
}
- break;
+ break;
}
break;
case 6:
@@ -9449,7 +9440,6 @@ ecl_in01,82,79,4 script Magazine#02 HIDDEN_NPC,{
close;
}
-
// Light and Darkness
//============================================================
ecl_in02,98,32,3 script Eclage Guard#tl1b 4_M_FAIRYSOLDIER2,{
@@ -9469,7 +9459,7 @@ ecl_in02,98,32,3 script Eclage Guard#tl1b 4_M_FAIRYSOLDIER2,{
ecl_in02,133,115,0 script #pa0829Prison Guard HIDDEN_WARP_NPC,3,3,{
end;
-
+
OnTouch:
if (ep14_2_etran < 2) {
mes "[Clever]";
@@ -10226,7 +10216,6 @@ ecl_in04,109,215,3 script Hiel#pa0829 4_M_FAIRYSCHOLAR,{
mes "Oh... I guess it was too much to ask for. That's too bad then.";
ep14_2_etran = 12;
close;
-
case 2:
mes "[Hiel]";
mes "Wow wow! Thank you so much! I'll return the favor by operating it together when the experiments are complete! In the meantime, I'll start preparing for material combination!";
@@ -10289,7 +10278,6 @@ ecl_in04,109,215,3 script Hiel#pa0829 4_M_FAIRYSCHOLAR,{
mes "[Hiel]";
mes "How ruthless... Saying that he won't give them after showing them to me.";
close;
-
case 2:
if ((countitem(Dark_Debris)) && (countitem(Yellow_Gemstone) > 1) && (countitem(Red_Gemstone) > 1) && (countitem(Blue_Gemstone) > 1)) {
mes "[Hiel]";
@@ -11572,7 +11560,6 @@ OnTouch:
next;
mes "^000099The reactor was activated, but the dimension does not seem to be related to Etran.^000000";
close;
-
case 2:
mes "[????]";
mes "I... I did it. The restricted area!! Absolute zero ductility!!!!!! And they stole it from me. My gravitational pull of 300 grams.";
@@ -11582,7 +11569,6 @@ OnTouch:
next;
mes "^000099The reactor was activated, but the dimension does not seem to be related to Etran.^000000";
close;
-
case 3:
mes "[????]";
mes "Is this-...(Static static) Is this guy really in the right mind?";
@@ -11619,14 +11605,12 @@ OnTouch:
next;
mes "^000099The reactor was activated, but the dimension does not seem to be related to Etran. It's cold somehow.^000000";
close;
-
case 2:
mes "[????]";
mes "Human!! Human Chicken!!!!!!!!";
next;
mes "^000099The reactor was activated, but the dimension does not seem to be related to Etran. It smells delicious somehow.^000000";
close;
-
case 3:
mes "[????]";
mes "You don't know why I'm upset, do you?";
@@ -11641,7 +11625,7 @@ OnTouch:
close;
}
}
-end;
+ end;
}
ecl_fild01,179,179,0 duplicate(#pa0829Reactor3) #pa0829Reactor8 HIDDEN_WARP_NPC,3,3
@@ -11665,14 +11649,12 @@ OnTouch:
next;
mes "^000099The reactor was activated but... For some reason, I'm getting lonely.^000000";
close;
-
case 2:
mes "[???]";
mes "3..8..12..33...31..The last number is erased...";
next;
mes "^000099How intriguing...^000000";
close;
-
case 3:
mes "[???]";
mes "I'm going insane.";
@@ -11710,14 +11692,12 @@ OnTouch:
next;
mes "^000099The reactor was activated. Somehow it felt like I had to do whatever they said in it.^000000";
close;
-
case 2:
mes "[???]";
mes "3..8..12..33...31..The last number is erased...";
next;
mes "^000099How intriguing...^000000";
close;
-
case 3:
mes "[????]";
mes "Baby, you don't know why I'm upset, do you?";
@@ -11953,14 +11933,12 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
next;
mes "^000099It's been a while since I felt that about myself. Yes, indeed... This machine is getting on my nerves.^000000";
close;
-
case 2:
mes "[???]";
mes "CHTTTTSTATIC~~~~ ANG!?~~ CHTTTTT ~ oh my shoulder!!";
next;
mes "^000099Oh, I'm sorry. I'm going to leave this channel.^000000";
close;
-
case 3:
mes "^000099Etran's sad legend^000000";
next;
@@ -12014,7 +11992,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 4:
mes "^000099What if Etran and Robert were the priosoner and the guard?^000000";
next;
@@ -12032,7 +12009,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 5:
mes "^000099Etran and Robert were put to work as cat merchants.^000000";
next;
@@ -12074,7 +12050,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 6:
mes "^000099Etran and Robert were placed in a Flight machine.^000000";
next;
@@ -12127,7 +12102,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 7:
mes "^000099Iron Chef Robert^000000";
next;
@@ -12159,7 +12133,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 8:
mes "^000099Robert actually likes beer.^000000";
next;
@@ -12206,7 +12179,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 9:
mes "^000099Robert the cook^000000";
next;
@@ -12244,7 +12216,6 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 10:
mes "^000099Childhood friends, Etran and Robert^000000";
next;
@@ -12292,19 +12263,16 @@ ecl_in04,105,216,4 script Hiel's Workshop#pa0829 HIDDEN_NPC,{
close2;
cutin "",255;
end;
-
case 11:
mes "^000099In boiling water~ 3 minutes~ ... Static static^000000";
next;
mes "^0000993 minutes in boiling water... What after that. Does it mean it will die 3 minutes in boiling water? Do I pour the boiling water over a monster or something?^000000";
close;
-
case 12:
mes "^000099Houston~ Houston~ This is CHTTTCHTTT~ We see a large tower and a tree. It seems like there are life forms here on this planet as well~ STATIC~ ^000000";
next;
mes "^000099Some desperate voices are heard. Not sure what the words, planets and life forms, are referring to.^000000";
close;
-
default:
mes "^000099There's too much static. Try adjusting the frequency. ^000000";
close;
@@ -12336,18 +12304,15 @@ ecl_fild01,190,93,5 script Fili#1 4_M_FAIRYANG,1,1,{
mes "[Fili]";
mes "What is Eclage like? It's such a nice place.";
close;
-
case 2:
mes "[Fili]";
mes "People wouldn't hate or hold each other at knife point if their hearts are filled with love for flowers and the earth.";
close;
-
case 3:
mes "[Fili]";
mes "You should avoid going into the tower. It's dangerous. We can't do much for the ones who have already entered, though.";
close;
}
-
case 2:
if (questprogress(13059,PLAYTIME) == 2) {
mes "[Fili]";
@@ -12365,7 +12330,7 @@ ecl_fild01,190,93,5 script Fili#1 4_M_FAIRYANG,1,1,{
mes "[Fili]";
mes "There are four in the work group. Don't forget to tell everyone.";
close;
- }
+ }
mes "[Fili]";
mes "Thanks. Can you hear the earth singing? The sound of flowers and trees dancing in the wind. You'll hear it someday.";
emotion e_lv;
@@ -12544,7 +12509,7 @@ ecl_fild01,190,93,5 script Fili#1 4_M_FAIRYANG,1,1,{
mes "[Fili]";
mes "I think their work for the field is finished for the day. By the way, ^FF0000there's another work. Ask about it if you're interested.^000000";
erasequest 13050;
- ep14_2_nines = 2;
+ ep14_2_nines = 2;
getitem Splendide_Coin,1; //Splendide_Coin
getexp 300000,300000;
close;
@@ -12588,7 +12553,7 @@ ecl_fild01,190,93,5 script Fili#1 4_M_FAIRYANG,1,1,{
close2;
}
}
- }
+ }
if (ep14_2_oliver > 4) {
mes "[Fili]";
mes "Look at this beautiful field filled with little blades of grass and twigs breathing!";
@@ -12677,7 +12642,7 @@ ecl_fild01,83,263,5 script Watering Laphine#1 4_M_FAIRYKID3,{
mes "I think this is enough for the day. I have to take a break and draw water, too. Hehe~!";
close;
}
- else if ((questprogress(13050) == 1) && (questprogress(13052) == 1)) {
+ else if ((questprogress(13050) == 1) && (questprogress(13052) == 1)) {
mes "[Watering Laphine]";
mes "I'll water these dying flowers and grasses again. This brings them back to life! Hehe~!";
erasequest 13052;
@@ -12691,7 +12656,6 @@ ecl_fild01,83,263,5 script Watering Laphine#1 4_M_FAIRYKID3,{
mes "[Watering Laphine]";
mes "I'm sure Eclage needs a Laphine like me! Hehe~!";
close;
-
}
else if (ep14_2_nines == 1){
if ((questprogress(13050) == 1) && (questprogress(13052) == 1)) {
@@ -12708,7 +12672,6 @@ ecl_fild01,83,263,5 script Watering Laphine#1 4_M_FAIRYKID3,{
mes "[Watering Laphine]";
mes "Hehe~! Now that I'm done watering, I should wait for the great Fili.";
close;
-
}
mes "[Watering Laphine]";
mes "It's my job to water the earth.";
@@ -12727,7 +12690,7 @@ ecl_fild01,163,196,5 script Dancing Laphine#1 4_F_FAIRYKID3,{
mes "I would love to see the great Fili next time...";
close;
}
- if ((questprogress(13050) == 1) && (questprogress(13053) == 1)) {
+ if ((questprogress(13050) == 1) && (questprogress(13053) == 1)) {
mes "[Dancing Laphine]";
mes "Ah, it's you again! You're so insensitive. Anyway, you're here to tell me to start working, right? I see, I see. You can go now.";
emotion e_pif;
@@ -12860,13 +12823,13 @@ ecl_fild01,237,181,5 script Cute Laphine#1 4_M_FAIRYKID5,{
ecl_tdun02,99,63,5 script Rosi#No.1 4_F_HUWOMAN,1,1,{
end;
-
+
OnInit:
if (atoi( charat( strnpcinfo(0), getstrlen(strnpcinfo(0))-1 ) ) > 1){
disablenpc strnpcinfo(0);
}
end;
-
+
OnTouch:
if (ep14_2_nines < 2) {
mes "[Rosi]";
@@ -12902,7 +12865,6 @@ OnTouch:
mes "[Rosi]";
mes "This tower is very quiet yet mysterious. It's definitely something that adventurers would love, right?";
close;
-
}
else if (ep14_2_nines == 2) {
if ((questprogress(13055) == 1) && (questprogress(13056) == 1)) {
@@ -12952,7 +12914,7 @@ ecl_tdun02,22,36,5 duplicate(Rosi#No.1) Rosi#No.3 4_F_HUWOMAN,1,1
ecl_tdun01,11,62,5 script Euncheong#No.1 4_M_HUBOY,1,1,{
end;
-
+
OnInit:
if (atoi( charat( strnpcinfo(0), getstrlen(strnpcinfo(0))-1 ) ) > 1){
disablenpc strnpcinfo(0);
@@ -13125,7 +13087,6 @@ ecl_tdun03,68,80,3 script New Oz#1 4_M_NEWOZ,1,1,{
close2;
cutin "",255;
end;
-
case 2:
if (questprogress(13062,PLAYTIME) == 1) {
cutin "nines02",2;
@@ -13218,7 +13179,6 @@ ecl_tdun03,68,80,3 script New Oz#1 4_M_NEWOZ,1,1,{
close2;
cutin "",255;
end;
-
case 3:
if (questprogress(13064,PLAYTIME) == 1) {
cutin "nines02",2;
@@ -13285,7 +13245,6 @@ ecl_tdun03,68,80,3 script New Oz#1 4_M_NEWOZ,1,1,{
close2;
cutin "",255;
end;
-
case 4:
if (questprogress(13066,PLAYTIME) == 1) {
cutin "nines03",2;
@@ -13411,7 +13370,7 @@ ecl_tdun03,68,80,3 script New Oz#1 4_M_NEWOZ,1,1,{
close2;
cutin "",255;
end;
- }
+ }
cutin "nines03",2;
mes "[New Oz]";
mes "Don't worry. I'm pretty much done writing a song. I'm almost done with the lyrics as well as the melody.";
@@ -13421,7 +13380,6 @@ ecl_tdun03,68,80,3 script New Oz#1 4_M_NEWOZ,1,1,{
close2;
cutin "",255;
end;
-
}
cutin "nines02",2;
mes "[New Oz]";
@@ -14126,7 +14084,7 @@ ecl_tdun04,26,39,1 script Professor Worm#worm 4_M_PROFESSORWORM,{
ecl_tdun04,21,41,0 script #pf HIDDEN_WARP_NPC,2,2,{
end;
-
+
OnTouch:
.@pro = rand(1,100);
if (ep14_2_profe == 1) {
@@ -14209,7 +14167,6 @@ OnTouch:
mes "But why do I have to remain in a place like this, too?";
close;
}
-
}
ecl_tdun04,35,31,0 script #prf2 HIDDEN_WARP_NPC,2,2,{
@@ -14251,7 +14208,6 @@ OnTouch:
mes "I wonder if I'll forget even my name... How it worries me...";
close;
}
-
}
ecl_tdun04,28,43,0 script #prf3 HIDDEN_WARP_NPC,2,2,{
@@ -14378,7 +14334,7 @@ OnTouch:
next;
mes "[Wall Note 5]";
mes "Monsters, I have to create more monsters to protect me. As many as I could possibly create!";
- close;
+ close;
}
}
@@ -14608,7 +14564,7 @@ ecl_fild01,173,95,7 script Diary Frog No. 30#worm 4_FROG,{
mes "If you come back to late, all you'll hear are my moans and groans.";
changequest 1226,1227;
ep14_2_profe = 10;
- close;
+ close;
}
else if (ep14_2_profe == 10) {
if (countitem(Star_Shape_Mushroom) < 10) {
@@ -14672,7 +14628,7 @@ ecl_fild01,173,95,7 script Diary Frog No. 30#worm 4_FROG,{
mes "I'm so mad, I oughta throw this out!";
next;
mes "It seems that a continued search for diary recordings would be meaningless. I should go back to Professor Worm.";
- close;
+ close;
}
}
@@ -14797,7 +14753,6 @@ ecl_in01,32,52,5 script Traveler Fome#tl01 4_F_DOGTRAVELER,3,3,{
mes "Let's talk to other travelers.";
setquest 7411;
break;
-
case 2:
mes "[Fome]";
mes "The main attraction of Eclage?";
@@ -14855,7 +14810,6 @@ ecl_in01,32,52,5 script Traveler Fome#tl01 4_F_DOGTRAVELER,3,3,{
hideonnpc "Eclage Guard#tl01";
warp "ecl_in03",244,89;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Oh, is that right?";
@@ -14875,7 +14829,6 @@ ecl_in01,32,52,5 script Traveler Fome#tl01 4_F_DOGTRAVELER,3,3,{
cutin "",255;
hideonnpc "Eclage Guard#tl01";
end;
-
}
}
mes "[Fome]";
@@ -14948,7 +14901,6 @@ ecl_in01,32,52,5 script Traveler Fome#tl01 4_F_DOGTRAVELER,3,3,{
mes "What Fome said is interesting.";
mes "A distrusted king...should I listen to what other Laphines say about it?";
close;
-
}
mes "[Fome]";
mes "I'm sure there is something.";
@@ -14959,7 +14911,7 @@ ecl_in01,32,52,5 script Traveler Fome#tl01 4_F_DOGTRAVELER,3,3,{
mes "I should start planning on moving to the next region. ";
mes "I'm debating whether I should just go back or go to Mora Village...";
close;
-
+
OnTouch:
if (ep14_2_mylord == 0 && BaseLevel > 98) {
mes "A group of travelers of Alpheim are having a conversation.";
@@ -14971,7 +14923,6 @@ OnTouch:
case 1:
mes "They don't seem to care that much.";
close;
-
case 2:
mes "When you approach, they stop talking for a second and make a seat for you.";
mes "Start a conversation.";
@@ -15081,7 +15032,6 @@ ecl_in01,32,51,7 script Traveler Litrip#tl02 4_M_DOGTRAVELER,{
cutin "",255;
warp "ecl_in03",244,89;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Oh, is that right?";
@@ -15101,7 +15051,6 @@ ecl_in01,32,51,7 script Traveler Litrip#tl02 4_M_DOGTRAVELER,{
hideonnpc "Eclage Guard#tl01";
cutin "",255;
end;
-
}
}
mes "[Litrip]";
@@ -15270,7 +15219,6 @@ ecl_in01,35,51,3 script Traveler Chiba#tl03 4_M_DOGTRAVELER2,{
warp "ecl_in03",244,89;
cutin "",255;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Oh, is that right?";
@@ -15290,7 +15238,6 @@ ecl_in01,35,51,3 script Traveler Chiba#tl03 4_M_DOGTRAVELER2,{
hideonnpc "Eclage Guard#tl01";
cutin "",255;
end;
-
}
}
mes "[Chiba]";
@@ -15338,11 +15285,11 @@ ecl_in01,31,49,7 script Eclage Guard#tl01 4_M_FAIRYSOLDIER,{
OnInit:
hideonnpc "Eclage Guard#tl01";
end;
-
+
OnEnable:
hideoffnpc "Eclage Guard#tl01";
end;
-
+
OnDisable:
hideonnpc "Eclage Guard#tl01";
end;
@@ -15375,7 +15322,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
cutin "",255;
warp "ecl_in03",244,89;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Ah...is that right?";
@@ -15404,7 +15350,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
warp "ecl_in03",244,89;
cutin "",255;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Is that right?";
@@ -15439,7 +15384,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
warp "ecl_in03",58,72;
cutin "",255;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Do as you wish although Mayor Jun might be upset if you keep him waiting for too long.";
@@ -15460,7 +15404,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
warp "ecl_in03",58,72;
cutin "",255;
end;
-
case 2:
mes "[Eclage Guard]";
mes "Thank you.";
@@ -15496,7 +15439,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
mes "Well, I understand.";
cutin "minuel01",2;
break;
-
case 2:
mes "[Minuel]";
mes "Actually I don't have any time for myself since I have to be here all the time.";
@@ -15531,7 +15473,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
mes "I'll be counting on you!";
setquest 7418;
break;
-
case 2:
mes "[Minuel]";
mes "Ha, do you really think so?";
@@ -15539,7 +15480,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
mes "Soon, in the near future. Hehehe";
cutin "minuel02",2;
break;
-
}
close2;
cutin "",255;
@@ -15731,7 +15671,6 @@ ecl_in01,82,70,3 script Eclage Guard#tl02 4_M_FAIRYSOLDIER,{
mes "That's too bad.";
mes "Maybe next time!";
break;
-
case 2:
mes "[Minuel]";
mes "Thank you so much.";
@@ -16041,7 +15980,6 @@ ecl_in03,245,93,3 script Chief of Staff#tl01 4_F_FAIRY,{
mes "A scholar of magics? There's no one with that name among the scholars I know. ";
mes "I don't know.";
close;
-
}
else if ((ep14_2_mylord > 17) && (ep14_2_mylord < 22)) {
mes "[Shenime]";
@@ -16232,7 +16170,6 @@ ecl_in03,245,93,3 script Chief of Staff#tl01 4_F_FAIRY,{
ep14_2_mylord = 26;
changequest 7445,7447;
close;
-
}
else if (ep14_2_mylord == 26) {
mes "[Shenime]";
@@ -16308,7 +16245,6 @@ ecl_in03,245,93,3 script Chief of Staff#tl01 4_F_FAIRY,{
ep14_2_mylord = 28;
changequest 7448,7449;
close;
-
case 2:
mes "When you held Shenime's hand, you felt a sharp pain in your hand.";
mes "You took your hand off quickly and examined it, but nothing was there.";
@@ -16323,7 +16259,6 @@ ecl_in03,245,93,3 script Chief of Staff#tl01 4_F_FAIRY,{
close2;
warp "ecl_hub01",129,12;
end;
-
}
}
else if (ep14_2_mylord == 28) {
@@ -16336,7 +16271,6 @@ ecl_in03,245,93,3 script Chief of Staff#tl01 4_F_FAIRY,{
mes "Shouldn't you, a foreigner, consider it as an honor and receive the offer?";
mes "You're hesitating too much.";
close;
-
case 2:
mes "When you held Shenime's hand, you felt a sharp pain in your hand.";
mes "You took your hand off quickly and examined it, but nothing was there.";
@@ -17993,7 +17927,6 @@ eclage,112,40,3 script Eclage Guard Leo#tl 4_M_FAIRYSOLDIER2,{
mes ".........isn't it depressing.";
close;
}
-
}
ecl_fild01,205,86,3 script Eclage Messenger Roy#tl 4_M_FAIRYSOLDIER2,{
@@ -18825,7 +18758,6 @@ ecl_tdun04,32,35,3 script Hisie#tlord 4_M_FARIY_HISIE,{
mes "I need to see what Avant is researching about.";
mes "Let's hurry.";
close2;
-
}
else if ((ep14_2_mylord == 22) || (ep14_2_mylord == 23)) {
cutin "hisie03",0;
@@ -19119,18 +19051,18 @@ OnTouch:
close2;
cutin "",255;
end;
-
+
OnStop:
stopnpctimer;
end;
OnTimer5000:
- mapannounce "que_avan01","Welcome, Sir Avant. User certification standby for 5 minutes.",bc_map,"0xA8A8A8";
+ mapannounce "que_avan01","Welcome, Sir Avant. User certification standby for 5 minutes.",bc_map,"0xA8A8A8";
end;
OnTimer360000:
- mapannounce "que_avan01","Warning: Long-term use was not certified. Restrictive magic on unauthorized personnel will automatically be executed.",bc_map,"0xA8A8A8";
+ mapannounce "que_avan01","Warning: Long-term use was not certified. Restrictive magic on unauthorized personnel will automatically be executed.",bc_map,"0xA8A8A8";
end;
OnTimer365000:
- mapannounce "que_avan01","Research lab interior space has been distorted. Sweeping in process.",bc_map,"0x7b68ee";
+ mapannounce "que_avan01","Research lab interior space has been distorted. Sweeping in process.",bc_map,"0x7b68ee";
end;
OnTimer368000:
mapwarp "que_avan01","eclage",265,275;
@@ -19383,7 +19315,7 @@ OnEnable:
monster "que_avan01",29,36,"DARK_PRIEST",DARK_PRIEST,1;
monster "que_avan01",29,32,"DARK_PRIEST",DARK_PRIEST,1;
end;
-
+
OnReset:
mapwarp "que_avan01","eclage",265,275;
killmonster "que_avan01","#avtmanager::OnMyMobDead";
@@ -19399,10 +19331,10 @@ OnReset:
hideoffnpc "#tltimer";
$111204_avantlabo = 0;
end;
-
+
OnMyMobDead:
if (mobcount ("que_avan01","#avtmanager::OnMyMobDead") == 0) {
- mapannounce "que_avan01","Hisie: This is it for you! Avant!!",bc_map,"0x7b68ee";
+ mapannounce "que_avan01","Hisie: This is it for you! Avant!!",bc_map,"0x7b68ee";
hideonnpc "Hisie#tlspt";
hideoffnpc "Hisie#tlhunt";
}
@@ -19420,20 +19352,20 @@ que_avan01,26,41,3 script Avant Magic Scholar#tlac 4_M_FAIRYAVANT,{
initnpctimer;
monster "que_avan01",26,38,"HIDDEN_MOB",HIDDEN_MOB,1;
end;
-
+
OnInit:
hideonnpc "Avant Magic Scholar#tlac";
end;
-
+
OnKill:
killmonster "que_avan01","Avant Magic Scholar#tlac::OnMyMobDead";
stopnpctimer;
end;
-
+
OnTimer2000:
- mapannounce "que_avan01","Hisie: Watch out!!!",bc_map,"0x7b68ee";
+ mapannounce "que_avan01","Hisie: Watch out!!!",bc_map,"0x7b68ee";
end;
-
+
OnTimer8000:
killmonster "que_avan01","Avant Magic Scholar#tlac::OnMyMobDead";
stopnpctimer;
diff --git a/npc/re/quests/quests_malangdo.txt b/npc/re/quests/quests_malangdo.txt
index 4cd3ec886..2f13ad618 100644
--- a/npc/re/quests/quests_malangdo.txt
+++ b/npc/re/quests/quests_malangdo.txt
@@ -4612,7 +4612,7 @@ mal_in02,187,58,3 script Chef Nyas 4_CAT_CHEF,{
setquest 7276;
mal_food = 0;
erasequest 7280+.@i;
-
+
// Quantities grouped in 10s repeating.
// [ 3, 3, 6, 6, 9, 9, 12, 12, 15, 18 ]
// Last group [ 61 - 66 ] receives 25 constant.
diff --git a/npc/re/quests/quests_malaya.txt b/npc/re/quests/quests_malaya.txt
index e67a827e9..925f28507 100644
--- a/npc/re/quests/quests_malaya.txt
+++ b/npc/re/quests/quests_malaya.txt
@@ -3165,7 +3165,7 @@ ma_fild01,251,93,3 script Lost Child#malaya01 4_F_BARYO_GIRL,{
}
}
end;
-
+
OnInit:
if (strnpcinfo(0) != "Lost Child#malaya01")
disablenpc strnpcinfo(0);
@@ -3770,7 +3770,7 @@ ma_fild01,158,243,6 script Tribe Blacksmith#malaya 4_M_MALAYA,{
.@newItem = 2492;
break;
}
-
+
if (!(.@item)) {
mes "[Bayani]";
mes "You should wear the equipment to upgrade and not come without it on you.";
@@ -3817,11 +3817,11 @@ ma_fild01,158,243,6 script Tribe Blacksmith#malaya 4_M_MALAYA,{
mes "[Bayani]";
mes "BAM!!";
next;
-
+
delitem 6499,20; //Ancient_Grudge
delequip .@part;
getitem .@newItem, 1;
-
+
mes "[Bayani]";
mes "Ha ha. Perfect.";
mes "Congratulations. Your armor is better than ever.";
diff --git a/npc/re/scripts_jobs.conf b/npc/re/scripts_jobs.conf
index 0bd34bd50..1defcdc54 100644
--- a/npc/re/scripts_jobs.conf
+++ b/npc/re/scripts_jobs.conf
@@ -28,7 +28,8 @@ npc: npc/re/jobs/3-2/sorcerer.txt
npc: npc/re/jobs/3-2/sura.txt
npc: npc/re/jobs/3-2/wanderer.txt
// - Novice
-npc: npc/re/jobs/novice/novice.txt
+npc: npc/re/jobs/novice/academy.txt
+// npc: npc/re/jobs/novice/novice.txt
npc: npc/re/jobs/novice/supernovice_ex.txt
// - Job Repairs
npc: npc/re/jobs/repair.txt
diff --git a/npc/re/warps/cities/izlude.txt b/npc/re/warps/cities/izlude.txt
index 8bf26e31d..a061aab27 100644
--- a/npc/re/warps/cities/izlude.txt
+++ b/npc/re/warps/cities/izlude.txt
@@ -58,6 +58,21 @@ iz_ac01,78,25,0 warp #to_ac2f01 2,2,iz_ac02,104,27
iz_ac01,122,25,0 warp #to_ac2f02 2,2,iz_ac02,104,27
iz_ac02,94,27,0 warp #to_ac1f01 2,2,iz_ac01,78,28
iz_ac02,113,27,0 warp #to_ac1f02 2,2,iz_ac01,122,28
+new_1-3,96,176,0 warp #to_ac01-2 1,1,iz_ac01,49,73
+
+iz_int,96,73,0 script iz_int_iz WARPNPC,2,2,{
+ end;
+
+ OnTouch:
+ savepoint "izlude", 128, 98;
+ warp "izlude"+strnpcinfo(2)+"", 195, 209;
+ end;
+}
+
+iz_int01,96,73,0 duplicate(iz_int_iz) iz_int_iz#_a WARPNPC,2,2
+iz_int02,96,73,0 duplicate(iz_int_iz) iz_int_iz#_b WARPNPC,2,2
+iz_int03,96,73,0 duplicate(iz_int_iz) iz_int_iz#_c WARPNPC,2,2
+iz_int04,96,73,0 duplicate(iz_int_iz) iz_int_iz#_d WARPNPC,2,2
//= Izlude Academy Duplicates ================================
izlude_a,125,257,0 warp #to_ac01_a 2,2,iz_ac01_a,99,29
diff --git a/npc/re/warps/dungeons/ecl_dun.txt b/npc/re/warps/dungeons/ecl_dun.txt
index e0677c3a9..24f6c6cf0 100644
--- a/npc/re/warps/dungeons/ecl_dun.txt
+++ b/npc/re/warps/dungeons/ecl_dun.txt
@@ -8,7 +8,7 @@
//= Warp Portals for Eclage Dungeon
//===== Additional Comments: =================================
//= 1.0 First Version.
-//= 1.0a Corrected Warp Co-ordinates and
+//= 1.0a Corrected Warp Co-ordinates and
//= name of Warp Portal. [Dastgir]
//============================================================
diff --git a/npc/scripts_jobs.conf b/npc/scripts_jobs.conf
index ad6ea3d73..500f69f63 100644
--- a/npc/scripts_jobs.conf
+++ b/npc/scripts_jobs.conf
@@ -47,8 +47,6 @@ npc: npc/jobs/novice/supernovice.txt
npc: npc/jobs/valkyrie.txt
// ------------------------ Skill Quests ------------------------
-// - Novice
-npc: npc/quests/skills/novice_skills.txt
// - 1-1
npc: npc/quests/skills/acolyte_skills.txt
npc: npc/quests/skills/archer_skills.txt
diff --git a/npc/warps/cities/einbroch.txt b/npc/warps/cities/einbroch.txt
index bbb562a95..c05940360 100644
--- a/npc/warps/cities/einbroch.txt
+++ b/npc/warps/cities/einbroch.txt
@@ -22,7 +22,6 @@ ein_in01,13,213,0 warp ein_fa01a 1,1,einbroch,129,79
ein_in01,81,198,0 warp ein_fa02 1,1,einbroch,179,70
einbroch,179,73,0 warp ein_fa02a 1,1,ein_in01,81,203
-
//==========================================================================
//Einbroch - Near Train station
//==========================================================================
@@ -31,14 +30,12 @@ einbroch,233,312,0 warp ein_to01a 1,1,einbroch,214,260
einbroch,250,263,0 warp ein_to02 1,1,einbroch,269,315
einbroch,269,312,0 warp ein_to02a 1,1,einbroch,250,260
-
//==========================================================================
//Einbroch - Weapon shop
//==========================================================================
einbroch,216,214,0 warp ein_wp01 1,1,ein_in01,108,17
ein_in01,108,13,0 warp ein_wp01a 1,1,einbroch,216,211
-
//=========================================================================
//Einbroch - Hotel
//=========================================================================
@@ -59,7 +56,6 @@ ein_in01,232,176,0 warp ein_h07a 1,1,ein_in01,264,206
ein_in01,284,224,0 warp ein_h08 1,1,ein_in01,177,277
ein_in01,180,277,0 warp ein_h08a 1,1,ein_in01,280,224
-
//==========================================================================
//Einbroch - Building behind the hotel
//==========================================================================
@@ -70,20 +66,17 @@ ein_in01,100,142,0 warp ein_ho02a 1,1,ein_in01,123,85
einbroch,290,222,0 warp ein_ho03 1,1,ein_in01,121,80
ein_in01,121,77,0 warp ein_ho03a 1,1,einbroch,290,219
-
//==========================================================================
//Einbroch - House of Kapetain
//==========================================================================
einbroch,129,229,0 warp ein_kf01 1,1,ein_in01,14,147
ein_in01,11,147,0 warp ein_kf01a 1,1,einbroch,126,229
-
//=========================================================================
//Einbroch - Lab
//=========================================================================
ein_in01,286,25,0 warp ein_lab 1,1,einbroch,54,52
-
//=========================================================================
//Einbroch - Blacksmith guild
//=========================================================================
@@ -92,7 +85,6 @@ ein_in01,14,14,0 warp ein_jb01a 1,1,einbroch,255,110
ein_in01,39,36,0 warp ein_jb02 1,1,ein_in01,35,83
ein_in01,39,85,0 warp ein_jb02a 1,1,ein_in01,36,36
-
//==========================================================================
//Einbroch - Field related
//==========================================================================
@@ -100,4 +92,3 @@ einbroch,157,331,0 warp ein_fd01 1,1,ein_fild04,184,31
ein_fild04,184,26,0 warp ein_fd01a 1,1,einbroch,157,327
einbroch,150,25,0 warp ein_fd02 1,1,ein_fild08,164,377
ein_fild08,164,380,0 warp ein_fd02a 1,1,einbroch,150,28
-
diff --git a/npc/warps/cities/gonryun.txt b/npc/warps/cities/gonryun.txt
index 1f74e02f5..b4e831dda 100644
--- a/npc/warps/cities/gonryun.txt
+++ b/npc/warps/cities/gonryun.txt
@@ -29,5 +29,3 @@ gon_in,42,35,0 warp gon_castle2-1 1,1,gon_in,34,97
gon_in,31,97,0 warp gon_castle2-2 1,1,gon_in,39,35
gonryun,161,8,0 warp gon_fild1-1 1,1,gon_fild01,191,261
gon_fild01,192,265,0 warp gon_fild1-2 1,1,gonryun,161,11
-
-
diff --git a/npc/warps/cities/mid_camp.txt b/npc/warps/cities/mid_camp.txt
index b1e26b0ae..b6da7046a 100644
--- a/npc/warps/cities/mid_camp.txt
+++ b/npc/warps/cities/mid_camp.txt
@@ -42,4 +42,3 @@ mid_camp,266,260,0 warp mid_house1-1 1,1,mid_campin,284,124
mid_campin,282,124,0 warp mid_house1-2 1,1,mid_camp,263,260
mid_camp,163,231,0 warp mid_house2-1 1,1,mid_campin,376,133
mid_campin,376,136,0 warp mid_house2-2 1,1,mid_camp,163,234
-
diff --git a/npc/warps/cities/prontera.txt b/npc/warps/cities/prontera.txt
index 7327b2901..2e446ec97 100644
--- a/npc/warps/cities/prontera.txt
+++ b/npc/warps/cities/prontera.txt
@@ -73,8 +73,6 @@ prt_church,168,19,0 warp prtch01-1 1,2,prt_church,105,81
prt_church,31,19,0 warp prtch02 1,2,prt_church,94,81
prt_church,90,81,0 warp prtch02-1 1,2,prt_church,27,19
-
-
//= Prontera Castle ===========================================
prt_castle,102,129,0 warp prtca01 3,2,prt_castle,102,143
prt_castle,102,140,0 warp prtca01-1 3,2,prt_castle,102,126
diff --git a/npc/warps/dungeons/lhz_dun.txt b/npc/warps/dungeons/lhz_dun.txt
index b77b0d2ef..5ed05bd7c 100644
--- a/npc/warps/dungeons/lhz_dun.txt
+++ b/npc/warps/dungeons/lhz_dun.txt
@@ -201,7 +201,7 @@ lhz_cube,123,26,0 script cubew09-4 WARPNPC,1,1,{
callfunc "randomw";
end;
}
-
+
//----- Function for Random Warps ----------------------------
function script randomw {
switch(rand(3)) {
diff --git a/npc/warps/dungeons/mosk_dun.txt b/npc/warps/dungeons/mosk_dun.txt
index 7543b5a9b..b4b83e1bf 100644
--- a/npc/warps/dungeons/mosk_dun.txt
+++ b/npc/warps/dungeons/mosk_dun.txt
@@ -121,7 +121,7 @@ mosk_dun02,53,215,3 script Soldier1#mos 4_M_RUSKNIGHT,{
mes "We're called out for emergencies,";
mes "don't disturb us anymore.";
close;
-
+
OnInit:
hideonnpc "Soldier1#mos";
end;
@@ -137,7 +137,7 @@ mosk_dun02,50,217,3 script Soldier2#mos 4_M_RUSKNIGHT,{
mes "We're called out for emergencies,";
mes "don't disturb us anymore.";
close;
-
+
OnInit:
hideonnpc "Soldier2#mos";
end;
@@ -147,14 +147,13 @@ OnEnable:
end;
}
-
mosk_dun02,56,217,5 script Soldier3#mos 4_M_RUSKNIGHT,{
mes "[Soldier]";
mes "We're the Csar's soldiers.";
mes "We're called out for emergencies,";
mes "don't disturb us anymore.";
close;
-
+
OnInit:
hideonnpc "Soldier3#mos";
end;
diff --git a/npc/warps/pvp.txt b/npc/warps/pvp.txt
index c8276ce23..61f233910 100644
--- a/npc/warps/pvp.txt
+++ b/npc/warps/pvp.txt
@@ -171,4 +171,3 @@ pvp_n_8-4,150,71,0 warp Link#pt_link_1-41 1,1,pvp_n_8-4,0,0
pvp_n_8-4,144,166,0 warp Link#pt_link_1-42 1,1,pvp_n_8-4,0,0
// Invalid Warp
//pvp_n_8-5,30,30,0 warp a 3,3,pvp_n_8-5,100,100
-
diff --git a/npc/woe-fe/agit_main.txt b/npc/woe-fe/agit_main.txt
index 6f4130962..36fb453fa 100644
--- a/npc/woe-fe/agit_main.txt
+++ b/npc/woe-fe/agit_main.txt
@@ -1130,9 +1130,9 @@ OnGuardianDied:
OnClock0001:
// Do nothing if this script is the template.
if (strnpcinfo(1) == "Gld_Trea_Spawn") end;
-
+
.@GID = getcastledata(strnpcinfo(2),1);
-
+
// If there is no owner, do nothing.
if (!.@GID) end;
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index 11d7c4b12..191d930ba 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -4315,7 +4315,7 @@ REPLACE INTO `item_db` VALUES ('6583','3rd_Test_Pass','3rd Test Pass','3','0','0
REPLACE INTO `item_db` VALUES ('6584','Guarantee_Weapon_12Up','Safe to 12 Weapon Certificate','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6585','Guarantee_Armor_12Up','Safe to 12 Armor Certificate','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6586','Captured_Book','Captured Book','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('6593','Cryptura_Hair_Coupon','Kuritura Hairstyle Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('6593','Criatura_Hair_Coupon','Criatura Hair Coupon','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6606','P_Cart_C','P Cart C','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6607','Temporal_Crystal','Temporal Crystal','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('6608','Coagulated_Spell','Coagulated Spell','3','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -5450,6 +5450,7 @@ REPLACE INTO `item_db` VALUES ('11055','Basic_Adventure','Basic Adventure','3','
REPLACE INTO `item_db` VALUES ('11056','Spiritualism_Guide','Spiritualism Guide','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('11057','Feb_Sweets','February Sweets','3','20','10','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('11058','Novice_Combi_Book','Beginner Item Book','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('11060','Energy_Xtal_Combi_Book','Energy Crystal Book','3','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('11500','Light_Yellow_Pot','Light Yellow Potion','0','550','275','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemheal rand(175,235),0;','','');
REPLACE INTO `item_db` VALUES ('11501','Light_White_Pot','Light White Potion','0','1200','600','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemheal rand(325,405),0;','','');
REPLACE INTO `item_db` VALUES ('11502','Light_Blue_Pot','Light Blue Potion','0','5000','2500','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','itemheal 0,rand(40,60);','','');
@@ -6313,6 +6314,9 @@ REPLACE INTO `item_db` VALUES ('12814','Slapping_Herb','Sadagui','11','0','0','1
REPLACE INTO `item_db` VALUES ('12815','Yggdrasil_Dust','Sequoia Dust','11','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','itemskill ECL_SEQUOIADUST,1;','','');
REPLACE INTO `item_db` VALUES ('12818','High_Weapon_Box_','Advanced Weapons Box','2','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','100',NULL,'0','0','0','0','0','0','507',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12831','Potion_Box','Potion Box','2','0','0','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','getitem 545,100; getitem 546,100; getitem 547,100; getitem 505,100;','','');
+REPLACE INTO `item_db` VALUES ('12845','Amatsu_Butterfly_Wing','Amatsu Butterfly Wing','3','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
+REPLACE INTO `item_db` VALUES ('12846','Little_Unripe_Apple','Little Unripe Apple','2','10','5','50','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'1',NULL,'0',NULL,'0','pet 2398;','','');
+REPLACE INTO `item_db` VALUES ('12847','Old_Equipment_Box','Old Equipment Box','0','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','475',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12848','Falcon_Flute','Falcon Flute','11','0','0','0','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','if(getskilllv(HT_FALCON)) { if(checkoption(Option_Wug)||checkoption(Option_Wugrider)) end; if(checkfalcon()==1) { setfalcon 0; } else { setfalcon 1; } }','','');
REPLACE INTO `item_db` VALUES ('12849','Combination_Kit','Union Kit','2','0','0','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('12850','Heaven_Scroll','Heaven Scroll','11','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
@@ -8344,7 +8348,7 @@ REPLACE INTO `item_db` VALUES ('18726','Skymet','Skymet','5','1000','500','10','
REPLACE INTO `item_db` VALUES ('18727','Sedora_Hat','Sedora Hat','5','20','10','300','0','0','13','0','1','4294967295','63','2','256','0','10',NULL,'1','869','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18728','Egir_Helm','Aegir Helm','5','200000','100000','800','0','0','10','0','1','4294967295','63','2','256','0','110',NULL,'1','870','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMdef,5; bonus bUnbreakableHelm,0;','','');
REPLACE INTO `item_db` VALUES ('18729','MVP_Basketball','MVP Basketball Hat','5','20','10','150','0','0','6','0','1','4294967295','63','2','256','0','0',NULL,'1','871','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus2 bSubRace,RC_DemiPlayer,10; bonus2 bAddItemHealRate,522,30; bonus bVariableCastrate,-3; if(getrefine()>=12) { bonus bVariableCastrate,-1; } if(getrefine()>=14) { bonus bVariableCastrate,-1; }','','');
-REPLACE INTO `item_db` VALUES ('18730','Cryptura_Academy_Hat','Criatura Hat','5','100','50','200','0','0','2','0','1','4294967295','63','2','256','0','0',NULL,'1','872','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,5; bonus bMaxHP,15;','','');
+REPLACE INTO `item_db` VALUES ('18730','Criatura_Academy_Hat','Criatura Hat','5','100','50','200','0','0','2','0','1','4294967295','63','2','256','0','0',NULL,'1','872','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','bonus bMaxSP,5; bonus bMaxHP,15;','','');
REPLACE INTO `item_db` VALUES ('18731','Valkyrie_Headgear','Valkyrie Helm','5','1000','500','0','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','225','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18732','TE_WoE_Cap','TE WoE Cap','5','0','0','0','0','0','5','0','0','4294967295','63','2','256','0','0',NULL,'0','14','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('18733','TE_WoE_Bone_Helm','TE WoE Bone Helm','5','0','0','0','0','0','10','0','0','279714','63','2','256','0','0',NULL,'0','103','0','0','0','0','499',NULL,'0',NULL,'0',NULL,'0','','','');
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 64bdfb5c7..dcc64af97 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -1,6 +1,6 @@
--
---
-- Table structure for table `account_data`
+--
CREATE TABLE IF NOT EXISTS `account_data` (
`account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
@@ -560,7 +560,7 @@ CREATE TABLE IF NOT EXISTS `login` (
-- added standard accounts for servers, VERY INSECURE!!!
-- inserted into the table called login which is above
-INSERT INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','athena@athena.com');
+INSERT IGNORE INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','athena@athena.com');
--
-- Table structure for table `mapreg`
@@ -770,38 +770,38 @@ CREATE TABLE IF NOT EXISTS `sql_updates` (
) ENGINE=MyISAM;
-- Existent updates to enter
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); -- 2013-02-14--16-15.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); -- 2013-02-15--18-06.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); -- 2013-03-05--01-05.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); -- 2013-03-06--00-00.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); -- 2013-03-09--01-56.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); -- 2013-03-27--18-35.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- 2013-04-16--01-24.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); -- 2013-04-16--02-15.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); -- 2013-10-09--21-38.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); -- 2013-10-10--16-36.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); -- 2013-10-27--16-47.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); -- 2013-10-30--19-53.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); -- 2013-10-30--21-12.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); -- 2013-10-31--07-49.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- 2013-11-09--00-03.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995); -- 2013-11-15--00-06.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); -- 2013-11-15--19-57.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); -- 2013-11-16--07-49.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- 2013-11-18--08-23.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-15.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-04.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1409590380); -- 2014-09-01--16-53.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1414975503); -- 2014-11-03--00-45.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1435860840); -- 2015-07-02--18-14.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1436360978); -- 2015-07-08--13-08.sql
-INSERT INTO `sql_updates` (`timestamp`) VALUES (1440688342); -- 2015-08-27--20-42.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1360858500); -- 2013-02-14--16-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1360951560); -- 2013-02-15--18-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362445531); -- 2013-03-05--01-05.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362528000); -- 2013-03-06--00-00.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362794218); -- 2013-03-09--01-56.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1364409316); -- 2013-03-27--18-35.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- 2013-04-16--01-24.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1366078541); -- 2013-04-16--02-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1381354728); -- 2013-10-09--21-38.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1381423003); -- 2013-10-10--16-36.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1382892428); -- 2013-10-27--16-47.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383162785); -- 2013-10-30--19-53.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383167577); -- 2013-10-30--21-12.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383205740); -- 2013-10-31--07-49.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- 2013-11-09--00-03.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384473995); -- 2013-11-15--00-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384545461); -- 2013-11-15--19-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384588175); -- 2013-11-16--07-49.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- 2013-11-18--08-23.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-04.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1409590380); -- 2014-09-01--16-53.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1414975503); -- 2014-11-03--00-45.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1435860840); -- 2015-07-02--18-14.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1436360978); -- 2015-07-08--13-08.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1440688342); -- 2015-08-27--20-42.sql
--
-- Table structure for table `storage`
@@ -826,4 +826,3 @@ CREATE TABLE IF NOT EXISTS `storage` (
PRIMARY KEY (`id`),
KEY `account_id` (`account_id`)
) ENGINE=MyISAM;
-
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index 94d87d191..5f6aed963 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -27,3 +27,4 @@
2014-11-03--00-45.sql
2015-07-02--18-14.sql
2015-07-08--13-08.sql
+2015-08-27--20-42.sql \ No newline at end of file
diff --git a/src/char/HPMchar.h b/src/char/HPMchar.h
index 594bb7f00..e3e000ef3 100644
--- a/src/char/HPMchar.h
+++ b/src/char/HPMchar.h
@@ -22,4 +22,3 @@ void HPM_char_do_final(void);
void HPM_char_do_init(void);
#endif /* CHAR_HPMCHAR_H */
-
diff --git a/src/char/char.c b/src/char/char.c
index 819cd2ef8..3cc8853a4 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -140,7 +140,11 @@ struct fame_list chemist_fame_list[MAX_FAME_LIST];
struct fame_list taekwon_fame_list[MAX_FAME_LIST];
// Initial position (it's possible to set it in conf file)
-struct point start_point = { 0, 53, 111 };
+#ifdef RENEWAL
+ struct point start_point = { 0, 97, 90 };
+#else
+ struct point start_point = { 0, 53, 111 };
+#endif
unsigned short skillid2idx[MAX_SKILL_ID];
@@ -2410,7 +2414,7 @@ void char_changesex(int account_id, int sex)
* Performs the necessary operations when changing a character's sex, such as
* correcting the job class and unequipping items, and propagating the
* information to the guild data.
- *
+ *
* @param sex The new sex (SEX_MALE or SEX_FEMALE).
* @param acc The character's account ID.
* @param char_id The character ID.
@@ -2479,7 +2483,7 @@ int char_parse_fromlogin_changesex_reply(int fd)
SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &char_id, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &class_, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &guild_id, 0, NULL, NULL);
-
+
for (i = 0; i < MAX_CHARS && SQL_SUCCESS == SQL->StmtNextRow(stmt); ++i) {
char_change_sex_sub(sex, acc, char_id, class_, guild_id);
}
@@ -3451,7 +3455,7 @@ void char_ask_name_ack(int fd, int acc, const char* name, int type, int result)
* Changes a character's sex.
* The information is updated on database, and the character is kicked if it
* currently is online.
- *
+ *
* @param char_id The character's ID.
* @param sex The new sex.
* @retval 0 in case of success.
@@ -3475,7 +3479,7 @@ int char_changecharsex(int char_id, int sex)
SQL->GetData(inter->sql_handle, 1, &data, NULL); class_ = atoi(data);
SQL->GetData(inter->sql_handle, 2, &data, NULL); guild_id = atoi(data);
SQL->FreeResult(inter->sql_handle);
-
+
if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `sex` = '%c' WHERE `char_id` = '%d'", char_db, sex == SEX_MALE ? 'M' : 'F', char_id)) {
Sql_ShowDebug(inter->sql_handle);
return 1;
@@ -5639,17 +5643,33 @@ int char_config_read(const char* cfgName)
autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
} else if (strcmpi(w1, "save_log") == 0) {
save_log = config_switch(w2);
- } else if (strcmpi(w1, "start_point") == 0) {
- char map[MAP_NAME_LENGTH_EXT];
- int x, y;
- if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3)
- continue;
- start_point.map = mapindex->name2id(map);
- if (!start_point.map)
- ShowError("Specified start_point %s not found in map-index cache.\n", map);
- start_point.x = x;
- start_point.y = y;
- } else if (strcmpi(w1, "start_items") == 0) {
+ }
+ #ifdef RENEWAL
+ else if (strcmpi(w1, "start_point") == 0) {
+ char map[MAP_NAME_LENGTH_EXT];
+ int x, y;
+ if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3)
+ continue;
+ start_point.map = mapindex->name2id(map);
+ if (!start_point.map)
+ ShowError("Specified start_point %s not found in map-index cache.\n", map);
+ start_point.x = x;
+ start_point.y = y;
+ }
+ #else
+ else if (strcmpi(w1, "start_point_pre") == 0) {
+ char map[MAP_NAME_LENGTH_EXT];
+ int x, y;
+ if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3)
+ continue;
+ start_point.map = mapindex->name2id(map);
+ if (!start_point.map)
+ ShowError("Specified start_point_pre %s not found in map-index cache.\n", map);
+ start_point.x = x;
+ start_point.y = y;
+ }
+ #endif
+ else if (strcmpi(w1, "start_items") == 0) {
int i;
char *split;
@@ -5876,7 +5896,12 @@ int do_init(int argc, char **argv) {
//Read map indexes
mapindex->init();
- start_point.map = mapindex->name2id("new_zone01");
+
+ #ifdef RENEWAL
+ start_point.map = mapindex->name2id("iz_int");
+ #else
+ start_point.map = mapindex->name2id("new_1-1");
+ #endif
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
chr->config_read(chr->CHAR_CONF_NAME);
diff --git a/src/char/int_quest.h b/src/char/int_quest.h
index c2393d103..442995826 100644
--- a/src/char/int_quest.h
+++ b/src/char/int_quest.h
@@ -20,4 +20,3 @@ void inter_quest_defaults(void);
HPShared struct inter_quest_interface *inter_quest;
#endif /* CHAR_INT_QUEST_H */
-
diff --git a/src/char/inter.c b/src/char/inter.c
index 548b24ee8..65048a9f9 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -953,7 +953,7 @@ int mapif_wis_message(struct WisData *wd)
wd->len = 0;
if (wd->len >= sizeof(wd->msg) - 1)
wd->len = sizeof(wd->msg) - 1;
-
+
WBUFW(buf, 0) = 0x3801;
WBUFW(buf, 2) = 56 +wd->len;
WBUFL(buf, 4) = wd->id;
diff --git a/src/common/HPM.c b/src/common/HPM.c
index a78f03daa..23265fa24 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -477,31 +477,32 @@ struct hplugin *hplugin_load(const char* filename) {
return plugin;
}
-void hplugin_unload(struct hplugin* plugin) {
- unsigned int i = plugin->idx;
-
- if( plugin->filename )
+void hplugin_unload(struct hplugin* plugin)
+{
+ if (plugin->filename)
aFree(plugin->filename);
- if( plugin->dll )
+ if (plugin->dll)
plugin_close(plugin->dll);
/* TODO: for manual packet unload */
/* - Go through known packets and unlink any belonging to the plugin being removed */
- aFree(plugin);
if (!HPM->off) {
- int cursor = 0;
- HPM->plugins[i] = NULL;
- for(i = 0; i < HPM->plugin_count; i++) {
- if( HPM->plugins[i] == NULL )
+ int i, cursor;
+ for (cursor = 0; cursor < HPM->plugin_count; cursor++) {
+ if (HPM->plugins[cursor]->idx != plugin->idx)
continue;
- if( cursor != i )
- HPM->plugins[cursor] = HPM->plugins[i];
+ HPM->plugins[cursor] = NULL;
+ break;
+ }
+ for(i = cursor + 1; i < HPM->plugin_count; i++) {
+ HPM->plugins[cursor] = HPM->plugins[i];
cursor++;
}
- if( !(HPM->plugin_count = cursor) ) {
+ if (!(HPM->plugin_count = cursor)) {
aFree(HPM->plugins);
HPM->plugins = NULL;
}
}
+ aFree(plugin);
}
/**
@@ -560,8 +561,8 @@ void hplugins_config_read(void) {
if ((plugin = HPM->load(filename))) {
const char * (*func)(bool *fr);
bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
- if ((func = plugin_import(plugin->dll, "Hooked",const char * (*)(bool *)))
- && (addhook_sub = plugin_import(plugin->dll, "HPM_Plugin_AddHook",bool (*)(enum HPluginHookType, const char *, void *, unsigned int)))) {
+ if ((func = plugin_import(plugin->dll, "Hooked",const char * (*)(bool *))) != NULL
+ && (addhook_sub = plugin_import(plugin->dll, "HPM_Plugin_AddHook",bool (*)(enum HPluginHookType, const char *, void *, unsigned int))) != NULL) {
const char *failed = func(&HPM->force_return);
if (failed) {
ShowError("HPM: failed to retrieve '%s' for '"CL_WHITE"%s"CL_RESET"'!\n", failed, plugin_name);
@@ -580,8 +581,8 @@ void hplugins_config_read(void) {
snprintf(filename, 60, "plugins/%s%s", libconfig->setting_get_string_elem(plist,i), DLL_EXT);
HPM->load(filename);
}
- libconfig->destroy(&plugins_conf);
}
+ libconfig->destroy(&plugins_conf);
if( HPM->plugin_count )
ShowStatus("HPM: There are '"CL_WHITE"%d"CL_RESET"' plugins loaded, type '"CL_WHITE"plugins"CL_RESET"' to list them\n", HPM->plugin_count);
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 7eb4029aa..4fd16114b 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -106,6 +106,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#endif // COMMON_CONF_H
#ifdef COMMON_CONSOLE_H
{ "CParseEntry", sizeof(struct CParseEntry), SERVER_TYPE_ALL },
+ { "console_input_interface", sizeof(struct console_input_interface), SERVER_TYPE_ALL },
{ "console_interface", sizeof(struct console_interface), SERVER_TYPE_ALL },
#else
#define COMMON_CONSOLE_H
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index bd8d8fe64..e03f52e3b 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -71,11 +71,12 @@ enum HPluginDataTypes {
HPDT_MOBDATA,
HPDT_ITEMDATA,
HPDT_BGDATA,
+ HPDT_AUTOTRADE_VEND,
};
/* used in macros and conf storage */
enum HPluginConfType {
- HPCT_BATTLE, /* battle-conf (map-server */
+ HPCT_BATTLE, /* battle-conf (map-server) */
HPCT_LOGIN, /* login-server.conf (login-server) */
HPCT_CHAR, /* char-server.conf (char-server) */
HPCT_CHAR_INTER, /* inter-server.conf (char-server) */
@@ -138,6 +139,10 @@ enum HPluginConfType {
#define addToBGDATA(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_BGDATA,HPMi->pid,(ptr),(data),(index),(autofree)))
#define getFromBGDATA(ptr,index) (HPMi->getFromHPData(HPDT_BGDATA,HPMi->pid,(ptr),(index)))
#define removeFromBGDATA(ptr,index) (HPMi->removeFromHPData(HPDT_BGDATA,HPMi->pid,(ptr),(index)))
+/* autotrade_vending */
+#define addToATVEND(ptr,data,index,autofree) (HPMi->addToHPData(HPDT_AUTOTRADE_VEND,HPMi->pid,(ptr),(data),(index),(autofree)))
+#define getFromATVEND(ptr,index) (HPMi->getFromHPData(HPDT_AUTOTRADE_VEND,HPMi->pid,(ptr),(index)))
+#define removeFromATVEND(ptr,index) (HPMi->removeFromHPData(HPDT_AUTOTRADE_VEND,HPMi->pid,(ptr),(index)))
/// HPMi->addCommand
#define addAtcommand(cname,funcname) do { \
diff --git a/src/common/atomic.h b/src/common/atomic.h
index c1ea2aa48..1bb859b29 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -40,7 +40,6 @@ forceinline int64 InterlockedCompareExchange64(volatile int64 *dest, int64 exch,
}
}
-
forceinline volatile int64 InterlockedIncrement64(volatile int64 *addend){
__int64 old;
do{
@@ -50,8 +49,6 @@ forceinline volatile int64 InterlockedIncrement64(volatile int64 *addend){
return (old + 1);
}
-
-
forceinline volatile int64 InterlockedDecrement64(volatile int64 *addend){
__int64 old;
@@ -97,53 +94,42 @@ static forceinline int64 InterlockedExchangeAdd64(volatile int64 *addend, int64
return __sync_fetch_and_add(addend, increment);
}//end: InterlockedExchangeAdd64()
-
static forceinline int32 InterlockedExchangeAdd(volatile int32 *addend, int32 increment){
return __sync_fetch_and_add(addend, increment);
}//end: InterlockedExchangeAdd()
-
static forceinline int64 InterlockedIncrement64(volatile int64 *addend){
return __sync_add_and_fetch(addend, 1);
}//end: InterlockedIncrement64()
-
static forceinline int32 InterlockedIncrement(volatile int32 *addend){
return __sync_add_and_fetch(addend, 1);
}//end: InterlockedIncrement()
-
static forceinline int64 InterlockedDecrement64(volatile int64 *addend){
return __sync_sub_and_fetch(addend, 1);
}//end: InterlockedDecrement64()
-
static forceinline int32 InterlockedDecrement(volatile int32 *addend){
return __sync_sub_and_fetch(addend, 1);
}//end: InterlockedDecrement()
-
static forceinline int64 InterlockedCompareExchange64(volatile int64 *dest, int64 exch, int64 cmp){
return __sync_val_compare_and_swap(dest, cmp, exch);
}//end: InterlockedCompareExchange64()
-
static forceinline int32 InterlockedCompareExchange(volatile int32 *dest, int32 exch, int32 cmp){
return __sync_val_compare_and_swap(dest, cmp, exch);
}//end: InterlockedCompareExchnage()
-
static forceinline int64 InterlockedExchange64(volatile int64 *target, int64 val){
return __sync_lock_test_and_set(target, val);
}//end: InterlockedExchange64()
-
static forceinline int32 InterlockedExchange(volatile int32 *target, int32 val){
return __sync_lock_test_and_set(target, val);
}//end: InterlockedExchange()
-
#endif //endif compiler decision
-
#endif /* COMMON_ATOMIC_H */
diff --git a/src/common/core.c b/src/common/core.c
index 7f5a1da53..dcc96fa41 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -206,7 +206,7 @@ const char *cmdline_arg_source(struct CmdlineArgData *arg) {
*/
bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
struct CmdlineArgData *data = NULL;
-
+
RECREATE(cmdline->args_data, struct CmdlineArgData, ++cmdline->args_data_count);
data = &cmdline->args_data[cmdline->args_data_count-1];
data->pluginID = pluginID;
@@ -227,7 +227,7 @@ static CMDLINEARG(help)
ShowInfo("Usage: %s [options]\n", SERVER_NAME);
ShowInfo("\n");
ShowInfo("Options:\n");
-
+
for (i = 0; i < cmdline->args_data_count; i++) {
struct CmdlineArgData *data = &cmdline->args_data[i];
char altname[16], paramnames[256];
@@ -400,7 +400,7 @@ int main (int argc, char **argv) {
cmdline->exec(argc, argv, CMDLINE_OPT_SILENT);
iMalloc->init_messages(); // Initialization messages (after buying us some time to suppress them if needed)
-
+
sysinfo->init();
if (!(showmsg->silent&0x1))
diff --git a/src/common/db.h b/src/common/db.h
index 9b9cba8f8..73d44a755 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -269,13 +269,9 @@ typedef uint64 (*DBHasher)(DBKey key, unsigned short maxlen);
*/
typedef void (*DBReleaser)(DBKey key, DBData data, DBRelease which);
-
-
typedef struct DBIterator DBIterator;
typedef struct DBMap DBMap;
-
-
/**
* Database iterator.
* Supports forward iteration, backward iteration and removing entries from the database.
@@ -621,7 +617,6 @@ struct DBMap {
#define i64db_get(db,k) ( DB->data2ptr((db)->get((db),DB->i642key(k))) )
#define ui64db_get(db,k) ( DB->data2ptr((db)->get((db),DB->ui642key(k))) )
-
// Get int-type data from DBMaps of various key types
#define db_iget(db,k) ( DB->data2i((db)->get((db),(k))) )
#define idb_iget(db,k) ( DB->data2i((db)->get((db),DB->i2key(k))) )
@@ -940,7 +935,6 @@ void db_defaults(void);
HPShared struct db_interface *DB;
-
/// Finds an entry in an array.
/// ex: ARR_FIND(0, size, i, list[i] == target);
///
@@ -955,8 +949,6 @@ HPShared struct db_interface *DB;
break; \
}while(0)
-
-
/// Moves an entry of the array.
/// Use ARR_MOVERIGHT/ARR_MOVELEFT if __from and __to are direct numbers.
/// ex: ARR_MOVE(i, 0, list, int);// move index i to index 0
@@ -980,8 +972,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// Moves an entry of the array to the right.
/// ex: ARR_MOVERIGHT(1, 4, list, int);// move index 1 to index 4
///
@@ -997,8 +987,6 @@ HPShared struct db_interface *DB;
memmove((__arr)+(__to), &__backup__, sizeof(__type)); \
}while(0)
-
-
/// Moves an entry of the array to the left.
/// ex: ARR_MOVELEFT(3, 0, list, int);// move index 3 to index 0
///
@@ -1014,14 +1002,10 @@ HPShared struct db_interface *DB;
memmove((__arr)+(__to), &__backup__, sizeof(__type)); \
}while(0)
-
-
/////////////////////////////////////////////////////////////////////
// Vector library based on defines. (dynamic array)
// uses aMalloc, aRealloc, aFree
-
-
/// Declares an anonymous vector struct.
///
/// @param __type Type of data
@@ -1032,8 +1016,6 @@ HPShared struct db_interface *DB;
__type* _data_; \
}
-
-
/// Declares a named vector struct.
///
/// @param __name Structure name
@@ -1045,8 +1027,6 @@ HPShared struct db_interface *DB;
__type* _data_; \
}
-
-
/// Declares and initializes an anonymous vector variable.
///
/// @param __type Type of data
@@ -1054,8 +1034,6 @@ HPShared struct db_interface *DB;
#define VECTOR_VAR(__type,__var) \
VECTOR_DECL(__type) __var = {0,0,NULL}
-
-
/// Declares and initializes a named vector variable.
///
/// @param __name Structure name
@@ -1063,16 +1041,12 @@ HPShared struct db_interface *DB;
#define VECTOR_STRUCT_VAR(__name,__var) \
struct __name __var = {0,0,NULL}
-
-
/// Initializes a vector.
///
/// @param __vec Vector
#define VECTOR_INIT(__vec) \
memset(&(__vec), 0, sizeof(__vec))
-
-
/// Returns the internal array of values.
///
/// @param __vec Vector
@@ -1080,8 +1054,6 @@ HPShared struct db_interface *DB;
#define VECTOR_DATA(__vec) \
( (__vec)._data_ )
-
-
/// Returns the length of the vector.
///
/// @param __vec Vector
@@ -1089,8 +1061,6 @@ HPShared struct db_interface *DB;
#define VECTOR_LENGTH(__vec) \
( (__vec)._len_ )
-
-
/// Returns the capacity of the vector.
///
/// @param __vec Vector
@@ -1098,8 +1068,6 @@ HPShared struct db_interface *DB;
#define VECTOR_CAPACITY(__vec) \
( (__vec)._max_ )
-
-
/// Returns the value at the target index.
/// Assumes the index exists.
///
@@ -1109,8 +1077,6 @@ HPShared struct db_interface *DB;
#define VECTOR_INDEX(__vec,__idx) \
( VECTOR_DATA(__vec)[__idx] )
-
-
/// Returns the first value of the vector.
/// Assumes the array is not empty.
///
@@ -1119,8 +1085,6 @@ HPShared struct db_interface *DB;
#define VECTOR_FIRST(__vec) \
( VECTOR_INDEX(__vec,0) )
-
-
/// Returns the last value of the vector.
/// Assumes the array is not empty.
///
@@ -1129,8 +1093,6 @@ HPShared struct db_interface *DB;
#define VECTOR_LAST(__vec) \
( VECTOR_INDEX(__vec,VECTOR_LENGTH(__vec)-1) )
-
-
/// Resizes the vector.
/// Excess values are discarded, new positions are zeroed.
///
@@ -1159,8 +1121,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// Ensures that the array has the target number of empty positions.
/// Increases the capacity in multiples of __step.
///
@@ -1176,8 +1136,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// Inserts a zeroed value in the target index.
/// Assumes the index is valid and there is enough capacity.
///
@@ -1191,8 +1149,6 @@ HPShared struct db_interface *DB;
++VECTOR_LENGTH(__vec); /* increase length */ \
}while(0)
-
-
/// Inserts a value in the target index. (using the '=' operator)
/// Assumes the index is valid and there is enough capacity.
///
@@ -1207,8 +1163,6 @@ HPShared struct db_interface *DB;
++VECTOR_LENGTH(__vec); /* increase length */ \
}while(0)
-
-
/// Inserts a value in the target index. (using memcpy)
/// Assumes the index is valid and there is enough capacity.
///
@@ -1218,8 +1172,6 @@ HPShared struct db_interface *DB;
#define VECTOR_INSERTCOPY(__vec,__idx,__val) \
VECTOR_INSERTARRAY(__vec,__idx,&(__val),1)
-
-
/// Inserts the values of the array in the target index. (using memcpy)
/// Assumes the index is valid and there is enough capacity.
///
@@ -1235,8 +1187,6 @@ HPShared struct db_interface *DB;
VECTOR_LENGTH(__vec) += (__n); /* increase length */ \
}while(0)
-
-
/// Inserts a zeroed value in the end of the vector.
/// Assumes there is enough capacity.
///
@@ -1247,7 +1197,6 @@ HPShared struct db_interface *DB;
++VECTOR_LENGTH(__vec); /* increase length */ \
}while(0)
-
/// Inserts a value in the end of the vector. (using the '=' operator)
/// Assumes there is enough capacity.
///
@@ -1259,8 +1208,6 @@ HPShared struct db_interface *DB;
++VECTOR_LENGTH(__vec); /* increase length */ \
}while(0)
-
-
/// Inserts a value in the end of the vector. (using memcpy)
/// Assumes there is enough capacity.
///
@@ -1269,8 +1216,6 @@ HPShared struct db_interface *DB;
#define VECTOR_PUSHCOPY(__vec,__val) \
VECTOR_PUSHARRAY(__vec,&(__val),1)
-
-
/// Inserts the values of the array in the end of the vector. (using memcpy)
/// Assumes there is enough capacity.
///
@@ -1283,8 +1228,6 @@ HPShared struct db_interface *DB;
VECTOR_LENGTH(__vec) += (__n); /* increase length */ \
}while(0)
-
-
/// Removes and returns the last value of the vector.
/// Assumes the array is not empty.
///
@@ -1293,8 +1236,6 @@ HPShared struct db_interface *DB;
#define VECTOR_POP(__vec) \
( VECTOR_INDEX(__vec,--VECTOR_LENGTH(__vec)) )
-
-
/// Removes the last N values of the vector and returns the value of the last pop.
/// Assumes there are enough values.
///
@@ -1304,8 +1245,6 @@ HPShared struct db_interface *DB;
#define VECTOR_POPN(__vec,__n) \
( VECTOR_INDEX(__vec,(VECTOR_LENGTH(__vec)-=(__n))) )
-
-
/// Removes the target index from the vector.
/// Assumes the index is valid and there are enough values.
///
@@ -1314,8 +1253,6 @@ HPShared struct db_interface *DB;
#define VECTOR_ERASE(__vec,__idx) \
VECTOR_ERASEN(__vec,__idx,1)
-
-
/// Removes N values from the target index of the vector.
/// Assumes the index is valid and there are enough values.
///
@@ -1329,8 +1266,6 @@ HPShared struct db_interface *DB;
VECTOR_LENGTH(__vec) -= (__n); /* decrease length */ \
}while(0)
-
-
/// Clears the vector, freeing allocated data.
///
/// @param __vec Vector
@@ -1344,77 +1279,57 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/////////////////////////////////////////////////////////////////////
// Binary heap library based on defines. (uses the vector defines above)
// uses aMalloc, aRealloc, aFree
// WARNING: BHEAP implementation details affect behaviour of A* pathfinding
-
-
/// Declares an anonymous binary heap struct.
///
/// @param __type Type of data
#define BHEAP_DECL(__type) VECTOR_DECL(__type)
-
-
/// Declares a named binary heap struct.
///
/// @param __name Structure name
/// @param __type Type of data
#define BHEAP_STRUCT_DECL(__name,__type) VECTOR_STRUCT_DECL(__name,__type)
-
-
/// Declares and initializes an anonymous binary heap variable.
///
/// @param __type Type of data
/// @param __var Variable name
#define BHEAP_VAR(__type,__var) VECTOR_VAR(__type,__var)
-
-
/// Declares and initializes a named binary heap variable.
///
/// @param __name Structure name
/// @param __var Variable name
#define BHEAP_STRUCT_VAR(__name,__var) VECTOR_STRUCT_VAR(__name,__var)
-
-
/// Initializes a heap.
///
/// @param __heap Binary heap
#define BHEAP_INIT(__heap) VECTOR_INIT(__heap)
-
-
/// Returns the internal array of values.
///
/// @param __heap Binary heap
/// @return Array of values
#define BHEAP_DATA(__heap) VECTOR_DATA(__heap)
-
-
/// Returns the length of the heap.
///
/// @param __heap Binary heap
/// @return Length
#define BHEAP_LENGTH(__heap) VECTOR_LENGTH(__heap)
-
-
/// Returns the capacity of the heap.
///
/// @param __heap Binary heap
/// @return Capacity
#define BHEAP_CAPACITY(__heap) VECTOR_CAPACITY(__heap)
-
-
/// Ensures that the heap has the target number of empty positions.
/// Increases the capacity in multiples of __step.
///
@@ -1423,8 +1338,6 @@ HPShared struct db_interface *DB;
/// @param __step Increase
#define BHEAP_ENSURE(__heap,__n,__step) VECTOR_ENSURE(__heap,__n,__step)
-
-
/// Returns the top value of the heap.
/// Assumes the heap is not empty.
///
@@ -1432,8 +1345,6 @@ HPShared struct db_interface *DB;
/// @return Value at the top
#define BHEAP_PEEK(__heap) VECTOR_INDEX(__heap,0)
-
-
/// Inserts a value in the heap. (using the '=' operator)
/// Assumes there is enough capacity.
///
@@ -1460,8 +1371,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// See BHEAP_PUSH. Version used by A* implementation, matching client bheap.
///
/// @param __heap Binary heap
@@ -1475,8 +1384,6 @@ HPShared struct db_interface *DB;
BHEAP_SIFTDOWN(__heap,0,_i_,__topcmp,__swp); \
}while(0)
-
-
/// Removes the top value of the heap. (using the '=' operator)
/// Assumes the heap is not empty.
///
@@ -1490,8 +1397,6 @@ HPShared struct db_interface *DB;
/// @param __swp Swapper
#define BHEAP_POP(__heap,__topcmp,__swp) BHEAP_POPINDEX(__heap,0,__topcmp,__swp)
-
-
/// See BHEAP_POP. Version used by A* implementation, matching client bheap.
///
/// @param __heap Binary heap
@@ -1505,8 +1410,6 @@ HPShared struct db_interface *DB;
BHEAP_SIFTUP(__heap,0,__topcmp,__swp); \
}while(0)
-
-
/// Removes the target value of the heap. (using the '=' operator)
/// Assumes the index exists.
///
@@ -1553,8 +1456,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// Follow path up towards (but not all the way to) the root, swapping nodes until finding
/// a place where the new item that was placed at __idx fits.
/// Only goes as high as __startidx (usually 0).
@@ -1577,8 +1478,6 @@ HPShared struct db_interface *DB;
} \
}while(0)
-
-
/// Repeatedly swap the smaller child with parent, after placing a new item at __idx.
///
/// @param __heap Binary heap
@@ -1607,8 +1506,6 @@ HPShared struct db_interface *DB;
BHEAP_SIFTDOWN(__heap,__idx,_i_,__topcmp,__swp); \
}while(0)
-
-
/// Call this after modifying the item at __idx__ to restore the heap
///
/// @param __heap Binary heap
@@ -1621,15 +1518,11 @@ HPShared struct db_interface *DB;
BHEAP_SIFTUP(__heap,__idx,__topcmp,__swp); \
}while(0)
-
-
/// Clears the binary heap, freeing allocated data.
///
/// @param __heap Binary heap
#define BHEAP_CLEAR(__heap) VECTOR_CLEAR(__heap)
-
-
/// Generic comparator for a min-heap. (minimum value at top)
/// Returns -1 if v1 is smaller, 1 if v2 is smaller, 0 if equal.
///
@@ -1638,8 +1531,6 @@ HPShared struct db_interface *DB;
/// @return negative if v1 is top, positive if v2 is top, 0 if equal
#define BHEAP_MINTOPCMP(v1,v2) ( v1 == v2 ? 0 : v1 < v2 ? -1 : 1 )
-
-
/// Generic comparator for a max-heap. (maximum value at top)
/// Returns -1 if v1 is bigger, 1 if v2 is bigger, 0 if equal.
///
@@ -1648,6 +1539,4 @@ HPShared struct db_interface *DB;
/// @return negative if v1 is top, positive if v2 is top, 0 if equal
#define BHEAP_MAXTOPCMP(v1,v2) ( v1 == v2 ? 0 : v1 > v2 ? -1 : 1 )
-
-
#endif /* COMMON_DB_H */
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 614678da8..b59c2b63d 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -47,7 +47,6 @@ typedef struct FILELIST {
// (NOTE: probably meant to be used to override grf contents by files in the data directory)
//#define GRFIO_LOCAL
-
// stores info about every loaded file
FILELIST* filelist = NULL;
int filelist_entrys = 0;
@@ -61,14 +60,12 @@ int gentry_maxentry = 0;
// the path to the data directory
char data_dir[1024] = "";
-
// little endian char array to uint conversion
static unsigned int getlong(unsigned char* p)
{
return (p[0] << 0 | p[1] << 8 | p[2] << 16 | p[3] << 24);
}
-
static void NibbleSwap(unsigned char* src, int len)
{
while( len > 0 )
@@ -79,7 +76,6 @@ static void NibbleSwap(unsigned char* src, int len)
}
}
-
/// Substitutes some specific values for others, leaves rest intact. Obfuscation.
/// NOTE: Operation is symmetric (calling it twice gives back the original input).
static uint8_t grf_substitution(uint8_t in)
@@ -142,7 +138,6 @@ static void grf_shuffle_dec(BIT64* src)
*src = out;
}
-
static void grf_decode_header(unsigned char* buf, size_t len)
{
BIT64* p = (BIT64*)buf;
@@ -156,7 +151,6 @@ static void grf_decode_header(unsigned char* buf, size_t len)
// the rest is plaintext, done.
}
-
static void grf_decode_full(unsigned char* buf, size_t len, int cycle)
{
BIT64* p = (BIT64*)buf;
@@ -195,7 +189,6 @@ static void grf_decode_full(unsigned char* buf, size_t len, int cycle)
}
}
-
/// Decodes grf data.
/// @param buf data to decode (in-place)
/// @param len length of the data
@@ -235,7 +228,6 @@ static void grf_decode(unsigned char* buf, size_t len, char entry_type, int entr
}
}
-
/******************************************************
*** Zlib Subroutines ***
******************************************************/
@@ -246,14 +238,12 @@ unsigned long grfio_crc32(const unsigned char* buf, unsigned int len)
return crc32(crc32(0L, Z_NULL, 0), buf, len);
}
-
/// zlib uncompress
int decode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen)
{
return uncompress((Bytef*)dest, destLen, (const Bytef*)source, sourceLen);
}
-
/// zlib compress
int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen) {
if( *destLen == 0 ) /* [Ind/Hercules] */
@@ -264,7 +254,6 @@ int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned
return compress((Bytef*)dest, destLen, (const Bytef*)source, sourceLen);
}
-
/***********************************************************
*** File List Subroutines ***
***********************************************************/
@@ -370,12 +359,10 @@ static void filelist_compact(void)
}
}
-
/***********************************************************
*** Grfio Subroutines ***
***********************************************************/
-
/// Combines are resource path with the data folder location to create local resource path.
static void grfio_localpath_create(char* buffer, size_t size, const char* filename)
{
@@ -399,7 +386,6 @@ static void grfio_localpath_create(char* buffer, size_t size, const char* filena
buffer[i] = '/';
}
-
/// Reads a file into a newly allocated buffer (from grf or data directory).
void *grfio_reads(const char *fname, int *size)
{
@@ -449,7 +435,7 @@ void *grfio_reads(const char *fname, int *size)
// Archive[GRF] File Read
char *grfname = gentry_table[entry->gentry - 1];
FILE *in = fopen(grfname, "rb");
-
+
if (in != NULL) {
int fsize = entry->srclen_aligned;
unsigned char *buf = (unsigned char *)aMalloc(fsize);
@@ -496,7 +482,6 @@ void *grfio_reads(const char *fname, int *size)
return NULL;
}
-
/// Decodes encrypted filename from a version 01xx grf index.
static char* decode_filename(unsigned char* buf, int len)
{
@@ -508,7 +493,6 @@ static char* decode_filename(unsigned char* buf, int len)
return (char*)buf;
}
-
/// Compares file extension against known large file types.
/// @return true if the file should undergo full mode 0 decryption, and true otherwise.
static bool isFullEncrypt(const char* fname)
@@ -525,7 +509,6 @@ static bool isFullEncrypt(const char* fname)
return true;
}
-
/// Loads all entries in the specified grf file into the filelist.
/// @param gentry index of the grf file name in the gentry_table
static int grfio_entryread(const char *grfname, int gentry)
@@ -691,7 +674,6 @@ static int grfio_entryread(const char *grfname, int gentry)
return 0; // 0:no error
}
-
static bool grfio_parse_restable_row(const char* row)
{
char w1[256], w2[256];
@@ -733,7 +715,6 @@ static bool grfio_parse_restable_row(const char* row)
return false;
}
-
/// Grfio Resource file check.
static void grfio_resourcecheck(void)
{
@@ -785,7 +766,6 @@ static void grfio_resourcecheck(void)
}
}
-
/// Reads a grf file and adds it to the list.
static int grfio_add(const char* fname)
{
@@ -802,7 +782,6 @@ static int grfio_add(const char* fname)
return grfio_entryread(fname, gentry_entrys - 1);
}
-
/// Finalizes grfio.
void grfio_final(void)
{
@@ -829,7 +808,6 @@ void grfio_final(void)
gentry_entrys = gentry_maxentry = 0;
}
-
/// Initializes grfio.
void grfio_init(const char* fname)
{
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 1567f20be..012eec935 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -299,6 +299,7 @@ enum e_mmo_charstatus_opt {
};
enum e_item_bound_type {
+ IBT_NONE = 0x0,
IBT_MIN = 0x1,
IBT_ACCOUNT = 0x1,
IBT_GUILD = 0x2,
@@ -333,18 +334,15 @@ enum {
OPTION_DRAGON5 = 0x04000000,
OPTION_HANBOK = 0x08000000,
OPTION_OKTOBERFEST = 0x10000000,
-
#ifndef NEW_CARTS
OPTION_CART1 = 0x00000008,
OPTION_CART2 = 0x00000080,
OPTION_CART3 = 0x00000100,
OPTION_CART4 = 0x00000200,
OPTION_CART5 = 0x00000400,
-
/* compound constant for older carts */
OPTION_CART = OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5,
#endif
-
// compound constants
OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5,
OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST,
@@ -757,7 +755,6 @@ enum {
GD_MAX,
};
-
//These mark the ID of the jobs, as expected by the client. [Skotlex]
enum {
JOB_NOVICE,
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 5dfb3d01c..715609628 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -25,7 +25,6 @@ struct ramutex{
#endif
};
-
struct racond{
#ifdef WIN32
HANDLE events[2];
@@ -40,14 +39,12 @@ struct racond{
#endif
};
-
////////////////////
// Mutex
//
// Implementation:
//
-
ramutex *ramutex_create(void) {
struct ramutex *m;
@@ -66,7 +63,6 @@ ramutex *ramutex_create(void) {
return m;
}//end: ramutex_create()
-
void ramutex_destroy(ramutex *m) {
#ifdef WIN32
@@ -79,7 +75,6 @@ void ramutex_destroy(ramutex *m) {
}//end: ramutex_destroy()
-
void ramutex_lock(ramutex *m) {
#ifdef WIN32
@@ -89,7 +84,6 @@ void ramutex_lock(ramutex *m) {
#endif
}//end: ramutex_lock
-
bool ramutex_trylock(ramutex *m) {
#ifdef WIN32
if(TryEnterCriticalSection(&m->hMutex) != FALSE)
@@ -104,7 +98,6 @@ bool ramutex_trylock(ramutex *m) {
#endif
}//end: ramutex_trylock()
-
void ramutex_unlock(ramutex *m) {
#ifdef WIN32
LeaveCriticalSection(&m->hMutex);
@@ -114,8 +107,6 @@ void ramutex_unlock(ramutex *m) {
}//end: ramutex_unlock()
-
-
///////////////
// Condition Variables
//
@@ -143,7 +134,6 @@ racond *racond_create(void) {
return c;
}//end: racond_create()
-
void racond_destroy(racond *c) {
#ifdef WIN32
CloseHandle( c->events[ EVENT_COND_SIGNAL ] );
@@ -156,14 +146,12 @@ void racond_destroy(racond *c) {
aFree(c);
}//end: racond_destroy()
-
void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
#ifdef WIN32
register DWORD ms;
int result;
bool is_last = false;
-
EnterCriticalSection(&c->waiters_lock);
c->nWaiters++;
LeaveCriticalSection(&c->waiters_lock);
@@ -191,7 +179,6 @@ void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
if(is_last == true)
ResetEvent( c->events[EVENT_COND_BROADCAST] );
-
ramutex_lock(m);
#else
@@ -210,7 +197,6 @@ void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
#endif
}//end: racond_wait()
-
void racond_signal(racond *c) {
#ifdef WIN32
# if 0
@@ -228,7 +214,6 @@ void racond_signal(racond *c) {
#endif
}//end: racond_signal()
-
void racond_broadcast(racond *c) {
#ifdef WIN32
# if 0
@@ -245,5 +230,3 @@ void racond_broadcast(racond *c) {
pthread_cond_broadcast(&c->hCond);
#endif
}//end: racond_broadcast()
-
-
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index 829ba4aab..98faa9f06 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -58,6 +58,5 @@ void assert_report(const char *file, int line, const char *func, const char *tar
**/
void nullpo_defaults(void) {
nullpo = &nullpo_s;
-
nullpo->assert_report = assert_report;
}
diff --git a/src/common/socket.c b/src/common/socket.c
index c4cc4a329..de8ca4682 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -113,7 +113,6 @@ int sock2fd(SOCKET s)
return fd;
}
-
/// Inserts the socket into the global array of sockets.
/// Returns a new fd associated with the socket.
/// If there are too many sockets it closes the socket, sets an error and
@@ -293,7 +292,6 @@ void set_defaultparse(ParseFunc defaultparse)
default_func_parse = defaultparse;
}
-
/*======================================
* CORE : Socket options
*--------------------------------------*/
@@ -1066,12 +1064,12 @@ static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) {
int list = 0;
ConnectHistory *hist = NULL;
DBIterator *iter;
-
+
if( !db_size(connect_history) )
return 0;
-
+
iter = db_iterator(connect_history);
-
+
for( hist = dbi_first(iter); dbi_exists(iter); hist = dbi_next(iter) ){
if( (!hist->ddos && DIFF_TICK(tick,hist->tick) > ddos_interval*3) ||
(hist->ddos && DIFF_TICK(tick,hist->tick) > ddos_autoreset) )
@@ -1081,13 +1079,12 @@ static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) {
}
list++;
}
-
dbi_destroy(iter);
-
+
if( access_debug ){
ShowInfo("connect_check_clear: Cleared %d of %d from IP list.\n", clear, list);
}
-
+
return list;
}
@@ -1206,7 +1203,6 @@ int socket_config_read(const char* cfgName)
return 0;
}
-
void socket_final(void)
{
int i;
diff --git a/src/common/sql.c b/src/common/sql.c
index 0ca51e272..ee759eb61 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -36,8 +36,6 @@ struct Sql {
int keepalive;
};
-
-
// Column length receiver.
// Takes care of the possible size mismatch between uint32 and unsigned long.
struct s_column_length {
@@ -46,8 +44,6 @@ struct s_column_length {
};
typedef struct s_column_length s_column_length;
-
-
/// Sql statement
struct SqlStmt {
StringBuf buf;
@@ -61,14 +57,10 @@ struct SqlStmt {
bool bind_columns;
};
-
-
///////////////////////////////////////////////////////////////////////////////
// Sql Handle
///////////////////////////////////////////////////////////////////////////////
-
-
/// Allocates and initializes a new Sql handle.
Sql* Sql_Malloc(void)
{
@@ -84,8 +76,6 @@ Sql* Sql_Malloc(void)
return self;
}
-
-
static int Sql_P_Keepalive(Sql* self);
/// Establishes a connection.
@@ -111,8 +101,6 @@ int Sql_Connect(Sql* self, const char* user, const char* passwd, const char* hos
return SQL_SUCCESS;
}
-
-
/// Retrieves the timeout of the connection.
int Sql_GetTimeout(Sql* self, uint32* out_timeout)
{
@@ -130,8 +118,6 @@ int Sql_GetTimeout(Sql* self, uint32* out_timeout)
return SQL_ERROR;
}
-
-
/// Retrieves the name of the columns of a table into out_buf, with the separator after each name.
int Sql_GetColumnNames(Sql* self, const char* table, char* out_buf, size_t buf_len, char sep)
{
@@ -160,8 +146,6 @@ int Sql_GetColumnNames(Sql* self, const char* table, char* out_buf, size_t buf_l
return SQL_SUCCESS;
}
-
-
/// Changes the encoding of the connection.
int Sql_SetEncoding(Sql* self, const char* encoding)
{
@@ -170,8 +154,6 @@ int Sql_SetEncoding(Sql* self, const char* encoding)
return SQL_ERROR;
}
-
-
/// Pings the connection.
int Sql_Ping(Sql* self)
{
@@ -180,8 +162,6 @@ int Sql_Ping(Sql* self)
return SQL_ERROR;
}
-
-
/// Wrapper function for Sql_Ping.
///
/// @private
@@ -193,8 +173,6 @@ static int Sql_P_KeepaliveTimer(int tid, int64 tick, int id, intptr_t data)
return 0;
}
-
-
/// Establishes keepalive (periodic ping) on the connection.
///
/// @return the keepalive timer id, or INVALID_TIMER
@@ -218,8 +196,6 @@ static int Sql_P_Keepalive(Sql* self)
return timer->add_interval(timer->gettick() + ping_interval*1000, Sql_P_KeepaliveTimer, 0, (intptr_t)self, ping_interval*1000);
}
-
-
/// Escapes a string.
size_t Sql_EscapeString(Sql* self, char *out_to, const char *from)
{
@@ -229,8 +205,6 @@ size_t Sql_EscapeString(Sql* self, char *out_to, const char *from)
return (size_t)mysql_escape_string(out_to, from, (unsigned long)strlen(from));
}
-
-
/// Escapes a string.
size_t Sql_EscapeStringLen(Sql* self, char *out_to, const char *from, size_t from_len)
{
@@ -240,8 +214,6 @@ size_t Sql_EscapeStringLen(Sql* self, char *out_to, const char *from, size_t fro
return (size_t)mysql_escape_string(out_to, from, (unsigned long)from_len);
}
-
-
/// Executes a query.
int Sql_Query(Sql *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
int Sql_Query(Sql *self, const char *query, ...) {
@@ -255,8 +227,6 @@ int Sql_Query(Sql *self, const char *query, ...) {
return res;
}
-
-
/// Executes a query.
int Sql_QueryV(Sql* self, const char* query, va_list args)
{
@@ -282,8 +252,6 @@ int Sql_QueryV(Sql* self, const char* query, va_list args)
return SQL_SUCCESS;
}
-
-
/// Executes a query.
int Sql_QueryStr(Sql* self, const char* query)
{
@@ -309,8 +277,6 @@ int Sql_QueryStr(Sql* self, const char* query)
return SQL_SUCCESS;
}
-
-
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE query.
uint64 Sql_LastInsertId(Sql* self)
{
@@ -320,8 +286,6 @@ uint64 Sql_LastInsertId(Sql* self)
return 0;
}
-
-
/// Returns the number of columns in each row of the result.
uint32 Sql_NumColumns(Sql* self)
{
@@ -330,8 +294,6 @@ uint32 Sql_NumColumns(Sql* self)
return 0;
}
-
-
/// Returns the number of rows in the result.
uint64 Sql_NumRows(Sql* self)
{
@@ -340,8 +302,6 @@ uint64 Sql_NumRows(Sql* self)
return 0;
}
-
-
/// Fetches the next row.
int Sql_NextRow(Sql* self) {
if( self && self->result ) {
@@ -357,8 +317,6 @@ int Sql_NextRow(Sql* self) {
return SQL_ERROR;
}
-
-
/// Gets the data of a column.
int Sql_GetData(Sql* self, size_t col, char** out_buf, size_t* out_len)
{
@@ -375,8 +333,6 @@ int Sql_GetData(Sql* self, size_t col, char** out_buf, size_t* out_len)
return SQL_ERROR;
}
-
-
/// Frees the result of the query.
void Sql_FreeResult(Sql* self) {
if( self && self->result ) {
@@ -387,8 +343,6 @@ void Sql_FreeResult(Sql* self) {
}
}
-
-
/// Shows debug information (last query).
void Sql_ShowDebug_(Sql* self, const char* debug_file, const unsigned long debug_line)
{
@@ -400,8 +354,6 @@ void Sql_ShowDebug_(Sql* self, const char* debug_file, const unsigned long debug
ShowDebug("at %s:%lu\n", debug_file, debug_line);
}
-
-
/// Frees a Sql handle returned by Sql_Malloc.
void Sql_Free(Sql* self) {
if( self )
@@ -414,14 +366,10 @@ void Sql_Free(Sql* self) {
}
}
-
-
///////////////////////////////////////////////////////////////////////////////
// Prepared Statements
///////////////////////////////////////////////////////////////////////////////
-
-
/// Returns the mysql integer type for the target size.
///
/// @private
@@ -439,8 +387,6 @@ static enum enum_field_types Sql_P_SizeToMysqlIntType(int sz)
}
}
-
-
/// Binds a parameter/result.
///
/// @private
@@ -514,8 +460,6 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
return SQL_SUCCESS;
}
-
-
/// Prints debug information about a field (type and length).
///
/// @private
@@ -551,8 +495,6 @@ static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_ty
ShowDebug("%stype=%s%s, length=%lu%s\n", prefix, sign, type_string, length, length_postfix);
}
-
-
/// Reports debug information about a truncated column.
///
/// @private
@@ -575,8 +517,6 @@ static void SqlStmt_P_ShowDebugTruncatedColumn(SqlStmt* self, size_t i)
mysql_free_result(meta);
}
-
-
/// Allocates and initializes a new SqlStmt handle.
SqlStmt* SqlStmt_Malloc(Sql* sql) {
SqlStmt* self;
@@ -604,8 +544,6 @@ SqlStmt* SqlStmt_Malloc(Sql* sql) {
return self;
}
-
-
/// Prepares the statement.
int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) {
@@ -619,8 +557,6 @@ int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) {
return res;
}
-
-
/// Prepares the statement.
int SqlStmt_PrepareV(SqlStmt* self, const char* query, va_list args)
{
@@ -641,8 +577,6 @@ int SqlStmt_PrepareV(SqlStmt* self, const char* query, va_list args)
return SQL_SUCCESS;
}
-
-
/// Prepares the statement.
int SqlStmt_PrepareStr(SqlStmt* self, const char* query)
{
@@ -663,8 +597,6 @@ int SqlStmt_PrepareStr(SqlStmt* self, const char* query)
return SQL_SUCCESS;
}
-
-
/// Returns the number of parameters in the prepared statement.
size_t SqlStmt_NumParams(SqlStmt* self)
{
@@ -674,8 +606,6 @@ size_t SqlStmt_NumParams(SqlStmt* self)
return 0;
}
-
-
/// Binds a parameter to a buffer.
int SqlStmt_BindParam(SqlStmt* self, size_t idx, enum SqlDataType buffer_type, void* buffer, size_t buffer_len)
{
@@ -704,8 +634,6 @@ int SqlStmt_BindParam(SqlStmt* self, size_t idx, enum SqlDataType buffer_type, v
return SQL_SUCCESS;// out of range - ignore
}
-
-
/// Executes the prepared statement.
int SqlStmt_Execute(SqlStmt* self)
{
@@ -731,8 +659,6 @@ int SqlStmt_Execute(SqlStmt* self)
return SQL_SUCCESS;
}
-
-
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE statement.
uint64 SqlStmt_LastInsertId(SqlStmt* self)
{
@@ -742,8 +668,6 @@ uint64 SqlStmt_LastInsertId(SqlStmt* self)
return 0;
}
-
-
/// Returns the number of columns in each row of the result.
size_t SqlStmt_NumColumns(SqlStmt* self)
{
@@ -753,8 +677,6 @@ size_t SqlStmt_NumColumns(SqlStmt* self)
return 0;
}
-
-
/// Binds the result of a column to a buffer.
int SqlStmt_BindColumn(SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
if (self == NULL)
@@ -796,8 +718,6 @@ int SqlStmt_BindColumn(SqlStmt *self, size_t idx, enum SqlDataType buffer_type,
}
}
-
-
/// Returns the number of rows in the result.
uint64 SqlStmt_NumRows(SqlStmt* self)
{
@@ -807,8 +727,6 @@ uint64 SqlStmt_NumRows(SqlStmt* self)
return 0;
}
-
-
/// Fetches the next row.
int SqlStmt_NextRow(SqlStmt* self)
{
@@ -892,8 +810,6 @@ int SqlStmt_NextRow(SqlStmt* self)
return SQL_SUCCESS;
}
-
-
/// Frees the result of the statement execution.
void SqlStmt_FreeResult(SqlStmt* self)
{
@@ -901,8 +817,6 @@ void SqlStmt_FreeResult(SqlStmt* self)
mysql_stmt_free_result(self->stmt);
}
-
-
/// Shows debug information (with statement).
void SqlStmt_ShowDebug_(SqlStmt* self, const char* debug_file, const unsigned long debug_line)
{
@@ -914,8 +828,6 @@ void SqlStmt_ShowDebug_(SqlStmt* self, const char* debug_file, const unsigned lo
ShowDebug("at %s:%lu\n", debug_file, debug_line);
}
-
-
/// Frees a SqlStmt returned by SqlStmt_Malloc.
void SqlStmt_Free(SqlStmt* self)
{
diff --git a/src/common/sql.h b/src/common/sql.h
index 7fb4aabe8..fc1562347 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -142,8 +142,6 @@ struct sql_interface {
/// Allocates and initializes a new Sql handle.
struct Sql *(*Malloc) (void);
-
-
///////////////////////////////////////////////////////////////////////////////
// Prepared Statements
///////////////////////////////////////////////////////////////////////////////
@@ -157,7 +155,6 @@ struct sql_interface {
// 1) SELECT col FROM table WHERE id=?
// 2) INSERT INTO table(col1,col2) VALUES(?,?)
-
/*=====================================
SQL Statement interface [Susu]
*-------------------------------------*/
@@ -169,8 +166,6 @@ struct sql_interface {
/// @return SqlStmt handle or NULL if an error occurred
struct SqlStmt* (*StmtMalloc)(Sql* sql);
-
-
/// Prepares the statement.
/// Any previous result is freed and all parameter bindings are removed.
/// The query is constructed as if it was sprintf.
@@ -185,8 +180,6 @@ struct sql_interface {
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtPrepareV)(SqlStmt* self, const char* query, va_list args);
-
-
/// Prepares the statement.
/// Any previous result is freed and all parameter bindings are removed.
/// The query is used directly.
@@ -194,15 +187,11 @@ struct sql_interface {
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtPrepareStr)(SqlStmt* self, const char* query);
-
-
/// Returns the number of parameters in the prepared statement.
///
/// @return Number or parameters
size_t (*StmtNumParams)(SqlStmt* self);
-
-
/// Binds a parameter to a buffer.
/// The buffer data will be used when the statement is executed.
/// All parameters should have bindings.
@@ -210,30 +199,22 @@ struct sql_interface {
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtBindParam)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len);
-
-
/// Executes the prepared statement.
/// Any previous result is freed and all column bindings are removed.
///
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtExecute)(SqlStmt* self);
-
-
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE statement.
///
/// @return Value of the auto-increment column
uint64 (*StmtLastInsertId)(SqlStmt* self);
-
-
/// Returns the number of columns in each row of the result.
///
/// @return Number of columns
size_t (*StmtNumColumns)(SqlStmt* self);
-
-
/// Binds the result of a column to a buffer.
/// The buffer will be filled with data when the next row is fetched.
/// For string/enum buffer types there has to be enough space for the data
@@ -242,23 +223,17 @@ struct sql_interface {
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtBindColumn)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len, uint32* out_length, int8* out_is_null);
-
-
/// Returns the number of rows in the result.
///
/// @return Number of rows
uint64 (*StmtNumRows)(SqlStmt* self);
-
-
/// Fetches the next row.
/// All column bindings will be filled with data.
///
/// @return SQL_SUCCESS, SQL_ERROR or SQL_NO_DATA
int (*StmtNextRow)(SqlStmt* self);
-
-
/// Frees the result of the statement execution.
void (*StmtFreeResult)(SqlStmt* self);
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 024b73e59..fcd1b483b 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -423,8 +423,6 @@ bool strlib_bin2hex(char *output, unsigned char *input, size_t count)
return true;
}
-
-
/////////////////////////////////////////////////////////////////////
/// Parses a single field in a delim-separated string.
/// The delimiter after the field is skipped.
@@ -582,7 +580,6 @@ int sv_parse_next(struct s_svstate* svstate)
return 1;
}
-
/// Parses a delim-separated string.
/// Starts parsing at startoff and fills the pos array with position pairs.
/// out_pos[0] and out_pos[1] are the start and end of line.
@@ -892,7 +889,6 @@ const char* skip_escaped_c(const char* p) {
return p;
}
-
/// Opens and parses a file containing delim-separated columns, feeding them to the specified callback function row by row.
/// Tracks the progress of the operation (current line number, number of successfully processed rows).
/// Returns 'true' if it was able to process the specified file, or 'false' if it could not be read.
@@ -970,7 +966,6 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc
return true;
}
-
/////////////////////////////////////////////////////////////////////
// StringBuf - dynamic string
//
diff --git a/src/common/thread.c b/src/common/thread.c
index 9b9308d06..d5bbd7f97 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -48,12 +48,10 @@ struct rAthread {
#endif
};
-
#ifdef HAS_TLS
__thread int g_rathread_ID = -1;
#endif
-
///
/// Subystem Code
///
@@ -76,8 +74,6 @@ void rathread_init(void) {
}//end: rathread_init()
-
-
void rathread_final(void) {
register unsigned int i;
@@ -94,8 +90,6 @@ void rathread_final(void) {
}//end: rathread_final()
-
-
// gets called whenever a thread terminated ..
static void rat_thread_terminated(rAthread *handle) {
// Preserve handle->myID and handle->hThread, set everything else to its default value
@@ -131,7 +125,6 @@ static void *raThreadMainRedirector( void *p ){
#endif
-
ret = ((rAthread*)p)->proc( ((rAthread*)p)->param ) ;
#ifdef WIN32
@@ -146,10 +139,6 @@ static void *raThreadMainRedirector( void *p ){
#endif
}//end: raThreadMainRedirector()
-
-
-
-
///
/// API Level
///
@@ -157,7 +146,6 @@ rAthread *rathread_create(rAthreadProc entryPoint, void *param) {
return rathread_createEx( entryPoint, param, (1<<23) /*8MB*/, RAT_PRIO_NORMAL );
}//end: rathread_create()
-
rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio) {
#ifndef WIN32
pthread_attr_t attr;
@@ -166,13 +154,11 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack
unsigned int i;
rAthread *handle = NULL;
-
// given stacksize aligned to systems pagesize?
tmp = szStack % sysinfo->getpagesize();
if(tmp != 0)
szStack += tmp;
-
// Get a free Thread Slot.
for(i = 0; i < RA_THREADS_MAX; i++){
if(l_threads[i].proc == NULL){
@@ -208,7 +194,6 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack
return handle;
}//end: rathread_createEx
-
void rathread_destroy(rAthread *handle) {
#ifdef WIN32
if( TerminateThread(handle->hThread, 0) != FALSE){
@@ -253,7 +238,6 @@ rAthread *rathread_self(void) {
return NULL;
}//end: rathread_self()
-
int rathread_get_tid(void) {
#ifdef HAS_TLS
@@ -269,7 +253,6 @@ int rathread_get_tid(void) {
}//end: rathread_get_tid()
-
bool rathread_wait(rAthread *handle, void **out_exitCode) {
// Hint:
// no thread data cleanup routine call here!
@@ -286,18 +269,15 @@ bool rathread_wait(rAthread *handle, void **out_exitCode) {
}//end: rathread_wait()
-
void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio) {
handle->prio = RAT_PRIO_NORMAL;
//@TODO
}//end: rathread_prio_set()
-
RATHREAD_PRIO rathread_prio_get(rAthread *handle) {
return handle->prio;
}//end: rathread_prio_get()
-
void rathread_yield(void) {
#ifdef WIN32
SwitchToThread();
diff --git a/src/common/utils.c b/src/common/utils.c
index 3606c6755..f5eecb65d 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -60,7 +60,6 @@ void WriteDump(FILE* fp, const void* buffer, size_t length)
}
}
-
/// Dumps given buffer on the console.
void ShowDump(const void *buffer, size_t length) {
size_t i;
@@ -86,7 +85,6 @@ void ShowDump(const void *buffer, size_t length) {
}
}
-
#ifdef WIN32
static char* checkpath(char *path, const char *srcpath)
@@ -137,7 +135,6 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
func( tmppath );
}
-
if( FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
findfile(tmppath, pat, func);
@@ -155,7 +152,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) {
while(*srcpath) {
if (*srcpath=='\\') {
@@ -349,7 +346,6 @@ const char* timestamp2string(char* str, size_t size, time_t timestamp, const cha
return str;
}
-
/* [Ind/Hercules] Caching */
bool HCache_check(const char *file)
{
diff --git a/src/config/core.h b/src/config/core.h
index da9296bda..3832b185e 100644
--- a/src/config/core.h
+++ b/src/config/core.h
@@ -64,7 +64,6 @@
/// Uncomment to enable real-time server stats (in and out data and ram usage). [Ai4rei]
//#define SHOW_SERVER_STATS
-
/// Comment to disable autotrade persistency (where autotrading merchants survive server restarts)
#define AUTOTRADE_PERSISTENCY
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index a59fbb6ef..ac78e8c84 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -128,6 +128,10 @@ bool HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataType
ret->HPDataSRCPtr = (void**)(&((struct battleground_data *)ptr)->hdata);
ret->hdatac = &((struct battleground_data *)ptr)->hdatac;
break;
+ case HPDT_AUTOTRADE_VEND:
+ ret->HPDataSRCPtr = (void**)(&((struct autotrade_vending *)ptr)->hdata);
+ ret->hdatac = &((struct autotrade_vending *)ptr)->hdatac;
+ break;
default:
return false;
}
@@ -143,27 +147,27 @@ void HPM_map_plugin_load_sub(struct hplugin *plugin) {
bool HPM_map_add_atcommand(char *name, AtCommandFunc func) {
unsigned int i = 0;
-
+
for(i = 0; i < atcommand_list_items; i++) {
if( !strcmpi(atcommand_list[i].name,name) ) {
ShowDebug("HPM_map_add_atcommand: duplicate command '%s', skipping...\n", name);
return false;
}
}
-
+
i = atcommand_list_items;
-
+
RECREATE(atcommand_list, struct HPM_atcommand_list , ++atcommand_list_items);
-
+
safestrncpy(atcommand_list[i].name, name, sizeof(atcommand_list[i].name));
atcommand_list[i].func = func;
-
+
return true;
}
void HPM_map_atcommands(void) {
unsigned int i;
-
+
for(i = 0; i < atcommand_list_items; i++) {
atcommand->add(atcommand_list[i].name,atcommand_list[i].func,true);
}
@@ -174,9 +178,9 @@ void HPM_map_atcommands(void) {
**/
void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask) {
unsigned char index = pcg->HPMpermissions_count;
-
+
RECREATE(pcg->HPMpermissions, struct pc_groups_new_permission, ++pcg->HPMpermissions_count);
-
+
pcg->HPMpermissions[index].pID = pluginID;
pcg->HPMpermissions[index].name = aStrdup(name);
pcg->HPMpermissions[index].mask = mask;
@@ -203,6 +207,5 @@ void HPM_map_do_final(void) {
}
aFree(pcg->HPMpermissions);
}
-
HPM->datacheck_final();
}
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 105f3304c..15422a74a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -67,6 +67,7 @@ static char atcmd_player_name[NAME_LENGTH];
struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
int i = 0;
+ nullpo_retr(NULL, name);
if( *name == atcommand->at_symbol || *name == atcommand->char_symbol )
name++; // for backwards compatibility
@@ -76,18 +77,16 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
}
const char* atcommand_msgsd(struct map_session_data *sd, int msg_number) {
- if( !(msg_number >= 0 && msg_number < MAX_MSG) )
- return "??";
- if( !sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number] )
+ Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG);
+ if (!sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number])
return atcommand->msg_table[0][msg_number];
return atcommand->msg_table[sd->lang_id][msg_number];
}
const char* atcommand_msgfd(int fd, int msg_number) {
struct map_session_data *sd = sockt->session_is_valid(fd) ? sockt->session[fd]->session_data : NULL;
- if( !(msg_number >= 0 && msg_number < MAX_MSG) )
- return "??";
- if( !sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number] )
+ Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG);
+ if (!sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number])
return atcommand->msg_table[0][msg_number];
return atcommand->msg_table[sd->lang_id][msg_number];
}
@@ -96,13 +95,12 @@ const char* atcommand_msgfd(int fd, int msg_number) {
// Return the message string of the specified number by [Yor]
//-----------------------------------------------------------
const char* atcommand_msg(int msg_number) {
- if (msg_number >= 0 && msg_number < MAX_MSG) {
- if(atcommand->msg_table[map->default_lang_id][msg_number] != NULL && atcommand->msg_table[map->default_lang_id][msg_number][0] != '\0')
- return atcommand->msg_table[map->default_lang_id][msg_number];
-
- if(atcommand->msg_table[0][msg_number] != NULL && atcommand->msg_table[0][msg_number][0] != '\0')
- return atcommand->msg_table[0][msg_number];
- }
+ Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG);
+ if (atcommand->msg_table[map->default_lang_id][msg_number] != NULL && atcommand->msg_table[map->default_lang_id][msg_number][0] != '\0')
+ return atcommand->msg_table[map->default_lang_id][msg_number];
+
+ if(atcommand->msg_table[0][msg_number] != NULL && atcommand->msg_table[0][msg_number][0] != '\0')
+ return atcommand->msg_table[0][msg_number];
return "??";
}
@@ -120,11 +118,12 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
FILE *fp;
static int called = 1;
+ nullpo_retr(false, cfg_name);
if ((fp = fopen(cfg_name, "r")) == NULL) {
ShowError("Messages file not found: %s\n", cfg_name);
return false;
}
-
+
if( !atcommand->max_message_table )
atcommand->expand_message_table();
@@ -135,7 +134,7 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
continue;
if (strcmpi(w1, "import") == 0) {
- msg_config_read(w2, true);
+ atcommand->msg_read(w2, true);
} else {
msg_number = atoi(w1);
if (msg_number >= 0 && msg_number < MAX_MSG) {
@@ -153,9 +152,8 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
}
}
}
-
fclose(fp);
-
+
if( ++called == 1 ) { //Original
if( script->lang_export_fp ) {
int i;
@@ -179,7 +177,7 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
*------------------------------------------*/
void do_final_msg(void) {
int i, j;
-
+
for(i = 0; i < atcommand->max_message_table; i++) {
for (j = 0; j < MAX_MSG; j++) {
if( atcommand->msg_table[i][j] )
@@ -187,7 +185,7 @@ void do_final_msg(void) {
}
aFree(atcommand->msg_table[i]);
}
-
+
if( atcommand->msg_table )
aFree(atcommand->msg_table);
}
@@ -199,8 +197,6 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) {
return info->help;
}
-
-
/*==========================================
* @send (used for testing packet sends from the client)
*------------------------------------------*/
@@ -210,8 +206,8 @@ ACMD(send)
long num;
// read message type as hex number (without the 0x)
- if (!message || !*message
- || !((sscanf(message, "len %x", &type)==1 && (len=1))
+ if (!*message
+ || !((sscanf(message, "len %x", &type)==1 && (len=1, true))
|| sscanf(message, "%x", &type)==1)
) {
clif->message(fd, msg_fd(fd,900)); // Usage:
@@ -223,7 +219,7 @@ ACMD(send)
#define PARSE_ERROR(error,p) do {\
clif->message(fd, (error));\
- sprintf(atcmd_output, ">%s", (p));\
+ safesnprintf(atcmd_output, sizeof(atcmd_output), ">%s", (p));\
clif->message(fd, atcmd_output);\
} while(0) //define PARSE_ERROR
@@ -246,19 +242,19 @@ ACMD(send)
}\
} while(0) //define GET_VALUE
- if (type > 0 && type < MAX_PACKET_DB) {
+ if (type >= MIN_PACKET_DB && type <= MAX_PACKET_DB) {
int off = 2;
if (len) {
// show packet length
- sprintf(atcmd_output, msg_fd(fd,904), type, packet_db[type].len); // Packet 0x%x length: %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, clif->packet(type)->len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
return true;
}
- len=packet_db[type].len;
+ len = clif->packet(type)->len;
if (len == 0) {
// unknown packet - ERROR
- sprintf(atcmd_output, msg_fd(fd,905), type); // Unknown packet: 0x%x
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,905), type); // Unknown packet: 0x%x
clif->message(fd, atcmd_output);
return false;
} else if (len == -1) {
@@ -406,7 +402,7 @@ ACMD(send)
SKIP_VALUE(message);
}
- if(packet_db[type].len == -1) {// send dynamic packet
+ if (clif->packet(type)->len == -1) { // send dynamic packet
WFIFOW(sd->fd,2)=TOW(off);
WFIFOSET(sd->fd,off);
} else {// send static packet
@@ -438,9 +434,9 @@ ACMD(mapmove) {
memset(map_name, '\0', sizeof(map_name));
- if (!message || !*message ||
- (sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 &&
- sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) {
+ if (!*message ||
+ (sscanf(message, "%15s %5hd %5hd", map_name, &x, &y) < 3 &&
+ sscanf(message, "%15[^,],%5hd,%5hd", map_name, &x, &y) < 1)) {
clif->message(fd, msg_fd(fd,909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
return false;
}
@@ -459,7 +455,7 @@ ACMD(mapmove) {
return false;
}
- if ((x || y) && map->getcell(m, x, y, CELL_CHKNOPASS) && pc_get_group_level(sd) < battle_config.gm_ignore_warpable_area) {
+ if ((x || y) && map->getcell(m, &sd->bl, x, y, CELL_CHKNOPASS) && pc_get_group_level(sd) < battle_config.gm_ignore_warpable_area) {
//This is to prevent the pc->setpos call from printing an error.
clif->message(fd, msg_fd(fd,2));
if (!map->search_freecell(NULL, m, &x, &y, 10, 10, 1))
@@ -490,7 +486,7 @@ ACMD(where) {
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,910)); // Please enter a player name (usage: @where <char name>).
return false;
}
@@ -516,7 +512,7 @@ ACMD(where) {
ACMD(jumpto) {
struct map_session_data *pl_sd = NULL;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
return false;
}
@@ -547,7 +543,7 @@ ACMD(jumpto) {
}
pc->setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
- sprintf(atcmd_output, msg_fd(fd,4), pl_sd->status.name); // Jumped to %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,4), pl_sd->status.name); // Jumped to %s
clif->message(fd, atcmd_output);
return true;
@@ -562,7 +558,7 @@ ACMD(jump)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- sscanf(message, "%hd %hd", &x, &y);
+ sscanf(message, "%5hd %5hd", &x, &y);
if (map->list[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
clif->message(fd, msg_fd(fd,248)); // You are not authorized to warp from your current map.
@@ -574,20 +570,20 @@ ACMD(jump)
return false;
}
- if ((x || y) && map->getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) {
+ if ((x || y) && map->getcell(sd->bl.m, &sd->bl, x, y, CELL_CHKNOPASS)) {
//This is to prevent the pc->setpos call from printing an error.
clif->message(fd, msg_fd(fd,2));
if (!map->search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
}
- if( x && y && sd->bl.x == x && sd->bl.y == y ) {
+ if (x && y && sd->bl.x == x && sd->bl.y == y) {
clif->message(fd, msg_fd(fd,253)); // You already are at your destination!
return false;
}
pc->setpos(sd, sd->mapindex, x, y, CLR_TELEPORT);
- sprintf(atcmd_output, msg_fd(fd,5), sd->bl.x, sd->bl.y); // Jumped to %d %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,5), sd->bl.x, sd->bl.y); // Jumped to %d %d
clif->message(fd, atcmd_output);
return true;
}
@@ -735,18 +731,18 @@ ACMD(whogm)
if (pl_level > level) {
if (pc_isinvisible(pl_sd))
continue;
- sprintf(atcmd_output, msg_fd(fd,913), pl_sd->status.name); // Name: %s (GM)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,913), pl_sd->status.name); // Name: %s (GM)
clif->message(fd, atcmd_output);
count++;
continue;
}
- sprintf(atcmd_output, msg_fd(fd,914), // Name: %s (GM:%d) | Location: %s %d %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,914), // Name: %s (GM:%d) | Location: %s %d %d
pl_sd->status.name, pl_level,
mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,915), // BLvl: %d | Job: %s (Lvl: %d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,915), // BLvl: %d | Job: %s (Lvl: %d)
pl_sd->status.base_level,
pc->job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif->message(fd, atcmd_output);
@@ -754,7 +750,7 @@ ACMD(whogm)
p = party->search(pl_sd->status.party_id);
g = pl_sd->guild;
- sprintf(atcmd_output,msg_fd(fd,916), // Party: '%s' | Guild: '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,916), // Party: '%s' | Guild: '%s'
p?p->party.name:msg_fd(fd,917), g?g->name:msg_fd(fd,917)); // None.
clif->message(fd, atcmd_output);
@@ -767,7 +763,7 @@ ACMD(whogm)
else if (count == 1)
clif->message(fd, msg_fd(fd,151)); // 1 GM found.
else {
- sprintf(atcmd_output, msg_fd(fd,152), count); // %d GMs found.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,152), count); // %d GMs found.
clif->message(fd, atcmd_output);
}
@@ -821,8 +817,8 @@ ACMD(speed)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d", &speed) < 1) {
- sprintf(atcmd_output, msg_fd(fd,918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
+ if (!*message || sscanf(message, "%12d", &speed) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -863,7 +859,6 @@ ACMD(storage)
return true;
}
-
/*==========================================
*
*------------------------------------------*/
@@ -903,7 +898,7 @@ ACMD(option)
{
int param1 = 0, param2 = 0, param3 = 0;
- if (!message || !*message || sscanf(message, "%d %d %d", &param1, &param2, &param3) < 1 || param1 < 0 || param2 < 0 || param3 < 0)
+ if (!*message || sscanf(message, "%12d %12d %12d", &param1, &param2, &param3) < 1 || param1 < 0 || param2 < 0 || param3 < 0)
{// failed to match the parameters so inform the user of the options
const char* text;
@@ -972,65 +967,64 @@ ACMD(hide) {
/*==========================================
* Changes a character's class
*------------------------------------------*/
-ACMD(jobchange) {
+ACMD(jobchange)
+{
int job = 0, upper = 0;
- const char* text;
-
- if (!message || !*message || sscanf(message, "%d %d", &job, &upper) < 1) {
- upper = 0;
+ bool found = false;
- if( message ) {
- int i;
- bool found = false;
-
- // Normal Jobs
- for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ) {
- if (strncmpi(message, pc->job_name(i), 16) == 0) {
- job = i;
- found = true;
- }
- }
+ if (*message == '\0') { // No message, just show the list
+ found = false;
+ } else if (sscanf(message, "%12d %12d", &job, &upper) >= 1) { // Numeric job ID
+ found = true;
+ } else { // Job name
+ int i;
- // High Jobs, Babies and Third
- for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){
- if (strncmpi(message, pc->job_name(i), 16) == 0) {
- job = i;
- found = true;
- }
+ // Normal Jobs
+ for (i = JOB_NOVICE; !found && i < JOB_MAX_BASIC; i++) {
+ if (strncmpi(message, pc->job_name(i), 16) == 0) {
+ job = i;
+ found = true;
+ break;
}
+ }
- if (!found) {
- text = atcommand_help_string(info);
- if (text)
- clif->messageln(fd, text);
- return false;
+ // High Jobs, Babies and Third
+ for (i = JOB_NOVICE_HIGH; !found && i < JOB_MAX; i++) {
+ if (strncmpi(message, pc->job_name(i), 16) == 0) {
+ job = i;
+ found = true;
+ break;
}
}
}
- /* WHY DO WE LIST THEM THEN? */
+
+ if (!found || !pc->db_checkid(job)) {
+ const char *text = atcommand_help_string(info);
+ if (text)
+ clif->messageln(fd, text);
+ return false;
+ }
+
// Deny direct transformation into dummy jobs
- if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2 || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER
- || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2
- || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
+ if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2
+ || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER
+ || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2
+ || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2
+ || job == JOB_STAR_GLADIATOR2
+ || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2)
+ || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
) {
+ /* WHY DO WE LIST THEM THEN? */
clif->message(fd, msg_fd(fd,923)); //"You can not change to this job by command."
return true;
}
- if (pc->db_checkid(job)) {
- if (pc->jobchange(sd, job, upper) == 0)
- clif->message(fd, msg_fd(fd,12)); // Your job has been changed.
- else {
- clif->message(fd, msg_fd(fd,155)); // You are unable to change your job.
- return false;
- }
- } else {
- text = atcommand_help_string(info);
- if (text)
- clif->messageln(fd, text);
+ if (pc->jobchange(sd, job, upper) != 0) {
+ clif->message(fd, msg_fd(fd,155)); // You are unable to change your job.
return false;
}
+ clif->message(fd, msg_fd(fd,12)); // Your job has been changed.
return true;
}
@@ -1070,7 +1064,7 @@ ACMD(kami)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if(*(info->command + 4) != 'c' && *(info->command + 4) != 'C') {
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,980)); // Please enter a message (usage: @kami <message>).
return false;
}
@@ -1081,7 +1075,7 @@ ACMD(kami)
else
intif->broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(info->command + 4) == 'b' || *(info->command + 4) == 'B') ? BC_BLUE : BC_YELLOW);
} else {
- if(!message || !*message || (sscanf(message, "%u %199[^\n]", &color, atcmd_output) < 2)) {
+ if(!*message || (sscanf(message, "%10u %199[^\n]", &color, atcmd_output) < 2)) {
clif->message(fd, msg_fd(fd,981)); // Please enter color and message (usage: @kamic <color> <message>).
return false;
}
@@ -1102,12 +1096,12 @@ ACMD(heal)
{
int hp = 0, sp = 0; // [Valaris] thanks to fov
- sscanf(message, "%d %d", &hp, &sp);
+ sscanf(message, "%12d %12d", &hp, &sp);
// some overflow checks
if( hp == INT_MIN ) hp++;
if( sp == INT_MIN ) sp++;
-
+
if ( hp == 0 && sp == 0 ) {
if (!status_percent_heal(&sd->bl, 100, 100))
clif->message(fd, msg_fd(fd,157)); // HP and SP have already been recovered.
@@ -1166,15 +1160,15 @@ ACMD(item)
memset(item_name, '\0', sizeof(item_name));
- if (!strcmpi(info->command,"itembound") && (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 2 &&
- sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2
+ if (!strcmpi(info->command,"itembound") && (!*message || (
+ sscanf(message, "\"%99[^\"]\" %12d %12d", item_name, &number, &bound) < 2 &&
+ sscanf(message, "%99s %12d %12d", item_name, &number, &bound) < 2
))) {
clif->message(fd, msg_fd(fd,295)); // Please enter an item name or ID (usage: @itembound <item name/ID> <quantity> <bound_type>).
return false;
- } else if (!message || !*message
- || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1
- && sscanf(message, "%99s %d", item_name, &number) < 1
+ } else if (!*message
+ || ( sscanf(message, "\"%99[^\"]\" %12d", item_name, &number) < 1
+ && sscanf(message, "%99s %12d", item_name, &number) < 1
)) {
clif->message(fd, msg_fd(fd,983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
return false;
@@ -1257,15 +1251,15 @@ ACMD(item2)
memset(item_name, '\0', sizeof(item_name));
- if (!strcmpi(info->command,"itembound2") && (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 &&
- sscanf(message, "%99s %d %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 ))) {
+ if (!strcmpi(info->command,"itembound2") && (!*message || (
+ sscanf(message, "\"%99[^\"]\" %12d %12d %12d %12d %12d %12d %12d %12d %12d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 &&
+ sscanf(message, "%99s %12d %12d %12d %12d %12d %12d %12d %12d %12d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 ))) {
clif->message(fd, msg_fd(fd,296)); // Please enter all parameters (usage: @itembound2 <item name/ID> <quantity>
clif->message(fd, msg_fd(fd,297)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound_type>).
return false;
- } else if ( !message || !*message
- || ( sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
- && sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
+ } else if (!*message
+ || ( sscanf(message, "\"%99[^\"]\" %12d %12d %12d %12d %12d %12d %12d %12d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
+ && sscanf(message, "%99s %12d %12d %12d %12d %12d %12d %12d %12d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
)) {
clif->message(fd, msg_fd(fd,984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
clif->message(fd, msg_fd(fd,985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
@@ -1361,7 +1355,7 @@ ACMD(baselevelup)
{
int level=0, i=0, status_point=0;
- if (!message || !*message || !(level = atoi(message))) {
+ if (!*message || !(level = atoi(message))) {
clif->message(fd, msg_fd(fd,986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
return false;
}
@@ -1420,7 +1414,7 @@ ACMD(joblevelup)
{
int level=0;
- if (!message || !*message || !(level = atoi(message))) {
+ if (!*message || !(level = atoi(message))) {
clif->message(fd, msg_fd(fd,987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
return false;
}
@@ -1470,7 +1464,7 @@ ACMD(help) {
char *default_command = "help";
AtCommandInfo *tinfo = NULL;
- if (!message || !*message) {
+ if (!*message) {
command_name = default_command; // If no command_name specified, display help for @help.
} else {
if (*message == atcommand->at_symbol || *message == atcommand->char_symbol)
@@ -1479,7 +1473,7 @@ ACMD(help) {
}
if (!atcommand->can_use2(sd, command_name, COMMAND_ATCOMMAND)) {
- sprintf(atcmd_output, msg_fd(fd,153), message); // "%s is Unknown Command"
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,153), message); // "%s is Unknown Command"
clif->message(fd, atcmd_output);
atcommand->get_suggestions(sd, command_name, true);
return false;
@@ -1488,13 +1482,13 @@ ACMD(help) {
tinfo = atcommand->get_info_byname(atcommand->check_alias(command_name));
if ( !tinfo || tinfo->help == NULL ) {
- sprintf(atcmd_output, msg_fd(fd,988), atcommand->at_symbol, command_name); // There is no help for %c%s.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,988), atcommand->at_symbol, command_name); // There is no help for %c%s.
clif->message(fd, atcmd_output);
atcommand->get_suggestions(sd, command_name, true);
return false;
}
- sprintf(atcmd_output, msg_fd(fd,989), atcommand->at_symbol, command_name); // Help for command %c%s:
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,989), atcommand->at_symbol, command_name); // Help for command %c%s:
clif->message(fd, atcmd_output);
{ // Display aliases
@@ -1525,25 +1519,37 @@ ACMD(help) {
return true;
}
-// helper function, used in foreach calls to stop auto-attack timers
-// parameter: '0' - everyone, 'id' - only those attacking someone with that id
+/**
+ * Helper function, used in foreach calls to stop auto-attack timers.
+ *
+ * @see map_foreachinmap
+ *
+ * Arglist parameters:
+ * - (int) id: If 0, stop any attacks. Otherwise, the target block list id to stop attacking.
+ */
int atcommand_stopattack(struct block_list *bl,va_list ap)
{
- struct unit_data *ud = unit->bl2ud(bl);
- int id = va_arg(ap, int);
- if (ud && ud->attacktimer != INVALID_TIMER && (!id || id == ud->target))
- {
+ struct unit_data *ud = NULL;
+ int id = 0;
+ nullpo_ret(bl);
+
+ ud = unit->bl2ud(bl);
+ id = va_arg(ap, int);
+
+ if (ud && ud->attacktimer != INVALID_TIMER && (!id || id == ud->target)) {
unit->stop_attack(bl);
return 1;
}
return 0;
}
+
/*==========================================
*
*------------------------------------------*/
int atcommand_pvpoff_sub(struct block_list *bl,va_list ap)
{
TBL_PC* sd = (TBL_PC*)bl;
+ nullpo_ret(bl);
clif->pvpset(sd, 0, 0, 2);
if (sd->pvp_timer != INVALID_TIMER) {
timer->delete(sd->pvp_timer, pc->calc_pvprank_timer);
@@ -1578,6 +1584,7 @@ ACMD(pvpoff)
int atcommand_pvpon_sub(struct block_list *bl,va_list ap)
{
TBL_PC* sd = (TBL_PC*)bl;
+ nullpo_ret(bl);
if (sd->pvp_timer == INVALID_TIMER) {
sd->pvp_timer = timer->add(timer->gettick() + 200, pc->calc_pvprank_timer, sd->bl.id, 0);
sd->pvp_rank = 0;
@@ -1658,8 +1665,8 @@ ACMD(model)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) {
- sprintf(atcmd_output, msg_fd(fd,991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
+ if (!*message || sscanf(message, "%12d %12d %12d", &hair_style, &hair_color, &cloth_color) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR);
clif->message(fd, atcmd_output);
return false;
@@ -1689,8 +1696,8 @@ ACMD(dye)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) {
- sprintf(atcmd_output, msg_fd(fd,992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
+ if (!*message || sscanf(message, "%12d", &cloth_color) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -1715,8 +1722,8 @@ ACMD(hair_style)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) {
- sprintf(atcmd_output, msg_fd(fd,993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
+ if (!*message || sscanf(message, "%12d", &hair_style) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -1741,8 +1748,8 @@ ACMD(hair_color)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) {
- sprintf(atcmd_output, msg_fd(fd,994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
+ if (!*message || sscanf(message, "%12d", &hair_color) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -1815,7 +1822,7 @@ ACMD(go) {
memset(map_name, '\0', sizeof(map_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%11s", map_name) < 1) {
+ if (!*message || sscanf(message, "%11s", map_name) < 1) {
// no value matched so send the list of locations
const char* text;
@@ -1824,7 +1831,7 @@ ACMD(go) {
clif->message(fd, msg_fd(fd,38)); // Invalid location number, or name.
- if( text ) {// send the text to the client
+ if (text) { // send the text to the client
clif->messageln( fd, text );
}
@@ -1915,18 +1922,18 @@ ACMD(monster)
memset(monster, '\0', sizeof(monster));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,80)); // Please specify a display name or monster name/id.
return false;
}
- if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 ||
- sscanf(message, "%23s \"%23[^\"]\" %d", monster, name, &number) > 1) {
+ if (sscanf(message, "\"%23[^\"]\" %23s %12d", name, monster, &number) > 1 ||
+ sscanf(message, "%23s \"%23[^\"]\" %12d", monster, name, &number) > 1) {
//All data can be left as it is.
- } else if ((count=sscanf(message, "%23s %d %23s", monster, &number, name)) > 1) {
+ } else if ((count=sscanf(message, "%23s %12d %23s", monster, &number, name)) > 1) {
//Here, it is possible name was not given and we are using monster for it.
if (count < 3) //Blank mob's name.
name[0] = '\0';
- } else if (sscanf(message, "%23s %23s %d", name, monster, &number) > 1) {
+ } else if (sscanf(message, "%23s %23s %12d", name, monster, &number) > 1) {
//All data can be left as it is.
} else if (sscanf(message, "%23s", monster) > 0) {
//As before, name may be already filled.
@@ -1947,7 +1954,7 @@ ACMD(monster)
if (number <= 0)
number = 1;
- if( !name[0] )
+ if (!name[0])
strcpy(name, "--ja--");
// If value of atcommand_spawn_quantity_limit directive is greater than or equal to 1 and quantity of monsters is greater than value of the directive
@@ -1977,7 +1984,7 @@ ACMD(monster)
if (number == count)
clif->message(fd, msg_fd(fd,39)); // All monster summoned!
else {
- sprintf(atcmd_output, msg_fd(fd,240), count); // %d monster(s) summoned!
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,240), count); // %d monster(s) summoned!
clif->message(fd, atcmd_output);
}
else {
@@ -1993,12 +2000,10 @@ ACMD(monster)
*------------------------------------------*/
int atkillmonster_sub(struct block_list *bl, va_list ap)
{
- struct mob_data *md;
- int flag;
-
- nullpo_ret(md=(struct mob_data *)bl);
- flag = va_arg(ap, int);
+ struct mob_data *md = (struct mob_data *)bl;
+ int flag = va_arg(ap, int);
+ nullpo_ret(bl);
if (md->guardian_data)
return 0; //Do not touch WoE mobs!
@@ -2015,9 +2020,9 @@ ACMD(killmonster) {
memset(map_name, '\0', sizeof(map_name));
- if (!message || !*message || sscanf(message, "%15s", map_name) < 1)
+ if (!*message || sscanf(message, "%15s", map_name) < 1) {
map_id = sd->bl.m;
- else {
+ } else {
if ((map_id = map->mapname2mapid(map_name)) < 0)
map_id = sd->bl.m;
}
@@ -2041,27 +2046,27 @@ ACMD(refine)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
+ if (!*message || sscanf(message, "%12d %12d", &position, &refine) < 2) {
clif->message(fd, msg_fd(fd,996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
- sprintf(atcmd_output, msg_fd(fd,997), EQP_HEAD_LOW); // %d: Lower Headgear
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,997), EQP_HEAD_LOW); // %d: Lower Headgear
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,998), EQP_HAND_R); // %d: Right Hand
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,998), EQP_HAND_R); // %d: Right Hand
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,999), EQP_GARMENT); // %d: Garment
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,999), EQP_GARMENT); // %d: Garment
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1000), EQP_ACC_L); // %d: Left Accessory
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1000), EQP_ACC_L); // %d: Left Accessory
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1001), EQP_ARMOR); // %d: Body Armor
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1001), EQP_ARMOR); // %d: Body Armor
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1002), EQP_HAND_L); // %d: Left Hand
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1002), EQP_HAND_L); // %d: Left Hand
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1003), EQP_SHOES); // %d: Shoes
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1003), EQP_SHOES); // %d: Shoes
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1004), EQP_ACC_R); // %d: Right Accessory
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1004), EQP_ACC_R); // %d: Right Accessory
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1005), EQP_HEAD_TOP); // %d: Top Headgear
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1005), EQP_HEAD_TOP); // %d: Top Headgear
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1006), EQP_HEAD_MID); // %d: Mid Headgear
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1006), EQP_HEAD_MID); // %d: Mid Headgear
clif->message(fd, atcmd_output);
return false;
}
@@ -2103,7 +2108,7 @@ ACMD(refine)
else if (count == 1)
clif->message(fd, msg_fd(fd,167)); // 1 item has been refined.
else {
- sprintf(atcmd_output, msg_fd(fd,168), count); // %d items have been refined.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,168), count); // %d items have been refined.
clif->message(fd, atcmd_output);
}
@@ -2123,9 +2128,9 @@ ACMD(produce)
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(item_name, '\0', sizeof(item_name));
- if (!message || !*message || (
- sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
- sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
+ if (!*message || (
+ sscanf(message, "\"%99[^\"]\" %12d %12d", item_name, &attribute, &star) < 1 &&
+ sscanf(message, "%99s %12d %12d", item_name, &attribute, &star) < 1
)) {
clif->message(fd, msg_fd(fd,1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
return false;
@@ -2160,7 +2165,7 @@ ACMD(produce)
if ((flag = pc->additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
} else {
- sprintf(atcmd_output, msg_fd(fd,169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
clif->message(fd, atcmd_output);
return false;
}
@@ -2177,16 +2182,16 @@ ACMD(memo)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if( !message || !*message || sscanf(message, "%d", &position) < 1 )
+ if (!*message || sscanf(message, "%d", &position) < 1)
{
int i;
clif->message(sd->fd, msg_fd(fd,868)); // "Your current memo positions are:"
for( i = 0; i < MAX_MEMOPOINTS; i++ )
{
if( sd->status.memo_point[i].map )
- sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y);
else
- sprintf(atcmd_output, msg_fd(fd,171), i); // %d - void
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,171), i); // %d - void
clif->message(sd->fd, atcmd_output);
}
return true;
@@ -2194,7 +2199,7 @@ ACMD(memo)
if( position < 0 || position >= MAX_MEMOPOINTS )
{
- sprintf(atcmd_output, msg_fd(fd,1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -2212,13 +2217,13 @@ ACMD(gat) {
memset(atcmd_output, '\0', sizeof(atcmd_output));
for (y = 2; y >= -2; y--) {
- sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
map->list[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y,
- map->getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
+ map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
+ map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
+ map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
+ map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
+ map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
clif->message(fd, atcmd_output);
}
@@ -2233,7 +2238,7 @@ ACMD(displaystatus)
{
int i, type, flag, tick, val1 = 0, val2 = 0, val3 = 0;
- if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) {
+ if (!*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) {
clif->message(fd, msg_fd(fd,1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
return false;
}
@@ -2256,7 +2261,7 @@ ACMD(statuspoint)
int point;
unsigned int new_status_point;
- if (!message || !*message || (point = atoi(message)) == 0) {
+ if (!*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1010)); // Please enter a number (usage: @stpoint <number of points>).
return false;
}
@@ -2304,7 +2309,7 @@ ACMD(skillpoint)
int point;
unsigned int new_skill_point;
- if (!message || !*message || (point = atoi(message)) == 0) {
+ if (!*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1011)); // Please enter a number (usage: @skpoint <number of points>).
return false;
}
@@ -2351,12 +2356,12 @@ ACMD(zeny)
{
int zeny=0, ret=-1;
- if (!message || !*message || (zeny = atoi(message)) == 0) {
+ if (!*message || (zeny = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1012)); // Please enter an amount (usage: @zeny <amount>).
return false;
}
- if(zeny > 0){
+ if(zeny > 0) {
if((ret=pc->getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
clif->message(fd, msg_fd(fd,149)); // Unable to increase the number/value.
}
@@ -2384,7 +2389,7 @@ ACMD(param) {
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
+ if (!*message || sscanf(message, "%d", &value) < 1 || value == 0) {
clif->message(fd, msg_fd(fd,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
return false;
}
@@ -2448,7 +2453,7 @@ ACMD(stat_all) {
stats[4] = &sd->status.dex;
stats[5] = &sd->status.luk;
- if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
+ if (!*message || sscanf(message, "%d", &value) < 1 || value == 0) {
value = pc_maxparameter(sd);
max = pc_maxparameter(sd);
} else {
@@ -2497,7 +2502,7 @@ ACMD(guildlevelup) {
int16 added_level;
struct guild *guild_info;
- if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) {
+ if (!*message || sscanf(message, "%d", &level) < 1 || level == 0) {
clif->message(fd, msg_fd(fd,1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
return false;
}
@@ -2538,7 +2543,7 @@ ACMD(makeegg)
struct item_data *item_data;
int id, pet_id;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
return false;
}
@@ -2592,7 +2597,7 @@ ACMD(petfriendly)
int friendly;
struct pet_data *pd;
- if (!message || !*message || (friendly = atoi(message)) < 0) {
+ if (!*message || (friendly = atoi(message)) < 0) {
clif->message(fd, msg_fd(fd,1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
return false;
}
@@ -2628,7 +2633,7 @@ ACMD(pethungry)
int hungry;
struct pet_data *pd;
- if (!message || !*message || (hungry = atoi(message)) < 0) {
+ if (!*message || (hungry = atoi(message)) < 0) {
clif->message(fd, msg_fd(fd,1017)); // Please enter a valid number (usage: @pethungry <0-100>).
return false;
}
@@ -2684,7 +2689,7 @@ ACMD(petrename)
ACMD(recall) {
struct map_session_data *pl_sd = NULL;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1018)); // Please enter a player name (usage: @recall <char name/ID>).
return false;
}
@@ -2712,7 +2717,7 @@ ACMD(recall) {
return false;
}
pc->setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
- sprintf(atcmd_output, msg_fd(fd,46), pl_sd->status.name); // %s recalled!
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,46), pl_sd->status.name); // %s recalled!
clif->message(fd, atcmd_output);
return true;
@@ -2727,7 +2732,7 @@ ACMD(char_block)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1021)); // Please enter a player name (usage: @block <char name>).
return false;
}
@@ -2763,7 +2768,7 @@ ACMD(char_ban)
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
+ if (!*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
clif->message(fd, msg_fd(fd,1022)); // Please enter ban time and a player name (usage: @ban <time> <char name>).
return false;
}
@@ -2842,7 +2847,7 @@ ACMD(char_unblock)
{
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1024)); // Please enter a player name (usage: @unblock <char name>).
return false;
}
@@ -2861,7 +2866,7 @@ ACMD(char_unban)
{
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1025)); // Please enter a player name (usage: @unban <char name>).
return false;
}
@@ -2959,6 +2964,7 @@ ACMD(doommap)
*------------------------------------------*/
void atcommand_raise_sub(struct map_session_data* sd)
{
+ nullpo_retv(sd);
status->revive(&sd->bl, 100, 100);
clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
@@ -3012,7 +3018,7 @@ ACMD(kick)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1026)); // Please enter a player name (usage: @kick <char name/ID>).
return false;
}
@@ -3022,7 +3028,7 @@ ACMD(kick)
return false;
}
- if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
+ if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
{
clif->message(fd, msg_fd(fd,81)); // Your GM level don't authorize you to do this action on this player.
return false;
@@ -3042,7 +3048,7 @@ ACMD(kickall)
struct s_mapiterator* iter;
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) )
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter))
{
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kick only lower or same gm level
if (sd->status.account_id != pl_sd->status.account_id)
@@ -3076,8 +3082,8 @@ ACMD(questskill)
{
uint16 skill_id, index;
- if (!message || !*message || (skill_id = atoi(message)) <= 0)
- {// also send a list of skills applicable to this command
+ if (!*message || (skill_id = atoi(message)) <= 0)
+ { // also send a list of skills applicable to this command
const char* text;
// attempt to find the text corresponding to this command
@@ -3118,8 +3124,8 @@ ACMD(lostskill)
{
uint16 skill_id, index;
- if (!message || !*message || (skill_id = atoi(message)) <= 0)
- {// also send a list of skills applicable to this command
+ if (!*message || (skill_id = atoi(message)) <= 0)
+ { // also send a list of skills applicable to this command
const char* text;
// attempt to find the text corresponding to this command
@@ -3134,7 +3140,7 @@ ACMD(lostskill)
return false;
}
- if ( !( index = skill->get_index(skill_id) ) ) {
+ if (!( index = skill->get_index(skill_id))) {
clif->message(fd, msg_fd(fd,198)); // This skill number doesn't exist.
return false;
}
@@ -3165,7 +3171,7 @@ ACMD(spiritball)
max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF);
- if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs )
+ if (!*message || (number = atoi(message)) < 0 || number > max_spiritballs)
{
char msg[CHAT_SIZE_MAX];
safesnprintf(msg, sizeof(msg), msg_fd(fd,1028), max_spiritballs); // Please enter an amount (usage: @spiritball <number: 0-%d>).
@@ -3191,7 +3197,7 @@ ACMD(party)
memset(party_name, '\0', sizeof(party_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif->message(fd, msg_fd(fd,1029)); // Please enter a party name (usage: @party <party_name>).
return false;
}
@@ -3211,7 +3217,7 @@ ACMD(guild)
memset(guild_name, '\0', sizeof(guild_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_fd(fd,1030)); // Please enter a guild name (usage: @guild <guild_name>).
return false;
}
@@ -3227,8 +3233,7 @@ ACMD(guild)
ACMD(breakguild)
{
if (sd->status.guild_id) { // Check if the player has a guild
- struct guild *g;
- g = sd->guild; // Search the guild
+ struct guild *g = sd->guild; // Search the guild
if (g) { // Check if guild was found
if (sd->state.gmaster_flag) { // Check if player is guild master
int ret = 0;
@@ -3337,24 +3342,24 @@ ACMD(idsearch)
memset(item_name, '\0', sizeof(item_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%99s", item_name) < 0) {
+ if (!*message || sscanf(message, "%99s", item_name) < 0) {
clif->message(fd, msg_fd(fd,1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
return false;
}
- sprintf(atcmd_output, msg_fd(fd,77), item_name); // Search results for '%s' (name: id):
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,77), item_name); // Search results for '%s' (name: id):
clif->message(fd, atcmd_output);
match = itemdb->search_name_array(item_array, MAX_SEARCH, item_name, 0);
if (match > MAX_SEARCH) {
- sprintf(atcmd_output, msg_fd(fd,269), MAX_SEARCH, match);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, match);
clif->message(fd, atcmd_output);
match = MAX_SEARCH;
}
for(i = 0; i < match; i++) {
- sprintf(atcmd_output, msg_fd(fd,78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
clif->message(fd, atcmd_output);
}
- sprintf(atcmd_output, msg_fd(fd,79), match); // %d results found.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,79), match); // %d results found.
clif->message(fd, atcmd_output);
return true;
@@ -3378,7 +3383,7 @@ ACMD(recallall)
count = 0;
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter)) {
if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) {
if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)
continue; // Don't waste time warping the character to the same place.
@@ -3397,7 +3402,7 @@ ACMD(recallall)
clif->message(fd, msg_fd(fd,92)); // All characters recalled!
if (count) {
- sprintf(atcmd_output, msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
@@ -3418,7 +3423,7 @@ ACMD(guildrecall)
memset(guild_name, '\0', sizeof(guild_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_fd(fd,1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
return false;
}
@@ -3438,7 +3443,7 @@ ACMD(guildrecall)
count = 0;
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) )
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter))
{
if (sd->status.account_id != pl_sd->status.account_id && pl_sd->status.guild_id == g->guild_id) {
if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y))
@@ -3451,10 +3456,10 @@ ACMD(guildrecall)
}
mapit->free(iter);
- sprintf(atcmd_output, msg_fd(fd,93), g->name); // All online characters of the %s guild have been recalled to your position.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,93), g->name); // All online characters of the %s guild have been recalled to your position.
clif->message(fd, atcmd_output);
if (count) {
- sprintf(atcmd_output, msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
@@ -3475,7 +3480,7 @@ ACMD(partyrecall)
memset(party_name, '\0', sizeof(party_name));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif->message(fd, msg_fd(fd,1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
return false;
}
@@ -3507,10 +3512,10 @@ ACMD(partyrecall)
}
mapit->free(iter);
- sprintf(atcmd_output, msg_fd(fd,95), p->party.name); // All online characters of the %s party have been recalled to your position.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,95), p->party.name); // All online characters of the %s party have been recalled to your position.
clif->message(fd, atcmd_output);
if (count) {
- sprintf(atcmd_output, msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
clif->message(fd, atcmd_output);
}
@@ -3658,7 +3663,7 @@ ACMD(reloadscript) {
//atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" );
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter)) {
if (pl_sd->npc_id || pl_sd->npc_shopid) {
if (pl_sd->state.using_fake_npc) {
clif->clearunit_single(pl_sd->npc_id, CLR_OUTSIGHT, pl_sd->fd);
@@ -3709,7 +3714,7 @@ ACMD(mapinfo) {
memset(mapname, '\0', sizeof(mapname));
memset(direction, '\0', sizeof(direction));
- sscanf(message, "%d %23[^\n]", &list, mapname);
+ sscanf(message, "%12d %23[^\n]", &list, mapname);
if (list < 0 || list > 3) {
clif->message(fd, msg_fd(fd,1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
@@ -3744,7 +3749,7 @@ ACMD(mapinfo) {
}
mapit->free(iter);
- sprintf(atcmd_output, msg_fd(fd,1040), mapname, map->list[m_id].zone->name, map->list[m_id].users, map->list[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1040), mapname, map->list[m_id].zone->name, map->list[m_id].users, map->list[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1041)); // ------ Map Flags ------
if (map->list[m_id].flag.town)
@@ -3797,7 +3802,7 @@ ACMD(mapinfo) {
strcat(atcmd_output, msg_fd(fd,1064)); // NoMemo |
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1065), // No Exp Penalty: %s | No Zeny Penalty: %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1065), // No Exp Penalty: %s | No Zeny Penalty: %s
(map->list[m_id].flag.noexppenalty) ? msg_fd(fd,1066) : msg_fd(fd,1067),
(map->list[m_id].flag.nozenypenalty) ? msg_fd(fd,1066) : msg_fd(fd,1067)); // On / Off
clif->message(fd, atcmd_output);
@@ -3806,10 +3811,10 @@ ACMD(mapinfo) {
if (!map->list[m_id].save.map)
clif->message(fd, msg_fd(fd,1068)); // No Save (Return to last Save Point)
else if (map->list[m_id].save.x == -1 || map->list[m_id].save.y == -1 ) {
- sprintf(atcmd_output, msg_fd(fd,1069), mapindex_id2name(map->list[m_id].save.map)); // No Save, Save Point: %s,Random
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1069), mapindex_id2name(map->list[m_id].save.map)); // No Save, Save Point: %s,Random
clif->message(fd, atcmd_output);
} else {
- sprintf(atcmd_output, msg_fd(fd,1070), // No Save, Save Point: %s,%d,%d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1070), // No Save, Save Point: %s,%d,%d
mapindex_id2name(map->list[m_id].save.map),map->list[m_id].save.x,map->list[m_id].save.y);
clif->message(fd, atcmd_output);
}
@@ -3877,10 +3882,10 @@ ACMD(mapinfo) {
case 1:
clif->message(fd, msg_fd(fd,1098)); // ----- Players in Map -----
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) )
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter))
{
if (pl_sd->mapindex == m_index) {
- sprintf(atcmd_output, msg_fd(fd,1099), // Player '%s' (session #%d) | Location: %d,%d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1099), // Player '%s' (session #%d) | Location: %d,%d
pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
}
@@ -3904,27 +3909,27 @@ ACMD(mapinfo) {
default: strcpy(direction, msg_fd(fd,1110)); break; // Unknown
}
if(strcmp(nd->name,nd->exname) == 0)
- sprintf(atcmd_output, msg_fd(fd,1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
- ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1111), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d
+ ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
else
- sprintf(atcmd_output, msg_fd(fd,1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
- ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
+ ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
clif->message(fd, atcmd_output);
}
break;
case 3:
clif->message(fd, msg_fd(fd,1113)); // ----- Chats in Map -----
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) )
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter))
{
if ((cd = (struct chat_data*)map->id2bl(pl_sd->chatID)) != NULL &&
pl_sd->mapindex == m_index &&
cd->usersd[0] == pl_sd)
{
- sprintf(atcmd_output, msg_fd(fd,1114), // Chat: %s | Player: %s | Location: %d %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1114), // Chat: %s | Player: %s | Location: %d %d
cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1115), // Users: %d/%d | Password: %s | Public: %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1115), // Users: %d/%d | Password: %s | Public: %s
cd->users, cd->limit, cd->pass, (cd->pub) ? msg_fd(fd,1116) : msg_fd(fd,1117)); // Yes / No
clif->message(fd, atcmd_output);
}
@@ -3949,14 +3954,14 @@ ACMD(mount_peco)
return false;
}
- if( sd->sc.data[SC_ALL_RIDING] ) {
+ if (sd->sc.data[SC_ALL_RIDING]) {
clif->message(fd, msg_fd(fd,1476)); // You are already mounting something else
return false;
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT ) {
- if( !pc->checkskill(sd,RK_DRAGONTRAINING) ) {
- sprintf(atcmd_output, msg_fd(fd,213), skill->get_desc(RK_DRAGONTRAINING)); // You need %s to mount!
+ if ((sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) {
+ if (!pc->checkskill(sd,RK_DRAGONTRAINING)) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(RK_DRAGONTRAINING)); // You need %s to mount!
clif->message(fd, atcmd_output);
return false;
}
@@ -3969,13 +3974,13 @@ ACMD(mount_peco)
}
return true;
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER ) {
- if( !pc->checkskill(sd,RA_WUGRIDER) ) {
- sprintf(atcmd_output, msg_fd(fd,213), skill->get_desc(RA_WUGRIDER)); // You need %s to mount!
+ if ((sd->class_&MAPID_THIRDMASK) == MAPID_RANGER) {
+ if (!pc->checkskill(sd,RA_WUGRIDER)) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(RA_WUGRIDER)); // You need %s to mount!
clif->message(fd, atcmd_output);
return false;
}
- if( !pc_isridingwug(sd) ) {
+ if (!pc_isridingwug(sd)) {
clif->message(sd->fd,msg_fd(fd,1121)); // You have mounted your Warg.
pc->setridingwug(sd, true);
} else {
@@ -3984,8 +3989,8 @@ ACMD(mount_peco)
}
return true;
}
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
- if( !pc_ismadogear(sd) ) {
+ if ((sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC) {
+ if (!pc_ismadogear(sd)) {
clif->message(sd->fd,msg_fd(fd,1123)); // You have mounted your Mado Gear.
pc->setmadogear(sd, true);
} else {
@@ -3994,10 +3999,10 @@ ACMD(mount_peco)
}
return true;
}
- if( sd->class_&MAPID_SWORDMAN && sd->class_&JOBL_2 ) {
+ if (sd->class_&MAPID_SWORDMAN && sd->class_&JOBL_2) {
if (!pc_isridingpeco(sd)) { // if actually no peco
if (!pc->checkskill(sd, KN_RIDING)) {
- sprintf(atcmd_output, msg_fd(fd,213), skill->get_desc(KN_RIDING)); // You need %s to mount!
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(KN_RIDING)); // You need %s to mount!
clif->message(fd, atcmd_output);
return false;
}
@@ -4028,7 +4033,7 @@ ACMD(guildspy) {
clif->message(fd, msg_fd(fd,1125)); // The mapserver has spy command support disabled.
return false;
}
- if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_fd(fd,1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
return false;
}
@@ -4037,11 +4042,11 @@ ACMD(guildspy) {
(g = guild->search(atoi(message))) != NULL) {
if (sd->guildspy == g->guild_id) {
sd->guildspy = 0;
- sprintf(atcmd_output, msg_fd(fd,103), g->name); // No longer spying on the %s guild.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,103), g->name); // No longer spying on the %s guild.
clif->message(fd, atcmd_output);
} else {
sd->guildspy = g->guild_id;
- sprintf(atcmd_output, msg_fd(fd,104), g->name); // Spying on the %s guild.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,104), g->name); // Spying on the %s guild.
clif->message(fd, atcmd_output);
}
} else {
@@ -4068,7 +4073,7 @@ ACMD(partyspy) {
return false;
}
- if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif->message(fd, msg_fd(fd,1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
return false;
}
@@ -4077,11 +4082,11 @@ ACMD(partyspy) {
(p = party->search(atoi(message))) != NULL) {
if (sd->partyspy == p->party.party_id) {
sd->partyspy = 0;
- sprintf(atcmd_output, msg_fd(fd,105), p->party.name); // No longer spying on the %s party.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,105), p->party.name); // No longer spying on the %s party.
clif->message(fd, atcmd_output);
} else {
sd->partyspy = p->party.party_id;
- sprintf(atcmd_output, msg_fd(fd,106), p->party.name); // Spying on the %s party.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,106), p->party.name); // Spying on the %s party.
clif->message(fd, atcmd_output);
}
} else {
@@ -4128,7 +4133,7 @@ ACMD(nuke) {
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1128)); // Please enter a player name (usage: @nuke <char name>).
return false;
}
@@ -4158,7 +4163,7 @@ ACMD(tonpc) {
memset(npcname, 0, sizeof(npcname));
- if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", npcname) < 1) {
clif->message(fd, msg_fd(fd,1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
return false;
}
@@ -4185,7 +4190,7 @@ ACMD(shownpc)
memset(NPCname, '\0', sizeof(NPCname));
- if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif->message(fd, msg_fd(fd,1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
return false;
}
@@ -4210,7 +4215,7 @@ ACMD(hidenpc)
memset(NPCname, '\0', sizeof(NPCname));
- if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif->message(fd, msg_fd(fd,1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
return false;
}
@@ -4229,7 +4234,7 @@ ACMD(loadnpc)
{
FILE *fp;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1132)); // Please enter a script file name (usage: @loadnpc <file name>).
return false;
}
@@ -4258,7 +4263,7 @@ ACMD(unloadnpc)
memset(NPCname, '\0', sizeof(NPCname));
- if (!message || !*message || sscanf(message, "%24[^\n]", NPCname) < 1) {
+ if (!*message || sscanf(message, "%24[^\n]", NPCname) < 1) {
clif->message(fd, msg_fd(fd,1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
return false;
}
@@ -4378,6 +4383,11 @@ void get_jail_time(int jailtime, int* year, int* month, int* day, int* hour, int
const int factor_day = 1440; //24*60 = 1440
const int factor_hour = 60;
+ nullpo_retv(year);
+ nullpo_retv(month);
+ nullpo_retv(day);
+ nullpo_retv(hour);
+ nullpo_retv(minute);
*year = jailtime/factor_year;
jailtime -= *year*factor_year;
*month = jailtime/factor_month;
@@ -4407,7 +4417,7 @@ ACMD(jail) {
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1134)); // Please enter a player name (usage: @jail <char_name>).
return false;
}
@@ -4458,7 +4468,7 @@ ACMD(unjail) {
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
return false;
}
@@ -4494,7 +4504,7 @@ ACMD(jailfor) {
int jailtime = 0,x,y;
short m_index = 0;
- if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) {
+ if (!*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) {
clif->message(fd, msg_fd(fd,400)); //Usage: @jailfor <time> <character name>
return false;
}
@@ -4568,9 +4578,9 @@ ACMD(jailfor) {
clif->message(fd, msg_fd(fd,121)); // Player unjailed
} else {
atcommand->get_jail_time(jailtime,&year,&month,&day,&hour,&minute);
- sprintf(atcmd_output,msg_fd(fd,402),msg_fd(fd,1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,402),msg_fd(fd,1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes
clif->message(pl_sd->fd, atcmd_output);
- sprintf(atcmd_output,msg_fd(fd,402),msg_fd(fd,1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,402),msg_fd(fd,1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes
clif->message(fd, atcmd_output);
}
} else if (jailtime < 0) {
@@ -4595,7 +4605,6 @@ ACMD(jailfor) {
return true;
}
-
//By Coltaro
ACMD(jailtime)
{
@@ -4618,7 +4627,7 @@ ACMD(jailtime)
//Get remaining jail time
atcommand->get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute);
- sprintf(atcmd_output,msg_fd(fd,402),msg_fd(fd,1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,402),msg_fd(fd,1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
clif->message(fd, atcmd_output);
@@ -4632,7 +4641,7 @@ ACMD(disguise)
{
int id = 0;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
return false;
}
@@ -4683,7 +4692,7 @@ ACMD(disguiseall)
struct map_session_data *pl_sd;
struct s_mapiterator* iter;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
return false;
}
@@ -4717,7 +4726,7 @@ ACMD(disguiseguild)
memset(monster, '\0', sizeof(monster));
memset(guild_name, '\0', sizeof(guild_name));
- if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild_name) < 2 ) {
+ if (!*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild_name) < 2) {
clif->message(fd, msg_fd(fd,1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
return false;
}
@@ -4753,7 +4762,6 @@ ACMD(disguiseguild)
return true;
}
-
/*==========================================
* @undisguise by [Yor]
*------------------------------------------*/
@@ -4799,17 +4807,17 @@ ACMD(undisguiseguild)
memset(guild_name, '\0', sizeof(guild_name));
- if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
+ if (!*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif->message(fd, msg_fd(fd,1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
return false;
}
- if( (g = guild->searchname(guild_name)) == NULL && (g = guild->search(atoi(message))) == NULL ) {
+ if ((g = guild->searchname(guild_name)) == NULL && (g = guild->search(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,94)); // Incorrect name/ID, or no one from the guild is online.
return false;
}
- for(i = 0; i < g->max_member; i++) {
+ for (i = 0; i < g->max_member; i++) {
struct map_session_data *pl_sd = g->member[i].sd;
if (pl_sd && pl_sd->disguise != -1)
pc->disguise(pl_sd, -1);
@@ -4843,7 +4851,6 @@ ACMD(exp)
return true;
}
-
/*==========================================
* @broadcast by [Valaris]
*------------------------------------------*/
@@ -4851,12 +4858,12 @@ ACMD(broadcast)
{
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1149)); // Please enter a message (usage: @broadcast <message>).
return false;
}
- sprintf(atcmd_output, "%s: %s", sd->status.name, message);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message);
intif->broadcast(atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT);
return true;
@@ -4869,12 +4876,12 @@ ACMD(localbroadcast)
{
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1150)); // Please enter a message (usage: @localbroadcast <message>).
return false;
}
- sprintf(atcmd_output, "%s: %s", sd->status.name, message);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message);
clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
@@ -4892,7 +4899,7 @@ ACMD(email)
memset(actual_email, '\0', sizeof(actual_email));
memset(new_email, '\0', sizeof(new_email));
- if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
+ if (!*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
clif->message(fd, msg_fd(fd,1151)); // Please enter two e-mail addresses (usage: @email <current@email> <new@email>).
return false;
}
@@ -4923,7 +4930,7 @@ ACMD(effect)
{
int type = 0, flag = 0;
- if (!message || !*message || sscanf(message, "%d", &type) < 1) {
+ if (!*message || sscanf(message, "%d", &type) < 1) {
clif->message(fd, msg_fd(fd,1152)); // Please enter an effect number (usage: @effect <effect number>).
return false;
}
@@ -4941,7 +4948,7 @@ ACMD(killer)
{
sd->state.killer = !sd->state.killer;
- if(sd->state.killer)
+ if (sd->state.killer)
clif->message(fd, msg_fd(fd,241));
else {
clif->message(fd, msg_fd(fd,292));
@@ -4957,9 +4964,9 @@ ACMD(killer)
ACMD(killable) {
sd->state.killable = !sd->state.killable;
- if(sd->state.killable)
+ if (sd->state.killable) {
clif->message(fd, msg_fd(fd,242));
- else {
+ } else {
clif->message(fd, msg_fd(fd,288));
map->foreachinrange(atcommand->stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
}
@@ -4996,7 +5003,7 @@ ACMD(npcmove) {
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
- if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
+ if (!*message || sscanf(message, "%12d %12d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
clif->message(fd, msg_fd(fd,1153)); // Usage: @npcmove <X> <Y> <npc_name>
return false;
}
@@ -5034,7 +5041,7 @@ ACMD(addwarp)
memset(warpname, '\0', sizeof(warpname));
- if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) {
+ if (!*message || sscanf(message, "%31s %12d %12d %23[^\n]", mapname, &x, &y, warpname) < 4) {
clif->message(fd, msg_fd(fd,1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
return false;
}
@@ -5042,7 +5049,7 @@ ACMD(addwarp)
m = mapindex->name2id(mapname);
if( m == 0 )
{
- sprintf(atcmd_output, msg_fd(fd,1157), mapname); // Unknown map '%s'.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1157), mapname); // Unknown map '%s'.
clif->message(fd, atcmd_output);
return false;
}
@@ -5051,7 +5058,7 @@ ACMD(addwarp)
if( nd == NULL )
return false;
- sprintf(atcmd_output, msg_fd(fd,1158), nd->exname); // New warp NPC '%s' created.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1158), nd->exname); // New warp NPC '%s' created.
clif->message(fd, atcmd_output);
return true;
}
@@ -5063,7 +5070,7 @@ ACMD(addwarp)
ACMD(follow) {
struct map_session_data *pl_sd = NULL;
- if (!message || !*message) {
+ if (!*message) {
if (sd->followtarget == -1)
return false;
pc->stop_following (sd);
@@ -5071,7 +5078,7 @@ ACMD(follow) {
return true;
}
- if ( (pl_sd = map->nick2sd((char *)message)) == NULL )
+ if ((pl_sd = map->nick2sd((char *)message)) == NULL)
{
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
@@ -5088,7 +5095,6 @@ ACMD(follow) {
return true;
}
-
/*==========================================
* @dropall by [MouseJstr]
* Drop all your possession on the ground
@@ -5117,7 +5123,7 @@ ACMD(storeall)
if (sd->state.storage_flag != STORAGE_FLAG_NORMAL) {
//Open storage.
- if( storage->open(sd) == 1 ) {
+ if (storage->open(sd) == 1) {
clif->message(fd, msg_fd(fd,1161)); // You currently cannot open your storage.
return false;
}
@@ -5234,7 +5240,7 @@ ACMD(skillid) {
DBData *data;
char partials[MAX_SKILLID_PARTIAL_RESULTS][MAX_SKILLID_PARTIAL_RESULTS_LEN];
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
return false;
}
@@ -5246,7 +5252,7 @@ ACMD(skillid) {
for (data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key)) {
int idx = skill->get_index(DB->data2i(data));
if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill->dbs->db[idx].desc, message, skillen) == 0) {
- sprintf(atcmd_output, msg_fd(fd,1164), DB->data2i(data), skill->dbs->db[idx].desc, key.str); // skill %d: %s (%s)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1164), DB->data2i(data), skill->dbs->db[idx].desc, key.str); // skill %d: %s (%s)
clif->message(fd, atcmd_output);
} else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill->dbs->db[idx].desc,message) ) ) {
snprintf(partials[found], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_fd(fd,1164), DB->data2i(data), skill->dbs->db[idx].desc, key.str);
@@ -5257,7 +5263,7 @@ ACMD(skillid) {
dbi_destroy(iter);
if( found ) {
- sprintf(atcmd_output, msg_fd(fd,1398), found); // -- Displaying first %d partial matches
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1398), found); // -- Displaying first %d partial matches
clif->message(fd, atcmd_output);
}
@@ -5279,19 +5285,19 @@ ACMD(useskill) {
uint16 skill_lv;
char target[100];
- if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
+ if (!*message || sscanf(message, "%5hu %5hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
clif->message(fd, msg_fd(fd,1165)); // Usage: @useskill <skill ID> <skill level> <target>
return false;
}
- if(!strcmp(target,"self"))
+ if (!strcmp(target,"self"))
pl_sd = sd; //quick keyword
- else if ( (pl_sd = map->nick2sd(target)) == NULL ) {
+ else if ((pl_sd = map->nick2sd(target)) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
- if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
+ if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
{
clif->message(fd, msg_fd(fd,81)); // Your GM level don't authorized you to do this action on this player.
return false;
@@ -5324,7 +5330,7 @@ ACMD(displayskill) {
uint16 skill_id;
uint16 skill_lv = 1;
- if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1) {
+ if (!*message || sscanf(message, "%5hu %5hu", &skill_id, &skill_lv) < 1) {
clif->message(fd, msg_fd(fd,1166)); // Usage: @displayskill <skill ID> {<skill level>}
return false;
}
@@ -5347,7 +5353,7 @@ ACMD(skilltree) {
char target[NAME_LENGTH];
struct skill_tree_entry *ent;
- if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
+ if(!*message || sscanf(message, "%5hu %23[^\r\n]", &skill_id, target) != 2) {
clif->message(fd, msg_fd(fd,1167)); // Usage: @skilltree <skill ID> <target>
return false;
}
@@ -5360,7 +5366,7 @@ ACMD(skilltree) {
c = pc->calc_skilltree_normalize_job(pl_sd);
c = pc->mapid2jobid(c, pl_sd->status.sex);
- sprintf(atcmd_output, msg_fd(fd,1168), pc->job_name(c), pc->checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1168), pc->job_name(c), pc->checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
clif->message(fd, atcmd_output);
ARR_FIND( 0, MAX_SKILL_TREE, j, pc->skill_tree[c][j].id == 0 || pc->skill_tree[c][j].id == skill_id );
@@ -5377,7 +5383,7 @@ ACMD(skilltree) {
{
if( ent->need[j].id && pc->checkskill(sd,ent->need[j].id) < ent->need[j].lv)
{
- sprintf(atcmd_output, msg_fd(fd,1170), ent->need[j].lv, skill->dbs->db[ent->need[j].id].desc); // Player requires level %d of skill %s.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1170), ent->need[j].lv, skill->dbs->db[ent->need[j].id].desc); // Player requires level %d of skill %s.
clif->message(fd, atcmd_output);
meets = 0;
}
@@ -5390,9 +5396,10 @@ ACMD(skilltree) {
}
// Hand a ring with partners name on it to this char
-void getring(struct map_session_data* sd) {
+void atcommand_getring(struct map_session_data* sd) {
int flag, item_id;
struct item item_tmp;
+ nullpo_retv(sd);
item_id = (sd->status.sex) ? WEDDING_RING_M : WEDDING_RING_F;
memset(&item_tmp, 0, sizeof(item_tmp));
@@ -5404,7 +5411,7 @@ void getring(struct map_session_data* sd) {
if((flag = pc->additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
@@ -5416,7 +5423,7 @@ ACMD(marry) {
struct map_session_data *pl_sd = NULL;
char player_name[NAME_LENGTH] = "";
- if (!message || !*message || sscanf(message, "%23s", player_name) != 1) {
+ if (!*message || sscanf(message, "%23s", player_name) != 1) {
clif->message(fd, msg_fd(fd,1172)); // Usage: @marry <char name>
return false;
}
@@ -5429,8 +5436,8 @@ ACMD(marry) {
if (pc->marriage(sd, pl_sd) == 0) {
clif->message(fd, msg_fd(fd,1173)); // They are married... wish them well.
clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
- getring(sd); // Auto-give named rings (Aru)
- getring(pl_sd);
+ atcommand->getring(sd); // Auto-give named rings (Aru)
+ atcommand->getring(pl_sd);
return true;
}
@@ -5445,12 +5452,12 @@ ACMD(marry) {
ACMD(divorce)
{
if (pc->divorce(sd) != 0) {
- sprintf(atcmd_output, msg_fd(fd,1175), sd->status.name); // '%s' is not married.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1175), sd->status.name); // '%s' is not married.
clif->message(fd, atcmd_output);
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1176), sd->status.name); // '%s' and his/her partner are now divorced.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1176), sd->status.name); // '%s' and his/her partner are now divorced.
clif->message(fd, atcmd_output);
return true;
}
@@ -5463,7 +5470,7 @@ ACMD(changelook)
int i, j = 0, k = 0;
int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE };
- if((i = sscanf(message, "%d %d", &j, &k)) < 1) {
+ if((i = sscanf(message, "%12d %12d", &j, &k)) < 1) {
clif->message(fd, msg_fd(fd,1177)); // Usage: @changelook {<position>} <view id>
clif->message(fd, msg_fd(fd,1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
return false;
@@ -5540,17 +5547,17 @@ ACMD(changegm) {
return false;
}
- if( map->list[sd->bl.m].flag.guildlock || map->list[sd->bl.m].flag.gvg_castle ) {
+ if (map->list[sd->bl.m].flag.guildlock || map->list[sd->bl.m].flag.gvg_castle) {
clif->message(fd, msg_fd(fd,1182)); // You cannot change guild leaders in this map.
return false;
}
- if( !message[0] ) {
+ if (!message[0]) {
clif->message(fd, msg_fd(fd,1183)); // Usage: @changegm <guild_member_name>
return false;
}
- if((pl_sd=map->nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
+ if ((pl_sd=map->nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
clif->message(fd, msg_fd(fd,1184)); // Target character must be online and be a guild member.
return false;
}
@@ -5565,7 +5572,7 @@ ACMD(changegm) {
*------------------------------------------*/
ACMD(changeleader) {
- if( !message[0] ) {
+ if (!message[0]) {
clif->message(fd, msg_fd(fd,1185)); // Usage: @changeleader <party_member_name>
return false;
}
@@ -5591,7 +5598,7 @@ ACMD(partyoption)
return false;
}
- ARR_FIND( 0, MAX_PARTY, mi, p->data[mi].sd == sd );
+ ARR_FIND(0, MAX_PARTY, mi, p->data[mi].sd == sd);
if (mi == MAX_PARTY)
return false; //Shouldn't happen
@@ -5601,7 +5608,7 @@ ACMD(partyoption)
return false;
}
- if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2)
+ if (!*message || sscanf(message, "%15s %15s", w1, w2) < 2)
{
clif->message(fd, msg_fd(fd,1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
return false;
@@ -5627,7 +5634,7 @@ ACMD(autoloot)
int rate;
// autoloot command without value
- if(!message || !*message)
+ if (!*message)
{
if (sd->state.autoloot)
rate = 0;
@@ -5660,7 +5667,7 @@ ACMD(autolootitem)
int i;
int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset
- if (message && *message) {
+ if (*message) {
if (message[0] == '+') {
message++;
action = 1;
@@ -5684,7 +5691,7 @@ ACMD(autolootitem)
}
}
- switch(action) {
+ switch (action) {
case 1:
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
if (i != AUTOLOOTITEM_SIZE) {
@@ -5697,7 +5704,7 @@ ACMD(autolootitem)
return false;
}
sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
- sprintf(atcmd_output, msg_fd(fd,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
clif->message(fd, atcmd_output);
sd->state.autolooting = 1;
break;
@@ -5708,7 +5715,7 @@ ACMD(autolootitem)
return false;
}
sd->state.autolootid[i] = 0;
- sprintf(atcmd_output, msg_fd(fd,1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
clif->message(fd, atcmd_output);
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
if (i == AUTOLOOTITEM_SIZE) {
@@ -5716,7 +5723,7 @@ ACMD(autolootitem)
}
break;
case 3:
- sprintf(atcmd_output, msg_fd(fd,1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
clif->message(fd, msg_fd(fd,1197)); // "@alootid reset" will clear your autolootitem list.
@@ -5733,7 +5740,7 @@ ACMD(autolootitem)
ShowDebug("Non-existant item %d on autolootitem list (account_id: %d, char_id: %d)", sd->state.autolootid[i], sd->status.account_id, sd->status.char_id);
continue;
}
- sprintf(atcmd_output, "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
clif->message(fd, atcmd_output);
}
}
@@ -5757,7 +5764,7 @@ ACMD(autoloottype) {
enum item_types type = -1;
int ITEM_NONE = 0;
- if (message && *message) {
+ if (*message) {
if (message[0] == '+') {
message++;
action = 1;
@@ -5802,7 +5809,7 @@ ACMD(autoloottype) {
return false;
}
sd->state.autoloottype |= (1<<type); // Stores the type
- sprintf(atcmd_output, msg_fd(fd,1492), itemdb->typename(type)); // Autolooting item type: '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1492), itemdb->typename(type)); // Autolooting item type: '%s'
clif->message(fd, atcmd_output);
break;
case 2:
@@ -5811,7 +5818,7 @@ ACMD(autoloottype) {
return false;
}
sd->state.autoloottype &= ~(1<<type);
- sprintf(atcmd_output, msg_fd(fd,1494), itemdb->typename(type)); // Removed item type: '%s' from your autoloottype list.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1494), itemdb->typename(type)); // Removed item type: '%s' from your autoloottype list.
clif->message(fd, atcmd_output);
break;
case 3:
@@ -5830,7 +5837,7 @@ ACMD(autoloottype) {
clif->message(fd, msg_fd(fd,1496)); // Item types on your autoloottype list:
for(i=0; i < IT_MAX; i++) {
if (sd->state.autoloottype&(1<<i)) {
- sprintf(atcmd_output, " '%s'", itemdb->typename(i));
+ safesnprintf(atcmd_output, sizeof(atcmd_output), " '%s'", itemdb->typename(i));
clif->message(fd, atcmd_output);
}
}
@@ -5995,7 +6002,7 @@ ACMD(sound)
memset(sound_file, '\0', sizeof(sound_file));
- if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
+ if(!*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
clif->message(fd, msg_fd(fd,1217)); // Please enter a sound filename (usage: @sound <filename>).
return false;
}
@@ -6018,7 +6025,7 @@ ACMD(mobsearch)
int number = 0;
struct s_mapiterator* it;
- if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) {
+ if (!*message || sscanf(message, "%99[^\n]", mob_name) < 1) {
clif->message(fd, msg_fd(fd,1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
return false;
}
@@ -6081,7 +6088,7 @@ ACMD(cleanmap) {
ACMD(cleanarea) {
int x0 = 0, y0 = 0, x1 = 0, y1 = 0, n = 0;
- if (!message || !*message || (n=sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1)) < 1) {
+ if (!*message || (n=sscanf(message, "%d %d %d %d", &x0, &y0, &x1, &y1)) < 1) {
map->foreachinrange(atcommand->cleanfloor_sub, &sd->bl, AREA_SIZE * 2, BL_ITEM);
} else if (n == 4) {
map->foreachinarea(atcommand->cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM);
@@ -6110,13 +6117,13 @@ ACMD(npctalk)
return false;
if(!ifcolor) {
- if (!message || !*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) {
+ if (!*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) {
clif->message(fd, msg_fd(fd,1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
return false;
}
}
else {
- if (!message || !*message || sscanf(message, "%u %23[^,], %99[^\n]", &color, name, mes) < 3) {
+ if (!*message || sscanf(message, "%12u %23[^,], %99[^\n]", &color, name, mes) < 3) {
clif->message(fd, msg_fd(fd,1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
return false;
}
@@ -6141,13 +6148,13 @@ ACMD(pettalk)
char mes[100],temp[100];
struct pet_data *pd;
- if ( battle_config.min_chat_delay ) {
+ if (battle_config.min_chat_delay) {
if( DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0 )
return true;
sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
- if(!sd->status.pet_id || !(pd=sd->pd))
+ if (!sd->status.pet_id || !(pd=sd->pd))
{
clif->message(fd, msg_fd(fd,184));
return false;
@@ -6158,13 +6165,13 @@ ACMD(pettalk)
(sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
return false;
- if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
+ if (!*message || sscanf(message, "%99[^\n]", mes) < 1) {
clif->message(fd, msg_fd(fd,1224)); // Please enter a message (usage: @pettalk <message>).
return false;
}
if (message[0] == '/')
- {// pet emotion processing
+ { // pet emotion processing
const char* emo[] = {
"/!", "/?", "/ho", "/lv", "/swt", "/ic", "/an", "/ag", "/$", "/...",
"/scissors", "/rock", "/paper", "/korea", "/lv2", "/thx", "/wah", "/sry", "/heh", "/swt2",
@@ -6251,7 +6258,7 @@ ACMD(users)
ACMD(reset) {
pc->resetstate(sd);
pc->resetskill(sd, PCRESETSKILL_RESYNC);
- sprintf(atcmd_output, msg_fd(fd,208), sd->status.name); // '%s' skill and stats points reseted!
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,208), sd->status.name); // '%s' skill and stats points reseted!
clif->message(fd, atcmd_output);
return true;
}
@@ -6267,7 +6274,7 @@ ACMD(summon)
struct mob_data *md;
int64 tick=timer->gettick();
- if (!message || !*message || sscanf(message, "%23s %d", name, &duration) < 1)
+ if (!*message || sscanf(message, "%23s %12d", name, &duration) < 1)
{
clif->message(fd, msg_fd(fd,1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
return false;
@@ -6312,7 +6319,7 @@ ACMD(adjgroup)
{
int new_group = 0;
- if (!message || !*message || sscanf(message, "%d", &new_group) != 1) {
+ if (!*message || sscanf(message, "%12d", &new_group) != 1) {
clif->message(fd, msg_fd(fd,1226)); // Usage: @adjgroup <group_id>
return false;
}
@@ -6334,7 +6341,7 @@ ACMD(adjgroup)
ACMD(trade) {
struct map_session_data *pl_sd = NULL;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1230)); // Please enter a player name (usage: @trade <char name>).
return false;
}
@@ -6356,7 +6363,7 @@ ACMD(setbattleflag)
{
char flag[128], value[128];
- if (!message || !*message || sscanf(message, "%127s %127s", flag, value) != 2) {
+ if (!*message || sscanf(message, "%127s %127s", flag, value) != 2) {
clif->message(fd, msg_fd(fd,1231)); // Usage: @setbattleflag <flag> <value>
return false;
}
@@ -6377,18 +6384,18 @@ ACMD(setbattleflag)
ACMD(unmute) {
struct map_session_data *pl_sd = NULL;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1234)); // Please enter a player name (usage: @unmute <char name>).
return false;
}
- if ( (pl_sd = map->nick2sd((char *)message)) == NULL )
+ if ((pl_sd = map->nick2sd((char *)message)) == NULL)
{
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
- if(!pl_sd->sc.data[SC_NOCHAT]) {
+ if (!pl_sd->sc.data[SC_NOCHAT]) {
clif->message(sd->fd,msg_fd(fd,1235)); // Player is not muted.
return false;
}
@@ -6431,8 +6438,8 @@ ACMD(changesex) {
pc->resetskill(sd, PCRESETSKILL_CHSEX);
// to avoid any problem with equipment and invalid sex, equipment is unequipped.
- for( i=0; i<EQI_MAX; i++ )
- if( sd->equip_index[i] >= 0 ) pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
+ for (i=0; i<EQI_MAX; i++)
+ if (sd->equip_index[i] >= 0) pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
chrif->changesex(sd, true);
return true;
}
@@ -6444,17 +6451,17 @@ ACMD(mute) {
struct map_session_data *pl_sd = NULL;
int manner;
- if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) {
+ if (!*message || sscanf(message, "%12d %23[^\n]", &manner, atcmd_player_name) < 1) {
clif->message(fd, msg_fd(fd,1237)); // Usage: @mute <time> <char name>
return false;
}
- if ( (pl_sd = map->nick2sd(atcmd_player_name)) == NULL ) {
+ if ((pl_sd = map->nick2sd(atcmd_player_name)) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
- if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
+ if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
{
clif->message(fd, msg_fd(fd,81)); // Your GM level don't authorize you to do this action on this player.
return false;
@@ -6463,7 +6470,7 @@ ACMD(mute) {
clif->manner_message(sd, 0);
clif->manner_message(pl_sd, 5);
- if( pl_sd->status.manner < manner ) {
+ if (pl_sd->status.manner < manner) {
pl_sd->status.manner -= manner;
sc_start(NULL,&pl_sd->bl,SC_NOCHAT,100,0,0);
} else {
@@ -6505,7 +6512,7 @@ ACMD(identify)
{
int i,num;
- for(i=num=0;i<MAX_INVENTORY;i++){
+ for (i=num=0;i<MAX_INVENTORY;i++) {
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1){
num++;
}
@@ -6521,9 +6528,9 @@ ACMD(identify)
ACMD(misceffect) {
int effect = 0;
- if (!message || !*message)
+ if (!*message)
return false;
- if (sscanf(message, "%d", &effect) < 1)
+ if (sscanf(message, "%12d", &effect) < 1)
return false;
clif->misceffect(&sd->bl,effect);
@@ -6557,7 +6564,7 @@ ACMD(mobinfo)
memset(atcmd_output, '\0', sizeof(atcmd_output));
memset(atcmd_output2, '\0', sizeof(atcmd_output2));
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
return false;
}
@@ -6575,7 +6582,7 @@ ACMD(mobinfo)
}
if (count > MAX_SEARCH) {
- sprintf(atcmd_output, msg_fd(fd,269), MAX_SEARCH, count);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, count);
clif->message(fd, atcmd_output);
count = MAX_SEARCH;
}
@@ -6598,27 +6605,26 @@ ACMD(mobinfo)
// stats
if (monster->mexp)
- sprintf(atcmd_output, msg_fd(fd,1240), monster->name, monster->jname, monster->sprite, monster->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1240), monster->name, monster->jname, monster->sprite, monster->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
else
- sprintf(atcmd_output, msg_fd(fd,1241), monster->name, monster->jname, monster->sprite, monster->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1241), monster->name, monster->jname, monster->sprite, monster->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1242), monster->lv, monster->status.max_hp, base_exp, job_exp, MOB_HIT(monster), MOB_FLEE(monster)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1242), monster->lv, monster->status.max_hp, base_exp, job_exp, MOB_HIT(monster), MOB_FLEE(monster)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d
monster->status.def, monster->status.mdef, monster->status.str, monster->status.agi,
monster->status.vit, monster->status.int_, monster->status.dex, monster->status.luk);
clif->message(fd, atcmd_output);
-
#ifdef RENEWAL
- sprintf(atcmd_output, msg_fd(fd,1291), // ATK : %d~%d MATK : %d~%d Range : %d~%d~%d Size : %s Race : %s Element : %s(Lv : %d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1291), // ATK : %d~%d MATK : %d~%d Range : %d~%d~%d Size : %s Race : %s Element : %s(Lv : %d)
MOB_ATK1(monster), MOB_ATK2(monster), MOB_MATK1(monster), MOB_MATK2(monster), monster->status.rhw.range,
monster->range2 , monster->range3, msize[monster->status.size],
mrace[monster->status.race], melement[monster->status.def_ele], monster->status.ele_lv);
#else
- sprintf(atcmd_output, msg_fd(fd,1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)
monster->status.rhw.atk, monster->status.rhw.atk2, monster->status.rhw.range,
monster->range2 , monster->range3, msize[monster->status.size],
mrace[monster->status.race], melement[monster->status.def_ele], monster->status.ele_lv);
@@ -6665,7 +6671,7 @@ ACMD(mobinfo)
clif->message(fd, atcmd_output);
// mvp
if (monster->mexp) {
- sprintf(atcmd_output, msg_fd(fd,1247), monster->mexp); // MVP Bonus EXP:%u
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1247), monster->mexp); // MVP Bonus EXP:%u
clif->message(fd, atcmd_output);
safestrncpy(atcmd_output, msg_fd(fd,1248), sizeof(atcmd_output)); // MVP Items:
@@ -6702,7 +6708,7 @@ ACMD(showmobs)
int number = 0;
struct s_mapiterator* it;
- if( sscanf(message, "%99[^\n]", mob_name) < 0 ) {
+ if (sscanf(message, "%99[^\n]", mob_name) < 0) {
clif->message(fd, msg_fd(fd,546)); // Please enter a mob name/id (usage: @showmobs <mob name/id>)
return false;
}
@@ -6768,19 +6774,19 @@ ACMD(homlevel) {
int level = 0;
enum homun_type htype;
- if( !message || !*message || ( level = atoi(message) ) < 1 ) {
+ if (!*message || ( level = atoi(message) ) < 1) {
clif->message(fd, msg_fd(fd,1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
return false;
}
- if( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
hd = sd->hd;
- if( (htype = homun->class2type(hd->homunculus.class_)) == HT_INVALID ) {
+ if ((htype = homun->class2type(hd->homunculus.class_)) == HT_INVALID) {
ShowError("atcommand_homlevel: invalid homun class %d (player %s)\n", hd->homunculus.class_,sd->status.name);
return false;
}
@@ -6838,12 +6844,12 @@ ACMD(hommutate) {
int homun_id;
enum homun_type m_class, m_id;
- if( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
- if( !message || !*message ) {
+ if (!*message) {
homun_id = 6048 + (rnd() % 4);
} else {
homun_id = atoi(message);
@@ -6866,15 +6872,15 @@ ACMD(hommutate) {
ACMD(makehomun) {
int homunid;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
return false;
}
homunid = atoi(message);
- if( homunid == -1 && sd->status.hom_id && !(sd->hd && homun_alive(sd->hd)) ) {
- if( !sd->hd )
+ if (homunid == -1 && sd->status.hom_id && !(sd->hd && homun_alive(sd->hd))) {
+ if (!sd->hd)
homun->call(sd);
else if( sd->hd->homunculus.vaporize )
homun->ressurect(sd, 100, sd->bl.x, sd->bl.y);
@@ -6883,12 +6889,12 @@ ACMD(makehomun) {
return true;
}
- if ( sd->status.hom_id ) {
+ if (sd->status.hom_id) {
clif->message(fd, msg_fd(fd,450));
return false;
}
- if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 )
+ if (homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1)
{
clif->message(fd, msg_fd(fd,1257)); // Invalid Homunculus ID.
return false;
@@ -6905,12 +6911,12 @@ ACMD(homfriendly)
{
int friendly = 0;
- if ( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
return false;
}
@@ -6930,12 +6936,12 @@ ACMD(homhungry)
{
int hungry = 0;
- if ( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
return false;
}
@@ -6955,8 +6961,8 @@ ACMD(homtalk)
{
char mes[100],temp[100];
- if ( battle_config.min_chat_delay ) {
- if( DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0 )
+ if (battle_config.min_chat_delay) {
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
return true;
sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
@@ -6966,12 +6972,12 @@ ACMD(homtalk)
(sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
return false;
- if ( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
- if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
+ if (!*message || sscanf(message, "%99[^\n]", mes) < 1) {
clif->message(fd, msg_fd(fd,1260)); // Please enter a message (usage: @homtalk <message>).
return false;
}
@@ -6989,7 +6995,7 @@ ACMD(hominfo) {
struct homun_data *hd;
struct status_data *st;
- if ( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
@@ -7026,7 +7032,7 @@ ACMD(homstats)
struct s_homunculus *hom;
int lv, min, max, evo;
- if ( !homun_alive(sd->hd) ) {
+ if (!homun_alive(sd->hd)) {
clif->message(fd, msg_fd(fd,1254)); // You do not have a homunculus.
return false;
}
@@ -7088,10 +7094,10 @@ ACMD(homstats)
ACMD(homshuffle)
{
- if(!sd->hd)
+ if (!sd->hd)
return false; // nothing to do
- if(!homun->shuffle(sd->hd))
+ if (!homun->shuffle(sd->hd))
return false;
clif->message(sd->fd, msg_fd(fd,1275)); // Homunculus stats altered.
@@ -7108,7 +7114,7 @@ ACMD(iteminfo)
struct item_data *item_array[MAX_SEARCH];
int i, count = 1;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
return false;
}
@@ -7121,27 +7127,27 @@ ACMD(iteminfo)
}
if (count > MAX_SEARCH) {
- sprintf(atcmd_output, msg_fd(fd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
clif->message(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
struct item_data *item_data = item_array[i];
- sprintf(atcmd_output, msg_fd(fd,1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
itemdb->typename(item_data->type),
(item_data->script==NULL)? msg_fd(fd,1278) : msg_fd(fd,1279) // None / With script
);
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
clif->message(fd, atcmd_output);
if (item_data->maxchance == -1)
safestrncpy(atcmd_output, msg_fd(fd,1281), sizeof(atcmd_output)); // - Available in the shops only.
else if ( !battle_config.atcommand_mobinfo_type ) {
if( item_data->maxchance )
- sprintf(atcmd_output, msg_fd(fd,1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%%
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%%
else
safestrncpy(atcmd_output, msg_fd(fd,1283), sizeof(atcmd_output)); // - Monsters don't drop this item.
}
@@ -7159,7 +7165,7 @@ ACMD(whodrops)
struct item_data *item_array[MAX_SEARCH];
int i,j, count = 1;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
return false;
}
@@ -7172,25 +7178,25 @@ ACMD(whodrops)
}
if (count > MAX_SEARCH) {
- sprintf(atcmd_output, msg_fd(fd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, count); // Displaying first %d out of %d matches
clif->message(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
struct item_data *item_data = item_array[i];
- sprintf(atcmd_output, msg_fd(fd,1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
clif->message(fd, atcmd_output);
if (item_data->mob[0].chance == 0) {
safestrncpy(atcmd_output, msg_fd(fd,1286), sizeof(atcmd_output)); // - Item is not dropped by mobs.
clif->message(fd, atcmd_output);
} else {
- sprintf(atcmd_output, msg_fd(fd,1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed):
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed):
clif->message(fd, atcmd_output);
for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++)
{
- sprintf(atcmd_output, "- %s (%02.02f%%)", mob->db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "- %s (%02.02f%%)", mob->db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.);
clif->message(fd, atcmd_output);
}
}
@@ -7204,7 +7210,7 @@ ACMD(whereis)
int count;
int i, j, k;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
return false;
}
@@ -7223,7 +7229,7 @@ ACMD(whereis)
}
if (count > MAX_SEARCH) {
- sprintf(atcmd_output, msg_fd(fd,269), MAX_SEARCH, count);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,269), MAX_SEARCH, count);
clif->message(fd, atcmd_output);
count = MAX_SEARCH;
}
@@ -7246,9 +7252,9 @@ ACMD(whereis)
}
ACMD(version) {
- sprintf(atcmd_output, msg_fd(fd,1296), sysinfo->is64bit() ? 64 : 32, sysinfo->platform()); // Hercules %d-bit for %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1296), sysinfo->is64bit() ? 64 : 32, sysinfo->platform()); // Hercules %d-bit for %s
clif->message(fd, atcmd_output);
- sprintf(atcmd_output, msg_fd(fd,1295), sysinfo->vcstype(), sysinfo->vcsrevision_src(), sysinfo->vcsrevision_scripts()); // %s revision '%s' (src) / '%s' (scripts)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1295), sysinfo->vcstype(), sysinfo->vcsrevision_src(), sysinfo->vcsrevision_scripts()); // %s revision '%s' (src) / '%s' (scripts)
clif->message(fd, atcmd_output);
return true;
@@ -7257,7 +7263,7 @@ ACMD(version) {
/*==========================================
* @mutearea by MouseJstr
*------------------------------------------*/
-int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
+int atcommand_mutearea_sub(struct block_list *bl, va_list ap)
{ // As it is being used [ACMD(mutearea)] there's no need to be a bool, but if there's need to reuse it, it's better to be this way
int time, id;
@@ -7281,7 +7287,7 @@ int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
ACMD(mutearea) {
int time;
- if (!message || !*message) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
return false;
}
@@ -7295,23 +7301,22 @@ ACMD(mutearea) {
return true;
}
-
ACMD(rates)
{
char buf[CHAT_SIZE_MAX];
memset(buf, '\0', sizeof(buf));
- snprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1298), // Experience rates: Base %.2fx / Job %.2fx
+ safesnprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1298), // Experience rates: Base %.2fx / Job %.2fx
battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.);
clif->message(fd, buf);
- snprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
+ safesnprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.);
clif->message(fd, buf);
- snprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
+ safesnprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.);
clif->message(fd, buf);
- snprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
+ safesnprintf(buf, CHAT_SIZE_MAX, msg_fd(fd,1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.);
clif->message(fd, buf);
@@ -7334,12 +7339,12 @@ ACMD(me)
(sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT)))
return false;
- if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
+ if (!*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
clif->message(fd, msg_fd(fd,1302)); // Please enter a message (usage: @me <message>).
return false;
}
- sprintf(atcmd_output, msg_fd(fd,270), sd->status.name, tempmes); // *%s %s*
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,270), sd->status.name, tempmes); // *%s %s*
clif->disp_overhead(&sd->bl, atcmd_output);
return true;
@@ -7380,17 +7385,17 @@ ACMD(sizeall)
size = cap_value(size,0,2);
iter = mapit_getallusers();
- for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {
- if( pl_sd->state.size != size ) {
- if( pl_sd->state.size ) {
+ for (pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter)) {
+ if (pl_sd->state.size != size) {
+ if (pl_sd->state.size) {
pl_sd->state.size = SZ_SMALL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}
pl_sd->state.size = size;
- if( size == SZ_MEDIUM )
+ if (size == SZ_MEDIUM)
clif->specialeffect(&pl_sd->bl,420,AREA);
- else if( size == SZ_BIG )
+ else if (size == SZ_BIG)
clif->specialeffect(&pl_sd->bl,422,AREA);
}
}
@@ -7409,20 +7414,20 @@ ACMD(sizeguild)
memset(guild_name, '\0', sizeof(guild_name));
- if( !message || !*message || sscanf(message, "%d %23[^\n]", &size, guild_name) < 2 ) {
+ if (!*message || sscanf(message, "%d %23[^\n]", &size, guild_name) < 2) {
clif->message(fd, msg_fd(fd,1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
return false;
}
- if( (g = guild->searchname(guild_name)) == NULL && (g = guild->search(atoi(guild_name))) == NULL ) {
+ if ((g = guild->searchname(guild_name)) == NULL && (g = guild->search(atoi(guild_name))) == NULL) {
clif->message(fd, msg_fd(fd,94)); // Incorrect name/ID, or no one from the guild is online.
return false;
}
size = cap_value(size,SZ_SMALL,SZ_BIG);
- for( i = 0; i < g->max_member; i++ ) {
- if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) {
+ for (i = 0; i < g->max_member; i++) {
+ if ((pl_sd = g->member[i].sd) && pl_sd->state.size != size) {
if( pl_sd->state.size ) {
pl_sd->state.size = SZ_SMALL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
@@ -7462,9 +7467,9 @@ ACMD(monsterignore)
*------------------------------------------*/
ACMD(fakename)
{
- if( !message || !*message )
+ if (!*message)
{
- if( sd->fakename[0] )
+ if (sd->fakename[0])
{
sd->fakename[0] = '\0';
clif->charnameack(0, &sd->bl);
@@ -7478,7 +7483,7 @@ ACMD(fakename)
return false;
}
- if( strlen(message) < 2 )
+ if (strlen(message) < 2)
{
clif->message(sd->fd, msg_fd(fd,1309)); // Fake name must be at least two characters.
return false;
@@ -7486,7 +7491,7 @@ ACMD(fakename)
safestrncpy(sd->fakename, message, sizeof(sd->fakename));
clif->charnameack(0, &sd->bl);
- if( sd->disguise ) // Another packet should be sent so the client updates the name for sd
+ if (sd->disguise) // Another packet should be sent so the client updates the name for sd
clif->charnameack(sd->fd, &sd->bl);
clif->message(sd->fd, msg_fd(fd,1310)); // Fake name enabled.
@@ -7497,11 +7502,11 @@ ACMD(fakename)
* Ragnarok Resources
*------------------------------------------*/
ACMD(mapflag) {
-#define CHECKFLAG( cmd ) do { if ( map->list[ sd->bl.m ].flag.cmd ) clif->message(sd->fd,#cmd); } while(0)
+#define CHECKFLAG( cmd ) do { if (map->list[ sd->bl.m ].flag.cmd ) clif->message(sd->fd,#cmd);} while(0)
#define SETFLAG( cmd ) do { \
- if ( strcmp( flag_name , #cmd ) == 0 ) { \
+ if (strcmp( flag_name , #cmd ) == 0) { \
map->list[ sd->bl.m ].flag.cmd = flag; \
- sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag); \
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag); \
clif->message(sd->fd,atcmd_output); \
return true; \
} \
@@ -7512,7 +7517,7 @@ ACMD(mapflag) {
memset(flag_name, '\0', sizeof(flag_name));
- if (!message || !*message || (sscanf(message, "%99s %hd", flag_name, &flag) < 1)) {
+ if (!*message || (sscanf(message, "%99s %5hd", flag_name, &flag) < 1)) {
clif->message(sd->fd,msg_fd(fd,1311)); // Enabled Mapflags in this map:
clif->message(sd->fd,"----------------------------------");
CHECKFLAG(autotrade); CHECKFLAG(allowks); CHECKFLAG(nomemo); CHECKFLAG(noteleport);
@@ -7535,18 +7540,18 @@ ACMD(mapflag) {
}
for (i = 0; flag_name[i]; i++) flag_name[i] = TOLOWER(flag_name[i]); //lowercase
- if ( strcmp( flag_name , "gvg" ) == 0 ) {
+ if (strcmp( flag_name , "gvg" ) == 0) {
if( flag && !map->list[sd->bl.m].flag.gvg )
map->zone_change2(sd->bl.m,strdb_get(map->zone_db, MAP_ZONE_GVG_NAME));
else if ( !flag && map->list[sd->bl.m].flag.gvg )
map->zone_change2(sd->bl.m,map->list[sd->bl.m].prev_zone);
} else if ( strcmp( flag_name , "pvp" ) == 0 ) {
- if( flag && !map->list[sd->bl.m].flag.pvp )
+ if ( flag && !map->list[sd->bl.m].flag.pvp )
map->zone_change2(sd->bl.m,strdb_get(map->zone_db, MAP_ZONE_PVP_NAME));
else if ( !flag && map->list[sd->bl.m].flag.pvp )
map->zone_change2(sd->bl.m,map->list[sd->bl.m].prev_zone);
} else if ( strcmp( flag_name , "battleground" ) == 0 ) {
- if( flag && !map->list[sd->bl.m].flag.battleground )
+ if ( flag && !map->list[sd->bl.m].flag.battleground )
map->zone_change2(sd->bl.m,strdb_get(map->zone_db, MAP_ZONE_BG_NAME));
else if ( !flag && map->list[sd->bl.m].flag.battleground )
map->zone_change2(sd->bl.m,map->list[sd->bl.m].prev_zone);
@@ -7638,36 +7643,36 @@ ACMD(invite) {
unsigned int did = sd->duel_group;
struct map_session_data *target_sd = map->nick2sd((char *)message);
- if(did == 0)
+ if (did == 0)
{
// "Duel: @invite without @duel."
clif->message(fd, msg_fd(fd,350));
return false;
}
- if(duel->list[did].max_players_limit > 0 &&
- duel->list[did].members_count >= duel->list[did].max_players_limit) {
+ if (duel->list[did].max_players_limit > 0 &&
+ duel->list[did].members_count >= duel->list[did].max_players_limit) {
// "Duel: Limit of players is reached."
clif->message(fd, msg_fd(fd,351));
return false;
}
- if(target_sd == NULL) {
+ if (target_sd == NULL) {
// "Duel: Player not found."
clif->message(fd, msg_fd(fd,352));
return false;
}
- if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
+ if (target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
// "Duel: Player already in duel."
clif->message(fd, msg_fd(fd,353));
return false;
}
- if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m)
+ if (battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m)
{
// "Duel: You can't invite %s because he/she isn't in the same map."
- sprintf(atcmd_output, msg_fd(fd,364), message);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,364), message);
clif->message(fd, atcmd_output);
return false;
}
@@ -7681,18 +7686,18 @@ ACMD(invite) {
ACMD(duel) {
unsigned int maxpl = 0;
- if(sd->duel_group > 0) {
+ if (sd->duel_group > 0) {
duel->showinfo(sd->duel_group, sd);
return true;
}
- if(sd->duel_invite > 0) {
+ if (sd->duel_invite > 0) {
// "Duel: @duel without @reject."
clif->message(fd, msg_fd(fd,355));
return false;
}
- if(!duel->checktime(sd)) {
+ if (!duel->checktime(sd)) {
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_fd(fd,356), battle_config.duel_time_interval);
@@ -7700,9 +7705,9 @@ ACMD(duel) {
return false;
}
- if( message[0] ) {
- if(sscanf(message, "%u", &maxpl) >= 1) {
- if(maxpl < 2 || maxpl > 65535) {
+ if (message[0]) {
+ if (sscanf(message, "%12u", &maxpl) >= 1) {
+ if (maxpl < 2 || maxpl > 65535) {
clif->message(fd, msg_fd(fd,357)); // "Duel: Invalid value."
return false;
}
@@ -7710,10 +7715,10 @@ ACMD(duel) {
} else {
struct map_session_data *target_sd;
target_sd = map->nick2sd((char *)message);
- if(target_sd != NULL) {
+ if (target_sd != NULL) {
unsigned int newduel;
- if((newduel = duel->create(sd, 2)) != -1) {
- if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
+ if ((newduel = duel->create(sd, 2)) != -1) {
+ if (target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
clif->message(fd, msg_fd(fd,353)); // "Duel: Player already in duel."
return false;
}
@@ -7732,9 +7737,8 @@ ACMD(duel) {
return true;
}
-
ACMD(leave) {
- if(sd->duel_group <= 0) {
+ if (sd->duel_group <= 0) {
// "Duel: @leave without @duel."
clif->message(fd, msg_fd(fd,358));
return false;
@@ -7745,7 +7749,7 @@ ACMD(leave) {
}
ACMD(accept) {
- if(!duel->checktime(sd)) {
+ if (!duel->checktime(sd)) {
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_fd(fd,356), battle_config.duel_time_interval);
@@ -7753,14 +7757,14 @@ ACMD(accept) {
return false;
}
- if(sd->duel_invite <= 0) {
+ if (sd->duel_invite <= 0) {
// "Duel: @accept without invitation."
clif->message(fd, msg_fd(fd,360));
return false;
}
- if( duel->list[sd->duel_invite].max_players_limit > 0
- && duel->list[sd->duel_invite].members_count >= duel->list[sd->duel_invite].max_players_limit ) {
+ if (duel->list[sd->duel_invite].max_players_limit > 0
+ && duel->list[sd->duel_invite].members_count >= duel->list[sd->duel_invite].max_players_limit) {
// "Duel: Limit of players is reached."
clif->message(fd, msg_fd(fd,351));
return false;
@@ -7773,7 +7777,7 @@ ACMD(accept) {
}
ACMD(reject) {
- if(sd->duel_invite <= 0) {
+ if (sd->duel_invite <= 0) {
// "Duel: @reject without invitation."
clif->message(fd, msg_fd(fd,362));
return false;
@@ -7794,12 +7798,12 @@ ACMD(cash)
int value;
int ret=0;
- if( !message || !*message || (value = atoi(message)) == 0 ) {
+ if (!*message || (value = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1322)); // Please enter an amount.
return false;
}
- if( !strcmpi(info->command,"cash") ) {
+ if (!strcmpi(info->command,"cash")) {
if( value > 0 ) {
if( (ret=pc->getcash(sd, value, 0)) >= 0){
// If this option is set, the message is already sent by pc function
@@ -7847,17 +7851,17 @@ ACMD(clone) {
int x=0,y=0,flag=0,master=0,i=0;
struct map_session_data *pl_sd=NULL;
- if (!message || !*message) {
+ if (!*message) {
clif->message(sd->fd,msg_fd(fd,1323)); // You must enter a player name or ID.
return false;
}
- if((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
+ if ((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
- if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
+ if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
clif->message(fd, msg_fd(fd,126)); // Cannot clone a player of higher GM level than yourself.
return false;
}
@@ -7866,7 +7870,7 @@ ACMD(clone) {
flag = 1;
else if (strcmpi(info->command, "slaveclone") == 0) {
flag = 2;
- if(pc_isdead(sd)){
+ if (pc_isdead(sd)){
//"Unable to spawn slave clone."
clif->message(fd, msg_fd(fd,129+flag*2));
return false;
@@ -7882,14 +7886,14 @@ ACMD(clone) {
do {
x = sd->bl.x + (rnd() % 10 - 5);
y = sd->bl.y + (rnd() % 10 - 5);
- } while (map->getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10);
+ } while (map->getcell(sd->bl.m, &sd->bl, x, y, CELL_CHKNOPASS) && i++ < 10);
if (i >= 10) {
x = sd->bl.x;
y = sd->bl.y;
}
- if((x = mob->clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
+ if ((x = mob->clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
clif->message(fd, msg_fd(fd,128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
return true;
}
@@ -7903,7 +7907,7 @@ ACMD(clone) {
*-------------------------------------*/
ACMD(noask)
{
- if(sd->state.noask) {
+ if (sd->state.noask) {
clif->message(fd, msg_fd(fd,391)); // Autorejecting is deactivated.
sd->state.noask = 0;
} else {
@@ -7920,12 +7924,12 @@ ACMD(noask)
*-------------------------------------*/
ACMD(request)
{
- if (!message || !*message) {
+ if (!*message) {
clif->message(sd->fd,msg_fd(fd,277)); // Usage: @request <petition/message to online GMs>.
return false;
}
- sprintf(atcmd_output, msg_fd(fd,278), message); // (@request): %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,278), message); // (@request): %s
intif->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
clif->message(sd->fd,msg_fd(fd,279)); // @request sent.
@@ -7965,7 +7969,7 @@ ACMD(ksprotection) {
if( sd->state.noks ) {
sd->state.noks = KSPROTECT_NONE;
clif->message(fd, msg_fd(fd,1325)); // [ K.S Protection Inactive ]
- } else if( !message || !*message || strcmpi(message, "party") == 0 ) {
+ } else if (!*message || strcmpi(message, "party") == 0) {
// Default is Party
sd->state.noks = KSPROTECT_PARTY;
clif->message(fd, msg_fd(fd,1326)); // [ K.S Protection Active - Option: Party ]
@@ -7998,7 +8002,7 @@ ACMD(allowks)
ACMD(resetstat)
{
pc->resetstate(sd);
- sprintf(atcmd_output, msg_fd(fd,207), sd->status.name);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,207), sd->status.name);
clif->message(fd, atcmd_output);
return true;
}
@@ -8006,7 +8010,7 @@ ACMD(resetstat)
ACMD(resetskill)
{
pc->resetskill(sd, PCRESETSKILL_RESYNC);
- sprintf(atcmd_output, msg_fd(fd,206), sd->status.name);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,206), sd->status.name);
clif->message(fd, atcmd_output);
return true;
}
@@ -8226,13 +8230,13 @@ ACMD(delitem) {
int nameid, amount = 0, total, idx;
struct item_data* id;
- if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &amount) < 2 && sscanf(message, "%99s %d", item_name, &amount) < 2 ) || amount < 1 )
+ if (!*message || (sscanf(message, "\"%99[^\"]\" %12d", item_name, &amount) < 2 && sscanf(message, "%99s %12d", item_name, &amount) < 2) || amount < 1)
{
clif->message(fd, msg_fd(fd,1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
return false;
}
- if( ( id = itemdb->search_name(item_name) ) != NULL || ( id = itemdb->exists(atoi(item_name)) ) != NULL )
+ if ((id = itemdb->search_name(item_name)) != NULL || (id = itemdb->exists(atoi(item_name))) != NULL)
{
nameid = id->nameid;
}
@@ -8258,7 +8262,7 @@ ACMD(delitem) {
}
// notify target
- sprintf(atcmd_output, msg_fd(fd,113), total-amount); // %d item(s) removed by a GM.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,113), total-amount); // %d item(s) removed by a GM.
clif->message(sd->fd, atcmd_output);
// notify source
@@ -8268,12 +8272,12 @@ ACMD(delitem) {
}
else if( amount )
{
- sprintf(atcmd_output, msg_fd(fd,115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items.
clif->message(fd, atcmd_output);
}
else
{
- sprintf(atcmd_output, msg_fd(fd,114), total); // %d item(s) removed from the player.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,114), total); // %d item(s) removed from the player.
clif->message(fd, atcmd_output);
}
return true;
@@ -8365,7 +8369,7 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand
dbi_destroy(iter);
clif->message(fd,line_buff);
- sprintf(atcmd_output, msg_fd(fd,274), count); // "%d commands found."
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,274), count); // "%d commands found."
clif->message(fd, atcmd_output);
return;
@@ -8410,7 +8414,7 @@ ACMD(cashmount)
ACMD(accinfo) {
char query[NAME_LENGTH];
- if (!message || !*message || strlen(message) > NAME_LENGTH ) {
+ if (!*message || strlen(message) > NAME_LENGTH ) {
clif->message(fd, msg_fd(fd,1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
clif->message(fd, msg_fd(fd,1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
return false;
@@ -8431,7 +8435,7 @@ ACMD(set) {
bool is_str = false;
size_t len;
- if( !message || !*message || (toset = sscanf(message, "%31s %127[^\n]s", reg, val)) < 1 ) {
+ if (!*message || (toset = sscanf(message, "%31s %127[^\n]s", reg, val)) < 1) {
clif->message(fd, msg_fd(fd,1367)); // Usage: @set <variable name> <value>
clif->message(fd, msg_fd(fd,1368)); // Usage: ex. "@set PoringCharVar 50"
clif->message(fd, msg_fd(fd,1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
@@ -8514,16 +8518,16 @@ ACMD(set) {
switch( data->type ) {
case C_INT:
- sprintf(atcmd_output,msg_fd(fd,1373),reg,data->u.num); // %s value is now :%d
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1373),reg,data->u.num); // %s value is now :%d
break;
case C_STR:
- sprintf(atcmd_output,msg_fd(fd,1374),reg,data->u.str); // %s value is now :%s
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1374),reg,data->u.str); // %s value is now :%s
break;
case C_CONSTSTR:
- sprintf(atcmd_output,msg_fd(fd,1375),reg); // %s is empty
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1375),reg); // %s is empty
break;
default:
- sprintf(atcmd_output,msg_fd(fd,1376),reg,data->type); // %s data type is not supported :%u
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1376),reg,data->type); // %s data type is not supported :%u
break;
}
clif->message(fd, atcmd_output);
@@ -8541,12 +8545,12 @@ ACMD(addperm) {
bool add = (strcmpi(info->command, "addperm") == 0) ? true : false;
int i;
- if( !message || !*message ) {
- sprintf(atcmd_output, msg_fd(fd,1378),command); // Usage: %s <permission_name>
+ if (!*message) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1378),command); // Usage: %s <permission_name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1379)); // -- Permission List
for( i = 0; i < perm_size; i++ ) {
- sprintf(atcmd_output,"- %s",pcg->permissions[i].name);
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"- %s",pcg->permissions[i].name);
clif->message(fd, atcmd_output);
}
return false;
@@ -8554,28 +8558,28 @@ ACMD(addperm) {
ARR_FIND(0, perm_size, i, strcmpi(pcg->permissions[i].name, message) == 0);
if( i == perm_size ) {
- sprintf(atcmd_output,msg_fd(fd,1380),message); // '%s' is not a known permission.
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1380),message); // '%s' is not a known permission.
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1379)); // -- Permission List
for( i = 0; i < perm_size; i++ ) {
- sprintf(atcmd_output,"- %s",pcg->permissions[i].name);
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"- %s",pcg->permissions[i].name);
clif->message(fd, atcmd_output);
}
return false;
}
if( add && (sd->extra_temp_permissions&pcg->permissions[i].permission) ) {
- sprintf(atcmd_output, msg_fd(fd,1381),sd->status.name,pcg->permissions[i].name); // User '%s' already possesses the '%s' permission.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1381),sd->status.name,pcg->permissions[i].name); // User '%s' already possesses the '%s' permission.
clif->message(fd, atcmd_output);
return false;
} else if ( !add && !(sd->extra_temp_permissions&pcg->permissions[i].permission) ) {
- sprintf(atcmd_output, msg_fd(fd,1382),sd->status.name,pcg->permissions[i].name); // User '%s' doesn't possess the '%s' permission.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1382),sd->status.name,pcg->permissions[i].name); // User '%s' doesn't possess the '%s' permission.
clif->message(fd, atcmd_output);
- sprintf(atcmd_output,msg_fd(fd,1383),sd->status.name); // -- User '%s' Permissions
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1383),sd->status.name); // -- User '%s' Permissions
clif->message(fd, atcmd_output);
for( i = 0; i < perm_size; i++ ) {
if( sd->extra_temp_permissions&pcg->permissions[i].permission ) {
- sprintf(atcmd_output,"- %s",pcg->permissions[i].name);
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"- %s",pcg->permissions[i].name);
clif->message(fd, atcmd_output);
}
}
@@ -8587,21 +8591,21 @@ ACMD(addperm) {
else
sd->extra_temp_permissions &=~ pcg->permissions[i].permission;
- sprintf(atcmd_output, msg_fd(fd,1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
clif->message(fd, atcmd_output);
return true;
}
ACMD(unloadnpcfile)
{
- if( !message || !*message ) {
+ if (!*message) {
clif->message(fd, msg_fd(fd,1385)); // Usage: @unloadnpcfile <file name>
return false;
}
- if( npc->unloadfile(message) )
+ if (npc->unloadfile(message)) {
clif->message(fd, msg_fd(fd,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
- else {
+ } else {
clif->message(fd, msg_fd(fd,1387)); // File not found.
return false;
}
@@ -8614,14 +8618,12 @@ ACMD(cart) {
sd->status.skill[idx].flag = (x)?1:0; \
} while(0)
- int val;
+ int val = atoi(message);
bool need_skill = pc->checkskill(sd, MC_PUSHCART) ? false : true;
unsigned int index = skill->get_index(MC_PUSHCART);
- if (message)
- val = atoi(message);
- if( !message || !*message || val < 0 || val > MAX_CARTS ) {
- sprintf(atcmd_output, msg_fd(fd,1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
+ if (!*message || val < 0 || val > MAX_CARTS) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
clif->message(fd, atcmd_output);
return false;
}
@@ -8658,16 +8660,16 @@ ACMD(join)
char name[HCS_NAME_LENGTH], pass[HCS_NAME_LENGTH];
enum channel_operation_status ret = HCS_STATUS_OK;
- if (!message || !*message || sscanf(message, "%19s %19s", name, pass) < 1) {
- sprintf(atcmd_output, msg_fd(fd,1399),command); // Unknown Channel (usage: %s <#channel_name>)
+ if (!*message || sscanf(message, "%19s %19s", name, pass) < 1) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1399),command); // Unknown Channel (usage: %s <#channel_name>)
clif->message(fd, atcmd_output);
return false;
}
chan = channel->search(name, sd);
- if(!chan) {
- sprintf(atcmd_output, msg_fd(fd,1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>)
+ if (!chan) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>)
clif->message(fd, atcmd_output);
return false;
}
@@ -8675,19 +8677,19 @@ ACMD(join)
ret = channel->join(chan, sd, pass, false);
if (ret == HCS_STATUS_ALREADY) {
- sprintf(atcmd_output, msg_fd(fd,1436),name); // You're already in the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1436),name); // You're already in the '%s' channel
clif->message(fd, atcmd_output);
return false;
}
if (ret == HCS_STATUS_NOPERM) {
- sprintf(atcmd_output, msg_fd(fd,1401),name,command); // '%s' Channel is password protected (usage: %s <#channel_name> <password>)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1401),name,command); // '%s' Channel is password protected (usage: %s <#channel_name> <password>)
clif->message(fd, atcmd_output);
return false;
}
if (ret == HCS_STATUS_BANNED) {
- sprintf(atcmd_output, msg_fd(fd,1438),name); // You cannot join the '%s' channel because you've been banned from it
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1438),name); // You cannot join the '%s' channel because you've been banned from it
clif->message(fd, atcmd_output);
return false;
}
@@ -8695,51 +8697,52 @@ ACMD(join)
return true;
}
/* [Ind/Hercules] */
-static inline void atcmd_channel_help(int fd, const char *command, bool can_create) {
- sprintf(atcmd_output, msg_fd(fd,1404),command); // %s failed.
+void atcommand_channel_help(int fd, const char *command, bool can_create) {
+ nullpo_retv(command);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1404),command); // %s failed.
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1414));// --- Available options:
if( can_create ) {
- sprintf(atcmd_output, msg_fd(fd,1415),command);// -- %s create <channel name> <channel password>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1415),command);// -- %s create <channel name> <channel password>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1416));// - creates a new channel
}
- sprintf(atcmd_output, msg_fd(fd,1417),command);// -- %s list
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1417),command);// -- %s list
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1418));// - lists public channels
if( can_create ) {
- sprintf(atcmd_output, msg_fd(fd,1419),command);// -- %s list colors
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1419),command);// -- %s list colors
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1420));// - lists colors available to select for custom channels
- sprintf(atcmd_output, msg_fd(fd,1421),command);// -- %s setcolor <channel name> <color name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1421),command);// -- %s setcolor <channel name> <color name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1422));// - changes <channel name> color to <color name>
}
- sprintf(atcmd_output, msg_fd(fd,1423),command);// -- %s leave <channel name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1423),command);// -- %s leave <channel name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1424));// - leaves <channel name>
- sprintf(atcmd_output, msg_fd(fd,1427),command);// -- %s bindto <channel name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1427),command);// -- %s bindto <channel name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1428));// - binds global chat to <channel name>, making anything you type in global be sent to the channel
- sprintf(atcmd_output, msg_fd(fd,1429),command);// -- %s unbind
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1429),command);// -- %s unbind
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1430));// - unbinds your global chat from its attached channel (if binded)
- sprintf(atcmd_output, msg_fd(fd,1429),command);// -- %s unbind
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1429),command);// -- %s unbind
clif->message(fd, atcmd_output);
if( can_create ) {
- sprintf(atcmd_output, msg_fd(fd,1456),command);// -- %s ban <channel name> <character name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1456),command);// -- %s ban <channel name> <character name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1457));// - bans <character name> from <channel name> channel
- sprintf(atcmd_output, msg_fd(fd,1458),command);// -- %s banlist <channel name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1458),command);// -- %s banlist <channel name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1459));// - lists all banned characters from <channel name> channel
- sprintf(atcmd_output, msg_fd(fd,1460),command);// -- %s unban <channel name> <character name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1460),command);// -- %s unban <channel name> <character name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1461));// - unbans <character name> from <channel name> channel
- sprintf(atcmd_output, msg_fd(fd,1467),command);// -- %s unbanall <channel name>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1467),command);// -- %s unbanall <channel name>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1468));// - unbans everyone from <channel name>
- sprintf(atcmd_output, msg_fd(fd,1462),command);// -- %s setopt <channel name> <option name> <option value>
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1462),command);// -- %s setopt <channel name> <option name> <option value>
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1463));// - adds or removes <option name> with <option value> to <channel name> channel
}
@@ -8751,20 +8754,20 @@ ACMD(channel) {
unsigned char k = 0;
sub1[0] = sub2[0] = sub3[0] = '\0';
- if (!message || !*message || sscanf(message, "%19s %19s %19s %19s", subcmd, sub1, sub2, sub3) < 1) {
- atcmd_channel_help(fd,command, (channel->config->allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)));
+ if (!*message || sscanf(message, "%19s %19s %19s %19s", subcmd, sub1, sub2, sub3) < 1) {
+ atcommand->channel_help(fd,command, (channel->config->allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)));
return true;
}
if (strcmpi(subcmd,"create") == 0 && (channel->config->allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN))) {
// sub1 = channel name; sub2 = password; sub3 = unused
size_t len = strlen(sub1);
- const char *pass = *sub2 ? sub2 : NULL;
+ const char *pass = *sub2 ? sub2 : "";
if (sub1[0] != '#') {
clif->message(fd, msg_fd(fd,1405));// Channel name must start with a '#'
return false;
} else if (len < 3 || len > HCS_NAME_LENGTH) {
- sprintf(atcmd_output, msg_fd(fd,1406), HCS_NAME_LENGTH);// Channel length must be between 3 and %d
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1406), HCS_NAME_LENGTH);// Channel length must be between 3 and %d
clif->message(fd, atcmd_output);
return false;
} else if (sub3[0] != '\0') {
@@ -8772,7 +8775,7 @@ ACMD(channel) {
return false;
}
if (strcmpi(sub1 + 1, channel->config->local_name) == 0 || strcmpi(sub1 + 1, channel->config->ally_name) == 0 || strdb_exists(channel->db, sub1 + 1)) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
@@ -8786,7 +8789,7 @@ ACMD(channel) {
// sub1 = list type; sub2 = unused; sub3 = unused
if (sub1[0] != '\0' && strcmpi(sub1,"colors") == 0) {
for (k = 0; k < channel->config->colors_count; k++) {
- sprintf(atcmd_output, "[ %s list colors ] : %s", command, channel->config->colors_name[k]);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "[ %s list colors ] : %s", command, channel->config->colors_name[k]);
clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output);
}
@@ -8795,18 +8798,18 @@ ACMD(channel) {
bool show_all = pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ? true : false;
clif->message(fd, msg_fd(fd,1410)); // -- Public Channels
if (channel->config->local) {
- sprintf(atcmd_output, msg_fd(fd,1409), channel->config->local_name, map->list[sd->bl.m].channel ? db_size(map->list[sd->bl.m].channel->users) : 0);// - #%s ( %d users )
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1409), channel->config->local_name, map->list[sd->bl.m].channel ? db_size(map->list[sd->bl.m].channel->users) : 0);// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
if (channel->config->ally && sd->status.guild_id) {
struct guild *g = sd->guild;
if( !g ) { dbi_destroy(iter); return false; }
- sprintf(atcmd_output, msg_fd(fd,1409), channel->config->ally_name, db_size(g->channel->users));// - #%s ( %d users )
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1409), channel->config->ally_name, db_size(g->channel->users));// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
for (chan = dbi_first(iter); dbi_exists(iter); chan = dbi_next(iter)) {
if (show_all || chan->type == HCS_TYPE_PUBLIC || chan->type == HCS_TYPE_IRC) {
- sprintf(atcmd_output, msg_fd(fd,1409), chan->name, db_size(chan->users));// - #%s ( %d users )
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1409), chan->name, db_size(chan->users));// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
}
@@ -8820,13 +8823,13 @@ ACMD(channel) {
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
if (chan->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
@@ -8836,12 +8839,12 @@ ACMD(channel) {
break;
}
if (k == channel->config->colors_count) {
- sprintf(atcmd_output, msg_fd(fd,1411), sub2);// Unknown color '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1411), sub2);// Unknown color '%s'
clif->message(fd, atcmd_output);
return false;
}
chan->color = k;
- sprintf(atcmd_output, msg_fd(fd,1413), sub1, channel->config->colors_name[k]);// '%s' channel color updated to '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1413), sub1, channel->config->colors_name[k]);// '%s' channel color updated to '%s'
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"leave") == 0) {
// sub1 = channel name; sub2 = unused; sub3 = unused
@@ -8854,7 +8857,7 @@ ACMD(channel) {
break;
}
if (k == sd->channel_count) {
- sprintf(atcmd_output, msg_fd(fd,1425),sub1);// You're not part of the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1425),sub1);// You're not part of the '%s' channel
clif->message(fd, atcmd_output);
return false;
}
@@ -8870,7 +8873,7 @@ ACMD(channel) {
} else {
channel->leave(sd->channels[k],sd);
}
- sprintf(atcmd_output, msg_fd(fd,1426),sub1); // You've left the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1426),sub1); // You've left the '%s' channel
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"bindto") == 0) {
// sub1 = channel name; sub2 = unused; sub3 = unused
@@ -8884,13 +8887,13 @@ ACMD(channel) {
break;
}
if (k == sd->channel_count) {
- sprintf(atcmd_output, msg_fd(fd,1425),sub1);// You're not part of the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1425),sub1);// You're not part of the '%s' channel
clif->message(fd, atcmd_output);
return false;
}
sd->gcbind = sd->channels[k];
- sprintf(atcmd_output, msg_fd(fd,1431),sub1); // Your global chat is now bound to the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1431),sub1); // Your global chat is now bound to the '%s' channel
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"unbind") == 0) {
// sub1 = unused; sub2 = unused; sub3 = unused
@@ -8899,7 +8902,7 @@ ACMD(channel) {
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1433),sd->gcbind->name); // Your global chat is no longer bound to the '#%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1433),sd->gcbind->name); // Your global chat is no longer bound to the '#%s' channel
clif->message(fd, atcmd_output);
sd->gcbind = NULL;
@@ -8915,19 +8918,19 @@ ACMD(channel) {
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
- if (!message || !*message || sscanf(message, "%19s %19s %23[^\n]", subcmd, sub1, sub4) < 3) {
- sprintf(atcmd_output, msg_fd(fd,1434), sub4);// Player '%s' was not found
+ if (!*message || sscanf(message, "%19s %19s %23[^\n]", subcmd, sub1, sub4) < 3) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found
clif->message(fd, atcmd_output);
return false;
}
if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4)) == NULL) {
- sprintf(atcmd_output, msg_fd(fd,1434), sub4);// Player '%s' was not found
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found
clif->message(fd, atcmd_output);
return false;
}
@@ -8935,13 +8938,13 @@ ACMD(channel) {
ret = channel->ban(chan, sd, pl_sd);
if (ret == HCS_STATUS_NOPERM) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
if (ret == HCS_STATUS_ALREADY) {
- sprintf(atcmd_output, msg_fd(fd,1465), pl_sd->status.name);// Player '%s' is already banned from this channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1465), pl_sd->status.name);// Player '%s' is already banned from this channel
clif->message(fd, atcmd_output);
return false;
}
@@ -8951,7 +8954,7 @@ ACMD(channel) {
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1437),pl_sd->status.name,sub1); // Player '%s' has now been banned from '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1437),pl_sd->status.name,sub1); // Player '%s' has now been banned from '%s' channel
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"unban") == 0) {
// sub1 = channel name; sub2 = unused; sub3 = unused
@@ -8964,34 +8967,34 @@ ACMD(channel) {
return false;
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
- if (!message || !*message || sscanf(message, "%19s %19s %23[^\n]", subcmd, sub1, sub4) < 3) {
- sprintf(atcmd_output, msg_fd(fd,1434), sub4);// Player '%s' was not found
+ if (!*message || sscanf(message, "%19s %19s %23[^\n]", subcmd, sub1, sub4) < 3) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found
clif->message(fd, atcmd_output);
return false;
}
if (sub4[0] == '\0' || (pl_sd = map->nick2sd(sub4)) == NULL) {
- sprintf(atcmd_output, msg_fd(fd,1434), sub4);// Player '%s' was not found
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1434), sub4);// Player '%s' was not found
clif->message(fd, atcmd_output);
return false;
}
ret = channel->unban(chan, sd, pl_sd);
if (ret == HCS_STATUS_NOPERM) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
if (ret == HCS_STATUS_ALREADY) {
- sprintf(atcmd_output, msg_fd(fd,1440), pl_sd->status.name);// Player '%s' is not banned from this channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1440), pl_sd->status.name);// Player '%s' is not banned from this channel
clif->message(fd, atcmd_output);
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1441),pl_sd->status.name,sub1); // Player '%s' has now been unbanned from the '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1441),pl_sd->status.name,sub1); // Player '%s' has now been unbanned from the '%s' channel
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"unbanall") == 0) {
enum channel_operation_status ret = HCS_STATUS_OK;
@@ -9001,23 +9004,23 @@ ACMD(channel) {
return false;
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
ret = channel->unban(chan, sd, NULL);
if (ret == HCS_STATUS_NOPERM) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
if (ret == HCS_STATUS_ALREADY) {
- sprintf(atcmd_output, msg_fd(fd,1439), sub1);// Channel '%s' has no banned players
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1439), sub1);// Channel '%s' has no banned players
clif->message(fd, atcmd_output);
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1442),sub1); // Removed all bans from '%s' channel
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1442),sub1); // Removed all bans from '%s' channel
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"banlist") == 0) {
// sub1 = channel name; sub2 = unused; sub3 = unused
@@ -9030,21 +9033,21 @@ ACMD(channel) {
return false;
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
if (chan->owner != sd->status.char_id && !isA) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
if (!chan->banned) {
- sprintf(atcmd_output, msg_fd(fd,1439), sub1);// Channel '%s' has no banned players
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1439), sub1);// Channel '%s' has no banned players
clif->message(fd, atcmd_output);
return false;
}
- sprintf(atcmd_output, msg_fd(fd,1443), chan->name);// -- '%s' ban list
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1443), chan->name);// -- '%s' ban list
clif->message(fd, atcmd_output);
iter = db_iterator(chan->banned);
@@ -9052,9 +9055,9 @@ ACMD(channel) {
struct channel_ban_entry *entry = DB->data2ptr(data);
if (!isA)
- sprintf(atcmd_output, msg_fd(fd,1444), entry->name);// - %s %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1444), entry->name);// - %s %s
else
- sprintf(atcmd_output, msg_fd(fd,1445), entry->name, key.i);// - %s (%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1445), entry->name, key.i);// - %s (%d)
clif->message(fd, atcmd_output);
}
@@ -9071,12 +9074,12 @@ ACMD(channel) {
return false;
}
if (!(chan = channel->search(sub1, sd))) {
- sprintf(atcmd_output, msg_fd(fd,1407), sub1);// Channel '%s' is not available
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1407), sub1);// Channel '%s' is not available
clif->message(fd, atcmd_output);
return false;
}
if (chan->owner != sd->status.char_id && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)) {
- sprintf(atcmd_output, msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1412), sub1);// You're not the owner of channel '%s'
clif->message(fd, atcmd_output);
return false;
}
@@ -9089,27 +9092,27 @@ ACMD(channel) {
break;
}
if (k == 3) {
- sprintf(atcmd_output, msg_fd(fd,1447), sub2);// '%s' is not a known channel option
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1447), sub2);// '%s' is not a known channel option
clif->message(fd, atcmd_output);
clif->message(fd, msg_fd(fd,1448)); // -- Available options
for (k = 1; k < 3; k++) {
- sprintf(atcmd_output, msg_fd(fd,1444), opt_str[k]);// - '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1444), opt_str[k]);// - '%s'
clif->message(fd, atcmd_output);
}
return false;
}
if (sub3[0] == '\0') {
if (k == HCS_OPT_MSG_DELAY) {
- sprintf(atcmd_output, msg_fd(fd,1466), opt_str[k]);// For '%s' you need the amount of seconds (from 0 to 10)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1466), opt_str[k]);// For '%s' you need the amount of seconds (from 0 to 10)
clif->message(fd, atcmd_output);
return false;
} else if (chan->options & k) {
- sprintf(atcmd_output, msg_fd(fd,1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel setopt %s 0'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel setopt %s 0'
clif->message(fd, atcmd_output);
return false;
} else {
channel->set_options(chan, chan->options | k);
- sprintf(atcmd_output, msg_fd(fd,1450), opt_str[k],chan->name);//option '%s' is now enabled for channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1450), opt_str[k],chan->name);//option '%s' is now enabled for channel '%s'
clif->message(fd, atcmd_output);
return true;
}
@@ -9117,42 +9120,42 @@ ACMD(channel) {
int v = atoi(sub3);
if (k == HCS_OPT_MSG_DELAY) {
if (v < 0 || v > 10) {
- sprintf(atcmd_output, msg_fd(fd,1451), v, opt_str[k]);// value '%d' for option '%s' is out of range (limit is 0-10)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1451), v, opt_str[k]);// value '%d' for option '%s' is out of range (limit is 0-10)
clif->message(fd, atcmd_output);
return false;
}
if (v == 0) {
channel->set_options(chan, chan->options&~k);
chan->msg_delay = 0;
- sprintf(atcmd_output, msg_fd(fd,1453), opt_str[k],chan->name,v);// option '%s' is now disabled for channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1453), opt_str[k],chan->name,v);// option '%s' is now disabled for channel '%s'
clif->message(fd, atcmd_output);
return true;
} else {
channel->set_options(chan, chan->options | k);
chan->msg_delay = v;
- sprintf(atcmd_output, msg_fd(fd,1452), opt_str[k],chan->name,v);// option '%s' is now enabled for channel '%s' with %d seconds
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1452), opt_str[k],chan->name,v);// option '%s' is now enabled for channel '%s' with %d seconds
clif->message(fd, atcmd_output);
return true;
}
} else {
if (v) {
if (chan->options & k) {
- sprintf(atcmd_output, msg_fd(fd,1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel opt %s 0'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1449), opt_str[k],opt_str[k]); // option '%s' is already enabled, if you'd like to disable it type '@channel opt %s 0'
clif->message(fd, atcmd_output);
return false;
} else {
channel->set_options(chan, chan->options | k);
- sprintf(atcmd_output, msg_fd(fd,1450), opt_str[k],chan->name);//option '%s' is now enabled for channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1450), opt_str[k],chan->name);//option '%s' is now enabled for channel '%s'
clif->message(fd, atcmd_output);
}
} else {
if (!(chan->options & k)) {
- sprintf(atcmd_output, msg_fd(fd,1454), opt_str[k],chan->name); // option '%s' is not enabled on channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1454), opt_str[k],chan->name); // option '%s' is not enabled on channel '%s'
clif->message(fd, atcmd_output);
return false;
} else {
channel->set_options(chan, chan->options&~k);
- sprintf(atcmd_output, msg_fd(fd,1453), opt_str[k],chan->name);// option '%s' is now disabled for channel '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1453), opt_str[k],chan->name);// option '%s' is now disabled for channel '%s'
clif->message(fd, atcmd_output);
return true;
}
@@ -9160,7 +9163,7 @@ ACMD(channel) {
}
}
} else {
- atcmd_channel_help(fd, command, (channel->config->allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)));
+ atcommand->channel_help(fd, command, (channel->config->allow_user_channel_creation || pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)));
}
return true;
}
@@ -9168,9 +9171,9 @@ ACMD(channel) {
ACMD(fontcolor) {
unsigned char k;
- if (!message || !*message) {
+ if (!*message) {
for (k = 0; k < channel->config->colors_count; k++) {
- sprintf(atcmd_output, "[ %s ] : %s", command, channel->config->colors_name[k]);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "[ %s ] : %s", command, channel->config->colors_name[k]);
clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output);
}
return false;
@@ -9186,13 +9189,13 @@ ACMD(fontcolor) {
break;
}
if( k == channel->config->colors_count ) {
- sprintf(atcmd_output, msg_fd(fd,1411), message);// Unknown color '%s'
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1411), message);// Unknown color '%s'
clif->message(fd, atcmd_output);
return false;
}
sd->fontcolor = k + 1;
- sprintf(atcmd_output, "Color changed to '%s'", channel->config->colors_name[k]);
+ safesnprintf(atcmd_output, sizeof(atcmd_output), "Color changed to '%s'", channel->config->colors_name[k]);
clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output);
return true;
@@ -9200,7 +9203,7 @@ ACMD(fontcolor) {
ACMD(searchstore){
int val = atoi(message);
- switch( val ) {
+ switch (val) {
case 0://EFFECTTYPE_NORMAL
case 1://EFFECTTYPE_CASH
break;
@@ -9233,10 +9236,10 @@ ACMD(costume){
};
unsigned short k = 0, len = ARRAYLENGTH(names);
- if( !message || !*message ) {
+ if (!*message) {
for( k = 0; k < len; k++ ) {
if( sd->sc.data[name2id[k]] ) {
- sprintf(atcmd_output,msg_fd(fd,1473),names[k]);//Costume '%s' removed.
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1473),names[k]);//Costume '%s' removed.
clif->message(sd->fd,atcmd_output);
status_change_end(&sd->bl,name2id[k],INVALID_TIMER);
return true;
@@ -9244,7 +9247,7 @@ ACMD(costume){
}
clif->message(sd->fd,msg_fd(fd,1472));
for( k = 0; k < len; k++ ) {
- sprintf(atcmd_output,msg_fd(fd,1471),names[k]);//-- %s
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1471),names[k]);//-- %s
clif->message(sd->fd,atcmd_output);
}
return false;
@@ -9252,7 +9255,7 @@ ACMD(costume){
for( k = 0; k < len; k++ ) {
if( sd->sc.data[name2id[k]] ) {
- sprintf(atcmd_output,msg_fd(fd,1470),names[k]);// You're already with a '%s' costume, type '@costume' to remove it.
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1470),names[k]);// You're already with a '%s' costume, type '@costume' to remove it.
clif->message(sd->fd,atcmd_output);
return false;
}
@@ -9263,7 +9266,7 @@ ACMD(costume){
break;
}
if( k == len ) {
- sprintf(atcmd_output,msg_fd(fd,1469),message);// '%s' is not a known costume
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1469),message);// '%s' is not a known costume
clif->message(sd->fd,atcmd_output);
return false;
}
@@ -9275,13 +9278,13 @@ ACMD(costume){
/* for debugging purposes (so users can easily provide us with debug info) */
/* should be trashed as soon as its no longer necessary */
ACMD(skdebug) {
- sprintf(atcmd_output,"second: %u; third: %u", sd->sktree.second, sd->sktree.third);
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"second: %u; third: %u", sd->sktree.second, sd->sktree.third);
clif->message(fd,atcmd_output);
- sprintf(atcmd_output,"pc_calc_skilltree_normalize_job: %d",pc->calc_skilltree_normalize_job(sd));
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"pc_calc_skilltree_normalize_job: %d",pc->calc_skilltree_normalize_job(sd));
clif->message(fd,atcmd_output);
- sprintf(atcmd_output,"change_lv_2nd/3rd: %d/%d",sd->change_level_2nd,sd->change_level_3rd);
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"change_lv_2nd/3rd: %d/%d",sd->change_level_2nd,sd->change_level_3rd);
clif->message(fd,atcmd_output);
- sprintf(atcmd_output,"pc_calc_skillpoint:%d",pc->calc_skillpoint(sd));
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"pc_calc_skillpoint:%d",pc->calc_skillpoint(sd));
clif->message(fd,atcmd_output);
return true;
}
@@ -9291,15 +9294,15 @@ ACMD(skdebug) {
ACMD(cddebug) {
int i;
struct skill_cd* cd = NULL;
-
- if( !(cd = idb_get(skill->cd_db,sd->status.char_id)) ) {
+
+ if (!(cd = idb_get(skill->cd_db,sd->status.char_id))) {
clif->message(fd,"No cool down list found");
} else {
clif->messages(fd,"Found %d registered cooldowns",cd->cursor);
for(i = 0; i < cd->cursor; i++) {
if( cd->entry[i] ) {
const struct TimerData *td = timer->get(cd->entry[i]->timer);
-
+
if( !td || td->func != skill->blockpc_end ) {
clif->messages(fd,"Found invalid entry in slot %d for skill %s",i,skill->dbs->db[cd->entry[i]->skidx].name);
sd->blockskill[cd->entry[i]->skidx] = false;
@@ -9307,8 +9310,8 @@ ACMD(cddebug) {
}
}
}
-
- if( !cd || (message && *message && !strcmpi(message,"reset")) ) {
+
+ if (!cd || (*message && !strcmpi(message,"reset"))) {
for(i = 0; i < MAX_SKILL; i++) {
if( sd->blockskill[i] ) {
clif->messages(fd,"Found skill '%s', unblocking...",skill->dbs->db[i].name);
@@ -9321,12 +9324,12 @@ ACMD(cddebug) {
timer->delete(cd->entry[i]->timer,skill->blockpc_end);
ers_free(skill->cd_entry_ers, cd->entry[i]);
}
-
+
idb_remove(skill->cd_db,sd->status.char_id);
ers_free(skill->cd_ers, cd);
}
}
-
+
return true;
}
@@ -9335,15 +9338,15 @@ ACMD(cddebug) {
**/
ACMD(lang) {
uint8 i;
-
- if( !message || !*message ) {
+
+ if (!*message) {
clif->messages(fd,"Usage: @%s <Language>",info->command);
clif->messages(fd,"There are %d languages available:",script->max_lang_id);
for(i = 0; i < script->max_lang_id; i++)
clif->messages(fd,"- %s",script->languages[i]);
return false;
}
-
+
for(i = 0; i < script->max_lang_id; i++) {
if( strcmpi(message,script->languages[i]) == 0 ) {
if( i == sd->lang_id ) {
@@ -9355,14 +9358,14 @@ ACMD(lang) {
break;
}
}
-
+
if( i == script->max_lang_id ) {
clif->messages(fd,"'%s' did not match any language available",message);
clif->messages(fd,"There are %d languages available:",script->max_lang_id);
for(i = 0; i < script->max_lang_id; i++)
clif->messages(fd,"- %s",script->languages[i]);
}
-
+
return true;
}
/**
@@ -9654,9 +9657,10 @@ void atcommand_basecommands(void) {
#undef ACMD_DEF
#undef ACMD_DEF2
-bool atcommand_add(char *name,AtCommandFunc func, bool replace) {
+bool atcommand_add(char *name, AtCommandFunc func, bool replace) {
AtCommandInfo* cmd;
+ nullpo_retr(false, name);
if( (cmd = atcommand->exists(name)) ) { //caller will handle/display on false
if( !replace )
return false;
@@ -9979,6 +9983,7 @@ void atcommand_config_read(const char* config_filename) {
const char *symbol = NULL;
int num_aliases = 0;
+ nullpo_retv(config_filename);
if (libconfig->read_file(&atcommand_config, config_filename))
return;
@@ -10101,7 +10106,11 @@ void atcommand_config_read(const char* config_filename) {
* COMMAND_ATCOMMAND (1) being index 0, COMMAND_CHARCOMMAND (2) being index 1.
* @private
*/
-static inline int AtCommandType2idx(AtCommandType type) { return (type-1); }
+static inline int atcommand_command_type2idx(AtCommandType type)
+{
+ Assert_retr(0, type > 0);
+ return (type-1);
+}
/**
* Loads permissions for groups to use commands.
@@ -10112,6 +10121,8 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
DBIterator *iter = db_iterator(atcommand->db);
AtCommandInfo *atcmd;
+ nullpo_retv(groups);
+ nullpo_retv(commands_);
for (atcmd = dbi_first(iter); dbi_exists(iter); atcmd = dbi_next(iter)) {
int i;
CREATE(atcmd->at_groups, char, sz);
@@ -10151,10 +10162,10 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
config_setting_is_aggregate(cmd) &&
config_setting_length(cmd) == 2
) {
- if (config_setting_get_bool_elem(cmd, AtCommandType2idx(COMMAND_ATCOMMAND))) {
+ if (config_setting_get_bool_elem(cmd, atcommand_command_type2idx(COMMAND_ATCOMMAND))) {
atcmd->at_groups[idx] = 1;
}
- if (config_setting_get_bool_elem(cmd, AtCommandType2idx(COMMAND_CHARCOMMAND))) {
+ if (config_setting_get_bool_elem(cmd, atcommand_command_type2idx(COMMAND_CHARCOMMAND))) {
atcmd->char_groups[idx] = 1;
}
}
@@ -10168,6 +10179,8 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
bool atcommand_can_use(struct map_session_data *sd, const char *command) {
AtCommandInfo *info = atcommand->get_info_byname(atcommand->check_alias(command + 1));
+ nullpo_retr(false, sd);
+ nullpo_retr(false, command);
if (info == NULL)
return false;
@@ -10181,6 +10194,8 @@ bool atcommand_can_use(struct map_session_data *sd, const char *command) {
bool atcommand_can_use2(struct map_session_data *sd, const char *command, AtCommandType type) {
AtCommandInfo *info = atcommand->get_info_byname(atcommand->check_alias(command));
+ nullpo_retr(false, sd);
+ nullpo_retr(false, command);
if (info == NULL)
return false;
@@ -10287,6 +10302,8 @@ void atcommand_defaults(void) {
atcommand->cleanfloor_sub = atcommand_cleanfloor_sub;
atcommand->mutearea_sub = atcommand_mutearea_sub;
atcommand->commands_sub = atcommand_commands_sub;
+ atcommand->getring = atcommand_getring;
+ atcommand->channel_help = atcommand_channel_help;
atcommand->cmd_db_clear = atcommand_db_clear;
atcommand->cmd_db_clear_sub = atcommand_db_clear_sub;
atcommand->doload = atcommand_doload;
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index ccc7d3725..6c8dbf9ef 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -114,6 +114,8 @@ struct atcommand_interface {
void (*get_jail_time) (int jailtime, int* year, int* month, int* day, int* hour, int* minute);
int (*cleanfloor_sub) (struct block_list *bl, va_list ap);
int (*mutearea_sub) (struct block_list *bl,va_list ap);
+ void (*getring) (struct map_session_data* sd);
+ void (*channel_help) (int fd, const char *command, bool can_create);
/* */
void (*commands_sub) (struct map_session_data* sd, const int fd, AtCommandType type);
void (*cmd_db_clear) (void);
@@ -134,6 +136,7 @@ void atcommand_defaults(void);
HPShared struct atcommand_interface *atcommand;
/* stay here */
-#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
+#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info) __attribute__((nonnull (2, 3, 4, 5))); \
+ static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
#endif /* MAP_ATCOMMAND_H */
diff --git a/src/map/battle.c b/src/map/battle.c
index 671d63200..5b147de9c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -48,7 +48,8 @@ struct battle_interface *battle;
int battle_getcurrentskill(struct block_list *bl) { //Returns the current/last skill in use by this bl.
struct unit_data *ud;
- if( bl->type == BL_SKILL ) {
+ nullpo_ret(bl);
+ if (bl->type == BL_SKILL) {
struct skill_unit * su = (struct skill_unit*)bl;
return su->group?su->group->skill_id:0;
}
@@ -67,6 +68,7 @@ int battle_gettargeted_sub(struct block_list *bl, va_list ap) {
int target_id;
int *c;
+ nullpo_ret(bl);
bl_list = va_arg(ap, struct block_list **);
c = va_arg(ap, int *);
target_id = va_arg(ap, int);
@@ -77,7 +79,7 @@ int battle_gettargeted_sub(struct block_list *bl, va_list ap) {
if (*c >= 24)
return 0;
- if ( !(ud = unit->bl2ud(bl)) )
+ if (!(ud = unit->bl2ud(bl)))
return 0;
if (ud->target == target_id || ud->skilltarget == target_id) {
@@ -102,10 +104,10 @@ struct block_list* battle_gettargeted(struct block_list *target) {
return bl_list[rnd()%c];
}
-
//Returns the id of the current targeted character of the passed bl. [Skotlex]
int battle_gettarget(struct block_list* bl) {
+ nullpo_ret(bl);
switch (bl->type) {
case BL_PC: return ((struct map_session_data*)bl)->ud.target;
case BL_MOB: return ((struct mob_data*)bl)->target_id;
@@ -123,6 +125,7 @@ int battle_getenemy_sub(struct block_list *bl, va_list ap) {
struct block_list *target;
int *c;
+ nullpo_ret(bl);
bl_list = va_arg(ap, struct block_list **);
c = va_arg(ap, int *);
target = va_arg(ap, struct block_list *);
@@ -149,6 +152,7 @@ struct block_list* battle_getenemy(struct block_list *target, int type, int rang
struct block_list *bl_list[24];
int c = 0;
+ nullpo_retr(NULL, target);
memset(bl_list, 0, sizeof(bl_list));
map->foreachinrange(battle->get_enemy_sub, target, range, type, bl_list, &c, target);
@@ -164,8 +168,11 @@ int battle_getenemyarea_sub(struct block_list *bl, va_list ap) {
struct block_list **bl_list, *src;
int *c, ignore_id;
+ nullpo_ret(bl);
bl_list = va_arg(ap, struct block_list **);
+ nullpo_ret(bl_list);
c = va_arg(ap, int *);
+ nullpo_ret(c);
src = va_arg(ap, struct block_list *);
ignore_id = va_arg(ap, int);
@@ -191,6 +198,7 @@ struct block_list* battle_getenemyarea(struct block_list *src, int x, int y, int
struct block_list *bl_list[24];
int c = 0;
+ nullpo_retr(NULL, src);
memset(bl_list, 0, sizeof(bl_list));
map->foreachinarea(battle->get_enemy_area_sub, src->m, x - range, y - range, x + range, y + range, type, bl_list, &c, src, ignore_id);
@@ -210,7 +218,7 @@ int battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
struct block_list* target = map->id2bl(dat->target_id);
if( !target || status->isdead(target) ) {/* nothing we can do */
- if( dat->src_type == BL_PC && ( src = map->id2bl(dat->src_id) ) && --((TBL_PC*)src)->delayed_damage == 0 && ((TBL_PC*)src)->state.hold_recalc ) {
+ if( dat->src_type == BL_PC && (src = map->id2bl(dat->src_id)) != NULL && --((TBL_PC*)src)->delayed_damage == 0 && ((TBL_PC*)src)->state.hold_recalc ) {
((TBL_PC*)src)->state.hold_recalc = 0;
status_calc_pc(((TBL_PC*)src),SCO_FORCE);
}
@@ -264,7 +272,7 @@ int battle_delay_damage(int64 tick, int amotion, struct block_list *src, struct
if (d_tbl && sc && check_distance_bl(target, d_tbl, sc->data[SC_DEVOTION]->val3) && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD)
damage = 0;
-
+
if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
map->freeblock_lock();
status_fix_damage(src, target, damage, ddelay); // We have to separate here between reflect damage and others [icescope]
@@ -300,7 +308,6 @@ int battle_delay_damage(int64 tick, int amotion, struct block_list *src, struct
}
int battle_attr_ratio(int atk_elem,int def_type, int def_lv)
{
-
if (atk_elem < ELE_NEUTRAL || atk_elem >= ELE_MAX)
return 100;
@@ -452,7 +459,7 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u
if( sc->data[SC_ZENKAI] && watk->ele == sc->data[SC_ZENKAI]->val2 )
eatk += 200;
}
-
+
#ifdef RENEWAL_EDP
if ( sc && sc->data[SC_EDP] && skill_id != AS_GRIMTOOTH && skill_id != AS_VENOMKNIFE && skill_id != ASC_BREAKER ) {
struct status_data *tstatus;
@@ -462,9 +469,8 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u
} else /* fall through */
#endif
damage += eatk;
-
damage = battle->calc_elefix(src, bl, skill_id, skill_lv, damage, nk, n_ele, s_ele, s_ele_, type == EQI_HAND_L, flag);
-
+
/**
* In RE Shield Boomerang takes weapon element only for damage calculation,
* - resist calculation is always against neutral
@@ -501,7 +507,8 @@ int64 battle_calc_base_damage(struct block_list *src, struct block_list *bl, uin
int64 damage;
struct status_data *st = status->get_status_data(src);
struct status_change *sc = status->get_sc(src);
-
+
+ nullpo_retr(0, src);
if ( !skill_id ) {
s_ele = st->rhw.ele;
s_ele_ = st->lhw.ele;
@@ -536,6 +543,8 @@ int64 battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa, st
short type = 0;
int64 damage = 0;
+ nullpo_retr(damage, st);
+ nullpo_retr(damage, wa);
if (!sd) { //Mobs/Pets
if(flag&4) {
atkmin = st->matk_min;
@@ -612,6 +621,7 @@ int64 battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa, st
int64 battle_calc_sizefix(struct map_session_data *sd, int64 damage, int type, int size, bool ignore){
//SizeFix only for players
+ nullpo_retr(damage, sd);
if (!(sd->special_state.no_sizefix || (ignore)))
damage = damage * ( type == EQI_HAND_L ? sd->left_weapon.atkmods[size] : sd->right_weapon.atkmods[size] ) / 100;
return damage;
@@ -627,8 +637,8 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in
int weapon, skill_lv;
damage = dmg;
- nullpo_ret(sd);
-
+ nullpo_retr(damage, sd);
+ nullpo_retr(damage, target);
if((skill_lv = pc->checkskill(sd,AL_DEMONBANE)) > 0 &&
target->type == BL_MOB && //This bonus doesn't work against players.
(battle->check_undead(st->race,st->def_ele) || st->race==RC_DEMON) )
@@ -848,7 +858,7 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target,
i = 2; //Star anger
else
ARR_FIND(0, MAX_PC_FEELHATE, i, status->get_class(target) == sd->hate_mob[i]);
- if ( i < MAX_PC_FEELHATE && (skill2_lv=pc->checkskill(sd,pc->sg_info[i].anger_id)) && weapon ) {
+ if (i < MAX_PC_FEELHATE && (skill2_lv=pc->checkskill(sd,pc->sg_info[i].anger_id)) > 0 && weapon) {
int ratio = sd->status.base_level + status_get_dex(src) + status_get_luk(src);
if ( i == 2 ) ratio += status_get_str(src); //Star Anger
if (skill2_lv < 4 )
@@ -957,11 +967,10 @@ int64 battle_calc_cardfix2(struct block_list *src, struct block_list *bl, int64
// FIXME: wflag is undocumented
int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct block_list *target, int nk, int s_ele, int s_ele_, int64 damage, int cflag, int wflag){
struct map_session_data *sd, *tsd;
- short cardfix =
#ifdef RENEWAL
- 100;
+ short cardfix = 100;
#else
- 1000;
+ short cardfix = 1000;
#endif
short t_class, s_class, s_race2, t_race2;
struct status_data *sstatus, *tstatus;
@@ -2688,9 +2697,12 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
struct map_session_data *sd = NULL;
struct status_change *sc, *tsc;
struct status_change_entry *sce;
- int div_ = d->div_, flag = d->flag;
+ int div_, flag;
nullpo_ret(bl);
+ nullpo_ret(d);
+ div_ = d->div_;
+ flag = d->flag;
// need check src for null pointer?
@@ -2802,7 +2814,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
if( sc->data[SC__MAELSTROM] && (flag&BF_MAGIC) && skill_id && (skill->get_inf(skill_id)&INF_GROUND_SKILL) ) {
// {(Maelstrom Skill LevelxAbsorbed Skill Level)+(Caster's Job/5)}/2
- int sp = (sc->data[SC__MAELSTROM]->val1 * skill_lv + sd->status.job_level / 5) / 2;
+ int sp = (sc->data[SC__MAELSTROM]->val1 * skill_lv + (sd ? sd->status.job_level / 5 : 0)) / 2;
status->heal(bl, 0, sp, 3);
d->dmg_lv = ATK_BLOCK;
return 0;
@@ -2869,7 +2881,6 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
return 0;
}
-
if( (sce=sc->data[SC_PARRYING]) && flag&BF_WEAPON && skill_id != WS_CARTTERMINATION && rnd()%100 < sce->val2 )
{ // attack blocked by Parrying
clif->skill_nodamage(bl, bl, LK_PARRYING, sce->val1,1);
@@ -2902,7 +2913,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
return 0;
}
- if( flag&BF_MAGIC && (sce=sc->data[SC_PRESTIGE]) && rnd()%100 < sce->val2) {
+ if (flag&BF_MAGIC && (sce=sc->data[SC_PRESTIGE]) != NULL && rnd()%100 < sce->val2) {
clif->specialeffect(bl, 462, AREA); // Still need confirm it.
return 0;
}
@@ -3121,7 +3132,6 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( sc->data[SC_MEIKYOUSISUI] && rnd()%100 < 40 ) // custom value
damage = 0;
-
if (!damage) return 0;
if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rnd()%100 < sce->val1 ) {
@@ -3155,7 +3165,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( sc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * sc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) )
status->change_spread(bl, src); // Deadly infect attacked side
- if ( sd && damage > 0 && (sce = sc->data[SC_GENTLETOUCH_ENERGYGAIN]) ) {
+ if (sd && damage > 0 && (sce = sc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
if ( rnd() % 100 < sce->val2 )
pc->addspiritball(sd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(sd, 0));
}
@@ -3203,7 +3213,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
TBL_HOM *hd = BL_CAST(BL_HOM,bl);
if (hd) homun->addspiritball(hd, 10);
}
- if ( src->type == BL_PC && damage > 0 && (sce = tsc->data[SC_GENTLETOUCH_ENERGYGAIN]) ) {
+ if (src->type == BL_PC && damage > 0 && (sce = tsc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
struct map_session_data *tsd = (struct map_session_data *)src;
if ( tsd && rnd() % 100 < sce->val2 )
pc->addspiritball(tsd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(tsd, 0));
@@ -3251,24 +3261,27 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if (skill_id)
mob->skill_event((TBL_MOB*)bl,src,timer->gettick(),MSC_SKILLUSED|(skill_id<<16));
}
- if( sd ) {
- if( pc_ismadogear(sd) && rnd()%100 < 50 ) {
- short element = skill->get_ele(skill_id, skill_lv);
- if( !skill_id || element == -1 ) { //Take weapon's element
- struct status_data *sstatus = NULL;
- if( src->type == BL_PC && ((TBL_PC*)src)->bonus.arrow_ele )
- element = ((TBL_PC*)src)->bonus.arrow_ele;
- else if( (sstatus = status->get_status_data(src)) ) {
- element = sstatus->rhw.ele;
- }
+ if (sd && pc_ismadogear(sd) && rnd()%100 < 50) {
+ int element = -1;
+ if (!skill_id || (element = skill->get_ele(skill_id, skill_lv)) == -1) {
+ // Take weapon's element
+ struct status_data *sstatus = NULL;
+ if (src->type == BL_PC && ((TBL_PC*)src)->bonus.arrow_ele) {
+ element = ((TBL_PC*)src)->bonus.arrow_ele;
+ } else if ((sstatus = status->get_status_data(src)) != NULL) {
+ element = sstatus->rhw.ele;
}
- else if( element == -2 ) //Use enchantment's element
- element = status_get_attack_sc_element(src,status->get_sc(src));
- else if( element == -3 ) //Use random element
- element = rnd()%ELE_MAX;
- if( element == ELE_FIRE || element == ELE_WATER )
- pc->overheat(sd,element == ELE_FIRE ? 1 : -1);
- }
+ } else if (element == -2) {
+ // Use enchantment's element
+ element = status_get_attack_sc_element(src,status->get_sc(src));
+ } else if (element == -3) {
+ // Use random element
+ element = rnd()%ELE_MAX;
+ }
+ if (element == ELE_FIRE)
+ pc->overheat(sd, 1);
+ else if (element == ELE_WATER)
+ pc->overheat(sd, -1);
}
return damage;
@@ -3283,6 +3296,7 @@ int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64
if( !damage )
return 0;
+ nullpo_retr(damage, bl);
if( bl->type == BL_MOB ) {
struct mob_data* md = BL_CAST(BL_MOB, bl);
@@ -3303,6 +3317,8 @@ int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64
if (!damage) //No reductions to make.
return 0;
+ nullpo_retr(damage, src);
+ nullpo_retr(damage, bl);
if(md && md->guardian_data) {
if(class_ == MOBID_EMPERIUM && flag&BF_SKILL) {
@@ -3370,6 +3386,8 @@ int battle_calc_drain(int64 damage, int rate, int per) {
*------------------------------------------*/
void battle_consume_ammo(TBL_PC*sd, int skill_id, int lv) {
int qty=1;
+
+ nullpo_retv(sd);
if (!battle_config.arrow_decrement)
return;
@@ -3383,8 +3401,12 @@ void battle_consume_ammo(TBL_PC*sd, int skill_id, int lv) {
sd->state.arrow_atk = 0;
}
+
//Skill Range Criteria
int battle_range_type(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv) {
+ nullpo_retr(BF_SHORT, src);
+ nullpo_retr(BF_SHORT, target);
+
if (battle_config.skillrange_by_distance &&
(src->type&battle_config.skillrange_by_distance)
) { //based on distance between src/target [Skotlex]
@@ -3417,8 +3439,10 @@ int battle_adjust_skill_damage(int m, unsigned short skill_id) {
return 0;
}
+
int battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) {
int i;
+ nullpo_ret(sd);
if (!sd->skillblown[0].id)
return 0;
//Apply the bonus blow count. [Skotlex]
@@ -4131,7 +4155,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
default:
rskill = skill_id;
}
- if (sd && (i = pc->skillatk_bonus(sd, rskill)))
+ if (sd && (i = pc->skillatk_bonus(sd, rskill)) != 0)
md.damage += md.damage*i/100;
}
if( (i = battle->adjust_skill_damage(src->m,skill_id)) )
@@ -4497,13 +4521,19 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
skill_id == NJ_KIRIKAGE))
{
short cri = sstatus->cri;
- if (sd)
- {
+ if (sd) {
+ // Check for katar here as katar crit bonus should not be displayed
+ if (sd->status.weapon == W_KATAR) {
+ cri <<= 1;
+ }
+
cri+= sd->critaddrace[tstatus->race];
- if(flag.arrow)
+
+ if (flag.arrow) {
cri += sd->bonus.arrow_cri;
+ }
}
- if( sc && sc->data[SC_CAMOUFLAGE] )
+ if (sc && sc->data[SC_CAMOUFLAGE])
cri += 10 * (10-sc->data[SC_CAMOUFLAGE]->val4);
#ifndef RENEWAL
//The official equation is *2, but that only applies when sd's do critical.
@@ -4875,7 +4905,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
else
wd.dmg_lv = ATK_DEF;
break;
-
+
case KO_BAKURETSU:
{
#ifdef RENEWAL
@@ -5513,7 +5543,6 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
#endif
}
-
if( src != target ) { // Don't reflect your own damage (Grand Cross)
if( wd.dmg_lv == ATK_MISS || wd.dmg_lv == ATK_BLOCK ) {
int64 prev1 = wd.damage, prev2 = wd.damage2;
@@ -5573,6 +5602,7 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
break;
}
+ nullpo_retr(d, target);
#ifdef HMAP_ZONE_DAMAGE_CAP_TYPE
if( target && skill_id ) {
int i;
@@ -5610,9 +5640,10 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
}
return d;
}
+
//Performs reflect damage (magic (maya) is performed over skill.c).
void battle_reflect_damage(struct block_list *target, struct block_list *src, struct Damage *wd,uint16 skill_id) {
- int64 damage = wd->damage + wd->damage2, rdamage = 0, trdamage = 0;
+ int64 damage, rdamage = 0, trdamage = 0;
struct map_session_data *sd, *tsd;
struct status_change *sc;
int64 tick = timer->gettick();
@@ -5623,6 +5654,10 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st
max_reflect_damage = max(status_get_max_hp(target), status_get_max_hp(target) * status->get_lv(target) / 100);
#endif
+ damage = wd->damage + wd->damage2;
+
+ nullpo_retv(wd);
+
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
@@ -5803,11 +5838,14 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st
return;
#undef NORMALIZE_RDAMAGE
}
+
void battle_drain(TBL_PC *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss)
{
struct weapon_data *wd;
int type, thp = 0, tsp = 0, rhp = 0, rsp = 0, hp, sp, i;
int64 *damage;
+
+ nullpo_retv(sd);
for (i = 0; i < 4; i++) {
//First two iterations: Right hand
if (i < 2) { wd = &sd->right_weapon; damage = &rdamage; }
@@ -5870,6 +5908,7 @@ int battle_damage_area(struct block_list *bl, va_list ap) {
if( bl->type == BL_MOB && ((TBL_MOB*)bl)->class_ == MOBID_EMPERIUM )
return 0;
if( bl != src && battle->check_target(src,bl,BCT_ENEMY) > 0 ) {
+ nullpo_ret(src);
map->freeblock_lock();
if( src->type == BL_PC )
battle->drain((TBL_PC*)src, bl, damage, damage, status_get_race(bl), is_boss(bl));
@@ -6270,6 +6309,7 @@ bool battle_check_undead(int race,int element)
//Returns the upmost level master starting with the given object
struct block_list* battle_get_master(struct block_list *src) {
struct block_list *prev; //Used for infinite loop check (master of yourself?)
+ nullpo_retr(NULL, src);
do {
prev = src;
switch (src->type) {
@@ -6324,7 +6364,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
m = target->m;
- if (flag&BCT_ENEMY && ( map->getcell(m,src->x,src->y,CELL_CHKBASILICA) || map->getcell(m,target->x,target->y,CELL_CHKBASILICA) ) ) {
+ if (flag & BCT_ENEMY && (map->getcell(m, src, src->x, src->y, CELL_CHKBASILICA) || map->getcell(m, src, target->x, target->y, CELL_CHKBASILICA))) {
return -1;
}
@@ -6354,7 +6394,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
switch( target->type ) { // Checks on actual target
case BL_PC: {
struct status_change* sc = status->get_sc(src);
-
if( ((TBL_PC*)target)->invincible_timer != INVALID_TIMER ) {
switch( battle->get_current_skill(src) ) {
/* TODO a proper distinction should be established bugreport:8397 */
@@ -6393,7 +6432,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
TBL_SKILL *su = (TBL_SKILL*)target;
if( !su->group )
return 0;
- if( skill->get_inf2(su->group->skill_id)&INF2_TRAP &&
+ if( skill->get_inf2(su->group->skill_id)&INF2_TRAP &&
su->group->unit_id != UNT_USED_TRAPS &&
su->group->unit_id != UNT_NETHERWORLD ) { //Only a few skills can target traps...
switch( battle->get_current_skill(src) ) {
@@ -6686,7 +6725,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
if( d > AREA_SIZE )
return false; // Avoid targeting objects beyond your range of sight.
- return path->search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
+ return path->search_long(NULL,src,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
}
static const struct battle_data {
@@ -7045,7 +7084,6 @@ static const struct battle_data {
{ "mail_show_status", &battle_config.mail_show_status, 0, 0, 2, },
{ "client_limit_unit_lv", &battle_config.client_limit_unit_lv, 0, 0, BL_ALL, },
{ "client_emblem_max_blank_percent", &battle_config.client_emblem_max_blank_percent, 100, 0, 100, },
-
// BattleGround Settings
{ "bg_update_interval", &battle_config.bg_update_interval, 1000, 100, INT_MAX, },
{ "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, },
@@ -7081,7 +7119,6 @@ static const struct battle_data {
{ "feature.banking", &battle_config.feature_banking, 1, 0, 1, },
{ "feature.auction", &battle_config.feature_auction, 0, 0, 2, },
{ "idletime_criteria", &battle_config.idletime_criteria, 0x25, 1, INT_MAX, },
-
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
{ "case_sensitive_aegisnames", &battle_config.case_sensitive_aegisnames, 1, 0, 1, },
{ "guild_castle_invite", &battle_config.guild_castle_invite, 0, 0, 1, },
@@ -7093,6 +7130,7 @@ static const struct battle_data {
{ "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, },
{ "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, },
{ "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
+ { "show_monster_hp_bar", &battle_config.show_monster_hp_bar, 1, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
@@ -7267,8 +7305,10 @@ static int Hercules_report_timer(int tid, int64 tick, int id, intptr_t data) {
int battle_set_value(const char* w1, const char* w2)
{
int val = config_switch(w2);
-
int i;
+
+ nullpo_retr(1, w1);
+ nullpo_retr(1, w2);
ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(w1, battle_data[i].str) == 0);
if (i == ARRAYLENGTH(battle_data)) {
if( HPM->parseConf(w1,w2,HPCT_BATTLE) ) /* if plugin-owned, succeed */
@@ -7289,6 +7329,7 @@ int battle_set_value(const char* w1, const char* w2)
int battle_get_value(const char* w1)
{
int i;
+ nullpo_retr(1, w1);
ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(w1, battle_data[i].str) == 0);
if (i == ARRAYLENGTH(battle_data))
return 0; // not found
@@ -7359,7 +7400,6 @@ void battle_adjust_conf(void) {
}
#endif
-
#ifndef CELL_NOSTACK
if (battle_config.custom_cell_stack_limit != 1)
ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n");
@@ -7371,6 +7411,8 @@ int battle_config_read(const char* cfgName)
FILE* fp;
static int count = 0;
+ nullpo_ret(cfgName);
+
if (count == 0)
battle->config_set_defaults();
diff --git a/src/map/battle.h b/src/map/battle.h
index b211afff5..0ebc0aeb9 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -507,6 +507,8 @@ struct Battle_Config {
int stormgust_knockback;
int feature_roulette;
+
+ int show_monster_hp_bar; // [Frost]
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 915ccc851..5df05d301 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -236,6 +236,7 @@ bool bg_send_message(struct map_session_data *sd, const char *mes, int len) {
struct battleground_data *bgd;
nullpo_ret(sd);
+ nullpo_ret(mes);
if( sd->bg_id == 0 || (bgd = bg->team_search(sd->bg_id)) == NULL )
return false; // Couldn't send message
clif->bg_message(bgd, sd->bl.id, sd->status.name, mes, len);
@@ -271,6 +272,7 @@ enum bg_queue_types bg_str2teamtype (const char *str) {
char temp[200], *parse;
enum bg_queue_types type = BGQT_INVALID;
+ nullpo_retr(type, str);
safestrncpy(temp, str, 200);
parse = strtok(temp,"|");
@@ -457,11 +459,12 @@ void bg_config_read(void) {
}
bg->arenas = arena_count;
}
- libconfig->destroy(&bg_conf);
}
+ libconfig->destroy(&bg_conf);
}
struct bg_arena *bg_name2arena (char *name) {
int i;
+ nullpo_retr(NULL, name);
for(i = 0; i < bg->arenas; i++) {
if( strcmpi(bg->arena[i]->name,name) == 0 )
return bg->arena[i];
@@ -484,6 +487,8 @@ int bg_id2pos ( int queue_id, int account_id ) {
return 0;
}
void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bool response) {
+ nullpo_retv(arena);
+ nullpo_retv(sd);
if( arena->begin_timer == INVALID_TIMER || !sd->bg_queue.arena || sd->bg_queue.arena != arena ) {
bg->queue_pc_cleanup(sd);
return;
@@ -496,7 +501,7 @@ void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bo
sd->bg_queue.ready = 1;
for( i = 0; i < queue->size; i++ ) {
- if( queue->item[i] > 0 && ( sd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
if( sd->bg_queue.ready == 1 )
count++;
}
@@ -511,6 +516,7 @@ void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bo
}
void bg_queue_player_cleanup(struct map_session_data *sd) {
+ nullpo_retv(sd);
if ( sd->bg_queue.client_has_bg_data ) {
if( sd->bg_queue.arena )
clif->bgqueue_notice_delete(sd,BGQND_CLOSEWINDOW,sd->bg_queue.arena->name);
@@ -528,6 +534,7 @@ void bg_match_over(struct bg_arena *arena, bool canceled) {
struct hQueue *queue = &script->hq[arena->queue_id];
int i;
+ nullpo_retv(arena);
if( !arena->ongoing )
return;
arena->ongoing = false;
@@ -535,7 +542,7 @@ void bg_match_over(struct bg_arena *arena, bool canceled) {
for( i = 0; i < queue->size; i++ ) {
struct map_session_data * sd = NULL;
- if( queue->item[i] > 0 && ( sd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
if( sd->bg_queue.arena ) {
bg->team_leave(sd, 0);
bg->queue_pc_cleanup(sd);
@@ -556,10 +563,11 @@ void bg_begin(struct bg_arena *arena) {
struct hQueue *queue = &script->hq[arena->queue_id];
int i, count = 0;
+ nullpo_retv(arena);
for( i = 0; i < queue->size; i++ ) {
struct map_session_data * sd = NULL;
- if( queue->item[i] > 0 && ( sd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
if( sd->bg_queue.ready == 1 )
count++;
else
@@ -586,7 +594,7 @@ void bg_begin(struct bg_arena *arena) {
for( i = 0; i < queue->size; i++ ) {
struct map_session_data * sd = NULL;
- if( queue->item[i] > 0 && ( sd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
if( sd->bg_queue.ready == 1 ) {
mapreg->setreg(reference_uid(script->add_str("$@bg_member"), count), sd->status.account_id);
mapreg->setreg(reference_uid(script->add_str("$@bg_member_group"), count),
@@ -637,13 +645,15 @@ int bg_afk_timer(int tid, int64 tick, int id, intptr_t data) {
}
void bg_queue_pregame(struct bg_arena *arena) {
- struct hQueue *queue = &script->hq[arena->queue_id];
+ struct hQueue *queue;
int i;
+ nullpo_retv(arena);
+ queue = &script->hq[arena->queue_id];
for( i = 0; i < queue->size; i++ ) {
struct map_session_data * sd = NULL;
- if( queue->item[i] > 0 && ( sd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (sd = map->id2sd(queue->item[i])) != NULL) {
clif->bgqueue_battlebegins(sd,arena->id,SELF);
}
}
@@ -656,7 +666,10 @@ int bg_fillup_timer(int tid, int64 tick, int id, intptr_t data) {
}
void bg_queue_check(struct bg_arena *arena) {
- int count = script->hq[arena->queue_id].items;
+ int count;
+
+ nullpo_retv(arena);
+ count = script->hq[arena->queue_id].items;
if( count == arena->max_players ) {
if( arena->fillup_timer != INVALID_TIMER ) {
timer->delete(arena->fillup_timer,bg->fillup_timer);
@@ -672,6 +685,8 @@ void bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_q
struct hQueue *queue;
int i, count = 0;
+ nullpo_retv(sd);
+ nullpo_retv(arena);
if( arena->begin_timer != INVALID_TIMER || arena->ongoing ) {
clif->bgqueue_ack(sd,BGQA_FAIL_QUEUING_FINISHED,arena->id);
return;
@@ -750,6 +765,8 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
int tick;
unsigned int tsec;
+ nullpo_retr(BGQA_FAIL_TYPE_INVALID, sd);
+ nullpo_retr(BGQA_FAIL_TYPE_INVALID, arena);
if( !(arena->allowed_types & type) )
return BGQA_FAIL_TYPE_INVALID;
@@ -864,6 +881,7 @@ void do_init_battleground(bool minimal) {
int bg_team_db_final(DBKey key, DBData *data, va_list ap) {
struct battleground_data* bgd = DB->data2ptr(data);
int i;
+ nullpo_ret(bgd);
for(i = 0; i < bgd->hdatac; i++ ) {
if( bgd->hdata[i]->flag.free ) {
aFree(bgd->hdata[i]->data);
@@ -888,7 +906,6 @@ void do_final_battleground(void)
}
aFree(bg->arena);
}
-
}
void battleground_defaults(void) {
bg = &bg_s;
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index a1b6e9e65..67018ec1f 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -14,6 +14,7 @@
#include "map/pc.h" // struct map_session_data
#include "common/cbasetypes.h"
#include "common/db.h" // ARR_FIND
+#include "common/nullpo.h" // nullpo_*
#include "common/showmsg.h" // ShowWarning
#include "common/socket.h" // RBUF*
#include "common/strlib.h" // safestrncpy
@@ -28,6 +29,7 @@ unsigned int buyingstore_getuid(void) {
bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
{
+ nullpo_retr(false, sd);
if( !battle_config.feature_buying_store || sd->state.vending || sd->state.buyingstore || sd->state.trading || slots == 0 )
{
return false;
@@ -44,7 +46,7 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
return false;
}
- if( map->getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) ) {
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING)) {
// custom: no vending cells
clif->message(sd->fd, msg_sd(sd,204)); // "You can't open a shop on this cell."
return false;
@@ -62,11 +64,11 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
return true;
}
-
void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count)
{
unsigned int i, weight, listidx;
+ nullpo_retv(sd);
if (!result || count == 0) {
// canceled, or no items
return;
@@ -98,7 +100,7 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
return;
}
- if( map->getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) ) {
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING)) {
// custom: no vending cells
clif->message(sd->fd, msg_sd(sd,204)); // "You can't open a shop on this cell."
return;
@@ -178,10 +180,10 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
clif->buyingstore_entry(sd);
}
-
void buyingstore_close(struct map_session_data* sd)
{
- if( sd->state.buyingstore )
+ nullpo_retv(sd);
+ if (sd->state.buyingstore)
{
// invalidate data
sd->state.buyingstore = false;
@@ -192,11 +194,11 @@ void buyingstore_close(struct map_session_data* sd)
}
}
-
void buyingstore_open(struct map_session_data* sd, int account_id)
{
struct map_session_data* pl_sd;
+ nullpo_retv(sd);
if( !battle_config.feature_buying_store || pc_istrading(sd) )
{// not allowed to sell
return;
@@ -229,6 +231,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
unsigned int i, weight, listidx, k;
struct map_session_data* pl_sd;
+ nullpo_retv(sd);
if( count == 0 )
{// nothing to do
return;
@@ -402,7 +405,8 @@ bool buyingstore_search(struct map_session_data* sd, unsigned short nameid)
{
unsigned int i;
- if( !sd->state.buyingstore )
+ nullpo_retr(false, sd);
+ if (!sd->state.buyingstore)
{// not buying
return false;
}
@@ -424,6 +428,8 @@ bool buyingstore_searchall(struct map_session_data* sd, const struct s_search_st
unsigned int i, idx;
struct s_buyingstore_item* it;
+ nullpo_retr(true, sd);
+
if( !sd->state.buyingstore )
{// not buying
return true;
diff --git a/src/map/channel.c b/src/map/channel.c
index 337d05504..196e5f770 100644
--- a/src/map/channel.c
+++ b/src/map/channel.c
@@ -255,6 +255,7 @@ void channel_send(struct channel_data *chan, struct map_session_data *sd, const
{
char message[150];
nullpo_retv(chan);
+ nullpo_retv(msg);
if (sd && chan->msg_delay != 0
&& DIFF_TICK(sd->hchsysch_tick + chan->msg_delay*1000, timer->gettick()) > 0
@@ -262,14 +263,14 @@ void channel_send(struct channel_data *chan, struct map_session_data *sd, const
clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));
return;
} else if (sd) {
- snprintf(message, 150, "[ #%s ] %s : %s",chan->name,sd->status.name, msg);
+ safesnprintf(message, 150, "[ #%s ] %s : %s", chan->name, sd->status.name, msg);
clif->channel_msg(chan,sd,message);
if (chan->type == HCS_TYPE_IRC)
ircbot->relay(sd->status.name,msg);
if (chan->msg_delay != 0)
sd->hchsysch_tick = timer->gettick();
} else {
- snprintf(message, 150, "[ #%s ] %s",chan->name, msg);
+ safesnprintf(message, 150, "[ #%s ] %s", chan->name, msg);
clif->channel_msg2(chan, message);
if (chan->type == HCS_TYPE_IRC)
ircbot->relay(NULL, msg);
@@ -329,6 +330,7 @@ enum channel_operation_status channel_join(struct channel_data *chan, struct map
nullpo_retr(HCS_STATUS_FAIL, chan);
nullpo_retr(HCS_STATUS_FAIL, sd);
+ nullpo_retr(HCS_STATUS_FAIL, password);
if (idb_exists(chan->users, sd->status.char_id)) {
return HCS_STATUS_ALREADY;
@@ -361,7 +363,7 @@ enum channel_operation_status channel_join(struct channel_data *chan, struct map
int i;
for (i = 0; i < MAX_GUILDALLIANCE; i++) {
struct guild *sg = NULL;
- if (g->alliance[i].opposition == 0 && g->alliance[i].guild_id && (sg = guild->search(g->alliance[i].guild_id))) {
+ if (g->alliance[i].opposition == 0 && g->alliance[i].guild_id && (sg = guild->search(g->alliance[i].guild_id)) != NULL) {
if (!(sg->channel->banned && idb_exists(sg->channel->banned, sd->status.account_id))) {
channel->join_sub(sg->channel, sd, stealth);
}
@@ -445,6 +447,7 @@ void channel_leave(struct channel_data *chan, struct map_session_data *sd)
*/
void channel_quit(struct map_session_data *sd)
{
+ nullpo_retv(sd);
while (sd->channel_count > 0) {
// Loop downward to avoid unnecessary array compactions by channel_leave
struct channel_data *chan = sd->channels[sd->channel_count-1];
@@ -461,10 +464,11 @@ void channel_quit(struct map_session_data *sd)
/**
* Joins the local map channel.
*
- * @param sd The target character
+ * @param sd The target character (sd must be non null)
*/
void channel_map_join(struct map_session_data *sd)
{
+ nullpo_retv(sd);
if (sd->state.autotrade || sd->state.standalone)
return;
if (!map->list[sd->bl.m].channel) {
@@ -475,18 +479,20 @@ void channel_map_join(struct map_session_data *sd)
map->list[sd->bl.m].channel->m = sd->bl.m;
}
- channel->join(map->list[sd->bl.m].channel, sd, NULL, false);
+ channel->join(map->list[sd->bl.m].channel, sd, "", false);
}
void channel_irc_join(struct map_session_data *sd)
{
struct channel_data *chan = ircbot->channel;
+
+ nullpo_retv(sd);
if (sd->state.autotrade || sd->state.standalone)
return;
if (channel->config->irc_name[0] == '\0')
return;
if (chan)
- channel->join(chan, sd, NULL, false);
+ channel->join(chan, sd, "", false);
}
/**
@@ -548,12 +554,13 @@ void channel_guild_leave_alliance(const struct guild *g_source, const struct gui
/**
* Makes a character quit all guild-related channels.
*
- * @param sd The character
+ * @param sd The character (must be non null)
*/
void channel_quit_guild(struct map_session_data *sd)
{
unsigned char i;
+ nullpo_retv(sd);
for (i = 0; i < sd->channel_count; i++) {
struct channel_data *chan = sd->channels[i];
@@ -770,8 +777,8 @@ void read_channels_config(void)
}
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' channels in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(channel->db), config_filename);
- libconfig->destroy(&channels_conf);
}
+ libconfig->destroy(&channels_conf);
}
/*==========================================
diff --git a/src/map/chat.c b/src/map/chat.c
index ed9d9c598..976b1ce8e 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -32,6 +32,9 @@ struct chat_data* chat_createchat(struct block_list* bl, const char* title, cons
{
struct chat_data* cd;
nullpo_retr(NULL, bl);
+ nullpo_retr(NULL, title);
+ nullpo_retr(NULL, pass);
+ nullpo_retr(NULL, ev);
/* Given the overhead and the numerous instances (npc allocated or otherwise) wouldn't it be beneficial to have it use ERS? [Ind] */
cd = (struct chat_data *) aMalloc(sizeof(struct chat_data));
@@ -75,6 +78,8 @@ struct chat_data* chat_createchat(struct block_list* bl, const char* title, cons
bool chat_createpcchat(struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub) {
struct chat_data* cd;
nullpo_ret(sd);
+ nullpo_ret(title);
+ nullpo_ret(pass);
if( sd->chatID )
return false; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
@@ -89,7 +94,7 @@ bool chat_createpcchat(struct map_session_data* sd, const char* title, const cha
return false; //Can't create chatrooms on this map.
}
- if( map->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) ) {
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOCHAT) ) {
clif->message (sd->fd, msg_sd(sd,865)); // "Can't create chat rooms in this area."
return false;
}
@@ -118,6 +123,7 @@ bool chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) {
struct chat_data* cd;
nullpo_ret(sd);
+ nullpo_ret(pass);
cd = (struct chat_data*)map->id2bl(chatid);
if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )
@@ -255,6 +261,7 @@ bool chat_changechatowner(struct map_session_data* sd, const char* nextownername
int i;
nullpo_ret(sd);
+ nullpo_ret(nextownername);
cd = (struct chat_data*)map->id2bl(sd->chatID);
if( cd == NULL || (struct block_list*) sd != cd->owner )
@@ -298,6 +305,8 @@ bool chat_changechatstatus(struct map_session_data* sd, const char* title, const
struct chat_data* cd;
nullpo_ret(sd);
+ nullpo_ret(title);
+ nullpo_ret(pass);
cd = (struct chat_data*)map->id2bl(sd->chatID);
if( cd==NULL || (struct block_list *)sd != cd->owner )
@@ -325,6 +334,7 @@ bool chat_kickchat(struct map_session_data* sd, const char* kickusername) {
int i;
nullpo_ret(sd);
+ nullpo_ret(kickusername);
cd = (struct chat_data *)map->id2bl(sd->chatID);
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 65c042533..1e376e3bc 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -150,6 +150,7 @@ bool chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
bool chrif_sd_to_auth(TBL_PC* sd, enum sd_state state) {
struct auth_node *node;
+ nullpo_retr(false, sd);
if ( chrif->search(sd->status.account_id) )
return false; //Already exists?
@@ -176,6 +177,7 @@ bool chrif_sd_to_auth(TBL_PC* sd, enum sd_state state) {
bool chrif_auth_logout(TBL_PC* sd, enum sd_state state)
{
+ nullpo_retr(false, sd);
if(sd->fd && state == ST_LOGOUT) { //Disassociate player, and free it after saving ack returns. [Skotlex]
//fd info must not be lost for ST_MAPCHANGE as a final packet needs to be sent to the player.
if ( sockt->session[sd->fd] )
@@ -187,8 +189,10 @@ bool chrif_auth_logout(TBL_PC* sd, enum sd_state state)
}
bool chrif_auth_finished(TBL_PC* sd) {
- struct auth_node *node= chrif->search(sd->status.account_id);
+ struct auth_node *node;
+ nullpo_retr(false, sd);
+ node = chrif->search(sd->status.account_id);
if ( node && node->sd == sd && node->state == ST_LOGIN ) {
node->sd = NULL;
@@ -197,13 +201,16 @@ bool chrif_auth_finished(TBL_PC* sd) {
return false;
}
+
// sets char-server's user id
void chrif_setuserid(char *id) {
+ nullpo_retv(id);
memcpy(chrif->userid, id, NAME_LENGTH);
}
// sets char-server's password
void chrif_setpasswd(char *pwd) {
+ nullpo_retv(pwd);
memcpy(chrif->passwd, pwd, NAME_LENGTH);
}
@@ -220,6 +227,7 @@ void chrif_checkdefaultlogin(void) {
bool chrif_setip(const char* ip) {
char ip_str[16];
+ nullpo_retr(false, ip);
if (!(chrif->ip = sockt->host2ip(ip))) {
ShowWarning("Failed to Resolve Char Server Address! (%s)\n", ip);
return false;
@@ -446,6 +454,7 @@ void chrif_connectack(int fd) {
int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
+ nullpo_ret(node);
switch (node->state) {
case ST_LOGIN:
if ( node->sd ) {//Since there is no way to request the char auth, make it fail.
@@ -473,7 +482,6 @@ int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
return 0;
}
-
/// Called when all the connection steps are completed.
void chrif_on_ready(void) {
static bool once = false;
@@ -503,7 +511,6 @@ void chrif_on_ready(void) {
}
}
-
/*==========================================
*
*------------------------------------------*/
@@ -542,6 +549,7 @@ bool chrif_scdata_request(int account_id, int char_id)
void chrif_authreq(struct map_session_data *sd, bool hstandalone) {
struct auth_node *node= chrif->search(sd->bl.id);
+ nullpo_retv(sd);
if( node != NULL || !chrif->isconnected() ) {
sockt->eof(sd->fd);
return;
@@ -649,7 +657,6 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
}
}
-
/**
* This can still happen (client times out while waiting for char to confirm auth data)
* @see DBApply
@@ -657,6 +664,7 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
+ nullpo_retr(1, node);
if(DIFF_TICK(timer->gettick(),node->node_created)>60000) {
const char* states[] = { "Login", "Logout", "Map change" };
switch (node->state) {
@@ -732,6 +740,8 @@ bool chrif_changeemail(int id, const char *actual_email, const char *new_email)
if (battle_config.etc_log)
ShowInfo("chrif_changeemail: account: %d, actual_email: '%s', new_email: '%s'.\n", id, actual_email, new_email);
+ nullpo_retr(false, actual_email);
+ nullpo_retr(false, new_email);
chrif_check(false);
WFIFOHEAD(chrif->fd,86);
@@ -760,6 +770,7 @@ bool chrif_changeemail(int id, const char *actual_email, const char *new_email)
*------------------------------------------*/
bool chrif_char_ask_name(int acc, const char* character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second)
{
+ nullpo_retr(false, character_name);
chrif_check(false);
WFIFOHEAD(chrif->fd,44);
@@ -783,13 +794,14 @@ bool chrif_char_ask_name(int acc, const char* character_name, unsigned short ope
/**
* Requests a sex change (either per character or per account).
- *
+ *
* @param sd The character's data.
* @param change_account Whether to change the per-account sex.
* @retval true.
*/
bool chrif_changesex(struct map_session_data *sd, bool change_account)
{
+ nullpo_retr(false, sd);
chrif_check(false);
WFIFOHEAD(chrif->fd,44);
@@ -822,6 +834,7 @@ bool chrif_char_ask_name_answer(int acc, const char* player_name, uint16 type, u
char output[256];
bool charsrv = ( type == CHAR_ASK_NAME_CHARBAN || type == CHAR_ASK_NAME_CHARUNBAN ) ? true : false;
+ nullpo_retr(false, player_name);
sd = map->id2sd(acc);
if( acc < 0 || sd == NULL ) {
@@ -1025,6 +1038,7 @@ int chrif_disconnectplayer(int fd) {
int chrif_updatefamelist(struct map_session_data* sd) {
char type;
+ nullpo_retr(0, sd);
chrif_check(-1);
switch(sd->class_ & MAPID_UPPERMASK) {
@@ -1115,9 +1129,11 @@ bool chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of th
int i, count=0;
int64 tick;
struct status_change_data data;
- struct status_change *sc = &sd->sc;
+ struct status_change *sc;
const struct TimerData *td;
+ nullpo_retr(false, sd);
+ sc = &sd->sc;
chrif_check(false);
tick = timer->gettick();
@@ -1211,7 +1227,6 @@ bool chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {
return true;
}
-
/*=========================================
* Tell char-server character disconnected [Wizputer]
*-----------------------------------------*/
@@ -1254,11 +1269,12 @@ bool chrif_char_reset_offline(void) {
}
/*=========================================
- * Tell char-server character is online [Wizputer]
+ * Tell char-server character is online [Wizputer]. Look like unused.
*-----------------------------------------*/
bool chrif_char_online(struct map_session_data *sd) {
chrif_check(false);
+ nullpo_retr(false, sd);
WFIFOHEAD(chrif->fd,10);
WFIFOW(chrif->fd,0) = 0x2b19;
WFIFOL(chrif->fd,2) = sd->status.char_id;
@@ -1281,7 +1297,6 @@ void chrif_on_disconnect(void) {
timer->add(timer->gettick() + 1000, chrif->check_connect_char_server, 0, 0);
}
-
void chrif_update_ip(int fd) {
uint32 new_ip;
@@ -1523,6 +1538,7 @@ bool chrif_removefriend(int char_id, int friend_id)
void chrif_send_report(char* buf, int len) {
#ifndef STATS_OPT_OUT
if( chrif->fd > 0 ) {
+ nullpo_retv(buf);
WFIFOHEAD(chrif->fd,len + 2);
WFIFOW(chrif->fd,0) = 0x3008;
@@ -1543,6 +1559,7 @@ void chrif_save_scdata_single(int account_id, int char_id, short type, struct st
if( !chrif->isconnected() )
return;
+ nullpo_retv(sce);
WFIFOHEAD(chrif->fd, 28);
WFIFOW(chrif->fd, 0) = 0x2740;
@@ -1582,6 +1599,7 @@ void chrif_del_scdata_single(int account_id, int char_id, short type)
int auth_db_final(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
+ nullpo_ret(node);
if (node->sd) {
if( node->sd->regs.vars )
node->sd->regs.vars->destroy(node->sd->regs.vars, script->reg_destroy);
@@ -1635,7 +1653,6 @@ void do_init_chrif(bool minimal) {
timer->add_interval(timer->gettick() + 1000, chrif->send_usercount_tochar, 0, 0, UPDATE_INTERVAL);
}
-
/*=====================================
* Default Functions : chrif.h
* Generated by HerculesInterfaceMaker
@@ -1706,7 +1723,7 @@ void chrif_defaults(void) {
chrif->char_offline_nsd = chrif_char_offline_nsd;
chrif->char_reset_offline = chrif_char_reset_offline;
chrif->send_users_tochar = send_users_tochar;
- chrif->char_online = chrif_char_online;
+ chrif->char_online = chrif_char_online; // look like unused
chrif->changesex = chrif_changesex;
//chrif->chardisconnect = chrif_chardisconnect;
chrif->divorce = chrif_divorce;
diff --git a/src/map/clif.c b/src/map/clif.c
index 12565de3c..59c8a7197 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -92,7 +92,6 @@ static inline int itemtype(int type) {
}
}
-
static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir) {
p += pos;
p[0] = (uint8)(x>>2);
@@ -100,7 +99,6 @@ static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsig
p[2] = (uint8)((y<<4) | (dir&0xf));
}
-
// client-side: x0+=sx0*0.0625-0.5 and y0+=sy0*0.0625-0.5
static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) {
p += pos;
@@ -180,9 +178,14 @@ static inline bool disguised(struct block_list* bl) {
return (bool)( bl->type == BL_PC && ((TBL_PC*)bl)->disguise != -1 );
}
-
//Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex]
static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max) {
+ nullpo_retr(0, mes);
+ if (len <= 0)
+ {
+ mes[0] = '\0';
+ Assert_retr(0, len > 0);
+ }
if( len > max )
len = max;
@@ -196,6 +199,7 @@ static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned i
*------------------------------------------*/
bool clif_setip(const char* ip) {
char ip_str[16];
+ nullpo_retr(false, ip);
clif->map_ip = sockt->host2ip(ip);
if ( !clif->map_ip ) {
ShowWarning("Failed to Resolve Map Server Address! (%s)\n", ip);
@@ -208,6 +212,7 @@ bool clif_setip(const char* ip) {
}
bool clif_setbindip(const char* ip) {
+ nullpo_retr(false, ip);
clif->bind_ip = sockt->host2ip(ip);
if ( clif->bind_ip ) {
char ip_str[16];
@@ -258,6 +263,7 @@ uint32 clif_refresh_ip(void)
#if PACKETVER >= 20071106
static inline unsigned char clif_bl_type(struct block_list *bl) {
+ nullpo_retr(0x1, bl);
switch (bl->type) {
case BL_PC: return (disguised(bl) && !pc->db_checkid(status->get_viewdata(bl)->class_))? 0x1:0x0; //PC_TYPE
case BL_ITEM: return 0x2; //ITEM_TYPE
@@ -342,6 +348,7 @@ int clif_send_sub(struct block_list *bl, va_list ap) {
int clif_send_actual(int fd, void *buf, int len)
{
+ nullpo_retr(0, buf);
WFIFOHEAD(fd, len);
if (WFIFOP(fd,0) == buf) {
ShowError("WARNING: Invalid use of clif->send function\n");
@@ -391,8 +398,8 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
case ALL_SAMEMAP: //All players on the same map
iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit->next(iter)) != NULL ) {
- if( bl->m == tsd->bl.m ) {
+ while ((tsd = (TBL_PC*)mapit->next(iter)) != NULL) {
+ if (bl && bl->m == tsd->bl.m) {
WFIFOHEAD(tsd->fd, len);
memcpy(WFIFOP(tsd->fd,0), buf, len);
WFIFOSET(tsd->fd,len);
@@ -408,16 +415,19 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
/* Fall through */
case AREA_WOC:
case AREA_WOS:
+ nullpo_retr(true, bl);
map->foreachinarea(clif->send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
BL_PC, buf, len, bl, type);
break;
case AREA_CHAT_WOC:
+ nullpo_retr(true, bl);
map->foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
break;
case CHAT:
case CHAT_WOS:
+ nullpo_retr(true, bl);
{
struct chat_data *cd;
if (sd) {
@@ -441,6 +451,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
case PARTY_AREA:
case PARTY_AREA_WOS:
+ nullpo_retr(true, bl);
x0 = bl->x - AREA_SIZE;
y0 = bl->y - AREA_SIZE;
x1 = bl->x + AREA_SIZE;
@@ -507,7 +518,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
break;
case SELF:
- if (sd && (fd=sd->fd) ) {
+ if (sd && (fd=sd->fd) != 0) {
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
WFIFOSET(fd,len);
@@ -517,6 +528,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
// New definitions for guilds [Valaris] - Cleaned up and reorganized by [Skotlex]
case GUILD_AREA:
case GUILD_AREA_WOS:
+ nullpo_retr(true, bl);
x0 = bl->x - AREA_SIZE;
y0 = bl->y - AREA_SIZE;
x1 = bl->x + AREA_SIZE;
@@ -569,6 +581,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
case BG_AREA:
case BG_AREA_WOS:
+ nullpo_retr(true, bl);
x0 = bl->x - AREA_SIZE;
y0 = bl->y - AREA_SIZE;
x1 = bl->x + AREA_SIZE;
@@ -602,7 +615,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
for( i = 0; i < queue->size; i++ ) {
struct map_session_data *qsd = NULL;
- if( queue->item[i] > 0 && ( qsd = map->id2sd(queue->item[i]) ) ) {
+ if (queue->item[i] > 0 && (qsd = map->id2sd(queue->item[i])) != NULL) {
WFIFOHEAD(qsd->fd,len);
memcpy(WFIFOP(qsd->fd,0), buf, len);
WFIFOSET(qsd->fd,len);
@@ -626,11 +639,11 @@ void clif_authok(struct map_session_data *sd)
{
struct packet_authok p;
+ nullpo_retv(sd);
p.PacketType = authokType;
p.startTime = (unsigned int)timer->gettick();
WBUFPOS(&p.PosDir[0],0,sd->bl.x,sd->bl.y,sd->ud.dir); /* do the stupid client math */
p.xSize = p.ySize = 5; /* not-used */
-
#if PACKETVER >= 20080102
p.font = sd->status.font;
#endif
@@ -640,7 +653,6 @@ void clif_authok(struct map_session_data *sd)
clif->send(&p,sizeof(p),&sd->bl,SELF);
}
-
/// Notifies the client, that it's connection attempt was refused (ZC_REFUSE_ENTER).
/// 0074 <error code>.B
/// error code:
@@ -657,7 +669,6 @@ void clif_authrefuse(int fd, uint8 error_code)
WFIFOSET(fd,packet_len(0x74));
}
-
/// Notifies the client of a ban or forced disconnect (SC_NOTIFY_BAN).
/// 0081 <error code>.B
/// error code:
@@ -704,7 +715,6 @@ void clif_authfail_fd(int fd, int type)
}
-
/// Notifies the client, whether it can disconnect and change servers (ZC_RESTART_ACK).
/// 00b3 <type>.B
/// type:
@@ -752,8 +762,6 @@ void clif_dropflooritem(struct flooritem_data* fitem) {
clif->send(&p, sizeof(p), &fitem->bl, AREA);
}
-
-
/// Makes an item disappear from the ground.
/// 00a1 <id>.L (ZC_ITEM_DISAPPEAR)
void clif_clearflooritem(struct flooritem_data *fitem, int fd)
@@ -774,7 +782,6 @@ void clif_clearflooritem(struct flooritem_data *fitem, int fd)
}
}
-
/// Makes a unit (char, npc, mob, homun) disappear to one client (ZC_NOTIFY_VANISH).
/// 0080 <id>.L <type>.B
/// type:
@@ -818,7 +825,6 @@ void clif_clearunit_area(struct block_list* bl, clr_type type)
}
}
-
/// Used to make monsters with player-sprites disappear after dying
/// like normal monsters, because the client does not remove those
/// automatically.
@@ -830,7 +836,10 @@ int clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) {
}
void clif_clearunit_delayed(struct block_list* bl, clr_type type, int64 tick) {
- struct block_list *tbl = ers_alloc(clif->delay_clearunit_ers, struct block_list);
+ struct block_list *tbl;
+
+ nullpo_retv(bl);
+ tbl = ers_alloc(clif->delay_clearunit_ers, struct block_list);
memcpy (tbl, bl, sizeof (struct block_list));
timer->add(tick, clif->clearunit_delayed_sub, (int)type, (intptr_t)tbl);
}
@@ -838,6 +847,9 @@ void clif_clearunit_delayed(struct block_list* bl, clr_type type, int64 tick) {
/// Gets weapon view info from sd's inventory_data and points (*rhand,*lhand)
void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand)
{
+ nullpo_retv(sd);
+ nullpo_retv(rhand);
+ nullpo_retv(lhand);
if(sd->sc.option&OPTION_COSTUME) {
*rhand = *lhand = 0;
return;
@@ -887,6 +899,7 @@ static int clif_setlevel_sub(int lv) {
static int clif_setlevel(struct block_list* bl) {
int lv = status->get_lv(bl);
+ nullpo_retr(0, bl);
if( battle_config.client_limit_unit_lv&bl->type )
return clif_setlevel_sub(lv);
switch( bl->type ) {
@@ -906,6 +919,7 @@ void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, en
struct packet_idle_unit2 p;
int g_id = status->get_guild_id(bl);
+ nullpo_retv(bl);
sd = BL_CAST(BL_PC, bl);
p.PacketType = idle_unit2Type;
@@ -959,7 +973,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
int g_id = status->get_guild_id(bl);
nullpo_retv(bl);
-
+
#if PACKETVER < 20091103
if( !pc->db_checkid(vd->class_) ) {
clif->set_unit_idle2(bl,tsd,target);
@@ -1046,6 +1060,7 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) {
struct packet_spawn_unit2 p;
int g_id = status->get_guild_id(bl);
+ nullpo_retv(bl);
sd = BL_CAST(BL_PC, bl);
p.PacketType = spawn_unit2Type;
@@ -1180,6 +1195,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
int g_id = status->get_guild_id(bl);
nullpo_retv(bl);
+ nullpo_retv(ud);
sd = BL_CAST(BL_PC, bl);
@@ -1252,7 +1268,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
/// 01b0 <id>.L <type>.B <value>.L
/// type:
/// unused
-void clif_class_change(struct block_list *bl,int class_,int type)
+void clif_class_change(struct block_list *bl, int class_, int type)
{
nullpo_retv(bl);
@@ -1267,11 +1283,11 @@ void clif_class_change(struct block_list *bl,int class_,int type)
}
}
-
/// Notifies the client of an object's spirits.
/// 01d0 <id>.L <amount>.W (ZC_SPIRITS)
/// 01e1 <id>.L <amount>.W (ZC_SPIRITS2)
void clif_spiritball_single(int fd, struct map_session_data *sd) {
+ nullpo_retv(sd);
WFIFOHEAD(fd, packet_len(0x1e1));
WFIFOW(fd,0)=0x1e1;
WFIFOL(fd,2)=sd->bl.id;
@@ -1284,6 +1300,7 @@ void clif_spiritball_single(int fd, struct map_session_data *sd) {
*------------------------------------------*/
void clif_charm_single(int fd, struct map_session_data *sd)
{
+ nullpo_retv(sd);
WFIFOHEAD(fd, packet_len(0x08cf));
WFIFOW(fd,0) = 0x08cf;
WFIFOL(fd,2) = sd->bl.id;
@@ -1297,9 +1314,12 @@ void clif_charm_single(int fd, struct map_session_data *sd)
* Tells its client to display all weather settings being used by this map
*------------------------------------------*/
void clif_weather_check(struct map_session_data *sd) {
- int16 m = sd->bl.m;
- int fd = sd->fd;
+ int16 m;
+ int fd;
+ nullpo_retv(sd);
+ m = sd->bl.m;
+ fd = sd->fd;
if (map->list[m].flag.snow)
clif->specialeffect_single(&sd->bl, 162, fd);
if (map->list[m].flag.clouds)
@@ -1341,6 +1361,7 @@ bool clif_spawn(struct block_list *bl)
{
struct view_data *vd;
+ nullpo_retr(false, bl);
vd = status->get_viewdata(bl);
if( !vd )
return false;
@@ -1357,7 +1378,6 @@ bool clif_spawn(struct block_list *bl)
if (vd->cloth_color)
clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
-
switch (bl->type) {
case BL_PC:
{
@@ -1413,6 +1433,7 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
unsigned char buf[128];
enum homun_type htype;
+ nullpo_retv(sd);
nullpo_retv(hd);
hstatus = &hd->battle_status;
@@ -1479,7 +1500,6 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
clif->send(buf,packet_len(0x22e),&sd->bl,SELF);
}
-
/// Notification about a change in homunuculus' state (ZC_CHANGESTATE_MER).
/// 0230 <type>.B <state>.B <id>.L <data>.L
/// type:
@@ -1492,8 +1512,12 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
/// ? = ignored
void clif_send_homdata(struct map_session_data *sd, int state, int param)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ nullpo_retv(sd->hd);
+ fd = sd->fd;
if ( (state == SP_INTIMATE) && (param >= 910) && (sd->hd->homunculus.class_ == sd->hd->homunculusDB->evo_class) )
homun->calc_skilltree(sd->hd, 0);
@@ -1553,6 +1577,7 @@ void clif_homskillup(struct map_session_data *sd, uint16 skill_id) { //[orn]
struct homun_data *hd;
int fd, idx;
nullpo_retv(sd);
+ nullpo_retv(sd->hd);
idx = skill_id - HM_SKILLBASE;
fd=sd->fd;
@@ -1583,13 +1608,14 @@ void clif_hom_food(struct map_session_data *sd,int foodid,int fail)
return;
}
-
/// Notifies the client, that it is walking (ZC_NOTIFY_PLAYERMOVE).
/// 0087 <walk start time>.L <walk data>.6B
void clif_walkok(struct map_session_data *sd)
{
- int fd=sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x87));
WFIFOW(fd,0)=0x87;
WFIFOL(fd,2)=(unsigned int)timer->gettick();
@@ -1597,14 +1623,20 @@ void clif_walkok(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x87));
}
-
void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) {
#ifdef ANTI_MAYAP_CHEAT
struct status_change *sc = NULL;
+#endif
+
+ nullpo_retv(bl);
+ nullpo_retv(vd);
+ nullpo_retv(ud);
+#ifdef ANTI_MAYAP_CHEAT
if( (sc = status->get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK) )
clif->ally_only = true;
#endif
+
clif->set_unit_walking(bl,NULL,ud,AREA_WOS);
if(vd->cloth_color)
@@ -1640,7 +1672,6 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u
#endif
}
-
/// Notifies clients in an area, that an other visible object is walking (ZC_NOTIFY_PLAYERMOVE).
/// 0086 <id>.L <walk data>.6B <walk start time>.L
/// Note: unit must not be self
@@ -1648,10 +1679,14 @@ void clif_move(struct unit_data *ud)
{
unsigned char buf[16];
struct view_data *vd;
- struct block_list *bl = ud->bl;
+ struct block_list *bl;
#ifdef ANTI_MAYAP_CHEAT
struct status_change *sc = NULL;
#endif
+
+ nullpo_retv(ud);
+ bl = ud->bl;
+ nullpo_retv(bl);
vd = status->get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS)
return; //This performance check is needed to keep GM-hidden objects from being notified to bots.
@@ -1690,7 +1725,6 @@ void clif_move(struct unit_data *ud)
#endif
}
-
/*==========================================
* Delays the map->quit of a player after they are disconnected. [Skotlex]
*------------------------------------------*/
@@ -1706,7 +1740,8 @@ int clif_delayquit(int tid, int64 tick, int id, intptr_t data) {
/*==========================================
*
*------------------------------------------*/
-void clif_quitsave(int fd,struct map_session_data *sd) {
+void clif_quitsave(int fd, struct map_session_data *sd) {
+ nullpo_retv(sd);
if (!battle_config.prevent_logout ||
DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
map->quit(sd);
@@ -1734,7 +1769,6 @@ void clif_changemap(struct map_session_data *sd, short m, int x, int y) {
WFIFOSET(fd,packet_len(0x91));
}
-
/// Notifies the client of a position change to coordinates on given map, which is on another map-server (ZC_NPCACK_SERVERMOVE).
/// 0092 <map name>.16B <x>.W <y>.W <ip>.L <port>.W
void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) {
@@ -1752,15 +1786,14 @@ void clif_changemapserver(struct map_session_data* sd, unsigned short map_index,
WFIFOSET(fd,packet_len(0x92));
}
-
void clif_blown(struct block_list *bl)
{
//Aegis packets says fixpos, but it's unsure whether slide works better or not.
+ nullpo_retv(bl);
clif->fixpos(bl);
clif->slide(bl, bl->x, bl->y);
}
-
/// Visually moves(slides) a character to x,y. If the target cell
/// isn't walkable, the char doesn't move at all. If the char is
/// sitting it will stand up (ZC_STOPMOVE).
@@ -1782,7 +1815,6 @@ void clif_fixpos(struct block_list *bl) {
}
}
-
/// Displays the buy/sell dialog of an NPC shop (ZC_SELECT_DEALTYPE).
/// 00c4 <shop id>.L
void clif_npcbuysell(struct map_session_data* sd, int id)
@@ -1798,7 +1830,6 @@ void clif_npcbuysell(struct map_session_data* sd, int id)
WFIFOSET(fd,packet_len(0xc4));
}
-
/// Presents list of items, that can be bought in an NPC shop (ZC_PC_PURCHASE_ITEMLIST).
/// 00c6 <packet len>.W { <price>.L <discount price>.L <item type>.B <name id>.W }*
void clif_buylist(struct map_session_data *sd, struct npc_data *nd) {
@@ -1861,7 +1892,7 @@ void clif_selllist(struct map_session_data *sd)
if( sd->status.inventory[i].expire_time )
continue; // Cannot Sell Rental Items
-
+
if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))
continue; // Don't allow sale of bound items
@@ -1878,7 +1909,6 @@ void clif_selllist(struct map_session_data *sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Displays an NPC dialog message (ZC_SAY_DIALOG).
/// 00b4 <packet len>.W <npc id>.L <message>.?B
/// Client behavior (dialog window):
@@ -1889,7 +1919,11 @@ void clif_selllist(struct map_session_data *sd)
/// - append this text
void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) {
int fd = sd->fd;
- size_t slen = strlen(mes) + 9;
+ size_t slen;
+
+ nullpo_retv(sd);
+ nullpo_retv(mes);
+ slen = strlen(mes) + 9;
sd->state.dialog = 1;
@@ -1901,7 +1935,6 @@ void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Adds a 'next' button to an NPC dialog (ZC_WAIT_DIALOG).
/// 00b5 <npc id>.L
/// Client behavior (dialog window):
@@ -1912,7 +1945,7 @@ void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) {
/// - 00B9 <npcid of dialog window>.L
/// - set to clear on next mes
/// - remove 'next' button
-void clif_scriptnext(struct map_session_data *sd,int npcid)
+void clif_scriptnext(struct map_session_data *sd, int npcid)
{
int fd;
@@ -1925,7 +1958,6 @@ void clif_scriptnext(struct map_session_data *sd,int npcid)
WFIFOSET(fd,packet_len(0xb5));
}
-
/// Adds a 'close' button to an NPC dialog (ZC_CLOSE_DIALOG).
/// 00b6 <npc id>.L
/// Client behavior:
@@ -1959,9 +1991,11 @@ void clif_scriptclose(struct map_session_data *sd, int npcid)
*------------------------------------------*/
void clif_sendfakenpc(struct map_session_data *sd, int npcid) {
unsigned char *buf;
- int fd = sd->fd;
- sd->state.using_fake_npc = 1;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
+ sd->state.using_fake_npc = 1;
WFIFOHEAD(fd, packet_len(0x78));
buf = WFIFOP(fd,0);
memset(WBUFP(buf,0), 0, packet_len(0x78));
@@ -1978,7 +2012,6 @@ void clif_sendfakenpc(struct map_session_data *sd, int npcid) {
WFIFOSET(fd, packet_len(0x78));
}
-
/// Displays an NPC dialog menu (ZC_MENU_LIST).
/// 00b7 <packet len>.W <npc id>.L <menu items>.?B
/// Client behavior:
@@ -2000,11 +2033,15 @@ void clif_sendfakenpc(struct map_session_data *sd, int npcid) {
/// Which suggests their have intertwined behavior. (probably the mouse targeting)
/// TODO investigate behavior of other windows [FlavioJS]
void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes) {
- int fd = sd->fd;
- size_t slen = strlen(mes) + 9;
+ int fd;
+ size_t slen;
struct block_list *bl = NULL;
- if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m ||
+ nullpo_retv(sd);
+ nullpo_retv(mes);
+ fd = sd->fd;
+ slen = strlen(mes) + 9;
+ if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
@@ -2017,7 +2054,6 @@ void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Displays an NPC dialog input box for numbers (ZC_OPEN_EDITDLG).
/// 0142 <npc id>.L
/// Client behavior (inputnum window):
@@ -2035,7 +2071,7 @@ void clif_scriptinput(struct map_session_data *sd, int npcid) {
nullpo_retv(sd);
- if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m ||
+ if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
@@ -2047,7 +2083,6 @@ void clif_scriptinput(struct map_session_data *sd, int npcid) {
WFIFOSET(fd,packet_len(0x142));
}
-
/// Displays an NPC dialog input box for numbers (ZC_OPEN_EDITDLGSTR).
/// 01d4 <npc id>.L
/// Client behavior (inputstr window):
@@ -2065,7 +2100,7 @@ void clif_scriptinputstr(struct map_session_data *sd, int npcid) {
nullpo_retv(sd);
- if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) && (bl->m!=sd->bl.m ||
+ if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
@@ -2077,7 +2112,6 @@ void clif_scriptinputstr(struct map_session_data *sd, int npcid) {
WFIFOSET(fd,packet_len(0x1d4));
}
-
/// Marks a position on client's minimap (ZC_COMPASS).
/// 0144 <npc id>.L <type>.L <x>.L <y>.L <id>.B <color>.L
/// npc id:
@@ -2129,12 +2163,12 @@ void clif_cutin(struct map_session_data* sd, const char* image, int type)
WFIFOSET(fd,packet_len(0x1b3));
}
-
/*==========================================
* Fills in card data from the given item and into the buffer. [Skotlex]
*------------------------------------------*/
void clif_addcards(unsigned char* buf, struct item* item) {
int i=0,j;
+ nullpo_retv(buf);
if( item == NULL ) { //Blank data
WBUFW(buf,0) = 0;
WBUFW(buf,2) = 0;
@@ -2184,6 +2218,7 @@ void clif_addcards(unsigned char* buf, struct item* item) {
void clif_addcards2(unsigned short *cards, struct item* item) {
int i=0,j;
+ nullpo_retv(cards);
if( item == NULL ) { //Blank data
cards[0] = 0;
cards[1] = 0;
@@ -2243,6 +2278,7 @@ void clif_addcards2(unsigned short *cards, struct item* item) {
void clif_add_random_options(unsigned char* buf, struct item* item)
{
int i;
+ nullpo_retv(buf);
for (i = 0; i < 5; i++){
WBUFW(buf,i*5+0) = 0; // OptIndex
WBUFW(buf,i*5+2) = 0; // Value
@@ -2250,7 +2286,6 @@ void clif_add_random_options(unsigned char* buf, struct item* item)
}
}
-
/// Notifies the client, about a received inventory item or the result of a pick-up request.
/// 00a0 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B (ZC_ITEM_PICKUP_ACK)
/// 029a <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B <expire time>.L (ZC_ITEM_PICKUP_ACK2)
@@ -2311,7 +2346,6 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
clif->send(&p,sizeof(p),&sd->bl,SELF);
}
-
/// Notifies the client, that an inventory item was deleted or dropped (ZC_ITEM_THROW_ACK).
/// 00af <index>.W <amount>.W
void clif_dropitem(struct map_session_data *sd,int n,int amount)
@@ -2328,7 +2362,6 @@ void clif_dropitem(struct map_session_data *sd,int n,int amount)
WFIFOSET(fd,packet_len(0xaf));
}
-
/// Notifies the client, that an inventory item was deleted (ZC_DELETE_ITEM_FROM_BODY).
/// 07fa <delete type>.W <index>.W <amount>.W
/// delete type: @see enum delitem_reason
@@ -2352,10 +2385,10 @@ void clif_delitem(struct map_session_data *sd,int n,int amount, short reason)
#endif
}
-
// Simplifies inventory/cart/storage packets by handling the packet section relevant to items. [Skotlex]
// Equip is >= 0 for equippable items (holds the equip-point, is 0 for pet
// armor/egg) -1 for stackable items, -2 for stackable items where arrows must send in the equip-point.
+// look like unused, not adding checks
void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip) {
if (id->view_id > 0)
WBUFW(buf,n)=id->view_id;
@@ -2377,10 +2410,14 @@ void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *
}
}
+
void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) {
#if PACKETVER >= 20150226
int j;
#endif
+ nullpo_retv(p);
+ nullpo_retv(i);
+ nullpo_retv(id);
p->index = idx;
if (id->view_id > 0)
@@ -2396,7 +2433,6 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct
p->location = eqp_pos;
p->WearState = i->equip;
-
#if PACKETVER < 20120925
p->IsDamaged = i->attribute ? 1 : 0;
#endif
@@ -2407,7 +2443,7 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct
#if PACKETVER >= 20071002
p->HireExpireDate = i->expire_time;
#endif
-
+
#if PACKETVER >= 20080102
p->bindOnEquipType = i->bound ? 2 : id->flag.bindonequip ? 1 : 0;
#endif
@@ -2432,7 +2468,12 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct
}
#endif
}
+
void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) {
+ nullpo_retv(p);
+ nullpo_retv(i);
+ nullpo_retv(id);
+
p->index = idx;
if (id->view_id > 0)
@@ -2441,18 +2482,18 @@ void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, stru
p->ITID = i->nameid;
p->type = itemtype(id->type);
-
+
#if PACKETVER < 20120925
p->IsIdentified = i->identify ? 1 : 0;
#endif
p->count = i->amount;
p->WearState = id->equip;
-
+
#if PACKETVER >= 5
clif->addcards2(&p->slot.card[0], i);
#endif
-
+
#if PACKETVER >= 20080102
p->HireExpireDate = i->expire_time;
#endif
@@ -2463,17 +2504,19 @@ void clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, stru
p->Flag.SpareBits = 0;
#endif
}
+
void clif_inventorylist(struct map_session_data *sd) {
int i, normal = 0, equip = 0;
+ nullpo_retv(sd);
for( i = 0; i < MAX_INVENTORY; i++ ) {
if( sd->status.inventory[i].nameid <= 0 || sd->inventory_data[i] == NULL )
continue;
if( !itemdb->isstackable2(sd->inventory_data[i]) ) //Non-stackable (Equippable)
- clif_item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.inventory[i],sd->inventory_data[i],pc->equippoint(sd,i));
+ clif->item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.inventory[i],sd->inventory_data[i],pc->equippoint(sd,i));
else //Stackable (Normal)
- clif_item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.inventory[i],sd->inventory_data[i]);
+ clif->item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.inventory[i],sd->inventory_data[i]);
}
if( normal ) {
@@ -2508,12 +2551,13 @@ void clif_inventorylist(struct map_session_data *sd) {
void clif_equiplist(struct map_session_data *sd) {
int i, equip = 0;
+ nullpo_retv(sd);
for( i = 0; i < MAX_INVENTORY; i++ ) {
if( sd->status.inventory[i].nameid <= 0 || sd->inventory_data[i] == NULL )
continue;
if( !itemdb->isstackable2(sd->inventory_data[i]) ) //Non-stackable (Equippable)
- clif_item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.inventory[i],sd->inventory_data[i],pc->equippoint(sd,i));
+ clif->item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.inventory[i],sd->inventory_data[i],pc->equippoint(sd,i));
}
if( equip ) {
@@ -2539,6 +2583,8 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
int i = 0;
struct item_data *id;
+ nullpo_retv(sd);
+ nullpo_retv(items);
do {
int normal = 0, equip = 0, k = 0;
@@ -2550,9 +2596,9 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
id = itemdb->search(items[i].nameid);
if( !itemdb->isstackable2(id) ) //Non-stackable (Equippable)
- clif_item_equip(i+1,&storelist_equip.list[equip++],&items[i],id,id->equip);
+ clif->item_equip(i+1,&storelist_equip.list[equip++],&items[i],id,id->equip);
else //Stackable (Normal)
- clif_item_normal(i+1,&storelist_normal.list[normal++],&items[i],id);
+ clif->item_normal(i+1,&storelist_normal.list[normal++],&items[i],id);
}
if( normal ) {
@@ -2585,17 +2631,17 @@ void clif_cartlist(struct map_session_data *sd) {
int i, normal = 0, equip = 0;
struct item_data *id;
+ nullpo_retv(sd);
for( i = 0; i < MAX_CART; i++ ) {
if( sd->status.cart[i].nameid <= 0 )
continue;
id = itemdb->search(sd->status.cart[i].nameid);
-
if( !itemdb->isstackable2(id) ) //Non-stackable (Equippable)
- clif_item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.cart[i],id,id->equip);
+ clif->item_equip(i+2,&itemlist_equip.list[equip++],&sd->status.cart[i],id,id->equip);
else //Stackable (Normal)
- clif_item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.cart[i],id);
+ clif->item_normal(i+2,&itemlist_normal.list[normal++],&sd->status.cart[i],id);
}
if( normal ) {
@@ -2613,7 +2659,6 @@ void clif_cartlist(struct map_session_data *sd) {
}
}
-
/// Removes cart (ZC_CARTOFF).
/// 012b
/// Client behavior:
@@ -2627,7 +2672,6 @@ void clif_clearcart(int fd)
}
-
/// Guild XY locators (ZC_NOTIFY_POSITION_TO_GUILDM) [Valaris]
/// 01eb <account id>.L <x>.W <y>.W
void clif_guild_xy(struct map_session_data *sd)
@@ -2651,6 +2695,7 @@ void clif_guild_xy_single(int fd, struct map_session_data *sd)
if( sd->bg_id )
return;
+ nullpo_retv(sd);
WFIFOHEAD(fd,packet_len(0x1eb));
WFIFOW(fd,0)=0x1eb;
WFIFOL(fd,2)=sd->status.account_id;
@@ -2843,13 +2888,11 @@ void clif_updatestatus(struct map_session_data *sd,int type)
WFIFOL(fd,4)=sd->battle_status.cri/10;
break;
case SP_MATK1:
- WFIFOL(fd,4)=pc_rightside_matk(sd);
+ WFIFOL(fd,4)=pc_rightside_matk(sd);
break;
case SP_MATK2:
- WFIFOL(fd,4)=pc_leftside_matk(sd);
+ WFIFOL(fd,4)=pc_leftside_matk(sd);
break;
-
-
case SP_ZENY:
WFIFOW(fd,0)=0xb1;
WFIFOL(fd,4)=sd->status.zeny;
@@ -3149,7 +3192,6 @@ void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_ta
clif->sendlook(bl, id, type, val, 0, target);
}
-
/// Character status (ZC_STATUS).
/// 00bd <stpoint>.W <str>.B <need str>.B <agi>.B <need agi>.B <vit>.B <need vit>.B
/// <int>.B <need int>.B <dex>.B <need dex>.B <luk>.B <need luk>.B <atk>.W <atk2>.W
@@ -3213,7 +3255,6 @@ void clif_initialstatus(struct map_session_data *sd) {
clif->updatestatus(sd,SP_ASPD);
}
-
/// Marks an ammunition item in inventory as equipped (ZC_EQUIP_ARROW).
/// 013c <index>.W
void clif_arrowequip(struct map_session_data *sd,int val)
@@ -3232,7 +3273,6 @@ void clif_arrowequip(struct map_session_data *sd,int val)
WFIFOSET(fd,packet_len(0x013c));
}
-
/// Ammunition action message (ZC_ACTION_FAILURE).
/// 013b <type>.W
/// type:
@@ -3255,7 +3295,6 @@ void clif_arrow_fail(struct map_session_data *sd,int type)
WFIFOSET(fd,packet_len(0x013b));
}
-
/// Presents a list of items, that can be processed by Arrow Crafting (ZC_MAKINGARROW_LIST).
/// 01ad <packet len>.W { <name id>.W }*
void clif_arrow_create_list(struct map_session_data *sd)
@@ -3290,7 +3329,6 @@ void clif_arrow_create_list(struct map_session_data *sd)
}
}
-
/// Notifies the client, about the result of an status change request (ZC_STATUS_CHANGE_ACK).
/// 00bc <status id>.W <result>.B <value>.B
/// status id:
@@ -3313,7 +3351,6 @@ void clif_statusupack(struct map_session_data *sd,int type,int ok,int val)
WFIFOSET(fd,packet_len(0xbc));
}
-
/// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK).
/// 00aa <index>.W <equip location>.W <result>.B
/// 00aa <index>.W <equip location>.W <view id>.W <result>.B (PACKETVER >= 20100629)
@@ -3336,7 +3373,6 @@ void clif_equipitemack(struct map_session_data *sd,int n,int pos,enum e_EQUIP_IT
clif->send(&p, sizeof(p), &sd->bl, SELF);
}
-
/// Notifies the client about the result of a request to take off an item (ZC_REQ_TAKEOFF_EQUIP_ACK).
/// 00ac <index>.W <equip location>.W <result>.B
void clif_unequipitemack(struct map_session_data *sd,int n,int pos,enum e_UNEQUIP_ITEM_ACK result) {
@@ -3352,7 +3388,6 @@ void clif_unequipitemack(struct map_session_data *sd,int n,int pos,enum e_UNEQUI
clif->send(&p, sizeof(p), &sd->bl, SELF);
}
-
/// Notifies clients in the area about an special/visual effect (ZC_NOTIFY_EFFECT).
/// 019b <id>.L <effect id>.L
/// effect id:
@@ -3379,7 +3414,6 @@ void clif_misceffect(struct block_list* bl,int type)
clif->send(buf,packet_len(0x19b),bl,AREA);
}
-
/// Notifies clients in the area of a state change.
/// 0119 <id>.L <body state>.W <health state>.W <effect state>.W <pk mode>.B (ZC_STATE_CHANGE)
/// 0229 <id>.L <body state>.W <health state>.W <effect state>.L <pk mode>.B (ZC_STATE_CHANGE3)
@@ -3430,13 +3464,13 @@ void clif_changeoption(struct block_list* bl)
#endif
}
-
/// Displays status change effects on NPCs/monsters (ZC_NPC_SHOWEFST_UPDATE).
/// 028a <id>.L <effect state>.L <level>.L <showEFST>.L
void clif_changeoption2(struct block_list* bl) {
unsigned char buf[20];
struct status_change *sc;
+ nullpo_retv(bl);
if ( !(sc = status->get_sc(bl)) && bl->type != BL_NPC ) return; //How can an option change if there's no sc?
WBUFW(buf,0) = 0x28a;
@@ -3455,7 +3489,6 @@ void clif_changeoption2(struct block_list* bl) {
clif->send(buf,packet_len(0x28a),bl,AREA);
}
-
/// Notifies the client about the result of an item use request.
/// 00a8 <index>.W <amount>.W <result>.B (ZC_USE_ITEM_ACK)
/// 01c8 <index>.W <name id>.W <id>.L <amount>.W <result>.B (ZC_USE_ITEM_ACK2)
@@ -3518,7 +3551,6 @@ void clif_createchat(struct map_session_data* sd, int flag)
WFIFOSET(fd,packet_len(0xd6));
}
-
/// Display a chat above the owner (ZC_ROOM_NEWENTRY).
/// 00d7 <packet len>.W <owner id>.L <char id>.L <limit>.W <users>.W <type>.B <title>.?B
/// type:
@@ -3556,7 +3588,6 @@ void clif_dispchat(struct chat_data* cd, int fd)
}
}
-
/// Chatroom properties adjustment (ZC_CHANGE_CHATROOM).
/// 00df <packet len>.W <owner id>.L <chat id>.L <limit>.W <users>.W <type>.B <title>.?B
/// type:
@@ -3588,7 +3619,6 @@ void clif_changechatstatus(struct chat_data* cd)
clif->send(buf,WBUFW(buf,2),cd->owner,CHAT);
}
-
/// Removes the chatroom (ZC_DESTROY_ROOM).
/// 00d8 <chat id>.L
void clif_clearchat(struct chat_data *cd,int fd)
@@ -3608,7 +3638,6 @@ void clif_clearchat(struct chat_data *cd,int fd)
}
}
-
/// Displays messages regarding join chat failures (ZC_REFUSE_ENTER_ROOM).
/// 00da <result>.B
/// result:
@@ -3634,7 +3663,6 @@ void clif_joinchatfail(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0xda));
}
-
/// Notifies the client about entering a chatroom (ZC_ENTER_ROOM).
/// 00db <packet len>.W <chat id>.L { <role>.L <name>.24B }*
/// role:
@@ -3673,7 +3701,6 @@ void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd)
WFIFOSET(fd, WFIFOW(fd, 2));
}
-
/// Notifies clients in a chat about a new member (ZC_MEMBER_NEWENTRY).
/// 00dc <users>.W <name>.24B
void clif_addchat(struct chat_data* cd,struct map_session_data *sd)
@@ -3689,7 +3716,6 @@ void clif_addchat(struct chat_data* cd,struct map_session_data *sd)
clif->send(buf,packet_len(0xdc),&sd->bl,CHAT_WOS);
}
-
/// Announce the new owner (ZC_ROLE_CHANGE).
/// 00e1 <role>.L <nick>.24B
/// role:
@@ -3713,7 +3739,6 @@ void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd)
clif->send(buf,packet_len(0xe1)*2,&sd->bl,CHAT);
}
-
/// Notify about user leaving the chatroom (ZC_MEMBER_EXIT).
/// 00dd <users>.W <nick>.24B <flag>.B
/// flag:
@@ -3734,21 +3759,28 @@ void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag
clif->send(buf,packet_len(0xdd),&sd->bl,CHAT);
}
-
/// Opens a trade request window from char 'name'.
/// 00e5 <nick>.24B (ZC_REQ_EXCHANGE_ITEM)
/// 01f4 <nick>.24B <charid>.L <baselvl>.W (ZC_REQ_EXCHANGE_ITEM2)
-void clif_traderequest(struct map_session_data* sd, const char* name) {
- int fd = sd->fd;
+void clif_traderequest(struct map_session_data *sd, const char *name)
+{
+ int fd;
+#if PACKETVER >= 6
+ struct map_session_data* tsd = NULL;
+#endif // PACKETVER >= 6
+ nullpo_retv(sd);
+ nullpo_retv(name);
+ fd = sd->fd;
#if PACKETVER < 6
WFIFOHEAD(fd,packet_len(0xe5));
WFIFOW(fd,0) = 0xe5;
safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0xe5));
#else // PACKETVER >= 6
- struct map_session_data* tsd = map->id2sd(sd->trade_partner);
- if( !tsd ) return;
+ tsd = map->id2sd(sd->trade_partner);
+ if (!tsd)
+ return;
WFIFOHEAD(fd,packet_len(0x1f4));
WFIFOW(fd,0) = 0x1f4;
@@ -3759,7 +3791,6 @@ void clif_traderequest(struct map_session_data* sd, const char* name) {
#endif // PACKETVER < 6
}
-
/// Reply to a trade-request.
/// 00e7 <result>.B (ZC_ACK_EXCHANGE_ITEM)
/// 01f5 <result>.B <charid>.L <baselvl>.W (ZC_ACK_EXCHANGE_ITEM2)
@@ -3770,11 +3801,18 @@ void clif_traderequest(struct map_session_data* sd, const char* name) {
/// 3 = Accept
/// 4 = Cancel
/// 5 = Busy
-void clif_tradestart(struct map_session_data* sd, uint8 type) {
- int fd = sd->fd;
+void clif_tradestart(struct map_session_data *sd, uint8 type)
+{
+ int fd;
+#if PACKETVER >= 6
+ struct map_session_data *tsd = NULL;
+#endif // PACKETVER >= 6
+ nullpo_retv(sd);
+
+ fd = sd->fd;
#if PACKETVER >= 6
- struct map_session_data* tsd = map->id2sd(sd->trade_partner);
- if( tsd ) {
+ tsd = map->id2sd(sd->trade_partner);
+ if (tsd) {
WFIFOHEAD(fd,packet_len(0x1f5));
WFIFOW(fd,0) = 0x1f5;
WFIFOB(fd,2) = type;
@@ -3790,7 +3828,6 @@ void clif_tradestart(struct map_session_data* sd, uint8 type) {
WFIFOSET(fd,packet_len(0xe7));
}
-
/// Notifies the client about an item from other player in current trade.
/// 00e9 <amount>.L <nameid>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_EXCHANGE_ITEM)
/// 080f <nameid>.W <item type>.B <amount>.L <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_EXCHANGE_ITEM2)
@@ -3856,7 +3893,6 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd
WFIFOSET(fd,packet_len(tradeaddType));
}
-
/// Notifies the client about the result of request to add an item to the current trade (ZC_ACK_ADD_EXCHANGE_ITEM).
/// 00ea <index>.W <result>.B
/// result:
@@ -3876,7 +3912,6 @@ void clif_tradeitemok(struct map_session_data* sd, int index, int fail)
WFIFOSET(fd,packet_len(0xea));
}
-
/// Notifies the client about finishing one side of the current trade (ZC_CONCLUDE_EXCHANGE_ITEM).
/// 00ec <who>.B
/// who:
@@ -3894,7 +3929,6 @@ void clif_tradedeal_lock(struct map_session_data* sd, int fail)
WFIFOSET(fd,packet_len(0xec));
}
-
/// Notifies the client about the trade being canceled (ZC_CANCEL_EXCHANGE_ITEM).
/// 00ee
void clif_tradecancelled(struct map_session_data* sd)
@@ -3908,7 +3942,6 @@ void clif_tradecancelled(struct map_session_data* sd)
WFIFOSET(fd,packet_len(0xee));
}
-
/// Result of a trade (ZC_EXEC_EXCHANGE_ITEM).
/// 00f0 <result>.B
/// result:
@@ -3926,21 +3959,22 @@ void clif_tradecompleted(struct map_session_data* sd, int fail)
WFIFOSET(fd,packet_len(0xf0));
}
-
/// Resets the trade window on the send side (ZC_EXCHANGEITEM_UNDO).
/// 00f1
/// NOTE: Unknown purpose. Items are not removed until the window is
/// refreshed (ex. by putting another item in there).
+/// unused
void clif_tradeundo(struct map_session_data* sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xf1));
WFIFOW(fd,0) = 0xf1;
WFIFOSET(fd,packet_len(0xf1));
}
-
/// Updates storage total amount (ZC_NOTIFY_STOREITEM_COUNTINFO).
/// 00f2 <current count>.W <max count>.W
void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount)
@@ -3957,7 +3991,6 @@ void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_a
WFIFOSET(fd,packet_len(0xf2));
}
-
/// Notifies the client of an item being added to the storage.
/// 00f4 <index>.W <amount>.L <nameid>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE)
/// 01c4 <index>.W <amount>.L <nameid>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE2)
@@ -3971,7 +4004,6 @@ void clif_storageitemadded(struct map_session_data* sd, struct item* i, int inde
fd=sd->fd;
view = itemdb_viewid(i->nameid);
-
WFIFOHEAD(fd,packet_len(storageaddType));
WFIFOW(fd, 0) = storageaddType; // Storage item added
WFIFOW(fd, 2) = index+1; // index
@@ -3991,7 +4023,6 @@ void clif_storageitemadded(struct map_session_data* sd, struct item* i, int inde
WFIFOSET(fd,packet_len(storageaddType));
}
-
/// Notifies the client of an item being deleted from the storage (ZC_DELETE_ITEM_FROM_STORE).
/// 00f6 <index>.W <amount>.L
void clif_storageitemremoved(struct map_session_data* sd, int index, int amount)
@@ -4008,7 +4039,6 @@ void clif_storageitemremoved(struct map_session_data* sd, int index, int amount)
WFIFOSET(fd,packet_len(0xf6));
}
-
/// Closes storage (ZC_CLOSE_STORE).
/// 00f8
void clif_storageclose(struct map_session_data* sd)
@@ -4030,6 +4060,8 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
struct block_list *d_bl;
int i;
+ nullpo_retv(sd);
+ nullpo_retv(dstsd);
if( dstsd->chatID ) {
struct chat_data *cd = NULL;
if( (cd = (struct chat_data*)map->id2bl(dstsd->chatID)) && cd->usersd[0]==dstsd)
@@ -4068,6 +4100,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
struct unit_data *ud;
struct view_data *vd;
+ nullpo_retv(sd);
+ nullpo_retv(bl);
+
vd = status->get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS)
return;
@@ -4123,10 +4158,10 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
else if(md->special_state.size==SZ_MEDIUM)
clif->specialeffect_single(bl,421,sd->fd);
#if PACKETVER >= 20120404
- if( !(md->status.mode&MD_BOSS) ){
+ if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) {
int i;
for(i = 0; i < DAMAGELOG_SIZE; i++) {// must show hp bar to all char who already hit the mob.
- if( md->dmglog[i].id == sd->status.char_id ) {
+ if (md->dmglog[i].id == sd->status.char_id) {
clif->monster_hp_bar(md, sd);
break;
}
@@ -4156,6 +4191,7 @@ int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int damage, i
if (type == 4 || type == 9 || damage <=0)
return 0;
+ nullpo_retr(delay, bl);
if (bl->type == BL_PC) {
if (battle_config.pc_walk_delay_rate != 100)
delay = delay*battle_config.pc_walk_delay_rate/100;
@@ -4169,7 +4205,6 @@ int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int damage, i
return delay>0?delay:1; //Return 1 to specify there should be no noticeable delay, but you should stop walking.
}
-
/// Sends a 'damage' packet (src performs action on dst)
/// 008a <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.W <div>.W <type>.B <damage2>.W (ZC_NOTIFY_ACT)
/// 02e1 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT2)
@@ -4193,7 +4228,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int
if(in_damage) in_damage = in_damage*(sc->data[SC_ILLUSION]->val2) + rnd()%100;
if(in_damage2) in_damage2 = in_damage2*(sc->data[SC_ILLUSION]->val2) + rnd()%100;
}
-
+
#if PACKETVER < 20071113
damage = (short)min(in_damage,INT16_MAX);
damage2 = (short)min(in_damage2,INT16_MAX);
@@ -4304,7 +4339,6 @@ void clif_standing(struct block_list* bl)
}
}
-
/// Inform client(s) about a map-cell change (ZC_UPDATE_MAPINFO).
/// 0192 <x>.W <y>.W <type>.W <map name>.16B
void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target) {
@@ -4330,11 +4364,13 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe
}
}
-
/// Notifies the client about an item on floor (ZC_ITEM_ENTRY).
/// 009d <id>.L <name id>.W <identified>.B <x>.W <y>.W <amount>.W <subX>.B <subY>.B
void clif_getareachar_item(struct map_session_data* sd,struct flooritem_data* fitem) {
int view,fd;
+
+ nullpo_retv(sd);
+ nullpo_retv(fitem);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x9d));
@@ -4356,6 +4392,9 @@ void clif_getareachar_item(struct map_session_data* sd,struct flooritem_data* fi
void clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum send_target target) {
struct packet_graffiti_entry p;
+ nullpo_retv(bl);
+ nullpo_retv(su);
+ nullpo_retv(su->group);
p.PacketType = graffiti_entryType;
p.AID = su->bl.id;
p.creatorAID = su->group->src_id;
@@ -4391,7 +4430,6 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, en
#endif
p.PacketType = skill_entryType;
-
#if PACKETVER >= 20110718
p.PacketLength = sizeof(p);
#endif
@@ -4407,7 +4445,7 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, en
p.job = UNT_DUMMYSKILL;
else
p.job = su->group->unit_id;
-
+
#if PACKETVER >= 20110718
p.RadiusRange = (unsigned char)su->range;
#endif
@@ -4424,7 +4462,6 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, en
clif->changemapcell(bl->type == BL_PC ? ((TBL_PC*)bl)->fd : 0,su->bl.m,su->bl.x,su->bl.y,5,SELF);
}
-
/*==========================================
* Server tells client to remove unit of id 'unit->bl.id'
*------------------------------------------*/
@@ -4440,7 +4477,6 @@ void clif_clearchar_skillunit(struct skill_unit *su, int fd) {
clif->changemapcell(fd,su->bl.m,su->bl.x,su->bl.y,su->val2,SELF);
}
-
/// Removes a skill unit (ZC_SKILL_DISAPPEAR).
/// 0120 <id>.L
void clif_skill_delunit(struct skill_unit *su) {
@@ -4453,7 +4489,6 @@ void clif_skill_delunit(struct skill_unit *su) {
clif->send(buf,packet_len(0x120),&su->bl,AREA);
}
-
/// Sent when an object gets ankle-snared (ZC_SKILL_UPDATE).
/// 01ac <id>.L
/// Only affects units with class [139,153] client-side.
@@ -4468,7 +4503,6 @@ void clif_skillunit_update(struct block_list* bl)
clif->send(buf,packet_len(0x1ac),bl,AREA);
}
-
/*==========================================
*
*------------------------------------------*/
@@ -4590,7 +4624,6 @@ int clif_insight(struct block_list *bl,va_list ap)
return 0;
}
-
/// Updates whole skill tree (ZC_SKILLINFO_LIST).
/// 010f <packet len>.W { <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <skill name>.24B <upgradable>.B }*
void clif_skillinfoblock(struct map_session_data *sd)
@@ -4683,7 +4716,6 @@ void clif_addskill(struct map_session_data *sd, int id)
WFIFOSET(fd,packet_len(0x111));
}
-
/// Deletes a skill from the skill tree (ZC_SKILLINFO_DELETE).
/// 0441 <skill id>.W
void clif_deleteskill(struct map_session_data *sd, int id)
@@ -4730,14 +4762,18 @@ void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, in
WFIFOSET(fd, packet_len(0x10e));
}
-
/// Updates a skill in the skill tree (ZC_SKILLINFO_UPDATE2).
/// 07e1 <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <upgradable>.B
void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
{
const int fd = sd->fd;
int idx = skill->get_index(skill_id);
- int skill_lv = sd->status.skill[idx].lv;
+ int skill_lv;
+
+ nullpo_retv(sd);
+ Assert_retv(idx >= 0 && idx < MAX_SKILL);
+
+ skill_lv = sd->status.skill[idx].lv;
WFIFOHEAD(fd,packet_len(0x7e1));
WFIFOW(fd,0) = 0x7e1;
@@ -4758,7 +4794,6 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
WFIFOSET(fd,packet_len(0x7e1));
}
-
/// Notifies clients in area, that an object is about to use a skill.
/// 013e <src id>.L <dst id>.L <x>.W <y>.W <skill id>.W <property>.L <delaytime>.L (ZC_USESKILL_ACK)
/// 07fb <src id>.L <dst id>.L <x>.W <y>.W <skill id>.W <property>.L <delaytime>.L <is disposable>.B (ZC_USESKILL_ACK2)
@@ -4803,7 +4838,6 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
clif->send(buf,packet_len(cmd), bl, AREA);
}
-
/// Notifies clients in area, that an object canceled casting (ZC_DISPEL).
/// 01b9 <id>.L
void clif_skillcastcancel(struct block_list* bl)
@@ -4817,7 +4851,6 @@ void clif_skillcastcancel(struct block_list* bl)
clif->send(buf,packet_len(0x1b9), bl, AREA);
}
-
/// Notifies the client about the result of a skill use request (ZC_ACK_TOUSESKILL).
/// 0110 <skill id>.W <num>.L <result>.B <cause>.B
/// num (only used when skill id = NV_BASIC and cause = 0):
@@ -4875,7 +4908,6 @@ void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_f
WFIFOSET(fd,packet_len(0x110));
}
-
/// Skill cooldown display icon (ZC_SKILL_POSTDELAY).
/// 043d <skill ID>.W <tick>.L
void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int duration)
@@ -4894,7 +4926,6 @@ void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned
#endif
}
-
/// Skill attack effect and damage.
/// 0114 <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <damage>.W <level>.W <div>.W <type>.B (ZC_NOTIFY_SKILL)
/// 01de <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <damage>.L <level>.W <div>.W <type>.B (ZC_NOTIFY_SKILL2)
@@ -4908,11 +4939,11 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick
damage = (int)cap_value(in_damage,INT_MIN,INT_MAX);
type = clif_calc_delay(type,div,damage,ddelay);
-
+
#if PACKETVER >= 20131223
if( type == 6 ) type = 8; //bugreport:8263
#endif
-
+
if( ( sc = status->get_sc(dst) ) && sc->count ) {
if(sc->data[SC_ILLUSION] && damage)
damage = damage*(sc->data[SC_ILLUSION]->val2) + rnd()%100;
@@ -4986,7 +5017,6 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick
return clif->calc_walkdelay(dst,ddelay,type,damage,div);
}
-
/// Ground skill attack effect and damage (ZC_NOTIFY_SKILL_POSITION).
/// 0115 <skill id>.W <src id>.L <dst id>.L <tick>.L <src delay>.L <dst delay>.L <x>.W <y>.W <damage>.W <level>.W <div>.W <type>.B
#if 0
@@ -5044,7 +5074,6 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic
}
#endif // 0
-
/// Non-damaging skill effect (ZC_USE_SKILL).
/// 011a <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.B
int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail)
@@ -5077,7 +5106,6 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 ski
return fail;
}
-
/// Non-damaging ground skill effect (ZC_NOTIFY_GROUNDSKILL).
/// 0117 <skill id>.W <src id>.L <level>.W <x>.W <y>.W <tick>.L
void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick) {
@@ -5105,6 +5133,7 @@ void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int
void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4)
{
int fd;
+
nullpo_retv(sd);
fd = sd->fd;
@@ -5128,7 +5157,6 @@ void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 s
sd->menuskill_val = skill_lv;
}
-
/// Memo message (ZC_ACK_REMEMBER_WARPPOINT).
/// 011e <type>.B
/// type:
@@ -5151,7 +5179,6 @@ void clif_skill_memomessage(struct map_session_data* sd, int type)
WFIFOSET(fd,packet_len(0x11e));
}
-
/// Teleport message (ZC_NOTIFY_MAPINFO).
/// 0189 <type>.W
/// type:
@@ -5174,7 +5201,6 @@ void clif_skill_mapinfomessage(struct map_session_data *sd, int type)
WFIFOSET(fd,packet_len(0x189));
}
-
/// Displays Sense (WZ_ESTIMATION) information window (ZC_MONSTER_INFO).
/// 018c <class>.W <level>.W <size>.W <hp>.L <def>.W <race>.W <mdef>.W <element>.W
/// <water%>.B <earth%>.B <fire%>.B <wind%>.B <poison%>.B <holy%>.B <shadow%>.B <ghost%>.B <undead%>.B
@@ -5211,7 +5237,6 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) {
clif->send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF);
}
-
/// Presents a textual list of producible items (ZC_MAKABLEITEMLIST).
/// 018d <packet len>.W { <name id>.W { <material id>.W }*3 }*
/// material id:
@@ -5253,7 +5278,6 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id , int
}
}
-
/// Present a list of producible items (ZC_MAKINGITEM_LIST).
/// 025a <packet len>.W <mk type>.W { <name id>.W }*
/// mk type:
@@ -5366,7 +5390,7 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
p.index = type;
p.AID = bl->id;
p.state = (unsigned char)flag;
-
+
#if PACKETVER >= 20120618
p.Total = tick; /* at this stage remain and total are the same value I believe */
#endif
@@ -5404,8 +5428,8 @@ void clif_displaymessage(const int fd, const char* mes) {
#endif
}
}
+
void clif_displaymessage2(const int fd, const char* mes) {
- // invalid pointer?
nullpo_retv(mes);
//Scrapped, as these are shared by disconnected players =X [Skotlex]
@@ -5442,6 +5466,7 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) __attribute
void clif_displaymessage_sprintf(const int fd, const char *mes, ...) {
va_list ap;
+ nullpo_retv(mes);
if (map->cpsd_active && fd == 0) {
ShowInfo("HCP: ");
va_start(ap,mes);
@@ -5472,10 +5497,13 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) {
}
/// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST).
/// 009a <packet len>.W <message>.?B
-void clif_broadcast(struct block_list* bl, const char* mes, size_t len, int type, enum send_target target)
+void clif_broadcast(struct block_list *bl, const char *mes, size_t len, int type, enum send_target target)
{
int lp = (type&BC_COLOR_MASK) ? 4 : 0;
- unsigned char *buf = (unsigned char*)aMalloc((4 + lp + len)*sizeof(unsigned char));
+ unsigned char *buf = NULL;
+ nullpo_retv(mes);
+
+ buf = aMalloc((4 + lp + len)*sizeof(unsigned char));
WBUFW(buf,0) = 0x9a;
WBUFW(buf,2) = 4 + lp + len;
@@ -5520,8 +5548,11 @@ void clif_GlobalMessage(struct block_list* bl, const char* message) {
/// 01c3 <packet len>.W <fontColor>.L <fontType>.W <fontSize>.W <fontAlign>.W <fontY>.W <message>.?B
void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target)
{
- unsigned char *buf = (unsigned char*)aMalloc((16 + len)*sizeof(unsigned char));
+ unsigned char *buf;
+
+ nullpo_retv(mes);
+ buf = (unsigned char*)aMalloc((16 + len)*sizeof(unsigned char));
WBUFW(buf,0) = 0x1c3;
WBUFW(buf,2) = len + 16;
WBUFL(buf,4) = fontColor;
@@ -5535,7 +5566,6 @@ void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigne
aFree(buf);
}
-
/// Displays heal effect (ZC_RECOVERY).
/// 013d <var id>.W <amount>.W
/// var id:
@@ -5551,7 +5581,6 @@ void clif_heal(int fd,int type,int val)
WFIFOSET(fd,packet_len(0x13d));
}
-
/// Displays resurrection effect (ZC_RESURRECTION).
/// 0148 <id>.L <type>.W
/// type:
@@ -5576,7 +5605,6 @@ void clif_resurrection(struct block_list *bl,int type)
}
}
-
/// Sets the map property (ZC_NOTIFY_MAPPROPERTY).
/// 0199 <type>.W
void clif_map_property(struct map_session_data* sd, enum map_property property)
@@ -5592,7 +5620,6 @@ void clif_map_property(struct map_session_data* sd, enum map_property property)
WFIFOSET(fd,packet_len(0x199));
}
-
/// Set the map type (ZC_NOTIFY_MAPPROPERTY2).
/// 01d6 <type>.W
void clif_map_type(struct map_session_data* sd, enum map_type type) {
@@ -5607,12 +5634,13 @@ void clif_map_type(struct map_session_data* sd, enum map_type type) {
WFIFOSET(fd,packet_len(0x1D6));
}
-
/// Updates PvP ranking (ZC_NOTIFY_RANKING).
/// 019a <id>.L <ranking>.L <total>.L
// FIXME: missing documentation for the 'type' parameter
void clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
{
+ nullpo_retv(sd);
+
if(type == 2) {
int fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x19a));
@@ -5639,7 +5667,6 @@ void clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
}
}
-
/*==========================================
*
*------------------------------------------*/
@@ -5656,7 +5683,6 @@ void clif_map_property_mapall(int mapid, enum map_property property)
clif->send(buf,packet_len(0x199),&bl,ALL_SAMEMAP);
}
-
/// Notifies the client about the result of a refine attempt (ZC_ACK_ITEMREFINING).
/// 0188 <result>.W <index>.W <refine>.W
/// result:
@@ -5673,7 +5699,6 @@ void clif_refine(int fd, int fail, int index, int val)
WFIFOSET(fd,packet_len(0x188));
}
-
/// Notifies the client about the result of a weapon refine attempt (ZC_ACK_WEAPONREFINE).
/// 0223 <result>.L <nameid>.W
/// result:
@@ -5690,11 +5715,17 @@ void clif_upgrademessage(int fd, int result, int item_id)
WFIFOSET(fd,packet_len(0x223));
}
-
/// Whisper is transmitted to the destination player (ZC_WHISPER).
/// 0097 <packet len>.W <nick>.24B <message>.?B
/// 0097 <packet len>.W <nick>.24B <isAdmin>.L <message>.?B (PACKETVER >= 20091104)
-void clif_wis_message(int fd, const char* nick, const char* mes, size_t mes_len) {
+void clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_len)
+{
+#if PACKETVER >= 20091104
+ struct map_session_data *ssd = NULL;
+#endif // PACKETVER >= 20091104
+ nullpo_retv(nick);
+ nullpo_retv(mes);
+
#if PACKETVER < 20091104
WFIFOHEAD(fd, mes_len + NAME_LENGTH + 4);
WFIFOW(fd,0) = 0x97;
@@ -5703,7 +5734,7 @@ void clif_wis_message(int fd, const char* nick, const char* mes, size_t mes_len)
safestrncpy((char*)WFIFOP(fd,28), mes, mes_len);
WFIFOSET(fd,WFIFOW(fd,2));
#else
- struct map_session_data *ssd = map->nick2sd(nick);
+ ssd = map->nick2sd(nick);
WFIFOHEAD(fd, mes_len + NAME_LENGTH + 8);
WFIFOW(fd,0) = 0x97;
@@ -5715,7 +5746,6 @@ void clif_wis_message(int fd, const char* nick, const char* mes, size_t mes_len)
#endif
}
-
/// Inform the player about the result of his whisper action (ZC_ACK_WHISPER).
/// 0098 <result>.B
/// result:
@@ -5735,15 +5765,15 @@ void clif_wis_end(int fd, int flag) {
#if PACKETVER >= 20131223
p.unknown = 0;
#endif
-
+
clif->send(&p, sizeof(p), &sd->bl, SELF);
}
-
/// Returns character name requested by char_id (ZC_ACK_REQNAME_BYGID).
/// 0194 <char id>.L <name>.24B
void clif_solved_charname(int fd, int charid, const char* name)
{
+ nullpo_retv(name);
WFIFOHEAD(fd,packet_len(0x194));
WFIFOW(fd,0)=0x194;
WFIFOL(fd,2)=charid;
@@ -5751,7 +5781,6 @@ void clif_solved_charname(int fd, int charid, const char* name)
WFIFOSET(fd,packet_len(0x194));
}
-
/// Presents a list of items that can be carded/composed (ZC_ITEMCOMPOSITION_LIST).
/// 017b <packet len>.W { <name id>.W }*
void clif_use_card(struct map_session_data *sd,int idx)
@@ -5782,7 +5811,6 @@ void clif_use_card(struct map_session_data *sd,int idx)
WFIFOSET(fd, WFIFOW(fd, 2));
}
-
/// Notifies the client about the result of item carding/composition (ZC_ACK_ITEMCOMPOSITION).
/// 017d <equip index>.W <card index>.W <result>.B
/// result:
@@ -5803,7 +5831,6 @@ void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int
WFIFOSET(fd,packet_len(0x17d));
}
-
/// Presents a list of items that can be identified (ZC_ITEMIDENTIFY_LIST).
/// 0177 <packet len>.W { <name id>.W }*
void clif_item_identify_list(struct map_session_data *sd)
@@ -5832,7 +5859,6 @@ void clif_item_identify_list(struct map_session_data *sd)
}
}
-
/// Notifies the client about the result of a item identify request (ZC_ACK_ITEMIDENTIFY).
/// 0179 <index>.W <result>.B
void clif_item_identified(struct map_session_data *sd,int idx,int flag)
@@ -5849,7 +5875,6 @@ void clif_item_identified(struct map_session_data *sd,int idx,int flag)
WFIFOSET(fd,packet_len(0x179));
}
-
/// Presents a list of items that can be repaired (ZC_REPAIRITEMLIST).
/// 01fc <packet len>.W { <index>.W <name id>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }*
void clif_item_repair_list(struct map_session_data *sd,struct map_session_data *dstsd, int lv)
@@ -5884,7 +5909,6 @@ void clif_item_repair_list(struct map_session_data *sd,struct map_session_data *
clif->skill_fail(sd,sd->ud.skill_id,USESKILL_FAIL_LEVEL,0);
}
-
/// Notifies the client about the result of a item repair request (ZC_ACK_ITEMREPAIR).
/// 01fe <index>.W <result>.B
/// index:
@@ -5908,12 +5932,14 @@ void clif_item_repaireffect(struct map_session_data *sd,int idx,int flag)
}
-
/// Displays a message, that an equipment got damaged (ZC_EQUIPITEM_DAMAGED).
/// 02bb <equip location>.W <account id>.L
void clif_item_damaged(struct map_session_data* sd, unsigned short position)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x2bb));
WFIFOW(fd,0) = 0x2bb;
@@ -5922,7 +5948,6 @@ void clif_item_damaged(struct map_session_data* sd, unsigned short position)
WFIFOSET(fd,packet_len(0x2bb));
}
-
/// Presents a list of weapon items that can be refined [Taken from jAthena] (ZC_NOTIFY_WEAPONITEMLIST).
/// 0221 <packet len>.W { <index>.W <name id>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }*
void clif_item_refine_list(struct map_session_data *sd)
@@ -5959,7 +5984,6 @@ void clif_item_refine_list(struct map_session_data *sd)
}
}
-
/// Notification of an auto-casted skill (ZC_AUTORUN_SKILL).
/// 0147 <skill id>.W <type>.L <level>.W <sp cost>.W <atk range>.W <skill name>.24B <upgradeable>.B
void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv)
@@ -5982,7 +6006,6 @@ void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv
WFIFOSET(fd,packet_len(0x147));
}
-
/// Adds an item to character's cart.
/// 0124 <index>.W <amount>.L <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_CART)
/// 01c5 <index>.W <amount>.L <name id>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_CART2)
@@ -6021,7 +6044,6 @@ void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
WFIFOSET(fd,packet_len(cartaddType));
}
-
/// Deletes an item from character's cart (ZC_DELETE_ITEM_FROM_CART).
/// 0125 <index>.W <amount>.L
void clif_cart_delitem(struct map_session_data *sd,int n,int amount)
@@ -6039,7 +6061,6 @@ void clif_cart_delitem(struct map_session_data *sd,int n,int amount)
WFIFOSET(fd,packet_len(0x125));
}
-
/// Opens the shop creation menu (ZC_OPENSTORE).
/// 012d <num>.W
/// num:
@@ -6057,7 +6078,6 @@ void clif_openvendingreq(struct map_session_data* sd, int num)
WFIFOSET(fd,packet_len(0x12d));
}
-
/// Displays a vending board to target/area (ZC_STORE_ENTRY).
/// 0131 <owner id>.L <message>.80B
void clif_showvendingboard(struct block_list* bl, const char* message, int fd)
@@ -6079,7 +6099,6 @@ void clif_showvendingboard(struct block_list* bl, const char* message, int fd)
}
}
-
/// Removes a vending board from screen (ZC_DISAPPEAR_ENTRY).
/// 0132 <owner id>.L
void clif_closevendingboard(struct block_list* bl, int fd)
@@ -6099,7 +6118,6 @@ void clif_closevendingboard(struct block_list* bl, int fd)
}
}
-
/// Sends a list of items in a shop.
/// R 0133 <packet len>.W <owner id>.L { <price>.L <amount>.W <index>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC)
/// R 0800 <packet len>.W <owner id>.L <unique id>.L { <price>.L <amount>.W <index>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }* (ZC_PC_PURCHASE_ITEMLIST_FROMMC2)
@@ -6155,7 +6173,6 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Shop purchase failure (ZC_PC_PURCHASE_RESULT_FROMMC).
/// 0135 <index>.W <amount>.W <result>.B
/// result:
@@ -6181,13 +6198,12 @@ void clif_buyvending(struct map_session_data* sd, int index, int amount, int fai
WFIFOSET(fd,packet_len(0x135));
}
-
/// Shop creation success (ZC_PC_PURCHASE_MYITEMLIST).
/// 0136 <packet len>.W <owner id>.L { <price>.L <index>.W <amount>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }*
void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending_items) {
int i,fd;
int count;
-
+
#if PACKETVER >= 20150226
const int item_length = 47;
#else
@@ -6195,6 +6211,7 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
#endif
nullpo_retv(sd);
+ nullpo_retv(vending_items);
fd = sd->fd;
count = sd->vend_num;
@@ -6220,7 +6237,7 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
#endif
}
WFIFOSET(fd,WFIFOW(fd,2));
-
+
#if PACKETVER >= 20141022
/** should go elsewhere perhaps? it has to be bundled with this however. **/
WFIFOHEAD(fd, 3);
@@ -6230,7 +6247,6 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
#endif
}
-
/// Inform merchant that someone has bought an item (ZC_DELETEITEM_FROM_MCSTORE).
/// 0137 <index>.W <amount>.W
void clif_vendingreport(struct map_session_data* sd, int index, int amount)
@@ -6247,7 +6263,6 @@ void clif_vendingreport(struct map_session_data* sd, int index, int amount)
WFIFOSET(fd,packet_len(0x137));
}
-
/// Result of organizing a party (ZC_ACK_MAKE_GROUP).
/// 00fa <result>.B
/// result:
@@ -6269,7 +6284,6 @@ void clif_party_created(struct map_session_data *sd,int result)
WFIFOSET(fd,packet_len(0xfa));
}
-
/// Adds new member to a party.
/// 0104 <account id>.L <role>.L <x>.W <y>.W <state>.B <party name>.24B <char name>.24B <map name>.16B (ZC_ADD_MEMBER_TO_GROUP)
/// 01e9 <account id>.L <role>.L <x>.W <y>.W <state>.B <party name>.24B <char name>.24B <map name>.16B <item pickup rule>.B <item share rule>.B (ZC_ADD_MEMBER_TO_GROUP2)
@@ -6284,6 +6298,8 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
unsigned char buf[81];
int i;
+ nullpo_retv(p);
+ nullpo_retv(sd);
if (!sd) { //Pick any party member (this call is used when changing item share rules)
ARR_FIND( 0, MAX_PARTY, i, p->data[i].sd != 0 );
} else {
@@ -6306,7 +6322,6 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
clif->send(buf,packet_len(0x1e9),&sd->bl,PARTY);
}
-
/// Sends party information (ZC_GROUP_LIST).
/// 00fb <packet len>.W <party name>.24B { <account id>.L <nick>.24B <map name>.16B <role>.B <state>.B }*
/// role:
@@ -6348,7 +6363,6 @@ void clif_party_info(struct party_data* p, struct map_session_data *sd)
}
}
-
/// The player's 'party invite' state, sent during login (ZC_PARTY_CONFIG).
/// 02c9 <flag>.B
/// flag:
@@ -6366,7 +6380,6 @@ void clif_partyinvitationstate(struct map_session_data* sd)
WFIFOSET(fd, packet_len(0x2c9));
}
-
/// Party invitation request.
/// 00fe <party id>.L <party name>.24B (ZC_REQ_JOIN_GROUP)
/// 02c6 <party id>.L <party name>.24B (ZC_PARTY_JOIN_REQ)
@@ -6395,7 +6408,6 @@ void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd)
WFIFOSET(fd,packet_len(cmd));
}
-
/// Party invite result.
/// 00fd <nick>.24S <result>.B (ZC_ACK_REQ_JOIN_GROUP)
/// 02c5 <nick>.24S <result>.L (ZC_PARTY_JOIN_REQ_ACK)
@@ -6412,6 +6424,7 @@ void clif_party_inviteack(struct map_session_data* sd, const char* nick, int res
{
int fd;
nullpo_retv(sd);
+ nullpo_retv(nick);
fd=sd->fd;
#if PACKETVER < 20070904
@@ -6436,7 +6449,6 @@ void clif_party_inviteack(struct map_session_data* sd, const char* nick, int res
#endif
}
-
/// Updates party settings.
/// 0101 <exp option>.L (ZC_GROUPINFO_CHANGE)
/// 07d8 <exp option>.L <item pick rule>.B <item share rule>.B (ZC_REQ_GROUPINFO_CHANGE_V2)
@@ -6479,7 +6491,6 @@ void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag
clif->send(buf,packet_len(cmd),&sd->bl,SELF);
}
-
/// 0105 <account id>.L <char name>.24B <result>.B (ZC_DELETE_MEMBER_FROM_GROUP).
/// result:
/// 0 = leave
@@ -6491,17 +6502,18 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int
unsigned char buf[64];
nullpo_retv(p);
+ nullpo_retv(name);
- if(!sd && (flag&0xf0)==0)
- {
+ if(!sd && (flag&0xf0)==0) { // TODO: Document this flag
int i;
- for(i=0;i<MAX_PARTY && !p->data[i].sd;i++)
- ;
- if (i < MAX_PARTY)
- sd = p->data[i].sd;
+ // Search for any online party member
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd != NULL);
+ if (i != MAX_PARTY)
+ sd = p->data[i].sd;
}
- if(!sd) return;
+ if (!sd)
+ return;
WBUFW(buf,0)=0x105;
WBUFL(buf,2)=account_id;
@@ -6513,7 +6525,6 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int
clif->send(buf,packet_len(0x105),&sd->bl,SELF);
}
-
/// Party chat message (ZC_NOTIFY_CHAT_PARTY).
/// 0109 <packet len>.W <account id>.L <message>.?B
void clif_party_message(struct party_data* p, int account_id, const char* mes, int len)
@@ -6522,6 +6533,7 @@ void clif_party_message(struct party_data* p, int account_id, const char* mes, i
int i;
nullpo_retv(p);
+ nullpo_retv(mes);
for(i=0; i < MAX_PARTY && !p->data[i].sd;i++);
if(i < MAX_PARTY){
@@ -6542,7 +6554,6 @@ void clif_party_message(struct party_data* p, int account_id, const char* mes, i
}
}
-
/// Updates the position of a party member on the minimap (ZC_NOTIFY_POSITION_TO_GROUPM).
/// 0107 <account id>.L <x>.W <y>.W
void clif_party_xy(struct map_session_data *sd)
@@ -6558,12 +6569,12 @@ void clif_party_xy(struct map_session_data *sd)
clif->send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
}
-
/*==========================================
* Sends x/y dot to a single fd. [Skotlex]
*------------------------------------------*/
void clif_party_xy_single(int fd, struct map_session_data *sd)
{
+ nullpo_retv(sd);
WFIFOHEAD(fd,packet_len(0x107));
WFIFOW(fd,0)=0x107;
WFIFOL(fd,2)=sd->status.account_id;
@@ -6572,7 +6583,6 @@ void clif_party_xy_single(int fd, struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x107));
}
-
/// Updates HP bar of a party member.
/// 0106 <account id>.L <hp>.W <max hp>.W (ZC_NOTIFY_HP_TO_GROUPM)
/// 080e <account id>.L <hp>.L <max hp>.L (ZC_NOTIFY_HP_TO_GROUPM_R2)
@@ -6604,7 +6614,6 @@ void clif_party_hp(struct map_session_data *sd)
clif->send(buf,packet_len(cmd),&sd->bl,PARTY_AREA_WOS);
}
-
/*==========================================
* Sends HP bar to a single fd. [Skotlex]
*------------------------------------------*/
@@ -6655,7 +6664,6 @@ void clif_movetoattack(struct map_session_data *sd,struct block_list *bl)
WFIFOSET(fd,packet_len(0x139));
}
-
/// Notifies the client about the result of an item produce request (ZC_ACK_REQMAKINGITEM).
/// 018f <result>.W <name id>.W
/// result:
@@ -6681,7 +6689,6 @@ void clif_produceeffect(struct map_session_data* sd,int flag,int nameid)
WFIFOSET(fd,packet_len(0x18f));
}
-
/// Initiates the pet taming process (ZC_START_CAPTURE).
/// 019e
void clif_catch_process(struct map_session_data *sd)
@@ -6696,7 +6703,6 @@ void clif_catch_process(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x19e));
}
-
/// Displays the result of a pet taming attempt (ZC_TRYCAPTURE_MONSTER).
/// 01a0 <result>.B
/// 0 = failure
@@ -6714,7 +6720,6 @@ void clif_pet_roulette(struct map_session_data *sd,int data)
WFIFOSET(fd,packet_len(0x1a0));
}
-
/// Presents a list of pet eggs that can be hatched (ZC_PETEGG_LIST).
/// 01a6 <packet len>.W { <index>.W }*
void clif_sendegg(struct map_session_data *sd)
@@ -6745,7 +6750,6 @@ void clif_sendegg(struct map_session_data *sd)
sd->menuskill_val = -1;
}
-
/// Sends a specific pet data update (ZC_CHANGESTATE_PET).
/// 01a4 <type>.B <id>.L <data>.L
/// type:
@@ -6772,7 +6776,6 @@ void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int typ
clif->send(buf, packet_len(0x1a4), &pd->bl, AREA);
}
-
/// Pet's base data (ZC_PROPERTY_PET).
/// 01a2 <name>.24B <renamed>.B <level>.W <hunger>.W <intimacy>.W <accessory id>.W <class>.W
void clif_send_petstatus(struct map_session_data *sd)
@@ -6799,7 +6802,6 @@ void clif_send_petstatus(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x1a2));
}
-
/// Notification about a pet's emotion/talk (ZC_PET_ACT).
/// 01aa <id>.L <data>.L
/// data:
@@ -6828,7 +6830,6 @@ void clif_pet_emotion(struct pet_data *pd,int param)
clif->send(buf,packet_len(0x1aa),&pd->bl,AREA);
}
-
/// Result of request to feed a pet (ZC_FEED_PET).
/// 01a3 <result>.B <name id>.W
/// result:
@@ -6848,7 +6849,6 @@ void clif_pet_food(struct map_session_data *sd,int foodid,int fail)
WFIFOSET(fd,packet_len(0x1a3));
}
-
/// Presents a list of skills that can be auto-spelled (ZC_AUTOSPELLLIST).
/// 01cd { <skill id>.L }*7
void clif_autospell(struct map_session_data *sd,uint16 skill_lv)
@@ -6895,7 +6895,6 @@ void clif_autospell(struct map_session_data *sd,uint16 skill_lv)
sd->menuskill_val = skill_lv;
}
-
/// Devotion's visual effect (ZC_DEVOTIONLIST).
/// 01cf <devoter id>.L { <devotee id>.L }*5 <max distance>.W
void clif_devotion(struct block_list *src, struct map_session_data *tsd)
@@ -6956,7 +6955,6 @@ void clif_spiritball(struct block_list *bl) {
clif->send(buf, packet_len(0x1d0), bl, AREA);
}
-
/// Notifies clients in area of a character's combo delay (ZC_COMBODELAY).
/// 01d2 <account id>.L <delay>.L
void clif_combo_delay(struct block_list *bl,int wait)
@@ -6971,7 +6969,6 @@ void clif_combo_delay(struct block_list *bl,int wait)
clif->send(buf,packet_len(0x1d2),bl,AREA);
}
-
/// Notifies clients in area that a character has blade-stopped another (ZC_BLADESTOP).
/// 01d1 <src id>.L <dst id>.L <flag>.L
/// flag:
@@ -6991,7 +6988,6 @@ void clif_bladestop(struct block_list *src, int dst_id, int active)
clif->send(buf,packet_len(0x1d1),src,AREA);
}
-
/// MVP effect (ZC_MVP).
/// 010c <account id>.L
void clif_mvp_effect(struct map_session_data *sd)
@@ -7005,7 +7001,6 @@ void clif_mvp_effect(struct map_session_data *sd)
clif->send(buf,packet_len(0x10c),&sd->bl,AREA);
}
-
/// MVP item reward message (ZC_MVP_GETTING_ITEM).
/// 010a <name id>.W
void clif_mvp_item(struct map_session_data *sd,int nameid)
@@ -7024,7 +7019,6 @@ void clif_mvp_item(struct map_session_data *sd,int nameid)
WFIFOSET(fd,packet_len(0x10a));
}
-
/// MVP EXP reward message (ZC_MVP_GETTING_SPECIAL_EXP).
/// 010b <exp>.L
void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
@@ -7040,7 +7034,6 @@ void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
WFIFOSET(fd,packet_len(0x10b));
}
-
/// Dropped MVP item reward message (ZC_THROW_MVPITEM).
/// 010d
///
@@ -7055,7 +7048,6 @@ void clif_mvp_noitem(struct map_session_data* sd)
WFIFOSET(fd,packet_len(0x10d));
}
-
/// Guild creation result (ZC_RESULT_MAKE_GUILD).
/// 0167 <result>.B
/// result:
@@ -7076,7 +7068,6 @@ void clif_guild_created(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x167));
}
-
/// Notifies the client that it is belonging to a guild (ZC_UPDATE_GDID).
/// 016c <guild id>.L <emblem id>.L <mode>.L <ismaster>.B <inter sid>.L <guild name>.24B
/// mode: @see enum guild_permission
@@ -7099,7 +7090,6 @@ void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g)
WFIFOSET(fd,packet_len(0x16c));
}
-
/// Guild member login notice.
/// 016d <account id>.L <char id>.L <status>.L (ZC_UPDATE_CHARSTAT)
/// 01f2 <account id>.L <char id>.L <status>.L <gender>.W <hair style>.W <hair color>.W (ZC_UPDATE_CHARSTAT2)
@@ -7172,7 +7162,6 @@ void clif_guild_send_onlineinfo(struct map_session_data *sd)
clif->send(buf, p_len*count, &sd->bl, SELF);
}
-
/// Bitmask of enabled guild window tabs (ZC_ACK_GUILD_MENUINTERFACE).
/// 014e <menu flag>.L
/// menu flag:
@@ -7196,7 +7185,6 @@ void clif_guild_masterormember(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x14e));
}
-
/// Guild basic information (Territories [Valaris])
/// 0150 <guild id>.L <level>.L <member num>.L <member max>.L <exp>.L <max exp>.L <points>.L <honor>.L <virtue>.L <emblem id>.L <name>.24B <master name>.24B <manage land>.16B (ZC_GUILD_INFO)
/// 01b6 <guild id>.L <level>.L <member num>.L <member max>.L <exp>.L <max exp>.L <points>.L <honor>.L <virtue>.L <emblem id>.L <name>.24B <master name>.24B <manage land>.16B <zeny>.L (ZC_GUILD_INFO2)
@@ -7232,7 +7220,6 @@ void clif_guild_basicinfo(struct map_session_data *sd) {
WFIFOSET(fd,packet_len(0x1b6));
}
-
/// Guild alliance and opposition list (ZC_MYGUILD_BASIC_INFO).
/// 014c <packet len>.W { <relation>.L <guild id>.L <guild name>.24B }*
void clif_guild_allianceinfo(struct map_session_data *sd)
@@ -7260,7 +7247,6 @@ void clif_guild_allianceinfo(struct map_session_data *sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Guild member manager information (ZC_MEMBERMGR_INFO).
/// 0154 <packet len>.W { <account>.L <char id>.L <hair style>.W <hair color>.W <gender>.W <class>.W <level>.W <contrib exp>.L <state>.L <position>.L <memo>.50B <name>.24B }*
/// state:
@@ -7304,7 +7290,6 @@ void clif_guild_memberlist(struct map_session_data *sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Guild position name information (ZC_POSITION_ID_NAME_INFO).
/// 0166 <packet len>.W { <position id>.L <position name>.24B }*
void clif_guild_positionnamelist(struct map_session_data *sd) {
@@ -7326,7 +7311,6 @@ void clif_guild_positionnamelist(struct map_session_data *sd) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Guild position information (ZC_POSITION_INFO).
/// 0160 <packet len>.W { <position id>.L <mode>.L <ranking>.L <pay rate>.L }*
/// mode: @see enum guild_permission
@@ -7354,7 +7338,6 @@ void clif_guild_positioninfolist(struct map_session_data *sd) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Notifies clients in a guild about updated position information (ZC_ACK_CHANGE_GUILD_POSITIONINFO).
/// 0174 <packet len>.W { <position id>.L <mode>.L <ranking>.L <pay rate>.L <position name>.24B }*
/// mode: @see enum guild_permission
@@ -7383,7 +7366,6 @@ void clif_guild_positionchanged(struct guild *g,int idx)
clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
-
/// Notifies clients in a guild about updated member position assignments (ZC_ACK_REQ_CHANGE_MEMBERS).
/// 0156 <packet len>.W { <account id>.L <char id>.L <position id>.L }*
void clif_guild_memberpositionchanged(struct guild *g,int idx)
@@ -7407,7 +7389,6 @@ void clif_guild_memberpositionchanged(struct guild *g,int idx)
clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
-
/// Sends emblems bitmap data to the client that requested it (ZC_GUILD_EMBLEM_IMG).
/// 0152 <packet len>.W <guild id>.L <emblem id>.L <emblem data>.?B
void clif_guild_emblem(struct map_session_data *sd,struct guild *g)
@@ -7429,7 +7410,6 @@ void clif_guild_emblem(struct map_session_data *sd,struct guild *g)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Sends update of the guild id/emblem id to everyone in the area (ZC_CHANGE_GUILD).
/// 01b4 <id>.L <guild id>.L <emblem id>.W
void clif_guild_emblem_area(struct block_list* bl)
@@ -7447,7 +7427,6 @@ void clif_guild_emblem_area(struct block_list* bl)
clif->send(buf, 12, bl, AREA_WOS);
}
-
/// Sends guild skills (ZC_GUILD_SKILLINFO).
/// 0162 <packet len>.W <skill points>.W { <skill id>.W <type>.L <level>.W <sp cost>.W <atk range>.W <skill name>.24B <upgradeable>.B }*
void clif_guild_skillinfo(struct map_session_data* sd)
@@ -7487,7 +7466,6 @@ void clif_guild_skillinfo(struct map_session_data* sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Sends guild notice to client (ZC_GUILD_NOTICE).
/// 016f <subject>.60B <notice>.120B
void clif_guild_notice(struct map_session_data* sd, struct guild* g)
@@ -7512,7 +7490,6 @@ void clif_guild_notice(struct map_session_data* sd, struct guild* g)
WFIFOSET(fd,packet_len(0x16f));
}
-
/// Guild invite (ZC_REQ_JOIN_GUILD).
/// 016a <guild id>.L <guild name>.24B
void clif_guild_invite(struct map_session_data *sd,struct guild *g)
@@ -7530,7 +7507,6 @@ void clif_guild_invite(struct map_session_data *sd,struct guild *g)
WFIFOSET(fd,packet_len(0x16a));
}
-
/// Reply to invite request (ZC_ACK_REQ_JOIN_GUILD).
/// 0169 <answer>.B
/// answer:
@@ -7551,7 +7527,6 @@ void clif_guild_inviteack(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x169));
}
-
/// Notifies clients of a guild of a leaving member (ZC_ACK_LEAVE_GUILD).
/// 015a <char name>.24B <reason>.40B
void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes)
@@ -7566,7 +7541,6 @@ void clif_guild_leave(struct map_session_data *sd,const char *name,const char *m
clif->send(buf,packet_len(0x15a),&sd->bl,GUILD_NOBG);
}
-
/// Notifies clients of a guild of an expelled member.
/// 015c <char name>.24B <reason>.40B <account name>.24B (ZC_ACK_BAN_GUILD)
/// 0839 <char name>.24B <reason>.40B (ZC_ACK_BAN_GUILD_SSO)
@@ -7580,6 +7554,8 @@ void clif_guild_expulsion(struct map_session_data* sd, const char* name, const c
#endif
nullpo_retv(sd);
+ nullpo_retv(name);
+ nullpo_retv(mes);
WBUFW(buf,0) = cmd;
safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
@@ -7590,7 +7566,6 @@ void clif_guild_expulsion(struct map_session_data* sd, const char* name, const c
clif->send(buf, packet_len(cmd), &sd->bl, GUILD_NOBG);
}
-
/// Guild expulsion list (ZC_BAN_LIST).
/// 0163 <packet len>.W { <char name>.24B <account name>.24B <reason>.40B }*
/// 0163 <packet len>.W { <char name>.24B <reason>.40B }* (PACKETVER >= 20100803)
@@ -7633,7 +7608,6 @@ void clif_guild_expulsionlist(struct map_session_data* sd) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Guild chat message (ZC_GUILD_CHAT).
/// 017f <packet len>.W <message>.?B
void clif_guild_message(struct guild *g,int account_id,const char *mes,int len)
@@ -7641,6 +7615,7 @@ void clif_guild_message(struct guild *g,int account_id,const char *mes,int len)
struct map_session_data *sd;
uint8 buf[256];
+ nullpo_retv(mes);
if (len == 0)
return;
@@ -7664,6 +7639,7 @@ void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const cha
int fd;
nullpo_retv(sd);
+ nullpo_retv(name);
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x171));
@@ -7673,7 +7649,6 @@ void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const cha
WFIFOSET(fd,packet_len(0x171));
}
-
/// Notifies the client about the result of a alliance request (ZC_ACK_REQ_ALLY_GUILD).
/// 0173 <answer>.B
/// answer:
@@ -7696,7 +7671,6 @@ void clif_guild_allianceack(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x173));
}
-
/// Notifies the client that a alliance or opposition has been removed (ZC_DELETE_RELATED_GUILD).
/// 0184 <other guild id>.L <relation>.L
/// relation:
@@ -7718,7 +7692,6 @@ void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
WFIFOSET(fd,packet_len(0x184));
}
-
/// Notifies the client about the result of a opposition request (ZC_ACK_REQ_HOSTILE_GUILD).
/// 0181 <result>.B
/// result:
@@ -7739,7 +7712,6 @@ void clif_guild_oppositionack(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x181));
}
-
/// Adds alliance or opposition (ZC_ADD_RELATED_GUILD).
/// 0185 <relation>.L <guild id>.L <guild name>.24B
/*
@@ -7754,7 +7726,6 @@ void clif_guild_allianceadded(struct guild *g,int idx)
}
*/
-
/// Notifies the client about the result of a guild break (ZC_ACK_DISORGANIZE_GUILD_RESULT).
/// 015e <reason>.L
/// 0 = success
@@ -7773,7 +7744,6 @@ void clif_guild_broken(struct map_session_data *sd,int flag)
WFIFOSET(fd,packet_len(0x15e));
}
-
/// Displays emotion on an object (ZC_EMOTION).
/// 00c0 <id>.L <type>.B
/// type:
@@ -7790,13 +7760,13 @@ void clif_emotion(struct block_list *bl,int type)
clif->send(buf,packet_len(0xc0),bl,AREA);
}
-
/// Displays the contents of a talkiebox trap (ZC_TALKBOX_CHATCONTENTS).
/// 0191 <id>.L <contents>.80B
void clif_talkiebox(struct block_list* bl, const char* talkie)
{
unsigned char buf[MESSAGE_SIZE+6];
nullpo_retv(bl);
+ nullpo_retv(talkie);
WBUFW(buf,0) = 0x191;
WBUFL(buf,2) = bl->id;
@@ -7804,7 +7774,6 @@ void clif_talkiebox(struct block_list* bl, const char* talkie)
clif->send(buf,packet_len(0x191),bl,AREA);
}
-
/// Displays wedding effect centered on an object (ZC_CONGRATULATION).
/// 01ea <id>.L
void clif_wedding_effect(struct block_list *bl)
@@ -7818,7 +7787,6 @@ void clif_wedding_effect(struct block_list *bl)
clif->send(buf, packet_len(0x1ea), bl, AREA);
}
-
/// Notifies the client of the name of the partner character (ZC_COUPLENAME).
/// 01e6 <partner name>.24B
void clif_callpartner(struct map_session_data *sd) {
@@ -7843,7 +7811,6 @@ void clif_callpartner(struct map_session_data *sd) {
clif->send(buf, packet_len(0x1e6), &sd->bl, AREA);
}
-
/// Initiates the partner "taming" process [DracoRPG] (ZC_START_COUPLE).
/// 01e4
/// This packet while still implemented by the client is no longer being officially used.
@@ -7860,7 +7827,6 @@ void clif_marriage_process(struct map_session_data *sd)
}
*/
-
/// Notice of divorce (ZC_DIVORCE).
/// 0205 <partner name>.24B
void clif_divorced(struct map_session_data* sd, const char* name)
@@ -7875,7 +7841,6 @@ void clif_divorced(struct map_session_data* sd, const char* name)
WFIFOSET(fd, packet_len(0x205));
}
-
/// Marriage proposal (ZC_REQ_COUPLE).
/// 01e2 <account id>.L <char id>.L <char name>.24B
/// This packet while still implemented by the client is no longer being officially used.
@@ -7903,6 +7868,9 @@ void clif_disp_message(struct block_list* src, const char* mes, size_t len, enum
if (len == 0)
return;
+ nullpo_retv(src);
+ nullpo_retv(mes);
+
if (len > sizeof(buf)-5) {
ShowWarning("clif_disp_message: Truncated message '%s' (len=%"PRIuS", max=%"PRIuS", aid=%d).\n", mes, len, sizeof(buf)-5, src->id);
len = sizeof(buf)-5;
@@ -7914,7 +7882,6 @@ void clif_disp_message(struct block_list* src, const char* mes, size_t len, enum
clif->send(buf, WBUFW(buf,2), src, target);
}
-
/// Notifies the client about the result of a request to disconnect another player (ZC_ACK_DISCONNECT_CHARACTER).
/// 00cd <result>.L (unknown packet version or invalid information at packet_len_table)
/// 00cd <result>.B
@@ -7934,20 +7901,21 @@ void clif_GM_kickack(struct map_session_data *sd, int result)
WFIFOSET(fd, packet_len(0xcd));
}
-
void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd) {
- int fd = tsd->fd;
+ int fd;
+
+ nullpo_retv(tsd);
+ fd = tsd->fd;
- if( fd > 0 )
+ if (fd > 0)
clif->authfail_fd(fd, 15);
else
map->quit(tsd);
- if( sd )
+ if (sd)
clif->GM_kickack(sd, 1);
}
-
/// Displays various manner-related status messages (ZC_ACK_GIVE_MANNER_POINT).
/// 014a <result>.L
/// result:
@@ -7969,7 +7937,6 @@ void clif_manner_message(struct map_session_data* sd, uint32 type)
WFIFOSET(fd, packet_len(0x14a));
}
-
/// Follow-up to 0x14a type 3/5, informs who did the manner adjustment action (ZC_NOTIFY_MANNER_POINT_GIVEN).
/// 014b <type>.B <GM name>.24B
/// type:
@@ -7989,7 +7956,6 @@ void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd,
WFIFOSET(fd, packet_len(0x14b));
}
-
/// Notifies the client about the result of a request to allow/deny whispers from a player (ZC_SETTING_WHISPER_PC).
/// 00d1 <type>.B <result>.B
/// type:
@@ -8033,7 +7999,6 @@ void clif_wisall(struct map_session_data *sd,int type,int flag) {
WFIFOSET(fd,packet_len(0xd2));
}
-
/// Play a BGM! [Rikter/Yommy] (ZC_PLAY_NPC_BGM).
/// 07fe <bgm>.24B
void clif_playBGM(struct map_session_data* sd, const char* name)
@@ -8049,7 +8014,6 @@ void clif_playBGM(struct map_session_data* sd, const char* name)
WFIFOSET(fd,packet_len(0x7fe));
}
-
/// Plays/stops a wave sound (ZC_SOUND).
/// 01d3 <file name>.24B <act>.B <term>.L <npc id>.L
/// file name:
@@ -8069,6 +8033,7 @@ void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const
nullpo_retv(sd);
nullpo_retv(bl);
+ nullpo_retv(name);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x1d3));
@@ -8085,6 +8050,7 @@ void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum
unsigned char buf[40];
nullpo_retv(bl);
+ nullpo_retv(name);
WBUFW(buf,0) = 0x1d3;
safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
@@ -8094,7 +8060,6 @@ void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum
clif->send(buf, packet_len(0x1d3), bl, coverage);
}
-
/// Displays special effects (npcs, weather, etc) [Valaris] (ZC_NOTIFY_EFFECT2).
/// 01f3 <id>.L <effect id>.L
/// effect id:
@@ -8120,6 +8085,7 @@ void clif_specialeffect(struct block_list* bl, int type, enum send_target target
}
void clif_specialeffect_single(struct block_list* bl, int type, int fd) {
+ nullpo_retv(bl);
WFIFOHEAD(fd,10);
WFIFOW(fd,0) = 0x1f3;
WFIFOL(fd,2) = bl->id;
@@ -8127,7 +8093,6 @@ void clif_specialeffect_single(struct block_list* bl, int type, int fd) {
WFIFOSET(fd,10);
}
-
/// Notifies clients of an special/visual effect that accepts an value (ZC_NOTIFY_EFFECT3).
/// 0284 <id>.L <effect id>.L <num data>.L
/// effect id:
@@ -8162,7 +8127,10 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
*/
void clif_messagecolor_self(int fd, uint32 color, const char *msg)
{
- size_t msg_len = strlen(msg) + 1;
+ size_t msg_len;
+
+ nullpo_retv(msg);
+ msg_len = strlen(msg) + 1;
WFIFOHEAD(fd,msg_len + 12);
WFIFOW(fd,0) = 0x2C1;
@@ -8188,6 +8156,7 @@ void clif_messagecolor(struct block_list* bl, uint32 color, const char *msg)
uint8 buf[256];
nullpo_retv(bl);
+ nullpo_retv(msg);
if (msg_len > sizeof(buf)-12) {
ShowWarning("clif_messagecolor: Truncating too long message '%s' (len=%"PRIuS").\n", msg, msg_len);
@@ -8211,6 +8180,7 @@ void clif_messagecolor(struct block_list* bl, uint32 color, const char *msg)
**/
void clif_refresh_storagewindow(struct map_session_data *sd)
{
+ nullpo_retv(sd);
// Notify the client that the storage is open
if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
storage->sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
@@ -8293,7 +8263,6 @@ void clif_refresh(struct map_session_data *sd)
clif->refresh_storagewindow(sd);
}
-
/// Updates the object's (bl) name on client.
/// 0095 <id>.L <char name>.24B (ZC_ACK_REQNAME)
/// 0195 <id>.L <char name>.24B <party name>.24B <guild name>.24B <position name>.24B (ZC_ACK_REQNAMEALL)
@@ -8433,7 +8402,6 @@ void clif_charnameack (int fd, struct block_list *bl)
}
}
-
//Used to update when a char leaves a party/guild. [Skotlex]
//Needed because when you send a 0x95 packet, the client will not remove the cached party/guild info that is not sent.
void clif_charnameupdate (struct map_session_data *ssd)
@@ -8488,7 +8456,6 @@ void clif_charnameupdate (struct map_session_data *ssd)
clif->send(buf, packet_len(cmd), &ssd->bl, AREA);
}
-
/// Taekwon Jump (TK_HIGHJUMP) effect (ZC_HIGHJUMP).
/// 01ff <id>.L <x>.W <y>.W
///
@@ -8513,13 +8480,16 @@ void clif_slide(struct block_list *bl, int x, int y)
}
}
-
/// Public chat message (ZC_NOTIFY_CHAT). lordalfa/Skotlex - used by @me as well
/// 008d <packet len>.W <id>.L <message>.?B
void clif_disp_overhead(struct block_list *bl, const char* mes)
{
unsigned char buf[256]; //This should be more than sufficient, the theoretical max is CHAT_SIZE + 8 (pads and extra inserted crap)
- size_t len_mes = strlen(mes)+1; //Account for \0
+ size_t len_mes;
+
+ nullpo_retv(bl);
+ nullpo_retv(mes);
+ len_mes = strlen(mes)+1; //Account for \0
if (len_mes > sizeof(buf)-8) {
ShowError("clif_disp_overhead: Message too long (length %"PRIuS")\n", len_mes);
@@ -8557,7 +8527,6 @@ void clif_party_xy_remove(struct map_session_data *sd)
clif->send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
}
-
/// Displays a skill message (thanks to Rayce) (ZC_SKILLMSG).
/// 0215 <msg id>.L
/// msg id:
@@ -8575,7 +8544,10 @@ void clif_party_xy_remove(struct map_session_data *sd)
/// ? = nothing
void clif_gospel_info(struct map_session_data *sd, int type)
{
- int fd=sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x215));
WFIFOW(fd,0)=0x215;
WFIFOL(fd,2)=type;
@@ -8583,7 +8555,6 @@ void clif_gospel_info(struct map_session_data *sd, int type)
}
-
/// Multi-purpose mission information packet (ZC_STARSKILL).
/// 020e <mapname>.24B <monster_id>.L <star>.B <result>.B
/// result:
@@ -8614,7 +8585,11 @@ void clif_gospel_info(struct map_session_data *sd, int type)
/// 40 = Target HP : <monster_id used as HP>
void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ nullpo_retv(mapname);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x20e));
WFIFOW(fd,0) = 0x20e;
@@ -8633,6 +8608,8 @@ void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsig
{
char mapname[MAP_NAME_LENGTH_EXT];
+ nullpo_retv(sd);
+ Assert_retv(feel_level < MAX_PC_FEELHATE);
mapindex->getmapname_ext(mapindex_id2name(sd->feel_map[feel_level].index), mapname);
clif->starskill(sd, mapname, 0, feel_level, type ? 1 : 0);
}
@@ -8668,7 +8645,6 @@ void clif_feel_hate_reset(struct map_session_data *sd)
clif->starskill(sd, "", 0, 0, 30);
}
-
/// Equip window (un)tick ack (ZC_CONFIG).
/// 02d9 <type>.L <value>.L
/// type:
@@ -8689,7 +8665,6 @@ void clif_equiptickack(struct map_session_data* sd, int flag)
WFIFOSET(fd, packet_len(0x2d9));
}
-
/// The player's 'view equip' state, sent during login (ZC_CONFIG_NOTIFY).
/// 02da <open equip window>.B
/// open equip window:
@@ -8707,7 +8682,6 @@ void clif_equpcheckbox(struct map_session_data* sd)
WFIFOSET(fd, packet_len(0x2da));
}
-
/// Sends info about a player's equipped items.
/// 02d7 <packet len>.W <name>.24B <class>.W <hairstyle>.W <up-viewid>.W <mid-viewid>.W <low-viewid>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.26B* (ZC_EQUIPWIN_MICROSCOPE)
/// 02d7 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE, PACKETVER >= 20100629)
@@ -8725,7 +8699,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
if (tsd->status.inventory[k].nameid <= 0 || tsd->inventory_data[k] == NULL) // Item doesn't exist
continue;
- clif_item_equip(k+2,&viewequip_list.list[equip++],&tsd->status.inventory[k],tsd->inventory_data[k],pc->equippoint(tsd,k));
+ clif->item_equip(k+2,&viewequip_list.list[equip++],&tsd->status.inventory[k],tsd->inventory_data[k],pc->equippoint(tsd,k));
}
}
@@ -8749,7 +8723,6 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
clif->send(&viewequip_list, viewequip_list.PacketLength, &sd->bl, SELF);
}
-
/**
* Displays a string from msgstringtable.txt (ZC_MSG).
*
@@ -8808,7 +8781,10 @@ void clif_msgtable_num(struct map_session_data *sd, unsigned short msg_id, int v
*/
void clif_msgtable_skill(struct map_session_data* sd, uint16 skill_id, int msg_id)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x7e6));
WFIFOW(fd,0) = 0x7e6;
@@ -8827,6 +8803,12 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_,
size_t namelen, messagelen;
int fd = sd->fd;
+ nullpo_retr(false, sd);
+ nullpo_retr(false, name_);
+ nullpo_retr(false, namelen_);
+ nullpo_retr(false, message_);
+ nullpo_retr(false, messagelen_);
+
*name_ = NULL;
*namelen_ = 0;
*message_ = NULL;
@@ -8914,10 +8896,17 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_,
void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg)
{
- DBIterator *iter = db_iterator(chan->users);
+ DBIterator *iter;
struct map_session_data *user;
- unsigned short msg_len = strlen(msg) + 1;
- uint32 color = channel->config->colors[chan->color];
+ unsigned short msg_len;
+ uint32 color;
+
+ nullpo_retv(chan);
+ nullpo_retv(sd);
+ nullpo_retv(msg);
+ iter = db_iterator(chan->users);
+ msg_len = strlen(msg) + 1;
+ color = channel->config->colors[chan->color];
WFIFOHEAD(sd->fd,msg_len + 12);
WFIFOW(sd->fd,0) = 0x2C1;
@@ -8941,11 +8930,17 @@ void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, ch
void clif_channel_msg2(struct channel_data *chan, char *msg)
{
- DBIterator *iter = db_iterator(chan->users);
+ DBIterator *iter;
struct map_session_data *user;
unsigned char buf[210];
- unsigned short msg_len = strlen(msg) + 1;
- uint32 color = channel->config->colors[chan->color];
+ unsigned short msg_len;
+ uint32 color;
+
+ nullpo_retv(chan);
+ nullpo_retv(msg);
+ iter = db_iterator(chan->users);
+ msg_len = strlen(msg) + 1;
+ color = channel->config->colors[chan->color];
WBUFW(buf,0) = 0x2C1;
WBUFW(buf,2) = msg_len + 12;
@@ -8967,7 +8962,6 @@ void clif_channel_msg2(struct channel_data *chan, char *msg)
// ------------
// Parses incoming (player) connection
-
/// Request to connect to map-server.
/// 0072 <account id>.L <char id>.L <auth code>.L <client time>.L <gender>.B (CZ_ENTER)
/// 0436 <account id>.L <char id>.L <auth code>.L <client time>.L <gender>.B (CZ_ENTER2)
@@ -9043,9 +9037,10 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd) {
chrif->authreq(sd,false);
}
+void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Notification from the client, that it has finished map loading and is about to display player's character (CZ_NOTIFY_ACTORINIT).
/// 007d
-void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
+void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
bool first_time = false;
if(sd->bl.prev != NULL)
@@ -9361,7 +9356,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
clif->guild_notice(sd, sd->guild);
// For automatic triggering of NPCs after map loading (so you don't need to walk 1 step first)
- if (map->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNPC))
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNPC))
npc->touch_areanpc(sd,sd->bl.m,sd->bl.x,sd->bl.y);
else
npc->untouch_areanpc(sd, sd->bl.m, sd->bl.x, sd->bl.y);
@@ -9401,11 +9396,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
#endif
}
-
/// Server's tick (ZC_NOTIFY_TIME).
/// 007f <time>.L
void clif_notify_time(struct map_session_data* sd, int64 time) {
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x7f));
WFIFOW(fd,0) = 0x7f;
@@ -9413,7 +9410,7 @@ void clif_notify_time(struct map_session_data* sd, int64 time) {
WFIFOSET(fd,packet_len(0x7f));
}
-
+void clif_parse_TickSend(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request for server's tick.
/// 007e <client tick>.L (CZ_REQUEST_TIME)
/// 0360 <client tick>.L (CZ_REQUEST_TIME2)
@@ -9425,7 +9422,6 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd)
clif->notify_time(sd, timer->gettick());
}
-
/// Sends hotkey bar.
/// 02b9 { <is skill>.B <id>.L <count>.W }*27 (ZC_SHORTCUT_KEY_LIST)
/// 07d9 { <is skill>.B <id>.L <count>.W }*36 (ZC_SHORTCUT_KEY_LIST_V2, PACKETVER >= 20090603)
@@ -9435,6 +9431,7 @@ void clif_hotkeys_send(struct map_session_data *sd) {
#ifdef HOTKEY_SAVING
struct packet_hotkey p;
int i;
+ nullpo_retv(sd);
p.PacketType = hotkeyType;
#if PACKETVER >= 20141022
p.Rotate = sd->status.hotkey_rowshift;
@@ -9448,12 +9445,14 @@ void clif_hotkeys_send(struct map_session_data *sd) {
#endif
}
+void clif_parse_HotkeyRowShift(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_HotkeyRowShift(int fd, struct map_session_data *sd)
{
int cmd = RFIFOW(fd, 0);
sd->status.hotkey_rowshift = RFIFOB(fd, packet_db[cmd].pos[0]);
}
+void clif_parse_Hotkey(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to update a position on the hotkey bar (CZ_SHORTCUT_KEY_CHANGE).
/// 02ba <index>.W <is skill>.B <id>.L <count>.W
void clif_parse_Hotkey(int fd, struct map_session_data *sd) {
@@ -9471,13 +9470,15 @@ void clif_parse_Hotkey(int fd, struct map_session_data *sd) {
#endif
}
-
/// Displays cast-like progress bar (ZC_PROGRESS).
/// 02f0 <color>.L <time>.L
/* TODO ZC_PROGRESS_ACTOR <account_id>.L */
void clif_progressbar(struct map_session_data * sd, unsigned int color, unsigned int second)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x2f0));
WFIFOW(fd,0) = 0x2f0;
@@ -9486,19 +9487,21 @@ void clif_progressbar(struct map_session_data * sd, unsigned int color, unsigned
WFIFOSET(fd,packet_len(0x2f0));
}
-
/// Removes an ongoing progress bar (ZC_PROGRESS_CANCEL).
/// 02f2
void clif_progressbar_abort(struct map_session_data * sd)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x2f2));
WFIFOW(fd,0) = 0x2f2;
WFIFOSET(fd,packet_len(0x2f2));
}
-
+void clif_parse_progressbar(int fd, struct map_session_data * sd) __attribute__((nonnull (2)));
/// Notification from the client, that the progress bar has reached 100% (CZ_PROGRESS).
/// 02f1
void clif_parse_progressbar(int fd, struct map_session_data * sd)
@@ -9512,7 +9515,7 @@ void clif_parse_progressbar(int fd, struct map_session_data * sd)
npc->scriptcont(sd, npc_id, false);
}
-
+void clif_parse_WalkToXY(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to walk to a certain position on the current map.
/// 0085 <dest>.3B (CZ_REQUEST_MOVE)
/// 035f <dest>.3B (CZ_REQUEST_MOVE2)
@@ -9547,7 +9550,6 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
unit->walktoxy(&sd->bl, x, y, 4);
}
-
/// Notification about the result of a disconnect request (ZC_ACK_REQ_DISCONNECT).
/// 018b <result>.W
/// result:
@@ -9556,7 +9558,10 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
/// ? = ignored
void clif_disconnect_ack(struct map_session_data* sd, short result)
{
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x18b));
WFIFOW(fd,0) = 0x18b;
@@ -9564,7 +9569,7 @@ void clif_disconnect_ack(struct map_session_data* sd, short result)
WFIFOSET(fd,packet_len(0x18b));
}
-
+void clif_parse_QuitGame(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to disconnect from server (CZ_REQ_DISCONNECT).
/// 018a <type>.W
/// type:
@@ -9583,7 +9588,7 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Requesting unit's name.
/// 0094 <id>.L (CZ_REQNAME)
/// 0368 <id>.L (CZ_REQNAME2)
@@ -9631,6 +9636,7 @@ int clif_undisguise_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
+void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Validates and processes global messages
/// 008c <packet len>.W <text>.?B (<name> : <message>) 00 (CZ_REQUEST_CHAT)
/// There are various variants of this packet.
@@ -9762,17 +9768,17 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
WFIFOW(fd,0) = 0x8e;
}
WFIFOSET(fd, WFIFOW(fd,2));
-
+
// Chat logging type 'O' / Global Chat
logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
-
+
#ifdef PCRE_SUPPORT
// trigger listening npcs
map->foreachinrange(npc_chat->sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
#endif
}
-
+void clif_parse_MapMove(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /mm /mapmove (as @rura GM command) (CZ_MOVETO_MAP).
/// Request to warp to a map on given coordinates.
/// 0140 <map name>.16B <x>.W <y>.W
@@ -9787,7 +9793,6 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd)
atcommand->exec(fd, sd, command, true);
}
-
/// Updates body and head direction of an object (ZC_CHANGE_DIRECTION).
/// 009c <id>.L <head dir>.W <dir>.B
/// head dir:
@@ -9807,6 +9812,7 @@ void clif_changed_dir(struct block_list *bl, enum send_target target)
{
unsigned char buf[64];
+ nullpo_retv(bl);
WBUFW(buf,0) = 0x9c;
WBUFL(buf,2) = bl->id;
WBUFW(buf,6) = bl->type==BL_PC?((TBL_PC*)bl)->head_dir:0;
@@ -9821,7 +9827,7 @@ void clif_changed_dir(struct block_list *bl, enum send_target target)
}
}
-
+void clif_parse_ChangeDir(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change own body and head direction.
/// 009b <head dir>.W <dir>.B (CZ_CHANGE_DIRECTION)
/// 0361 <head dir>.W <dir>.B (CZ_CHANGE_DIRECTION2)
@@ -9837,7 +9843,7 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd)
clif->changed_dir(&sd->bl, AREA_WOS);
}
-
+void clif_parse_Emotion(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to show an emotion (CZ_REQ_EMOTION).
/// 00bf <type>.B
/// type:
@@ -9871,11 +9877,13 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1);
}
-
/// Amount of currently online players, reply to /w /who (ZC_USER_COUNT).
/// 00c2 <count>.L
void clif_user_count(struct map_session_data* sd, int count) {
- int fd = sd->fd;
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xc2));
WFIFOW(fd,0) = 0xc2;
@@ -9883,7 +9891,7 @@ void clif_user_count(struct map_session_data* sd, int count) {
WFIFOSET(fd,packet_len(0xc2));
}
-
+void clif_parse_HowManyConnections(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /w /who (CZ_REQ_USER_COUNT).
/// Request to display amount of currently connected players.
/// 00c1
@@ -9891,10 +9899,10 @@ void clif_parse_HowManyConnections(int fd, struct map_session_data *sd) {
clif->user_count(sd, map->getusers());
}
-
void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, int64 tick) {
struct block_list *target = NULL;
-
+
+ nullpo_retv(sd);
if (pc_isdead(sd)) {
clif->clearunit_area(&sd->bl, CLR_DEAD);
return;
@@ -9920,12 +9928,11 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
switch(action_type) {
case 0x00: // once attack
case 0x07: // continuous attack
-
if( (target = map->id2bl(target_id)) && target->type == BL_NPC ) {
npc->click(sd,(TBL_NPC*)target);
return;
}
-
+
if( pc_cant_act(sd) || pc_issit(sd) || sd->sc.option&OPTION_HIDE )
return;
@@ -9990,6 +9997,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
}
}
+void clif_parse_ActionRequest(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request for an action.
/// 0089 <target id>.L <action>.B (CZ_REQUEST_ACT)
/// 0437 <target id>.L <action>.B (CZ_REQUEST_ACT2)
@@ -10010,7 +10018,7 @@ void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
);
}
-
+void clif_parse_Restart(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Response to the death/system menu (CZ_RESTART).
/// 00b2 <type>.B
/// type:
@@ -10036,7 +10044,7 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) {
}
}
-
+void clif_parse_WisMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Validates and processes whispered messages (CZ_WHISPER).
/// 0096 <packet len>.W <nick>.24B <message>.?B
void clif_parse_WisMessage(int fd, struct map_session_data* sd)
@@ -10116,7 +10124,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
if (chan) {
int k;
ARR_FIND(0, sd->channel_count, k, sd->channels[k] == chan);
- if (k < sd->channel_count || channel->join(chan, sd, NULL, true) == HCS_STATUS_OK) {
+ if (k < sd->channel_count || channel->join(chan, sd, "", true) == HCS_STATUS_OK) {
channel->send(chan,sd,message);
} else {
clif->message(fd, msg_fd(fd,1402));
@@ -10171,7 +10179,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
clif->wis_message(dstsd->fd, sd->status.name, message, messagelen);
}
-
+void clif_parse_Broadcast(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /b /nb (CZ_BROADCAST).
/// Request to broadcast a message on whole server.
/// 0099 <packet len>.W <text>.?B 00
@@ -10187,7 +10195,7 @@ void clif_parse_Broadcast(int fd, struct map_session_data* sd) {
atcommand->exec(fd, sd, command, true);
}
-
+void clif_parse_TakeItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to pick up an item.
/// 009f <id>.L (CZ_ITEM_PICKUP)
/// 0362 <id>.L (CZ_ITEM_PICKUP2)
@@ -10231,7 +10239,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) {
clif->additem(sd,0,0,6);
}
-
+void clif_parse_DropItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to drop an item.
/// 00a2 <index>.W <amount>.W (CZ_ITEM_THROW)
/// 0363 <index>.W <amount>.W (CZ_ITEM_THROW2)
@@ -10265,10 +10273,10 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
}
//Because the client does not like being ignored.
- clif->dropitem(sd, item_index,0);
+ clif->dropitem(sd, item_index, 0);
}
-
+void clif_parse_UseItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to use an item.
/// 00a7 <index>.W <account id>.L (CZ_USE_ITEM)
/// 0439 <index>.W <account id>.L (CZ_USE_ITEM2)
@@ -10290,13 +10298,13 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
sd->idletime = sockt->last_tick;
n = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-2;
- if(n <0 || n >= MAX_INVENTORY)
+ if (n < 0 || n >= MAX_INVENTORY)
return;
if (!pc->useitem(sd,n))
clif->useitemack(sd,n,0,false); //Send an empty ack packet or the client gets stuck.
}
-
+void clif_parse_EquipItem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to equip an item (CZ_REQ_WEAR_EQUIP).
/// 00a9 <index>.W <position>.W
/// 0998 <index>.W <position>.L
@@ -10343,6 +10351,7 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) {
pc->equipitem(sd,p->index,p->wearLocation);
}
+void clif_parse_UnequipItem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to take off an equip (CZ_REQ_TAKEOFF_EQUIP).
/// 00ab <index>.W
void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
@@ -10370,7 +10379,7 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
pc->unequipitem(sd,index, PCUNEQUIPITEM_RECALC);
}
-
+void clif_parse_NpcClicked(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to start a conversation with an NPC (CZ_CONTACTNPC).
/// 0090 <id>.L <type>.B
/// type:
@@ -10410,20 +10419,19 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
}
}
-
+void clif_parse_NpcBuySellSelected(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Selection between buy/sell was made (CZ_ACK_SELECT_DEALTYPE).
/// 00c5 <id>.L <type>.B
/// type:
/// 0 = buy
/// 1 = sell
-void clif_parse_NpcBuySellSelected(int fd,struct map_session_data *sd)
+void clif_parse_NpcBuySellSelected(int fd, struct map_session_data *sd)
{
if (sd->state.trading)
return;
- npc->buysellsel(sd,RFIFOL(fd,2),RFIFOB(fd,6));
+ npc->buysellsel(sd, RFIFOL(fd,2), RFIFOB(fd,6));
}
-
/// Notification about the result of a purchase attempt from an NPC shop (ZC_PC_PURCHASE_RESULT).
/// 00ca <result>.B
/// result:
@@ -10432,15 +10440,17 @@ void clif_parse_NpcBuySellSelected(int fd,struct map_session_data *sd)
/// 2 = "You are over your Weight Limit."
/// 3 = "Out of the maximum capacity, you have too many items."
void clif_npc_buy_result(struct map_session_data* sd, unsigned char result) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xca));
WFIFOW(fd,0) = 0xca;
WFIFOB(fd,2) = result;
WFIFOSET(fd,packet_len(0xca));
}
-
+void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to buy chosen items from npc shop (CZ_PC_PURCHASE_ITEMLIST).
/// 00c8 <packet len>.W { <amount>.W <name id>.W }*
void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
@@ -10459,22 +10469,23 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
clif->npc_buy_result(sd, result);
}
-
/// Notification about the result of a sell attempt to an NPC shop (ZC_PC_SELL_RESULT).
/// 00cb <result>.B
/// result:
/// 0 = "The deal has successfully completed."
/// 1 = "The deal has failed."
void clif_npc_sell_result(struct map_session_data* sd, unsigned char result) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0xcb));
WFIFOW(fd,0) = 0xcb;
WFIFOB(fd,2) = result;
WFIFOSET(fd,packet_len(0xcb));
}
-
+void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to sell chosen items to npc shop (CZ_PC_SELL_ITEMLIST).
/// 00c9 <packet len>.W { <index>.W <amount>.W }*
void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
@@ -10495,7 +10506,7 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
clif->npc_sell_result(sd, fail);
}
-
+void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Chatroom creation request (CZ_CREATE_CHATROOM).
/// 00d5 <packet len>.W <limit>.W <type>.B <passwd>.8B <title>.?B
/// type:
@@ -10535,7 +10546,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
chat->create_pc_chat(sd, s_title, s_password, limit, pub);
}
-
+void clif_parse_ChatAddMember(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Chatroom join request (CZ_REQ_ENTER_ROOM).
/// 00d9 <chat ID>.L <passwd>.8B
void clif_parse_ChatAddMember(int fd, struct map_session_data* sd)
@@ -10546,7 +10557,7 @@ void clif_parse_ChatAddMember(int fd, struct map_session_data* sd)
chat->join(sd,chatid,password);
}
-
+void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Chatroom properties adjustment request (CZ_CHANGE_CHATROOM).
/// 00de <packet len>.W <limit>.W <type>.B <passwd>.8B <title>.?B
/// type:
@@ -10571,7 +10582,7 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd)
chat->change_status(sd, s_title, s_password, limit, pub);
}
-
+void clif_parse_ChangeChatOwner(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to change the chat room ownership (CZ_REQ_ROLE_CHANGE).
/// 00e0 <role>.L <nick>.24B
/// role:
@@ -10582,7 +10593,7 @@ void clif_parse_ChangeChatOwner(int fd, struct map_session_data* sd)
chat->change_owner(sd,(char*)RFIFOP(fd,6));
}
-
+void clif_parse_KickFromChat(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to expel a player from chat room (CZ_REQ_EXPEL_MEMBER).
/// 00e2 <name>.24B
void clif_parse_KickFromChat(int fd,struct map_session_data *sd)
@@ -10590,7 +10601,7 @@ void clif_parse_KickFromChat(int fd,struct map_session_data *sd)
chat->kick(sd,(char*)RFIFOP(fd,2));
}
-
+void clif_parse_ChatLeave(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to leave the current chatroom (CZ_EXIT_ROOM).
/// 00e3
void clif_parse_ChatLeave(int fd, struct map_session_data* sd)
@@ -10598,13 +10609,13 @@ void clif_parse_ChatLeave(int fd, struct map_session_data* sd)
chat->leave(sd, false);
}
-
//Handles notifying asker and rejecter of what has just occurred.
//Type is used to determine the correct msg_txt to use:
//0:
void clif_noask_sub(struct map_session_data *src, struct map_session_data *target, int type) {
const char* msg;
char output[256];
+ nullpo_retv(src);
// Your request has been rejected by autoreject option.
msg = msg_sd(src,392);
clif_disp_onlyself(src, msg, strlen(msg));
@@ -10613,7 +10624,7 @@ void clif_noask_sub(struct map_session_data *src, struct map_session_data *targe
clif_disp_onlyself(target, output, strlen(output));
}
-
+void clif_parse_TradeRequest(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to begin a trade (CZ_REQ_EXCHANGE_ITEM).
/// 00e4 <account id>.L
void clif_parse_TradeRequest(int fd,struct map_session_data *sd) {
@@ -10638,7 +10649,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) {
trade->request(sd,t_sd);
}
-
+void clif_parse_TradeAck(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to a trade request (CZ_ACK_EXCHANGE_ITEM).
/// 00e6 <result>.B
/// result:
@@ -10649,7 +10660,7 @@ void clif_parse_TradeAck(int fd,struct map_session_data *sd)
trade->ack(sd,RFIFOB(fd,2));
}
-
+void clif_parse_TradeAddItem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add an item to current trade (CZ_ADD_EXCHANGE_ITEM).
/// 00e8 <index>.W <amount>.L
void clif_parse_TradeAddItem(int fd,struct map_session_data *sd)
@@ -10663,7 +10674,7 @@ void clif_parse_TradeAddItem(int fd,struct map_session_data *sd)
trade->additem(sd, index, (short)amount);
}
-
+void clif_parse_TradeOk(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to lock items in current trade (CZ_CONCLUDE_EXCHANGE_ITEM).
/// 00eb
void clif_parse_TradeOk(int fd,struct map_session_data *sd)
@@ -10671,7 +10682,7 @@ void clif_parse_TradeOk(int fd,struct map_session_data *sd)
trade->ok(sd);
}
-
+void clif_parse_TradeCancel(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to cancel current trade (CZ_CANCEL_EXCHANGE_ITEM).
/// 00ed
void clif_parse_TradeCancel(int fd,struct map_session_data *sd)
@@ -10679,7 +10690,7 @@ void clif_parse_TradeCancel(int fd,struct map_session_data *sd)
trade->cancel(sd);
}
-
+void clif_parse_TradeCommit(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to commit current trade (CZ_EXEC_EXCHANGE_ITEM).
/// 00ef
void clif_parse_TradeCommit(int fd,struct map_session_data *sd)
@@ -10687,7 +10698,7 @@ void clif_parse_TradeCommit(int fd,struct map_session_data *sd)
trade->commit(sd);
}
-
+void clif_parse_StopAttack(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to stop chasing/attacking an unit (CZ_CANCEL_LOCKON).
/// 0118
void clif_parse_StopAttack(int fd,struct map_session_data *sd)
@@ -10695,7 +10706,7 @@ void clif_parse_StopAttack(int fd,struct map_session_data *sd)
pc_stop_attack(sd);
}
-
+void clif_parse_PutItemToCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from inventory to cart (CZ_MOVE_ITEM_FROM_BODY_TO_CART).
/// 0126 <index>.W <amount>.L
void clif_parse_PutItemToCart(int fd,struct map_session_data *sd) {
@@ -10710,7 +10721,7 @@ void clif_parse_PutItemToCart(int fd,struct map_session_data *sd) {
}
}
-
+void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from cart to inventory (CZ_MOVE_ITEM_FROM_CART_TO_BODY).
/// 0127 <index>.W <amount>.L
void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
@@ -10720,7 +10731,7 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
pc->getitemfromcart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
}
-
+void clif_parse_RemoveOption(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to remove cart/falcon/peco/dragon (CZ_REQ_CARTOFF).
/// 012a
void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
@@ -10738,15 +10749,13 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
}
}
-
+void clif_parse_ChangeCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change cart's visual look (CZ_REQ_CHANGECART).
/// 01af <num>.W
void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
{// TODO: State tracking?
int type;
- nullpo_retv(sd);
-
if( pc->checkskill(sd, MC_CHANGECART) < 1 )
return;
@@ -10778,7 +10787,7 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
pc->setcart(sd,type);
}
-
+void clif_parse_StatusUp(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to increase status (CZ_STATUS_CHANGE).
/// 00bb <status id>.W <amount>.B
/// status id:
@@ -10798,7 +10807,7 @@ void clif_parse_StatusUp(int fd,struct map_session_data *sd) {
pc->statusup(sd, RFIFOW(fd,2), increase_amount);
}
-
+void clif_parse_SkillUp(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to increase level of a skill (CZ_UPGRADE_SKILLLEVEL).
/// 0112 <skill id>.W
void clif_parse_SkillUp(int fd,struct map_session_data *sd)
@@ -10809,6 +10818,7 @@ void clif_parse_SkillUp(int fd,struct map_session_data *sd)
void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id) {
int lv;
+ nullpo_retv(sd);
if( !hd )
return;
if (skill->not_ok_hom(skill_id, hd)){
@@ -10837,6 +10847,7 @@ void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_session_dat
void clif_parse_UseSkillToPos_homun(struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo) {
int lv;
+ nullpo_retv(sd);
if( !hd )
return;
if (skill->not_ok_hom(skill_id, hd)){
@@ -10865,6 +10876,7 @@ void clif_parse_UseSkillToPos_homun(struct homun_data *hd, struct map_session_da
void clif_parse_UseSkillToId_mercenary(struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id) {
int lv;
+ nullpo_retv(sd);
if( !md )
return;
if( skill->not_ok_mercenary(skill_id, md) )
@@ -10885,6 +10897,7 @@ void clif_parse_UseSkillToId_mercenary(struct mercenary_data *md, struct map_ses
void clif_parse_UseSkillToPos_mercenary(struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo) {
int lv;
+ nullpo_retv(sd);
if( !md )
return;
if( skill->not_ok_mercenary(skill_id, md) )
@@ -10905,7 +10918,7 @@ void clif_parse_UseSkillToPos_mercenary(struct mercenary_data *md, struct map_se
unit->skilluse_pos(&md->bl, x, y, skill_id, skill_lv);
}
-
+void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to use a targeted skill.
/// 0113 <skill lv>.W <skill id>.W <target id>.L (CZ_USE_SKILL)
/// 0438 <skill lv>.W <skill id>.W <target id>.L (CZ_USE_SKILL2)
@@ -11023,6 +11036,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
{
int64 tick = timer->gettick();
+ nullpo_retv(sd);
if( !(skill->get_inf(skill_id)&INF_GROUND_SKILL) )
return; //Using a target skill on the ground? WRONG.
@@ -11035,7 +11049,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
clif->pUseSkillToPos_mercenary(sd->md, sd, tick, skill_id, skill_lv, x, y, skillmoreinfo);
return;
}
-
+
#ifdef RENEWAL
if( sd->state.workinprogress&1 ){
clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message.
@@ -11098,7 +11112,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
}
}
-
+void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to use a ground skill.
/// 0116 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND)
/// 0366 <skill lv>.W <skill id>.W <x>.W <y>.W (CZ_USE_SKILL_TOGROUND2)
@@ -11119,7 +11133,7 @@ void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
);
}
-
+void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to use a ground skill with text.
/// 0190 <skill lv>.W <skill id>.W <x>.W <y>.W <contents>.80B (CZ_USE_SKILL_TOGROUND_WITHTALKBOX)
/// 0367 <skill lv>.W <skill id>.W <x>.W <y>.W <contents>.80B (CZ_USE_SKILL_TOGROUND_WITHTALKBOX2)
@@ -11140,7 +11154,7 @@ void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd)
);
}
-
+void clif_parse_UseSkillMap(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Answer to map selection dialog (CZ_SELECT_WARPPOINT).
/// 011b <skill id>.W <map name>.16B
void clif_parse_UseSkillMap(int fd, struct map_session_data* sd)
@@ -11164,7 +11178,7 @@ void clif_parse_UseSkillMap(int fd, struct map_session_data* sd)
skill->castend_map(sd,skill_id,map_name);
}
-
+void clif_parse_RequestMemo(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to set a memo on current map (CZ_REMEMBER_WARPPOINT).
/// 011d
void clif_parse_RequestMemo(int fd,struct map_session_data *sd)
@@ -11173,7 +11187,7 @@ void clif_parse_RequestMemo(int fd,struct map_session_data *sd)
pc->memo(sd,-1);
}
-
+void clif_parse_ProduceMix(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to pharmacy item selection dialog (CZ_REQMAKINGITEM).
/// 018e <name id>.W { <material id>.W }*3
void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
@@ -11198,7 +11212,7 @@ void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_Cooking(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to mixing item selection dialog (CZ_REQ_MAKINGITEM).
/// 025b <mk type>.W <name id>.W
/// mk type:
@@ -11226,7 +11240,7 @@ void clif_parse_Cooking(int fd,struct map_session_data *sd) {
clif_menuskill_clear(sd);
}
-
+void clif_parse_RepairItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to repair weapon item selection dialog (CZ_REQ_ITEMREPAIR).
/// 01fd <index>.W <name id>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W
void clif_parse_RepairItem(int fd, struct map_session_data *sd)
@@ -11243,7 +11257,7 @@ void clif_parse_RepairItem(int fd, struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_WeaponRefine(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to refine weapon item selection dialog (CZ_REQ_WEAPONREFINE).
/// 0222 <index>.L
void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
@@ -11265,7 +11279,7 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to script menu dialog (CZ_CHOOSE_MENU).
/// 00b8 <npc id>.L <choice>.B
/// choice:
@@ -11295,7 +11309,7 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
npc->scriptcont(sd,npc_id, false);
}
-
+void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// NPC dialog 'next' click (CZ_REQ_NEXT_SCRIPT).
/// 00b9 <npc id>.L
void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd)
@@ -11303,7 +11317,7 @@ void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd)
npc->scriptcont(sd,RFIFOL(fd,2), false);
}
-
+void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// NPC numeric input dialog value (CZ_INPUT_EDITDLG).
/// 0143 <npc id>.L <value>.L
void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
@@ -11311,11 +11325,14 @@ void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
int npcid = RFIFOL(fd,2);
int amount = (int)RFIFOL(fd,6);
- sd->npc_amount = amount;
+ if (amount >= 0)
+ sd->npc_amount = amount;
+ else
+ sd->npc_amount = 0;
npc->scriptcont(sd, npcid, false);
}
-
+void clif_parse_NpcStringInput(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// NPC text input dialog value (CZ_INPUT_EDITDLGSTR).
/// 01d5 <packet len>.W <npc id>.L <string>.?B
void clif_parse_NpcStringInput(int fd, struct map_session_data* sd)
@@ -11331,7 +11348,7 @@ void clif_parse_NpcStringInput(int fd, struct map_session_data* sd)
npc->scriptcont(sd, npcid, false);
}
-
+void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// NPC dialog 'close' click (CZ_CLOSE_DIALOG).
/// 0146 <npc id>.L
void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd)
@@ -11342,7 +11359,7 @@ void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd)
npc->scriptcont(sd, RFIFOL(fd,2), true);
}
-
+void clif_parse_ItemIdentify(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to identify item selection dialog (CZ_REQ_ITEMIDENTIFY).
/// 0178 <index>.W
/// index:
@@ -11363,7 +11380,7 @@ void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_SelectArrow(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to arrow crafting item selection dialog (CZ_REQ_MAKINGARROW).
/// 01ae <name id>.W
void clif_parse_SelectArrow(int fd,struct map_session_data *sd)
@@ -11395,7 +11412,7 @@ void clif_parse_SelectArrow(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_AutoSpell(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to SA_AUTOSPELL skill selection dialog (CZ_SELECTAUTOSPELL).
/// 01ce <skill id>.L
void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
@@ -11414,7 +11431,7 @@ void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_UseCard(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to display item carding/composition list (CZ_REQ_ITEMCOMPOSITION_LIST).
/// 017a <card index>.W
void clif_parse_UseCard(int fd,struct map_session_data *sd)
@@ -11422,7 +11439,7 @@ void clif_parse_UseCard(int fd,struct map_session_data *sd)
clif->use_card(sd,RFIFOW(fd,2)-2);
}
-
+void clif_parse_InsertCard(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to carding/composing item selection dialog (CZ_REQ_ITEMCOMPOSITION).
/// 017c <card index>.W <equip index>.W
void clif_parse_InsertCard(int fd,struct map_session_data *sd)
@@ -11430,7 +11447,7 @@ void clif_parse_InsertCard(int fd,struct map_session_data *sd)
pc->insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2);
}
-
+void clif_parse_SolveCharName(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request of character's name by char ID.
/// 0193 <char id>.L (CZ_REQNAME_BYGID)
/// 0369 <char id>.L (CZ_REQNAME_BYGID2)
@@ -11442,7 +11459,7 @@ void clif_parse_SolveCharName(int fd, struct map_session_data *sd) {
map->reqnickdb(sd, charid);
}
-
+void clif_parse_ResetChar(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /resetskill /resetstate (CZ_RESET).
/// Request to reset stats or skills.
/// 0197 <type>.W
@@ -11460,7 +11477,7 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
atcommand->exec(fd, sd, cmd, true);
}
-
+void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /lb /nlb (CZ_LOCALBROADCAST).
/// Request to broadcast a message on current map.
/// 019c <packet len>.W <text>.?B
@@ -11477,7 +11494,7 @@ void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd)
atcommand->exec(fd, sd, command, true);
}
-
+void clif_parse_MoveToKafra(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from inventory to storage.
/// 00f3 <index>.W <amount>.L (CZ_MOVE_ITEM_FROM_BODY_TO_STORE)
/// 0364 <index>.W <amount>.L (CZ_MOVE_ITEM_FROM_BODY_TO_STORE2)
@@ -11500,7 +11517,7 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd)
gstorage->add(sd, item_index, item_amount);
}
-
+void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from storage to inventory.
/// 00f5 <index>.W <amount>.L (CZ_MOVE_ITEM_FROM_STORE_TO_BODY)
/// 0365 <index>.W <amount>.L (CZ_MOVE_ITEM_FROM_STORE_TO_BODY2)
@@ -11518,7 +11535,7 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd)
gstorage->get(sd, item_index, item_amount);
}
-
+void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from cart to storage (CZ_MOVE_ITEM_FROM_CART_TO_STORE).
/// 0129 <index>.W <amount>.L
void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd)
@@ -11534,7 +11551,7 @@ void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd)
gstorage->addfromcart(sd, RFIFOW(fd,2) - 2, RFIFOL(fd,4));
}
-
+void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move an item from storage to cart (CZ_MOVE_ITEM_FROM_STORE_TO_CART).
/// 0128 <index>.W <amount>.L
void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd)
@@ -11550,7 +11567,7 @@ void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd)
gstorage->gettocart(sd, RFIFOW(fd,2)-1, RFIFOL(fd,4));
}
-
+void clif_parse_CloseKafra(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to close storage (CZ_CLOSE_STORE).
/// 00f7
void clif_parse_CloseKafra(int fd, struct map_session_data *sd)
@@ -11561,7 +11578,6 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd)
gstorage->close(sd);
}
-
/// Displays kafra storage password dialog (ZC_REQ_STORE_PASSWORD).
/// 023a <info>.W
/// info:
@@ -11572,15 +11588,17 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd)
/// NOTE: This packet is only available on certain non-kRO clients.
void clif_storagepassword(struct map_session_data* sd, short info)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x23a));
WFIFOW(fd,0) = 0x23a;
WFIFOW(fd,2) = info;
WFIFOSET(fd,packet_len(0x23a));
}
-
+void clif_parse_StoragePassword(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to the kafra storage password dialog (CZ_ACK_STORE_PASSWORD).
/// 023b <type>.W <password>.16B <new password>.16B
/// type:
@@ -11592,7 +11610,6 @@ void clif_parse_StoragePassword(int fd, struct map_session_data *sd)
//TODO
}
-
/// Result of kafra storage password validation (ZC_RESULT_STORE_PASSWORD).
/// 023c <result>.W <error count>.W
/// result:
@@ -11605,8 +11622,10 @@ void clif_parse_StoragePassword(int fd, struct map_session_data *sd)
/// NOTE: This packet is only available on certain non-kRO clients.
void clif_storagepassword_result(struct map_session_data* sd, short result, short error_count)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x23c));
WFIFOW(fd,0) = 0x23c;
WFIFOW(fd,2) = result;
@@ -11614,7 +11633,7 @@ void clif_storagepassword_result(struct map_session_data* sd, short result, shor
WFIFOSET(fd,packet_len(0x23c));
}
-
+void clif_parse_CreateParty(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Party creation request
/// 00f9 <party name>.24B (CZ_MAKE_GROUP)
/// 01e8 <party name>.24B <item pickup rule>.B <item share rule>.B (CZ_MAKE_GROUP2)
@@ -11635,6 +11654,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
party->create(sd,name,0,0);
}
+void clif_parse_CreateParty2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
char* name = (char*)RFIFOP(fd,2);
int item1 = RFIFOB(fd,26);
@@ -11654,7 +11674,7 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
party->create(sd,name,item1,item2);
}
-
+void clif_parse_PartyInvite(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Party invitation request
/// 00fc <account id>.L (CZ_REQ_JOIN_GROUP)
/// 02c4 <char name>.24B (CZ_PARTY_JOIN_REQ)
@@ -11677,6 +11697,7 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd) {
party->invite(sd, t_sd);
}
+void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) {
struct map_session_data *t_sd;
char *name = (char*)RFIFOP(fd,2);
@@ -11698,7 +11719,7 @@ void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) {
party->invite(sd, t_sd);
}
-
+void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Party invitation reply
/// 00ff <party id>.L <flag>.L (CZ_JOIN_GROUP)
/// 02c7 <party id>.L <flag>.B (CZ_PARTY_JOIN_REQ_ACK)
@@ -11710,12 +11731,13 @@ void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd)
party->reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
+void clif_parse_ReplyPartyInvite2(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_ReplyPartyInvite2(int fd,struct map_session_data *sd)
{
party->reply_invite(sd,RFIFOL(fd,2),RFIFOB(fd,6));
}
-
+void clif_parse_LeaveParty(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to leave party (CZ_REQ_LEAVE_GROUP).
/// 0100
void clif_parse_LeaveParty(int fd, struct map_session_data *sd) {
@@ -11727,7 +11749,7 @@ void clif_parse_LeaveParty(int fd, struct map_session_data *sd) {
party->leave(sd);
}
-
+void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to expel a party member (CZ_REQ_EXPEL_GROUP_MEMBER).
/// 0103 <account id>.L <char name>.24B
void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) {
@@ -11739,7 +11761,7 @@ void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) {
party->removemember(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
}
-
+void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change party options.
/// 0102 <exp share rule>.L (CZ_CHANGE_GROUPEXPOPTION)
/// 07d7 <exp share rule>.L <item pickup rule>.B <item share rule>.B (CZ_GROUPINFO_CHANGE_V2)
@@ -11770,7 +11792,7 @@ void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd)
#endif
}
-
+void clif_parse_PartyMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Validates and processes party messages (CZ_REQUEST_CHAT_PARTY).
/// 0108 <packet len>.W <text>.?B (<name> : <message>) 00
void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
@@ -11803,13 +11825,14 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
party->send_message(sd, text, textlen);
}
-
+void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Changes Party Leader (CZ_CHANGE_GROUP_MASTER).
/// 07da <account id>.L
void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) {
party->changeleader(sd, map->id2sd(RFIFOL(fd,2)));
}
-
+
+void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Party Booking in KRO [Spiria]
///
@@ -11832,7 +11855,6 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd)
#endif
}
-
/// Result of request to register a party booking advertisement (ZC_PARTY_BOOKING_ACK_REGISTER).
/// 0803 <result>.W
/// result:
@@ -11842,8 +11864,10 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd)
void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag)
{
#ifndef PARTY_RECRUIT
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x803));
WFIFOW(fd,0) = 0x803;
WFIFOW(fd,2) = flag;
@@ -11853,7 +11877,7 @@ void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag)
#endif
}
-
+void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to search for party booking advertisement (CZ_PARTY_BOOKING_REQ_SEARCH).
/// 0804 <level>.W <map id>.W <job>.W <last index>.L <result count>.W
void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd)
@@ -11871,7 +11895,6 @@ void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd)
#endif
}
-
/// Party booking search results (ZC_PARTY_BOOKING_ACK_SEARCH).
/// 0805 <packet len>.W <more results>.B { <index>.L <char name>.24B <expire time>.L <level>.W <map id>.W { <job>.W }*6 }*
/// more results:
@@ -11883,6 +11906,7 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results,
int i, j;
int size = sizeof(struct party_booking_ad_info); // structure size (48)
struct party_booking_ad_info *pb_ad;
+ nullpo_retv(results);
WFIFOHEAD(fd,size*count + 5);
WFIFOW(fd,0) = 0x805;
WFIFOW(fd,2) = size*count + 5;
@@ -11904,7 +11928,7 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results,
#endif
}
-
+void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to delete own party booking advertisement (CZ_PARTY_BOOKING_REQ_DELETE).
/// 0806
void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd)
@@ -11917,7 +11941,6 @@ void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd)
#endif
}
-
/// Result of request to delete own party booking advertisement (ZC_PARTY_BOOKING_ACK_DELETE).
/// 0807 <result>.W
/// result:
@@ -11928,8 +11951,10 @@ void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd)
void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag)
{
#ifndef PARTY_RECRUIT
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x807));
WFIFOW(fd,0) = 0x807;
WFIFOW(fd,2) = flag;
@@ -11939,7 +11964,7 @@ void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag)
#endif
}
-
+void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to update party booking advertisement (CZ_PARTY_BOOKING_REQ_UPDATE).
/// 0808 { <job>.W }*6
void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd)
@@ -11957,7 +11982,6 @@ void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd)
#endif
}
-
/// Notification about new party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_INSERT).
/// 0809 <index>.L <char name>.24B <expire time>.L <level>.W <map id>.W { <job>.W }*6
void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad)
@@ -11966,6 +11990,7 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo
int i;
uint8 buf[38+PARTY_BOOKING_JOBS*2];
+ nullpo_retv(sd);
if(pb_ad == NULL) return;
WBUFW(buf,0) = 0x809;
@@ -11983,7 +12008,6 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo
#endif
}
-
/// Notification about updated party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_UPDATE).
/// 080a <index>.L { <job>.W }*6
void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad)
@@ -11992,6 +12016,7 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo
int i;
uint8 buf[6+PARTY_BOOKING_JOBS*2];
+ nullpo_retv(sd);
if(pb_ad == NULL) return;
WBUFW(buf,0) = 0x80a;
@@ -12004,7 +12029,6 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo
#endif
}
-
/// Notification about deleted party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_DELETE).
/// 080b <index>.L
void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index)
@@ -12012,6 +12036,7 @@ void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index)
#ifndef PARTY_RECRUIT
uint8 buf[6];
+ nullpo_retv(sd);
WBUFW(buf,0) = 0x80b;
WBUFL(buf,2) = index;
@@ -12021,6 +12046,7 @@ void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index)
#endif
}
+void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Modified version of Party Booking System for 2012-04-10 or 2012-04-18 (RagexeRE).
/// Code written by mkbu95, Spiria, Yommy and Ind
@@ -12050,6 +12076,7 @@ void clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info** results,
int size = sizeof(struct party_booking_ad_info);
struct party_booking_ad_info *pb_ad;
+ nullpo_retv(results);
WFIFOHEAD(fd, (size * count) + 5);
WFIFOW(fd, 0) = 0x8e8;
WFIFOW(fd, 2) = (size * count) + 5;
@@ -12080,8 +12107,10 @@ void clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info** results,
void clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag)
{
#ifdef PARTY_RECRUIT
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x8e6));
WFIFOW(fd, 0) = 0x8e6;
WFIFOW(fd, 2) = flag;
@@ -12091,6 +12120,7 @@ void clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag)
#endif
}
+void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to search for party booking advertisement (CZ_PARTY_RECRUIT_REQ_SEARCH).
/// 08e7 <level>.W <map id>.W <last index>.L <result count>.W
void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd)
@@ -12107,6 +12137,7 @@ void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd)
#endif
}
+void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to delete own party booking advertisement (CZ_PARTY_RECRUIT_REQ_DELETE).
/// 08e9
void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd)
@@ -12129,8 +12160,10 @@ void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd)
void clif_PartyRecruitDeleteAck(struct map_session_data* sd, int flag)
{
#ifdef PARTY_RECRUIT
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x8ea));
WFIFOW(fd, 0) = 0x8ea;
WFIFOW(fd, 2) = flag;
@@ -12140,6 +12173,7 @@ void clif_PartyRecruitDeleteAck(struct map_session_data* sd, int flag)
#endif
}
+void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to update party booking advertisement (CZ_PARTY_RECRUIT_REQ_UPDATE).
/// 08eb <notice>.37B
void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd)
@@ -12162,6 +12196,7 @@ void clif_PartyRecruitInsertNotify(struct map_session_data* sd, struct party_boo
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+6+24+4+37+1];
+ nullpo_retv(sd);
if (pb_ad == NULL)
return;
@@ -12184,6 +12219,8 @@ void clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_boo
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+37+1];
+ nullpo_retv(sd);
+ nullpo_retv(pb_ad);
WBUFW(buf, 0) = 0x8ed;
WBUFL(buf, 2) = pb_ad->index;
memcpy(WBUFP(buf, 6), pb_ad->p_detail.notice, PB_NOTICE_LENGTH);
@@ -12201,6 +12238,7 @@ void clif_PartyRecruitDeleteNotify(struct map_session_data* sd, int index)
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+1];
+ nullpo_retv(sd);
WBUFW(buf, 0) = 0x8ee;
WBUFL(buf, 2) = index;
@@ -12210,6 +12248,7 @@ void clif_PartyRecruitDeleteNotify(struct map_session_data* sd, int index)
#endif
}
+void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add to filtering list (PARTY_RECRUIT_ADD_FILTERLINGLIST).
/// 08ef <index>.L
void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_data *sd)
@@ -12223,6 +12262,7 @@ void clif_parse_PartyBookingAddFilteringList(int fd, struct map_session_data *sd
#endif
}
+void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to remove from filtering list (PARTY_RECRUIT_SUB_FILTERLINGLIST).
/// 08f0 <GID>.L
void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_data *sd)
@@ -12236,6 +12276,7 @@ void clif_parse_PartyBookingSubFilteringList(int fd, struct map_session_data *sd
#endif
}
+void clif_parse_PartyBookingReqVolunteer(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to recruit volunteer (PARTY_RECRUIT_REQ_VOLUNTEER).
/// 08f1 <index>.L
void clif_parse_PartyBookingReqVolunteer(int fd, struct map_session_data *sd)
@@ -12256,6 +12297,7 @@ void clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd)
#ifdef PARTY_RECRUIT
unsigned char buf[2+4+4+2+24+1];
+ nullpo_retv(sd);
WBUFW(buf, 0) = 0x8f2;
WBUFL(buf, 2) = sd->status.account_id;
WBUFL(buf, 6) = sd->status.class_;
@@ -12274,21 +12316,25 @@ void clif_PartyBookingPersonalSetting(int fd, struct map_session_data *sd)
{
}
+void clif_parse_PartyBookingShowEquipment(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08f4 <target GID>.L
void clif_parse_PartyBookingShowEquipment(int fd, struct map_session_data *sd)
{
}
+void clif_parse_PartyBookingReqRecall(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08f5 <packet len>.W
void clif_parse_PartyBookingReqRecall(int fd, struct map_session_data *sd)
{
}
+void clif_PartyBookingRecallCost(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08f6 <money>.L <map name>.16B
void clif_PartyBookingRecallCost(int fd, struct map_session_data *sd)
{
}
+void clif_parse_PartyBookingAckRecall(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08f7 <result>.B
void clif_parse_PartyBookingAckRecall(int fd, struct map_session_data *sd)
{
@@ -12301,11 +12347,13 @@ void clif_parse_PartyBookingAckRecall(int fd, struct map_session_data *sd)
/// REASON_REFUSE = 0x2
/// REASON_NOT_PARTY_MEMBER = 0x3
/// REASON_ETC = 0x4
+void clif_PartyBookingFailedRecall(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_PartyBookingFailedRecall(int fd, struct map_session_data *sd)
{
}
#endif //if 0
+void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08f9 <refuse AID>.L
void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_data *sd)
{
@@ -12318,6 +12366,7 @@ void clif_parse_PartyBookingRefuseVolunteer(int fd, struct map_session_data *sd)
#endif
}
+void clif_PartyBookingRefuseVolunteer(unsigned int aid, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08fa <index>.L
void clif_PartyBookingRefuseVolunteer(unsigned int aid, struct map_session_data *sd)
{
@@ -12333,6 +12382,7 @@ void clif_PartyBookingRefuseVolunteer(unsigned int aid, struct map_session_data
#endif
}
+void clif_parse_PartyBookingCancelVolunteer(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// 08fb <index>.L
void clif_parse_PartyBookingCancelVolunteer(int fd, struct map_session_data *sd)
{
@@ -12351,6 +12401,7 @@ void clif_PartyBookingCancelVolunteer(int index, struct map_session_data *sd)
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+1];
+ nullpo_retv(sd);
WBUFW(buf, 0) = 0x909;
WBUFL(buf, 2) = index;
@@ -12366,6 +12417,7 @@ void clif_PartyBookingAddFilteringList(int index, struct map_session_data *sd)
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+24+1];
+ nullpo_retv(sd);
WBUFW(buf, 0) = 0x90b;
WBUFL(buf, 2) = sd->bl.id;
memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH);
@@ -12382,6 +12434,7 @@ void clif_PartyBookingSubFilteringList(int gid, struct map_session_data *sd)
#ifdef PARTY_RECRUIT
unsigned char buf[2+6+24+1];
+ nullpo_retv(sd);
WBUFW(buf, 0) = 0x90c;
WBUFL(buf, 2) = gid;
memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH);
@@ -12404,6 +12457,7 @@ void clif_PartyBookingRefuseVolunteerToPM(struct map_session_data *sd)
}
#endif //if 0
+void clif_parse_CloseVending(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to close own vending (CZ_REQ_CLOSESTORE).
/// 012e
void clif_parse_CloseVending(int fd, struct map_session_data* sd)
@@ -12411,7 +12465,7 @@ void clif_parse_CloseVending(int fd, struct map_session_data* sd)
vending->close(sd);
}
-
+void clif_parse_VendingListReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to open a vending shop (CZ_REQ_BUY_FROMMC).
/// 0130 <account id>.L
void clif_parse_VendingListReq(int fd, struct map_session_data* sd)
@@ -12422,7 +12476,7 @@ void clif_parse_VendingListReq(int fd, struct map_session_data* sd)
vending->list(sd,RFIFOL(fd,2));
}
-
+void clif_parse_PurchaseReq(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Shop item(s) purchase request (CZ_PC_PURCHASE_ITEMLIST_FROMMC).
/// 0134 <packet len>.W <account id>.L { <amount>.W <index>.W }*
void clif_parse_PurchaseReq(int fd, struct map_session_data* sd)
@@ -12437,7 +12491,7 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data* sd)
sd->vended_id = 0;
}
-
+void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Shop item(s) purchase request (CZ_PC_PURCHASE_ITEMLIST_FROMMC2).
/// 0801 <packet len>.W <account id>.L <unique id>.L { <amount>.W <index>.W }*
void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd)
@@ -12453,7 +12507,7 @@ void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd)
sd->vended_id = 0;
}
-
+void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Confirm or cancel the shop preparation window.
/// 012f <packet len>.W <shop name>.80B { <index>.W <amount>.W <price>.L }* (CZ_REQ_OPENSTORE)
/// 01b2 <packet len>.W <shop name>.80B <result>.B { <index>.W <amount>.W <price>.L }* (CZ_REQ_OPENSTORE2)
@@ -12475,7 +12529,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
clif->message (sd->fd, msg_sd(sd,276)); // "You can't open a shop on this map"
return;
}
- if( map->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) ) {
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING)) {
clif->message (sd->fd, msg_sd(sd,204)); // "You can't open a shop on this cell."
return;
}
@@ -12486,6 +12540,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
vending->open(sd, message, data, len/8);
}
+void clif_parse_CreateGuild(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild creation request (CZ_REQ_MAKE_GUILD).
/// 0165 <char id>.L <guild name>.24B
void clif_parse_CreateGuild(int fd,struct map_session_data *sd) {
@@ -12501,7 +12556,7 @@ void clif_parse_CreateGuild(int fd,struct map_session_data *sd) {
guild->create(sd, name);
}
-
+void clif_parse_GuildCheckMaster(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request for guild window interface permissions (CZ_REQ_GUILD_MENUINTERFACE).
/// 014d
void clif_parse_GuildCheckMaster(int fd, struct map_session_data *sd)
@@ -12509,7 +12564,7 @@ void clif_parse_GuildCheckMaster(int fd, struct map_session_data *sd)
clif->guild_masterormember(sd);
}
-
+void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request for guild window information (CZ_REQ_GUILD_MENU).
/// 014f <type>.L
/// type:
@@ -12550,7 +12605,7 @@ void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to update guild positions (CZ_REG_CHANGE_GUILD_POSITIONINFO).
/// 0161 <packet len>.W { <position id>.L <mode>.L <ranking>.L <pay rate>.L <name>.24B }*
void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
@@ -12565,7 +12620,7 @@ void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to update the position of guild members (CZ_REQ_CHANGE_MEMBERPOS).
/// 0155 <packet len>.W { <account id>.L <char id>.L <position id>.L }*
void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd)
@@ -12581,7 +12636,7 @@ void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request for guild emblem data (CZ_REQ_GUILD_EMBLEM_IMG).
/// 0151 <guild id>.L
void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd)
@@ -12619,6 +12674,7 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
unsigned long buf_len = sizeof(buf);
int header = 0, bitmap = 0, offbits = 0, palettesize = 0;
+ nullpo_retr(false, emblem);
if( decode_zip(buf, &buf_len, emblem, emblem_len) != 0 || buf_len < BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE
|| RBUFW(buf,0) != 0x4d42 // BITMAPFILEHEADER.bfType (signature)
|| RBUFL(buf,2) != buf_len // BITMAPFILEHEADER.bfSize (file size)
@@ -12716,7 +12772,7 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
return true;
}
-
+void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to update the guild emblem (CZ_REGISTER_GUILD_EMBLEM_IMG).
/// 0153 <packet len>.W <emblem data>.?B
void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
@@ -12736,7 +12792,7 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
guild->change_emblem(sd, emblem_len, (const char*)emblem);
}
-
+void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Guild notice update request (CZ_GUILD_NOTICE).
/// 016e <guild id>.L <msg1>.60B <msg2>.120B
void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd)
@@ -12761,6 +12817,8 @@ bool clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_sessi
if ( t_sd == NULL )// not online or does not exist
return false;
+ nullpo_retr(false, sd);
+ nullpo_retr(false, t_sd);
if ( map->list[sd->bl.m].flag.guildlock ) {
//Guild locked.
clif->message(fd, msg_fd(fd,228));
@@ -12776,6 +12834,7 @@ bool clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_sessi
return true;
}
+void clif_parse_GuildInvite(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild invite request (CZ_REQ_JOIN_GUILD).
/// 0168 <account id>.L <inviter account id>.L <inviter char id>.L
void clif_parse_GuildInvite(int fd,struct map_session_data *sd) {
@@ -12785,15 +12844,20 @@ void clif_parse_GuildInvite(int fd,struct map_session_data *sd) {
return;
}
+void clif_parse_GuildInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild invite request (/guildinvite) (CZ_REQ_JOIN_GUILD2).
/// 0916 <char name>.24B
void clif_parse_GuildInvite2(int fd, struct map_session_data *sd) {
- struct map_session_data *t_sd = map->nick2sd((char *)RFIFOP(fd, 2));
+ char *nick = (char*)RFIFOP(fd, 2);
+ struct map_session_data *t_sd = map->nick2sd(nick);
+
+ nick[NAME_LENGTH - 1] = '\0';
if (!clif_sub_guild_invite(fd, sd, t_sd))
return;
}
+void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to guild invitation (CZ_JOIN_GUILD).
/// 016b <guild id>.L <answer>.L
/// answer:
@@ -12804,7 +12868,7 @@ void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd)
guild->reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
-
+void clif_parse_GuildLeave(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to leave guild (CZ_REQ_LEAVE_GUILD).
/// 0159 <guild id>.L <account id>.L <char id>.L <reason>.40B
void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
@@ -12821,7 +12885,7 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
guild->leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
-
+void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to expel a member of a guild (CZ_REQ_BAN_GUILD).
/// 015b <guild id>.L <account id>.L <char id>.L <reason>.40B
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) {
@@ -12833,7 +12897,7 @@ void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) {
guild->expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
-
+void clif_parse_GuildMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Validates and processes guild messages (CZ_GUILD_CHAT).
/// 017e <packet len>.W <text>.?B (<name> : <message>) 00
void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
@@ -12869,7 +12933,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
guild->send_message(sd, text, textlen);
}
-
+void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild alliance request (CZ_REQ_ALLY_GUILD).
/// 0170 <account id>.L <inviter account id>.L <inviter char id>.L
void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) {
@@ -12895,7 +12959,7 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) {
guild->reqalliance(sd,t_sd);
}
-
+void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to a guild alliance request (CZ_ALLY_GUILD).
/// 0172 <inviter account id>.L <answer>.L
/// answer:
@@ -12906,7 +12970,7 @@ void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd)
guild->reply_reqalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
-
+void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to delete a guild alliance or opposition (CZ_REQ_DELETE_RELATED_GUILD).
/// 0183 <opponent guild id>.L <relation>.L
/// relation:
@@ -12924,7 +12988,7 @@ void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) {
guild->delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
-
+void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to set a guild as opposition (CZ_REQ_HOSTILE_GUILD).
/// 0180 <account id>.L
void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) {
@@ -12950,7 +13014,7 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) {
guild->opposition(sd,t_sd);
}
-
+void clif_parse_GuildBreak(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to delete own guild (CZ_REQ_DISORGANIZE_GUILD).
/// 015d <key>.40B
/// key:
@@ -12965,10 +13029,10 @@ void clif_parse_GuildBreak(int fd, struct map_session_data *sd) {
guild->dobreak(sd,(char*)RFIFOP(fd,2));
}
-
/// Pet
///
+void clif_parse_PetMenu(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to invoke a pet menu action (CZ_COMMAND_PET).
/// 01a1 <type>.B
/// type:
@@ -12982,7 +13046,7 @@ void clif_parse_PetMenu(int fd, struct map_session_data *sd)
pet->menu(sd,RFIFOB(fd,2));
}
-
+void clif_parse_CatchPet(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Attempt to tame a monster (CZ_TRYCAPTURE_MONSTER).
/// 019f <id>.L
void clif_parse_CatchPet(int fd, struct map_session_data *sd)
@@ -12990,7 +13054,7 @@ void clif_parse_CatchPet(int fd, struct map_session_data *sd)
pet->catch_process2(sd,RFIFOL(fd,2));
}
-
+void clif_parse_SelectEgg(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to pet incubator egg selection dialog (CZ_SELECT_PETEGG).
/// 01a7 <index>.W
void clif_parse_SelectEgg(int fd, struct map_session_data *sd)
@@ -13002,7 +13066,7 @@ void clif_parse_SelectEgg(int fd, struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
+void clif_parse_SendEmotion(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to display pet's emotion/talk (CZ_PET_ACT).
/// 01a9 <data>.L
/// data:
@@ -13033,7 +13097,7 @@ void clif_parse_SendEmotion(int fd, struct map_session_data *sd)
clif->pet_emotion(sd->pd,RFIFOL(fd,2));
}
-
+void clif_parse_ChangePetName(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change pet's name (CZ_RENAME_PET).
/// 01a5 <name>.24B
void clif_parse_ChangePetName(int fd, struct map_session_data *sd)
@@ -13041,7 +13105,7 @@ void clif_parse_ChangePetName(int fd, struct map_session_data *sd)
pet->change_name(sd,(char*)RFIFOP(fd,2));
}
-
+void clif_parse_GMKick(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /kill (CZ_DISCONNECT_CHARACTER).
/// Request to disconnect a character.
/// 00cc <account id>.L
@@ -13100,7 +13164,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) {
}
}
-
+void clif_parse_GMKickAll(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /killall (CZ_DISCONNECT_ALL_CHARACTER).
/// Request to disconnect all characters.
/// 00ce
@@ -13110,7 +13174,7 @@ void clif_parse_GMKickAll(int fd, struct map_session_data* sd) {
atcommand->exec(fd, sd, cmd, true);
}
-
+void clif_parse_GMShift(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /remove (CZ_REMOVE_AID).
/// Request to warp to a character with given login ID.
/// 01ba <account name>.24B
@@ -13130,7 +13194,7 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd)
atcommand->exec(fd, sd, command, true);
}
-
+void clif_parse_GMRemove2(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /remove (CZ_REMOVE_AID_SSO).
/// Request to warp to a character with given account ID.
/// 0843 <account id>.L
@@ -13146,7 +13210,7 @@ void clif_parse_GMRemove2(int fd, struct map_session_data* sd) {
}
}
-
+void clif_parse_GMRecall(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /recall (CZ_RECALL).
/// Request to summon a player with given login ID to own position.
/// 01bc <account name>.24B
@@ -13166,7 +13230,7 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd)
atcommand->exec(fd, sd, command, true);
}
-
+void clif_parse_GMRecall2(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /recall (CZ_RECALL_SSO).
/// Request to summon a player with given account ID to own position.
/// 0842 <account id>.L
@@ -13182,7 +13246,7 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd) {
}
}
-
+void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /item /monster (CZ_ITEM_CREATE).
/// Request to execute GM commands.
/// usage:
@@ -13252,7 +13316,7 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) {
}
}
-
+void clif_parse_GMHide(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /hide (CZ_CHANGE_EFFECTSTATE).
/// 019d <effect state>.L
/// effect state:
@@ -13265,7 +13329,7 @@ void clif_parse_GMHide(int fd, struct map_session_data *sd) {
atcommand->exec(fd, sd, cmd, true);
}
-
+void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to adjust player's manner points (CZ_REQ_GIVE_MANNER_POINT).
/// 0149 <account id>.L <type>.B <value>.W
/// type:
@@ -13319,7 +13383,7 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd) {
atcommand->exec(fd, sd, command, true);
}
-
+void clif_parse_GMRc(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /rc (CZ_REQ_GIVE_MANNER_BYNAME).
/// GM adjustment of a player's manner value by -60.
/// 0212 <char name>.24B
@@ -13333,12 +13397,13 @@ void clif_parse_GMRc(int fd, struct map_session_data* sd)
atcommand->exec(fd, sd, command, true);
}
-
/// Result of request to resolve account name (ZC_ACK_ACCOUNTNAME).
/// 01e0 <account id>.L <account name>.24B
void clif_account_name(struct map_session_data* sd, int account_id, const char* accname) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x1e0));
WFIFOW(fd,0) = 0x1e0;
WFIFOL(fd,2) = account_id;
@@ -13346,7 +13411,7 @@ void clif_account_name(struct map_session_data* sd, int account_id, const char*
WFIFOSET(fd,packet_len(0x1e0));
}
-
+void clif_parse_GMReqAccountName(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// GM requesting account name (for right-click gm menu) (CZ_REQ_ACCOUNTNAME).
/// 01df <account id>.L
void clif_parse_GMReqAccountName(int fd, struct map_session_data *sd)
@@ -13357,7 +13422,7 @@ void clif_parse_GMReqAccountName(int fd, struct map_session_data *sd)
clif->account_name(sd, account_id, ""); // insert account name here >_<
}
-
+void clif_parse_GMChangeMapType(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /changemaptype <x> <y> <type> (CZ_CHANGE_MAPTYPE).
/// GM single cell type change request.
/// 0198 <x>.W <y>.W <type>.W
@@ -13379,7 +13444,7 @@ void clif_parse_GMChangeMapType(int fd, struct map_session_data *sd) {
//FIXME: once players leave the map, the client 'forgets' this information.
}
-
+void clif_parse_PMIgnore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// /in /ex (CZ_SETTING_WHISPER_PC).
/// Request to allow/deny whispers from a nick.
/// 00cf <nick>.24B <type>.B
@@ -13432,7 +13497,7 @@ void clif_parse_PMIgnore(int fd, struct map_session_data* sd) {
clif->wisexin(sd, type, 0); // success
}
-
+void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /inall /exall (CZ_SETTING_WHISPER_STATE).
/// Request to allow/deny all whispers.
/// 00d0 <type>.B
@@ -13468,12 +13533,13 @@ void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd)
clif->wisall(sd, type, flag);
}
-
/// Whisper ignore list (ZC_WHISPER_LIST).
/// 00d4 <packet len>.W { <char name>.24B }*
void clif_PMIgnoreList(struct map_session_data* sd) {
- int i, fd = sd->fd;
+ int i, fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,4+ARRAYLENGTH(sd->ignore)*NAME_LENGTH);
WFIFOW(fd,0) = 0xd4;
@@ -13485,7 +13551,7 @@ void clif_PMIgnoreList(struct map_session_data* sd) {
WFIFOSET(fd,WFIFOW(fd,2));
}
-
+void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Whisper ignore list request (CZ_REQ_WHISPER_LIST).
/// 00d3
void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd)
@@ -13493,7 +13559,7 @@ void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd)
clif->PMIgnoreList(sd);
}
-
+void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to invoke the /doridori recovery bonus (CZ_DORIDORI).
/// 01e7
void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
@@ -13512,7 +13578,7 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to invoke the effect of super novice's guardian angel prayer (CZ_CHOPOKGI).
/// 01ed
/// Note: This packet is caused by 7 lines of any text, followed by
@@ -13541,7 +13607,6 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
}
}
-
/// Friends List
///
@@ -13551,8 +13616,10 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
/// 0 = online
/// 1 = offline
void clif_friendslist_toggle(struct map_session_data *sd,int account_id, int char_id, int online) {
- int i, fd = sd->fd;
+ int i, fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
//Seek friend.
for (i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id &&
(sd->status.friends[i].char_id != char_id || sd->status.friends[i].account_id != account_id); i++);
@@ -13568,7 +13635,6 @@ void clif_friendslist_toggle(struct map_session_data *sd,int account_id, int cha
WFIFOSET(fd, packet_len(0x206));
}
-
//Sub-function called from clif_foreachclient to toggle friends on/off [Skotlex]
int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap)
{
@@ -13580,13 +13646,13 @@ int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap)
return 0;
}
-
/// Sends the whole friends list (ZC_FRIENDS_LIST).
/// 0201 <packet len>.W { <account id>.L <char id>.L <name>.24B }*
void clif_friendslist_send(struct map_session_data *sd)
{
int i = 0, n, fd = sd->fd;
+ nullpo_retv(sd);
// Send friends list
WFIFOHEAD(fd, MAX_FRIENDS * 32 + 4);
WFIFOW(fd, 0) = 0x201;
@@ -13607,7 +13673,6 @@ void clif_friendslist_send(struct map_session_data *sd)
}
}
-
/// Notification about the result of a friend add request (ZC_ADD_FRIENDS_LIST).
/// 0209 <result>.W <account id>.L <char id>.L <name>.24B
/// result:
@@ -13632,12 +13697,13 @@ void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_dat
WFIFOSET(fd, packet_len(0x209));
}
-
/// Asks a player for permission to be added as friend (ZC_REQ_ADD_FRIENDS).
/// 0207 <req account id>.L <req char id>.L <req char name>.24B
void clif_friendlist_req(struct map_session_data* sd, int account_id, int char_id, const char* name) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x207));
WFIFOW(fd,0) = 0x207;
WFIFOL(fd,2) = account_id;
@@ -13646,14 +13712,16 @@ void clif_friendlist_req(struct map_session_data* sd, int account_id, int char_i
WFIFOSET(fd,packet_len(0x207));
}
-
+void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add a player as friend (CZ_ADD_FRIENDS).
/// 0202 <name>.24B
void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) {
struct map_session_data *f_sd;
int i;
+ char *nick = (char*)RFIFOP(fd,2);
- f_sd = map->nick2sd((char*)RFIFOP(fd,2));
+ nick[NAME_LENGTH - 1] = '\0';
+ f_sd = map->nick2sd(nick);
// ensure that the request player's friend list is not full
ARR_FIND(0, MAX_FRIENDS, i, sd->status.friends[i].char_id == 0);
@@ -13693,7 +13761,7 @@ void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) {
clif->friendlist_req(f_sd, sd->status.account_id, sd->status.char_id, sd->status.name);
}
-
+void clif_parse_FriendsListReply(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to a friend add request (CZ_ACK_REQ_ADD_FRIENDS).
/// 0208 <inviter account id>.L <inviter char id>.L <result>.B
/// 0208 <inviter account id>.L <inviter char id>.L <result>.L (PACKETVER >= 6)
@@ -13761,7 +13829,7 @@ void clif_parse_FriendsListReply(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to delete a friend (CZ_DELETE_FRIENDS).
/// 0203 <account id>.L <char id>.L
void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd)
@@ -13825,12 +13893,13 @@ void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd)
WFIFOSET(fd, packet_len(0x20a));
}
-
/// /pvpinfo list (ZC_ACK_PVPPOINT).
/// 0210 <char id>.L <account id>.L <win point>.L <lose point>.L <point>.L
void clif_PVPInfo(struct map_session_data* sd) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x210));
WFIFOW(fd,0) = 0x210;
WFIFOL(fd,2) = sd->status.char_id;
@@ -13841,7 +13910,7 @@ void clif_PVPInfo(struct map_session_data* sd) {
WFIFOSET(fd, packet_len(0x210));
}
-
+void clif_parse_PVPInfo(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// /pvpinfo (CZ_REQ_PVPPOINT).
/// 020f <char id>.L <account id>.L
void clif_parse_PVPInfo(int fd,struct map_session_data *sd)
@@ -13858,6 +13927,7 @@ void clif_ranklist_sub(unsigned char *buf, enum fame_list_type type) {
struct fame_list* list;
int i;
+ nullpo_retv(buf);
switch( type ) {
case RANKTYPE_BLACKSMITH: list = pc->smith_fame_list; break;
case RANKTYPE_ALCHEMIST: list = pc->chemist_fame_list; break;
@@ -13886,10 +13956,13 @@ 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) {
- int fd = sd->fd;
+ int fd;
int mypoint = 0;
- int upperMask = sd->class_&MAPID_UPPERMASK;
+ int upperMask;
+ nullpo_retv(sd);
+ fd = sd->fd;
+ upperMask = sd->class_&MAPID_UPPERMASK;
WFIFOHEAD(fd, 288);
WFIFOW(fd, 0) = 0x97d;
WFIFOW(fd, 2) = type;
@@ -13908,6 +13981,7 @@ void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
WFIFOSET(fd, 288);
}
+void clif_parse_ranklist(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/*
* 097c <type> (CZ_REQ_RANKING)
* */
@@ -13932,7 +14006,11 @@ void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type t
case RANKTYPE_TAEKWON: clif->fame_taekwon(sd,points); break;
}
#else
- int fd = sd->fd;
+
+ int fd;
+
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, 12);
WFIFOW(fd, 0) = 0x97e;
WFIFOW(fd, 2) = type;
@@ -13945,14 +14023,17 @@ void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type t
/// /blacksmith list (ZC_BLACKSMITH_RANK).
/// 0219 { <name>.24B }*10 { <point>.L }*10
void clif_blacksmith(struct map_session_data* sd) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x219));
WFIFOW(fd,0) = 0x219;
clif_ranklist_sub(WFIFOP(fd, 2), RANKTYPE_BLACKSMITH);
WFIFOSET(fd, packet_len(0x219));
}
+void clif_parse_Blacksmith(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// /blacksmith (CZ_BLACKSMITH_RANK).
/// 0217
void clif_parse_Blacksmith(int fd,struct map_session_data *sd) {
@@ -13962,8 +14043,10 @@ void clif_parse_Blacksmith(int fd,struct map_session_data *sd) {
/// Notification about backsmith points (ZC_BLACKSMITH_POINT).
/// 021b <points>.L <total points>.L
void clif_fame_blacksmith(struct map_session_data *sd, int points) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x21b));
WFIFOW(fd,0) = 0x21b;
WFIFOL(fd,2) = points;
@@ -13974,14 +14057,17 @@ void clif_fame_blacksmith(struct map_session_data *sd, int points) {
/// /alchemist list (ZC_ALCHEMIST_RANK).
/// 021a { <name>.24B }*10 { <point>.L }*10
void clif_alchemist(struct map_session_data* sd) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x21a));
WFIFOW(fd,0) = 0x21a;
clif_ranklist_sub(WFIFOP(fd,2), RANKTYPE_ALCHEMIST);
WFIFOSET(fd, packet_len(0x21a));
}
+void clif_parse_Alchemist(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// /alchemist (CZ_ALCHEMIST_RANK).
/// 0218
void clif_parse_Alchemist(int fd,struct map_session_data *sd) {
@@ -13991,8 +14077,10 @@ void clif_parse_Alchemist(int fd,struct map_session_data *sd) {
/// Notification about alchemist points (ZC_ALCHEMIST_POINT).
/// 021c <points>.L <total points>.L
void clif_fame_alchemist(struct map_session_data *sd, int points) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x21c));
WFIFOW(fd,0) = 0x21c;
WFIFOL(fd,2) = points;
@@ -14003,14 +14091,17 @@ void clif_fame_alchemist(struct map_session_data *sd, int points) {
/// /taekwon list (ZC_TAEKWON_RANK).
/// 0226 { <name>.24B }*10 { <point>.L }*10
void clif_taekwon(struct map_session_data* sd) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x226));
WFIFOW(fd,0) = 0x226;
clif_ranklist_sub(WFIFOP(fd,2), RANKTYPE_TAEKWON);
WFIFOSET(fd, packet_len(0x226));
}
+void clif_parse_Taekwon(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// /taekwon (CZ_TAEKWON_RANK).
/// 0225
void clif_parse_Taekwon(int fd,struct map_session_data *sd) {
@@ -14020,8 +14111,10 @@ void clif_parse_Taekwon(int fd,struct map_session_data *sd) {
/// Notification about taekwon points (ZC_TAEKWON_POINT).
/// 0224 <points>.L <total points>.L
void clif_fame_taekwon(struct map_session_data *sd, int points) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x224));
WFIFOW(fd,0) = 0x224;
WFIFOL(fd,2) = points;
@@ -14032,8 +14125,10 @@ void clif_fame_taekwon(struct map_session_data *sd, int points) {
/// /pk list (ZC_KILLER_RANK).
/// 0238 { <name>.24B }*10 { <point>.L }*10
void clif_ranking_pk(struct map_session_data* sd) {
- int i, fd = sd->fd;
+ int i, fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x238));
WFIFOW(fd,0) = 0x238;
for (i = 0; i < 10;i ++) {
@@ -14043,14 +14138,14 @@ void clif_ranking_pk(struct map_session_data* sd) {
WFIFOSET(fd, packet_len(0x238));
}
-
+void clif_parse_RankingPk(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// /pk (CZ_KILLER_RANK).
/// 0237
void clif_parse_RankingPk(int fd,struct map_session_data *sd) {
clif->ranking_pk(sd);
}
-
+void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// SG Feel save OK [Komurka] (CZ_AGREE_STARPLACE).
/// 0254 <which>.B
/// which:
@@ -14077,7 +14172,6 @@ void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
-
/// Star Gladiator's Feeling map confirmation prompt (ZC_STARPLACE).
/// 0253 <which>.B
/// which:
@@ -14086,6 +14180,7 @@ void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd)
/// 2 = star
void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv)
{
+ nullpo_retv(sd);
WFIFOHEAD(fd,packet_len(0x253));
WFIFOW(fd,0)=0x253;
WFIFOB(fd,2)=TOB(skill_lv-1);
@@ -14094,14 +14189,14 @@ void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv)
sd->menuskill_val = skill_lv;
}
-
+void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change homunculus' name (CZ_RENAME_MER).
/// 0231 <name>.24B
void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) {
homun->change_name(sd,(char*)RFIFOP(fd,2));
}
-
+void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to warp/move homunculus/mercenary to it's owner (CZ_REQUEST_MOVETOOWNER).
/// 0234 <id>.L
void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd)
@@ -14110,9 +14205,9 @@ void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd)
struct block_list *bl = NULL;
struct unit_data *ud = NULL;
- if( sd->md && sd->md->bl.id == id )
+ if (sd->md && sd->md->bl.id == id)
bl = &sd->md->bl;
- else if( homun_alive(sd->hd) && sd->hd->bl.id == id )
+ else if (homun_alive(sd->hd) && sd->hd->bl.id == id)
bl = &sd->hd->bl; // Moving Homunculus
else
return;
@@ -14122,7 +14217,7 @@ void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd)
unit->walktoxy(bl, ud->to_x, ud->to_y, 4);
}
-
+void clif_parse_HomMoveTo(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to move homunculus/mercenary (CZ_REQUEST_MOVENPC).
/// 0232 <id>.L <position data>.3B
void clif_parse_HomMoveTo(int fd, struct map_session_data *sd)
@@ -14143,7 +14238,7 @@ void clif_parse_HomMoveTo(int fd, struct map_session_data *sd)
unit->walktoxy(bl, x, y, 4);
}
-
+void clif_parse_HomAttack(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to do an action with homunculus/mercenary (CZ_REQUEST_ACTNPC).
/// 0233 <id>.L <target id>.L <action>.B
/// action:
@@ -14165,7 +14260,7 @@ void clif_parse_HomAttack(int fd,struct map_session_data *sd)
unit->attack(bl, target_id, action_type != 0);
}
-
+void clif_parse_HomMenu(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to invoke a homunculus menu action (CZ_COMMAND_MER).
/// 022d <type>.W <command>.B
/// type:
@@ -14185,7 +14280,7 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd) { //[orn]
homun->menu(sd,RFIFOB(fd,packet_db[cmd].pos[1]));
}
-
+void clif_parse_AutoRevive(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to resurrect oneself using Token of Siegfried (CZ_STANDING_RESURRECTION).
/// 0292
void clif_parse_AutoRevive(int fd, struct map_session_data *sd) {
@@ -14213,7 +14308,6 @@ void clif_parse_AutoRevive(int fd, struct map_session_data *sd) {
clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
}
-
/// Information about character's status values (ZC_ACK_STATUS_GM).
/// 0214 <str>.B <standardStr>.B <agi>.B <standardAgi>.B <vit>.B <standardVit>.B
/// <int>.B <standardInt>.B <dex>.B <standardDex>.B <luk>.B <standardLuk>.B
@@ -14222,6 +14316,7 @@ void clif_parse_AutoRevive(int fd, struct map_session_data *sd) {
/// <hitSuccessValue>.W <avoidSuccessValue>.W <plusAvoidSuccessValue>.W
/// <criticalSuccessValue>.W <ASPD>.W <plusASPD>.W
void clif_check(int fd, struct map_session_data* pl_sd) {
+ nullpo_retv(pl_sd);
WFIFOHEAD(fd,packet_len(0x214));
WFIFOW(fd, 0) = 0x214;
WFIFOB(fd, 2) = min(pl_sd->status.str, UINT8_MAX);
@@ -14253,7 +14348,7 @@ void clif_check(int fd, struct map_session_data* pl_sd) {
WFIFOSET(fd,packet_len(0x214));
}
-
+void clif_parse_Check(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /check (CZ_REQ_STATUS_GM).
/// Request character's status values.
/// 0213 <char name>.24B
@@ -14274,8 +14369,6 @@ void clif_parse_Check(int fd, struct map_session_data *sd)
clif->check(fd, pl_sd);
}
-
-
/// MAIL SYSTEM
/// By Zephyrus
///
@@ -14294,7 +14387,6 @@ void clif_Mail_setattachment(int fd, int index, uint8 flag)
WFIFOSET(fd,packet_len(0x255));
}
-
/// Notification about the result of retrieving a mail attachment (ZC_MAIL_REQ_GET_ITEM).
/// 0245 <result>.B
/// result:
@@ -14309,7 +14401,6 @@ void clif_Mail_getattachment(int fd, uint8 flag)
WFIFOSET(fd,packet_len(0x245));
}
-
/// Notification about the result of sending a mail (ZC_MAIL_REQ_SEND).
/// 0249 <result>.B
/// result:
@@ -14323,7 +14414,6 @@ void clif_Mail_send(int fd, bool fail)
WFIFOSET(fd,packet_len(0x249));
}
-
/// Notification about the result of deleting a mail (ZC_ACK_MAIL_DELETE).
/// 0257 <mail id>.L <result>.W
/// result:
@@ -14338,7 +14428,6 @@ void clif_Mail_delete(int fd, int mail_id, short fail)
WFIFOSET(fd, packet_len(0x257));
}
-
/// Notification about the result of returning a mail (ZC_ACK_MAIL_RETURN).
/// 0274 <mail id>.L <result>.W
/// result:
@@ -14353,11 +14442,12 @@ void clif_Mail_return(int fd, int mail_id, short fail)
WFIFOSET(fd,packet_len(0x274));
}
-
/// Notification about new mail (ZC_MAIL_RECEIVE).
/// 024a <mail id>.L <title>.40B <sender>.24B
void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title)
{
+ nullpo_retv(sender);
+ nullpo_retv(title);
WFIFOHEAD(fd,packet_len(0x24a));
WFIFOW(fd,0) = 0x24a;
WFIFOL(fd,2) = mail_id;
@@ -14366,7 +14456,6 @@ void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title)
WFIFOSET(fd,packet_len(0x24a));
}
-
/// Opens/closes the mail window (ZC_MAIL_WINDOWS).
/// 0260 <type>.L
/// type:
@@ -14380,7 +14469,6 @@ void clif_Mail_window(int fd, int flag)
WFIFOSET(fd,packet_len(0x260));
}
-
/// Lists mails stored in inbox (ZC_MAIL_REQ_GET_LIST).
/// 0240 <packet len>.W <amount>.L { <mail id>.L <title>.40B <read>.B <sender>.24B <time>.L }*amount
/// read:
@@ -14389,10 +14477,12 @@ void clif_Mail_window(int fd, int flag)
void clif_Mail_refreshinbox(struct map_session_data *sd)
{
int fd = sd->fd;
- struct mail_data *md = &sd->mail.inbox;
+ struct mail_data *md;
struct mail_message *msg;
int len, i, j;
+ nullpo_retv(sd);
+ md = &sd->mail.inbox;
len = 8 + (73 * md->amount);
WFIFOHEAD(fd,len);
@@ -14421,7 +14511,7 @@ void clif_Mail_refreshinbox(struct map_session_data *sd)
}
}
-
+void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Mail inbox list request (CZ_MAIL_GET_LIST).
/// 023f
void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd)
@@ -14437,7 +14527,6 @@ void clif_parse_Mail_refreshinbox(int fd, struct map_session_data *sd)
mail->removezeny(sd, 0);
}
-
/// Opens a mail (ZC_MAIL_REQ_OPEN).
/// 0242 <packet len>.W <mail id>.L <title>.40B <sender>.24B <time>.L <zeny>.L
/// <amount>.L <name id>.W <item type>.W <identified>.B <damaged>.B <refine>.B
@@ -14446,6 +14535,7 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
{
int i, fd = sd->fd;
+ nullpo_retv(sd);
ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id);
if( i == MAIL_MAX_INBOX ) {
clif->mail_return(sd->fd, mail_id, 1); // Mail doesn't exist
@@ -14499,7 +14589,7 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
}
}
-
+void clif_parse_Mail_read(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to open a mail (CZ_MAIL_OPEN).
/// 0241 <mail id>.L
void clif_parse_Mail_read(int fd, struct map_session_data *sd)
@@ -14514,7 +14604,7 @@ void clif_parse_Mail_read(int fd, struct map_session_data *sd)
clif->mail_read(sd, RFIFOL(fd,2));
}
-
+void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to receive mail's attachment (CZ_MAIL_GET_ITEM).
/// 0244 <mail id>.L
void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
@@ -14576,12 +14666,13 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
sd->mail.inbox.msg[i].zeny = 0;
memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item));
- clif->mail_read(sd, mail_id);
+ mail->clear(sd);
+ clif->mail_read(sd, mail_id);
intif->Mail_getattach(sd->status.char_id, mail_id);
}
-
+void clif_parse_Mail_delete(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to delete a mail (CZ_MAIL_DELETE).
/// 0243 <mail id>.L
void clif_parse_Mail_delete(int fd, struct map_session_data *sd)
@@ -14605,11 +14696,14 @@ void clif_parse_Mail_delete(int fd, struct map_session_data *sd)
return;
}
+ sd->mail.inbox.msg[i].zeny = 0;
+ memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item));
+ mail->clear(sd);
intif->Mail_delete(sd->status.char_id, mail_id);
}
}
-
+void clif_parse_Mail_return(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to return a mail (CZ_REQ_MAIL_RETURN).
/// 0273 <mail id>.L <receive name>.24B
void clif_parse_Mail_return(int fd, struct map_session_data *sd)
@@ -14623,13 +14717,17 @@ void clif_parse_Mail_return(int fd, struct map_session_data *sd)
return;
ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id);
- if( i < MAIL_MAX_INBOX && sd->mail.inbox.msg[i].send_id != 0 )
+ if (i < MAIL_MAX_INBOX && sd->mail.inbox.msg[i].send_id != 0) {
+ sd->mail.inbox.msg[i].zeny = 0;
+ memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item));
+ mail->clear(sd);
intif->Mail_return(sd->status.char_id, mail_id);
- else
+ } else {
clif->mail_return(sd->fd, mail_id, 1);
+ }
}
-
+void clif_parse_Mail_setattach(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add an item or Zeny to mail (CZ_MAIL_ADD_ITEM).
/// 0247 <index>.W <amount>.L
void clif_parse_Mail_setattach(int fd, struct map_session_data *sd)
@@ -14647,7 +14745,7 @@ void clif_parse_Mail_setattach(int fd, struct map_session_data *sd)
clif->mail_setattachment(fd,idx,flag);
}
-
+void clif_parse_Mail_winopen(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to reset mail item and/or Zeny (CZ_MAIL_RESET_ITEM).
/// 0246 <type>.W
/// type:
@@ -14664,7 +14762,7 @@ void clif_parse_Mail_winopen(int fd, struct map_session_data *sd)
mail->removezeny(sd, 0);
}
-
+void clif_parse_Mail_send(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to send mail (CZ_MAIL_SEND).
/// 0248 <packet len>.W <recipient>.24B <title>.40B <body len>.B <body>.?B
void clif_parse_Mail_send(int fd, struct map_session_data *sd)
@@ -14724,7 +14822,6 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
sd->cansendmail_tick = timer->gettick() + 1000; // 1 Second flood Protection
}
-
/// AUCTION SYSTEM
/// By Zephyrus
///
@@ -14736,8 +14833,10 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
/// 1 = close
void clif_Auction_openwindow(struct map_session_data *sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
if (sd->state.storage_flag != STORAGE_FLAG_CLOSED || sd->state.vending || sd->state.buyingstore || sd->state.trading)
return;
@@ -14750,15 +14849,16 @@ void clif_Auction_openwindow(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x25f));
}
-
/// Returns auction item search results (ZC_AUCTION_ITEM_REQ_SEARCH).
/// 0252 <packet len>.W <pages>.L <count>.L { <auction id>.L <seller name>.24B <name id>.W <type>.L <amount>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <now price>.L <max price>.L <buyer name>.24B <delete time>.L }*
void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf)
{
- int i, fd = sd->fd, len = sizeof(struct auction_data);
+ int i, fd, len = sizeof(struct auction_data);
struct auction_data auction;
struct item_data *item;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,12 + (count * 83));
WFIFOW(fd,0) = 0x252;
WFIFOW(fd,2) = 12 + (count * 83);
@@ -14794,7 +14894,6 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages,
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Result from request to add an item (ZC_ACK_AUCTION_ADD_ITEM).
/// 0256 <index>.W <result>.B
/// result:
@@ -14808,7 +14907,7 @@ void clif_Auction_setitem(int fd, int index, bool fail) {
WFIFOSET(fd,packet_len(0x256));
}
-
+void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to initialize 'new auction' data (CZ_AUCTION_CREATE).
/// 024b <type>.W
/// type:
@@ -14823,7 +14922,7 @@ void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd)
sd->auction.amount = 0;
}
-
+void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add an item to the action (CZ_AUCTION_ADD_ITEM).
/// 024c <index>.W <count>.L
void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
@@ -14888,7 +14987,6 @@ void clif_Auction_message(int fd, unsigned char flag)
WFIFOSET(fd,packet_len(0x250));
}
-
/// Result of the auction close request (ZC_AUCTION_ACK_MY_SELL_STOP).
/// 025e <result>.W
/// result:
@@ -14903,7 +15001,7 @@ void clif_Auction_close(int fd, unsigned char flag)
WFIFOSET(fd,packet_len(0x25e));
}
-
+void clif_parse_Auction_register(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add an auction (CZ_AUCTION_ADD).
/// 024d <now money>.L <max money>.L <delete hour>.W
void clif_parse_Auction_register(int fd, struct map_session_data *sd)
@@ -14914,12 +15012,19 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
if (!battle_config.feature_auction)
return;
+ Assert_retv(sd->auction.index >= 0 && sd->auction.index < MAX_INVENTORY);
+
memset(&auction, 0, sizeof(auction));
auction.price = RFIFOL(fd,2);
auction.buynow = RFIFOL(fd,6);
auction.hours = RFIFOW(fd,10);
// Invalid Situations...
+ if (auction.price <= 0 || auction.buynow <= 0) {
+ ShowWarning("Character %s trying to register auction wit wrong price.\n", sd->status.name);
+ return;
+ }
+
if( sd->auction.amount < 1 ) {
ShowWarning("Character %s trying to register auction without item.\n", sd->status.name);
return;
@@ -14991,7 +15096,7 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_Auction_cancel(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Cancels an auction (CZ_AUCTION_ADD_CANCEL).
/// 024e <auction id>.L
void clif_parse_Auction_cancel(int fd, struct map_session_data *sd)
@@ -15001,7 +15106,7 @@ void clif_parse_Auction_cancel(int fd, struct map_session_data *sd)
intif->Auction_cancel(sd->status.char_id, auction_id);
}
-
+void clif_parse_Auction_close(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Closes an auction (CZ_AUCTION_REQ_MY_SELL_STOP).
/// 025d <auction id>.L
void clif_parse_Auction_close(int fd, struct map_session_data *sd)
@@ -15011,7 +15116,7 @@ void clif_parse_Auction_close(int fd, struct map_session_data *sd)
intif->Auction_close(sd->status.char_id, auction_id);
}
-
+void clif_parse_Auction_bid(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Places a bid on an auction (CZ_AUCTION_BUY).
/// 024f <auction id>.L <money>.L
void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
@@ -15036,7 +15141,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
}
}
-
+void clif_parse_Auction_search(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Auction Search (CZ_AUCTION_ITEM_SEARCH).
/// 0251 <search type>.W <auction id>.L <search text>.24B <page number>.W
/// search type:
@@ -15061,7 +15166,7 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd)
intif->Auction_requestlist(sd->status.char_id, type, price, search_text, page);
}
-
+void clif_parse_Auction_buysell(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Requests list of own currently active bids or auctions (CZ_AUCTION_REQ_MY_INFO).
/// 025c <type>.W
/// type:
@@ -15079,7 +15184,6 @@ void clif_parse_Auction_buysell(int fd, struct map_session_data* sd)
intif->Auction_requestlist(sd->status.char_id, type, 0, "", 1);
}
-
/// CASH/POINT SHOP
///
@@ -15146,9 +15250,11 @@ void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd) {
/// For error return codes see enum cashshop_error@clif.h
void clif_cashshop_ack(struct map_session_data* sd, int error) {
struct npc_data *nd;
- int fd = sd->fd;
+ int fd;
int currency[2] = { 0,0 };
+ nullpo_retv(sd);
+ fd = sd->fd;
if( (nd = map->id2nd(sd->npc_shopid)) && nd->subtype == SCRIPT ) {
npc->trader_count_funds(nd,sd);
currency[0] = npc->trader_funds[0];
@@ -15170,7 +15276,7 @@ void clif_cashshop_ack(struct map_session_data* sd, int error) {
WFIFOSET(fd, packet_len(0x289));
}
-
+void clif_parse_cashshop_buy(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to buy item(s) from cash shop (CZ_PC_BUY_CASH_POINT_ITEM).
/// 0288 <name id>.W <amount>.W
/// 0288 <name id>.W <amount>.W <kafra points>.L (PACKETVER >= 20070711)
@@ -15178,7 +15284,6 @@ void clif_cashshop_ack(struct map_session_data* sd, int error) {
void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
{
int fail = 0;
- nullpo_retv(sd);
if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) )
fail = 1;
@@ -15206,7 +15311,6 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
clif->cashshop_ack(sd,fail);
}
-
/// Adoption System
///
@@ -15218,20 +15322,24 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
/// 2 = "You cannot adopt a married person."
void clif_Adopt_reply(struct map_session_data *sd, int type)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,6);
WFIFOW(fd,0) = 0x216;
WFIFOL(fd,2) = type;
WFIFOSET(fd,6);
}
-
/// Adoption confirmation (ZC_REQ_BABY).
/// 01f6 <account id>.L <char id>.L <name>.B
void clif_Adopt_request(struct map_session_data *sd, struct map_session_data *src, int p_id) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ nullpo_retv(src);
+ fd = sd->fd;
WFIFOHEAD(fd,34);
WFIFOW(fd,0) = 0x1f6;
WFIFOL(fd,2) = src->status.account_id;
@@ -15240,7 +15348,7 @@ void clif_Adopt_request(struct map_session_data *sd, struct map_session_data *sr
WFIFOSET(fd,34);
}
-
+void clif_parse_Adopt_request(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to adopt a player (CZ_REQ_JOIN_BABY).
/// 01f9 <account id>.L
void clif_parse_Adopt_request(int fd, struct map_session_data *sd) {
@@ -15252,7 +15360,7 @@ void clif_parse_Adopt_request(int fd, struct map_session_data *sd) {
}
}
-
+void clif_parse_Adopt_reply(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to adopt confirmation (CZ_JOIN_BABY).
/// 01f7 <account id>.L <char id>.L <answer>.L
/// answer:
@@ -15280,7 +15388,6 @@ void clif_parse_Adopt_reply(int fd, struct map_session_data *sd) {
pc->adoption(p1_sd, p2_sd, sd);
}
-
/// Convex Mirror (ZC_BOSS_INFO).
/// 0293 <infoType>.B <x>.L <y>.L <minHours>.W <minMinutes>.W <maxHours>.W <maxMinutes>.W <monster name>.51B
/// infoType:
@@ -15322,7 +15429,7 @@ void clif_bossmapinfo(int fd, struct mob_data *md, short flag)
WFIFOSET(fd,70);
}
-
+void clif_parse_ViewPlayerEquip(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Requesting equip of a player (CZ_EQUIPWIN_MICROSCOPE).
/// 02d6 <account id>.L
void clif_parse_ViewPlayerEquip(int fd, struct map_session_data* sd) {
@@ -15338,7 +15445,7 @@ void clif_parse_ViewPlayerEquip(int fd, struct map_session_data* sd) {
clif->msgtable(sd, MSG_EQUIP_NOT_PUBLIC);
}
-
+void clif_parse_EquipTick(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to change equip window tick (CZ_CONFIG).
/// 02d8 <type>.L <value>.L
/// type:
@@ -15353,6 +15460,7 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd)
clif->equiptickack(sd, flag);
}
+void clif_parse_PartyTick(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to change party invitation tick.
/// value:
/// 0 = disabled
@@ -15375,12 +15483,16 @@ void clif_quest_send_list(struct map_session_data *sd)
int i;
#if PACKETVER >= 20141022
int info_len = 15;
- int len = sd->avail_quests*info_len+8;
+ int len;
+ nullpo_retv(sd);
+ len = sd->avail_quests*info_len+8;
WFIFOHEAD(fd,len);
WFIFOW(fd, 0) = 0x97a;
#else
int info_len = 5;
- int len = sd->avail_quests*info_len+8;
+ int len;
+ nullpo_retv(sd);
+ len = sd->avail_quests*info_len+8;
WFIFOHEAD(fd,len);
WFIFOW(fd, 0) = 0x2b1;
#endif
@@ -15399,20 +15511,20 @@ void clif_quest_send_list(struct map_session_data *sd)
WFIFOW(fd, i*info_len+21) = qi->objectives_count;
#endif
}
-
WFIFOSET(fd, len);
}
-
/// Sends list of all quest missions (ZC_ALL_QUEST_MISSION).
/// 02b2 <packet len>.W <num>.L { <quest id>.L <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3 }*num
void clif_quest_send_mission(struct map_session_data *sd)
{
int fd = sd->fd;
int i, j;
- int len = sd->avail_quests*104+8;
+ int len;
struct mob_db *monster;
+ nullpo_retv(sd);
+ len = sd->avail_quests*104+8;
WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x2b2;
WFIFOW(fd, 2) = len;
@@ -15436,15 +15548,18 @@ void clif_quest_send_mission(struct map_session_data *sd)
WFIFOSET(fd, len);
}
-
/// Notification about a new quest (ZC_ADD_QUEST).
/// 02b3 <quest id>.L <active>.B <start time>.L <expire time>.L <mobs>.W { <mob id>.L <mob count>.W <mob name>.24B }*3
void clif_quest_add(struct map_session_data *sd, struct quest *qd)
{
- int fd = sd->fd;
+ int fd;
int i;
- struct quest_db *qi = quest->db(qd->quest_id);
+ struct quest_db *qi;
+ nullpo_retv(sd);
+ nullpo_retv(qd);
+ fd = sd->fd;
+ qi = quest->db(qd->quest_id);
WFIFOHEAD(fd, packet_len(0x2b3));
WFIFOW(fd, 0) = 0x2b3;
WFIFOL(fd, 2) = qd->quest_id;
@@ -15464,27 +15579,33 @@ void clif_quest_add(struct map_session_data *sd, struct quest *qd)
WFIFOSET(fd, packet_len(0x2b3));
}
-
/// Notification about a quest being removed (ZC_DEL_QUEST).
/// 02b4 <quest id>.L
void clif_quest_delete(struct map_session_data *sd, int quest_id) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x2b4));
WFIFOW(fd, 0) = 0x2b4;
WFIFOL(fd, 2) = quest_id;
WFIFOSET(fd, packet_len(0x2b4));
}
-
/// Notification of an update to the hunting mission counter (ZC_UPDATE_MISSION_HUNT).
/// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3
void clif_quest_update_objective(struct map_session_data *sd, struct quest *qd)
{
- int fd = sd->fd;
+ int fd;
int i;
- struct quest_db *qi = quest->db(qd->quest_id);
- int len = qi->objectives_count*12+6;
+ struct quest_db *qi;
+ int len;
+
+ nullpo_retv(sd);
+ nullpo_retv(qd);
+ fd = sd->fd;
+ qi = quest->db(qd->quest_id);
+ len = qi->objectives_count * 12 + 6;
WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x2b5;
@@ -15501,19 +15622,20 @@ void clif_quest_update_objective(struct map_session_data *sd, struct quest *qd)
WFIFOSET(fd, len);
}
-
+void clif_parse_questStateAck(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change the state of a quest (CZ_ACTIVE_QUEST).
/// 02b6 <quest id>.L <active>.B
void clif_parse_questStateAck(int fd, struct map_session_data *sd) {
quest->update_status(sd, RFIFOL(fd,2), RFIFOB(fd,6)?Q_ACTIVE:Q_INACTIVE);
}
-
/// Notification about the change of a quest state (ZC_ACTIVE_QUEST).
/// 02b7 <quest id>.L <active>.B
void clif_quest_update_status(struct map_session_data *sd, int quest_id, bool active) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x2b7));
WFIFOW(fd, 0) = 0x2b7;
WFIFOL(fd, 2) = quest_id;
@@ -15521,7 +15643,6 @@ void clif_quest_update_status(struct map_session_data *sd, int quest_id, bool ac
WFIFOSET(fd, packet_len(0x2b7));
}
-
/// Notification about an NPC's quest state (ZC_QUEST_NOTIFY_EFFECT).
/// 0446 <npc id>.L <x>.W <y>.W <effect>.W <type>.W
/// effect:
@@ -15536,8 +15657,11 @@ void clif_quest_update_status(struct map_session_data *sd, int quest_id, bool ac
void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color)
{
#if PACKETVER >= 20090218
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ nullpo_retv(bl);
+ fd = sd->fd;
WFIFOHEAD(fd, packet_len(0x446));
WFIFOW(fd, 0) = 0x446;
WFIFOL(fd, 2) = bl->id;
@@ -15549,7 +15673,6 @@ void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, s
#endif
}
-
/// Mercenary System
///
@@ -15617,7 +15740,6 @@ void clif_mercenary_updatestatus(struct map_session_data *sd, int type) {
WFIFOSET(fd,packet_len(0x2a2));
}
-
/// Mercenary base status data (ZC_MER_INIT).
/// 029b <id>.L <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W
/// <name>.24B <level>.W <hp>.L <maxhp>.L <sp>.L <maxsp>.L <expire time>.L <faith>.W
@@ -15676,7 +15798,6 @@ void clif_mercenary_info(struct map_session_data *sd) {
WFIFOSET(fd,packet_len(0x29b));
}
-
/// Mercenary skill tree (ZC_MER_SKILLINFO_LIST).
/// 029d <packet len>.W { <skill id>.W <type>.L <level>.W <sp cost>.W <attack range>.W <skill name>.24B <upgradeable>.B }*
void clif_mercenary_skillblock(struct map_session_data *sd)
@@ -15714,7 +15835,7 @@ void clif_mercenary_skillblock(struct map_session_data *sd)
WFIFOSET(fd,len);
}
-
+void clif_parse_mercenary_action(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to invoke a mercenary menu action (CZ_MER_COMMAND).
/// 029f <command>.B
/// 1 = mercenary information
@@ -15729,7 +15850,6 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd)
mercenary->delete(sd->md, 2);
}
-
/// Mercenary Message
/// message:
/// 0 = Mercenary soldier's duty hour is over.
@@ -15741,7 +15861,6 @@ void clif_mercenary_message(struct map_session_data* sd, int message)
clif->msgtable(sd, MSG_MERCENARY_EXPIRED + message);
}
-
/// Notification about the remaining time of a rental item (ZC_CASH_TIME_COUNTER).
/// 0298 <name id>.W <seconds>.L
void clif_rental_time(int fd, int nameid, int seconds)
@@ -15753,7 +15872,6 @@ void clif_rental_time(int fd, int nameid, int seconds)
WFIFOSET(fd,packet_len(0x298));
}
-
/// Deletes a rental item from client's inventory (ZC_CASH_ITEM_DELETE).
/// 0299 <index>.W <name id>.W
void clif_rental_expired(int fd, int index, int nameid)
@@ -15765,7 +15883,6 @@ void clif_rental_expired(int fd, int index, int nameid)
WFIFOSET(fd,packet_len(0x299));
}
-
/// Book Reading (ZC_READ_BOOK).
/// 0294 <book id>.L <page>.L
void clif_readbook(int fd, int book_id, int page)
@@ -15777,7 +15894,6 @@ void clif_readbook(int fd, int book_id, int page)
WFIFOSET(fd,packet_len(0x294));
}
-
/// Battlegrounds
///
@@ -15807,7 +15923,6 @@ void clif_bg_hp(struct map_session_data *sd)
clif->send(buf, packet_len(cmd), &sd->bl, BG_AREA_WOS);
}
-
/// Updates the position of a camp member on the minimap (ZC_BATTLEFIELD_NOTIFY_POSITION).
/// 02df <account id>.L <name>.24B <class>.W <x>.W <y>.W
void clif_bg_xy(struct map_session_data *sd)
@@ -15840,14 +15955,16 @@ void clif_bg_xy_remove(struct map_session_data *sd)
clif->send(buf, packet_len(0x2df), &sd->bl, BG_SAMEMAP_WOS);
}
-
/// Notifies clients of a battleground message (ZC_BATTLEFIELD_CHAT).
/// 02dc <packet len>.W <account id>.L <name>.24B <message>.?B
void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len)
{
struct map_session_data *sd;
unsigned char *buf;
-
+
+ nullpo_retv(bgd);
+ nullpo_retv(name);
+ nullpo_retv(mes);
if( !bgd->count || (sd = bg->getavailablesd(bgd)) == NULL )
return;
@@ -15863,7 +15980,7 @@ void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name
aFree(buf);
}
-
+void clif_parse_BattleChat(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Validates and processes battlechat messages [pakpil] (CZ_BATTLEFIELD_CHAT).
/// 0x2db <packet len>.W <text>.?B (<name> : <message>) 00
void clif_parse_BattleChat(int fd, struct map_session_data* sd)
@@ -15895,7 +16012,6 @@ void clif_parse_BattleChat(int fd, struct map_session_data* sd)
bg->send_message(sd, text, textlen);
}
-
/// Notifies client of a battleground score change (ZC_BATTLEFIELD_NOTIFY_POINT).
/// 02de <camp A points>.W <camp B points>.W
void clif_bg_updatescore(int16 m) {
@@ -15924,7 +16040,6 @@ void clif_bg_updatescore_single(struct map_session_data *sd) {
WFIFOSET(fd,packet_len(0x2de));
}
-
/// Battleground camp belong-information (ZC_BATTLEFIELD_NOTIFY_CAMPINFO).
/// 02dd <account id>.L <name>.24B <camp>.W
void clif_sendbgemblem_area(struct map_session_data *sd)
@@ -15950,7 +16065,6 @@ void clif_sendbgemblem_single(int fd, struct map_session_data *sd)
WFIFOSET(fd,packet_len(0x2dd));
}
-
/// Custom Fonts (ZC_NOTIFY_FONT).
/// 02ef <account_id>.L <font id>.W
void clif_font(struct map_session_data *sd)
@@ -15965,7 +16079,6 @@ void clif_font(struct map_session_data *sd)
#endif
}
-
/*==========================================
* Instancing Window
*------------------------------------------*/
@@ -16074,15 +16187,17 @@ void clif_instance_leave(int fd)
WFIFOSET(fd,packet_len(0x02CE));
}
-
/// Notifies clients about item picked up by a party member (ZC_ITEM_PICKUP_PARTY).
/// 02b8 <account id>.L <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B
void clif_party_show_picker(struct map_session_data * sd, struct item * item_data)
{
#if PACKETVER >= 20071002
unsigned char buf[22];
- struct item_data* id = itemdb->search(item_data->nameid);
+ struct item_data* id;
+ nullpo_retv(sd);
+ nullpo_retv(item_data);
+ id = itemdb->search(item_data->nameid);
WBUFW(buf,0) = 0x2b8;
WBUFL(buf,2) = sd->status.account_id;
WBUFW(buf,6) = item_data->nameid;
@@ -16096,7 +16211,6 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat
#endif
}
-
/// Display gained exp (ZC_NOTIFY_EXP).
/// 07f6 <account id>.L <amount>.L <var id>.W <exp type>.W
/// var id:
@@ -16120,7 +16234,6 @@ void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, b
WFIFOSET(fd,packet_len(0x7f6));
}
-
/// Displays digital clock digits on top of the screen (ZC_SHOWDIGIT).
/// type:
/// 0 = Displays 'value' for 5 seconds.
@@ -16131,6 +16244,7 @@ void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, b
/// Except for type 3 it is interpreted as seconds for displaying as DD:HH:MM:SS, HH:MM:SS, MM:SS or SS (leftmost '00' is not displayed).
void clif_showdigit(struct map_session_data* sd, unsigned char type, int value)
{
+ nullpo_retv(sd);
WFIFOHEAD(sd->fd, packet_len(0x1b1));
WFIFOW(sd->fd,0) = 0x1b1;
WFIFOB(sd->fd,2) = type;
@@ -16138,7 +16252,7 @@ void clif_showdigit(struct map_session_data* sd, unsigned char type, int value)
WFIFOSET(sd->fd, packet_len(0x1b1));
}
-
+void clif_parse_LessEffect(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Notification of the state of client command /effect (CZ_LESSEFFECT).
/// 021d <state>.L
/// state:
@@ -16158,6 +16272,7 @@ void clif_parse_LessEffect(int fd, struct map_session_data* sd)
sd->state.lesseffect = ( isLess != 0 );
}
+void clif_parse_ItemListWindowSelected(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// S 07e4 <length>.w <option>.l <val>.l {<index>.w <amount>.w).4b*
void clif_parse_ItemListWindowSelected(int fd, struct map_session_data* sd) {
int n = (RFIFOW(fd,2)-12) / 4;
@@ -16246,7 +16361,6 @@ void clif_elemental_info(struct map_session_data *sd) {
WFIFOSET(fd,22);
}
-
/// Buying Store System
///
@@ -16254,15 +16368,17 @@ void clif_elemental_info(struct map_session_data *sd) {
/// 0810 <slots>.B
void clif_buyingstore_open(struct map_session_data* sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x810));
WFIFOW(fd,0) = 0x810;
WFIFOB(fd,2) = sd->buyingstore.slots;
WFIFOSET(fd,packet_len(0x810));
}
-
+void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to create a buying store (CZ_REQ_OPEN_BUYING_STORE).
/// 0811 <packet len>.W <limit zeny>.L <result>.B <store name>.80B { <name id>.W <amount>.W <price>.L }*
/// result:
@@ -16304,7 +16420,6 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
buyingstore->create(sd, zenylimit, result, storename, itemlist, count);
}
-
/// Notification, that the requested buying store could not be created (ZC_FAILED_OPEN_BUYING_STORE_TO_BUYER).
/// 0812 <result>.W <total weight>.L
/// result:
@@ -16314,8 +16429,10 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
/// ? = nothing
void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x812));
WFIFOW(fd,0) = 0x812;
WFIFOW(fd,2) = result;
@@ -16323,14 +16440,15 @@ void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short re
WFIFOSET(fd,packet_len(0x812));
}
-
/// Notification, that the requested buying store was created (ZC_MYITEMLIST_BUYING_STORE).
/// 0813 <packet len>.W <account id>.L <limit zeny>.L { <price>.L <count>.W <type>.B <name id>.W }*
void clif_buyingstore_myitemlist(struct map_session_data* sd)
{
- int fd = sd->fd;
+ int fd;
unsigned int i;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,12+sd->buyingstore.slots*9);
WFIFOW(fd,0) = 0x813;
WFIFOW(fd,2) = 12+sd->buyingstore.slots*9;
@@ -16348,13 +16466,13 @@ void clif_buyingstore_myitemlist(struct map_session_data* sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Notifies clients in area of a buying store (ZC_BUYING_STORE_ENTRY).
/// 0814 <account id>.L <store name>.80B
void clif_buyingstore_entry(struct map_session_data* sd)
{
uint8 buf[86];
+ nullpo_retv(sd);
WBUFW(buf,0) = 0x814;
WBUFL(buf,2) = sd->bl.id;
memcpy(WBUFP(buf,6), sd->message, MESSAGE_SIZE);
@@ -16363,8 +16481,10 @@ void clif_buyingstore_entry(struct map_session_data* sd)
}
void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x814));
WFIFOW(fd,0) = 0x814;
WFIFOL(fd,2) = pl_sd->bl.id;
@@ -16372,20 +16492,20 @@ void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_sessi
WFIFOSET(fd,packet_len(0x814));
}
-
+void clif_parse_ReqCloseBuyingStore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to close own buying store (CZ_REQ_CLOSE_BUYING_STORE).
/// 0815
void clif_parse_ReqCloseBuyingStore(int fd, struct map_session_data* sd) {
buyingstore->close(sd);
}
-
/// Notifies clients in area that a buying store was closed (ZC_DISAPPEAR_BUYING_STORE_ENTRY).
/// 0816 <account id>.L
void clif_buyingstore_disappear_entry(struct map_session_data* sd)
{
uint8 buf[6];
+ nullpo_retv(sd);
WBUFW(buf,0) = 0x816;
WBUFL(buf,2) = sd->bl.id;
@@ -16393,15 +16513,17 @@ void clif_buyingstore_disappear_entry(struct map_session_data* sd)
}
void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ nullpo_retv(pl_sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x816));
WFIFOW(fd,0) = 0x816;
WFIFOL(fd,2) = pl_sd->bl.id;
WFIFOSET(fd,packet_len(0x816));
}
-
/// Request to open someone else's buying store (CZ_REQ_CLICK_TO_BUYING_STORE).
/// 0817 <account id>.L
void clif_parse_ReqClickBuyingStore(int fd, struct map_session_data* sd)
@@ -16413,14 +16535,16 @@ void clif_parse_ReqClickBuyingStore(int fd, struct map_session_data* sd)
buyingstore->open(sd, account_id);
}
-
/// Sends buying store item list (ZC_ACK_ITEMLIST_BUYING_STORE).
/// 0818 <packet len>.W <account id>.L <store id>.L <limit zeny>.L { <price>.L <amount>.W <type>.B <name id>.W }*
void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_data* pl_sd)
{
- int fd = sd->fd;
+ int fd;
unsigned int i;
+ nullpo_retv(sd);
+ nullpo_retv(pl_sd);
+ fd = sd->fd;
WFIFOHEAD(fd,16+pl_sd->buyingstore.slots*9);
WFIFOW(fd,0) = 0x818;
WFIFOW(fd,2) = 16+pl_sd->buyingstore.slots*9;
@@ -16439,7 +16563,7 @@ void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_d
WFIFOSET(fd,WFIFOW(fd,2));
}
-
+void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to sell items to a buying store (CZ_REQ_TRADE_BUYING_STORE).
/// 0819 <packet len>.W <account id>.L <store id>.L { <index>.W <name id>.W <amount>.W }*
void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
@@ -16474,7 +16598,6 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
buyingstore->trade(sd, account_id, buyer_id, itemlist, count);
}
-
/// Notifies the buyer, that the buying store has been closed due to a post-trade condition (ZC_FAILED_TRADE_BUYING_STORE_TO_BUYER).
/// 081a <result>.W
/// result:
@@ -16483,21 +16606,24 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
/// ? = nothing
void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x81a));
WFIFOW(fd,0) = 0x81a;
WFIFOW(fd,2) = result;
WFIFOSET(fd,packet_len(0x81a));
}
-
/// Updates the zeny limit and an item in the buying store item list (ZC_UPDATE_ITEM_FROM_BUYING_STORE).
/// 081b <name id>.W <amount>.W <limit zeny>.L
void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x81b));
WFIFOW(fd,0) = 0x81b;
WFIFOW(fd,2) = nameid;
@@ -16506,7 +16632,6 @@ void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short na
WFIFOSET(fd,packet_len(0x81b));
}
-
/// Deletes item from inventory, that was sold to a buying store (ZC_ITEM_DELETE_BUYING_STORE).
/// 081c <index>.W <amount>.W <price>.L
/// message:
@@ -16515,8 +16640,10 @@ void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short na
/// NOTE: This function has to be called _instead_ of clif_delitem/clif_dropitem.
void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x81c));
WFIFOW(fd,0) = 0x81c;
WFIFOW(fd,2) = index+2;
@@ -16525,7 +16652,6 @@ void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsi
WFIFOSET(fd,packet_len(0x81c));
}
-
/// Notifies the seller, that a buying store trade failed (ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER).
/// 0824 <result>.W <name id>.W
/// result:
@@ -16535,8 +16661,10 @@ void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsi
/// ? = nothing
void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, unsigned short nameid)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x824));
WFIFOW(fd,0) = 0x824;
WFIFOW(fd,2) = result;
@@ -16544,7 +16672,7 @@ void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short res
WFIFOSET(fd,packet_len(0x824));
}
-
+void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Search Store Info System
///
@@ -16600,7 +16728,6 @@ void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) {
searchstore->query(sd, type, min_price, max_price, (const unsigned short*)itemlist, item_count, (const unsigned short*)cardlist, card_count);
}
-
/// Results for a store search request (ZC_SEARCH_STORE_INFO_ACK).
/// 0836 <packet len>.W <is first page>.B <is next page>.B <remaining uses>.B { <store id>.L <account id>.L <shop name>.80B <nameid>.W <item type>.B <price>.L <amount>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }*
/// is first page:
@@ -16612,9 +16739,11 @@ void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) {
void clif_search_store_info_ack(struct map_session_data* sd)
{
const unsigned int blocksize = MESSAGE_SIZE+26;
- int fd = sd->fd;
+ int fd;
unsigned int i, start, end;
+ nullpo_retv(sd);
+ fd = sd->fd;
start = sd->searchstore.pages*SEARCHSTORE_RESULTS_PER_PAGE;
end = min(sd->searchstore.count, start+SEARCHSTORE_RESULTS_PER_PAGE);
@@ -16650,7 +16779,6 @@ void clif_search_store_info_ack(struct map_session_data* sd)
WFIFOSET(fd,WFIFOW(fd,2));
}
-
/// Notification of failure when searching for stores (ZC_SEARCH_STORE_INFO_FAILED).
/// 0837 <reason>.B
/// reason:
@@ -16661,15 +16789,17 @@ void clif_search_store_info_ack(struct map_session_data* sd)
/// 4 = "No sale (purchase) information available." (0x705)
void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x837));
WFIFOW(fd,0) = 0x837;
WFIFOB(fd,2) = reason;
WFIFOSET(fd,packet_len(0x837));
}
-
+void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to display next page of results (CZ_SEARCH_STORE_INFO_NEXT_PAGE).
/// 0838
void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd)
@@ -16677,7 +16807,6 @@ void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd)
searchstore->next(sd);
}
-
/// Opens the search store window (ZC_OPEN_SEARCH_STORE_INFO).
/// 083a <type>.W <remaining uses>.B
/// type:
@@ -16685,8 +16814,10 @@ void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd)
/// 1 = Search Stores (Cash), asks for confirmation, when clicking a store
void clif_open_search_store_info(struct map_session_data* sd)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x83a));
WFIFOW(fd,0) = 0x83a;
WFIFOW(fd,2) = sd->searchstore.effect;
@@ -16696,7 +16827,7 @@ void clif_open_search_store_info(struct map_session_data* sd)
WFIFOSET(fd,packet_len(0x83a));
}
-
+void clif_parse_CloseSearchStoreInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to close the store search window (CZ_CLOSE_SEARCH_STORE_INFO).
/// 083b
void clif_parse_CloseSearchStoreInfo(int fd, struct map_session_data* sd)
@@ -16704,7 +16835,7 @@ void clif_parse_CloseSearchStoreInfo(int fd, struct map_session_data* sd)
searchstore->close(sd);
}
-
+void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/// Request to invoke catalog effect on a store from search results (CZ_SSILIST_ITEM_CLICK).
/// 083c <account id>.L <store id>.L <nameid>.W
void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd)
@@ -16720,13 +16851,14 @@ void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd
searchstore->click(sd, account_id, store_id, nameid);
}
-
/// Notification of the store position on current map (ZC_SSILIST_ITEM_CLICK_ACK).
/// 083d <xPos>.W <yPos>.W
void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y)
{
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x83d));
WFIFOW(fd,0) = 0x83d;
WFIFOW(fd,2) = x;
@@ -16734,7 +16866,6 @@ void clif_search_store_info_click_ack(struct map_session_data* sd, short x, shor
WFIFOSET(fd,packet_len(0x83d));
}
-
/// Parse function for packet debugging.
void clif_parse_debug(int fd,struct map_session_data *sd) {
int cmd, packet_len;
@@ -16765,7 +16896,6 @@ int clif_elementalconverter_list(struct map_session_data *sd) {
nullpo_ret(sd);
-
/// Main client packet processing function
fd=sd->fd;
WFIFOHEAD(fd, MAX_SKILL_PRODUCE_DB *2+4);
@@ -16796,6 +16926,7 @@ void clif_millenniumshield(struct block_list *bl, short shields ) {
#if PACKETVER >= 20081217
unsigned char buf[10];
+ nullpo_retv(bl);
WBUFW(buf,0) = 0x440;
WBUFL(buf,2) = bl->id;
WBUFW(buf,6) = shields;
@@ -16974,6 +17105,8 @@ int clif_skill_itemlistwindow( struct map_session_data *sd, uint16 skill_id, uin
return 1;
}
+
+void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/*==========================================
* used by SC_AUTOSHADOWSPELL
* RFIFOL(fd,2) - flag (currently not used)
@@ -16993,6 +17126,7 @@ void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) {
clif_menuskill_clear(sd);
}
+
/*==========================================
* Kagerou/Oboro amulet spirit
*------------------------------------------*/
@@ -17008,6 +17142,8 @@ void clif_charm(struct map_session_data *sd)
WBUFW(buf,8) = sd->charm_count;
clif->send(buf,packet_len(0x08cf),&sd->bl,AREA);
}
+
+void clif_parse_MoveItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Move Item from or to Personal Tab (CZ_WHATSOEVER) [FE]
/// 0907 <index>.W
///
@@ -17039,6 +17175,7 @@ void clif_parse_MoveItem(int fd, struct map_session_data *sd) {
clif->favorite_item(sd, index);
#endif
}
+
/* [Ind/Hercules] */
void clif_cashshop_db(void) {
config_t cashshop_conf;
@@ -17090,7 +17227,6 @@ void clif_cashshop_db(void) {
}
}
-
RECREATE(clif->cs.data[i], struct hCSData *, ++clif->cs.item_count[i]);
CREATE(clif->cs.data[i][ clif->cs.item_count[i] - 1 ], struct hCSData , 1);
@@ -17101,15 +17237,17 @@ void clif_cashshop_db(void) {
}
}
- libconfig->destroy(&cashshop_conf);
}
+ libconfig->destroy(&cashshop_conf);
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", item_count_t, config_filename);
}
/// Items that are in favorite tab of inventory (ZC_ITEM_FAVORITE).
/// 0900 <index>.W <favorite>.B
void clif_favorite_item(struct map_session_data* sd, unsigned short index) {
- int fd = sd->fd;
+ int fd;
+ nullpo_retv(sd);
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x908));
WFIFOW(fd,0) = 0x908;
WFIFOW(fd,2) = index+2;
@@ -17120,6 +17258,7 @@ void clif_favorite_item(struct map_session_data* sd, unsigned short index) {
void clif_snap( struct block_list *bl, short x, short y ) {
unsigned char buf[10];
+ nullpo_retv(bl);
WBUFW(buf,0) = 0x8d2;
WBUFL(buf,2) = bl->id;
WBUFW(buf,6) = x;
@@ -17131,17 +17270,22 @@ void clif_snap( struct block_list *bl, short x, short y ) {
void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
struct packet_monster_hp p;
+ nullpo_retv(md);
+ nullpo_retv(sd);
p.PacketType = monsterhpType;
p.GID = md->bl.id;
p.HP = md->status.hp;
p.MaxHP = md->status.max_hp;
- clif->send(&p,sizeof(p),&sd->bl,SELF);
+ clif->send(&p, sizeof(p), &sd->bl, SELF);
}
+
/* [Ind/Hercules] placeholder for unsupported incoming packets (avoids server disconnecting client) */
void __attribute__ ((unused)) clif_parse_dull(int fd,struct map_session_data *sd) {
return;
}
+
+void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) {
if (map->list[sd->bl.m].flag.nocashshop) {
@@ -17156,10 +17300,12 @@ void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) {
WFIFOSET(fd, 10);
}
+void clif_parse_CashShopClose(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_CashShopClose(int fd, struct map_session_data *sd) {
/* TODO apply some state tracking */
}
+void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
int i, j = 0;
@@ -17181,6 +17327,8 @@ void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
WFIFOSET(fd, 8 + ( clif->cs.item_count[i] * 6 ));
}
}
+
+void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
unsigned short limit = RFIFOW(fd, 4), i, j;
unsigned int kafra_pay = RFIFOL(fd, 6);// [Ryuuzaki] - These are free cash points (strangely #CASH = main cash currently for us, confusing)
@@ -17268,6 +17416,8 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
}
}
+
+void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/* [Ind/Hercules] */
void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
short tab = RFIFOW(fd, 2);
@@ -17333,6 +17483,7 @@ void clif_status_change2(struct block_list *bl, int tid, enum send_target target
}
void clif_partytickack(struct map_session_data* sd, bool flag) {
+ nullpo_retv(sd);
WFIFOHEAD(sd->fd, packet_len(0x2c9));
WFIFOW(sd->fd, 0) = 0x2c9;
@@ -17365,6 +17516,8 @@ void clif_ShowScript(struct block_list* bl, const char* message) {
void clif_status_change_end(struct block_list *bl, int tid, enum send_target target, int type) {
struct packet_status_change_end p;
+ nullpo_retv(bl);
+
if( bl->type == BL_PC && !((TBL_PC*)bl)->state.active )
return;
@@ -17385,6 +17538,7 @@ void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK
default: {
struct packet_bgqueue_ack p;
+ nullpo_retv(sd);
p.PacketType = bgqueue_ackType;
p.type = response;
safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
@@ -17395,10 +17549,10 @@ void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK
}
}
-
void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, char *name) {
struct packet_bgqueue_notice_delete p;
+ nullpo_retv(sd);
p.PacketType = bgqueue_notice_deleteType;
p.type = response;
safestrncpy(p.bg_name, name, sizeof(p.bg_name));
@@ -17406,6 +17560,7 @@ void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) {
struct packet_bgqueue_register *p = P2PTR(fd);
struct bg_arena *arena = NULL;
@@ -17432,6 +17587,8 @@ void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) {
void clif_bgqueue_update_info(struct map_session_data *sd, unsigned char arena_id, int position) {
struct packet_bgqueue_update_info p;
+ nullpo_retv(sd);
+ Assert_retv(arena_id < bg->arenas);
p.PacketType = bgqueue_updateinfoType;
safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
p.position = position;
@@ -17441,15 +17598,18 @@ void clif_bgqueue_update_info(struct map_session_data *sd, unsigned char arena_i
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) {
struct packet_bgqueue_checkstate *p = P2PTR(fd);
+ nullpo_retv(sd);
if ( sd->bg_queue.arena && sd->bg_queue.type ) {
clif->bgqueue_update_info(sd,sd->bg_queue.arena->id,bg->id2pos(sd->bg_queue.arena->queue_id,sd->status.account_id));
} else
clif->bgqueue_notice_delete(sd, BGQND_FAIL_NOT_QUEUING,p->bg_name);
}
+void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) {
struct packet_bgqueue_revoke_req *p = P2PTR(fd);
@@ -17459,6 +17619,7 @@ void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) {
clif->bgqueue_notice_delete(sd, BGQND_FAIL_NOT_QUEUING,p->bg_name);
}
+void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) {
struct packet_bgqueue_battlebegin_ack *p = P2PTR(fd);
struct bg_arena *arena;
@@ -17475,6 +17636,7 @@ void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) {
void clif_bgqueue_joined(struct map_session_data *sd, int pos) {
struct packet_bgqueue_notify_entry p;
+ nullpo_retv(sd);
p.PacketType = bgqueue_notify_entryType;
safestrncpy(p.name,sd->status.name,sizeof(p.name));
p.position = pos;
@@ -17491,6 +17653,8 @@ void clif_bgqueue_pcleft(struct map_session_data *sd) {
void clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_id, enum send_target target) {
struct packet_bgqueue_battlebegins p;
+ nullpo_retv(sd);
+ Assert_retv(arena_id < bg->arenas);
p.PacketType = bgqueue_battlebeginsType;
safestrncpy(p.bg_name, bg->arena[arena_id]->name, sizeof(p.bg_name));
safestrncpy(p.game_name, bg->arena[arena_id]->name, sizeof(p.game_name));
@@ -17501,15 +17665,18 @@ void clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_
void clif_scriptclear(struct map_session_data *sd, int npcid) {
struct packet_script_clear p;
+ nullpo_retv(sd);
p.PacketType = script_clearType;
p.NpcID = npcid;
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+
/* Made Possible Thanks to Yommy! */
void clif_package_item_announce(struct map_session_data *sd, unsigned short nameid, unsigned short containerid) {
struct packet_package_item_announce p;
+ nullpo_retv(sd);
p.PacketType = package_item_announceType;
p.PacketLength = 11+NAME_LENGTH;
p.type = 0x0;
@@ -17521,10 +17688,12 @@ void clif_package_item_announce(struct map_session_data *sd, unsigned short name
clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT);
}
+
/* Made Possible Thanks to Yommy! */
void clif_item_drop_announce(struct map_session_data *sd, unsigned short nameid, char *monsterName) {
struct packet_item_drop_announce p;
+ nullpo_retv(sd);
p.PacketType = item_drop_announceType;
p.PacketLength = sizeof(p);
p.type = 0x1;
@@ -17536,6 +17705,7 @@ void clif_item_drop_announce(struct map_session_data *sd, unsigned short nameid,
clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT);
}
+
/* [Ind/Hercules] special thanks to Yommy~! */
void clif_skill_cooldown_list(int fd, struct skill_cd* cd) {
#if PACKETVER >= 20120604
@@ -17545,6 +17715,8 @@ void clif_skill_cooldown_list(int fd, struct skill_cd* cd) {
#endif
int i, count = 0;
+ nullpo_retv(cd);
+
WFIFOHEAD(fd,4+(offset*cd->cursor));
#if PACKETVER >= 20120604
@@ -17570,6 +17742,7 @@ void clif_skill_cooldown_list(int fd, struct skill_cd* cd) {
WFIFOSET(fd,4+(offset*count));
}
+
/* [Ind/Hercules] - Data Thanks to Yommy
* - ADDITEM_TO_CART_FAIL_WEIGHT = 0x0
* - ADDITEM_TO_CART_FAIL_COUNT = 0x1
@@ -17577,11 +17750,14 @@ void clif_skill_cooldown_list(int fd, struct skill_cd* cd) {
void clif_cart_additem_ack(struct map_session_data *sd, int flag) {
struct packet_cart_additem_ack p;
+ nullpo_retv(sd);
p.PacketType = cart_additem_ackType;
p.result = (char)flag;
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+
+void clif_parse_BankDeposit(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/* Bank System [Yommy/Hercules] */
void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
struct packet_banking_deposit_req *p = P2PTR(fd);
@@ -17597,6 +17773,7 @@ void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
pc->bank_deposit(sd,money);
}
+void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
struct packet_banking_withdraw_req *p = P2PTR(fd);
int money;
@@ -17611,6 +17788,7 @@ void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
pc->bank_withdraw(sd,money);
}
+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) {
struct packet_banking_check p;
@@ -17626,10 +17804,12 @@ void clif_parse_BankCheck(int fd, struct map_session_data* sd) {
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+void clif_parse_BankOpen(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_BankOpen(int fd, struct map_session_data* sd) {
return;
}
+void clif_parse_BankClose(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_BankClose(int fd, struct map_session_data* sd) {
return;
}
@@ -17637,6 +17817,7 @@ void clif_parse_BankClose(int fd, struct map_session_data* sd) {
void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason) {
struct packet_banking_deposit_ack p;
+ nullpo_retv(sd);
p.PacketType = banking_deposit_ackType;
p.Balance = sd->status.zeny;/* how much zeny char has after operation */
p.Money = (int64)sd->status.bank_vault;/* money in the bank */
@@ -17644,9 +17825,11 @@ void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK r
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+
void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason) {
struct packet_banking_withdraw_ack p;
+ nullpo_retv(sd);
p.PacketType = banking_withdraw_ackType;
p.Balance = sd->status.zeny;/* how much zeny char has after operation */
p.Money = (int64)sd->status.bank_vault;/* money in the bank */
@@ -17654,9 +17837,11 @@ void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+
/* TODO: official response packet (tried 0x8cb/0x97b but the display was quite screwed up.) */
/* currently mimicing */
void clif_show_modifiers (struct map_session_data *sd) {
+ nullpo_retv(sd);
if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) {
char output[128];
@@ -17671,12 +17856,14 @@ void clif_show_modifiers (struct map_session_data *sd) {
void clif_notify_bounditem(struct map_session_data *sd, unsigned short index) {
struct packet_notify_bounditem p;
+ nullpo_retv(sd);
p.PacketType = notify_bounditemType;
p.index = index+2;
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+void clif_parse_GMFullStrip(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/**
* Parses the (GM) right click option 'remove all equipment'
**/
@@ -17693,6 +17880,7 @@ void clif_parse_GMFullStrip(int fd, struct map_session_data *sd) {
pc->unequipitem(tsd, tsd->equip_index[i], PCUNEQUIPITEM_FORCE);
}
}
+
/**
* clif_delay_damage timer, sends the stored data and clears the memory afterwards
**/
@@ -17705,6 +17893,7 @@ int clif_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
+
/**
* Delays sending a damage packet in order to avoid the visual display to overlap
*
@@ -17736,7 +17925,7 @@ int clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst
if(sc && sc->count && sc->data[SC_ILLUSION]) {
if(in_damage) in_damage = in_damage*(sc->data[SC_ILLUSION]->val2) + rnd()%100;
}
-
+
#if PACKETVER < 20071113
damage = (short)min(in_damage,INT16_MAX);
#else
@@ -17777,22 +17966,29 @@ int clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst
return clif->calc_walkdelay(dst,ddelay,type,damage,div);
}
+
+void clif_parse_NPCShopClosed(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/* Thanks to Yommy */
void clif_parse_NPCShopClosed(int fd, struct map_session_data *sd) {
/* TODO track the state <3~ */
sd->npc_shopid = 0;
}
+
/* NPC Market (by Ind after an extensive debugging of the packet, only possible thanks to Yommy <3) */
void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
#if PACKETVER >= 20131223
- struct npc_item_list *shop = nd->u.scr.shop->item;
- unsigned short shop_size = nd->u.scr.shop->items, i, c;
+ struct npc_item_list *shop;
+ unsigned short shop_size, i, c;
+ nullpo_retv(sd);
+ nullpo_retv(nd);
+ shop = nd->u.scr.shop->item;
+ shop_size = nd->u.scr.shop->items;
npcmarket_open.PacketType = npcmarketopenType;
for(i = 0, c = 0; i < shop_size; i++) {
struct item_data *id = NULL;
- if( shop[i].nameid && (id = itemdb->exists(shop[i].nameid)) ) {
+ if (shop[i].nameid && (id = itemdb->exists(shop[i].nameid)) != NULL) {
npcmarket_open.list[c].nameid = shop[i].nameid;
npcmarket_open.list[c].price = shop[i].value;
npcmarket_open.list[c].qty = shop[i].qty;
@@ -17807,14 +18003,19 @@ void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
clif->send(&npcmarket_open,npcmarket_open.PacketLength,&sd->bl,SELF);
#endif
}
+
+void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd) {
/* TODO track the state <3~ */
sd->npc_shopid = 0;
}
+
void clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response) {
#if PACKETVER >= 20131223
unsigned short c = 0;
+ nullpo_retv(sd);
+ nullpo_retv(req);
npcmarket_result.PacketType = npcmarketresultackType;
npcmarket_result.result = response == 0 ? 1 : 0;/* find other values */
@@ -17847,6 +18048,8 @@ void clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc
clif->send(&npcmarket_result,npcmarket_result.PacketLength,&sd->bl,SELF);
#endif
}
+
+void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) {
#if PACKETVER >= 20131223
struct packet_npc_market_purchase *p = P2PTR(fd);
@@ -17854,27 +18057,29 @@ void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) {
clif->npc_market_purchase_ack(sd,p,npc->market_buylist(sd,(p->PacketLength - 4) / sizeof(p->list[0]),p));
#endif
}
-
+
void clif_PartyLeaderChanged(struct map_session_data *sd, int prev_leader_aid, int new_leader_aid) {
struct packet_party_leader_changed p;
-
+
+ nullpo_retv(sd);
p.PacketType = partyleaderchangedType;
-
+
p.prev_leader_aid = prev_leader_aid;
p.new_leader_aid = new_leader_aid;
-
+
clif->send(&p,sizeof(p),&sd->bl,PARTY);
}
+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) {
struct packet_roulette_open_ack p;
-
+
if( !battle_config.feature_roulette ) {
clif->message(fd,"Roulette is disabled");
return;
}
-
+
p.PacketType = 0xa1a;
p.Result = 0;
p.Serial = 0;
@@ -17887,6 +18092,8 @@ void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) {
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+
+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) {
struct packet_roulette_info_ack p;
unsigned short i, j, count = 0;
@@ -17895,11 +18102,11 @@ void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
clif->message(fd,"Roulette is disabled");
return;
}
-
+
p.PacketType = rouletteinfoackType;
p.PacketLength = 8 + (42 * 8);
p.RouletteSerial = 1;
-
+
for(i = 0; i < MAX_ROULETTE_LEVEL; i++) {
for(j = 0; j < MAX_ROULETTE_COLUMNS-i; j++) {
p.ItemInfo[count].Row = i;
@@ -17909,45 +18116,44 @@ void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
count++;
}
}
-
clif->send(&p,sizeof(p), &sd->bl, SELF);
return;
}
+
+void clif_parse_RouletteClose(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_RouletteClose(int fd, struct map_session_data* sd) {
-
if( !battle_config.feature_roulette ) {
clif->message(fd,"Roulette is disabled");
return;
}
-
-
+
/** What do we need this for? (other than state tracking), game client closes the window without our response. **/
-
//ShowDebug("clif_parse_RouletteClose\n");
-
+
return;
}
+
+void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) {
unsigned char result = GENERATE_ROULETTE_SUCCESS;
short stage = sd->roulette.stage;
-
+
if( !battle_config.feature_roulette ) {
clif->message(fd,"Roulette is disabled");
return;
}
-
+
if( sd->roulette.stage >= MAX_ROULETTE_LEVEL )
stage = sd->roulette.stage = 0;
-
+
if( stage == 0 ) {
if( pc_readglobalreg(sd, script->add_str("TmpRouletteBronze")) <= 0 &&
pc_readglobalreg(sd, script->add_str("TmpRouletteSilver")) < 10 &&
pc_readglobalreg(sd, script->add_str("TmpRouletteGold")) < 10 )
result = GENERATE_ROULETTE_NO_ENOUGH_POINT;
}
-
+
if( result == GENERATE_ROULETTE_SUCCESS ) {
-
if( stage == 0 ) {
if( pc_readglobalreg(sd, script->add_str("TmpRouletteBronze")) > 0 ) {
pc_setglobalreg(sd, script->add_str("TmpRouletteBronze"), pc_readglobalreg(sd, script->add_str("TmpRouletteBronze")) - 1);
@@ -17959,7 +18165,6 @@ void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) {
stage = sd->roulette.stage = 4;
}
}
-
sd->roulette.prizeStage = stage;
sd->roulette.prizeIdx = rnd()%clif->rd.items[stage];
if( sd->roulette.prizeIdx == 0 ) {
@@ -17968,37 +18173,39 @@ void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) {
it.nameid = clif->rd.nameid[stage][0];
it.identify = 1;
-
+
pc->additem(sd, &it, clif->rd.qty[stage][0], LOG_TYPE_OTHER);/** TODO maybe a new log type for roulette items? **/
-
+
sd->roulette.stage = 0;
result = GENERATE_ROULETTE_LOSING;
} else
sd->roulette.claimPrize = true;
}
-
+
clif->roulette_generate_ack(sd,result,stage,sd->roulette.prizeIdx,0);
if( result == GENERATE_ROULETTE_SUCCESS )
sd->roulette.stage++;
}
+
+void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/**
* Request to cash in!
**/
void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
struct packet_roulette_itemrecv_ack p;
-
+
if( !battle_config.feature_roulette ) {
clif->message(fd,"Roulette is disabled");
return;
}
-
+
p.PacketType = roulettercvitemackType;
p.AdditionItemID = 0;/** TODO **/
-
+
if( sd->roulette.claimPrize ) {
struct item it;
memset(&it, 0, sizeof(it));
-
+
it.nameid = clif->rd.nameid[sd->roulette.prizeStage][sd->roulette.prizeIdx];
it.identify = 1;
@@ -18025,7 +18232,7 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
}
} else
p.Result = RECV_ITEM_FAILED;
-
+
clif->send(&p,sizeof(p), &sd->bl, SELF);
return;
}
@@ -18035,39 +18242,38 @@ bool clif_parse_roulette_db(void) {
config_setting_t *roulette = NULL, *levels = NULL;
const char *config_filename = "db/roulette_db.conf"; // FIXME hardcoded name
int i, j, item_count_t = 0;
-
+
for( i = 0; i < MAX_ROULETTE_LEVEL; i++ ) {
clif->rd.items[i] = 0;
}
-
+
if (libconfig->read_file(&roulette_conf, config_filename)) {
ShowError("can't read %s\n", config_filename);
return false;
}
-
roulette = libconfig->lookup(&roulette_conf, "roulette");
-
+
if( roulette != NULL && (levels = libconfig->setting_get_elem(roulette, 0)) != NULL ) {
for(i = 0; i < MAX_ROULETTE_LEVEL; i++) {
config_setting_t *level;
char entry_name[10];
-
+
sprintf(entry_name,"level_%d",i+1);
-
+
if( (level = libconfig->setting_get_member(levels, entry_name)) != NULL ) {
int k, item_count = libconfig->setting_length(level);
-
+
for(k = 0; k < item_count; k++) {
config_setting_t *entry = libconfig->setting_get_elem(level,k);
const char *name = config_setting_name(entry);
int qty = libconfig->setting_get_int(entry);
struct item_data * data = NULL;
-
+
if( qty < 1 ) {
ShowWarning("roulette_db: unsupported qty '%d' for entry named '%s' in category '%s'\n", qty, name, entry_name);
continue;
}
-
+
if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
if( !( data = itemdb->exists(atoi(name+2))) ) {
ShowWarning("roulette_db: unknown item id '%s' in category '%s'\n", name+2, entry_name);
@@ -18079,26 +18285,25 @@ bool clif_parse_roulette_db(void) {
continue;
}
}
-
+
j = clif->rd.items[i];
RECREATE(clif->rd.nameid[i],int,++clif->rd.items[i]);
RECREATE(clif->rd.qty[i],int,clif->rd.items[i]);
-
+
clif->rd.nameid[i][j] = data->nameid;
clif->rd.qty[i][j] = qty;
-
+
item_count_t++;
}
}
}
-
- libconfig->destroy(&roulette_conf);
}
-
+ libconfig->destroy(&roulette_conf);
+
for(i = 0; i < MAX_ROULETTE_LEVEL; i++) {
int limit = MAX_ROULETTE_COLUMNS-i;
if( clif->rd.items[i] == limit ) continue;
-
+
if( clif->rd.items[i] > limit ) {
ShowWarning("roulette_db: level %d has %d items, only %d supported, capping...\n",i+1,clif->rd.items[i],limit);
clif->rd.items[i] = limit;
@@ -18106,23 +18311,20 @@ bool clif_parse_roulette_db(void) {
}
/** this scenario = clif->rd.items[i] < limit **/
ShowWarning("roulette_db: level %d has %d items, %d are required. filling with apples\n",i+1,clif->rd.items[i],limit);
-
+
clif->rd.items[i] = limit;
RECREATE(clif->rd.nameid[i],int,clif->rd.items[i]);
RECREATE(clif->rd.qty[i],int,clif->rd.items[i]);
-
for(j = 0; j < MAX_ROULETTE_COLUMNS-i; j++) {
- if( clif->rd.qty[i][j] ) continue;
-
+ if (clif->rd.qty[i][j])
+ continue;
clif->rd.nameid[i][j] = ITEMID_APPLE;
clif->rd.qty[i][j] = 1;
}
}
-
-
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", item_count_t, config_filename);
-
+
return true;
}
@@ -18132,6 +18334,7 @@ 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) {
struct packet_roulette_generate_ack p;
+ nullpo_retv(sd);
p.PacketType = roulettgenerateackType;
p.Result = result;
p.Step = stage;
@@ -18140,32 +18343,31 @@ void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char resul
p.RemainBronze = pc_readglobalreg(sd, script->add_str("TmpRouletteBronze"));
p.RemainGold = pc_readglobalreg(sd, script->add_str("TmpRouletteGold"));
p.RemainSilver = pc_readglobalreg(sd, script->add_str("TmpRouletteSilver"));
-
+
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
-/**
-* Stackable items merger
-**/
+/**
+ * Stackable items merger
+ */
void clif_openmergeitem(int fd, struct map_session_data *sd)
{
int i = 0, n = 0, j = 0;
struct merge_item merge_items[MAX_INVENTORY];
struct merge_item *merge_items_[MAX_INVENTORY] = {0};
+ nullpo_retv(sd);
memset(&merge_items,'\0',sizeof(merge_items));
for (i = 0; i < MAX_INVENTORY; i++) {
struct item *item_data = &sd->status.inventory[i];
- if (item_data->nameid == 0 || !itemdb->isstackable(item_data->nameid))
+ if (item_data->nameid == 0 || !itemdb->isstackable(item_data->nameid) || item_data->bound != IBT_NONE)
continue;
merge_items[n].nameid = item_data->nameid;
merge_items[n].position = i + 2;
n++;
-
-
}
qsort(merge_items,n,sizeof(struct merge_item),clif->comparemergeitem);
@@ -18199,8 +18401,10 @@ int clif_comparemergeitem(const void *a, const void *b)
const struct merge_item *a_ = a;
const struct merge_item *b_ = b;
+ nullpo_ret(a);
+ nullpo_ret(b);
if (a_->nameid == b_->nameid)
- return 0;
+ return 0;
return a_->nameid > b_->nameid ? -1 : 1;
}
@@ -18210,8 +18414,9 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
int16 nameid = 0, indexes[MAX_INVENTORY] = {0}, amounts[MAX_INVENTORY] = {0};
struct item item_data;
+ nullpo_retv(sd);
length = (RFIFOW(fd,2) - 4)/2;
-
+
if (length >= MAX_INVENTORY || length < 2) {
WFIFOHEAD(fd,7);
WFIFOW(fd,0) = 0x96f;
@@ -18231,7 +18436,7 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
it = &sd->status.inventory[idx];
- if (it->nameid == 0 || !itemdb->isstackable(it->nameid))
+ if (it->nameid == 0 || !itemdb->isstackable(it->nameid) || it->bound != IBT_NONE)
continue;
if (nameid == 0)
@@ -18246,7 +18451,6 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
n++;
}
-
if (n < 2 || count == 0) {
WFIFOHEAD(fd,7);
WFIFOW(fd,0) = 0x96f;
@@ -18270,14 +18474,13 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
for (i = 0; i < n; i++)
pc->delitem(sd,indexes[i],amounts[i],0,DELITEM_NORMAL,LOG_TYPE_NPC);
-
memset(&item_data,'\0',sizeof(item_data));
item_data.nameid = nameid;
item_data.identify = 1;
item_data.unique_id = itemdb->unique_id(sd);
pc->additem(sd,&item_data,count,LOG_TYPE_NPC);
-
+
ARR_FIND(0,MAX_INVENTORY,i,item_data.unique_id == sd->status.inventory[i].unique_id);
WFIFOHEAD(fd,7);
@@ -18286,7 +18489,6 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
WFIFOW(fd,4) = count;
WFIFOB(fd,6) = MERGEITEM_SUCCESS;
WFIFOSET(fd,7);
-
}
void clif_cancelmergeitem (int fd, struct map_session_data *sd)
@@ -18302,11 +18504,13 @@ unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
}
return (cmd ^ (((( clif->cryptKey[0] * clif->cryptKey[1] ) + clif->cryptKey[2]) >> 16) & 0x7FFF));
}
+
unsigned short clif_parse_cmd_normal( int fd, struct map_session_data *sd ) {
unsigned short cmd = RFIFOW(fd,0);
return cmd;
}
+
unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) {
unsigned short cmd = RFIFOW(fd,0);
@@ -18314,6 +18518,7 @@ unsigned short clif_parse_cmd_decrypt( int fd, struct map_session_data *sd ) {
return cmd;
}
+
unsigned short clif_parse_cmd_optional( int fd, struct map_session_data *sd ) {
unsigned short cmd = RFIFOW(fd,0);
@@ -18475,6 +18680,19 @@ int clif_parse(int fd) {
return 0;
}
+/**
+ * Returns information about the given packet ID.
+ *
+ * @param packet_id The packet ID.
+ * @return The corresponding packet_db entry, if any.
+ */
+const struct s_packet_db *clif_packet(int packet_id)
+{
+ if (packet_id < MIN_PACKET_DB || packet_id > MAX_PACKET_DB || packet_db[packet_id].len == 0)
+ return NULL;
+ return &packet_db[packet_id];
+}
+
static void __attribute__ ((unused)) packetdb_addpacket(short cmd, int len, ...) {
va_list va;
int i;
@@ -18515,14 +18733,13 @@ static void __attribute__ ((unused)) packetdb_addpacket(short cmd, int len, ...)
va_end(va);
}
void packetdb_loaddb(void) {
-
memset(packet_db,0,sizeof(packet_db));
-
- #define packet(id, size, ...) packetdb_addpacket((id), (size), ##__VA_ARGS__, 0xFFFF)
- #define packetKeys(a,b,c) do { clif->cryptKey[0] = (a); clif->cryptKey[1] = (b); clif->cryptKey[2] = (c); } while(0)
- #include "packets.h" /* load structure data */
- #undef packet
- #undef packetKeys
+
+#define packet(id, size, ...) packetdb_addpacket((id), (size), ##__VA_ARGS__, 0xFFFF)
+#define packetKeys(a,b,c) do { clif->cryptKey[0] = (a); clif->cryptKey[1] = (b); clif->cryptKey[2] = (c); } while(0)
+#include "packets.h" /* load structure data */
+#undef packet
+#undef packetKeys
}
void clif_bc_ready(void) {
if( battle_config.display_status_timers )
@@ -18582,7 +18799,7 @@ void do_final_clif(void)
}
aFree(clif->cs.data[i]);
}
-
+
for(i = 0; i < MAX_ROULETTE_LEVEL; i++) {
if( clif->rd.nameid[i] )
aFree(clif->rd.nameid[i]);
@@ -18611,6 +18828,7 @@ void clif_defaults(void) {
clif->parse = clif_parse;
clif->parse_cmd = clif_parse_cmd_optional;
clif->decrypt_cmd = clif_decrypt_cmd;
+ clif->packet = clif_packet;
/* auth */
clif->authok = clif_authok;
clif->authrefuse = clif_authrefuse;
@@ -18623,6 +18841,8 @@ void clif_defaults(void) {
clif->dropitem = clif_dropitem;
clif->delitem = clif_delitem;
clif->takeitem = clif_takeitem;
+ clif->item_equip = clif_item_equip;
+ clif->item_normal = clif_item_normal;
clif->arrowequip = clif_arrowequip;
clif->arrow_fail = clif_arrow_fail;
clif->use_card = clif_use_card;
@@ -18633,7 +18853,7 @@ void clif_defaults(void) {
clif->useitemack = clif_useitemack;
clif->addcards = clif_addcards;
clif->addcards2 = clif_addcards2;
- clif->item_sub = clif_item_sub;
+ clif->item_sub = clif_item_sub; // look like unused
clif->getareachar_item = clif_getareachar_item;
clif->cart_additem_ack = clif_cart_additem_ack;
clif->cashshop_load = clif_cashshop_db;
@@ -18867,7 +19087,7 @@ void clif_defaults(void) {
clif->tradedeal_lock = clif_tradedeal_lock;
clif->tradecancelled = clif_tradecancelled;
clif->tradecompleted = clif_tradecompleted;
- clif->tradeundo = clif_tradeundo;
+ clif->tradeundo = clif_tradeundo; // unused
/* vending handling */
clif->openvendingreq = clif_openvendingreq;
clif->showvendingboard = clif_showvendingboard;
diff --git a/src/map/clif.h b/src/map/clif.h
index fdcc929e3..40610b7c1 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -597,6 +597,7 @@ struct clif_interface {
int (*send_sub) (struct block_list *bl, va_list ap);
int (*send_actual) (int fd, void *buf, int len);
int (*parse) (int fd);
+ const struct s_packet_db *(*packet) (int packet_id);
unsigned short (*parse_cmd) ( int fd, struct map_session_data *sd );
unsigned short (*decrypt_cmd) ( int cmd, struct map_session_data *sd );
/* auth */
@@ -611,6 +612,8 @@ struct clif_interface {
void (*dropitem) (struct map_session_data *sd,int n,int amount);
void (*delitem) (struct map_session_data *sd,int n,int amount, short reason);
void (*takeitem) (struct block_list* src, struct block_list* dst);
+ void (*item_equip) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos);
+ void (*item_normal) (short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
void (*arrowequip) (struct map_session_data *sd,int val);
void (*arrow_fail) (struct map_session_data *sd,int type);
void (*use_card) (struct map_session_data *sd,int idx);
@@ -1321,11 +1324,6 @@ struct clif_interface {
};
#ifdef HERCULES_CORE
-/**
- * Vars
- **/
-extern struct s_packet_db packet_db[MAX_PACKET_DB + 1];
-
void clif_defaults(void);
#endif // HERCULES_CORE
diff --git a/src/map/duel.c b/src/map/duel.c
index 762745b75..e18e2fc45 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -10,6 +10,7 @@
#include "map/clif.h"
#include "map/pc.h"
#include "common/cbasetypes.h"
+#include "common/nullpo.h"
#include <stdio.h>
#include <stdlib.h>
@@ -25,10 +26,10 @@ struct duel_interface *duel;
void duel_savetime(struct map_session_data* sd) {
time_t clock;
struct tm *t;
-
+
time(&clock);
t = localtime(&clock);
-
+
pc_setglobalreg(sd, script->add_str("PC_LAST_DUEL_TIME"), t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);
}
@@ -36,22 +37,25 @@ int duel_checktime(struct map_session_data* sd) {
int diff;
time_t clock;
struct tm *t;
-
+
time(&clock);
t = localtime(&clock);
-
+
diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, script->add_str("PC_LAST_DUEL_TIME") );
-
+
return !(diff >= 0 && diff < battle_config.duel_time_interval);
}
+
static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
{
struct map_session_data *ssd = va_arg(va, struct map_session_data*);
int *p = va_arg(va, int*);
char output[256];
+ nullpo_retr(1, sd);
+ nullpo_retr(1, ssd);
if (sd->duel_group != ssd->duel_group) return 0;
-
+
sprintf(output, " %d. %s", ++(*p), sd->status.name);
clif_disp_onlyself(ssd, output, strlen(output));
return 1;
@@ -80,19 +84,21 @@ void duel_showinfo(const unsigned int did, struct map_session_data* sd) {
int duel_create(struct map_session_data* sd, const unsigned int maxpl) {
int i=1;
char output[256];
-
+
+ nullpo_ret(sd);
+
while(i < MAX_DUEL && duel->list[i].members_count > 0) i++;
if(i == MAX_DUEL) return 0;
-
+
duel->count++;
sd->duel_group = i;
duel->list[i].members_count++;
duel->list[i].invites_count = 0;
duel->list[i].max_players_limit = maxpl;
-
+
safestrncpy(output, msg_sd(sd,372), sizeof(output)); // " -- Duel has been created (@invite/@leave) --"
clif_disp_onlyself(sd, output, strlen(output));
-
+
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
clif->maptypeproperty2(&sd->bl,SELF);
return i;
@@ -101,13 +107,15 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl) {
void duel_invite(const unsigned int did, struct map_session_data* sd, struct map_session_data* target_sd) {
char output[256];
+ nullpo_retv(sd);
+ nullpo_retv(target_sd);
// " -- Player %s invites %s to duel --"
sprintf(output, msg_sd(sd,373), sd->status.name, target_sd->status.name);
clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
target_sd->duel_invite = did;
duel->list[did].invites_count++;
-
+
// "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
sprintf(output, msg_sd(target_sd,374), sd->status.name);
clif->broadcast((struct block_list *)target_sd, output, strlen(output)+1, BC_BLUE, SELF);
@@ -116,6 +124,7 @@ void duel_invite(const unsigned int did, struct map_session_data* sd, struct map
static int duel_leave_sub(struct map_session_data* sd, va_list va)
{
int did = va_arg(va, int);
+ nullpo_ret(sd);
if (sd->duel_invite == did)
sd->duel_invite = 0;
return 0;
@@ -123,18 +132,18 @@ static int duel_leave_sub(struct map_session_data* sd, va_list va)
void duel_leave(const unsigned int did, struct map_session_data* sd) {
char output[256];
-
+
+ nullpo_retv(sd);
// " <- Player %s has left duel --"
sprintf(output, msg_sd(sd,375), sd->status.name);
clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
+
duel->list[did].members_count--;
-
if(duel->list[did].members_count == 0) {
map->foreachpc(duel_leave_sub, did);
duel->count--;
}
-
+
sd->duel_group = 0;
duel_savetime(sd);
clif->map_property(sd, MAPPROPERTY_NOTHING);
@@ -143,12 +152,13 @@ void duel_leave(const unsigned int did, struct map_session_data* sd) {
void duel_accept(const unsigned int did, struct map_session_data* sd) {
char output[256];
-
+
+ nullpo_retv(sd);
duel->list[did].members_count++;
sd->duel_group = sd->duel_invite;
duel->list[did].invites_count--;
sd->duel_invite = 0;
-
+
// " -> Player %s has accepted duel --"
sprintf(output, msg_sd(sd,376), sd->status.name);
clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
@@ -159,11 +169,12 @@ void duel_accept(const unsigned int did, struct map_session_data* sd) {
void duel_reject(const unsigned int did, struct map_session_data* sd) {
char output[256];
-
+
+ nullpo_retv(sd);
// " -- Player %s has rejected duel --"
sprintf(output, msg_sd(sd,377), sd->status.name);
clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
+
duel->list[did].invites_count--;
sd->duel_invite = 0;
}
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 435dffaf4..b629275e5 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -785,7 +785,7 @@ int read_elementaldb(void) {
struct status_data *estatus;
sprintf(line, "%s/%s", map->db_path, "elemental_db.txt");
-
+
if( core->runflag == MAPSERVER_ST_RUNNING ) //only necessary after we're up
memset(elemental->db,0,sizeof(elemental->db));
@@ -980,27 +980,26 @@ void elemental_defaults(void) {
/* */
memset(elemental->db,0,sizeof(elemental->db));
-
+
/* funcs */
-
elemental->class = elemental_class;
elemental->get_viewdata = elemental_get_viewdata;
-
+
elemental->create = elemental_create;
elemental->data_received = elemental_data_received;
elemental->save = elemental_save;
-
+
elemental->change_mode_ack = elemental_change_mode_ack;
elemental->change_mode = elemental_change_mode;
-
+
elemental->heal = elemental_heal;
elemental->dead = elemental_dead;
-
+
elemental->delete = elemental_delete;
elemental->summon_stop = elemental_summon_stop;
-
+
elemental->get_lifetime = elemental_get_lifetime;
-
+
elemental->unlocktarget = elemental_unlocktarget;
elemental->skillnotok = elemental_skillnotok;
elemental->set_target = elemental_set_target;
@@ -1008,11 +1007,11 @@ void elemental_defaults(void) {
elemental->clean_effect = elemental_clean_effect;
elemental->action = elemental_action;
elemental->skill_get_requirements = elemental_skill_get_requirements;
-
+
elemental->read_skilldb = read_elemental_skilldb;
elemental->reload_db = reload_elementaldb;
elemental->reload_skilldb = reload_elemental_skilldb;
-
+
elemental->search_index = elemental_search_index;
elemental->summon_init = elemental_summon_init;
elemental->summon_end_timer = elemental_summon_end_timer;
diff --git a/src/map/guild.c b/src/map/guild.c
index 15c65ec98..7a187b625 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -227,7 +227,7 @@ int guild_getposition(struct guild* g, struct map_session_data* sd)
if( g == NULL && (g=sd->guild) == NULL )
return -1;
-
+
ARR_FIND( 0, g->max_member, i, g->member[i].account_id == sd->status.account_id && g->member[i].char_id == sd->status.char_id );
return( i < g->max_member ) ? g->member[i].position : -1;
}
@@ -263,7 +263,7 @@ int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
struct guild *g;
c = DB->data2ptr(data);
-
+
if (
(g = guild->search(c->guild_id)) == NULL ||
(i = guild->getindex(g, c->account_id, c->char_id)) < 0
@@ -475,7 +475,7 @@ int guild_recv_info(struct guild *sg) {
if (channel->config->ally_autojoin) {
struct s_mapiterator* iter = mapit_getallusers();
struct guild *tg[MAX_GUILDALLIANCE];
-
+
for (i = 0; i < MAX_GUILDALLIANCE; i++) {
tg[i] = NULL;
if( sg->alliance[i].opposition == 0 && sg->alliance[i].guild_id )
@@ -507,11 +507,8 @@ int guild_recv_info(struct guild *sg) {
}
}
}
-
mapit->free(iter);
-
}
-
aChSysSave = chan;
}
@@ -540,16 +537,16 @@ int guild_recv_info(struct guild *sg) {
instances_save = g->instances;
}
memcpy(g,sg,sizeof(struct guild));
-
+
g->channel = aChSysSave;
g->instance = instance_save;
g->instances = instances_save;
-
+
if(g->max_member > MAX_GUILD) {
ShowError("guild_recv_info: Received guild with %d members, but MAX_GUILD is only %d. Extra guild-members have been lost!\n", g->max_member, MAX_GUILD);
g->max_member = MAX_GUILD;
}
-
+
for(i=bm=m=0;i<g->max_member;i++){
if(g->member[i].account_id>0){
sd = g->member[i].sd = guild->sd_check(g->guild_id, g->member[i].account_id, g->member[i].char_id);
@@ -623,7 +620,7 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
return 0;
}
}
-
+
if (!tsd->fd) { //You can't invite someone who has already disconnected.
clif->guild_inviteack(sd,1);
return 0;
@@ -735,12 +732,11 @@ void guild_member_joined(struct map_session_data *sd)
if (i == -1)
sd->status.guild_id = 0;
else {
-
g->member[i].sd = sd;
sd->guild = g;
-
+
if (channel->config->ally && channel->config->ally_autojoin) {
- channel->join(g->channel, sd, NULL, true);
+ channel->join(g->channel, sd, "", true);
}
}
@@ -868,7 +864,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
if(g == NULL)
return 0; // no such guild (error!)
-
+
i = guild->getindex(g, account_id, char_id);
if( i == -1 )
return 0; // not a member (inconsistency!)
@@ -876,7 +872,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
online_member_sd = guild->getavailablesd(g);
if(online_member_sd == NULL)
return 0; // no one online to inform
-
+
#ifdef GP_BOUND_ITEMS
//Guild bound item check
guild->retrieveitembound(char_id,account_id,guild_id);
@@ -940,9 +936,9 @@ void guild_retrieveitembound(int char_id,int aid,int guild_id) {
int guild_send_memberinfoshort(struct map_session_data *sd,int online)
{ // cleaned up [LuzZza]
struct guild *g;
-
+
nullpo_ret(sd);
-
+
if(sd->status.guild_id <= 0)
return 0;
@@ -960,7 +956,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
ShowError("guild_send_memberinfoshort: Failed to locate member %d:%d in guild %d!\n", sd->status.account_id, sd->status.char_id, g->guild_id);
return 0;
}
-
+
if (sd->state.connect_new) {
//Note that this works because it is invoked in parse_LoadEndAck before connect_new is cleared.
clif->guild_belonginfo(sd,g);
@@ -971,13 +967,12 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
{ // cleaned up [LuzZza]
-
int i,alv,c,idx=-1,om=0,oldonline=-1;
struct guild *g = guild->search(guild_id);
-
+
if(g == NULL)
return 0;
-
+
for(i=0,alv=0,c=0,om=0;i<g->max_member;i++){
struct guild_member *m=&g->member[i];
if(!m->account_id) continue;
@@ -993,7 +988,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
if(m->online)
om++;
}
-
+
if(idx == -1 || c == 0) {
//Treat char_id who doesn't match guild_id (not found as member)
struct map_session_data *sd = map->id2sd(account_id);
@@ -1004,7 +999,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
ShowWarning("guild: not found member %d,%d on %d[%s]\n", account_id,char_id,guild_id,g->name);
return 0;
}
-
+
g->average_lv=alv/c;
g->connect_member=om;
@@ -1013,14 +1008,14 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
if(oldonline!=online)
clif->guild_memberlogin_notice(g, idx, online);
-
+
if(!g->member[idx].sd)
return 0;
//Send XY dot updates. [Skotlex]
//Moved from guild_send_memberinfoshort [LuzZza]
for(i=0; i < g->max_member; i++) {
-
+
if(!g->member[i].sd || i == idx ||
g->member[i].sd->bl.m != g->member[idx].sd->bl.m)
continue;
@@ -1079,7 +1074,7 @@ int guild_memberposition_changed(struct guild *g,int idx,int pos)
g->member[idx].position=pos;
clif->guild_memberpositionchanged(g,idx);
-
+
// Update char position in client [LuzZza]
if(g->member[idx].sd != NULL)
clif->charnameupdate(g->member[idx].sd);
@@ -1111,7 +1106,7 @@ int guild_position_changed(int guild_id,int idx,struct guild_position *p)
return 0;
memcpy(&g->position[idx],p,sizeof(struct guild_position));
clif->guild_positionchanged(g,idx);
-
+
// Update char name in client [LuzZza]
for(i=0;i<g->max_member;i++)
if(g->member[i].position == idx && g->member[i].sd != NULL)
@@ -1251,29 +1246,27 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp) {
struct guild *g;
struct guild_expcache *c;
int per;
-
+
nullpo_ret(sd);
if (!exp) return 0;
-
+
if (sd->status.guild_id == 0 ||
(g = sd->guild) == NULL ||
(per = guild->getposition(g,sd)) < 0 ||
(per = g->position[per].exp_mode) < 1)
return 0;
-
if (per < 100)
exp = exp * per / 100;
//Otherwise tax everything.
-
c = DB->data2ptr(guild->expcache_db->ensure(guild->expcache_db, DB->i2key(sd->status.char_id), guild->create_expcache, sd));
if (c->exp > UINT64_MAX - exp)
c->exp = UINT64_MAX;
else
c->exp += exp;
-
+
return exp;
}
@@ -1361,7 +1354,7 @@ void guild_guildaura_refresh(struct map_session_data *sd, uint16 skill_id, uint1
return;
if( !skill_lv )
return;
- if( sd->sc.data[type] && (group = skill->id2group(sd->sc.data[type]->val4)) ) {
+ if (sd->sc.data[type] && (group = skill->id2group(sd->sc.data[type]->val4)) != NULL) {
skill->del_unitgroup(group,ALC_MARK);
status_change_end(&sd->bl,type,INVALID_TIMER);
}
@@ -1433,7 +1426,6 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
return 0;
}
-
nullpo_ret(sd);
if(tsd==NULL || tsd->status.guild_id<=0)
@@ -1499,7 +1491,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
struct guild *g, *tg; // Reconfirm the number of alliance
g=sd->guild;
tg=tsd->guild;
-
+
if(g==NULL || guild->get_alliance_count(g,0) >= battle_config.max_guild_alliance){
clif->guild_allianceack(sd,4);
clif->guild_allianceack(tsd,3);
@@ -1639,7 +1631,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
channel->guild_leave_alliance(g[1],g[0]);
}
}
-
+
if (!(flag & 0x08)) { // new relationship
for(i=0;i<2-(flag&1);i++) {
if(g[i]!=NULL) {
@@ -1671,7 +1663,6 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
clif->guild_oppositionack(sd[0],0);
}
-
for (i = 0; i < 2 - (flag & 1); i++) { // Retransmission of the relationship list to all members
if (g[i] != NULL) {
for (j = 0; j < g[i]->max_member; j++) {
@@ -1771,7 +1762,7 @@ int guild_broken(int guild_id,int flag)
}
if( g->instance )
aFree(g->instance);
-
+
if( g->hdata )
{
for( i = 0; i < g->hdatac; i++ ) {
@@ -1782,7 +1773,7 @@ int guild_broken(int guild_id,int flag)
}
aFree(g->hdata);
}
-
+
idb_remove(guild->db,guild_id);
return 0;
}
@@ -1795,7 +1786,7 @@ int guild_gm_change(int guild_id, struct map_session_data *sd)
if (sd->status.guild_id != guild_id)
return 0;
-
+
g=guild->search(guild_id);
nullpo_ret(g);
@@ -1839,7 +1830,7 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
clif->message(g->member[pos].sd->fd, msg_sd(g->member[pos].sd,878)); //"You no longer are the Guild Master."
g->member[pos].sd->state.gmaster_flag = 0;
}
-
+
if (g->member[0].sd && g->member[0].sd->fd) {
clif->message(g->member[0].sd->fd, msg_sd(g->member[0].sd,879)); //"You have become the Guild Master!"
g->member[0].sd->state.gmaster_flag = 1;
@@ -1867,7 +1858,7 @@ int guild_break(struct map_session_data *sd,char *name) {
struct guild *g;
struct unit_data *ud;
int i;
-
+
nullpo_ret(sd);
if( (g=sd->guild)==NULL )
@@ -1888,7 +1879,7 @@ int guild_break(struct map_session_data *sd,char *name) {
clif->guild_broken(sd,2);
return 0;
}
-
+
/* regardless of char server allowing it, we clear the guild master's auras */
if( (ud = unit->bl2ud(&sd->bl)) ) {
int count = 0;
@@ -1905,7 +1896,6 @@ int guild_break(struct map_session_data *sd,char *name) {
groups[count++] = ud->skillunit[i];
break;
}
-
}
for(i = 0; i < count; i++) { // FIXME: Why is this not done in the above loop?
skill->del_unitgroup(groups[i],ALC_MARK);
@@ -1915,7 +1905,7 @@ int guild_break(struct map_session_data *sd,char *name) {
#ifdef GP_BOUND_ITEMS
pc->bound_clear(sd,IBT_GUILD);
#endif
-
+
intif->guild_break(g->guild_id);
return 1;
}
@@ -2153,7 +2143,7 @@ bool guild_isallied(int guild_id, int guild_id2)
void guild_flag_add(struct npc_data *nd) {
int i;
-
+
/* check */
for( i = 0; i < guild->flags_count; i++ ) {
if( guild->flags[i] && guild->flags[i]->bl.id == nd->bl.id ) {
@@ -2184,11 +2174,10 @@ void guild_flag_remove(struct npc_data *nd) {
for( i = 0, cursor = 0; i < guild->flags_count; i++ ) {
if( guild->flags[i] == NULL )
continue;
-
+
if( cursor != i ) {
memmove(&guild->flags[cursor], &guild->flags[i], sizeof(struct npc_data*));
}
-
cursor++;
}
@@ -2234,7 +2223,7 @@ void guild_flags_clear(void) {
if( guild->flags[i] )
guild->flags[i] = NULL;
}
-
+
guild->flags_count = 0;
}
@@ -2247,7 +2236,7 @@ void do_init_guild(bool minimal) {
guild->expcache_db = idb_alloc(DB_OPT_BASE);
guild->infoevent_db = idb_alloc(DB_OPT_BASE);
guild->expcache_ers = ers_new(sizeof(struct guild_expcache),"guild.c::expcache_ers",ERS_OPT_NONE);
-
+
sv->readdb(map->db_path, "castle_db.txt", ',', 4, 5, -1, guild->read_castledb);
sv->readdb(map->db_path, "guild_skill_tree.txt", ',', 2+MAX_GUILD_SKILL_REQUIRE*2, 2+MAX_GUILD_SKILL_REQUIRE*2, -1, guild->read_guildskill_tree_db); //guild skill tree [Komurka]
@@ -2262,7 +2251,7 @@ void do_final_guild(void) {
DBIterator *iter = db_iterator(guild->db);
struct guild *g;
int i;
-
+
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) {
if( g->channel != NULL )
channel->delete(g->channel);
@@ -2281,21 +2270,21 @@ void do_final_guild(void) {
aFree(g->hdata);
}
}
-
+
dbi_destroy(iter);
-
+
db_destroy(guild->db);
guild->castle_db->destroy(guild->castle_db,guild->castle_db_final);
guild->expcache_db->destroy(guild->expcache_db,guild->expcache_db_final);
guild->infoevent_db->destroy(guild->infoevent_db,guild->eventlist_db_final);
ers_destroy(guild->expcache_ers);
-
+
if( guild->flags )
aFree(guild->flags);
}
void guild_defaults(void) {
guild = &guild_s;
-
+
guild->init = do_init_guild;
guild->final = do_final_guild;
/* */
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index cc736708d..d0a4f6679 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -297,10 +297,10 @@ bool homunculus_levelup(struct homun_data *hd) {
ShowError("homunculus_levelup: Invalid class %d. \n", hd->homunculus.class_);
return false;
}
-
+
if( !hd->exp_next || hd->homunculus.exp < hd->exp_next )
return false;
-
+
switch( htype ) {
case HT_REG:
case HT_EVO:
@@ -312,7 +312,7 @@ bool homunculus_levelup(struct homun_data *hd) {
return false;
break;
}
-
+
hom = &hd->homunculus;
hom->level++ ;
if (!(hom->level % 3))
@@ -385,7 +385,7 @@ bool homunculus_evolve(struct homun_data *hd) {
sd = hd->master;
if (!sd)
return false;
-
+
if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class) {
clif->emotion(&hd->bl, E_SWT);
return false;
@@ -438,7 +438,7 @@ bool homunculus_mutate(struct homun_data *hd, int homun_id) {
sd = hd->master;
if (!sd)
return false;
-
+
m_class = homun->class2type(hd->homunculus.class_);
m_id = homun->class2type(homun_id);
@@ -461,7 +461,6 @@ bool homunculus_mutate(struct homun_data *hd, int homun_id) {
clif->emotion(&sd->bl, E_NO1);
clif->specialeffect(&hd->bl,568,AREA);
-
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
hom = &hd->homunculus;
hom->hp = hd->battle_status.hp;
@@ -480,12 +479,12 @@ int homunculus_gainexp(struct homun_data *hd,unsigned int exp) {
if(hd->homunculus.vaporize != HOM_ST_ACTIVE)
return 1;
-
+
if( (htype = homun->class2type(hd->homunculus.class_)) == HT_INVALID ) {
ShowError("homunculus_gainexp: Invalid class %d. \n", hd->homunculus.class_);
return 0;
}
-
+
switch( htype ) {
case HT_REG:
case HT_EVO:
@@ -763,7 +762,7 @@ bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
hd->bl.x = hd->ud.to_x;
hd->bl.y = hd->ud.to_y;
hd->masterteleport_timer = 0;
-
+
map->addiddb(&hd->bl);
status_calc_homunculus(hd,SCO_FIRST);
status_percent_heal(&hd->bl, 100, 100);
@@ -835,7 +834,7 @@ bool homunculus_recv_data(int account_id, struct s_homunculus *sh, int flag) {
if (!sd->status.hom_id) //Hom just created.
sd->status.hom_id = sh->hom_id;
-
+
if (sd->hd) //uh? Overwrite the data.
memcpy(&sd->hd->homunculus, sh, sizeof(struct s_homunculus));
else
@@ -985,10 +984,10 @@ bool homunculus_shuffle(struct homun_data *hd) {
exp = hd->homunculus.exp;
memcpy(&b_skill, &hd->homunculus.hskill, sizeof(b_skill));
skillpts = hd->homunculus.skillpts;
-
+
//Reset values to level 1.
homun->stat_reset(hd);
-
+
//Level it back up
do {
hd->homunculus.exp += hd->exp_next;
@@ -1159,7 +1158,7 @@ bool homunculus_read_skill_db_sub(char* split[], int columns, int current) {
// check for bounds [celest]
classid = atoi(split[0]) - HM_CLASS_BASE;
-
+
if ( classid >= MAX_HOMUNCULUS_CLASS ) {
ShowWarning("homunculus_read_skill_db_sub: Invalid homunculus class %d.\n", atoi(split[0]));
return false;
@@ -1273,7 +1272,7 @@ void do_init_homunculus(bool minimal) {
}
void do_final_homunculus(void) {
-
+
}
void homunculus_defaults(void) {
diff --git a/src/map/instance.c b/src/map/instance.c
index 1fc396325..300247fe7 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -47,7 +47,6 @@ bool instance_is_valid(int instance_id) {
return true;
}
-
/*--------------------------------------
* name : instance name
* Return value could be
@@ -61,7 +60,7 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
struct guild *g = NULL;
short *iptr = NULL;
int i;
-
+
switch ( type ) {
case IOT_NONE:
break;
@@ -93,15 +92,15 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
ShowError("instance_create: unknown type %d for owner_id %d and name %s.\n", type,owner_id,name);
return -1;
}
-
+
if( type != IOT_NONE && *icptr ) {
ARR_FIND(0, *icptr, i, strcmp(instance->list[iptr[i]].name,name) == 0 );
if( i != *icptr )
return -4;/* already got this instance */
}
-
+
ARR_FIND(0, instance->instances, i, instance->list[i].state == INSTANCE_FREE);
-
+
if( i == instance->instances )
RECREATE(instance->list, struct instance_data, ++instance->instances);
@@ -121,9 +120,9 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
instance->list[i].respawn.map = 0;
instance->list[i].respawn.y = 0;
instance->list[i].respawn.x = 0;
-
+
safestrncpy( instance->list[i].name, name, sizeof(instance->list[i].name) );
-
+
if( type != IOT_NONE ) {
int j;
ARR_FIND(0, *icptr, j, iptr[j] == -1);
@@ -146,7 +145,7 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
iptr[j] = i;
}
}
-
+
clif->instance(i, 1, 0); // Start instancing window
return i;
}
@@ -166,27 +165,27 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
ShowError("instance_add_map: trying to attach '%s' map to non-existing instance %d.\n", name, instance_id);
return -1;
}
-
+
if( map_name != NULL && strdb_iget(mapindex->db, map_name) ) {
ShowError("instance_add_map: trying to create instanced map with existent name '%s'\n", map_name);
return -2;
}
-
+
if( map->list[m].instance_id >= 0 ) {
// Source map already belong to a Instance.
ShowError("instance_add_map: trying to instance already instanced map %s.\n", name);
return -4;
}
-
+
ARR_FIND( instance->start_id, map->count, i, map->list[i].name[0] == 0 ); // Searching for a Free Map
-
+
if( i < map->count )
im = i; // Unused map found (old instance)
else {
im = map->count; // Using next map index
RECREATE(map->list,struct map_data,++map->count);
}
-
+
if( map->list[m].cell == (struct mapcell *)0xdeadbeaf )
map->cellfromcache(&map->list[m]);
@@ -199,13 +198,13 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
map->list[im].index = mapindex->addmap(-1, map->list[im].name); // Add map index
map->list[im].channel = NULL;
-
+
if( !map->list[im].index ) {
map->list[im].name[0] = '\0';
ShowError("instance_add_map: no more free map indexes.\n");
return -3; // No free map index
}
-
+
// Reallocate cells
num_cell = map->list[im].xs * map->list[im].ys;
CREATE( map->list[im].cell, struct mapcell, num_cell );
@@ -221,7 +220,7 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
map->list[im].cell[j].npc = 0;
map->list[im].cell[j].landprotector = 0;
}
-
+
size = map->list[im].bxs * map->list[im].bys * sizeof(struct block_list*);
map->list[im].block = (struct block_list**)aCalloc(size, 1);
map->list[im].block_mob = (struct block_list**)aCalloc(size, 1);
@@ -246,7 +245,7 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
if( map->list[m].skill_count ) {
map->list[im].skill_count = map->list[m].skill_count;
CREATE( map->list[im].skills, struct mapflag_skill_adjust*, map->list[im].skill_count );
-
+
for(i = 0; i < map->list[im].skill_count; i++) {
CREATE( map->list[im].skills[i], struct mapflag_skill_adjust, 1);
memcpy( map->list[im].skills[i],map->list[m].skills[i],sizeof(struct mapflag_skill_adjust));
@@ -256,20 +255,20 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
if( map->list[m].zone_mf_count ) {
map->list[im].zone_mf_count = map->list[m].zone_mf_count;
CREATE( map->list[im].zone_mf, char *, map->list[im].zone_mf_count );
-
+
for(i = 0; i < map->list[im].zone_mf_count; i++) {
CREATE(map->list[im].zone_mf[i], char, MAP_ZONE_MAPFLAG_LENGTH);
safestrncpy(map->list[im].zone_mf[i],map->list[m].zone_mf[i],MAP_ZONE_MAPFLAG_LENGTH);
}
}
-
+
//Mimic questinfo
if( map->list[m].qi_count ) {
map->list[im].qi_count = map->list[m].qi_count;
CREATE( map->list[im].qi_data, struct questinfo, map->list[im].qi_count );
memcpy( map->list[im].qi_data, map->list[m].qi_data, map->list[im].qi_count * sizeof(struct questinfo) );
}
-
+
map->list[im].m = im;
map->list[im].instance_id = instance_id;
map->list[im].instance_src_map = m;
@@ -280,7 +279,7 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
instance->list[instance_id].map[instance->list[instance_id].num_map - 1] = im; // Attach to actual instance
map->addmap2db(&map->list[im]);
-
+
return im;
}
@@ -305,11 +304,11 @@ int instance_map2imap(int16 m, int instance_id) {
int instance_mapname2imap(const char *map_name, int instance_id) {
int i;
-
+
if( !instance->valid(instance_id) ) {
return -1;
}
-
+
for( i = 0; i < instance->list[instance_id].num_map; i++ ) {
if( instance->list[instance_id].map[i] && !strcmpi(map->list[map->list[instance->list[instance_id].map[i]].instance_src_map].name,map_name) )
return instance->list[instance_id].map[i];
@@ -317,7 +316,6 @@ int instance_mapname2imap(const char *map_name, int instance_id) {
return -1;
}
-
/*--------------------------------------
* m : source map
* instance_id : where to search
@@ -354,7 +352,7 @@ int instance_init_npc(struct block_list* bl, va_list args) {
struct npc_data *nd = (struct npc_data*)bl;
struct event_data *ev;
char evname[EVENT_NAME_LENGTH];
-
+
snprintf(evname, EVENT_NAME_LENGTH, "%s::OnInstanceInit", nd->exname);
if( ( ev = strdb_get(npc->ev_db, evname) ) )
@@ -377,7 +375,7 @@ void instance_init(int instance_id) {
/* cant be together with the previous because it will rely on all of them being up */
map->foreachininstance(instance->init_npc, instance_id, BL_NPC);
-
+
instance->list[instance_id].state = INSTANCE_BUSY;
}
@@ -387,7 +385,7 @@ void instance_init(int instance_id) {
*--------------------------------------*/
int instance_del_load(struct map_session_data* sd, va_list args) {
int16 m = va_arg(args,int);
-
+
if( !sd || sd->bl.m != m )
return 0;
@@ -428,7 +426,7 @@ int instance_cleanup_sub(struct block_list *bl, va_list ap) {
*--------------------------------------*/
void instance_del_map(int16 m) {
int i;
-
+
if( m <= 0 || map->list[m].instance_id == -1 ) {
ShowError("instance_del_map: tried to remove non-existing instance map (%d)\n", m);
return;
@@ -439,38 +437,38 @@ void instance_del_map(int16 m) {
if( map->list[m].mob_delete_timer != INVALID_TIMER )
timer->delete(map->list[m].mob_delete_timer, map->removemobs_timer);
-
+
mapindex->removemap(map_id2index(m));
// Free memory
aFree(map->list[m].cell);
aFree(map->list[m].block);
aFree(map->list[m].block_mob);
-
+
if (map->list[m].unit_count && map->list[m].units) {
for(i = 0; i < map->list[m].unit_count; i++) {
aFree(map->list[m].units[i]);
}
aFree(map->list[m].units);
}
-
+
if (map->list[m].skill_count && map->list[m].skills) {
for(i = 0; i < map->list[m].skill_count; i++) {
aFree(map->list[m].skills[i]);
}
aFree(map->list[m].skills);
}
-
+
if (map->list[m].zone_mf_count && map->list[m].zone_mf) {
for(i = 0; i < map->list[m].zone_mf_count; i++) {
aFree(map->list[m].zone_mf[i]);
}
aFree(map->list[m].zone_mf);
}
-
+
if( map->list[m].qi_data )
aFree(map->list[m].qi_data);
-
+
// Remove from instance
for( i = 0; i < instance->list[map->list[m].instance_id].num_map; i++ ) {
if( instance->list[map->list[m].instance_id].map[i] == m ) {
@@ -481,10 +479,10 @@ void instance_del_map(int16 m) {
break;
}
}
-
+
if( i == instance->list[map->list[m].instance_id].num_map )
ShowError("map_instance_del: failed to remove %s from instance list (%s): %d\n", map->list[m].name, instance->list[map->list[m].instance_id].name, m);
-
+
if( map->list[m].channel )
channel->delete(map->list[m].channel);
@@ -514,7 +512,7 @@ void instance_destroy(int instance_id) {
short *iptr = NULL;
int type, j;
unsigned int now = (unsigned int)time(NULL);
-
+
if( !instance->valid(instance_id) )
return; // nothing to do
@@ -524,7 +522,7 @@ void instance_destroy(int instance_id) {
type = 2;
else
type = 3;
-
+
clif->instance(instance_id, 5, type); // Report users this instance has been destroyed
switch ( instance->list[instance_id].owner_type ) {
@@ -555,13 +553,13 @@ void instance_destroy(int instance_id) {
ShowError("instance_destroy: unknown type %d for owner_id %d and name '%s'.\n", instance->list[instance_id].owner_type,instance->list[instance_id].owner_id,instance->list[instance_id].name);
break;
}
-
+
if( iptr != NULL ) {
ARR_FIND(0, *icptr, j, iptr[j] == instance_id);
if( j != *icptr )
iptr[j] = -1;
}
-
+
if (instance->list[instance_id].map) {
int last = 0;
while (instance->list[instance_id].num_map && last != instance->list[instance_id].map[0]) {
@@ -570,7 +568,7 @@ void instance_destroy(int instance_id) {
instance->del_map( instance->list[instance_id].map[0] );
}
}
-
+
if( instance->list[instance_id].regs.vars )
db_destroy(instance->list[instance_id].regs.vars);
if( instance->list[instance_id].regs.arrays )
@@ -585,11 +583,11 @@ void instance_destroy(int instance_id) {
if( instance->list[instance_id].map )
aFree(instance->list[instance_id].map);
-
+
instance->list[instance_id].map = NULL;
instance->list[instance_id].state = INSTANCE_FREE;
instance->list[instance_id].num_map = 0;
-
+
if (instance->list[instance_id].hdata)
{
for( j = 0; j < instance->list[instance_id].hdatac; j++ ) {
@@ -600,7 +598,7 @@ void instance_destroy(int instance_id) {
}
aFree(instance->list[instance_id].hdata);
}
-
+
instance->list[instance_id].hdata = NULL;
instance->list[instance_id].hdatac = 0;
}
@@ -688,13 +686,13 @@ void do_reload_instance(void) {
struct s_mapiterator *iter;
struct map_session_data *sd;
int i, k;
-
+
for(i = 0; i < instance->instances; i++) {
for(k = 0; k < instance->list[i].num_map; k++) {
if( !map->list[map->list[instance->list[i].map[k]].instance_src_map].flag.src4instance )
break;
}
-
+
if( k != instance->list[i].num_map ) /* any (or all) of them were disabled, we destroy */
instance->destroy(i);
else {
@@ -704,7 +702,7 @@ void do_reload_instance(void) {
instance->set_timeout(i,instance->list[i].original_progress_timeout,instance->list[i].idle_timeoutval);
}
}
-
+
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); sd = (TBL_PC*)mapit->next(iter) ) {
if(sd && map->list[sd->bl.m].instance_id >= 0) {
@@ -714,14 +712,13 @@ void do_reload_instance(void) {
mapit->free(iter);
}
-
void do_final_instance(void) {
int i;
-
+
for(i = 0; i < instance->instances; i++) {
instance->destroy(i);
}
-
+
if( instance->list )
aFree(instance->list);
@@ -738,7 +735,7 @@ void do_init_instance(bool minimal) {
void instance_defaults(void) {
instance = &instance_s;
-
+
instance->init = do_init_instance;
instance->final = do_final_instance;
instance->reload = do_reload_instance;
diff --git a/src/map/intif.c b/src/map/intif.c
index 12f679552..1795055c4 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -279,7 +279,7 @@ int intif_saveregistry(struct map_session_data *sd) {
if (intif->CheckForCharServer() || !sd->regs.vars)
return -1;
-
+
WFIFOHEAD(inter_fd, 60000 + 300);
WFIFOW(inter_fd,0) = 0x3004;
/* 0x2 = length (set later) */
@@ -288,78 +288,76 @@ int intif_saveregistry(struct map_session_data *sd) {
WFIFOW(inter_fd,12) = 0;/* count */
plen = 14;
-
+
iter = db_iterator(sd->regs.vars);
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
const char *varname = NULL;
struct script_reg_state *src = NULL;
-
+
if( data->type != DB_DATA_PTR ) /* its a @number */
continue;
-
+
varname = script->get_str(script_getvarid(key.i64));
-
+
if( varname[0] == '@' ) /* @string$ can get here, so we skip */
continue;
-
+
src = DB->data2ptr(data);
/* no need! */
if( !src->update )
continue;
-
+
src->update = false;
-
+
len = strlen(varname)+1;
-
+
WFIFOB(inter_fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
-
+
safestrncpy((char*)WFIFOP(inter_fd,plen), varname, len);
plen += len;
-
+
WFIFOL(inter_fd, plen) = script_getvaridx(key.i64);
plen += 4;
-
+
if( src->type ) {
struct script_reg_str *p = (struct script_reg_str *)src;
-
+
WFIFOB(inter_fd, plen) = p->value ? 2 : 3;
plen += 1;
-
+
if( p->value ) {
len = strlen(p->value)+1;
-
+
WFIFOB(inter_fd, plen) = (unsigned char)len;/* won't be higher; the column size is 254 */
plen += 1;
-
+
safestrncpy((char*)WFIFOP(inter_fd,plen), p->value, len);
plen += len;
} else {
script->reg_destroy_single(sd,key.i64,&p->flag);
}
-
} else {
struct script_reg_num *p = (struct script_reg_num *)src;
WFIFOB(inter_fd, plen) = p->value ? 0 : 1;
plen += 1;
-
+
if( p->value ) {
WFIFOL(inter_fd, plen) = p->value;
plen += 4;
} else {
script->reg_destroy_single(sd,key.i64,&p->flag);
}
-
}
-
+
WFIFOW(inter_fd,12) += 1;
-
+
if( plen > 60000 ) {
WFIFOW(inter_fd, 2) = plen;
WFIFOSET(inter_fd, plen);
-
+
/* prepare follow up */
WFIFOHEAD(inter_fd, 60000 + 300);
WFIFOW(inter_fd,0) = 0x3004;
@@ -367,19 +365,18 @@ int intif_saveregistry(struct map_session_data *sd) {
WFIFOL(inter_fd,4) = sd->status.account_id;
WFIFOL(inter_fd,8) = sd->status.char_id;
WFIFOW(inter_fd,12) = 0;/* count */
-
+
plen = 14;
}
-
}
dbi_destroy(iter);
/* mark & go. */
WFIFOW(inter_fd, 2) = plen;
WFIFOSET(inter_fd, plen);
-
+
sd->vars_dirty = false;
-
+
return 0;
}
@@ -826,7 +823,6 @@ int intif_guild_castle_dataload(int num, int *castle_ids)
return 1;
}
-
// Request change castle guild owner and save data
int intif_guild_castle_datasave(int castle_id,int index, int value)
{
@@ -895,7 +891,6 @@ int intif_homunculus_requestdelete(int homun_id)
}
-
//-----------------------------------------------------------------
// Packets receive from inter server
@@ -999,13 +994,13 @@ void intif_parse_Registers(int fd)
else { //Normally registries should arrive for in log-in chars.
sd = map->id2sd(account_id);
}
-
+
if (!sd || sd->status.char_id != char_id) {
return; //Character registry from another character.
}
-
+
flag = ( sd->vars_received&PRL_ACCG && sd->vars_received&PRL_ACCL && sd->vars_received&PRL_CHAR ) ? 0 : 1;
-
+
switch (RFIFOB(fd,12)) {
case 3: //Character Registry
sd->vars_received |= PRL_CHAR;
@@ -1024,14 +1019,14 @@ void intif_parse_Registers(int fd)
}
/* have it not complain about insertion of vars before loading, and not set those vars as new or modified */
pc->reg_load = true;
-
+
if( RFIFOW(fd, 14) ) {
char key[32];
unsigned int index;
int max = RFIFOW(fd, 14), cursor = 16, i;
-
+
script->parser_current_file = "loading char/acc variables";//for script_add_str to refer to here in case errors occur
-
+
/**
* Vessel!char_reg_num_db
*
@@ -1043,13 +1038,13 @@ void intif_parse_Registers(int fd)
char sval[254];
safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor));
cursor += RFIFOB(fd, cursor) + 1;
-
+
index = RFIFOL(fd, cursor);
cursor += 4;
-
+
safestrncpy(sval, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor));
cursor += RFIFOB(fd, cursor) + 1;
-
+
script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)sval, NULL);
}
/**
@@ -1063,23 +1058,22 @@ void intif_parse_Registers(int fd)
int ival;
safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor));
cursor += RFIFOB(fd, cursor) + 1;
-
+
index = RFIFOL(fd, cursor);
cursor += 4;
-
+
ival = RFIFOL(fd, cursor);
cursor += 4;
-
+
script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)h64BPTRSIZE(ival), NULL);
}
}
-
script->parser_current_file = NULL;/* reset */
}
-
+
/* flag it back */
pc->reg_load = false;
-
+
if (flag && sd->vars_received&PRL_ACCG && sd->vars_received&PRL_ACCL && sd->vars_received&PRL_CHAR)
pc->reg_received(sd); //Received all registry values, execute init scripts and what-not. [Skotlex]
}
@@ -1662,7 +1656,7 @@ void intif_parse_MailDelete(int fd) {
int char_id = RFIFOL(fd,2);
int mail_id = RFIFOL(fd,6);
bool failed = RFIFOB(fd,10);
-
+
if ( (sd = map->charid2sd(char_id)) == NULL) {
ShowError("intif_parse_MailDelete: char not found %d\n", char_id);
return;
@@ -1987,7 +1981,7 @@ int intif_mercenary_create(struct s_mercenary *merc)
void intif_parse_MercenaryReceived(int fd) {
int len = RFIFOW(fd,2) - 5;
-
+
if (sizeof(struct s_mercenary) != len) {
if (battle_config.etc_log)
ShowError("intif: create mercenary data size mismatch %d != %"PRIuS"\n", len, sizeof(struct s_mercenary));
@@ -2067,7 +2061,7 @@ int intif_elemental_create(struct s_elemental *ele)
void intif_parse_ElementalReceived(int fd) {
int len = RFIFOW(fd,2) - 5;
-
+
if (sizeof(struct s_elemental) != len) {
if (battle_config.etc_log)
ShowError("intif: create elemental data size mismatch %d != %"PRIuS"\n", len, sizeof(struct s_elemental));
@@ -2128,8 +2122,6 @@ void intif_parse_ElementalSaved(int fd) {
}
void intif_request_accinfo( int u_fd, int aid, int group_lv, char* query ) {
-
-
WFIFOHEAD(inter_fd,2 + 4 + 4 + 4 + NAME_LENGTH);
WFIFOW(inter_fd,0) = 0x3007;
@@ -2176,7 +2168,7 @@ void intif_itembound_req(int char_id,int aid,int guild_id) {
gstor->lock = 1; //Lock for retrieval process
#endif
}
-
+
//3856
void intif_parse_Itembound_ack(int fd) {
#ifdef GP_BOUND_ITEMS
@@ -2252,11 +2244,11 @@ int intif_parse(int fd)
case 0x383f: intif->pGuildEmblem(fd); break;
case 0x3840: intif->pGuildCastleDataLoad(fd); break;
case 0x3843: intif->pGuildMasterChanged(fd); break;
-
+
//Quest system
case 0x3860: intif->pQuestLog(fd); break;
case 0x3861: intif->pQuestSave(fd); break;
-
+
// Mail System
case 0x3848: intif->pMailInboxReceived(fd); break;
case 0x3849: intif->pMailNew(fd); break;
@@ -2287,7 +2279,7 @@ int intif_parse(int fd)
case 0x387c: intif->pElementalReceived(fd); break;
case 0x387d: intif->pElementalDeleted(fd); break;
case 0x387e: intif->pElementalSaved(fd); break;
-
+
case 0x3880: intif->pCreatePet(fd); break;
case 0x3881: intif->pRecvPetData(fd); break;
case 0x3882: intif->pSavePetOk(fd); break;
@@ -2328,7 +2320,7 @@ void intif_defaults(void) {
/* */
memcpy(intif->packet_len_table,&packet_len_table,sizeof(intif->packet_len_table));
-
+
/* funcs */
intif->parse = intif_parse;
intif->create_pet = intif_create_pet;
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index 86f854ff7..f89bd2f1c 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -36,10 +36,10 @@ int irc_connect_timer(int tid, int64 tick, int id, intptr_t data) {
struct hSockOpt opt;
if( ircbot->isOn || ++ircbot->fails >= 3 )
return 0;
-
+
opt.silent = 1;
opt.setTimeo = 0;
-
+
ircbot->last_try = timer->gettick();
if ((ircbot->fd = sockt->make_connection(ircbot->ip, channel->config->irc_server_port, &opt)) > 0) {
@@ -58,14 +58,14 @@ int irc_connect_timer(int tid, int64 tick, int id, intptr_t data) {
int irc_identify_timer(int tid, int64 tick, int id, intptr_t data) {
if( !ircbot->isOn )
return 0;
-
+
sprintf(send_string, "USER HerculesWS%d 8 * : Hercules IRC Bridge",rnd()%777);
ircbot->send(send_string);
sprintf(send_string, "NICK %s", channel->config->irc_nick);
ircbot->send(send_string);
timer->add(timer->gettick() + 3000, ircbot->join_timer, 0, 0);
-
+
return 0;
}
@@ -76,7 +76,7 @@ int irc_identify_timer(int tid, int64 tick, int id, intptr_t data) {
int irc_join_timer(int tid, int64 tick, int id, intptr_t data) {
if( !ircbot->isOn )
return 0;
-
+
if (channel->config->irc_nick_pw[0] != '\0') {
sprintf(send_string, "PRIVMSG NICKSERV : IDENTIFY %s", channel->config->irc_nick_pw);
ircbot->send(send_string);
@@ -84,7 +84,7 @@ int irc_join_timer(int tid, int64 tick, int id, intptr_t data) {
sprintf(send_string, "PRIVMSG NICKSERV : GHOST %s %s", channel->config->irc_nick, channel->config->irc_nick_pw);
}
}
-
+
sprintf(send_string, "JOIN %s", channel->config->irc_channel);
ircbot->send(send_string);
ircbot->isIn = true;
@@ -125,20 +125,20 @@ int irc_parse(int fd) {
timer->add(timer->gettick() + 120000, ircbot->connect_timer, 0, 0);
return 0;
}
-
+
if( !RFIFOREST(fd) )
return 0;
-
+
parse_string = (char*)RFIFOP(fd,0);
parse_string[ RFIFOREST(fd) - 1 ] = '\0';
-
+
parse_string = strtok_r(parse_string,"\r\n",&str_safe);
-
+
while (parse_string != NULL) {
ircbot->parse_sub(fd,parse_string);
parse_string = strtok_r(NULL,"\r\n",&str_safe);
}
-
+
RFIFOSKIP(fd, RFIFOREST(fd));
RFIFOFLUSH(fd);
return 0;
@@ -158,7 +158,7 @@ void irc_parse_source(char *source, char *nick, char *ident, char *host) {
int i, pos = 0;
size_t len = strlen(source);
unsigned char stage = 0;
-
+
for(i = 0; i < len; i++) {
if( stage == 0 && source[i] == '!' ) {
safestrncpy(nick, &source[0], min(i + 1, IRC_NICK_LENGTH));
@@ -182,29 +182,28 @@ void irc_parse_sub(int fd, char *str) {
char source[180], command[60], buf1[IRC_MESSAGE_LENGTH], buf2[IRC_MESSAGE_LENGTH];
char *target = buf1, *message = buf2;
struct irc_func *func;
-
+
source[0] = command[0] = buf1[0] = buf2[0] = '\0';
-
+
if( str[0] == ':' )
str++;
-
+
if (sscanf(str, "%179s %59s %499s :%499[^\r\n]", source, command, buf1, buf2) == 3 && buf1[0] == ':') {
// source command :message (i.e. QUIT)
message = buf1+1;
target = buf2;
}
-
+
if( command[0] == '\0' )
return;
-
- if( !(func = ircbot->func_search(command)) && !(func = ircbot->func_search(source)) ) {
+
+ if ((func = ircbot->func_search(command)) == NULL && (func = ircbot->func_search(source)) == NULL) {
#ifdef IRCBOT_DEBUG
ShowWarning("Unknown command received %s from %s\n",command,source);
#endif // IRCBOT_DEBUG
return;
}
func->func(fd,command,source,target,message);
-
}
/**
@@ -301,7 +300,7 @@ void irc_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
if( source[0] != '\0' )
ircbot->parse_source(source,source_nick,source_ident,source_host);
-
+
if( ircbot->channel ) {
size_t padding_len = strlen(ircbot->channel->name) + strlen(source_nick) + 13;
while (1) {
@@ -421,26 +420,26 @@ void irc_bot_init(bool minimal) {
channel->config->irc = false;
return;
}
-
+
ircbot->funcs.size = ARRAYLENGTH(irc_func_base);
CREATE(ircbot->funcs.list,struct irc_func*,ircbot->funcs.size);
-
+
for( i = 0; i < ircbot->funcs.size; i++ ) {
-
+
CREATE(function, struct irc_func, 1);
-
+
safestrncpy(function->name, irc_func_base[i].name, sizeof(function->name));
function->func = irc_func_base[i].func;
-
+
ircbot->funcs.list[i] = function;
}
-
+
ircbot->fails = 0;
ircbot->fd = 0;
ircbot->isIn = false;
ircbot->isOn = false;
-
+
timer->add_func_list(ircbot->connect_timer, "irc_connect_timer");
timer->add(timer->gettick() + 7000, ircbot->connect_timer, 0, 0);
}
@@ -450,14 +449,14 @@ void irc_bot_init(bool minimal) {
*/
void irc_bot_final(void) {
int i;
-
+
if (!channel->config->irc)
return;
if( ircbot->isOn ) {
ircbot->send("QUIT :Hercules is shutting down");
sockt->close(ircbot->fd);
}
-
+
for( i = 0; i < ircbot->funcs.size; i++ ) {
aFree(ircbot->funcs.list[i]);
}
@@ -469,25 +468,25 @@ void irc_bot_final(void) {
*/
void ircbot_defaults(void) {
ircbot = &irc_bot_s;
-
+
ircbot->channel = NULL;
-
+
ircbot->init = irc_bot_init;
ircbot->final = irc_bot_final;
-
+
ircbot->parse = irc_parse;
ircbot->parse_sub = irc_parse_sub;
ircbot->parse_source = irc_parse_source;
-
+
ircbot->func_search = irc_func_search;
-
+
ircbot->connect_timer = irc_connect_timer;
ircbot->identify_timer = irc_identify_timer;
ircbot->join_timer = irc_join_timer;
-
+
ircbot->send = irc_send;
ircbot->relay = irc_relay;
-
+
ircbot->pong = irc_pong;
ircbot->privmsg = irc_privmsg;
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 7f5c2224c..ccedee72a 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -160,14 +160,14 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str,
/* [Ind/Hercules] */
int itemdb_chain_item(unsigned short chain_id, int *rate) {
struct item_chain_entry *entry;
-
+
if( chain_id >= itemdb->chain_count ) {
ShowError("itemdb_chain_item: unknown chain id %d\n", chain_id);
return UNKNOWN_ITEM_ID;
}
-
+
entry = &itemdb->chains[chain_id].items[ rnd()%itemdb->chains[chain_id].qty ];
-
+
if( rnd()%10000 >= entry->rate )
return 0;
@@ -178,47 +178,47 @@ int itemdb_chain_item(unsigned short chain_id, int *rate) {
/* [Ind/Hercules] */
void itemdb_package_item(struct map_session_data *sd, struct item_package *package) {
int i = 0, get_count, j, flag;
-
+
for( i = 0; i < package->must_qty; i++ ) {
struct item it;
memset(&it, 0, sizeof(it));
it.nameid = package->must_items[i].id;
it.identify = 1;
-
+
if( package->must_items[i].hours ) {
it.expire_time = (unsigned int)(time(NULL) + ((package->must_items[i].hours*60)*60));
}
-
+
if( package->must_items[i].named ) {
it.card[0] = CARD0_FORGE;
it.card[1] = 0;
it.card[2] = GetWord(sd->status.char_id, 0);
it.card[3] = GetWord(sd->status.char_id, 1);
}
-
+
if( package->must_items[i].announce )
clif->package_announce(sd,package->must_items[i].id,package->id);
-
+
if ( package->must_items[i].force_serial )
it.unique_id = itemdb->unique_id(sd);
get_count = itemdb->isstackable(package->must_items[i].id) ? package->must_items[i].qty : 1;
-
+
it.amount = get_count == 1 ? 1 : get_count;
-
+
for( j = 0; j < package->must_items[i].qty; j += get_count ) {
if ( ( flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT) ) )
clif->additem(sd, 0, 0, flag);
}
}
-
+
if( package->random_qty ) {
for( i = 0; i < package->random_qty; i++ ) {
struct item_package_rand_entry *entry;
-
+
entry = &package->random_groups[i].random_list[rnd()%package->random_groups[i].random_qty];
-
+
while( 1 ) {
if( rnd()%10000 >= entry->rate ) {
entry = entry->next;
@@ -226,28 +226,28 @@ void itemdb_package_item(struct map_session_data *sd, struct item_package *packa
} else {
struct item it;
memset(&it, 0, sizeof(it));
-
+
it.nameid = entry->id;
it.identify = 1;
-
+
if( entry->hours ) {
it.expire_time = (unsigned int)(time(NULL) + ((entry->hours*60)*60));
}
-
+
if( entry->named ) {
it.card[0] = CARD0_FORGE;
it.card[1] = 0;
it.card[2] = GetWord(sd->status.char_id, 0);
it.card[3] = GetWord(sd->status.char_id, 1);
}
-
+
if( entry->announce )
clif->package_announce(sd,entry->id,package->id);
-
+
get_count = itemdb->isstackable(entry->id) ? entry->qty : 1;
-
+
it.amount = get_count == 1 ? 1 : get_count;
-
+
for( j = 0; j < entry->qty; j += get_count ) {
if ( ( flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT) ) )
clif->additem(sd, 0, 0, flag);
@@ -257,9 +257,8 @@ void itemdb_package_item(struct map_session_data *sd, struct item_package *packa
}
}
}
-
- return;
}
+
/*==========================================
* Return a random item id from group. (takes into account % chance giving/tot group)
*------------------------------------------*/
@@ -267,17 +266,17 @@ int itemdb_searchrandomid(struct item_group *group) {
if (group->qty)
return group->nameid[rnd()%group->qty];
-
+
ShowError("itemdb_searchrandomid: No item entries for group id %d\n", group->id);
return UNKNOWN_ITEM_ID;
}
bool itemdb_in_group(struct item_group *group, int nameid) {
int i;
-
+
for( i = 0; i < group->qty; i++ )
if( group->nameid[i] == nameid )
return true;
-
+
return false;
}
@@ -522,7 +521,6 @@ int itemdb_isstackable2(struct item_data *data)
}
}
-
/*==========================================
* Trade Restriction functions [Skotlex]
*------------------------------------------*/
@@ -569,10 +567,10 @@ int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(stru
if (!func(item_data, gmlv, gmlv2))
return 0;
-
+
if(item_data->slot == 0 || itemdb_isspecial(item->card[0]))
return 1;
-
+
for(i = 0; i < item_data->slot; i++) {
if (!item->card[i]) continue;
if (!func(itemdb->search(item->card[i]), gmlv, gmlv2))
@@ -623,12 +621,12 @@ void itemdb_read_groups(void) {
ShowError("can't read %s\n", config_filename);
return;
}
-
+
gsize = aMalloc( libconfig->setting_length(item_group_conf.root) * sizeof(unsigned int) );
-
+
for(i = 0; i < libconfig->setting_length(item_group_conf.root); i++)
gsize[i] = 0;
-
+
i = 0;
while( (itg = libconfig->setting_get_elem(item_group_conf.root,i++)) ) {
const char *name = config_setting_name(itg);
@@ -639,7 +637,7 @@ void itemdb_read_groups(void) {
--i;
continue;
}
-
+
c = 0;
while( (it = libconfig->setting_get_elem(itg,c++)) ) {
if( config_setting_is_list(it) )
@@ -647,19 +645,18 @@ void itemdb_read_groups(void) {
else
gsize[ i - 1 ] += 1;
}
-
}
-
+
i = 0;
CREATE(itemdb->groups, struct item_group, libconfig->setting_length(item_group_conf.root));
itemdb->group_count = (unsigned short)libconfig->setting_length(item_group_conf.root);
-
+
while( (itg = libconfig->setting_get_elem(item_group_conf.root,i++)) ) {
struct item_data *data = itemdb->name2id(config_setting_name(itg));
int ecount = 0;
-
+
data->group = &itemdb->groups[count];
-
+
itemdb->groups[count].id = data->nameid;
itemdb->groups[count].qty = gsize[ count ];
@@ -672,13 +669,13 @@ void itemdb_read_groups(void) {
repeat = libconfig->setting_get_int_elem(it,1);
} else
itname = libconfig->setting_get_string_elem(itg,c - 1);
-
+
if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
if( !( data = itemdb->exists(atoi(itname+2)) ) )
ShowWarning("itemdb_read_groups: unknown item ID '%d' in group '%s'!\n",atoi(itname+2),config_setting_name(itg));
} else if( !( data = itemdb->name2id(itname) ) )
ShowWarning("itemdb_read_groups: unknown item '%s' in group '%s'!\n",itname,config_setting_name(itg));
-
+
itemdb->groups[count].nameid[ecount] = data ? data->nameid : 0;
if( repeat > 1 ) {
//memset would be better? I failed to get the following to work though hu
@@ -689,25 +686,24 @@ void itemdb_read_groups(void) {
}
ecount += repeat;
}
-
count++;
}
-
+
libconfig->destroy(&item_group_conf);
aFree(gsize);
-
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, config_filename);
}
+
/* [Ind/Hercules] - HCache for Packages */
void itemdb_write_cached_packages(const char *config_filename) {
FILE *file;
unsigned short pcount = itemdb->package_count;
unsigned short i;
-
+
if( !(file = HCache->open(config_filename,"wb")) ) {
return;
}
-
+
// first 2 bytes = package count
hwrite(&pcount,sizeof(pcount),1,file);
@@ -741,7 +737,7 @@ void itemdb_write_cached_packages(const char *config_filename) {
for(c = 0; c < random_qty; c++) {
struct item_package_rand_group *group = &itemdb->packages[i].random_groups[c];
unsigned short group_qty = group->random_qty, h;
-
+
//next 2 bytes = how many entries in this group
hwrite(&group_qty,sizeof(group_qty),1,file);
//now we loop into the group's list
@@ -765,9 +761,8 @@ void itemdb_write_cached_packages(const char *config_filename) {
}
}
}
-
fclose(file);
-
+
return;
}
bool itemdb_read_cached_packages(const char *config_filename) {
@@ -778,7 +773,7 @@ bool itemdb_read_cached_packages(const char *config_filename) {
if( !(file = HCache->open(config_filename,"rb")) ) {
return false;
}
-
+
// first 2 bytes = package count
hread(&pcount,sizeof(pcount),1,file);
@@ -790,25 +785,25 @@ bool itemdb_read_cached_packages(const char *config_filename) {
struct item_data *pdata;
struct item_package *package = &itemdb->packages[i];
unsigned short c;
-
+
//into a package, first 2 bytes = id.
hread(&id,sizeof(id),1,file);
//next 2 bytes = must count
hread(&must_qty,sizeof(must_qty),1,file);
//next 2 bytes = random count
hread(&random_qty,sizeof(random_qty),1,file);
-
+
if( !(pdata = itemdb->exists(id)) )
ShowWarning("itemdb_read_cached_packages: unknown package item '%d', skipping..\n",id);
else
pdata->package = &itemdb->packages[i];
-
+
package->id = id;
package->random_qty = random_qty;
package->must_qty = must_qty;
package->must_items = NULL;
package->random_groups = NULL;
-
+
if( package->must_qty ) {
CREATE(package->must_items, struct item_package_must_entry, package->must_qty);
//now we loop into must
@@ -847,13 +842,13 @@ bool itemdb_read_cached_packages(const char *config_filename) {
for(c = 0; c < package->random_qty; c++) {
unsigned short group_qty = 0, h;
struct item_package_rand_entry *prev = NULL;
-
+
//next 2 bytes = how many entries in this group
hread(&group_qty,sizeof(group_qty),1,file);
-
+
package->random_groups[c].random_qty = group_qty;
CREATE(package->random_groups[c].random_list, struct item_package_rand_entry, package->random_groups[c].random_qty);
-
+
//now we loop into the group's list
for(h = 0; h < group_qty; h++) {
struct item_package_rand_entry *entry = &itemdb->packages[i].random_groups[c].random_list[h];
@@ -862,7 +857,7 @@ bool itemdb_read_cached_packages(const char *config_filename) {
struct item_data *data;
if( prev ) prev->next = entry;
-
+
//first 2 byte = item id
hread(&mid,sizeof(mid),1,file);
//next 2 byte = qty
@@ -880,7 +875,7 @@ bool itemdb_read_cached_packages(const char *config_filename) {
if( !(data = itemdb->exists(mid)) )
ShowWarning("itemdb_read_cached_packages: unknown item '%d' in package '%s'!\n",mid,itemdb_name(package->id));
-
+
entry->id = data ? data->nameid : 0;
entry->rate = rate;
entry->hours = hours;
@@ -895,9 +890,7 @@ bool itemdb_read_cached_packages(const char *config_filename) {
}
}
}
-
fclose(file);
-
ShowStatus("Done reading '"CL_WHITE"%hu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"' ("CL_GREEN"C"CL_RESET").\n", pcount, config_filename);
return true;
@@ -914,42 +907,41 @@ void itemdb_read_packages(void) {
int i = 0, count = 0, c = 0, highest_gcount = 0;
unsigned int *must = NULL, *random = NULL, *rgroup = NULL, **rgroups = NULL;
struct item_package_rand_entry **prev = NULL;
-
+
if( HCache->check(config_filename) ) {
if( itemdb->read_cached_packages(config_filename) )
return;
}
-
+
if (libconfig->read_file(&item_packages_conf, config_filename)) {
ShowError("can't read %s\n", config_filename);
return;
}
-
+
must = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int) );
random = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int) );
rgroup = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int) );
rgroups = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int *) );
-
for(i = 0; i < libconfig->setting_length(item_packages_conf.root); i++) {
must[i] = 0;
random[i] = 0;
rgroup[i] = 0;
rgroups[i] = NULL;
}
-
+
/* validate tree, drop poisonous fruits! */
i = 0;
while( (itg = libconfig->setting_get_elem(item_packages_conf.root,i++)) ) {
const char *name = config_setting_name(itg);
-
+
if( !itemdb->name2id(name) ) {
ShowWarning("itemdb_read_packages: unknown package item '%s', skipping..\n",name);
libconfig->setting_remove(item_packages_conf.root, name);
--i;
continue;
}
-
+
c = 0;
while( (it = libconfig->setting_get_elem(itg,c++)) ) {
int rval = 0;
@@ -959,7 +951,7 @@ void itemdb_read_packages(void) {
--c;
continue;
}
-
+
if( rval == 0 )
must[ i - 1 ] += 1;
else {
@@ -976,7 +968,7 @@ void itemdb_read_packages(void) {
for(i = 0; i < highest_gcount; i++) {
prev[i] = NULL;
}
-
+
for(i = 0; i < libconfig->setting_length(item_packages_conf.root); i++ ) {
rgroups[i] = aMalloc( rgroup[i] * sizeof(unsigned int) );
for( c = 0; c < rgroup[i]; c++ ) {
@@ -990,33 +982,33 @@ void itemdb_read_packages(void) {
c = 0;
while( (it = libconfig->setting_get_elem(itg,c++)) ) {
int rval = 0;
- if( ( t = libconfig->setting_get_member(it, "Random")) && ( rval = libconfig->setting_get_int(t) ) > 0 ) {
+ if ((t = libconfig->setting_get_member(it, "Random")) != NULL && (rval = libconfig->setting_get_int(t)) > 0) {
rgroups[i - 1][rval - 1] += 1;
}
}
}
-
+
CREATE(itemdb->packages, struct item_package, libconfig->setting_length(item_packages_conf.root));
itemdb->package_count = (unsigned short)libconfig->setting_length(item_packages_conf.root);
-
+
/* write */
i = 0;
while( (itg = libconfig->setting_get_elem(item_packages_conf.root,i++)) ) {
struct item_data *data = itemdb->name2id(config_setting_name(itg));
int r = 0, m = 0;
-
+
for(r = 0; r < highest_gcount; r++) {
prev[r] = NULL;
}
-
+
data->package = &itemdb->packages[count];
-
+
itemdb->packages[count].id = data->nameid;
itemdb->packages[count].random_groups = NULL;
itemdb->packages[count].must_items = NULL;
itemdb->packages[count].random_qty = rgroup[ i - 1 ];
itemdb->packages[count].must_qty = must[ i - 1 ];
-
+
if( itemdb->packages[count].random_qty ) {
CREATE(itemdb->packages[count].random_groups, struct item_package_rand_group, itemdb->packages[count].random_qty);
for( c = 0; c < itemdb->packages[count].random_qty; c++ ) {
@@ -1029,14 +1021,14 @@ void itemdb_read_packages(void) {
}
if( itemdb->packages[count].must_qty )
CREATE(itemdb->packages[count].must_items, struct item_package_must_entry, itemdb->packages[count].must_qty);
-
+
c = 0;
while( (it = libconfig->setting_get_elem(itg,c++)) ) {
int icount = 1, expire = 0, rate = 10000, gid = 0;
bool announce = false, named = false, force_serial = false;
-
+
itname = config_setting_name(it);
-
+
if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
if( !( data = itemdb->exists(atoi(itname+2)) ) )
ShowWarning("itemdb_read_packages: unknown item ID '%d' in package '%s'!\n",atoi(itname+2),config_setting_name(itg));
@@ -1045,10 +1037,10 @@ void itemdb_read_packages(void) {
if( ( t = libconfig->setting_get_member(it, "Count")) )
icount = libconfig->setting_get_int(t);
-
+
if( ( t = libconfig->setting_get_member(it, "Expire")) )
expire = libconfig->setting_get_int(t);
-
+
if( ( t = libconfig->setting_get_member(it, "Rate")) ) {
if( (rate = (unsigned short)libconfig->setting_get_int(t)) > 10000 ) {
ShowWarning("itemdb_read_packages: invalid rate (%d) for item '%s' in package '%s'!\n",rate,itname,config_setting_name(itg));
@@ -1061,7 +1053,7 @@ void itemdb_read_packages(void) {
if( ( t = libconfig->setting_get_member(it, "Named")) && libconfig->setting_get_bool(t) )
named = true;
-
+
if( ( t = libconfig->setting_get_member(it, "ForceSerial")) && libconfig->setting_get_bool(t) )
force_serial = true;
@@ -1081,12 +1073,12 @@ void itemdb_read_packages(void) {
m++;
} else {
int gidx = gid - 1;
-
+
r = itemdb->packages[count].random_groups[gidx].random_qty;
-
+
if( prev[gidx] )
prev[gidx]->next = &itemdb->packages[count].random_groups[gidx].random_list[r];
-
+
itemdb->packages[count].random_groups[gidx].random_list[r].id = data ? data->nameid : 0;
itemdb->packages[count].random_groups[gidx].random_list[r].qty = icount;
if( (itemdb->packages[count].random_groups[gidx].random_list[r].rate = rate) == 10000 ) {
@@ -1097,17 +1089,16 @@ void itemdb_read_packages(void) {
itemdb->packages[count].random_groups[gidx].random_list[r].named = named == true ? 1 : 0;
itemdb->packages[count].random_groups[gidx].random_list[r].force_serial = force_serial == true ? 1 : 0;
itemdb->packages[count].random_groups[gidx].random_qty += 1;
-
+
prev[gidx] = &itemdb->packages[count].random_groups[gidx].random_list[r];
}
-
}
-
+
for(r = 0; r < highest_gcount; r++) {
if( prev[r] )
prev[r]->next = &itemdb->packages[count].random_groups[r].random_list[0];
}
-
+
for( r = 0; r < itemdb->packages[count].random_qty; r++ ) {
if( itemdb->packages[count].random_groups[r].random_qty == 1 ) {
//item packages don't stop looping until something comes out of them, so if you have only one item in it the drop is guaranteed.
@@ -1116,11 +1107,9 @@ void itemdb_read_packages(void) {
itemdb->packages[count].random_groups[r].random_list[0].rate = 10000;
}
}
-
count++;
}
-
-
+
aFree(must);
aFree(random);
for(i = 0; i < libconfig->setting_length(item_packages_conf.root); i++ ) {
@@ -1129,12 +1118,12 @@ void itemdb_read_packages(void) {
aFree(rgroups);
aFree(rgroup);
aFree(prev);
-
+
libconfig->destroy(&item_packages_conf);
if( HCache->enabled )
itemdb->write_cached_packages(config_filename);
-
+
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, config_filename);
}
@@ -1147,7 +1136,7 @@ void itemdb_read_chains(void) {
const char *config_filename = "db/pre-re/item_chain.conf"; // FIXME hardcoded name
#endif
int i = 0, count = 0;
-
+
if (libconfig->read_file(&item_chain_conf, config_filename)) {
ShowError("can't read %s\n", config_filename);
return;
@@ -1155,7 +1144,7 @@ void itemdb_read_chains(void) {
CREATE(itemdb->chains, struct item_chain, libconfig->setting_length(item_chain_conf.root));
itemdb->chain_count = (unsigned short)libconfig->setting_length(item_chain_conf.root);
-
+
#ifdef ENABLE_CASE_CHECK
script->parser_current_file = config_filename;
#endif // ENABLE_CASE_CHECK
@@ -1165,12 +1154,12 @@ void itemdb_read_chains(void) {
const char *name = config_setting_name(itc);
int c = 0;
config_setting_t *entry = NULL;
-
+
script->set_constant2(name,i-1,0);
itemdb->chains[count].qty = (unsigned short)libconfig->setting_length(itc);
-
+
CREATE(itemdb->chains[count].items, struct item_chain_entry, libconfig->setting_length(itc));
-
+
while( (entry = libconfig->setting_get_elem(itc,c++)) ) {
const char *itname = config_setting_name(entry);
if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
@@ -1178,32 +1167,32 @@ void itemdb_read_chains(void) {
ShowWarning("itemdb_read_chains: unknown item ID '%d' in chain '%s'!\n",atoi(itname+2),name);
} else if( !( data = itemdb->name2id(itname) ) )
ShowWarning("itemdb_read_chains: unknown item '%s' in chain '%s'!\n",itname,name);
-
+
if( prev )
prev->next = &itemdb->chains[count].items[c - 1];
-
+
itemdb->chains[count].items[c - 1].id = data ? data->nameid : 0;
itemdb->chains[count].items[c - 1].rate = data ? libconfig->setting_get_int(entry) : 0;
-
+
prev = &itemdb->chains[count].items[c - 1];
}
-
+
if( prev )
prev->next = &itemdb->chains[count].items[0];
-
+
count++;
}
#ifdef ENABLE_CASE_CHECK
script->parser_current_file = NULL;
#endif // ENABLE_CASE_CHECK
-
+
libconfig->destroy(&item_chain_conf);
-
+
if( !script->get_constant("ITMCHAIN_ORE",&i) )
ShowWarning("itemdb_read_chains: failed to find 'ITMCHAIN_ORE' chain to link to cache!\n");
else
itemdb->chain_cache[ECC_ORE] = i;
-
+
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, config_filename);
}
@@ -1212,21 +1201,19 @@ void itemdb_read_chains(void) {
**/
int itemdb_combo_split_atoi (char *str, int *val) {
int i;
-
+
for (i=0; i<MAX_ITEMS_PER_COMBO; i++) {
if (!str) break;
-
+
val[i] = atoi(str);
-
str = strchr(str,':');
-
if (str)
*str++=0;
}
-
+
if( i == 0 ) //No data found.
return 0;
-
+
return i;
}
/**
@@ -1235,41 +1222,38 @@ int itemdb_combo_split_atoi (char *str, int *val) {
void itemdb_read_combos() {
uint32 lines = 0, count = 0;
char line[1024];
-
char filepath[256];
FILE* fp;
-
+
sprintf(filepath, "%s/%s", map->db_path, DBPATH"item_combo_db.txt");
-
+
if ((fp = fopen(filepath, "r")) == NULL) {
ShowError("itemdb_read_combos: File not found \"%s\".\n", filepath);
return;
}
-
+
// process rows one by one
while(fgets(line, sizeof(line), fp)) {
char *str[2], *p;
-
+
lines++;
if (line[0] == '/' && line[1] == '/')
continue;
-
+
memset(str, 0, sizeof(str));
-
+
p = line;
-
p = trim(p);
-
if (*p == '\0')
continue;// empty line
-
+
if (!strchr(p,',')) {
/* is there even a single column? */
ShowError("itemdb_read_combos: Insufficient columns in line %d of \"%s\", skipping.\n", lines, filepath);
continue;
}
-
+
str[0] = p;
p = strchr(p,',');
*p = '\0';
@@ -1278,12 +1262,12 @@ void itemdb_read_combos() {
str[1] = p;
p = strchr(p,',');
p++;
-
+
if (str[1][0] != '{') {
ShowError("itemdb_read_combos(#1): Invalid format (Script column) in line %d of \"%s\", skipping.\n", lines, filepath);
continue;
}
-
+
/* no ending key anywhere (missing \}\) */
if ( str[1][strlen(str[1])-1] != '}' ) {
ShowError("itemdb_read_combos(#2): Invalid format (Script column) in line %d of \"%s\", skipping.\n", lines, filepath);
@@ -1292,12 +1276,12 @@ void itemdb_read_combos() {
int items[MAX_ITEMS_PER_COMBO];
int v = 0, retcount = 0;
struct item_combo *combo = NULL;
-
+
if((retcount = itemdb->combo_split_atoi(str[0], items)) < 2) {
ShowError("itemdb_read_combos: line %d of \"%s\" doesn't have enough items to make for a combo (min:2), skipping.\n", lines, filepath);
continue;
}
-
+
/* validate */
for(v = 0; v < retcount; v++) {
if( !itemdb->exists(items[v]) ) {
@@ -1308,11 +1292,11 @@ void itemdb_read_combos() {
/* failed at some item */
if( v < retcount )
continue;
-
+
RECREATE(itemdb->combos, struct item_combo*, ++itemdb->combo_count);
-
+
CREATE(combo, struct item_combo, 1);
-
+
combo->count = retcount;
combo->script = script->parse(str[1], filepath, lines, 0, NULL);
combo->id = itemdb->combo_count - 1;
@@ -1320,37 +1304,28 @@ void itemdb_read_combos() {
for( v = 0; v < retcount; v++ ) {
combo->nameid[v] = items[v];
}
-
+
itemdb->combos[itemdb->combo_count - 1] = combo;
-
+
/* populate the items to refer to this combo */
for( v = 0; v < retcount; v++ ) {
struct item_data * it;
int index;
-
+
it = itemdb->exists(items[v]);
-
index = it->combos_count;
-
RECREATE(it->combos, struct item_combo*, ++it->combos_count);
-
it->combos[index] = combo;
}
-
}
-
count++;
}
-
fclose(fp);
-
ShowStatus("Done reading '"CL_WHITE"%"PRIu32""CL_RESET"' entries in '"CL_WHITE"item_combo_db"CL_RESET"'.\n", count);
-
+
return;
}
-
-
/*======================================
* Applies gender restrictions according to settings. [Skotlex]
*======================================*/
@@ -1498,7 +1473,7 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
entry->flag.available = 1;
entry->view_id = 0;
}
-
+
entry->sex = itemdb->gendercheck(entry); //Apply gender filtering.
// Validated. Finally insert it
@@ -1813,7 +1788,7 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
if( (t = libconfig->setting_get_member(it, "ForceSerial")) )
id.flag.force_serial = libconfig->setting_get_bool(t) ? 1 : 0;
-
+
if ( (t = libconfig->setting_get_member(it, "BuyingStore")) )
id.flag.buyingstore = libconfig->setting_get_bool(t) ? 1 : 0;
@@ -1926,7 +1901,7 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
id.flag.available = 1;
id.view_id = i32;
}
-
+
if( libconfig->setting_lookup_string(it, "Script", &str) )
id.script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
@@ -1970,7 +1945,7 @@ int itemdb_readdb_libconfig(const char *filename) {
config_setting_t *itdb, *it;
char filepath[256];
int i = 0, count = 0;
-
+
sprintf(filepath, "%s/%s", map->db_path, filename);
memset(&duplicate,0,sizeof(duplicate));
if( libconfig->read_file(&item_db_conf, filepath) || !(itdb = libconfig->setting_get_member(item_db_conf.root, "item_db")) ) {
@@ -1995,7 +1970,7 @@ int itemdb_readdb_libconfig(const char *filename) {
}
libconfig->destroy(&item_db_conf);
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename);
-
+
return count;
}
@@ -2008,7 +1983,7 @@ int itemdb_readdb_libconfig(const char *filename) {
*/
int itemdb_readdb_sql(const char *tablename) {
int i = 0, count = 0;
-
+
// retrieve all rows from the item database
if( SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `id`, `name_english`, `name_japanese`, `type`,"
" `price_buy`, `price_sell`, `weight`, `atk`,"
@@ -2053,7 +2028,7 @@ uint64 itemdb_unique_id(struct map_session_data *sd) {
void itemdb_read(bool minimal) {
int i;
DBData prev;
-
+
if (map->db_use_sql_item_db) {
const char* item_db_name[] = {
map->item_db_db,
@@ -2070,7 +2045,7 @@ void itemdb_read(bool minimal) {
for(i = 0; i < ARRAYLENGTH(filename); i++)
itemdb->readdb_libconfig(filename[i]);
}
-
+
for( i = 0; i < ARRAYLENGTH(itemdb->array); ++i ) {
if( itemdb->array[i] ) {
if( itemdb->names->put(itemdb->names,DB->str2key(itemdb->array[i]->name),DB->ptr2data(itemdb->array[i]),&prev) ) {
@@ -2079,7 +2054,7 @@ void itemdb_read(bool minimal) {
}
}
}
-
+
if (minimal)
return;
@@ -2164,7 +2139,7 @@ void itemdb_clear(bool total) {
if( itemdb->array[i] )
itemdb->destroy_item_data(itemdb->array[i], 1);
}
-
+
if( itemdb->groups )
{
for( i = 0; i < itemdb->group_count; i++ ) {
@@ -2176,7 +2151,7 @@ void itemdb_clear(bool total) {
itemdb->groups = NULL;
itemdb->group_count = 0;
-
+
if (itemdb->chains) {
for (i = 0; i < itemdb->chain_count; i++) {
if (itemdb->chains[i].items)
@@ -2187,7 +2162,7 @@ void itemdb_clear(bool total) {
itemdb->chains = NULL;
itemdb->chain_count = 0;
-
+
if (itemdb->packages) {
for (i = 0; i < itemdb->package_count; i++) {
if (itemdb->packages[i].random_groups) {
@@ -2203,7 +2178,7 @@ void itemdb_clear(bool total) {
itemdb->packages = NULL;
}
itemdb->package_count = 0;
-
+
if (itemdb->combos) {
for (i = 0; i < itemdb->combo_count; i++) {
if (itemdb->combos[i]->script) // Check if script was loaded
@@ -2215,28 +2190,28 @@ void itemdb_clear(bool total) {
itemdb->combos = NULL;
itemdb->combo_count = 0;
-
+
if (total)
return;
-
+
itemdb->other->clear(itemdb->other, itemdb->final_sub);
-
+
memset(itemdb->array, 0, sizeof(itemdb->array));
-
- db_clear(itemdb->names);
+ db_clear(itemdb->names);
}
+
void itemdb_reload(void) {
struct s_mapiterator* iter;
struct map_session_data* sd;
int i,d,k;
-
+
itemdb->clear(false);
// read new data
itemdb->read(false);
-
+
//Epoque's awesome @reloaditemdb fix - thanks! [Ind]
//- Fixes the need of a @reloadmobdb after a @reloaditemdb to re-link monster drop data
for( i = 0; i < MAX_MOB_DB; i++ ) {
@@ -2257,7 +2232,7 @@ void itemdb_reload(void) {
if (k == MAX_SEARCH)
continue;
-
+
if (id->mob[k].id != i && k != MAX_SEARCH - 1)
memmove(&id->mob[k+1], &id->mob[k], (MAX_SEARCH-k-1)*sizeof(id->mob[0]));
id->mob[k].chance = entry->dropitem[d].p;
@@ -2287,7 +2262,7 @@ void itemdb_reload(void) {
void itemdb_name_constants(void) {
DBIterator *iter = db_iterator(itemdb->names);
struct item_data *data;
-
+
#ifdef ENABLE_CASE_CHECK
script->parser_current_file = "Item Database (Likely an invalid or conflicting AegisName)";
#endif // ENABLE_CASE_CHECK
@@ -2301,7 +2276,7 @@ void itemdb_name_constants(void) {
}
void do_final_itemdb(void) {
itemdb->clear(true);
-
+
itemdb->other->destroy(itemdb->other, itemdb->final_sub);
itemdb->destroy_item_data(&itemdb->dummy, 0);
db_destroy(itemdb->names);
@@ -2318,14 +2293,14 @@ void do_init_itemdb(bool minimal) {
return;
clif->cashshop_load();
-
+
/** it failed? we disable it **/
if( !clif->parse_roulette_db() )
battle_config.feature_roulette = 0;
}
void itemdb_defaults(void) {
itemdb = &itemdb_s;
-
+
itemdb->init = do_init_itemdb;
itemdb->final = do_final_itemdb;
itemdb->reload = itemdb_reload;
diff --git a/src/map/log.c b/src/map/log.c
index 0c5977c05..a74cb27c5 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -54,7 +54,6 @@ char log_picktype2char(e_log_pick_type type) {
return 'X';
}
-
/// obtain log type character for chat logs
char log_chattype2char(e_log_chat_type type) {
switch( type ) {
@@ -70,7 +69,6 @@ char log_chattype2char(e_log_chat_type type) {
return 'O';
}
-
/// check if this item should be logged according the settings
bool should_log_item(int nameid, int amount, int refine, struct item_data *id) {
int filter = logs->config.filter;
@@ -112,7 +110,7 @@ void log_branch_sub_txt(struct map_session_data* sd) {
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_branch, "a") ) == NULL )
return;
time(&curtime);
@@ -145,7 +143,7 @@ void log_pick_sub_txt(int id, int16 m, e_log_pick_type type, int amount, struct
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_pick, "a") ) == NULL )
return;
time(&curtime);
@@ -174,7 +172,6 @@ void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount,
log_pick(sd->status.char_id, sd->bl.m, type, amount, itm, data ? data : itemdb->exists(itm->nameid));
}
-
/// logs item transactions (monsters)
void log_pick_mob(struct mob_data* md, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
nullpo_retv(md);
@@ -192,7 +189,7 @@ void log_zeny_sub_txt(struct map_session_data* sd, e_log_pick_type type, struct
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_zeny, "a") ) == NULL )
return;
time(&curtime);
@@ -222,7 +219,7 @@ void log_mvpdrop_sub_txt(struct map_session_data* sd, int monster_id, int* log_m
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_mvpdrop,"a") ) == NULL )
return;
time(&curtime);
@@ -243,7 +240,7 @@ void log_mvpdrop(struct map_session_data* sd, int monster_id, int* log_mvp)
void log_atcommand_sub_sql(struct map_session_data* sd, const char* message) {
SqlStmt* stmt;
-
+
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_gm, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
@@ -260,7 +257,7 @@ void log_atcommand_sub_txt(struct map_session_data* sd, const char* message) {
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_gm, "a") ) == NULL )
return;
time(&curtime);
@@ -298,7 +295,7 @@ void log_npc_sub_txt(struct map_session_data *sd, const char *message) {
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_npc, "a") ) == NULL )
return;
time(&curtime);
@@ -319,7 +316,7 @@ void log_npc(struct map_session_data* sd, const char* message)
void log_chat_sub_sql(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char* dst_charname, const char* message) {
SqlStmt* stmt;
-
+
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", logs->config.log_chat, logs->chattype2char(type), type_id, src_charid, src_accid, mapname, x, y)
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
@@ -336,7 +333,7 @@ void log_chat_sub_txt(e_log_chat_type type, int type_id, int src_charid, int src
char timestring[255];
time_t curtime;
FILE* logfp;
-
+
if( ( logfp = fopen(logs->config.log_chat, "a") ) == NULL )
return;
time(&curtime);
@@ -363,12 +360,12 @@ void log_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid,
void log_sql_init(void) {
// log db connection
logs->mysql_handle = SQL->Malloc();
-
+
ShowInfo(""CL_WHITE"[SQL]"CL_RESET": Connecting to the Log Database "CL_WHITE"%s"CL_RESET" At "CL_WHITE"%s"CL_RESET"...\n",logs->db_name,logs->db_ip);
if ( SQL_ERROR == SQL->Connect(logs->mysql_handle, logs->db_id, logs->db_pw, logs->db_ip, logs->db_port, logs->db_name) )
exit(EXIT_FAILURE);
ShowStatus(""CL_WHITE"[SQL]"CL_RESET": Successfully '"CL_GREEN"connected"CL_RESET"' to Database '"CL_WHITE"%s"CL_RESET"'.\n", logs->db_name);
-
+
if (map->default_codepage[0] != '\0')
if ( SQL_ERROR == SQL->SetEncoding(logs->mysql_handle, map->default_codepage) )
Sql_ShowDebug(logs->mysql_handle);
@@ -389,7 +386,6 @@ void log_set_defaults(void) {
logs->config.amount_items_log = 100;
}
-
int log_config_read(const char* cfgName) {
static int count = 0;
char line[1024], w1[1024], w2[1024];
@@ -506,7 +502,7 @@ void log_config_complete(void) {
}
void log_defaults(void) {
logs = &log_s;
-
+
sprintf(logs->db_ip,"127.0.0.1");
sprintf(logs->db_id,"ragnarok");
sprintf(logs->db_pw,"ragnarok");
@@ -515,7 +511,7 @@ void log_defaults(void) {
logs->db_port = 3306;
logs->mysql_handle = NULL;
/* */
-
+
logs->pick_pc = log_pick_pc;
logs->pick_mob = log_pick_mob;
logs->zeny = log_zeny;
@@ -524,7 +520,7 @@ void log_defaults(void) {
logs->atcommand = log_atcommand;
logs->branch = log_branch;
logs->mvpdrop = log_mvpdrop;
-
+
/* will be modified in a few seconds once loading is complete. */
logs->pick_sub = log_pick_sub_txt;
logs->zeny_sub = log_zeny_sub_txt;
diff --git a/src/map/mail.c b/src/map/mail.c
index 0bdad2877..e952d9b63 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -83,7 +83,7 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
if( idx < 0 || idx >= MAX_INVENTORY )
return 1;
- if( amount < 0 || amount > sd->status.inventory[idx].amount )
+ if( amount <= 0 || amount > sd->status.inventory[idx].amount )
return 1;
if( !pc_can_give_items(sd) || sd->status.inventory[idx].expire_time ||
!itemdb_canmail(&sd->status.inventory[idx],pc_get_group_level(sd)) ||
@@ -122,6 +122,8 @@ bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg)
memcpy(&msg->item, &sd->status.inventory[n], sizeof(struct item));
msg->item.amount = sd->mail.amount;
+ if (msg->item.amount != sd->mail.amount) // check for amount overflow
+ return false;
}
else
memset(&msg->item, 0x00, sizeof(struct item));
@@ -193,7 +195,7 @@ bool mail_invalid_operation(struct map_session_data *sd) {
void mail_defaults(void)
{
mail = &mail_s;
-
+
mail->clear = mail_clear;
mail->removeitem = mail_removeitem;
mail->removezeny = mail_removezeny;
diff --git a/src/map/map.c b/src/map/map.c
index a7b171ddf..e01a25366 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -111,7 +111,7 @@ int map_usercount(void) {
*------------------------------------------*/
int map_freeblock (struct block_list *bl) {
nullpo_retr(map->block_free_lock, bl);
-
+
if (map->block_free_lock == 0) {
if( bl->type == BL_ITEM )
ers_free(map->flooritem_ers, bl);
@@ -119,10 +119,9 @@ int map_freeblock (struct block_list *bl) {
aFree(bl);
bl = NULL;
} else {
-
if( map->block_free_count >= map->block_free_list_size )
map_block_free_expand();
-
+
map->block_free[map->block_free_count++] = bl;
}
@@ -139,7 +138,6 @@ int map_freeblock_lock (void) {
* Remove the lock on map_bl
*------------------------------------------*/
int map_freeblock_unlock (void) {
-
if ((--map->block_free_lock) == 0) {
int i;
for (i = 0; i < map->block_free_count; i++) {
@@ -375,8 +373,6 @@ int map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
) {
sc->data[SC_PROPERTYWALK]->val3++;
}
-
-
}
/* Guild Aura Moving */
if( bl->type == BL_PC && ((TBL_PC*)bl)->state.gmaster_flag ) {
@@ -840,7 +836,7 @@ static int bl_vgetall_inshootrange(struct block_list *bl, va_list args)
if (!check_distance_bl(center, bl, range))
return 0;
#endif
- if (!path->search_long(NULL, center->m, center->x, center->y, bl->x, bl->y, CELL_CHKWALL))
+ if (!path->search_long(NULL, center, center->m, center->x, center->y, bl->x, bl->y, CELL_CHKWALL))
return 0;
return 1;
}
@@ -1195,7 +1191,7 @@ static int bl_vgetall_inpath(struct block_list *bl, va_list args)
if ( k < 0 || k > len_limit ) //Since more skills use this, check for ending point as well.
return 0;
- if ( k > magnitude2 && !path->search_long(NULL, m, x0, y0, xi, yi, CELL_CHKWALL) )
+ if ( k > magnitude2 && !path->search_long(NULL, NULL, m, x0, y0, xi, yi, CELL_CHKWALL) )
return 0; //Targets beyond the initial ending point need the wall check.
//All these shifts are to increase the precision of the intersection point and distance considering how it's
@@ -1366,7 +1362,6 @@ int map_clearflooritem_timer(int tid, int64 tick, int id, intptr_t data) {
return 1;
}
-
if (pet->search_petDB_index(fitem->item_data.nameid, PET_EGG) >= 0)
intif->delete_petdata(MakeDWord(fitem->item_data.card[1], fitem->item_data.card[2]));
@@ -1397,7 +1392,7 @@ void map_clearflooritem(struct block_list *bl) {
* to place an BL_ITEM object. Scan area is 9x9, returns 1 on success.
* x and y are modified with the target cell when successful.
*------------------------------------------*/
-int map_searchrandfreecell(int16 m,int16 *x,int16 *y,int stack) {
+int map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack) {
int free_cell,i,j;
int free_cells[9][2];
@@ -1407,7 +1402,7 @@ int map_searchrandfreecell(int16 m,int16 *x,int16 *y,int stack) {
for(j=-1;j<=1;j++){
if(j+*x<0 || j+*x>=map->list[m].xs)
continue;
- if(map->getcell(m,j+*x,i+*y,CELL_CHKNOPASS) && !map->getcell(m,j+*x,i+*y,CELL_CHKICEWALL))
+ if (map->getcell(m, bl, j + *x, i + *y, CELL_CHKNOPASS) && !map->getcell(m, bl, j + *x, i + *y, CELL_CHKICEWALL))
continue;
//Avoid item stacking to prevent against exploits. [Skotlex]
if(stack && map->count_oncell(m,j+*x,i+*y, BL_ITEM, 0) > stack)
@@ -1424,7 +1419,6 @@ int map_searchrandfreecell(int16 m,int16 *x,int16 *y,int stack) {
return 1;
}
-
int map_count_sub(struct block_list *bl,va_list ap) {
return 1;
}
@@ -1466,7 +1460,7 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
//No range? Return the target cell then....
*x = bx;
*y = by;
- return map->getcell(m,*x,*y,CELL_CHKREACH);
+ return map->getcell(m, src, *x, *y, CELL_CHKREACH);
}
if (rx >= 0 && ry >= 0) {
@@ -1484,7 +1478,7 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
if (*x == bx && *y == by)
continue; //Avoid picking the same target tile.
- if (map->getcell(m,*x,*y,CELL_CHKREACH)) {
+ if (map->getcell(m, src, *x, *y, CELL_CHKREACH)) {
if(flag&2 && !unit->can_reach_pos(src, *x, *y, 1))
continue;
if(flag&4) {
@@ -1511,7 +1505,7 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
* flag:
* 0x1 - only count standing units
*------------------------------------------*/
-bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
+bool map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag)
{
uint8 dir = 6;
int16 tx = *x;
@@ -1530,7 +1524,7 @@ bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
if(dir%2 == 0 && costrange%MOVE_COST == 0) {
tx = *x+dx*(costrange/MOVE_COST);
ty = *y+dy*(costrange/MOVE_COST);
- if(!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m,tx,ty,CELL_CHKPASS)) {
+ if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) {
*x = tx;
*y = ty;
return true;
@@ -1540,7 +1534,7 @@ bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
else if(dir%2 == 1 && costrange%MOVE_DIAGONAL_COST == 0) {
tx = *x+dx*(costrange/MOVE_DIAGONAL_COST);
ty = *y+dy*(costrange/MOVE_DIAGONAL_COST);
- if(!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m,tx,ty,CELL_CHKPASS)) {
+ if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) {
*x = tx;
*y = ty;
return true;
@@ -1550,14 +1544,14 @@ bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
else if(dir%2 == 1 && costrange%MOVE_COST == 4) {
tx = *x+dx*((dir%4==3)?(costrange/MOVE_COST):1);
ty = *y+dy*((dir%4==1)?(costrange/MOVE_COST):1);
- if(!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m,tx,ty,CELL_CHKPASS)) {
+ if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) {
*x = tx;
*y = ty;
return true;
}
tx = *x+dx*((dir%4==1)?(costrange/MOVE_COST):1);
ty = *y+dy*((dir%4==3)?(costrange/MOVE_COST):1);
- if(!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m,tx,ty,CELL_CHKPASS)) {
+ if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) {
*x = tx;
*y = ty;
return true;
@@ -1591,19 +1585,19 @@ bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
* @first_charid, @second_charid, @third_charid, looting priority
* @flag: &1 MVP item. &2 do stacking check.
*------------------------------------------*/
-int map_addflooritem(struct item *item_data,int amount,int16 m,int16 x,int16 y,int first_charid,int second_charid,int third_charid,int flags)
+int map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags)
{
int r;
struct flooritem_data *fitem=NULL;
nullpo_ret(item_data);
- if (!map->searchrandfreecell(m, &x, &y, (flags&2)?1:0))
+ if (!map->searchrandfreecell(m, bl, &x, &y, (flags&2)?1:0))
return 0;
r=rnd();
fitem = ers_alloc(map->flooritem_ers, struct flooritem_data);
-
+
fitem->bl.type = BL_ITEM;
fitem->bl.prev = fitem->bl.next = NULL;
fitem->bl.m = m;
@@ -1789,7 +1783,7 @@ int map_quit(struct map_session_data *sd) {
//Non-active players should not have loaded any data yet (or it was cleared already) so no additional cleanups are needed.
return 0;
}
-
+
if( sd->expiration_tid != INVALID_TIMER )
timer->delete(sd->expiration_tid,pc->expiration_timer);
@@ -1882,7 +1876,7 @@ int map_quit(struct map_session_data *sd) {
if( sd->state.vending ) {
idb_remove(vending->db, sd->status.char_id);
}
-
+
party->booking_delete(sd); // Party Booking [Spiria]
pc->makesavestatus(sd);
pc->clean_skilltree(sd);
@@ -2567,8 +2561,8 @@ int map_random_dir(struct block_list *bl, int16 *x, int16 *y)
xi = bl->x + segment*dirx[j];
segment = (short)sqrt((float)(dist2 - segment*segment)); //The complement of the previously picked segment
yi = bl->y + segment*diry[j];
- } while ( (map->getcell(bl->m,xi,yi,CELL_CHKNOPASS) || !path->search(NULL,bl->m,bl->x,bl->y,xi,yi,1,CELL_CHKNOREACH))
- && (++i)<100 );
+ } while ((map->getcell(bl->m, bl, xi, yi, CELL_CHKNOPASS) || !path->search(NULL, bl, bl->m, bl->x, bl->y, xi, yi, 1, CELL_CHKNOREACH))
+ && (++i)<100);
if (i < 100) {
*x = xi;
@@ -2640,11 +2634,11 @@ void map_cellfromcache(struct map_data *m) {
/*==========================================
* Confirm if celltype in (m,x,y) match the one given in cellchk
*------------------------------------------*/
-int map_getcell(int16 m,int16 x,int16 y,cell_chk cellchk) {
- return (m < 0 || m >= map->count) ? 0 : map->list[m].getcellp(&map->list[m],x,y,cellchk);
+int map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
+ return (m < 0 || m >= map->count) ? 0 : map->list[m].getcellp(&map->list[m], bl, x, y, cellchk);
}
-int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
+int map_getcellp(struct map_data* m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
struct mapcell cell;
nullpo_ret(m);
@@ -2663,14 +2657,11 @@ int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
// base gat type checks
case CELL_CHKWALL:
return (!cell.walkable && !cell.shootable);
-
case CELL_CHKWATER:
return (cell.water);
-
case CELL_CHKCLIFF:
return (!cell.walkable && cell.shootable);
-
// base cell type checks
case CELL_CHKNPC:
return (cell.npc);
@@ -2715,12 +2706,13 @@ int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
}
/* [Ind/Hercules] */
-int map_sub_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) {
+int map_sub_getcellp(struct map_data* m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
map->cellfromcache(m);
m->getcellp = map->getcellp;
m->setcell = map->setcell;
- return m->getcellp(m,x,y,cellchk);
+ return m->getcellp(m, bl, x, y, cellchk);
}
+
/*==========================================
* Change the type/flags of a map cell
* 'cell' - which flag to modify
@@ -2808,7 +2800,7 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
if( (iwall = (struct iwall_data *)strdb_get(map->iwall_db, wall_name)) != NULL )
return false; // Already Exists
- if( map->getcell(m, x, y, CELL_CHKNOREACH) )
+ if (map->getcell(m, NULL, x, y, CELL_CHKNOREACH))
return false; // Starting cell problem
CREATE(iwall, struct iwall_data, 1);
@@ -2823,13 +2815,13 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
for( i = 0; i < size; i++ ) {
map->iwall_nextxy(x, y, dir, i, &x1, &y1);
- if( map->getcell(m, x1, y1, CELL_CHKNOREACH) )
+ if (map->getcell(m, NULL, x1, y1, CELL_CHKNOREACH))
break; // Collision
map->list[m].setcell(m, x1, y1, CELL_WALKABLE, false);
map->list[m].setcell(m, x1, y1, CELL_SHOOTABLE, shootable);
- clif->changemapcell(0, m, x1, y1, map->getcell(m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
+ clif->changemapcell(0, m, x1, y1, map->getcell(m, NULL, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
iwall->size = i;
@@ -2856,7 +2848,7 @@ void map_iwall_get(struct map_session_data *sd) {
for( i = 0; i < iwall->size; i++ ) {
map->iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
- clif->changemapcell(sd->fd, iwall->m, x1, y1, map->getcell(iwall->m, x1, y1, CELL_GETTYPE), SELF);
+ clif->changemapcell(sd->fd, iwall->m, x1, y1, map->getcell(iwall->m, &sd->bl, x1, y1, CELL_GETTYPE), SELF);
}
}
dbi_destroy(iter);
@@ -2876,7 +2868,7 @@ void map_iwall_remove(const char *wall_name)
map->list[iwall->m].setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
map->list[iwall->m].setcell(iwall->m, x1, y1, CELL_WALKABLE, true);
- clif->changemapcell(0, iwall->m, x1, y1, map->getcell(iwall->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
+ clif->changemapcell(0, iwall->m, x1, y1, map->getcell(iwall->m, NULL, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
map->list[iwall->m].iwall_num--;
@@ -3044,7 +3036,6 @@ int map_readfromcache(struct map_data *m, char *buffer) {
return 0; // Not found
}
-
int map_addmap(const char* mapname) {
map->list[map->count].instance_id = -1;
mapindex->getmapname(mapname, map->list[map->count++].name);
@@ -3081,38 +3072,38 @@ int map_delmap(char* mapname) {
**/
void map_zone_clear_single(struct map_zone_data *zone) {
int i;
-
+
for(i = 0; i < zone->disabled_skills_count; i++) {
aFree(zone->disabled_skills[i]);
}
-
+
if( zone->disabled_skills )
aFree(zone->disabled_skills);
-
+
if( zone->disabled_items )
aFree(zone->disabled_items);
-
+
if( zone->cant_disable_items )
aFree(zone->cant_disable_items);
-
+
for(i = 0; i < zone->mapflags_count; i++) {
aFree(zone->mapflags[i]);
}
-
+
if( zone->mapflags )
aFree(zone->mapflags);
-
+
for(i = 0; i < zone->disabled_commands_count; i++) {
aFree(zone->disabled_commands[i]);
}
-
+
if( zone->disabled_commands )
aFree(zone->disabled_commands);
-
+
for(i = 0; i < zone->capped_skills_count; i++) {
aFree(zone->capped_skills[i]);
}
-
+
if( zone->capped_skills )
aFree(zone->capped_skills);
}
@@ -3122,11 +3113,11 @@ void map_zone_clear_single(struct map_zone_data *zone) {
void map_zone_db_clear(void) {
struct map_zone_data *zone;
DBIterator *iter = db_iterator(map->zone_db);
-
+
for(zone = dbi_first(iter); dbi_exists(iter); zone = dbi_next(iter)) {
map->zone_clear_single(zone);
}
-
+
dbi_destroy(iter);
db_destroy(map->zone_db);/* will aFree(zone) */
@@ -3244,10 +3235,10 @@ void do_final_maps(void) {
if( map->list[i].channel )
channel->delete(map->list[i].channel);
-
+
if( map->list[i].qi_data )
aFree(map->list[i].qi_data);
-
+
if( map->list[i].hdata )
{
for( v = 0; v < map->list[i].hdatac; v++ ) {
@@ -3323,10 +3314,10 @@ void map_flags_init(void) {
map->list[i].misc_damage_rate = 100;
map->list[i].short_damage_rate = 100;
map->list[i].long_damage_rate = 100;
-
+
if( map->list[i].qi_data )
aFree(map->list[i].qi_data);
-
+
map->list[i].qi_data = NULL;
map->list[i].qi_count = 0;
}
@@ -3717,7 +3708,7 @@ int inter_config_read(char *cfgName) {
while (fgets(line, sizeof(line), fp)) {
if (line[0] == '/' && line[1] == '/')
continue;
-
+
if (sscanf(line,"%1023[^:]: %1023[^\r\n]", w1, w2) < 2)
continue;
/* table names */
@@ -3855,34 +3846,32 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
char newzone[MAP_ZONE_NAME_LENGTH];
struct map_zone_data *zone = NULL;
int cursor, i, j;
-
+
sprintf(newzone, "%s+%s",main->name,other->name);
-
+
if( (zone = strdb_get(map->zone_db, newzone)) )
return zone;/* this zone has already been merged */
-
+
CREATE(zone, struct map_zone_data, 1);
-
safestrncpy(zone->name, newzone, MAP_ZONE_NAME_LENGTH);
-
+ zone->merge_type = MZMT_NEVERMERGE;
zone->disabled_skills_count = main->disabled_skills_count + other->disabled_skills_count;
zone->disabled_items_count = main->disabled_items_count + other->disabled_items_count;
zone->mapflags_count = main->mapflags_count + other->mapflags_count;
zone->disabled_commands_count = main->disabled_commands_count + other->disabled_commands_count;
zone->capped_skills_count = main->capped_skills_count + other->capped_skills_count;
-
+
CREATE(zone->disabled_skills, struct map_zone_disabled_skill_entry *, zone->disabled_skills_count );
-
for(i = 0, cursor = 0; i < main->disabled_skills_count; i++, cursor++ ) {
CREATE(zone->disabled_skills[cursor], struct map_zone_disabled_skill_entry, 1 );
memcpy(zone->disabled_skills[cursor], main->disabled_skills[i], sizeof(struct map_zone_disabled_skill_entry));
}
-
+
for(i = 0; i < other->disabled_skills_count; i++, cursor++ ) {
CREATE(zone->disabled_skills[cursor], struct map_zone_disabled_skill_entry, 1 );
memcpy(zone->disabled_skills[cursor], other->disabled_skills[i], sizeof(struct map_zone_disabled_skill_entry));
}
-
+
for(j = 0; j < main->cant_disable_items_count; j++) {
for(i = 0; i < other->disabled_items_count; i++) {
if( other->disabled_items[i] == main->cant_disable_items[j] ) {
@@ -3893,11 +3882,10 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
}
CREATE(zone->disabled_items, int, zone->disabled_items_count );
-
for(i = 0, cursor = 0; i < main->disabled_items_count; i++, cursor++ ) {
zone->disabled_items[cursor] = main->disabled_items[i];
}
-
+
for(i = 0; i < other->disabled_items_count; i++) {
for(j = 0; j < main->cant_disable_items_count; j++) {
if( other->disabled_items[i] == main->cant_disable_items[j] ) {
@@ -3911,45 +3899,40 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
}
CREATE(zone->mapflags, char *, zone->mapflags_count );
-
for(i = 0, cursor = 0; i < main->mapflags_count; i++, cursor++ ) {
CREATE(zone->mapflags[cursor], char, MAP_ZONE_MAPFLAG_LENGTH );
safestrncpy(zone->mapflags[cursor], main->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
}
-
+
for(i = 0; i < other->mapflags_count; i++, cursor++ ) {
CREATE(zone->mapflags[cursor], char, MAP_ZONE_MAPFLAG_LENGTH );
safestrncpy(zone->mapflags[cursor], other->mapflags[i], MAP_ZONE_MAPFLAG_LENGTH);
}
-
+
CREATE(zone->disabled_commands, struct map_zone_disabled_command_entry *, zone->disabled_commands_count);
-
for(i = 0, cursor = 0; i < main->disabled_commands_count; i++, cursor++ ) {
CREATE(zone->disabled_commands[cursor], struct map_zone_disabled_command_entry, 1);
memcpy(zone->disabled_commands[cursor], main->disabled_commands[i], sizeof(struct map_zone_disabled_command_entry));
}
-
+
for(i = 0; i < other->disabled_commands_count; i++, cursor++ ) {
CREATE(zone->disabled_commands[cursor], struct map_zone_disabled_command_entry, 1);
memcpy(zone->disabled_commands[cursor], other->disabled_commands[i], sizeof(struct map_zone_disabled_command_entry));
}
-
+
CREATE(zone->capped_skills, struct map_zone_skill_damage_cap_entry *, zone->capped_skills_count);
-
for(i = 0, cursor = 0; i < main->capped_skills_count; i++, cursor++ ) {
CREATE(zone->capped_skills[cursor], struct map_zone_skill_damage_cap_entry, 1);
memcpy(zone->capped_skills[cursor], main->capped_skills[i], sizeof(struct map_zone_skill_damage_cap_entry));
}
-
+
for(i = 0; i < other->capped_skills_count; i++, cursor++ ) {
CREATE(zone->capped_skills[cursor], struct map_zone_skill_damage_cap_entry, 1);
memcpy(zone->capped_skills[cursor], other->capped_skills[i], sizeof(struct map_zone_skill_damage_cap_entry));
}
-
- zone->info.special = 2;
-
+
+ zone->info.merged = 1;
strdb_put(map->zone_db, newzone, zone);
-
return zone;
}
@@ -3958,17 +3941,17 @@ void map_zone_change2(int m, struct map_zone_data *zone) {
if( map->list[m].zone == zone )
return;
-
- if( map->list[m].zone->info.special != 2 ) /* we don't update it for merged zones! */
+
+ if( !map->list[m].zone->info.merged ) /* we don't update it for merged zones! */
map->list[m].prev_zone = map->list[m].zone;
-
+
if( map->list[m].zone_mf_count )
map->zone_remove(m);
- if( zone->info.special ) {
+ if( zone->merge_type == MZMT_MERGEABLE && map->list[m].prev_zone->merge_type != MZMT_NEVERMERGE ) {
zone = map->merge_zone(zone,map->list[m].prev_zone);
}
-
+
map->zone_apply(m,zone,empty,empty,empty);
}
/* when changing from a mapflag to another during runtime */
@@ -4917,12 +4900,15 @@ void read_map_zone_db(void) {
/* is this the global template? */
if( strncmpi(zonename,MAP_ZONE_NORMAL_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
zone = &map->zone_all;
+ zone->merge_type = MZMT_NEVERMERGE;
is_all = true;
} else if( strncmpi(zonename,MAP_ZONE_PK_NAME,MAP_ZONE_NAME_LENGTH) == 0 ) {
zone = &map->zone_pk;
+ zone->merge_type = MZMT_NEVERMERGE;
is_all = true;
} else {
CREATE( zone, struct map_zone_data, 1 );
+ zone->merge_type = MZMT_NORMAL;
zone->disabled_skills_count = 0;
zone->disabled_items_count = 0;
}
@@ -4987,7 +4973,6 @@ void read_map_zone_db(void) {
if( (libconfig->setting_length(items) - disabled_items_count) > 0 ) { //Some are forcefully enabled
zone->cant_disable_items_count = libconfig->setting_length(items) - disabled_items_count;
CREATE(zone->cant_disable_items, int, zone->cant_disable_items_count);
-
}
for(h = 0, v = 0, j = 0; h < libconfig->setting_length(items); h++) {
config_setting_t *item = libconfig->setting_get_elem(items, h);
@@ -5273,17 +5258,17 @@ void read_map_zone_db(void) {
}
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' zones in '"CL_WHITE"%s"CL_RESET"'.\n", zone_count, config_filename);
- /* not supposed to go in here but in skill_final whatever */
- libconfig->destroy(&map_zone_db);
-
+
/* post-load processing */
if( (zone = strdb_get(map->zone_db, MAP_ZONE_PVP_NAME)) )
- zone->info.special = 1;
+ zone->merge_type = MZMT_MERGEABLE;
if( (zone = strdb_get(map->zone_db, MAP_ZONE_GVG_NAME)) )
- zone->info.special = 1;
+ zone->merge_type = MZMT_MERGEABLE;
if( (zone = strdb_get(map->zone_db, MAP_ZONE_BG_NAME)) )
- zone->info.special = 1;
+ zone->merge_type = MZMT_MERGEABLE;
}
+ /* not supposed to go in here but in skill_final whatever */
+ libconfig->destroy(&map_zone_db);
}
int map_get_new_bonus_id (void) {
@@ -5292,22 +5277,22 @@ int map_get_new_bonus_id (void) {
void map_add_questinfo(int m, struct questinfo *qi) {
unsigned short i;
-
+
/* duplicate, override */
for(i = 0; i < map->list[m].qi_count; i++) {
if( map->list[m].qi_data[i].nd == qi->nd )
break;
}
-
+
if( i == map->list[m].qi_count )
RECREATE(map->list[m].qi_data, struct questinfo, ++map->list[m].qi_count);
-
+
memcpy(&map->list[m].qi_data[i], qi, sizeof(struct questinfo));
}
bool map_remove_questinfo(int m, struct npc_data *nd) {
unsigned short i;
-
+
for(i = 0; i < map->list[m].qi_count; i++) {
struct questinfo *qi = &map->list[m].qi_data[i];
if( qi->nd == nd ) {
@@ -5318,7 +5303,6 @@ bool map_remove_questinfo(int m, struct npc_data *nd) {
return true;
}
}
-
return false;
}
@@ -5397,10 +5381,10 @@ int do_final(void) {
struct s_mapiterator* iter;
ShowStatus("Terminating...\n");
-
+
channel->config->closing = true;
HPM->event(HPET_FINAL);
-
+
if (map->cpsd) aFree(map->cpsd);
//Ladies and babies first.
@@ -5461,7 +5445,7 @@ int do_final(void) {
vending->final();
HPM_map_do_final();
-
+
map->map_db->destroy(map->map_db, map->db_final);
mapindex->final();
@@ -5487,8 +5471,7 @@ int do_final(void) {
aFree(map->block_free);
if( map->bl_list )
aFree(map->bl_list);
-
-
+
if( !map->enable_grf )
aFree(map->cache_buffer);
@@ -5500,7 +5483,7 @@ int do_final(void) {
aFree(map->GRF_PATH_FILENAME);
aFree(map->INTER_CONF_NAME);
aFree(map->LOG_CONF_NAME);
-
+
HPM->event(HPET_POST_FINAL);
ShowStatus("Finished.\n");
@@ -5512,7 +5495,6 @@ int map_abort_sub(struct map_session_data* sd, va_list ap) {
return 1;
}
-
//------------------------------
// Function called when the server
// has received a crash signal.
@@ -5541,7 +5523,6 @@ void set_server_type(void) {
SERVER_TYPE = SERVER_TYPE_MAP;
}
-
/// Called when a terminate signal is received.
void do_shutdown(void)
{
@@ -5593,12 +5574,12 @@ CPCMD(gm_use) {
}
map->cpsd_active = true;
-
+
if( !atcommand->exec(map->cpsd->fd, map->cpsd, line, false) )
ShowInfo("HCP: '"CL_WHITE"%s"CL_RESET"' failed\n",line);
else
ShowInfo("HCP: '"CL_WHITE"%s"CL_RESET"' was used\n",line);
-
+
map->cpsd_active = false;
}
/* Hercules Console Parser */
@@ -5802,11 +5783,10 @@ static CMDLINEARG(loadscript)
**/
static CMDLINEARG(generatetranslations) {
script->lang_export_file = aStrdup("./generated_translations.pot");
-
+
if( !(script->lang_export_fp = fopen(script->lang_export_file,"wb")) ) {
ShowError("export-dialog: failed to open '%s' for writing\n",script->lang_export_file);
}
-
core->runflag = CORE_ST_STOP;
return true;
}
@@ -5838,7 +5818,7 @@ int do_init(int argc, char *argv[])
#ifdef GCOLLECT
GC_enable_incremental();
#endif
-
+
map_load_defaults();
map->INTER_CONF_NAME = aStrdup("conf/inter-server.conf");
@@ -5853,9 +5833,9 @@ int do_init(int argc, char *argv[])
HPM_map_do_init();
cmdline->exec(argc, argv, CMDLINE_OPT_PREINIT);
HPM->config_read();
-
+
HPM->event(HPET_PRE_INIT);
-
+
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
minimal = map->minimal;/* temp (perhaps make minimal a mask with options of what to load? e.g. plugin 1 does minimal |= mob_db; */
if (!minimal) {
@@ -5936,7 +5916,6 @@ int do_init(int argc, char *argv[])
map->readallmaps();
-
if (!minimal) {
timer->add_func_list(map->freeblock_timer, "map_freeblock_timer");
timer->add_func_list(map->clearflooritem_timer, "map_clearflooritem_timer");
@@ -5990,19 +5969,19 @@ int do_init(int argc, char *argv[])
HPM->event(HPET_READY);
exit(EXIT_SUCCESS);
}
-
+
npc->event_do_oninit( false ); // Init npcs (OnInit)
npc->market_fromsql(); /* after OnInit */
-
+
if (battle_config.pk_mode)
ShowNotice("Server is running on '"CL_WHITE"PK Mode"CL_RESET"'.\n");
Sql_HerculesUpdateCheck(map->mysql_handle);
-
+
#ifdef CONSOLE_INPUT
console->input->setSQL(map->mysql_handle);
#endif
-
+
ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port);
if( core->runflag != CORE_ST_STOP ) {
@@ -6033,14 +6012,14 @@ void map_defaults(void) {
map->extra_scripts = NULL;
map->extra_scripts_count = 0;
-
+
sprintf(map->db_path ,"db");
sprintf(map->help_txt ,"conf/help.txt");
sprintf(map->help2_txt ,"conf/help2.txt");
sprintf(map->charhelp_txt ,"conf/charhelp.txt");
-
+
sprintf(map->wisp_server_name ,"Server"); // can be modified in char-server configuration file
-
+
map->autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
map->minsave_interval = 100;
map->save_settings = 0xFFFF;
@@ -6048,18 +6027,18 @@ void map_defaults(void) {
map->agit2_flag = 0;
map->night_flag = 0; // 0=day, 1=night [Yor]
map->enable_spy = 0; //To enable/disable @spy commands, which consume too much cpu time when sending packets. [Skotlex]
-
+
map->db_use_sql_item_db = 0;
map->db_use_sql_mob_db = 0;
map->db_use_sql_mob_skill_db = 0;
-
+
sprintf(map->item_db_db, "item_db");
sprintf(map->item_db2_db, "item_db2");
sprintf(map->mob_db_db, "mob_db");
sprintf(map->mob_db2_db, "mob_db2");
sprintf(map->mob_skill_db_db, "mob_skill_db");
sprintf(map->mob_skill_db2_db, "mob_skill_db2");
-
+
map->INTER_CONF_NAME="conf/inter-server.conf";
map->LOG_CONF_NAME="conf/logs.conf";
map->MAP_CONF_NAME = "conf/map-server.conf";
@@ -6068,7 +6047,7 @@ void map_defaults(void) {
map->SCRIPT_CONF_NAME = "conf/script.conf";
map->MSG_CONF_NAME = "conf/messages.conf";
map->GRF_PATH_FILENAME = "conf/grf-files.txt";
-
+
map->default_codepage[0] = '\0';
map->server_port = 3306;
sprintf(map->server_ip,"127.0.0.1");
@@ -6079,15 +6058,15 @@ void map_defaults(void) {
map->default_lang_str[0] = '\0';
map->cpsd_active = false;
-
+
map->port = 0;
map->users = 0;
map->ip_set = 0;
map->char_ip_set = 0;
map->enable_grf = 0;
-
+
memset(&map->index2mapid, -1, sizeof(map->index2mapid));
-
+
map->id_db = NULL;
map->pc_db = NULL;
map->mobid_db = NULL;
@@ -6106,16 +6085,16 @@ void map_defaults(void) {
map->bl_list = NULL;
map->bl_list_count = 0;
map->bl_list_size = 0;
-
+
//all in a big chunk, respects order
memset(ZEROED_BLOCK_POS(map), 0, ZEROED_BLOCK_SIZE(map));
-
+
map->cpsd = NULL;
map->list = NULL;
-
+
map->iterator_ers = NULL;
map->cache_buffer = NULL;
-
+
map->flooritem_ers = NULL;
/* */
map->bonus_id = SP_LAST_KNOWN;
@@ -6282,19 +6261,17 @@ void map_defaults(void) {
map->abort_sub = map_abort_sub;
map->update_cell_bl = map_update_cell_bl;
-
map->get_new_bonus_id = map_get_new_bonus_id;
-
+
map->add_questinfo = map_add_questinfo;
map->remove_questinfo = map_remove_questinfo;
-
+
map->merge_zone = map_merge_zone;
map->zone_clear_single = map_zone_clear_single;
-
+
/**
* mapit interface
**/
-
mapit = &mapit_s;
mapit->alloc = mapit_alloc;
@@ -6304,5 +6281,4 @@ void map_defaults(void) {
mapit->next = mapit_next;
mapit->prev = mapit_prev;
mapit->exists = mapit_exists;
-
}
diff --git a/src/map/map.h b/src/map/map.h
index d4ab954be..3ac39e54f 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -549,6 +549,12 @@ struct map_zone_skill_damage_cap_entry {
enum map_zone_skill_subtype subtype;
};
+enum map_zone_merge_type {
+ MZMT_NORMAL = 0, ///< MZMT_MERGEABLE zones can merge *into* MZMT_NORMAL zones (but not the converse).
+ MZMT_MERGEABLE, ///< Can merge with other MZMT_MERGEABLE zones and *into* MZMT_NORMAL zones.
+ MZMT_NEVERMERGE, ///< Cannot merge with any zones.
+};
+
#define MAP_ZONE_NAME_LENGTH 60
#define MAP_ZONE_ALL_NAME "All"
#define MAP_ZONE_NORMAL_NAME "Normal"
@@ -560,6 +566,7 @@ struct map_zone_skill_damage_cap_entry {
struct map_zone_data {
char name[MAP_ZONE_NAME_LENGTH];/* 20'd */
+ enum map_zone_merge_type merge_type;
struct map_zone_disabled_skill_entry **disabled_skills;
int disabled_skills_count;
int *disabled_items;
@@ -573,7 +580,7 @@ struct map_zone_data {
struct map_zone_skill_damage_cap_entry **capped_skills;
int capped_skills_count;
struct {
- unsigned int special : 2;/* 1: whether this is a mergeable zone; 2: whether it is a merged zone */
+ unsigned int merged : 1;
} info;
};
@@ -719,7 +726,7 @@ struct map_data {
bool custom_name; ///< Whether the instanced map is using a custom name
/* */
- int (*getcellp)(struct map_data* m,int16 x,int16 y,cell_chk cellchk);
+ int (*getcellp)(struct map_data* m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
void (*setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
char *cellPos;
@@ -924,7 +931,7 @@ END_ZEROED_BLOCK;
void (*zone_change) (int m, struct map_zone_data *zone, const char* start, const char* buffer, const char* filepath);
void (*zone_change2) (int m, struct map_zone_data *zone);
- int (*getcell) (int16 m,int16 x,int16 y,cell_chk cellchk);
+ int (*getcell) (int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
void (*setgatcell) (int16 m, int16 x, int16 y, int gat);
void (*cellfromcache) (struct map_data *m);
@@ -946,7 +953,7 @@ END_ZEROED_BLOCK;
// search and creation
int (*get_new_object_id) (void);
int (*search_freecell) (struct block_list *src, int16 m, int16 *x, int16 *y, int16 rx, int16 ry, int flag);
- bool (*closest_freecell) (int16 m, int16 *x, int16 *y, int type, int flag);
+ bool (*closest_freecell) (int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag);
//
int (*quit) (struct map_session_data *sd);
// npc
@@ -955,7 +962,7 @@ END_ZEROED_BLOCK;
int (*clearflooritem_timer) (int tid, int64 tick, int id, intptr_t data);
int (*removemobs_timer) (int tid, int64 tick, int id, intptr_t data);
void (*clearflooritem) (struct block_list* bl);
- int (*addflooritem) (struct item *item_data,int amount,int16 m,int16 x,int16 y,int first_charid,int second_charid,int third_charid,int flags);
+ int (*addflooritem) (const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags);
// player to map session
void (*addnickdb) (int charid, const char* nick);
void (*delnickdb) (int charid, const char* nick);
@@ -1042,15 +1049,15 @@ END_ZEROED_BLOCK;
void (*do_shutdown) (void);
int (*freeblock_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*searchrandfreecell) (int16 m, int16 *x, int16 *y, int stack);
+ int (*searchrandfreecell) (int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack);
int (*count_sub) (struct block_list *bl, va_list ap);
DBData (*create_charid2nick) (DBKey key, va_list args);
int (*removemobs_sub) (struct block_list *bl, va_list ap);
struct mapcell (*gat2cell) (int gat);
int (*cell2gat) (struct mapcell cell);
- int (*getcellp) (struct map_data *m, int16 x, int16 y, cell_chk cellchk);
+ int (*getcellp) (struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
void (*setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
- int (*sub_getcellp) (struct map_data *m, int16 x, int16 y, cell_chk cellchk);
+ int (*sub_getcellp) (struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
void (*sub_setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
void (*iwall_nextxy) (int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1);
DBData (*create_map_data_other_server) (DBKey key, va_list args);
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index ff37f396d..b26876d39 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -471,7 +471,7 @@ bool read_mercenary_skilldb_sub(char* str[], int columns, int current)
ShowError("read_mercenary_skilldb : Class %d not found in mercenary_db for skill entry.\n", class_);
return false;
}
-
+
skill_id = atoi(str[1]);
if( skill_id < MC_SKILLBASE || skill_id >= MC_SKILLBASE + MAX_MERCSKILL )
{
@@ -501,7 +501,7 @@ void do_init_mercenary(bool minimal) {
mercenary->read_db();
mercenary->read_skilldb();
-
+
timer->add_func_list(mercenary->contract_end_timer, "merc_contract_end_timer");
}
@@ -518,22 +518,21 @@ void mercenary_defaults(void) {
memset(mercenary->db, 0, sizeof(struct s_mercenary_db) * MAX_MERCENARY_CLASS);
/* funcs */
-
mercenary->init = do_init_mercenary;
-
+
mercenary->class = merc_class;
mercenary->get_viewdata = merc_get_viewdata;
-
+
mercenary->create = merc_create;
mercenary->data_received = merc_data_received;
mercenary->save = mercenary_save;
-
+
mercenary->heal = mercenary_heal;
mercenary->dead = mercenary_dead;
-
+
mercenary->delete = merc_delete;
mercenary->contract_stop = merc_contract_stop;
-
+
mercenary->get_lifetime = mercenary_get_lifetime;
mercenary->get_guild = mercenary_get_guild;
mercenary->get_faith = mercenary_get_faith;
@@ -541,14 +540,14 @@ void mercenary_defaults(void) {
mercenary->get_calls = mercenary_get_calls;
mercenary->set_calls = mercenary_set_calls;
mercenary->kills = mercenary_kills;
-
+
mercenary->checkskill = mercenary_checkskill;
mercenary->read_db = read_mercenarydb;
mercenary->read_skilldb = read_mercenary_skilldb;
-
+
mercenary->killbonus = mercenary_killbonus;
mercenary->search_index = merc_search_index;
-
+
mercenary->contract_end_timer = merc_contract_end_timer;
mercenary->read_db_sub = read_mercenarydb_sub;
mercenary->read_skill_db_sub = read_mercenary_skilldb_sub;
diff --git a/src/map/mob.c b/src/map/mob.c
index f64c7e582..2fe9fe8fb 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -291,7 +291,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data) {
status->set_viewdata(&md->bl, md->class_);
status->change_init(&md->bl);
unit->dataset(&md->bl);
-
+
map->addiddb(&md->bl);
return md;
}
@@ -468,7 +468,7 @@ int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const
struct mob_data* md = NULL;
int count, lv;
bool no_guardian_data = false;
-
+
if( ai && ai&0x200 ) {
no_guardian_data = true;
ai &=~ 0x200;
@@ -545,7 +545,7 @@ int mob_once_spawn_area(struct map_session_data* sd, int16 m, int16 x0, int16 y0
x = rnd()%(x1-x0+1)+x0;
y = rnd()%(y1-y0+1)+y0;
j++;
- } while (map->getcell(m,x,y,CELL_CHKNOPASS) && j < max);
+ } while (map->getcell(m, NULL, x, y, CELL_CHKNOPASS) && j < max);
if (j == max)
{// attempt to find an available cell failed
@@ -1079,7 +1079,7 @@ int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
) { //Pick closest target?
#ifdef ACTIVEPATHSEARCH
struct walkpath_data wpd;
- if (!path->search(&wpd, md->bl.m, md->bl.x, md->bl.y, bl->x, bl->y, 0, CELL_CHKNOPASS)) // Count walk path cells
+ if (!path->search(&wpd, &md->bl, md->bl.m, md->bl.x, md->bl.y, bl->x, bl->y, 0, CELL_CHKNOPASS)) // Count walk path cells
return 0;
//Standing monsters use range2, walking monsters use range3
if ((md->ud.walktimer == INVALID_TIMER && wpd.path_len > md->db->range2)
@@ -1344,7 +1344,7 @@ int mob_randomwalk(struct mob_data *md, int64 tick) {
x+=md->bl.x;
y+=md->bl.y;
- if(((x != md->bl.x) || (y != md->bl.y)) && map->getcell(md->bl.m,x,y,CELL_CHKPASS) && unit->walktoxy(&md->bl,x,y,8)){
+ if (((x != md->bl.x) || (y != md->bl.y)) && map->getcell(md->bl.m, &md->bl, x, y, CELL_CHKPASS) && unit->walktoxy(&md->bl, x, y, 8)) {
break;
}
}
@@ -1382,7 +1382,7 @@ int mob_warpchase(struct mob_data *md, struct block_list *target)
return 0; //No need to do a warp chase.
if (md->ud.walktimer != INVALID_TIMER &&
- map->getcell(md->bl.m,md->ud.to_x,md->ud.to_y,CELL_CHKNPC))
+ map->getcell(md->bl.m, &md->bl, md->ud.to_x, md->ud.to_y, CELL_CHKNPC))
return 1; //Already walking to a warp.
//Search for warps within mob's viewing range.
@@ -1819,7 +1819,7 @@ int mob_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
ditem = list->item;
while (ditem) {
struct item_drop *ditem_prev;
- map->addflooritem(&ditem->item_data,ditem->item_data.amount,
+ map->addflooritem(NULL, &ditem->item_data,ditem->item_data.amount,
list->m,list->x,list->y,
list->first_charid,list->second_charid,list->third_charid,0);
ditem_prev = ditem;
@@ -2064,13 +2064,13 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) {
return;
#if PACKETVER >= 20120404
- if( !(md->status.mode&MD_BOSS) ){
+ if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) {
int i;
for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
- if( md->dmglog[i].id ) {
+ if (md->dmglog[i].id) {
struct map_session_data *sd = map->charid2sd(md->dmglog[i].id);
- if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
- clif->monster_hp_bar(md,sd);
+ if (sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE)) // check if in range
+ clif->monster_hp_bar(md, sd);
}
}
}
@@ -2184,7 +2184,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
else
ARR_FIND(0, MAX_PC_FEELHATE, i, temp == sd->hate_mob[i] &&
(battle_config.allow_skill_without_day || pc->sg_info[i].day_func()));
- if(i<MAX_PC_FEELHATE && (temp=pc->checkskill(sd,pc->sg_info[i].bless_id)))
+ if(i<MAX_PC_FEELHATE && (temp=pc->checkskill(sd,pc->sg_info[i].bless_id)) > 0)
bonus += (i==2?20:10)*temp;
}
if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris]
@@ -2371,7 +2371,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if( drop_rate < 1 )
drop_rate = 1;
}
-
+
// attempt to drop the item
if (rnd() % 10000 >= drop_rate)
continue;
@@ -2390,14 +2390,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif->broadcast(message, strlen(message)+1, BC_DEFAULT);
}
-
+
/* heres the thing we got the feature set up however we're still discussing how to best define the ids,
* so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it,
* thus why we're unsure on how to best place the setting) */
/* temp, will not be hardcoded for long thudu. */
if( it->nameid == 7782 || it->nameid == 7783 ) /* for when not hardcoded: add a check on mvp bonus drop as well */
clif->item_drop_announce(mvp_sd, it->nameid, md->name);
-
+
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [Skotlex]
mob->item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly);
@@ -2543,7 +2543,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
clif->additem(mvp_sd,0,0,temp);
- map->addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1);
+ map->addflooritem(&md->bl, &item, 1, mvp_sd->bl.m, mvp_sd->bl.x, mvp_sd->bl.y, mvp_sd->status.char_id, (second_sd?second_sd->status.char_id : 0), (third_sd ? third_sd->status.char_id : 0), 1);
}
//Logs items, MVP prizes [Lupus]
@@ -2574,7 +2574,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if( sd ) {
if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex]
- if( ++sd->mission_count >= 100 && (temp = mob->get_random_id(0, 0xE, sd->status.base_level)) ) {
+ if (++sd->mission_count >= 100 && (temp = mob->get_random_id(0, 0xE, sd->status.base_level)) != 0) {
pc->addfame(sd, 1);
sd->mission_mobid = temp;
pc_setglobalreg(sd,script->add_str("TK_MISSION_ID"), temp);
@@ -2798,19 +2798,19 @@ int mob_class_change (struct mob_data *md, int class_)
/*==========================================
* mob heal, update display hp info of mob for players
*------------------------------------------*/
-void mob_heal(struct mob_data *md,unsigned int heal)
+void mob_heal(struct mob_data *md, unsigned int heal)
{
if (battle_config.show_mob_info&3)
clif->charnameack (0, &md->bl);
-
+
#if PACKETVER >= 20120404
- if( !(md->status.mode&MD_BOSS) ){
+ if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) {
int i;
for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
- if( md->dmglog[i].id ) {
+ if (md->dmglog[i].id) {
struct map_session_data *sd = map->charid2sd(md->dmglog[i].id);
- if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
- clif->monster_hp_bar(md,sd);
+ if (sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE)) // check if in range
+ clif->monster_hp_bar(md, sd);
}
}
}
@@ -3175,7 +3175,8 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) {
case MSC_MASTERHPLTMAXRATE:
flag = ((fbl = mob->getmasterhpltmaxrate(md, ms[i].cond2)) != NULL); break;
case MSC_MASTERATTACKED:
- flag = (md->master_id > 0 && (fbl=map->id2bl(md->master_id)) && unit->counttargeted(fbl) > 0); break;
+ flag = (md->master_id > 0 && (fbl=map->id2bl(md->master_id)) != NULL && unit->counttargeted(fbl) > 0);
+ break;
case MSC_ALCHEMIST:
flag = (md->state.alchemist);
break;
@@ -3307,7 +3308,7 @@ int mobskill_event(struct mob_data *md, struct block_list *src, int64 tick, int
md->state.alchemist = 1;
return mob->skill_use(md, timer->gettick(), MSC_ALCHEMIST);
}
-
+
target_id = md->target_id;
if (!target_id || battle_config.mob_changetarget_byskill)
md->target_id = src->id;
@@ -3703,13 +3704,13 @@ bool mob_parse_dbrow(char** str) {
db->job_exp = (unsigned int)cap_value(exp, 0, UINT_MAX);
mstatus->rhw.range = atoi(str[9]);
-
+
mstatus->rhw.atk = mob_parse_dbrow_cap_value(class_,UINT16_MIN,UINT16_MAX,atoi(str[10]));
mstatus->rhw.atk2 = mob_parse_dbrow_cap_value(class_,UINT16_MIN,UINT16_MAX,atoi(str[11]));
-
+
mstatus->def = mob_parse_dbrow_cap_value(class_,DEFTYPE_MIN,DEFTYPE_MAX,atoi(str[12]));
mstatus->mdef = mob_parse_dbrow_cap_value(class_,DEFTYPE_MIN,DEFTYPE_MAX,atoi(str[13]));
-
+
mstatus->str = mob_parse_dbrow_cap_value(class_,UINT16_MIN,UINT16_MAX,atoi(str[14]));
mstatus->agi = mob_parse_dbrow_cap_value(class_,UINT16_MIN,UINT16_MAX,atoi(str[15]));
mstatus->vit = mob_parse_dbrow_cap_value(class_,UINT16_MIN,UINT16_MAX,atoi(str[16]));
@@ -3944,7 +3945,7 @@ void mob_readdb(void) {
* mob_db table reading
*------------------------------------------*/
int mob_read_sqldb(void) {
- const char* mob_db_name[] = {
+ const char* mob_db_name[] = {
map->mob_db_db,
map->mob_db2_db
};
@@ -4520,7 +4521,7 @@ void mob_readskilldb(void) {
* seems to work though...
*/
int mob_read_sqlskilldb(void) {
- const char* mob_skill_db_name[] = {
+ const char* mob_skill_db_name[] = {
map->mob_skill_db_db,
map->mob_skill_db2_db
};
@@ -4531,7 +4532,6 @@ int mob_read_sqlskilldb(void) {
return 0;
}
-
for( fi = 0; fi < ARRAYLENGTH(mob_skill_db_name); ++fi ) {
uint32 lines = 0, count = 0;
@@ -4646,7 +4646,7 @@ void mob_load(bool minimal) {
void mob_reload(void) {
int i;
-
+
//Mob skills need to be cleared before re-reading them. [Skotlex]
for (i = 0; i < MAX_MOB_DB; i++)
if (mob->db_data[i] && !mob->is_clone(i)) {
@@ -4765,13 +4765,13 @@ void mob_defaults(void) {
//Defines the Manuk/Splendide mob groups for the status reductions [Epoque]
const int mob_manuk[8] = { 1986, 1987, 1988, 1989, 1990, 1997, 1998, 1999 };
const int mob_splendide[5] = { 1991, 1992, 1993, 1994, 1995 };
-
+
mob = &mob_s;
-
+
memset(mob->db_data, 0, sizeof(mob->db_data));
mob->dummy = NULL;
memset(mob->chat_db, 0, sizeof(mob->chat_db));
-
+
memcpy(mob->manuk, mob_manuk, sizeof(mob->manuk));
memcpy(mob->splendide, mob_splendide, sizeof(mob->splendide));
/* */
diff --git a/src/map/npc.c b/src/map/npc.c
index bb0e772ae..a0c14a058 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -271,7 +271,7 @@ int npc_rr_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
if( sd ) sd->npc_idle_timer = INVALID_TIMER;
return 0;//Not logged in anymore OR no longer attached to a npc
}
-
+
switch( sd->npc_idle_type ) {
case NPCT_INPUT:
timeout = NPC_SECURE_TIMEOUT_INPUT;
@@ -281,7 +281,7 @@ int npc_rr_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
break;
//case NPCT_WAIT: var starts with this value
}
-
+
if( DIFF_TICK(tick,sd->npc_idle_tick) > (timeout*1000) ) {
/**
* If we still have the NPC script attached, tell it to stop.
@@ -556,7 +556,7 @@ int npc_timerevent(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
- if( ted->rid && !(sd = map->id2sd(ted->rid)) ) {
+ if (ted->rid && (sd = map->id2sd(ted->rid)) == NULL) {
ShowError("npc_timerevent: Attached player not found.\n");
ers_free(npc->timer_event_ers, ted);
return 0;
@@ -621,7 +621,7 @@ int npc_timerevent_start(struct npc_data* nd, int rid) {
// Check if there is an OnTimer Event
ARR_FIND( 0, nd->u.scr.timeramount, j, nd->u.scr.timer_event[j].timer > nd->u.scr.timer );
- if( nd->u.scr.rid > 0 && !(sd = map->id2sd(nd->u.scr.rid)) ) {
+ if (nd->u.scr.rid > 0 && (sd = map->id2sd(nd->u.scr.rid)) == NULL) {
// Failed to attach timer to this player.
ShowError("npc_timerevent_start: Attached player not found!\n");
return 1;
@@ -670,7 +670,7 @@ int npc_timerevent_stop(struct npc_data* nd)
nullpo_ret(nd);
- if (nd->u.scr.rid && !(sd = map->id2sd(nd->u.scr.rid))) {
+ if (nd->u.scr.rid && (sd = map->id2sd(nd->u.scr.rid)) == NULL) {
ShowError("npc_timerevent_stop: Attached player not found!\n");
return 1;
}
@@ -1099,7 +1099,7 @@ int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
i = 0;
for (ys = y0; ys <= y1 && !i; ys++) {
for(xs = x0; xs <= x1 && !i; xs++) {
- if (map->getcell(m,xs,ys,CELL_CHKNPC))
+ if (map->getcell(m, NULL, xs, ys, CELL_CHKNPC))
i = 1;
}
}
@@ -1239,7 +1239,7 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
if ((nd = npc->checknear(sd,&nd->bl)) == NULL)
return 1;
-
+
//Hidden/Disabled npc.
if (nd->class_ < 0 || nd->option&(OPTION_INVISIBLE|OPTION_HIDE))
return 1;
@@ -1281,7 +1281,7 @@ int npc_scriptcont(struct map_session_data* sd, int id, bool closing) {
nd?(char*)nd->name:"'Unknown NPC'", (int)id);
return 1;
}
-
+
if(id != npc->fake_nd->bl.id) { // Not item script
if ((npc->checknear(sd,target)) == NULL){
ShowWarning("npc_scriptcont: failed npc->checknear test.\n");
@@ -1303,10 +1303,10 @@ int npc_scriptcont(struct map_session_data* sd, int id, bool closing) {
**/
if( sd->progressbar.npc_id && DIFF_TICK(sd->progressbar.timeout,timer->gettick()) > 0 )
return 1;
-
+
if( !sd->st )
return 1;
-
+
if( closing && sd->st->state == CLOSE )
sd->st->state = END;
@@ -1327,12 +1327,11 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) {
return 1;
if ( nd->subtype != SHOP && !(nd->subtype == SCRIPT && nd->u.scr.shop && nd->u.scr.shop->items) ) {
-
if( nd->subtype == SCRIPT )
ShowError("npc_buysellsel: trader '%s' has no shop list!\n",nd->exname);
else
ShowError("npc_buysellsel: no such shop npc %d (%s)\n",id,nd->exname);
-
+
if (sd->npc_id == id)
sd->npc_id = 0;
return 1;
@@ -1340,7 +1339,7 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) {
if (nd->option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?)
return 1;
-
+
if( nd->class_ < 0 && !sd->state.callshop ) {// not called through a script and is not a visible NPC so an invalid call
return 1;
}
@@ -1354,7 +1353,6 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) {
} else {
clif->selllist(sd);
}
-
return 0;
}
@@ -1372,13 +1370,13 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
if( count <= 0 )
return ERROR_TYPE_ITEM_ID;
-
+
if( points < 0 )
return ERROR_TYPE_MONEY;
-
+
if( !(nd = (struct npc_data *)map->id2bl(sd->npc_shopid)) )
return ERROR_TYPE_NPC;
-
+
if( nd->subtype != CASHSHOP ) {
if( nd->subtype == SCRIPT && nd->u.scr.shop && nd->u.scr.shop->type != NST_ZENY && nd->u.scr.shop->type != NST_MARKET ) {
shop = nd->u.scr.shop->item;
@@ -1389,7 +1387,7 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
shop = nd->u.shop.shop_item;
shop_size = nd->u.shop.count;
}
-
+
new_ = 0;
w = 0;
vt = 0; // Global Value
@@ -1426,10 +1424,10 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
if( w + sd->weight > sd->max_weight )
return ERROR_TYPE_INVENTORY_WEIGHT;
-
+
if( pc->inventoryblank(sd) < new_ )
return ERROR_TYPE_INVENTORY_WEIGHT;
-
+
if( points > vt ) points = vt;
// Payment Process ----------------------------------------------------
@@ -1492,7 +1490,7 @@ void npc_market_fromsql(void) {
char name[NAME_LENGTH+1];
int itemid;
int amount;
-
+
if ( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `name`, `itemid`, `amount` FROM `%s`", map->npc_market_data_db)
|| SQL_ERROR == SQL->StmtExecute(stmt)
) {
@@ -1500,15 +1498,15 @@ void npc_market_fromsql(void) {
SQL->StmtFree(stmt);
return;
}
-
+
SQL->StmtBindColumn(stmt, 0, SQLDT_STRING, &name[0], sizeof(name), NULL, NULL);
SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &itemid, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &amount, 0, NULL, NULL);
-
+
while ( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) {
struct npc_data *nd = NULL;
unsigned short i;
-
+
if( !(nd = npc->name2id(name)) ) {
ShowError("npc_market_fromsql: NPC '%s' not found! skipping...\n",name);
npc->market_delfromsql_sub(name, USHRT_MAX);
@@ -1518,22 +1516,20 @@ void npc_market_fromsql(void) {
npc->market_delfromsql_sub(name, USHRT_MAX);
continue;
}
-
+
for(i = 0; i < nd->u.scr.shop->items; i++) {
if( nd->u.scr.shop->item[i].nameid == itemid ) {
nd->u.scr.shop->item[i].qty = amount;
break;
}
}
-
+
if( i == nd->u.scr.shop->items ) {
ShowError("npc_market_fromsql: NPC '%s' does not sell item %d (qty %d), deleting...\n",name,itemid,amount);
npc->market_delfromsql_sub(name, itemid);
continue;
}
-
}
-
SQL->StmtFree(stmt);
}
/**
@@ -1567,10 +1563,9 @@ void npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
* Judges whether to allow and spawn a trader's window.
**/
bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
-
if( !nd->u.scr.shop || !nd->u.scr.shop->items )
return false;
-
+
switch( nd->u.scr.shop->type ) {
case NST_ZENY:
sd->state.callshop = 1;
@@ -1578,12 +1573,12 @@ bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
return true;/* we skip sd->npc_shopid, npc->buysell will set it then when the player selects */
case NST_MARKET: {
unsigned short i;
-
+
for(i = 0; i < nd->u.scr.shop->items; i++) {
if( nd->u.scr.shop->item[i].qty )
break;
}
-
+
/* nothing to display, no items available */
if (i == nd->u.scr.shop->items) {
clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,881));
@@ -1597,9 +1592,7 @@ bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
clif->cashshop_show(sd,nd);
break;
}
-
sd->npc_shopid = nd->bl.id;
-
return true;
}
/**
@@ -1611,21 +1604,19 @@ void npc_trader_update(int master) {
DBIterator* iter;
struct block_list* bl;
struct npc_data *master_nd = map->id2nd(master);
-
+
CREATE(master_nd->u.scr.shop,struct npc_shop_data,1);
-
+
iter = db_iterator(map->id_db);
-
for( bl = (struct block_list*)dbi_first(iter); dbi_exists(iter); bl = (struct block_list*)dbi_next(iter) ) {
if( bl->type == BL_NPC ) {
struct npc_data* nd = (struct npc_data*)bl;
-
+
if( nd->src_id == master ) {
nd->u.scr.shop = master_nd->u.scr.shop;
}
}
}
-
dbi_destroy(iter);
}
/**
@@ -1637,9 +1628,9 @@ void npc_trader_update(int master) {
void npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
char evname[EVENT_NAME_LENGTH];
struct event_data *ev = NULL;
-
+
npc->trader_funds[0] = npc->trader_funds[1] = 0;/* clear */
-
+
switch( nd->u.scr.shop->type ) {
case NST_CASH:
npc->trader_funds[0] = sd->cashPoints;
@@ -1651,14 +1642,14 @@ void npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
ShowError("npc_trader_count_funds: unsupported shop type %d\n",nd->u.scr.shop->type);
return;
}
-
+
snprintf(evname, EVENT_NAME_LENGTH, "%s::OnCountFunds",nd->exname);
-
+
if ( (ev = strdb_get(npc->ev_db, evname)) )
script->run_npc(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id);
else
ShowError("npc_trader_count_funds: '%s' event '%s' not found, operation failed\n",nd->exname,evname);
-
+
/* the callee will rely on npc->trader_funds, upon success script->run updates them */
}
/**
@@ -1674,19 +1665,17 @@ void npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
bool npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int price, int points) {
char evname[EVENT_NAME_LENGTH];
struct event_data *ev = NULL;
-
+
npc->trader_ok = false;/* clear */
-
+
snprintf(evname, EVENT_NAME_LENGTH, "%s::OnPayFunds",nd->exname);
-
if ( (ev = strdb_get(npc->ev_db, evname)) ) {
pc->setreg(sd,script->add_str("@price"),price);
pc->setreg(sd,script->add_str("@points"),points);
-
script->run_npc(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id);
} else
ShowError("npc_trader_pay: '%s' event '%s' not found, operation failed\n",nd->exname,evname);
-
+
return npc->trader_ok;/* run script will deal with it */
}
/*==========================================
@@ -1698,7 +1687,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
struct npc_item_list *shop = NULL;
int i, price, w;
unsigned short shop_size = 0;
-
+
if( amount <= 0 )
return ERROR_TYPE_ITEM_ID;
@@ -1707,7 +1696,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
if( sd->state.trading )
return ERROR_TYPE_EXCHANGE;
-
+
if( !(nd = (struct npc_data *)map->id2bl(sd->npc_shopid)) )
return ERROR_TYPE_NPC;
@@ -1724,12 +1713,12 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
shop = nd->u.shop.shop_item;
shop_size = nd->u.shop.count;
}
-
+
ARR_FIND(0, shop_size, i, shop[i].nameid == nameid);
-
+
if( i == shop_size )
return ERROR_TYPE_ITEM_ID;
-
+
if( shop[i].value <= 0 )
return ERROR_TYPE_ITEM_ID;
@@ -1762,7 +1751,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
}
price = shop[i].value * amount;
-
+
if( points > price )
points = price;
@@ -1772,7 +1761,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
} else {
if( (sd->kafraPoints < points) || (sd->cashPoints < price - points) )
return ERROR_TYPE_MONEY;
-
+
pc->paycash(sd, price, points);
}
@@ -1798,14 +1787,14 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
double z;
int i,j,w,skill_t,new_, idx = skill->get_index(MC_DISCOUNT);
unsigned short shop_size = 0;
-
+
nullpo_retr(3, sd);
nullpo_retr(3, item_list);
-
+
nd = npc->checknear(sd,map->id2bl(sd->npc_shopid));
if( nd == NULL )
return 3;
-
+
if( nd->subtype != SHOP ) {
if( nd->subtype == SCRIPT && nd->u.scr.shop && nd->u.scr.shop->type == NST_ZENY ) {
shop = nd->u.scr.shop->item;
@@ -1816,76 +1805,76 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
shop = nd->u.shop.shop_item;
shop_size = nd->u.shop.count;
}
-
+
z = 0;
w = 0;
new_ = 0;
// process entries in buy list, one by one
for( i = 0; i < n; ++i ) {
int nameid, amount, value;
-
+
// find this entry in the shop's sell list
ARR_FIND( 0, shop_size, j,
item_list[i*2+1] == shop[j].nameid || //Normal items
item_list[i*2+1] == itemdb_viewid(shop[j].nameid) //item_avail replacement
);
-
+
if( j == shop_size )
return 3; // no such item in shop
-
+
amount = item_list[i*2+0];
nameid = item_list[i*2+1] = shop[j].nameid; //item_avail replacement
value = shop[j].value;
-
+
if( !itemdb->exists(nameid) )
return 3; // item no longer in itemdb
-
+
if( !itemdb->isstackable(nameid) && amount > 1 ) {
//Exploit? You can't buy more than 1 of equipment types o.O
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n",
sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);
amount = item_list[i*2+0] = 1;
}
-
+
if( nd->master_nd ) {
// Script-controlled shops decide by themselves, what can be bought and for what price.
continue;
}
-
+
switch( pc->checkadditem(sd,nameid,amount) ) {
case ADDITEM_EXIST:
break;
-
+
case ADDITEM_NEW:
new_++;
break;
-
+
case ADDITEM_OVERAMOUNT:
return 2;
}
-
+
value = pc->modifybuyvalue(sd,value);
-
+
z += (double)value * amount;
w += itemdb_weight(nameid) * amount;
}
-
+
if( nd->master_nd != NULL ) //Script-based shops.
return npc->buylist_sub(sd,n,item_list,nd->master_nd);
-
+
if( z > (double)sd->status.zeny )
return 1; // Not enough Zeny
if( w + sd->weight > sd->max_weight )
return 2; // Too heavy
if( pc->inventoryblank(sd) < new_ )
return 3; // Not enough space to store items
-
+
pc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL);
-
+
for( i = 0; i < n; ++i ) {
int nameid = item_list[i*2+1];
int amount = item_list[i*2+0];
-
+
if (itemdb_type(nameid) == IT_PETEGG) {
pet->create_egg(sd, nameid);
} else {
@@ -1893,16 +1882,16 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = nameid;
item_tmp.identify = 1;
-
+
pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
}
}
-
+
// custom merchant shop exp bonus
if( battle_config.shop_exp > 0 && z > 0 && (skill_t = pc->checkskill2(sd,idx)) > 0 ) {
if( sd->status.skill[idx].flag >= SKILL_FLAG_REPLACED_LV_0 )
skill_t = sd->status.skill[idx].flag - SKILL_FLAG_REPLACED_LV_0;
-
+
if( skill_t > 0 ) {
z = z * (double)skill_t * (double)battle_config.shop_exp/10000.;
if( z < 1 )
@@ -1910,7 +1899,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
pc->gainexp(sd,NULL,0,(int)z, false);
}
}
-
+
return 0;
}
@@ -1923,7 +1912,7 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
double z;
int i,j,w,new_;
unsigned short shop_size = 0;
-
+
nullpo_retr(1, sd);
nullpo_retr(1, p);
@@ -1934,21 +1923,21 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
shop = nd->u.scr.shop->item;
shop_size = nd->u.scr.shop->items;
-
+
z = 0;
w = 0;
new_ = 0;
-
+
// process entries in buy list, one by one
for( i = 0; i < list_size; ++i ) {
int nameid, amount, value;
-
+
// find this entry in the shop's sell list
ARR_FIND( 0, shop_size, j,
p->list[i].ITID == shop[j].nameid || //Normal items
p->list[i].ITID == itemdb_viewid(shop[j].nameid) //item_avail replacement
);
-
+
if( j == shop_size ) /* TODO find official response for this */
return 1; // no such item in shop
@@ -1962,26 +1951,24 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
if( !itemdb->exists(nameid) ) /* TODO find official response for this */
return 1; // item no longer in itemdb
-
+
if( !itemdb->isstackable(nameid) && amount > 1 ) {
//Exploit? You can't buy more than 1 of equipment types o.O
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n",
sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);
amount = p->list[i].qty = 1;
}
-
+
switch( pc->checkadditem(sd,nameid,amount) ) {
case ADDITEM_EXIST:
break;
-
case ADDITEM_NEW:
new_++;
break;
-
case ADDITEM_OVERAMOUNT: /* TODO find official response for this */
return 1;
}
-
+
z += (double)value * amount;
w += itemdb_weight(nameid) * amount;
}
@@ -1996,20 +1983,20 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
return 1; // Not enough space to store items
pc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL);
-
+
for( i = 0; i < list_size; ++i ) {
int nameid = p->list[i].ITID;
int amount = p->list[i].qty;
-
+
j = npc_market_qty[i];
-
+
if( p->list[i].qty > shop[j].qty ) /* wohoo someone tampered with the packet. */
return 1;
-
+
shop[j].qty -= amount;
-
+
npc->market_tosql(nd,j);
-
+
if (itemdb_type(nameid) == IT_PETEGG) {
pet->create_egg(sd, nameid);
} else {
@@ -2017,7 +2004,7 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = nameid;
item_tmp.identify = 1;
-
+
pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
}
}
@@ -2058,18 +2045,18 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li
script->setarray_pc(sd, "@sold_nameid", i, (void*)(intptr_t)sd->status.inventory[idx].nameid, &key_nameid);
script->setarray_pc(sd, "@sold_quantity", i, (void*)(intptr_t)item_list[i*2+1], &key_amount);
-
+
// process item based information into the arrays
script->setarray_pc(sd, "@sold_refine", i, (void*)(intptr_t)sd->status.inventory[idx].refine, &key_refine);
script->setarray_pc(sd, "@sold_attribute", i, (void*)(intptr_t)sd->status.inventory[idx].attribute, &key_attribute);
script->setarray_pc(sd, "@sold_identify", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify);
-
+
for (j = 0; j < MAX_SLOTS; j++) {
// store each of the cards/special info from the item in the array
snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
script->setarray_pc(sd, card_slot, i, (void*)(intptr_t)sd->status.inventory[idx].card[j], &key_card[j]);
}
-
+
}
// invoke event
@@ -2078,7 +2065,6 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li
return 0;
}
-
/// Player item selling to npc shop.
///
/// @param item_list 'n' pairs <index,amount>
@@ -2100,7 +2086,6 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
return 1;
}
-
z = 0;
// verify the sell list
@@ -2246,7 +2231,7 @@ int npc_unload(struct npc_data* nd, bool single)
if( nd->ud && nd->ud != &npc->base_ud ) {
skill->clear_unitgroup(&nd->bl);
}
-
+
npc->remove_map(nd);
map->deliddb(&nd->bl);
if( single )
@@ -2270,7 +2255,7 @@ int npc_unload(struct npc_data* nd, bool single)
aFree(nd->path);/* remove now that no other instances exist */
}
}
-
+
if( single && nd->bl.m != -1 )
map->remove_questinfo(nd->bl.m,nd);
@@ -2284,7 +2269,7 @@ int npc_unload(struct npc_data* nd, bool single)
npc->ev_db->foreach(npc->ev_db,npc->unload_ev,nd->exname); //Clean up all events related
npc->ev_label_db->foreach(npc->ev_label_db,npc->unload_ev_label,nd);
}
-
+
iter = mapit_geteachpc();
for( bl = (struct block_list*)mapit->first(iter); mapit->exists(iter); bl = (struct block_list*)mapit->next(iter) ) {
struct map_session_data *sd = ((TBL_PC*)bl);
@@ -2646,7 +2631,7 @@ const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const char* s
if (retval) *retval = EXIT_FAILURE;
return strchr(start,'\n');;//try next
}
-
+
nd = npc->create_npc(m, x, y);
map->addnpc(m, nd);
npc->parsename(nd, w3, start, buffer, filepath);
@@ -2722,7 +2707,7 @@ const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const char* s
if (retval) *retval = EXIT_FAILURE;
return strchr(start,'\n');//try next
}
-
+
if( strcmp(w2,"cashshop") == 0 )
type = CASHSHOP;
else
@@ -2820,14 +2805,14 @@ const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const char* s
void npc_convertlabel_db(struct npc_label_list* label_list, const char *filepath) {
int i;
-
+
for( i = 0; i < script->label_count; i++ ) {
const char* lname = script->get_str(script->labels[i].key);
int lpos = script->labels[i].pos;
struct npc_label_list* label;
const char *p;
size_t len;
-
+
// In case of labels not terminated with ':', for user defined function support
p = lname;
@@ -2840,9 +2825,9 @@ void npc_convertlabel_db(struct npc_label_list* label_list, const char *filepath
ShowError("npc_parse_script: label name longer than 23 chars! (%s) in file '%s'.\n", lname, filepath);
return;
}
-
+
label = &label_list[i];
-
+
safestrncpy(label->name, lname, sizeof(label->name));
label->pos = lpos;
}
@@ -2958,13 +2943,10 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
if( end == NULL )
return NULL;// (simple) parse error, don't continue
-
script->parser_current_npc_name = w3;
-
scriptroot = script->parse(script_start, filepath, strline(buffer,script_start-buffer), SCRIPT_USE_LABEL_DB, retval);
-
script->parser_current_npc_name = NULL;
-
+
label_list = NULL;
label_list_num = 0;
if( script->label_count ) {
@@ -2994,7 +2976,7 @@ const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, const char*
if( options&NPO_TRADER )
nd->u.scr.trader = true;
nd->u.scr.shop = NULL;
-
+
++npc_script;
nd->bl.type = BL_NPC;
nd->subtype = SCRIPT;
@@ -3116,7 +3098,7 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
if (retval) *retval = EXIT_FAILURE;
return end;//try next
}
-
+
if( type == WARP && sscanf(w4, "%d,%d", &xs, &ys) == 2 );// <spanx>,<spany>
else if( type == SCRIPT && sscanf(w4, "%*[^,],%d,%d", &xs, &ys) == 2);// <sprite id>,<triggerX>,<triggerY>
else if( type == WARP ) {
@@ -3300,7 +3282,7 @@ void npc_setcells(struct npc_data* nd) {
for (i = y-ys; i <= y+ys; i++) {
for (j = x-xs; j <= x+xs; j++) {
- if (map->getcell(m, j, i, CELL_CHKNOPASS))
+ if (map->getcell(m, &nd->bl, j, i, CELL_CHKNOPASS))
continue;
map->list[m].setcell(m, j, i, CELL_NPC, true);
}
@@ -3337,10 +3319,10 @@ void npc_unsetcells(struct npc_data* nd) {
//Locate max range on which we can locate npc cells
//FIXME: does this really do what it's supposed to do? [ultramage]
- for(x0 = x-xs; x0 > 0 && map->getcell(m, x0, y, CELL_CHKNPC); x0--);
- for(x1 = x+xs; x1 < map->list[m].xs-1 && map->getcell(m, x1, y, CELL_CHKNPC); x1++);
- for(y0 = y-ys; y0 > 0 && map->getcell(m, x, y0, CELL_CHKNPC); y0--);
- for(y1 = y+ys; y1 < map->list[m].ys-1 && map->getcell(m, x, y1, CELL_CHKNPC); y1++);
+ for(x0 = x-xs; x0 > 0 && map->getcell(m, &nd->bl, x0, y, CELL_CHKNPC); x0--);
+ for(x1 = x+xs; x1 < map->list[m].xs-1 && map->getcell(m, &nd->bl, x1, y, CELL_CHKNPC); x1++);
+ for(y0 = y-ys; y0 > 0 && map->getcell(m, &nd->bl, x, y0, CELL_CHKNPC); y0--);
+ for(y1 = y+ys; y1 < map->list[m].ys-1 && map->getcell(m, &nd->bl, x, y1, CELL_CHKNPC); y1++);
//Erase this npc's cells
for (i = y-ys; i <= y+ys; i++)
@@ -3485,7 +3467,7 @@ const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const cha
scriptroot = script->parse(script_start, filepath, strline(buffer,start-buffer), SCRIPT_RETURN_EMPTY_SCRIPT, retval);
script->parser_current_npc_name = NULL;
-
+
if( scriptroot == NULL )// parse error, continue
return end;
@@ -3501,7 +3483,6 @@ const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, const cha
return end;
}
-
/*==========================================
* Parse Mob 1 - Parse mob list into each map
* Parse Mob 2 - Actually Spawns Mob
@@ -3783,7 +3764,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
ShowWarning("npc_parse_mapflag: You can't set PvP and BattleGround flags for the same map! Removing BattleGround flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
}
- if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_PVP_NAME)) && map->list[m].zone != zone ) {
+ if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_PVP_NAME)) != NULL && map->list[m].zone != zone ) {
map->zone_change(m,zone,start,buffer,filepath);
} else if ( !state ) {
map->list[m].zone = &map->zone_all;
@@ -3823,7 +3804,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
map->list[m].flag.pvp_nocalcrank=state;
else if (!strcmpi(w3,"gvg")) {
struct map_zone_data *zone;
-
+
map->list[m].flag.gvg = state;
if( state && map->list[m].flag.pvp ) {
map->list[m].flag.pvp = 0;
@@ -3835,7 +3816,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing BattleGround flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
}
- if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_GVG_NAME)) && map->list[m].zone != zone ) {
+ if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_GVG_NAME)) != NULL && map->list[m].zone != zone ) {
map->zone_change(m,zone,start,buffer,filepath);
}
}
@@ -3872,8 +3853,8 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing GvG flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
}
-
- if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_BG_NAME)) && map->list[m].zone != zone ) {
+
+ if( state && (zone = strdb_get(map->zone_db, MAP_ZONE_BG_NAME)) != NULL && map->list[m].zone != zone ) {
map->zone_change(m,zone,start,buffer,filepath);
}
}
@@ -3958,11 +3939,11 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
int skill_id, k;
char skill_name[MAP_ZONE_MAPFLAG_LENGTH], modifier[MAP_ZONE_MAPFLAG_LENGTH];
size_t len = w4 ? strlen(w4) : 0;
-
+
modifier[0] = '\0';
if( w4 )
memcpy(skill_name, w4, MAP_ZONE_MAPFLAG_LENGTH);
-
+
for(k = 0; k < len; k++) {
if( skill_name[k] == '\t' ) {
memcpy(modifier, &skill_name[k+1], len - k);
@@ -3970,7 +3951,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
break;
}
}
-
+
if( modifier[0] == '\0' ) {
ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_unit_duration' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
@@ -3982,9 +3963,9 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
if (retval) *retval = EXIT_FAILURE;
} else {
int idx = map->list[m].unit_count;
-
+
ARR_FIND(0, idx, k, map->list[m].units[k]->skill_id == skill_id);
-
+
if( k < idx ) {
if( atoi(modifier) != 100 )
map->list[m].units[k]->modifier = (unsigned short)atoi(modifier);
@@ -3995,9 +3976,9 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
for( k = 0; k < idx; k++ ) {
if( map->list[m].units[k] == NULL )
continue;
-
+
map->list[m].units[cursor] = map->list[m].units[k];
-
+
cursor++;
}
if( !( map->list[m].unit_count = cursor ) ) {
@@ -4016,12 +3997,12 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
int skill_id, k;
char skill_name[MAP_ZONE_MAPFLAG_LENGTH], modifier[MAP_ZONE_MAPFLAG_LENGTH];
size_t len = w4 ? strlen(w4) : 0;
-
+
modifier[0] = '\0';
-
+
if( w4 )
memcpy(skill_name, w4, MAP_ZONE_MAPFLAG_LENGTH);
-
+
for(k = 0; k < len; k++) {
if( skill_name[k] == '\t' ) {
memcpy(modifier, &skill_name[k+1], len - k);
@@ -4029,7 +4010,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
break;
}
}
-
+
if( modifier[0] == '\0' ) {
ShowWarning("npc_parse_mapflag: Missing 5th param for 'adjust_skill_damage' flag! removing flag from %s in file '%s', line '%d'.\n", map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
@@ -4041,9 +4022,9 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
if (retval) *retval = EXIT_FAILURE;
} else {
int idx = map->list[m].skill_count;
-
+
ARR_FIND(0, idx, k, map->list[m].skills[k]->skill_id == skill_id);
-
+
if( k < idx ) {
if( atoi(modifier) != 100 )
map->list[m].skills[k]->modifier = (unsigned short)atoi(modifier);
@@ -4054,9 +4035,9 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
for( k = 0; k < idx; k++ ) {
if( map->list[m].skills[k] == NULL )
continue;
-
+
map->list[m].skills[cursor] = map->list[m].skills[k];
-
+
cursor++;
}
if( !( map->list[m].skill_count = cursor ) ) {
@@ -4070,11 +4051,10 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
map->list[m].skills[idx]->skill_id = (unsigned short)skill_id;
map->list[m].skills[idx]->modifier = (unsigned short)atoi(modifier);
}
-
}
} else if (!strcmpi(w3,"zone")) {
struct map_zone_data *zone;
-
+
if( !(zone = strdb_get(map->zone_db, w4)) ) {
ShowWarning("npc_parse_mapflag: Invalid zone '%s'! removing flag from %s in file '%s', line '%d'.\n", w4, map->list[m].name, filepath, strline(buffer,start-buffer));
if (retval) *retval = EXIT_FAILURE;
@@ -4451,9 +4431,8 @@ int npc_reload(void) {
npc_last_npd = NULL;
npc_last_path = NULL;
npc_last_ref = NULL;
-
- //Remove all npcs/mobs. [Skotlex]
+ //Remove all npcs/mobs. [Skotlex]
iter = mapit_geteachiddb();
for( bl = (struct block_list*)mapit->first(iter); mapit->exists(iter); bl = (struct block_list*)mapit->next(iter) ) {
switch(bl->type) {
@@ -4580,14 +4559,14 @@ void npc_debug_warps_sub(struct npc_data* nd) {
if (m < 0) return; //Warps to another map, nothing to do about it.
if (nd->u.warp.x == 0 && nd->u.warp.y == 0) return; // random warp
- if (map->getcell(m, nd->u.warp.x, nd->u.warp.y, CELL_CHKNPC)) {
+ if (map->getcell(m, &nd->bl, nd->u.warp.x, nd->u.warp.y, CELL_CHKNPC)) {
ShowWarning("Warp %s at %s(%d,%d) warps directly on top of an area npc at %s(%d,%d)\n",
nd->name,
map->list[nd->bl.m].name, nd->bl.x, nd->bl.y,
map->list[m].name, nd->u.warp.x, nd->u.warp.y
);
}
- if (map->getcell(m, nd->u.warp.x, nd->u.warp.y, CELL_CHKNOPASS)) {
+ if (map->getcell(m, &nd->bl, nd->u.warp.x, nd->u.warp.y, CELL_CHKNOPASS)) {
ShowWarning("Warp %s at %s(%d,%d) warps to a non-walkable tile at %s(%d,%d)\n",
nd->name,
map->list[nd->bl.m].name, nd->bl.x, nd->bl.y,
@@ -4617,7 +4596,7 @@ int do_init_npc(bool minimal) {
npc->base_ud.attackabletime =
npc->base_ud.canact_tick =
npc->base_ud.canmove_tick = timer->gettick();
-
+
//Stock view data for normal npcs.
memset(&npc_viewdb, 0, sizeof(npc_viewdb));
@@ -4645,12 +4624,12 @@ int do_init_npc(bool minimal) {
npc_process_files(START_NPC_NUM);
}
-
+
if (!minimal) {
map->zone_init();
-
+
npc->motd = npc->name2id("HerculesMOTD"); /* [Ind/Hercules] */
-
+
// set up the events cache
memset(script_event, 0, sizeof(script_event));
npc->read_event_script();
@@ -4662,7 +4641,7 @@ int do_init_npc(bool minimal) {
timer->add_func_list(npc->event_do_clock,"npc_event_do_clock");
timer->add_func_list(npc->timerevent,"npc_timerevent");
}
-
+
if( script->lang_export_fp ) {
ShowInfo("Lang exported to '%s'\n",script->lang_export_file);
fclose(script->lang_export_fp);
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 0b9023ede..503dbd845 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -80,7 +80,6 @@ struct pcre_interface *libpcre;
* deletes a pset
*/
-
/**
* delete everything associated with a entry
*
@@ -102,9 +101,9 @@ struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) {
struct npc_parse *npcParse = nd->chatdb;
if (npcParse == NULL)
nd->chatdb = npcParse = (struct npc_parse *)aCalloc(sizeof(struct npc_parse), 1);
-
+
pcreset = npcParse->active;
-
+
while (pcreset != NULL) {
if (pcreset->setid == setid)
break;
@@ -112,13 +111,13 @@ struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) {
}
if (pcreset == NULL)
pcreset = npcParse->inactive;
-
+
while (pcreset != NULL) {
if (pcreset->setid == setid)
break;
pcreset = pcreset->next;
}
-
+
if (pcreset == NULL) {
pcreset = (struct pcrematch_set *)aCalloc(sizeof(struct pcrematch_set), 1);
pcreset->next = npcParse->inactive;
@@ -128,7 +127,6 @@ struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) {
npcParse->inactive = pcreset;
pcreset->setid = setid;
}
-
return pcreset;
}
@@ -157,7 +155,7 @@ void activate_pcreset(struct npc_data* nd, int setid)
pcreset->prev->next = pcreset->next;
else
npcParse->inactive = pcreset->next;
-
+
pcreset->prev = NULL;
pcreset->next = npcParse->active;
if (pcreset->next != NULL)
@@ -195,7 +193,7 @@ void deactivate_pcreset(struct npc_data* nd, int setid)
pcreset->prev->next = pcreset->next;
else
npcParse->active = pcreset->next;
-
+
pcreset->prev = NULL;
pcreset->next = npcParse->inactive;
if (pcreset->next != NULL)
@@ -230,27 +228,26 @@ void delete_pcreset(struct npc_data* nd, int setid)
}
if (pcreset == NULL)
return;
-
+
if (pcreset->next != NULL)
pcreset->next->prev = pcreset->prev;
if (pcreset->prev != NULL)
pcreset->prev->next = pcreset->next;
-
+
if(active)
npcParse->active = pcreset->next;
else
npcParse->inactive = pcreset->next;
-
+
pcreset->prev = NULL;
pcreset->next = NULL;
-
+
while (pcreset->head) {
struct pcrematch_entry* n = pcreset->head->next;
npc_chat->finalize_pcrematch_entry(pcreset->head);
aFree(pcreset->head); // Cleaning the last ones.. [Lance]
pcreset->head = n;
}
-
aFree(pcreset);
}
@@ -261,25 +258,25 @@ struct pcrematch_entry* create_pcrematch_entry(struct pcrematch_set* set)
{
struct pcrematch_entry * e = (struct pcrematch_entry *) aCalloc(sizeof(struct pcrematch_entry), 1);
struct pcrematch_entry * last = set->head;
-
+
// Normally we would have just stuck it at the end of the list but
// this doesn't sink up with peoples usage pattern. They wanted
// the items defined first to have a higher priority then the
// items defined later. as a result, we have to do some work up front.
-
+
/* if we are the first pattern, stick us at the end */
if (last == NULL) {
set->head = e;
return e;
}
-
+
/* Look for the last entry */
while (last->next != NULL)
last = last->next;
-
+
last->next = e;
e->next = NULL;
-
+
return e;
}
@@ -290,7 +287,7 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c
{
const char *err;
int erroff;
-
+
struct pcrematch_set * s = npc_chat->lookup_pcreset(nd, setid);
struct pcrematch_entry *e = npc_chat->create_pcrematch_entry(s);
e->pattern = aStrdup(pattern);
@@ -310,13 +307,13 @@ void npc_chat_finalize(struct npc_data* nd)
struct npc_parse *npcParse = nd->chatdb;
if (npcParse == NULL)
return;
-
+
while(npcParse->active)
npc_chat->delete_pcreset(nd, npcParse->active->setid);
-
+
while(npcParse->inactive)
npc_chat->delete_pcreset(nd, npcParse->inactive->setid);
-
+
// Additional cleaning up [Lance]
aFree(npcParse);
}
@@ -334,15 +331,15 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
struct npc_label_list* lst;
struct pcrematch_set* pcreset;
struct pcrematch_entry* e;
-
+
// Not interested in anything you might have to say...
if (npcParse == NULL || npcParse->active == NULL)
return 0;
-
+
msg = va_arg(ap,char*);
len = va_arg(ap,int);
sd = va_arg(ap,struct map_session_data *);
-
+
// iterate across all active sets
for (pcreset = npcParse->active; pcreset != NULL; pcreset = pcreset->next)
{
@@ -350,7 +347,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
for (e = pcreset->head; e != NULL; e = e->next)
{
int offsets[2*10 + 10]; // 1/3 reserved for temp space required by pcre_exec
-
+
// perform pattern match
int r = libpcre->exec(e->pcre_, e->pcre_extra_, msg, len, 0, 0, offsets, ARRAYLENGTH(offsets));
if (r > 0)
@@ -363,7 +360,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
libpcre->copy_substring(msg, offsets, r, i, val, sizeof(val));
script->set_var(sd, var, val);
}
-
+
// find the target label.. this sucks..
lst = nd->u.scr.label_list;
ARR_FIND(0, nd->u.scr.label_list_num, i, strncmp(lst[i].name, e->label, sizeof(lst[i].name)) == 0);
@@ -371,14 +368,13 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
ShowWarning("npc_chat_sub: Unable to find label: %s\n", e->label);
return 0;
}
-
+
// run the npc script
script->run_npc(nd->u.scr.script,lst[i].pos,sd->bl.id,nd->bl.id);
return 0;
}
}
}
-
return 0;
}
@@ -388,7 +384,7 @@ BUILDIN(defpattern) {
const char* pattern = script_getstr(st,3);
const char* label = script_getstr(st,4);
struct npc_data* nd = (struct npc_data *)map->id2bl(st->oid);
-
+
npc_chat->def_pattern(nd, setid, pattern, label);
return true;
@@ -397,7 +393,7 @@ BUILDIN(defpattern) {
BUILDIN(activatepset) {
int setid = script_getnum(st,2);
struct npc_data* nd = (struct npc_data *)map->id2bl(st->oid);
-
+
npc_chat->activate_pcreset(nd, setid);
return true;
@@ -406,16 +402,16 @@ BUILDIN(activatepset) {
BUILDIN(deactivatepset) {
int setid = script_getnum(st,2);
struct npc_data* nd = (struct npc_data *)map->id2bl(st->oid);
-
+
npc_chat->deactivate_pcreset(nd, setid);
-
+
return true;
}
BUILDIN(deletepset) {
int setid = script_getnum(st,2);
struct npc_data* nd = (struct npc_data *)map->id2bl(st->oid);
-
+
npc_chat->delete_pcreset(nd, setid);
return true;
@@ -423,7 +419,7 @@ BUILDIN(deletepset) {
void npc_chat_defaults(void) {
npc_chat = &npc_chat_s;
-
+
npc_chat->sub = npc_chat_sub;
npc_chat->finalize = npc_chat_finalize;
npc_chat->def_pattern = npc_chat_def_pattern;
@@ -433,9 +429,9 @@ void npc_chat_defaults(void) {
npc_chat->activate_pcreset = activate_pcreset;
npc_chat->lookup_pcreset = lookup_pcreset;
npc_chat->finalize_pcrematch_entry = finalize_pcrematch_entry;
-
+
libpcre = &libpcre_s;
-
+
libpcre->compile = pcre_compile;
libpcre->study = pcre_study;
libpcre->exec = pcre_exec;
diff --git a/src/map/packets.h b/src/map/packets.h
index 1f465b833..ffa40ff7c 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -2818,7 +2818,6 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0A22,5); // HEADER_ZC_RECV_ROULETTE_ITEM
#endif
-
// 2014-10-22bRagexe - YomRawr
#if PACKETVER >= 20141022
packet(0x0369,7,clif->pActionRequest,2,6);
@@ -2896,7 +2895,7 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0923,36,clif->pStoragePassword,0);
packet(0x09e8,11,clif->pDull); //CZ_OPEN_MAILBOX
packet(0x0a2e,6,clif->pDull); //TITLE
-#endif
+#endif
/* PacketKeys: http://herc.ws/board/topic/1105-hercules-wpe-free-june-14th-patch/ */
#if PACKETVER >= 20110817
diff --git a/src/map/party.c b/src/map/party.c
index 472c03423..db285a4b4 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -98,7 +98,7 @@ TBL_PC* party_sd_check(int party_id, int account_id, int char_id) {
}
int party_db_final(DBKey key, DBData *data, va_list ap) {
struct party_data *p;
-
+
if ((p = DB->data2ptr(data))) {
if (p->instance)
aFree(p->instance);
@@ -114,7 +114,6 @@ int party_db_final(DBKey key, DBData *data, va_list ap) {
aFree(p->hdata);
}
}
-
return 0;
}
/// Party data lookup using party id.
@@ -168,7 +167,6 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
return 0;
}
-
void party_created(int account_id,int char_id,int fail,int party_id,char *name) {
struct map_session_data *sd;
sd=map->id2sd(account_id);
@@ -500,7 +498,6 @@ int party_member_added(int party_id,int account_id,int char_id, int flag) {
break;
}
}
-
return 0;
}
@@ -600,7 +597,7 @@ int party_broken(int party_id)
instance->list[p->instance[j]].owner_id = 0;
}
}
-
+
for( i = 0; i < MAX_PARTY; i++ ) {
if( p->data[i].sd!=NULL ) {
clif->party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10);
@@ -690,7 +687,7 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
//Change leadership.
p->party.member[mi].leader = 0;
p->party.member[tmi].leader = 1;
-
+
/** update members **/
clif->PartyLeaderChanged(p->data[mi].sd, p->data[mi].sd->status.account_id, p->data[tmi].sd->status.account_id);
@@ -955,13 +952,13 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
base_exp_bonus = base_exp;
job_exp_bonus = job_exp;
#endif
-
+
for (i = 0; i < c; i++) {
#ifdef RENEWAL_EXP
if( !(src && src->type == BL_MOB && ((TBL_MOB*)src)->db->mexp) ){
struct mob_data *md = (TBL_MOB*)src;
int rate = pc->level_penalty_mod(md->level - (sd[i])->status.base_level, md->status.race, md->status.mode, 1);
-
+
base_exp = (unsigned int)cap_value(base_exp_bonus * rate / 100, 1, UINT_MAX);
job_exp = (unsigned int)cap_value(job_exp_bonus * rate / 100, 1, UINT_MAX);
}
@@ -1118,7 +1115,7 @@ int party_sub_count_chorus(struct block_list *bl, va_list ap) {
if (sd->state.autotrade)
return 0;
-
+
if (battle_config.idle_no_share && pc_isidle(sd))
return 0;
@@ -1189,9 +1186,8 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
#ifndef PARTY_RECRUIT
struct party_booking_ad_info *pb_ad;
int i;
-
+
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
-
if( pb_ad == NULL )
{
pb_ad = party->create_booking_data();
@@ -1202,17 +1198,17 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
clif->PartyBookingRegisterAck(sd, 2);
return;
}
-
+
memcpy(pb_ad->charname,sd->status.name,NAME_LENGTH);
pb_ad->expiretime = (int)time(NULL);
pb_ad->p_detail.level = level;
pb_ad->p_detail.mapid = mapid;
-
+
for(i=0;i<PARTY_BOOKING_JOBS;i++)
if(job[i] != 0xFF)
pb_ad->p_detail.job[i] = job[i];
else pb_ad->p_detail.job[i] = -1;
-
+
clif->PartyBookingRegisterAck(sd, 0);
clif->PartyBookingInsertNotify(sd, pb_ad); // Notice
#else
@@ -1244,26 +1240,25 @@ void party_booking_update(struct map_session_data *sd, short* job) {
#ifndef PARTY_RECRUIT
int i;
struct party_booking_ad_info *pb_ad;
-
+
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
-
+
if( pb_ad == NULL )
return;
-
+
pb_ad->expiretime = (int)time(NULL);// Update time.
-
+
for(i=0;i<PARTY_BOOKING_JOBS;i++)
if(job[i] != 0xFF)
pb_ad->p_detail.job[i] = job[i];
else pb_ad->p_detail.job[i] = -1;
-
+
clif->PartyBookingUpdateNotify(sd, pb_ad);
#else
return;
#endif
}
-
void party_recruit_search(struct map_session_data *sd, short level, short mapid, unsigned long lastindex, short resultcount) {
#ifdef PARTY_RECRUIT
struct party_booking_ad_info *pb_ad;
@@ -1302,9 +1297,9 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
struct party_booking_ad_info* result_list[PARTY_BOOKING_RESULTS];
bool more_result = false;
DBIterator* iter = db_iterator(party->booking_db);
-
+
memset(result_list, 0, sizeof(result_list));
-
+
for( pb_ad = dbi_first(iter); dbi_exists(iter); pb_ad = dbi_next(iter) ) {
if (pb_ad->index < lastindex || (level && (pb_ad->p_detail.level < level-15 || pb_ad->p_detail.level > level)))
continue;
@@ -1334,7 +1329,6 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
#endif
}
-
bool party_booking_delete(struct map_session_data *sd)
{
struct party_booking_ad_info* pb_ad;
@@ -1384,7 +1378,7 @@ void party_defaults(void) {
party->searchname = party_searchname;
party->getmemberid = party_getmemberid;
party->getavailablesd = party_getavailablesd;
-
+
party->create = party_create;
party->created = party_created;
party->request_info = party_request_info;
diff --git a/src/map/path.c b/src/map/path.c
index 723fd8e8f..a482fc473 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -69,7 +69,7 @@ static const unsigned char walk_choices [3][3] =
* Find the closest reachable cell, 'count' cells away from (x0,y0) in direction (dx,dy).
* Income after the coordinates of the blow
*------------------------------------------*/
-int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
+int path_blownpos(struct block_list *bl, int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
{
struct map_data *md;
@@ -88,7 +88,7 @@ int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
}
while( count > 0 && (dx != 0 || dy != 0) ) {
- if( !md->getcellp(md,x0+dx,y0+dy,CELL_CHKPASS) )
+ if (!md->getcellp(md, bl, x0 + dx, y0 + dy, CELL_CHKPASS))
break;
x0 += dx;
@@ -102,7 +102,7 @@ int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
/*==========================================
* is ranged attack from (x0,y0) to (x1,y1) possible?
*------------------------------------------*/
-bool path_search_long(struct shootpath_data *spd,int16 m,int16 x0,int16 y0,int16 x1,int16 y1,cell_chk cell)
+bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,int16 x0,int16 y0,int16 x1,int16 y1,cell_chk cell)
{
int dx, dy;
int wx = 0, wy = 0;
@@ -159,7 +159,7 @@ bool path_search_long(struct shootpath_data *spd,int16 m,int16 x0,int16 y0,int16
spd->y[spd->len] = y0;
spd->len++;
}
- if (md->getcellp(md,x0,y0,cell))
+ if (md->getcellp(md, bl, x0, y0, cell))
return false;
}
@@ -236,7 +236,7 @@ static int add_path(struct node_heap *heap, struct path_node *tp, int16 x, int16
* flag: &1 = easy path search only
* cell: type of obstruction to check for
*------------------------------------------*/
-bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell)
+bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell)
{
register int i, j, x, y, dx, dy;
struct map_data *md;
@@ -250,13 +250,13 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
md = &map->list[m];
//Do not check starting cell as that would get you stuck.
- if (x0 < 0 || x0 >= md->xs || y0 < 0 || y0 >= md->ys /*|| md->getcellp(md,x0,y0,cell)*/)
+ if (x0 < 0 || x0 >= md->xs || y0 < 0 || y0 >= md->ys /*|| md->getcellp(md, bl, x0, y0, cell)*/)
return false;
// Check destination cell
- if (x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || md->getcellp(md,x1,y1,cell))
+ if (x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || md->getcellp(md, bl, x1, y1, cell))
return false;
-
+
if( x0 == x1 && y0 == y1 ) {
wpd->path_len = 0;
wpd->path_pos = 0;
@@ -287,7 +287,7 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
if( dx == 0 && dy == 0 )
break; // success
- if( md->getcellp(md,x,y,cell) )
+ if (md->getcellp(md, bl, x, y, cell))
break; // obstacle = failure
}
@@ -360,26 +360,26 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
break;
}
- if (y < ys && !md->getcellp(md, x, y+1, cell)) allowed_dirs |= DIR_NORTH;
- if (y > 0 && !md->getcellp(md, x, y-1, cell)) allowed_dirs |= DIR_SOUTH;
- if (x < xs && !md->getcellp(md, x+1, y, cell)) allowed_dirs |= DIR_EAST;
- if (x > 0 && !md->getcellp(md, x-1, y, cell)) allowed_dirs |= DIR_WEST;
+ if (y < ys && !md->getcellp(md, bl, x, y+1, cell)) allowed_dirs |= DIR_NORTH;
+ if (y > 0 && !md->getcellp(md, bl, x, y-1, cell)) allowed_dirs |= DIR_SOUTH;
+ if (x < xs && !md->getcellp(md, bl, x+1, y, cell)) allowed_dirs |= DIR_EAST;
+ if (x > 0 && !md->getcellp(md, bl, x-1, y, cell)) allowed_dirs |= DIR_WEST;
#define chk_dir(d) ((allowed_dirs & (d)) == (d))
// Process neighbors of current node
- if (chk_dir(DIR_SOUTH|DIR_EAST) && !md->getcellp(md, x+1, y-1, cell))
+ if (chk_dir(DIR_SOUTH|DIR_EAST) && !md->getcellp(md, bl, x+1, y-1, cell))
e += add_path(&open_set, tp, x+1, y-1, g_cost + MOVE_DIAGONAL_COST, current, heuristic(x+1, y-1, x1, y1)); // (x+1, y-1) 5
if (chk_dir(DIR_EAST))
e += add_path(&open_set, tp, x+1, y, g_cost + MOVE_COST, current, heuristic(x+1, y, x1, y1)); // (x+1, y) 6
- if (chk_dir(DIR_NORTH|DIR_EAST) && !md->getcellp(md, x+1, y+1, cell))
+ if (chk_dir(DIR_NORTH|DIR_EAST) && !md->getcellp(md, bl, x+1, y+1, cell))
e += add_path(&open_set, tp, x+1, y+1, g_cost + MOVE_DIAGONAL_COST, current, heuristic(x+1, y+1, x1, y1)); // (x+1, y+1) 7
if (chk_dir(DIR_NORTH))
e += add_path(&open_set, tp, x, y+1, g_cost + MOVE_COST, current, heuristic(x, y+1, x1, y1)); // (x, y+1) 0
- if (chk_dir(DIR_NORTH|DIR_WEST) && !md->getcellp(md, x-1, y+1, cell))
+ if (chk_dir(DIR_NORTH|DIR_WEST) && !md->getcellp(md, bl, x-1, y+1, cell))
e += add_path(&open_set, tp, x-1, y+1, g_cost + MOVE_DIAGONAL_COST, current, heuristic(x-1, y+1, x1, y1)); // (x-1, y+1) 1
if (chk_dir(DIR_WEST))
e += add_path(&open_set, tp, x-1, y, g_cost + MOVE_COST, current, heuristic(x-1, y, x1, y1)); // (x-1, y) 2
- if (chk_dir(DIR_SOUTH|DIR_WEST) && !md->getcellp(md, x-1, y-1, cell))
+ if (chk_dir(DIR_SOUTH|DIR_WEST) && !md->getcellp(md, bl, x-1, y-1, cell))
e += add_path(&open_set, tp, x-1, y-1, g_cost + MOVE_DIAGONAL_COST, current, heuristic(x-1, y-1, x1, y1)); // (x-1, y-1) 3
if (chk_dir(DIR_SOUTH))
e += add_path(&open_set, tp, x, y-1, g_cost + MOVE_COST, current, heuristic(x, y-1, x1, y1)); // (x, y-1) 4
@@ -409,7 +409,6 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x
return false;
}
-
//Distance functions, taken from http://www.flipcode.com/articles/article_fastdistance.shtml
bool check_distance(int dx, int dy, int distance)
{
@@ -489,7 +488,7 @@ int distance_client(int dx, int dy)
void path_defaults(void) {
path = &path_s;
-
+
path->blownpos = path_blownpos;
path->search_long = path_search_long;
path->search = path_search;
diff --git a/src/map/path.h b/src/map/path.h
index 2ece8f84b..14885d566 100644
--- a/src/map/path.h
+++ b/src/map/path.h
@@ -42,11 +42,11 @@ struct shootpath_data {
struct path_interface {
// calculates destination cell for knockback
- int (*blownpos) (int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count);
+ int (*blownpos) (struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count);
// tries to find a walkable path
- bool (*search) (struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell);
+ bool (*search) (struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell);
// tries to find a shootable path
- bool (*search_long) (struct shootpath_data *spd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell);
+ bool (*search_long) (struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell);
bool (*check_distance) (int dx, int dy, int distance);
unsigned int (*distance) (int dx, int dy);
bool (*check_distance_client) (int dx, int dy, int distance);
diff --git a/src/map/pc.c b/src/map/pc.c
index 49b8f1f94..dc7014701 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -40,6 +40,7 @@
#include "common/cbasetypes.h"
#include "common/conf.h"
#include "common/core.h" // get_svn_revision()
+#include "common/HPM.h"
#include "common/malloc.h"
#include "common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS
#include "common/nullpo.h"
@@ -126,7 +127,7 @@ void pc_setinvincibletimer(struct map_session_data* sd, int val) {
nullpo_retv(sd);
val += map->list[sd->bl.m].invincible_time_inc;
-
+
if( sd->invincible_timer != INVALID_TIMER )
timer->delete(sd->invincible_timer,pc->invincible_timer);
sd->invincible_timer = timer->add(timer->gettick()+val,pc->invincible_timer,sd->bl.id,0);
@@ -187,7 +188,7 @@ int pc_getmaxspiritball(struct map_session_data *sd, int min) {
nullpo_ret(sd);
result = pc->checkskill(sd, MO_CALLSPIRITS);
-
+
if ( min && result < min )
result = min;
else if ( sd->sc.data[SC_RAISINGDRAGON] )
@@ -516,7 +517,7 @@ void pc_rental_expire(struct map_session_data *sd, int i) {
}
break;
}
-
+
clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
}
@@ -622,14 +623,12 @@ int pc_makesavestatus(struct map_session_data *sd)
sd->status.last_point.x = 0;
sd->status.last_point.y = 0;
}
-
+
if( sd->status.save_point.map == 0 ) {
sd->status.save_point.map = 1;
sd->status.save_point.x = 0;
sd->status.save_point.y = 0;
}
-
-
return 0;
}
@@ -915,7 +914,7 @@ int pc_isequip(struct map_session_data *sd,int n)
if(pc_has_permission(sd, PC_PERM_USE_ALL_EQUIPMENT))
return 1;
-
+
if (item->elv && sd->status.base_level < (unsigned int)item->elv) {
clif->msgtable(sd, MSG_ITEM_CANT_EQUIP_LVL);
return 0;
@@ -1047,7 +1046,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if( sd->status.clothes_color < MIN_CLOTH_COLOR || sd->status.clothes_color > MAX_CLOTH_COLOR ) {
sd->status.clothes_color = MIN_CLOTH_COLOR;
}
-
+
//Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation.
if(!sd->status.hp) pc_setdead(sd);
sd->state.connect_new = 1;
@@ -1079,7 +1078,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->hchsysch_tick = tick;
sd->idletime = sockt->last_tick;
-
+
for(i = 0; i < MAX_SPIRITBALL; i++)
sd->spirit_timer[i] = INVALID_TIMER;
for(i = 0; i < ARRAYLENGTH(sd->autobonus); i++)
@@ -1105,11 +1104,11 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if( sd->status.option & OPTION_INVISIBLE && !pc->can_use_command(sd, "@hide") )
sd->status.option &=~ OPTION_INVISIBLE;
-
+
status->change_init(&sd->bl);
-
+
sd->sc.option = sd->status.option; //This is the actual option used in battle.
-
+
//Set here because we need the inventory data for weapon sprite parsing.
status->set_viewdata(&sd->bl, sd->status.class_);
unit->dataset(&sd->bl);
@@ -1118,25 +1117,25 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->guild_y = -1;
sd->disguise = -1;
-
+
sd->instance = NULL;
sd->instances = 0;
-
+
sd->bg_queue.arena = NULL;
sd->bg_queue.ready = 0;
sd->bg_queue.client_has_bg_data = 0;
sd->bg_queue.type = 0;
-
+
sd->queues = NULL;
sd->queues_count = 0;
-
+
sd->state.dialog = 0;
-
+
sd->delayed_damage = 0;
-
+
if( battle_config.item_check )
sd->state.itemcheck = 1;
-
+
// Event Timers
for( i = 0; i < MAX_EVENTTIMER; i++ )
sd->eventtimer[i] = INVALID_TIMER;
@@ -1156,9 +1155,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->vars_dirty = false;
sd->vars_ok = false;
sd->vars_received = 0x0;
-
+
sd->lang_id = map->default_lang_id;
-
+
//warp player
if ((i=pc->setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i);
@@ -1193,7 +1192,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sprintf(buf, msg_sd(sd,1295), sysinfo->vcstype(), sysinfo->vcsrevision_src(), sysinfo->vcsrevision_scripts()); // %s revision '%s' (src) / '%s' (scripts)
clif->message(sd->fd, buf);
}
-
+
if (expiration_time != 0) {
sd->expiration_time = expiration_time;
}
@@ -1222,7 +1221,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
/* [Ind/Hercules] */
sd->sc_display = NULL;
sd->sc_display_count = 0;
-
+
// Request all registries (auth is considered completed whence they arrive)
intif->request_registry(sd,7);
return true;
@@ -1305,7 +1304,7 @@ int pc_reg_received(struct map_session_data *sd)
if ((i = pc->checkskill(sd,RG_PLAGIARISM)) > 0) {
sd->cloneskill_id = pc_readglobalreg(sd,script->add_str("CLONE_SKILL"));
- if (sd->cloneskill_id > 0 && (idx = skill->get_index(sd->cloneskill_id))) {
+ if (sd->cloneskill_id > 0 && (idx = skill->get_index(sd->cloneskill_id)) > 0) {
sd->status.skill[idx].id = sd->cloneskill_id;
sd->status.skill[idx].lv = pc_readglobalreg(sd,script->add_str("CLONE_SKILL_LV"));
if (sd->status.skill[idx].lv > i)
@@ -1315,7 +1314,7 @@ int pc_reg_received(struct map_session_data *sd)
}
if ((i = pc->checkskill(sd,SC_REPRODUCE)) > 0) {
sd->reproduceskill_id = pc_readglobalreg(sd,script->add_str("REPRODUCE_SKILL"));
- if( sd->reproduceskill_id > 0 && (idx = skill->get_index(sd->reproduceskill_id))) {
+ if( sd->reproduceskill_id > 0 && (idx = skill->get_index(sd->reproduceskill_id)) > 0) {
sd->status.skill[idx].id = sd->reproduceskill_id;
sd->status.skill[idx].lv = pc_readglobalreg(sd,script->add_str("REPRODUCE_SKILL_LV"));
if( i < sd->status.skill[idx].lv)
@@ -1323,7 +1322,7 @@ int pc_reg_received(struct map_session_data *sd)
sd->status.skill[idx].flag = SKILL_FLAG_PLAGIARIZED;
}
}
-
+
//Weird... maybe registries were reloaded?
if (sd->state.active)
return 0;
@@ -1369,7 +1368,7 @@ int pc_reg_received(struct map_session_data *sd)
clif->message(sd->fd, msg_sd(sd,11)); // Invisible: On
// decrement the number of pvp players on the map
map->list[sd->bl.m].users_pvp--;
-
+
if( map->list[sd->bl.m].flag.pvp && !map->list[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {// unregister the player for ranking
timer->delete( sd->pvp_timer, pc->calc_pvprank_timer );
sd->pvp_timer = INVALID_TIMER;
@@ -1379,7 +1378,7 @@ int pc_reg_received(struct map_session_data *sd)
if( npc->motd ) /* [Ind/Hercules] */
script->run(npc->motd->u.scr.script, 0, sd->bl.id, npc->fake_nd->bl.id);
-
+
return 1;
}
@@ -1406,7 +1405,6 @@ int pc_calc_skillpoint(struct map_session_data* sd) {
return skill_point;
}
-
/*==========================================
* Calculation of skill level.
*------------------------------------------*/
@@ -1424,7 +1422,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
return 1;
}
c = pc->class2idx(c);
-
+
for( i = 0; i < MAX_SKILL; i++ ) {
if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED ) //Don't touch these
sd->status.skill[i].id = 0; //First clear skills.
@@ -1542,7 +1540,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
if( f ) {
int inf2;
inf2 = skill->dbs->db[idx].inf2;
-
+
if(!sd->status.skill[idx].lv && (
(inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) ||
inf2&INF2_WEDDING_SKILL ||
@@ -1551,7 +1549,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
continue; //Cannot be learned via normal means. Note this check DOES allows raising already known skills.
sd->status.skill[idx].id = id;
-
+
if(inf2&INF2_SPIRIT_SKILL) { //Spirit skills cannot be learned, they will only show up on your tree when you get buffed.
sd->status.skill[idx].lv = 1; // need to manually specify a skill level
sd->status.skill[idx].flag = SKILL_FLAG_TEMPORARY; //So it is not saved, and tagged as a "bonus" skill.
@@ -1689,7 +1687,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
novice_skills = pc->max_level[pc->class2idx(JOB_NOVICE)][1] - 1;
sd->sktree.second = sd->sktree.third = 0;
-
+
// limit 1st class and above to novice job levels
if(skill_point < novice_skills) {
c = MAPID_NOVICE;
@@ -1744,7 +1742,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
// restore non-limiting flags
c |= sd->class_&(JOBL_UPPER|JOBL_BABY);
-
+
return c;
}
@@ -4475,7 +4473,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
break;
}
}
-
+
i = MAX_INVENTORY;
// Stackable | Non Rental
@@ -4494,7 +4492,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
}
}
}
-
+
if ( i >= MAX_INVENTORY ) {
i = pc->search_inventory(sd,0);
if (i == INDEX_NOT_FOUND)
@@ -4608,7 +4606,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0;
}
- if (!map->addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2))
+ if (!map->addflooritem(&sd->bl, &sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2))
return 0;
pc->delitem(sd, n, amount, 1, DELITEM_NORMAL, LOG_TYPE_PICKDROP_PLAYER);
@@ -4821,7 +4819,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
return 0;
}
}
-
+
//Gender check
if(item->sex != 2 && sd->status.sex != item->sex)
return 0;
@@ -4842,7 +4840,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
(item->class_base[(sd->class_&JOBL_2_1) ? 1 : ((sd->class_&JOBL_2_2) ? 2 : 0)])
))
return 0;
-
+
//Not usable by upper class. [Haru]
while( 1 ) {
// Normal classes (no upper, no baby, no third classes)
@@ -4924,7 +4922,7 @@ int pc_useitem(struct map_session_data *sd,int n) {
(itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0)
)
return 0;
-
+
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
if( sd->inventory_data[n]->flag.delay_consume && nameid != ITEMID_REINS_OF_MOUNT ) {
if( sd->sc.data[SC_ALL_RIDING] )
@@ -4978,11 +4976,11 @@ int pc_useitem(struct map_session_data *sd,int n) {
return 0;
}
}
-
+
//Dead Branch & Bloody Branch & Porings Box
if( nameid == ITEMID_BRANCH_OF_DEAD_TREE || nameid == ITEMID_BLOODY_DEAD_BRANCH || nameid == ITEMID_PORING_BOX )
logs->branch(sd);
-
+
sd->itemid = sd->status.inventory[n].nameid;
sd->itemindex = n;
if(sd->catch_target_class != -1) //Abort pet catching.
@@ -5186,7 +5184,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
if(item_data->nameid==0 || amount < 1 || item_data->amount<amount || sd->state.vending )
return 1;
-
+
if((flag = pc->additem(sd,item_data,amount,LOG_TYPE_NONE)) == 0)
return pc->cart_delitem(sd,idx,amount,0,LOG_TYPE_NONE);
@@ -5194,7 +5192,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
}
void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) {
int i;
-
+
switch( type ) {
/* both restricted to inventory */
case IBT_PARTY:
@@ -5210,7 +5208,7 @@ void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) {
break;
case IBT_GUILD: {
struct guild_storage *gstor = idb_get(gstorage->db,sd->status.guild_id);
-
+
for( i = 0; i < MAX_INVENTORY; i++ ){
if(sd->status.inventory[i].bound == type) {
if( gstor )
@@ -5223,7 +5221,6 @@ void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) {
}
break;
}
-
}
/*==========================================
* Display item stolen msg to player sd
@@ -5292,7 +5289,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
// Try dropping one item, in the order from first to last possible slot.
// Droprate is affected by the skill success rate.
for( i = 0; i < MAX_STEAL_DROP; i++ )
- if( md->db->dropitem[i].nameid > 0 && (data = itemdb->exists(md->db->dropitem[i].nameid)) && rnd() % 10000 < md->db->dropitem[i].p * rate/100. )
+ if (md->db->dropitem[i].nameid > 0 && (data = itemdb->exists(md->db->dropitem[i].nameid)) != NULL && rnd() % 10000 < md->db->dropitem[i].p * rate/100.)
break;
if( i == MAX_STEAL_DROP )
return 0;
@@ -5402,7 +5399,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
stop = true;
}
}
- if ( !stop && sd->status.party_id && (p = party->search(sd->status.party_id)) && p->instances ) {
+ if ( !stop && sd->status.party_id && (p = party->search(sd->status.party_id)) != NULL && p->instances ) {
for( i = 0; i < p->instances; i++ ) {
if( p->instance[i] >= 0 ) {
ARR_FIND(0, instance->list[p->instance[i]].num_map, j, map->list[instance->list[p->instance[i]].map[j]].instance_src_map == m && !map->list[instance->list[p->instance[i]].map[j]].custom_name);
@@ -5447,7 +5444,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
if( sd->state.changemap ) { // Misc map-changing settings
int i;
sd->state.pmap = sd->bl.m;
-
+
for( i = 0; i < sd->queues_count; i++ ) {
struct hQueue *queue;
if( (queue = script->queue(sd->queues[i])) && queue->onMapChange[0] != '\0' ) {
@@ -5455,7 +5452,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
npc->event(sd, queue->onMapChange, 0);
}
}
-
+
if( map->list[m].cell == (struct mapcell *)0xdeadbeaf )
map->cellfromcache(&map->list[m]);
if (sd->sc.count) { // Cancel some map related stuff.
@@ -5498,7 +5495,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
clif->message (sd->fd, msg_sd(sd,276)); // "You can't open a shop on this map"
vending->close(sd);
}
-
+
if (map->list[sd->bl.m].channel) {
channel->leave(map->list[sd->bl.m].channel,sd);
}
@@ -5538,10 +5535,10 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
do {
x=rnd()%(map->list[m].xs-2)+1;
y=rnd()%(map->list[m].ys-2)+1;
- } while(map->getcell(m,x,y,CELL_CHKNOPASS));
+ } while(map->getcell(m, &sd->bl, x, y, CELL_CHKNOPASS));
}
- if (sd->state.vending && map->getcell(m,x,y,CELL_CHKNOVENDING)) {
+ if (sd->state.vending && map->getcell(m, &sd->bl, x, y, CELL_CHKNOVENDING)) {
clif->message (sd->fd, msg_sd(sd,204)); // "You can't open a shop on this cell."
vending->close(sd);
}
@@ -5584,7 +5581,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
sd->md->bl.y = sd->md->ud.to_y = y;
sd->md->ud.dir = sd->ud.dir;
}
-
+
/* given autotrades have no clients you have to trigger this manually otherwise they get stuck in memory limbo bugreport:7495 */
if( sd->state.autotrade )
clif->pLoadEndAck(0,sd);
@@ -5613,7 +5610,7 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type) {
do {
x=rnd()%(map->list[m].xs-2)+1;
y=rnd()%(map->list[m].ys-2)+1;
- } while( map->getcell(m,x,y,CELL_CHKNOPASS) && (i++) < 1000 );
+ } while (map->getcell(m, &sd->bl, x, y, CELL_CHKNOPASS) && (i++) < 1000 );
if (i < 1000)
return pc->setpos(sd,map_id2index(sd->bl.m),x,y,type);
@@ -5702,14 +5699,14 @@ int pc_checkskill2(struct map_session_data *sd,uint16 index) {
}
if( skill->dbs->db[index].nameid >= GD_SKILLBASE && skill->dbs->db[index].nameid < GD_MAX ) {
struct guild *g;
-
+
if( sd->status.guild_id>0 && (g=sd->guild)!=NULL)
return guild->checkskill(g,skill->dbs->db[index].nameid);
return 0;
}
if(sd->status.skill[index].id == skill->dbs->db[index].nameid)
return (sd->status.skill[index].lv);
-
+
return 0;
}
@@ -6482,7 +6479,7 @@ int pc_stop_following (struct map_session_data *sd)
sd->ud.target_to = 0;
unit->stop_walking(&sd->bl, STOPWALKING_FLAG_FIXPOS);
-
+
return 0;
}
@@ -6621,8 +6618,6 @@ void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned in
*job_exp = (unsigned int) cap_value((double)*job_exp * sd->status.mod_exp/100., 1, UINT_MAX);
}
-
- return;
}
/**
@@ -6703,7 +6698,7 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in
if(job_exp)
clif->displayexp(sd, job_exp, SP_JOBEXP, is_quest);
#endif
-
+
if(sd->state.showexp) {
char output[256];
sprintf(output,
@@ -6751,7 +6746,6 @@ unsigned int pc_thisbaseexp(struct map_session_data *sd)
return pc->exp_table[pc->class2idx(sd->status.class_)][0][sd->status.base_level-2];
}
-
/*==========================================
* job level exp lookup
* Return:
@@ -7001,7 +6995,7 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
if( !(index = skill->get_index(skill_id)) )
return 0;
-
+
if( sd->status.skill_point > 0 &&
sd->status.skill[index].id &&
sd->status.skill[index].flag == SKILL_FLAG_PERMANENT && //Don't allow raising while you have granted skills. [Skotlex]
@@ -7301,9 +7295,9 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL) ) //Avoid reseting wedding/linker skills.
continue;
-
+
skill_id = skill->dbs->db[i].nameid;
-
+
// Don't reset trick dead if not a novice/baby
if( skill_id == NV_TRICKDEAD && (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE ) {
sd->status.skill[i].lv = 0;
@@ -7317,7 +7311,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( sd->status.skill[i].flag == SKILL_FLAG_PERM_GRANTED )
continue;
-
+
if( flag&PCRESETSKILL_CHSEX && !skill_ischangesex(i) )
continue;
@@ -7344,7 +7338,6 @@ int pc_resetskill(struct map_session_data* sd, int flag)
sd->status.skill_point += skill_point;
-
if (!(flag&PCRESETSKILL_RECOUNT)) {
// Remove all SCs that can't be inactivated without a skill
if( sd->sc.data[SC_STORMKICK_READY] )
@@ -7550,7 +7543,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if (sd->npc_id && sd->st && sd->st->state != RUN)
npc->event_dequeue(sd);
-
+
pc_setglobalreg(sd,script->add_str("PC_DIE_COUNTER"),sd->die_counter+1);
pc->setparam(sd, SP_KILLERRID, src?src->id:0);
@@ -7559,15 +7552,15 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if( (bgd = bg->team_search(sd->bg_id)) != NULL && bgd->die_event[0] )
npc->event(sd, bgd->die_event, 0);
}
-
+
for( i = 0; i < sd->queues_count; i++ ) {
struct hQueue *queue;
if( (queue = script->queue(sd->queues[i])) && queue->onDeath[0] != '\0' )
npc->event(sd, queue->onDeath, 0);
}
-
+
npc->script_event(sd,NPCE_DIE);
-
+
// Clear anything NPC-related when you die and was interacting with one.
if ( (sd->npc_id || sd->npc_shopid) && sd->state.dialog) {
if (sd->state.using_fake_npc) {
@@ -7665,7 +7658,6 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
else if (sd->status.karma < ssd->status.karma) // If player killed was more good
ssd->status.karma++;
-
// or the PK System way...
if (sd->status.karma > 0) // player killed is dishonourable?
@@ -7688,7 +7680,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
item_tmp.card[1]=0;
item_tmp.card[2]=GetWord(sd->status.char_id,0); // CharId
item_tmp.card[3]=GetWord(sd->status.char_id,1);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
// activate Steel body if a super novice dies at 99+% exp [celest]
@@ -7717,7 +7709,6 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
) {
unsigned int base_penalty = 0;
if (battle_config.death_penalty_base > 0) {
-
switch (battle_config.death_penalty_type) {
case 1:
base_penalty = (unsigned int) ((double)pc->nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000);
@@ -7726,7 +7717,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
base_penalty = (unsigned int) ((double)sd->status.base_exp * (double)battle_config.death_penalty_base/10000);
break;
}
-
+
if(base_penalty) {
if (battle_config.pk_mode && src && src->type==BL_PC)
base_penalty*=2;
@@ -7736,10 +7727,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
clif->updatestatus(sd,SP_BASEEXP);
}
}
-
+
if(battle_config.death_penalty_job > 0) {
base_penalty = 0;
-
+
switch (battle_config.death_penalty_type) {
case 1:
base_penalty = (unsigned int) ((double)pc->nextjobexp(sd) * (double)battle_config.death_penalty_job/10000);
@@ -7748,7 +7739,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
base_penalty = (unsigned int) ((double)sd->status.job_exp * (double)battle_config.death_penalty_job/10000);
break;
}
-
+
if(base_penalty) {
if (battle_config.pk_mode && src && src->type==BL_PC)
base_penalty*=2;
@@ -7758,7 +7749,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
clif->updatestatus(sd,SP_JOBEXP);
}
}
-
+
if(battle_config.zeny_penalty > 0 && !map->list[sd->bl.m].flag.nozenypenalty) {
base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
if(base_penalty)
@@ -8025,7 +8016,6 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_VARCASTRATE: val = sd->bonus.varcastrate; break;
case SP_ADD_VARIABLECAST:val = sd->bonus.add_varcast; break;
#endif
-
}
return val;
@@ -8431,7 +8421,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
/* going off star glad lineage, reset feel to not store no-longer-used vars in the database */
pc->resetfeel(sd);
}
-
+
sd->status.class_ = job;
fame_flag = pc->famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
sd->class_ = (unsigned short)b_class;
@@ -8694,7 +8684,7 @@ int pc_setoption(struct map_session_data *sd,int type)
new_look = JOB_STAR_GLADIATOR2;
else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING)
new_look = -1;
-
+
if (sd->disguise != -1 || !new_look)
return 0; //Disguises break sprite changes
@@ -8940,7 +8930,7 @@ int pc_readreg(struct map_session_data* sd, int64 reg) {
**/
void pc_setreg(struct map_session_data* sd, int64 reg, int val) {
unsigned int index = script_getvaridx(reg);
-
+
if( val ) {
i64db_iput(sd->regs.vars, reg, val);
if( index )
@@ -8959,7 +8949,7 @@ char* pc_readregstr(struct map_session_data* sd, int64 reg) {
struct script_reg_str *p = NULL;
p = i64db_get(sd->regs.vars, reg);
-
+
return p ? p->value : NULL;
}
/**
@@ -8972,10 +8962,10 @@ void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) {
if( str[0] ) {
p = ers_alloc(pc->str_reg_ers, struct script_reg_str);
-
+
p->value = aStrdup(str);
p->flag.type = 1;
-
+
if( sd->regs.vars->put(sd->regs.vars, DB->i642key(reg), DB->ptr2data(p), &prev) ) {
p = DB->data2ptr(&prev);
if( p->value )
@@ -9004,7 +8994,7 @@ void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) {
**/
int pc_readregistry(struct map_session_data *sd, int64 reg) {
struct script_reg_num *p = NULL;
-
+
if (!sd->vars_ok) {
ShowError("pc_readregistry: Trying to read reg %s before it's been loaded!\n", script->get_str(script_getvarid(reg)));
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
@@ -9012,7 +9002,7 @@ int pc_readregistry(struct map_session_data *sd, int64 reg) {
sockt->eof(sd->fd);
return 0;
}
-
+
p = i64db_get(sd->regs.vars, reg);
return p ? p->value : 0;
@@ -9025,7 +9015,7 @@ int pc_readregistry(struct map_session_data *sd, int64 reg) {
**/
char* pc_readregistry_str(struct map_session_data *sd, int64 reg) {
struct script_reg_str *p = NULL;
-
+
if (!sd->vars_ok) {
ShowError("pc_readregistry_str: Trying to read reg %s before it's been loaded!\n", script->get_str(script_getvarid(reg)));
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
@@ -9035,7 +9025,7 @@ char* pc_readregistry_str(struct map_session_data *sd, int64 reg) {
}
p = i64db_get(sd->regs.vars, reg);
-
+
return p ? p->value : NULL;
}
/**
@@ -9072,12 +9062,12 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
}
break;
}
-
+
if ( !pc->reg_load && !sd->vars_ok ) {
ShowError("pc_setregistry : refusing to set %s until vars are received.\n", regname);
return 0;
}
-
+
if( (p = i64db_get(sd->regs.vars, reg) ) ) {
if( val ) {
if( !p->value && index ) /* its a entry that was deleted, so we reset array */
@@ -9092,22 +9082,22 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
p->flag.update = 1;/* either way, it will require either delete or replace */
} else if( val ) {
DBData prev;
-
+
if( index )
script->array_update(&sd->regs, reg, false);
-
+
p = ers_alloc(pc->num_reg_ers, struct script_reg_num);
-
+
p->value = val;
if( !pc->reg_load )
p->flag.update = 1;
-
+
if( sd->regs.vars->put(sd->regs.vars, DB->i642key(reg), DB->ptr2data(p), &prev) ) {
p = DB->data2ptr(&prev);
ers_free(pc->num_reg_ers, p);
}
}
-
+
if( !pc->reg_load && p )
sd->vars_dirty = true;
@@ -9150,12 +9140,12 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
script->array_update(&sd->regs, reg, false);
p = ers_alloc(pc->str_reg_ers, struct script_reg_str);
-
+
p->value = aStrdup(val);
if( !pc->reg_load )
p->flag.update = 1;
p->flag.type = 1;
-
+
if( sd->regs.vars->put(sd->regs.vars, DB->i642key(reg), DB->ptr2data(p), &prev) ) {
p = DB->data2ptr(&prev);
if( p->value )
@@ -9163,10 +9153,10 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
ers_free(pc->str_reg_ers, p);
}
}
-
+
if( !pc->reg_load && p )
sd->vars_dirty = true;
-
+
return 1;
}
@@ -9294,7 +9284,7 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
/* ensure this isn't a duplicate combo */
if( sd->combos != NULL ) {
int x;
-
+
ARR_FIND( 0, sd->combo_count, x, sd->combos[x].id == data->combos[i]->id );
/* found a match, skip this combo */
@@ -9315,7 +9305,7 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
if(!sd->inventory_data[index])
continue;
-
+
if ( itemdb_type(id) != IT_CARD ) {
if ( sd->inventory_data[index]->nameid != id )
continue;
@@ -9350,15 +9340,13 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
/* we got here, means all items in the combo are matching */
RECREATE(sd->combos, struct pc_combos, ++sd->combo_count);
-
combo = &sd->combos[sd->combo_count - 1];
-
combo->bonus = data->combos[i]->script;
combo->id = data->combos[i]->id;
-
+
success++;
}
-
+
return success;
}
@@ -9368,11 +9356,11 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
if( !sd->combos )
return 0;/* nothing to do here, player has no combos */
-
+
for( i = 0; i < data->combos_count; i++ ) {
/* check if this combo exists in this user */
int x = 0, cursor = 0, j;
-
+
ARR_FIND( 0, sd->combo_count, x, sd->combos[x].id == data->combos[i]->id );
/* no match, skip this combo */
if( x == sd->combo_count )
@@ -9380,9 +9368,9 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
sd->combos[x].bonus = NULL;
sd->combos[x].id = 0;
-
+
retval++;
-
+
for( j = 0, cursor = 0; j < sd->combo_count; j++ ) {
if( sd->combos[j].bonus == NULL )
continue;
@@ -9394,7 +9382,7 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
cursor++;
}
-
+
/* it's empty, we can clear all the memory */
if( (sd->combo_count = cursor) == 0 ) {
aFree(sd->combos);
@@ -9402,7 +9390,7 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
break;
}
}
-
+
/* check if combo requirements still fit -- don't touch retval! */
pc->checkcombo( sd, data );
@@ -9568,7 +9556,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
sd->status.inventory[n].bound = (unsigned char)IBT_CHARACTER;
clif->notify_bounditem(sd,n);
}
-
+
if(pos == EQP_ACC) { //Accesories should only go in one of the two,
pos = req_pos&EQP_ACC;
if (pos == EQP_ACC) //User specified both slots..
@@ -9639,7 +9627,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
status_calc_pc(sd,SCO_NONE);
if (flag) //Update skill data
clif->skillinfoblock(sd);
-
+
//OnEquip script [Skotlex]
if (id->equip_script)
script->run_item_equip_script(sd, id, npc->fake_nd->bl.id);
@@ -9906,7 +9894,7 @@ int pc_checkitem(struct map_session_data *sd)
if ( !sd->status.cart[i].unique_id && !itemdb->isstackable(id) )
sd->status.cart[i].unique_id = itemdb->unique_id(sd);
}
-
+
for( i = 0; i < MAX_STORAGE; i++ ) {
id = sd->status.storage.items[i].nameid;
@@ -9923,7 +9911,7 @@ int pc_checkitem(struct map_session_data *sd)
if ( !sd->status.storage.items[i].unique_id && !itemdb->isstackable(id) )
sd->status.storage.items[i].unique_id = itemdb->unique_id(sd);
}
-
+
if (sd->guild) {
struct guild_storage *guild_storage = idb_get(gstorage->db,sd->guild->guild_id);
if (guild_storage) {
@@ -10398,7 +10386,7 @@ bool pc_can_use_command(struct map_session_data *sd, const char *command) {
/**
* Spirit Charm expiration timer.
- *
+ *
* @see TimerFunc
*/
int pc_charm_timer(int tid, int64 tick, int id, intptr_t data)
@@ -10436,7 +10424,7 @@ int pc_charm_timer(int tid, int64 tick, int id, intptr_t data)
/**
* Adds a spirit charm.
- *
+ *
* @param sd Target character.
* @param interval Duration.
* @param max Maximum amount of charms to add.
@@ -10479,7 +10467,7 @@ void pc_add_charm(struct map_session_data *sd, int interval, int max, int type)
/**
* Removes one or more spirit charms.
- *
+ *
* @param sd The target character.
* @param count Amount of charms to remove.
* @param type Type of charm to remove.
@@ -10621,32 +10609,32 @@ void pc_read_skill_tree(void) {
int i = 0;
struct s_mapiterator *iter;
struct map_session_data *sd;
-
+
if (libconfig->read_file(&skill_tree_conf, config_filename)) {
ShowError("can't read %s\n", config_filename);
return;
}
-
+
while ((skt = libconfig->setting_get_elem(skill_tree_conf.root,i++))) {
int k;
const char *name = config_setting_name(skt);
-
+
if ( (k = pc->check_job_name(name)) == -1 ) {
ShowWarning("pc_read_skill_tree: '%s' unknown job name!\n", name);
continue;
}
-
+
if( ( skills = libconfig->setting_get_member(skt,"skills") ) ) {
int c = 0;
int idx = pc->class2idx(k);
-
+
while ((sk = libconfig->setting_get_elem(skills,c++))) {
const char *sk_name = config_setting_name(sk);
int skill_id;
-
+
if( ( skill_id = skill->name2id(sk_name) ) ) {
int skidx, offset = 0, h = 0, rlen = 0;
-
+
ARR_FIND( 0, MAX_SKILL_TREE, skidx, pc->skill_tree[idx][skidx].id == 0 || pc->skill_tree[idx][skidx].id == skill_id );
if (skidx == MAX_SKILL_TREE) {
ShowWarning("pc_read_skill_tree: Unable to load skill %d (%s) into '%s's tree. Maximum number of skills per class has been reached.\n", skill_id, sk_name, name);
@@ -10654,10 +10642,10 @@ void pc_read_skill_tree(void) {
} else if (pc->skill_tree[idx][skidx].id) {
ShowNotice("pc_read_skill_tree: Overwriting %d for '%s' (%d)\n", skill_id, name, k);
}
-
+
pc->skill_tree[idx][skidx].id = skill_id;
pc->skill_tree[idx][skidx].idx = skill->get_index(skill_id);
-
+
if( config_setting_is_group(sk) ) {
int max = 0, jlevel = 0;
libconfig->setting_lookup_int(sk, "MaxLevel", &max);
@@ -10670,11 +10658,11 @@ void pc_read_skill_tree(void) {
pc->skill_tree[idx][skidx].max = (unsigned char)libconfig->setting_get_int(sk);
pc->skill_tree[idx][skidx].joblv = 0;
}
-
+
for (h = offset; h < rlen && h < MAX_PC_SKILL_REQUIRE; h++) {
config_setting_t *rsk = libconfig->setting_get_elem(sk,h);
int rskid;
- if (rsk && ( rskid = skill->name2id(config_setting_name(rsk)))) {
+ if (rsk && (rskid = skill->name2id(config_setting_name(rsk))) != 0) {
pc->skill_tree[idx][skidx].need[h].id = rskid;
pc->skill_tree[idx][skidx].need[h].idx = skill->get_index(rskid);
pc->skill_tree[idx][skidx].need[h].lv = (unsigned char)libconfig->setting_get_int(rsk);
@@ -10684,19 +10672,18 @@ void pc_read_skill_tree(void) {
ShowWarning("pc_read_skill_tree: error for '%s' in '%s'\n",sk_name,name);
}
}
-
} else {
ShowWarning("pc_read_skill_tree: unknown skill '%s' in '%s'\n",sk_name,name);
}
}
}
}
-
+
i = 0;
while( (skt = libconfig->setting_get_elem(skill_tree_conf.root,i++)) ) {
int k, idx;
const char *name = config_setting_name(skt);
-
+
if ( (k = pc->check_job_name(name)) == -1 ) {
ShowWarning("pc_read_skill_tree: '%s' unknown job name!\n", name);
continue;
@@ -10734,9 +10721,8 @@ void pc_read_skill_tree(void) {
}
}
-
}
-
+
libconfig->destroy(&skill_tree_conf);
/* lets update all players skill tree */
@@ -11023,7 +11009,7 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) {
void pc_bank_deposit(struct map_session_data *sd, int money) {
unsigned int limit_check = money+sd->status.bank_vault;
-
+
if( money <= 0 || limit_check > MAX_BANK_ZENY ) {
clif->bank_deposit(sd,BDA_OVERFLOW);
return;
@@ -11043,7 +11029,7 @@ void pc_bank_deposit(struct map_session_data *sd, int money) {
}
void pc_bank_withdraw(struct map_session_data *sd, int money) {
unsigned int limit_check = money+sd->status.zeny;
-
+
if (money <= 0) {
clif->bank_withdraw(sd,BWA_UNKNOWN_ERROR);
return;
@@ -11055,7 +11041,7 @@ void pc_bank_withdraw(struct map_session_data *sd, int money) {
clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1482));
return;
}
-
+
if( pc->getzeny(sd,money, LOG_TYPE_BANK, NULL) )
clif->bank_withdraw(sd,BWA_NO_MONEY);
else {
@@ -11069,16 +11055,16 @@ void pc_bank_withdraw(struct map_session_data *sd, int money) {
void pc_scdata_received(struct map_session_data *sd) {
pc->inventory_rentals(sd);
clif->show_modifiers(sd);
-
+
if (sd->expiration_time != 0) { // don't display if it's unlimited or unknow value
time_t exp_time = sd->expiration_time;
char tmpstr[1024];
strftime(tmpstr, sizeof(tmpstr) - 1, msg_sd(sd,501), localtime(&exp_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, strlen(tmpstr)+1);
-
+
pc->expire_check(sd);
}
-
+
if( sd->state.standalone ) {
clif->pLoadEndAck(0,sd);
pc->autotrade_populate(sd);
@@ -11087,16 +11073,16 @@ void pc_scdata_received(struct map_session_data *sd) {
}
int pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data *sd = map->id2sd(id);
-
+
if( !sd ) return 0;
-
+
sd->expiration_tid = INVALID_TIMER;
-
+
if( sd->fd )
clif->authfail_fd(sd->fd,10);
-
+
map->quit(sd);
-
+
return 0;
}
/* This timer exists only when a character with an expire timer > 24h is online */
@@ -11106,30 +11092,26 @@ int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data* sd;
iter = mapit_getallusers();
-
for( sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); sd = (TBL_PC*)mapit->next(iter) ) {
if( sd->expiration_time )
pc->expire_check(sd);
}
-
mapit->free(iter);
-
+
return 0;
}
void pc_expire_check(struct map_session_data *sd) {
/* ongoing timer */
if( sd->expiration_tid != INVALID_TIMER )
return;
-
+
/* not within the next 24h, enable the global check */
if( sd->expiration_time > ( time(NULL) + ( ( 60 * 60 ) * 24 ) ) ) {
-
/* global check not running, enable */
if( pc->expiration_tid == INVALID_TIMER ) {
/* starts in 1h, repeats every hour */
pc->expiration_tid = timer->add_interval(timer->gettick() + ((1000*60)*60), pc->global_expiration_timer, 0, 0, ((1000*60)*60));
}
-
return;
}
@@ -11141,33 +11123,31 @@ void pc_expire_check(struct map_session_data *sd) {
void pc_autotrade_load(void)
{
char *data;
-
+
if (SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `account_id`,`char_id`,`sex`,`title` FROM `%s`",map->autotrade_merchants_db))
Sql_ShowDebug(map->mysql_handle);
-
+
while (SQL_SUCCESS == SQL->NextRow(map->mysql_handle)) {
struct map_session_data *sd;
int account_id, char_id;
char title[MESSAGE_SIZE];
unsigned char sex;
-
+
SQL->GetData(map->mysql_handle, 0, &data, NULL); account_id = atoi(data);
SQL->GetData(map->mysql_handle, 1, &data, NULL); char_id = atoi(data);
SQL->GetData(map->mysql_handle, 2, &data, NULL); sex = atoi(data);
SQL->GetData(map->mysql_handle, 3, &data, NULL); safestrncpy(title, data, sizeof(title));
CREATE(sd, TBL_PC, 1);
-
+
pc->setnewpc(sd, account_id, char_id, 0, 0, sex, 0);
-
+
safestrncpy(sd->message, title, MESSAGE_SIZE);
-
sd->state.standalone = 1;
sd->group = pcg->get_dummy_group();
-
+
chrif->authreq(sd,true);
}
-
SQL->FreeResult(map->mysql_handle);
}
/**
@@ -11183,17 +11163,16 @@ void pc_autotrade_start(struct map_session_data *sd) {
while( SQL_SUCCESS == SQL->NextRow(map->mysql_handle) ) {
int itemkey, amount, price;
-
+
SQL->GetData(map->mysql_handle, 0, &data, NULL); itemkey = atoi(data);
SQL->GetData(map->mysql_handle, 1, &data, NULL); amount = atoi(data);
SQL->GetData(map->mysql_handle, 2, &data, NULL); price = atoi(data);
ARR_FIND(0, MAX_CART, i, sd->status.cart[i].id == itemkey);
-
if( i != MAX_CART && itemdb_cantrade(&sd->status.cart[i], 0, 0) ) {
if( amount > sd->status.cart[i].amount )
amount = sd->status.cart[i].amount;
-
+
if( amount ) {
sd->vending[count].index = i;
sd->vending[count].amount = amount;
@@ -11203,7 +11182,7 @@ void pc_autotrade_start(struct map_session_data *sd) {
}
}
}
-
+
if( !count ) {
pc->autotrade_update(sd,PAUC_REMOVE);
map->quit(sd);
@@ -11222,13 +11201,13 @@ void pc_autotrade_start(struct map_session_data *sd) {
**/
void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update_action action) {
int i;
-
+
/* either way, this goes down */
if( action != PAUC_START ) {
if (SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d'",map->autotrade_data_db,sd->status.char_id))
Sql_ShowDebug(map->mysql_handle);
}
-
+
switch( action ) {
case PAUC_REMOVE:
if (SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d' LIMIT 1",map->autotrade_merchants_db,sd->status.char_id))
@@ -11236,7 +11215,7 @@ void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update
break;
case PAUC_START: {
char title[MESSAGE_SIZE*2+1];
-
+
SQL->EscapeStringLen(map->mysql_handle, title, sd->message, strnlen(sd->message, MESSAGE_SIZE));
if (SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s` (`account_id`,`char_id`,`sex`,`title`) VALUES ('%d','%d','%d','%s')",
@@ -11253,7 +11232,7 @@ void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update
for( i = 0; i < sd->vend_num; i++ ) {
if( sd->vending[i].amount == 0 )
continue;
-
+
if (SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s` (`char_id`,`itemkey`,`amount`,`price`) VALUES ('%d','%d','%d','%d')",
map->autotrade_data_db,
sd->status.char_id,
@@ -11277,25 +11256,25 @@ void pc_autotrade_prepare(struct map_session_data *sd) {
unsigned char sex;
CREATE(data, struct autotrade_vending, 1);
-
+
memcpy(data->vending, sd->vending, sizeof(sd->vending));
-
+
for(i = 0; i < sd->vend_num; i++) {
if( sd->vending[i].amount ) {
memcpy(&data->list[cursor],&sd->status.cart[sd->vending[i].index],sizeof(struct item));
cursor++;
}
}
-
+
data->vend_num = (unsigned char)cursor;
-
+
idb_put(pc->at_db, sd->status.char_id, data);
-
+
account_id = sd->status.account_id;
char_id = sd->status.char_id;
sex = sd->status.sex;
safestrncpy(title, sd->message, sizeof(title));
-
+
sd->npc_id = 0;
sd->npc_shopid = 0;
if (sd->st) {
@@ -11306,11 +11285,10 @@ void pc_autotrade_prepare(struct map_session_data *sd) {
chrif->auth_delete(account_id, char_id, ST_LOGOUT);
CREATE(sd, TBL_PC, 1);
-
+
pc->setnewpc(sd, account_id, char_id, 0, 0, sex, 0);
-
+
safestrncpy(sd->message, title, MESSAGE_SIZE);
-
sd->state.standalone = 1;
sd->group = pcg->get_dummy_group();
@@ -11329,7 +11307,7 @@ void pc_autotrade_populate(struct map_session_data *sd) {
for(i = 0; i < data->vend_num; i++) {
if( !data->vending[i].amount )
continue;
-
+
for(j = 0; j < MAX_CART; j++) {
if( !memcmp((char*)(&data->list[i]) + sizeof(data->list[0].id), (char*)(&sd->status.cart[j]) + sizeof(data->list[0].id), sizeof(struct item) - sizeof(data->list[0].id)) ) {
if( cursor ) {
@@ -11340,23 +11318,50 @@ void pc_autotrade_populate(struct map_session_data *sd) {
break;
}
}
-
+
if( j != MAX_CART ) {
sd->vending[cursor].index = j;
sd->vending[cursor].amount = data->vending[i].amount;
sd->vending[cursor].value = data->vending[i].value;
-
+
cursor++;
}
}
-
+
sd->vend_num = cursor;
pc->autotrade_update(sd,PAUC_START);
-
+
+ for(i = 0; i < data->hdatac; i++ ) {
+ if( data->hdata[i]->flag.free ) {
+ aFree(data->hdata[i]->data);
+ }
+ aFree(data->hdata[i]);
+ }
+ if( data->hdata )
+ aFree(data->hdata);
+
idb_remove(pc->at_db, sd->status.char_id);
}
+/**
+ * @see DBApply
+ */
+int pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
+ struct autotrade_vending* at_v = DB->data2ptr(data);
+ int i;
+ for(i = 0; i < at_v->hdatac; i++ ) {
+ if( at_v->hdata[i]->flag.free ) {
+ aFree(at_v->hdata[i]->data);
+ }
+ aFree(at_v->hdata[i]);
+ }
+ if( at_v->hdata )
+ aFree(at_v->hdata);
+
+ return 0;
+}
+
//Checks if the given class value corresponds to a player class. [Skotlex]
//JOB_NOVICE isn't checked for class_ is supposed to be unsigned
bool pc_db_checkid(unsigned int class_)
@@ -11371,12 +11376,11 @@ bool pc_db_checkid(unsigned int class_)
}
void do_final_pc(void) {
-
db_destroy(pc->itemcd_db);
- db_destroy(pc->at_db);
-
+ pc->at_db->destroy(pc->at_db,pc->autotrade_final);
+
pcg->final();
-
+
ers_destroy(pc->sc_display_ers);
ers_destroy(pc->num_reg_ers);
ers_destroy(pc->str_reg_ers);
@@ -11387,12 +11391,12 @@ void do_final_pc(void) {
void do_init_pc(bool minimal) {
if (minimal)
return;
-
+
pc->itemcd_db = idb_alloc(DB_OPT_RELEASE_DATA);
pc->at_db = idb_alloc(DB_OPT_RELEASE_DATA);
-
+
pc->readdb();
-
+
timer->add_func_list(pc->invincible_timer, "pc_invincible_timer");
timer->add_func_list(pc->eventtimer, "pc_eventtimer");
timer->add_func_list(pc->inventory_rental_end, "pc_inventory_rental_end");
@@ -11404,25 +11408,25 @@ void do_init_pc(bool minimal) {
timer->add_func_list(pc->charm_timer, "pc_charm_timer");
timer->add_func_list(pc->global_expiration_timer,"pc_global_expiration_timer");
timer->add_func_list(pc->expiration_timer,"pc_expiration_timer");
-
+
timer->add(timer->gettick() + map->autosave_interval, pc->autosave, 0, 0);
-
+
// 0=day, 1=night [Yor]
map->night_flag = battle_config.night_at_start ? 1 : 0;
-
+
if (battle_config.day_duration > 0 && battle_config.night_duration > 0) {
int day_duration = battle_config.day_duration;
int night_duration = battle_config.night_duration;
// add night/day timer [Yor]
timer->add_func_list(pc->map_day_timer, "pc_map_day_timer");
timer->add_func_list(pc->map_night_timer, "pc_map_night_timer");
-
+
pc->day_timer_tid = timer->add_interval(timer->gettick() + (map->night_flag ? 0 : day_duration) + night_duration, pc->map_day_timer, 0, 0, day_duration + night_duration);
pc->night_timer_tid = timer->add_interval(timer->gettick() + day_duration + (map->night_flag ? night_duration : 0), pc->map_night_timer, 0, 0, day_duration + night_duration);
}
-
+
pcg->init();
-
+
pc->sc_display_ers = ers_new(sizeof(struct sc_display_entry), "pc.c:sc_display_ers", ERS_OPT_FLEX_CHUNK);
pc->num_reg_ers = ers_new(sizeof(struct script_reg_num), "pc.c::num_reg_ers", ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
pc->str_reg_ers = ers_new(sizeof(struct script_reg_str), "pc.c::str_reg_ers", ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
@@ -11475,7 +11479,7 @@ void pc_defaults(void) {
pc->get_dummy_sd = pc_get_dummy_sd;
pc->class2idx = pc_class2idx;
-
+
pc->can_use_command = pc_can_use_command;
pc->set_group = pc_set_group;
pc->should_log_commands = pc_should_log_commands;
@@ -11487,25 +11491,25 @@ void pc_defaults(void) {
pc->authok = pc_authok;
pc->authfail = pc_authfail;
pc->reg_received = pc_reg_received;
-
+
pc->isequip = pc_isequip;
pc->equippoint = pc_equippoint;
pc->setinventorydata = pc_setinventorydata;
-
+
pc->checkskill = pc_checkskill;
pc->checkskill2 = pc_checkskill2;
pc->checkallowskill = pc_checkallowskill;
pc->checkequip = pc_checkequip;
-
+
pc->calc_skilltree = pc_calc_skilltree;
pc->calc_skilltree_normalize_job = pc_calc_skilltree_normalize_job;
pc->clean_skilltree = pc_clean_skilltree;
-
+
pc->setpos = pc_setpos;
pc->setsavepoint = pc_setsavepoint;
pc->randomwarp = pc_randomwarp;
pc->memo = pc_memo;
-
+
pc->checkadditem = pc_checkadditem;
pc->inventoryblank = pc_inventoryblank;
pc->search_inventory = pc_search_inventory;
@@ -11516,47 +11520,47 @@ void pc_defaults(void) {
// Special Shop System
pc->paycash = pc_paycash;
pc->getcash = pc_getcash;
-
+
pc->cart_additem = pc_cart_additem;
pc->cart_delitem = pc_cart_delitem;
pc->putitemtocart = pc_putitemtocart;
pc->getitemfromcart = pc_getitemfromcart;
pc->cartitem_amount = pc_cartitem_amount;
-
+
pc->takeitem = pc_takeitem;
pc->dropitem = pc_dropitem;
-
+
pc->isequipped = pc_isequipped;
pc->can_Adopt = pc_can_Adopt;
pc->adoption = pc_adoption;
-
+
pc->updateweightstatus = pc_updateweightstatus;
-
+
pc->addautobonus = pc_addautobonus;
pc->exeautobonus = pc_exeautobonus;
pc->endautobonus = pc_endautobonus;
pc->delautobonus = pc_delautobonus;
-
+
pc->bonus = pc_bonus;
pc->bonus2 = pc_bonus2;
pc->bonus3 = pc_bonus3;
pc->bonus4 = pc_bonus4;
pc->bonus5 = pc_bonus5;
pc->skill = pc_skill;
-
+
pc->insert_card = pc_insert_card;
pc->can_insert_card = pc_can_insert_card;
pc->can_insert_card_into = pc_can_insert_card_into;
pc->steal_item = pc_steal_item;
pc->steal_coin = pc_steal_coin;
-
+
pc->modifybuyvalue = pc_modifybuyvalue;
pc->modifysellvalue = pc_modifysellvalue;
-
+
pc->follow = pc_follow; // [MouseJstr]
pc->stop_following = pc_stop_following;
-
+
pc->maxbaselv = pc_maxbaselv;
pc->maxjoblv = pc_maxjoblv;
pc->checkbaselevelup = pc_checkbaselevelup;
@@ -11584,11 +11588,11 @@ void pc_defaults(void) {
pc->unequipitem_pos = pc_unequipitem_pos;
pc->checkitem = pc_checkitem;
pc->useitem = pc_useitem;
-
+
pc->skillatk_bonus = pc_skillatk_bonus;
pc->skillheal_bonus = pc_skillheal_bonus;
pc->skillheal2_bonus = pc_skillheal2_bonus;
-
+
pc->damage = pc_damage;
pc->dead = pc_dead;
pc->revive = pc_revive;
@@ -11605,7 +11609,7 @@ void pc_defaults(void) {
pc->setridingwug = pc_setridingwug;
pc->changelook = pc_changelook;
pc->equiplookall = pc_equiplookall;
-
+
pc->readparam = pc_readparam;
pc->setparam = pc_setparam;
pc->readreg = pc_readreg;
@@ -11616,15 +11620,15 @@ void pc_defaults(void) {
pc->setregistry = pc_setregistry;
pc->readregistry_str = pc_readregistry_str;
pc->setregistry_str = pc_setregistry_str;
-
+
pc->addeventtimer = pc_addeventtimer;
pc->deleventtimer = pc_deleventtimer;
pc->cleareventtimer = pc_cleareventtimer;
pc->addeventtimercount = pc_addeventtimercount;
-
+
pc->calc_pvprank = pc_calc_pvprank;
pc->calc_pvprank_timer = pc_calc_pvprank_timer;
-
+
pc->ismarried = pc_ismarried;
pc->marriage = pc_marriage;
pc->divorce = pc_divorce;
@@ -11632,30 +11636,30 @@ void pc_defaults(void) {
pc->get_father = pc_get_father;
pc->get_mother = pc_get_mother;
pc->get_child = pc_get_child;
-
+
pc->bleeding = pc_bleeding;
pc->regen = pc_regen;
-
+
pc->setstand = pc_setstand;
pc->candrop = pc_candrop;
pc->can_talk = pc_can_talk;
pc->can_attack = pc_can_attack;
-
+
pc->jobid2mapid = pc_jobid2mapid; // Skotlex
pc->mapid2jobid = pc_mapid2jobid; // Skotlex
-
+
pc->job_name = job_name;
-
+
pc->setinvincibletimer = pc_setinvincibletimer;
pc->delinvincibletimer = pc_delinvincibletimer;
-
+
pc->addspiritball = pc_addspiritball;
pc->delspiritball = pc_delspiritball;
pc->addfame = pc_addfame;
pc->famerank = pc_famerank;
pc->set_hate_mob = pc_set_hate_mob;
pc->getmaxspiritball = pc_getmaxspiritball;
-
+
pc->readdb = pc_readdb;
pc->map_day_timer = map_day_timer; // by [yor]
pc->map_night_timer = map_night_timer; // by [yor]
@@ -11663,26 +11667,24 @@ void pc_defaults(void) {
pc->inventory_rentals = pc_inventory_rentals;
pc->inventory_rental_clear = pc_inventory_rental_clear;
pc->inventory_rental_add = pc_inventory_rental_add;
-
+
pc->disguise = pc_disguise;
pc->isautolooting = pc_isautolooting;
-
+
pc->overheat = pc_overheat;
-
pc->banding = pc_banding;
-
+
pc->itemcd_do = pc_itemcd_do;
-
pc->load_combo = pc_load_combo;
-
+
pc->add_charm = pc_add_charm;
pc->del_charm = pc_del_charm;
-
+
pc->baselevelchanged = pc_baselevelchanged;
pc->level_penalty_mod = pc_level_penalty_mod;
-
+
pc->calc_skillpoint = pc_calc_skillpoint;
-
+
pc->invincible_timer = pc_invincible_timer;
pc->spiritball_timer = pc_spiritball_timer;
pc->check_banding = pc_check_banding;
@@ -11710,15 +11712,15 @@ void pc_defaults(void) {
pc->checkcombo = pc_checkcombo;
pc->calcweapontype = pc_calcweapontype;
pc->removecombo = pc_removecombo;
-
+
pc->bank_withdraw = pc_bank_withdraw;
pc->bank_deposit = pc_bank_deposit;
-
+
pc->rental_expire = pc_rental_expire;
pc->scdata_received = pc_scdata_received;
-
+
pc->bound_clear = pc_bound_clear;
-
+
pc->expiration_timer = pc_expiration_timer;
pc->global_expiration_timer = pc_global_expiration_timer;
pc->expire_check = pc_expire_check;
@@ -11733,6 +11735,7 @@ void pc_defaults(void) {
pc->autotrade_start = pc_autotrade_start;
pc->autotrade_prepare = pc_autotrade_prepare;
pc->autotrade_populate = pc_autotrade_populate;
+ pc->autotrade_final = pc_autotrade_final;
pc->check_job_name = pc_check_job_name;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 85bbd2016..e6e95978d 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -569,7 +569,7 @@ END_ZEROED_BLOCK;
} roulette;
uint8 lang_id;
-
+
// temporary debugging of bug #3504
const char* delunit_prevfile;
int delunit_prevline;
@@ -757,6 +757,9 @@ struct autotrade_vending {
struct item list[MAX_VENDING];
struct s_vending vending[MAX_VENDING];
unsigned char vend_num;
+ /* HPM Custom Struct */
+ struct HPluginData **hdata;
+ unsigned int hdatac;
};
/*=====================================
@@ -1066,6 +1069,7 @@ END_ZEROED_BLOCK; /* End */
void (*autotrade_start) (struct map_session_data *sd);
void (*autotrade_prepare) (struct map_session_data *sd);
void (*autotrade_populate) (struct map_session_data *sd);
+ int (*autotrade_final) (DBKey key, DBData *data, va_list ap);
int (*check_job_name) (const char *name);
};
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 28bef6a85..7efcd7e26 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -51,7 +51,7 @@ static void read_config(void) {
config_setting_t *groups = NULL;
const char *config_filename = "conf/groups.conf"; // FIXME hardcoded name
int group_count = 0;
-
+
if (libconfig->read_file(&pc_group_config, config_filename))
return;
@@ -125,11 +125,10 @@ static void read_config(void) {
strdb_put(pcg->name_db, groupname, group_settings);
idb_put(pcg->db, id, group_settings);
-
}
group_count = libconfig->setting_length(groups); // Save number of groups
assert(group_count == db_size(pcg->db));
-
+
// Check if all commands and permissions exist
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
@@ -182,7 +181,7 @@ static void read_config(void) {
*commands = group_settings->commands,
*permissions = group_settings->permissions;
int j, inherit_count = 0, done = 0;
-
+
if (group_settings->inheritance_done) // group already processed
continue;
@@ -192,7 +191,7 @@ static void read_config(void) {
group_settings->inheritance_done = true;
continue;
}
-
+
for (j = 0; j < inherit_count; ++j) {
GroupSettings *inherited_group = NULL;
const char *groupname = libconfig->setting_get_string_elem(inherit, j);
@@ -225,7 +224,7 @@ static void read_config(void) {
++done; // copied commands and permissions from one of inherited groups
}
-
+
if (done == inherit_count) { // copied commands from all of inherited groups
++i;
group_settings->inheritance_done = true; // we're done with this group
@@ -239,7 +238,7 @@ static void read_config(void) {
break;
}
} // while(i < group_count)
-
+
// Pack permissions into GroupSettings.e_permissions for faster checking
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
@@ -365,28 +364,28 @@ int pc_group_get_idx(GroupSettings *group)
unsigned int pc_groups_add_permission(const char *name) {
uint64 key = 0x1;
unsigned char i;
-
+
for(i = 0; i < pcg->permission_count; i++) {
if( strcmpi(name,pcg->permissions[i].name) == 0 ) {
ShowError("pc_groups_add_permission(%s): failed! duplicate permission name!\n",name);
return 0;
}
}
-
+
if( i != 0 )
key = (uint64)pcg->permissions[i - 1].permission << 1;
-
+
if( key >= UINT_MAX ) {
ShowError("pc_groups_add_permission(%s): failed! not enough room, too many permissions!\n",name);
return 0;
}
-
+
i = pcg->permission_count;
RECREATE(pcg->permissions, struct pc_groups_permission_table, ++pcg->permission_count);
-
+
pcg->permissions[i].name = aStrdup(name);
pcg->permissions[i].permission = (unsigned int)key;
-
+
return (unsigned int)key;
}
/**
@@ -427,23 +426,23 @@ void do_init_pc_groups(void) {
{ "disable_skill_usage", PC_PERM_DISABLE_SKILL_USAGE },
};
unsigned char i, len = ARRAYLENGTH(pc_g_defaults);
-
+
for(i = 0; i < len; i++) {
unsigned int p;
if( ( p = pc_groups_add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission )
ShowError("do_init_pc_groups: %s error : %d != %d\n",pc_g_defaults[i].name,p,pc_g_defaults[i].permission);
}
-
+
/**
* Handle plugin-provided permissions
**/
for(i = 0; i < pcg->HPMpermissions_count; i++) {
*pcg->HPMpermissions[i].mask = pc_groups_add_permission(pcg->HPMpermissions[i].name);
}
-
+
pcg->db = idb_alloc(DB_OPT_RELEASE_DATA);
pcg->name_db = stridb_alloc(DB_OPT_DUP_KEY, 0);
-
+
read_config();
}
@@ -468,7 +467,7 @@ void do_final_pc_groups(void)
pcg->db->destroy(pcg->db, group_db_clear_sub);
if (pcg->name_db != NULL)
db_destroy(pcg->name_db);
-
+
if(pcg->permissions != NULL) {
unsigned char i;
for(i = 0; i < pcg->permission_count; i++)
@@ -490,7 +489,7 @@ void pc_groups_reload(void) {
pcg->final();
pcg->init();
-
+
/* refresh online users permissions */
iter = mapit_getallusers();
for (sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); sd = (TBL_PC*)mapit->next(iter)) {
@@ -508,7 +507,6 @@ void pc_groups_reload(void) {
**/
void pc_groups_defaults(void) {
pcg = &pcg_s;
-
/* */
pcg->db = NULL;
pcg->name_db = NULL;
diff --git a/src/map/pet.c b/src/map/pet.c
index 1ac6d117a..2865cc901 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -4,6 +4,7 @@
#define HERCULES_CORE
+#include "config/core.h" // DBPATH
#include "pet.h"
#include "map/atcommand.h" // msg_txt()
@@ -106,7 +107,7 @@ int pet_attackskill(struct pet_data *pd, int target_id) {
if (DIFF_TICK(pd->ud.canact_tick, timer->gettick()) > 0)
return 0;
-
+
if (rnd()%100 < (pd->a_skill->rate +pd->pet.intimate*pd->a_skill->bonusrate/1000)) {
//Skotlex: Use pet's skill
int inf;
@@ -132,7 +133,7 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type)
int rate;
pd = sd->pd;
-
+
Assert_ret(pd->msd == 0 || pd->msd->pd == pd);
if( bl == NULL || bl->type != BL_MOB || bl->prev == NULL
@@ -185,7 +186,7 @@ int pet_sc_check(struct map_session_data *sd, int type)
return 1;
pd->recovery->timer = timer->add(timer->gettick()+pd->recovery->delay*1000,pet->recovery_timer,sd->bl.id,0);
-
+
return 0;
}
@@ -210,7 +211,7 @@ int pet_hungry(int tid, int64 tick, int id, intptr_t data) {
if (pd->pet.intimate <= 0)
return 1; //You lost the pet already, the rest is irrelevant.
-
+
pd->pet.hungry--;
if( pd->pet.hungry < 0 )
{
@@ -302,7 +303,7 @@ int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
tmp_item.card[3] = pd->pet.rename_flag;
if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
pd->pet.incubate = 1;
unit->free(&pd->bl,CLR_OUTSIGHT);
@@ -336,7 +337,7 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo)
//The pet_id value was lost? odd... restore it.
sd->status.pet_id = petinfo->pet_id;
}
-
+
i = pet->search_petDB_index(petinfo->class_,PET_CLASS);
if(i < 0) {
sd->status.pet_id = 0;
@@ -366,10 +367,10 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo)
pd->last_thinktime = timer->gettick();
pd->state.skillbonus = 0;
-
+
if( battle_config.pet_status_support )
script->run_pet(pet->db[i].pet_script,0,sd->bl.id,0);
-
+
if( pd->petDB ) {
if( pd->petDB->equip_script )
status_calc_pc(sd,SCO_NONE);
@@ -379,7 +380,7 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo)
else
interval = pd->petDB->hungry_delay;
}
-
+
if( interval <= 0 )
interval = 1;
pd->pet_hungry_timer = timer->add(timer->gettick() + interval, pet->hungry, sd->bl.id, 0);
@@ -566,7 +567,7 @@ bool pet_get_egg(int account_id, short pet_class, int pet_id ) {
// the first request. [Panikon]
i = pet->search_petDB_index(pet_class,PET_CLASS);
sd->catch_target_class = -1;
-
+
if(i < 0) {
intif->delete_petdata(pet_id);
return false;
@@ -581,7 +582,7 @@ bool pet_get_egg(int account_id, short pet_class, int pet_id ) {
tmp_item.card[3] = 0; //New pets are not named.
if((ret = pc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER))) {
clif->additem(sd,0,0,ret);
- map->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
return true;
@@ -593,11 +594,11 @@ int pet_menu(struct map_session_data *sd,int menunum)
nullpo_ret(sd);
if (sd->pd == NULL)
return 1;
-
+
//You lost the pet already.
if(!sd->status.pet_id || sd->pd->pet.intimate <= 0 || sd->pd->pet.incubate)
return 1;
-
+
egg_id = itemdb->exists(sd->pd->petDB->EggID);
if (egg_id) {
if ((egg_id->flag.trade_restriction&ITR_NODROP) && !pc->inventoryblank(sd)) {
@@ -605,7 +606,7 @@ int pet_menu(struct map_session_data *sd,int menunum)
return 1;
}
}
-
+
switch(menunum) {
case 0:
clif->send_petstatus(sd);
@@ -671,9 +672,9 @@ int pet_equipitem(struct map_session_data *sd,int index) {
nullpo_retr(1, sd);
pd = sd->pd;
if (!pd) return 1;
-
+
nameid = sd->status.inventory[index].nameid;
-
+
if(pd->petDB->AcceID == 0 || nameid != pd->petDB->AcceID || pd->pet.equip != 0) {
clif->equipitemack(sd,0,0,EIA_FAIL);
return 1;
@@ -712,7 +713,7 @@ int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
tmp_item.identify = 1;
if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
if( battle_config.pet_equip_required )
{ // Skotlex: halt support timers if needed
@@ -794,7 +795,7 @@ int pet_randomwalk(struct pet_data *pd, int64 tick)
int r=rnd();
int x=pd->bl.x+r%(d*2+1)-d;
int y=pd->bl.y+r/(d*2+1)%(d*2+1)-d;
- if(map->getcell(pd->bl.m,x,y,CELL_CHKPASS) && unit->walktoxy(&pd->bl,x,y,0)) {
+ if(map->getcell (pd->bl.m, &pd->bl, x, y, CELL_CHKPASS) && unit->walktoxy(&pd->bl, x, y, 0)) {
pd->move_fail_count=0;
break;
}
@@ -842,7 +843,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick
pet->randomwalk(pd,tick);
return 0;
}
-
+
if (!check_distance_bl(&sd->bl, &pd->bl, pd->db->range3)) {
//Master too far, chase.
if(pd->target_id)
@@ -866,7 +867,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick
pd->status.speed = pd->petDB->speed;
pd->ud.state.change_walk_target = pd->ud.state.speed_changed = 1;
}
-
+
if (pd->target_id) {
target= map->id2bl(pd->target_id);
if (!target || pd->bl.m != target->m || status->isdead(target)
@@ -876,13 +877,13 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick
pet->unlocktarget(pd);
}
}
-
+
if(!target && pd->loot && pd->msd && pc_has_permission(pd->msd, PC_PERM_TRADE) && pd->loot->count < pd->loot->max && DIFF_TICK(tick,pd->ud.canact_tick)>0) {
//Use half the pet's range of sight.
map->foreachinrange(pet->ai_sub_hard_lootsearch,&pd->bl,
pd->db->range2/2, BL_ITEM,pd,&target);
}
-
+
if (!target) {
//Just walk around.
if (check_distance_bl(&sd->bl, &pd->bl, 3))
@@ -897,7 +898,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick
return 0;
}
-
+
if(pd->ud.target == target->id &&
(pd->ud.attacktimer != INVALID_TIMER || pd->ud.walktimer != INVALID_TIMER))
return 0; //Target already locked.
@@ -961,7 +962,7 @@ int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
if(sd_charid && sd_charid != pd->msd->status.char_id)
return 0;
-
+
if(unit->can_reach_bl(&pd->bl,bl, pd->db->range2, 1, NULL, NULL) &&
((*target) == NULL || //New target closer than previous one.
!check_distance_bl(&pd->bl, *target, distance_bl(&pd->bl, bl))))
@@ -981,9 +982,9 @@ int pet_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
ditem = list->item;
while (ditem) {
struct item_drop *ditem_prev;
- map->addflooritem(&ditem->item_data,ditem->item_data.amount,
- list->m,list->x,list->y,
- list->first_charid,list->second_charid,list->third_charid,0);
+ map->addflooritem(NULL, &ditem->item_data, ditem->item_data.amount,
+ list->m, list->x, list->y,
+ list->first_charid, list->second_charid, list->third_charid, 0);
ditem_prev = ditem;
ditem = ditem->next;
ers_free(pet->item_drop_ers, ditem_prev);
@@ -1046,18 +1047,18 @@ int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
struct pet_data *pd;
int bonus;
int duration = 0;
-
+
if(sd == NULL || sd->pd==NULL || sd->pd->bonus == NULL)
return 1;
-
+
pd=sd->pd;
-
+
if(pd->bonus->timer != tid) {
ShowError("pet_skill_bonus_timer %d != %d\n",pd->bonus->timer,tid);
pd->bonus->timer = INVALID_TIMER;
return 0;
}
-
+
// determine the time for the next timer
if (pd->state.skillbonus && pd->bonus->delay > 0) {
bonus = 0;
@@ -1069,7 +1070,7 @@ int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
pd->bonus->timer = INVALID_TIMER;
return 0;
}
-
+
if (pd->state.skillbonus != bonus) {
pd->state.skillbonus = bonus;
status_calc_pc(sd, SCO_NONE);
@@ -1085,10 +1086,10 @@ int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
int pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data *sd=map->id2sd(id);
struct pet_data *pd;
-
+
if(sd==NULL || sd->pd == NULL || sd->pd->recovery == NULL)
return 1;
-
+
pd=sd->pd;
if(pd->recovery->timer != tid) {
@@ -1105,7 +1106,7 @@ int pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
}
pd->recovery->timer = INVALID_TIMER;
-
+
return 0;
}
@@ -1119,14 +1120,14 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
short rate = 100;
if(sd==NULL || sd->pd == NULL || sd->pd->s_skill == NULL)
return 1;
-
+
pd=sd->pd;
-
+
if(pd->s_skill->timer != tid) {
ShowError("pet_skill_support_timer %d != %d\n",pd->s_skill->timer,tid);
return 0;
}
-
+
st = status->get_status_data(&sd->bl);
if (DIFF_TICK(pd->ud.canact_tick, tick) > 0) {
@@ -1134,7 +1135,7 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
pd->s_skill->timer=timer->add(pd->ud.canact_tick,pet->skill_support_timer,sd->bl.id,0);
return 0;
}
-
+
if(pc_isdead(sd) ||
(rate = get_percentage(st->sp, st->max_sp)) > pd->s_skill->sp ||
(rate = get_percentage(st->hp, st->max_hp)) > pd->s_skill->hp ||
@@ -1143,7 +1144,7 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
pd->s_skill->timer=timer->add(tick+(rate>10?rate:10)*100,pet->skill_support_timer,sd->bl.id,0);
return 0;
}
-
+
pet_stop_attack(pd);
pet_stop_walking(pd, STOPWALKING_FLAG_FIXPOS);
pd->s_skill->timer=timer->add(tick+pd->s_skill->delay*1000,pet->skill_support_timer,sd->bl.id,0);
@@ -1154,26 +1155,24 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
-/*==========================================
- * Pet read db data
- * pet->db.txt
- * pet->db2.txt
- *------------------------------------------*/
+/**
+ * Loads (or reloads) the pet database.
+ */
int read_petdb()
{
- char* filename[] = {"pet_db.txt","pet_db2.txt"};
- int nameid,i,j,k;
+ const char *filename[] = {
+ DBPATH"pet_db.txt",
+ "pet_db2.txt",
+ };
+ int i,j;
// Remove any previous scripts in case reloaddb was invoked.
- for( j = 0; j < MAX_PET_DB; j++ )
- {
- if( pet->db[j].pet_script )
- {
+ for (j = 0; j < MAX_PET_DB; j++) {
+ if (pet->db[j].pet_script) {
script->free_code(pet->db[j].pet_script);
pet->db[j].pet_script = NULL;
}
- if( pet->db[j].equip_script )
- {
+ if (pet->db[j].equip_script) {
script->free_code(pet->db[j].equip_script);
pet->db[j].equip_script = NULL;
}
@@ -1183,59 +1182,56 @@ int read_petdb()
memset(pet->db,0,sizeof(pet->db));
j = 0; // entry counter
- for( i = 0; i < ARRAYLENGTH(filename); i++ ) {
+ for (i = 0; i < ARRAYLENGTH(filename); i++) {
char line[1024];
int lines, entries;
FILE *fp;
sprintf(line, "%s/%s", map->db_path, filename[i]);
fp=fopen(line,"r");
- if( fp == NULL ) {
- if( i == 0 )
+ if (fp == NULL) {
+ if (i == 0)
ShowError("can't read %s\n",line);
continue;
}
lines = entries = 0;
- while( fgets(line, sizeof(line), fp) && j < MAX_PET_DB ) {
+ while (fgets(line, sizeof(line), fp) && j < MAX_PET_DB) {
char *str[22], *p;
+ int nameid, k;
lines++;
- if(line[0] == '/' && line[1] == '/')
+ if (line[0] == '/' && line[1] == '/')
continue;
memset(str, 0, sizeof(str));
p = line;
- while( ISSPACE(*p) )
+ while (ISSPACE(*p))
++p;
- if( *p == '\0' )
+ if (*p == '\0')
continue; // empty line
- for( k = 0; k < 20; ++k )
- {
+ for (k = 0; k < 20; ++k) {
str[k] = p;
p = strchr(p,',');
- if( p == NULL )
+ if (p == NULL)
break; // comma not found
*p = '\0';
++p;
}
- if( p == NULL )
- {
+ if (p == NULL) {
ShowError("read_petdb: Insufficient columns in line %d, skipping.\n", lines);
continue;
}
// Pet Script
- if( *p != '{' )
- {
+ if (*p != '{') {
ShowError("read_petdb: Invalid format (Pet Script column) in line %d, skipping.\n", lines);
continue;
}
str[20] = p;
p = strstr(p+1,"},");
- if( p == NULL )
- {
+ if (p == NULL) {
ShowError("read_petdb: Invalid format (Pet Script column) in line %d, skipping.\n", lines);
continue;
}
@@ -1243,18 +1239,17 @@ int read_petdb()
p += 2;
// Equip Script
- if( *p != '{' )
- {
+ if (*p != '{') {
ShowError("read_petdb: Invalid format (Equip Script column) in line %d, skipping.\n", lines);
continue;
}
str[21] = p;
- if( (nameid = atoi(str[0])) <= 0 )
+ nameid = atoi(str[0]);
+ if (nameid <= 0)
continue;
- if( !mob->db_checkid(nameid) )
- {
+ if (!mob->db_checkid(nameid)) {
ShowWarning("pet_db reading: Invalid mob-class %d, pet not read.\n", nameid);
continue;
}
@@ -1269,7 +1264,7 @@ int read_petdb()
pet->db[j].fullness=atoi(str[7]);
pet->db[j].hungry_delay=atoi(str[8])*1000;
pet->db[j].r_hungry=atoi(str[9]);
- if( pet->db[j].r_hungry <= 0 )
+ if (pet->db[j].r_hungry <= 0)
pet->db[j].r_hungry=1;
pet->db[j].r_full=atoi(str[10]);
pet->db[j].intimate=atoi(str[11]);
@@ -1284,16 +1279,16 @@ int read_petdb()
pet->db[j].pet_script = NULL;
pet->db[j].equip_script = NULL;
- if( *str[20] )
+ if (*str[20])
pet->db[j].pet_script = script->parse(str[20], filename[i], lines, 0, NULL);
- if( *str[21] )
+ if (*str[21])
pet->db[j].equip_script = script->parse(str[21], filename[i], lines, 0, NULL);
j++;
entries++;
}
- if( j >= MAX_PET_DB )
+ if (j >= MAX_PET_DB)
ShowWarning("read_petdb: Reached max number of pets [%d]. Remaining pets were not read.\n ", MAX_PET_DB);
fclose(fp);
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' pets in '"CL_WHITE"%s"CL_RESET"'.\n", entries, filename[i]);
@@ -1312,7 +1307,7 @@ int do_init_pet(bool minimal) {
pet->item_drop_ers = ers_new(sizeof(struct item_drop),"pet.c::item_drop_ers",ERS_OPT_NONE);
pet->item_drop_list_ers = ers_new(sizeof(struct item_drop_list),"pet.c::item_drop_list_ers",ERS_OPT_NONE);
-
+
timer->add_func_list(pet->hungry,"pet_hungry");
timer->add_func_list(pet->ai_hard,"pet_ai_hard");
timer->add_func_list(pet->skill_bonus_timer,"pet_skill_bonus_timer"); // [Valaris]
@@ -1346,16 +1341,14 @@ int do_final_pet(void)
}
void pet_defaults(void) {
pet = &pet_s;
-
+
memset(pet->db,0,sizeof(pet->db));
pet->item_drop_ers = NULL;
pet->item_drop_list_ers = NULL;
-
- /* */
+
pet->init = do_init_pet;
pet->final = do_final_pet;
-
- /* */
+
pet->hungry_val = pet_hungry_val;
pet->set_intimate = pet_set_intimate;
pet->create_egg = pet_create_egg;
diff --git a/src/map/quest.c b/src/map/quest.c
index ddbd2f92d..fe4014ae5 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -529,6 +529,7 @@ int quest_read_db(void)
count++;
}
+ libconfig->destroy(&quest_db_conf);
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filename);
return count;
}
diff --git a/src/map/script.c b/src/map/script.c
index efce0b986..5dbe62df3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -87,7 +87,6 @@ static inline void script_string_buf_addb(struct script_string_buf *buf,uint8 b)
buf->size += 512;
RECREATE(buf->ptr, char, buf->size);
}
-
buf->ptr[buf->pos++] = b;
}
@@ -267,7 +266,6 @@ void script_reportdata(struct script_data* data)
}
}
-
/// Reports on the console information about the current built-in function.
void script_reportfunc(struct script_state* st)
{
@@ -301,7 +299,6 @@ void script_reportfunc(struct script_state* st)
}
}
-
/*==========================================
* Output error message
*------------------------------------------*/
@@ -398,7 +395,6 @@ unsigned int calc_hash_ci(const char* p) {
return h % SCRIPT_HASH_SIZE;
}
-
/*==========================================
* script->str_data manipulation functions
*------------------------------------------*/
@@ -590,7 +586,6 @@ int script_add_str(const char* p)
return script->str_num++;
}
-
/// Appends 1 byte to the script buffer.
void add_scriptb(int a)
{
@@ -807,19 +802,19 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
else { //Nested function call
script->syntax.nested_call++;
nested_call = true;
-
+
if( script->str_data[func].val == script->buildin_lang_macro_offset ) {
script->syntax.lang_macro_active = true;
macro = true;
}
}
-
+
if( !macro ) {
// buildin function
script->addl(func);
script->addc(C_ARG);
}
-
+
arg = script->buildin[script->str_data[func].val];
if (script->str_data[func].deprecated)
DeprecationWarning(p);
@@ -903,17 +898,17 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
if( *p != ')' )
disp_error_message("parse_callfunc: expected ')' to close argument list",p);
++p;
-
+
if( script->str_data[func].val == script->buildin_lang_macro_offset )
script->syntax.lang_macro_active = false;
}
-
+
if( nested_call )
script->syntax.nested_call--;
-
+
if( !script->syntax.nested_call )
script->syntax.last_func = -1;
-
+
if( !macro )
script->addc(C_FUNC);
return p;
@@ -978,8 +973,8 @@ const char* parse_variable(const char* p)
const char *p2 = NULL;
const char *var = p;
- if( ( p[0] == '+' && p[1] == '+' && (type = C_ADD_PRE) ) // pre ++
- || ( p[0] == '-' && p[1] == '-' && (type = C_SUB_PRE) ) // pre --
+ if( ( p[0] == '+' && p[1] == '+' && (type = C_ADD_PRE, true) ) // pre ++
+ || ( p[0] == '-' && p[1] == '-' && (type = C_SUB_PRE, true) ) // pre --
) {
var = p = script->skip_space(&p[2]);
}
@@ -1008,19 +1003,19 @@ const char* parse_variable(const char* p)
}
if( type == C_NOP &&
- !( ( p[0] == '=' && p[1] != '=' && (type = C_EQ) ) // =
- || ( p[0] == '+' && p[1] == '=' && (type = C_ADD) ) // +=
- || ( p[0] == '-' && p[1] == '=' && (type = C_SUB) ) // -=
- || ( p[0] == '^' && p[1] == '=' && (type = C_XOR) ) // ^=
- || ( p[0] == '|' && p[1] == '=' && (type = C_OR ) ) // |=
- || ( p[0] == '&' && p[1] == '=' && (type = C_AND) ) // &=
- || ( p[0] == '*' && p[1] == '=' && (type = C_MUL) ) // *=
- || ( p[0] == '/' && p[1] == '=' && (type = C_DIV) ) // /=
- || ( p[0] == '%' && p[1] == '=' && (type = C_MOD) ) // %=
- || ( p[0] == '+' && p[1] == '+' && (type = C_ADD_POST) ) // post ++
- || ( p[0] == '-' && p[1] == '-' && (type = C_SUB_POST) ) // post --
- || ( p[0] == '<' && p[1] == '<' && p[2] == '=' && (type = C_L_SHIFT) ) // <<=
- || ( p[0] == '>' && p[1] == '>' && p[2] == '=' && (type = C_R_SHIFT) ) // >>=
+ !( ( p[0] == '=' && p[1] != '=' && (type = C_EQ, true) ) // =
+ || ( p[0] == '+' && p[1] == '=' && (type = C_ADD, true) ) // +=
+ || ( p[0] == '-' && p[1] == '=' && (type = C_SUB, true) ) // -=
+ || ( p[0] == '^' && p[1] == '=' && (type = C_XOR, true) ) // ^=
+ || ( p[0] == '|' && p[1] == '=' && (type = C_OR, true) ) // |=
+ || ( p[0] == '&' && p[1] == '=' && (type = C_AND, true) ) // &=
+ || ( p[0] == '*' && p[1] == '=' && (type = C_MUL, true) ) // *=
+ || ( p[0] == '/' && p[1] == '=' && (type = C_DIV, true) ) // /=
+ || ( p[0] == '%' && p[1] == '=' && (type = C_MOD, true) ) // %=
+ || ( p[0] == '+' && p[1] == '+' && (type = C_ADD_POST, true) ) // post ++
+ || ( p[0] == '-' && p[1] == '-' && (type = C_SUB_POST, true) ) // post --
+ || ( p[0] == '<' && p[1] == '<' && p[2] == '=' && (type = C_L_SHIFT, true) ) // <<=
+ || ( p[0] == '>' && p[1] == '>' && p[2] == '=' && (type = C_R_SHIFT, true) ) // >>=
) )
{// failed to find a matching operator combination so invalid
return NULL;
@@ -1149,15 +1144,15 @@ bool is_number(const char *p) {
int script_string_dup(char *str) {
size_t len = strlen(str);
int pos = script->string_list_pos;
-
+
while( pos+len+1 >= script->string_list_size ) {
script->string_list_size += (1024*1024)/2;
RECREATE(script->string_list,char,script->string_list_size);
}
-
+
safestrncpy(script->string_list+pos, str, len+1);
script->string_list_pos += len+1;
-
+
return pos;
}
@@ -1208,7 +1203,7 @@ const char* parse_simpleexpr(const char *p)
const char *start_point = p;
bool duplicate = true;
struct script_string_buf *sbuf = &script->parse_simpleexpr_str;
-
+
do {
p++;
while( *p && *p != '"' ) {
@@ -1231,19 +1226,19 @@ const char* parse_simpleexpr(const char *p)
p++; //'"'
p = script->skip_space(p);
} while( *p && *p == '"' );
-
+
script_string_buf_addb(sbuf, 0);
-
- if( !(script->syntax.translation_db && (st = strdb_get(script->syntax.translation_db, sbuf->ptr))) ) {
+
+ if (!(script->syntax.translation_db && (st = strdb_get(script->syntax.translation_db, sbuf->ptr)) != NULL)) {
script->addc(C_STR);
-
+
if( script->pos+sbuf->pos >= script->size ) {
do {
script->size += SCRIPT_BLOCK_SIZE;
} while( script->pos+sbuf->pos >= script->size );
RECREATE(script->buf,unsigned char,script->size);
}
-
+
memcpy(script->buf+script->pos, sbuf->ptr, sbuf->pos);
script->pos += sbuf->pos;
@@ -1253,19 +1248,19 @@ const char* parse_simpleexpr(const char *p)
unsigned int st_cursor = 0;
script->addc(C_LSTR);
-
+
expand += (sizeof(char*) + sizeof(uint8)) * st->translations;
-
+
while( script->pos+expand >= script->size ) {
script->size += SCRIPT_BLOCK_SIZE;
RECREATE(script->buf,unsigned char,script->size);
}
-
+
*((int *)(&script->buf[script->pos])) = st->string_id;
*((uint8 *)(&script->buf[script->pos + sizeof(int)])) = st->translations;
script->pos += sizeof(int) + sizeof(uint8);
-
+
for(j = 0; j < st->translations; j++) {
*((uint8 *)(&script->buf[script->pos])) = RBUFB(st->buf, st_cursor);
*((char **)(&script->buf[script->pos+sizeof(uint8)])) = &st->buf[st_cursor + sizeof(uint8)];
@@ -1275,19 +1270,19 @@ const char* parse_simpleexpr(const char *p)
st_cursor += sizeof(uint8);
}
}
-
+
/* When exporting we don't know what is a translation and what isn't */
if( script->lang_export_fp && sbuf->pos > 1 ) {//sbuf->pos will always be at least 1 because of the '\0'
if( !script->syntax.strings ) {
script->syntax.strings = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0);
}
-
+
if( !strdb_exists(script->syntax.strings,sbuf->ptr) ) {
strdb_put(script->syntax.strings, sbuf->ptr, NULL);
duplicate = false;
}
}
-
+
if( script->lang_export_fp && !duplicate &&
( ( ( script->syntax.last_func == script->buildin_mes_offset ||
script->syntax.last_func == script->buildin_select_offset ) && !script->syntax.nested_call
@@ -1304,44 +1299,41 @@ const char* parse_simpleexpr(const char *p)
else
break;
}
-
+
while( *line_end != '\n' && *line_end != '\0' )
line_end++;
-
+
line_length = (size_t)(line_end - line_start);
-
if( line_length > 0 ) {
script_string_buf_ensure(lbuf,line_length + 1);
-
+
memcpy(lbuf->ptr, line_start, line_length);
lbuf->pos = line_length;
script_string_buf_addb(lbuf, 0);
-
+
normalize_name(lbuf->ptr, "\r\n\t ");
}
-
+
for(cursor = 0; cursor < sbuf->pos; cursor++) {
if( sbuf->ptr[cursor] == '"' )
script_string_buf_addb(ubuf, '\\');
script_string_buf_addb(ubuf, sbuf->ptr[cursor]);
}
script_string_buf_addb(ubuf, 0);
-
+
fprintf(script->lang_export_fp, "#: %s\n"
- "# %s\n"
- "msgctxt \"%s\"\n"
- "msgid \"%s\"\n"
- "msgstr \"\"\n",
+ "# %s\n"
+ "msgctxt \"%s\"\n"
+ "msgid \"%s\"\n"
+ "msgstr \"\"\n",
script->parser_current_file ? script->parser_current_file : "Unknown File",
lbuf->ptr,
script->parser_current_npc_name ? script->parser_current_npc_name : "Unknown NPC",
ubuf->ptr
);
-
lbuf->pos = 0;
ubuf->pos = 0;
}
-
sbuf->pos = 0;
} else {
int l;
@@ -2423,10 +2415,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
if( script->parse_cleanup_timer_id == INVALID_TIMER ) {
script->parse_cleanup_timer_id = timer->add(timer->gettick() + 10, script->parse_cleanup_timer, 0, 0);
}
-
+
if( script->syntax.strings ) /* used only when generating translation file */
db_destroy(script->syntax.strings);
-
+
memset(&script->syntax,0,sizeof(script->syntax));
script->syntax.last_func = -1;/* as valid values are >= 0 */
if( script->parser_current_npc_name ) {
@@ -2636,6 +2628,38 @@ TBL_PC *script_rid2sd(struct script_state *st) {
return sd;
}
+char *get_val_npcscope_str(struct script_state* st, struct reg_db *n, struct script_data* data) {
+ if (n)
+ return (char*)i64db_get(n->vars, reference_getuid(data));
+ else
+ return NULL;
+}
+
+char *get_val_instance_str(struct script_state* st, const char* name, struct script_data* data) {
+ if (st->instance_id >= 0) {
+ return (char*)i64db_get(instance->list[st->instance_id].regs.vars, reference_getuid(data));
+ } else {
+ ShowWarning("script_get_val: cannot access instance variable '%s', defaulting to \"\"\n", name);
+ return NULL;
+ }
+}
+
+int get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data) {
+ if (n)
+ return (int)i64db_iget(n->vars, reference_getuid(data));
+ else
+ return 0;
+}
+
+int get_val_instance_num(struct script_state* st, const char* name, struct script_data* data) {
+ if (st->instance_id >= 0)
+ return (int)i64db_iget(instance->list[st->instance_id].regs.vars, reference_getuid(data));
+ else {
+ ShowWarning("script_get_val: cannot access instance variable '%s', defaulting to 0\n", name);
+ return 0;
+ }
+}
+
/**
* Dereferences a variable/constant, replacing it with a copy of the value.
*
@@ -2689,24 +2713,15 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
data->u.str = pc_readaccountregstr(sd, data->u.num);// local
break;
case '.':
- {
- struct DBMap* n = data->ref ?
- data->ref->vars : name[1] == '@' ?
- st->stack->scope.vars : // instance/scope variable
- st->script->local.vars; // npc variable
- if( n )
- data->u.str = (char*)i64db_get(n,reference_getuid(data));
- else
- data->u.str = NULL;
- }
+ if (data->ref)
+ data->u.str = script->get_val_ref_str(st, data->ref, data);
+ else if (name[1] == '@')
+ data->u.str = script->get_val_scope_str(st, &st->stack->scope, data);
+ else
+ data->u.str = script->get_val_npc_str(st, &st->script->local, data);
break;
case '\'':
- if ( st->instance_id >= 0 ) {
- data->u.str = (char*)i64db_get(instance->list[st->instance_id].regs.vars, reference_getuid(data));
- } else {
- ShowWarning("script_get_val: cannot access instance variable '%s', defaulting to \"\"\n", name);
- data->u.str = NULL;
- }
+ data->u.str = script->get_val_instance_str(st, name, data);
break;
default:
data->u.str = pc_readglobalreg_str(sd, data->u.num);
@@ -2744,24 +2759,15 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
data->u.num = pc_readaccountreg(sd, data->u.num);// local
break;
case '.':
- {
- struct DBMap* n = data->ref ?
- data->ref->vars : name[1] == '@' ?
- st->stack->scope.vars : // instance/scope variable
- st->script->local.vars; // npc variable
- if( n )
- data->u.num = (int)i64db_iget(n,reference_getuid(data));
- else
- data->u.num = 0;
- }
+ if (data->ref)
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ else if (name[1] == '@')
+ data->u.num = script->get_val_scope_num(st, &st->stack->scope, data);
+ else
+ data->u.num = script->get_val_npc_num(st, &st->script->local, data);
break;
case '\'':
- if( st->instance_id >= 0 )
- data->u.num = (int)i64db_iget(instance->list[st->instance_id].regs.vars, reference_getuid(data));
- else {
- ShowWarning("script_get_val: cannot access instance variable '%s', defaulting to 0\n", name);
- data->u.num = 0;
- }
+ data->u.num = script->get_val_instance_num(st, name, data);
break;
default:
data->u.num = pc_readglobalreg(sd, data->u.num);
@@ -2822,14 +2828,13 @@ void script_array_ensure_zero(struct script_state *st, struct map_session_data *
struct script_array *sa = idb_get(src->arrays, script_getvarid(uid));
if (sa) {
unsigned int i;
-
+
ARR_FIND(0, sa->size, i, sa->members[i] == 0);
if( i != sa->size ) {
if( !insert )
script->array_remove_member(src,sa,i);
return;
}
-
script->array_add_member(sa,0);
} else if (insert) {
script->array_update(src,reference_uid(script_getvarid(uid), 0),false);
@@ -2842,10 +2847,10 @@ void script_array_ensure_zero(struct script_state *st, struct map_session_data *
unsigned int script_array_size(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct script_array *sa = NULL;
struct reg_db *src = script->array_src(st, sd, name, ref);
-
+
if( src && src->arrays )
sa = idb_get(src->arrays, script->search_str(name));
-
+
return sa ? sa->size : 0;
}
/**
@@ -2854,25 +2859,22 @@ unsigned int script_array_size(struct script_state *st, struct map_session_data
unsigned int script_array_highest_key(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct script_array *sa = NULL;
struct reg_db *src = script->array_src(st, sd, name, ref);
-
-
+
if( src && src->arrays ) {
int key = script->add_word(name);
-
+
script->array_ensure_zero(st,sd,reference_uid(key, 0),ref);
-
+
if( ( sa = idb_get(src->arrays, key) ) ) {
unsigned int i, highest_key = 0;
-
+
for(i = 0; i < sa->size; i++) {
if( sa->members[i] > highest_key )
highest_key = sa->members[i];
}
-
return sa->size ? highest_key + 1 : 0;
}
}
-
return 0;
}
int script_free_array_db(DBKey key, DBData *data, va_list ap) {
@@ -2896,15 +2898,15 @@ void script_array_delete(struct reg_db *src, struct script_array *sa) {
**/
void script_array_remove_member(struct reg_db *src, struct script_array *sa, unsigned int idx) {
unsigned int i, cursor;
-
+
/* its the only member left, no need to do anything other than delete the array data */
if( sa->size == 1 ) {
script->array_delete(src,sa);
return;
}
-
+
sa->members[idx] = UINT_MAX;
-
+
for(i = 0, cursor = 0; i < sa->size; i++) {
if( sa->members[i] == UINT_MAX )
continue;
@@ -2912,7 +2914,7 @@ void script_array_remove_member(struct reg_db *src, struct script_array *sa, uns
sa->members[cursor] = sa->members[i];
cursor++;
}
-
+
sa->size = cursor;
}
/**
@@ -2921,11 +2923,9 @@ void script_array_remove_member(struct reg_db *src, struct script_array *sa, uns
* @param idx the index of the array member being inserted
**/
void script_array_add_member(struct script_array *sa, unsigned int idx) {
-
RECREATE(sa->members, unsigned int, ++sa->size);
-
- sa->members[sa->size - 1] = idx;
+ sa->members[sa->size - 1] = idx;
}
/**
* Obtains the source of the array database for this type and scenario
@@ -2933,7 +2933,7 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) {
**/
struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct reg_db *src = NULL;
-
+
switch( name[0] ) {
/* from player */
default: /* char reg */
@@ -2956,13 +2956,12 @@ struct reg_db *script_array_src(struct script_state *st, struct map_session_data
}
break;
}
-
+
if( src ) {
if( !src->arrays )
src->arrays = idb_alloc(DB_OPT_BASE);
return src;
}
-
return NULL;
}
@@ -2977,7 +2976,7 @@ void script_array_update(struct reg_db *src, int64 num, bool empty) {
struct script_array *sa = NULL;
int id = script_getvarid(num);
unsigned int index = script_getvaridx(num);
-
+
if (!src->arrays) {
src->arrays = idb_alloc(DB_OPT_BASE);
} else {
@@ -2986,13 +2985,13 @@ void script_array_update(struct reg_db *src, int64 num, bool empty) {
if( sa ) {
unsigned int i;
-
+
/* search */
for(i = 0; i < sa->size; i++) {
if( sa->members[i] == index )
break;
}
-
+
/* if existent */
if( i != sa->size ) {
/* if empty, we gotta remove it */
@@ -3013,6 +3012,73 @@ void script_array_update(struct reg_db *src, int64 num, bool empty) {
}
}
+void set_reg_npcscope_str(struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str)
+{
+ if (n)
+ {
+ if (str[0]) {
+ i64db_put(n->vars, num, aStrdup(str));
+ if (script_getvaridx(num))
+ script->array_update(n, num, false);
+ } else {
+ i64db_remove(n->vars, num);
+ if (script_getvaridx(num))
+ script->array_update(n, num, true);
+ }
+ }
+}
+
+void set_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 num, const char* name, int val)
+{
+ if (n) {
+ if (val != 0) {
+ i64db_iput(n->vars, num, val);
+ if (script_getvaridx(num))
+ script->array_update(n, num, false);
+ } else {
+ i64db_remove(n->vars, num);
+ if (script_getvaridx(num))
+ script->array_update(n, num, true);
+ }
+ }
+}
+
+void set_reg_instance_str(struct script_state* st, int64 num, const char* name, const char *str)
+{
+ if (st->instance_id >= 0) {
+ if (str[0]) {
+ i64db_put(instance->list[st->instance_id].regs.vars, num, aStrdup(str));
+ if (script_getvaridx(num))
+ script->array_update(&instance->list[st->instance_id].regs, num, false);
+ } else {
+ i64db_remove(instance->list[st->instance_id].regs.vars, num);
+ if (script_getvaridx(num))
+ script->array_update(&instance->list[st->instance_id].regs, num, true);
+ }
+ } else {
+ ShowError("script_set_reg: cannot write instance variable '%s', NPC not in a instance!\n", name);
+ script->reportsrc(st);
+ }
+}
+
+void set_reg_instance_num(struct script_state* st, int64 num, const char* name, int val)
+{
+ if (st->instance_id >= 0) {
+ if (val != 0) {
+ i64db_iput(instance->list[st->instance_id].regs.vars, num, val);
+ if (script_getvaridx(num))
+ script->array_update(&instance->list[st->instance_id].regs, num, false);
+ } else {
+ i64db_remove(instance->list[st->instance_id].regs.vars, num);
+ if (script_getvaridx(num))
+ script->array_update(&instance->list[st->instance_id].regs, num, true);
+ }
+ } else {
+ ShowError("script_set_reg: cannot write instance variable '%s', NPC not in a instance!\n", name);
+ script->reportsrc(st);
+ }
+}
+
/**
* Stores the value of a script variable
*
@@ -3029,7 +3095,7 @@ void script_array_update(struct reg_db *src, int64 num, bool empty) {
*------------------------------------------*/
int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, const void* value, struct reg_db *ref) {
char prefix = name[0];
-
+
if( is_string_variable(name) ) {// string variable
const char *str = (const char*)value;
@@ -3044,36 +3110,15 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co
pc_setaccountreg2str(sd, num, str) :
pc_setaccountregstr(sd, num, str);
case '.':
- {
- struct reg_db *n = (ref) ? ref : (name[1] == '@') ? &st->stack->scope : &st->script->local;
- if( n ) {
- if (str[0]) {
- i64db_put(n->vars, num, aStrdup(str));
- if( script_getvaridx(num) )
- script->array_update(n, num, false);
- } else {
- i64db_remove(n->vars, num);
- if( script_getvaridx(num) )
- script->array_update(n, num, true);
- }
- }
- }
+ if (ref)
+ script->set_reg_ref_str(st, ref, num, name, str);
+ else if (name[1] == '@')
+ script->set_reg_scope_str(st, &st->stack->scope, num, name, str);
+ else
+ script->set_reg_npc_str(st, &st->script->local, num, name, str);
return 1;
case '\'':
- if( st->instance_id >= 0 ) {
- if( str[0] ) {
- i64db_put(instance->list[st->instance_id].regs.vars, num, aStrdup(str));
- if( script_getvaridx(num) )
- script->array_update(&instance->list[st->instance_id].regs, num, false);
- } else {
- i64db_remove(instance->list[st->instance_id].regs.vars, num);
- if( script_getvaridx(num) )
- script->array_update(&instance->list[st->instance_id].regs, num, true);
- }
- } else {
- ShowError("script_set_reg: cannot write instance variable '%s', NPC not in a instance!\n", name);
- script->reportsrc(st);
- }
+ set_reg_instance_str(st, num, name, str);
return 1;
default:
return pc_setglobalreg_str(sd, num, str);
@@ -3110,36 +3155,15 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co
pc_setaccountreg2(sd, num, val) :
pc_setaccountreg(sd, num, val);
case '.':
- {
- struct reg_db *n = (ref) ? ref : (name[1] == '@') ? &st->stack->scope : &st->script->local;
- if( n ) {
- if( val != 0 ) {
- i64db_iput(n->vars, num, val);
- if( script_getvaridx(num) )
- script->array_update(n, num, false);
- } else {
- i64db_remove(n->vars, num);
- if( script_getvaridx(num) )
- script->array_update(n, num, true);
- }
- }
- }
+ if (ref)
+ script->set_reg_ref_num(st, ref, num, name, val);
+ else if (name[1] == '@')
+ script->set_reg_scope_num(st, &st->stack->scope, num, name, val);
+ else
+ script->set_reg_npc_num(st, &st->script->local, num, name, val);
return 1;
case '\'':
- if( st->instance_id >= 0 ) {
- if( val != 0 ) {
- i64db_iput(instance->list[st->instance_id].regs.vars, num, val);
- if( script_getvaridx(num) )
- script->array_update(&instance->list[st->instance_id].regs, num, false);
- } else {
- i64db_remove(instance->list[st->instance_id].regs.vars, num);
- if( script_getvaridx(num) )
- script->array_update(&instance->list[st->instance_id].regs, num, true);
- }
- } else {
- ShowError("script_set_reg: cannot write instance variable '%s', NPC not in a instance!\n", name);
- script->reportsrc(st);
- }
+ set_reg_instance_num(st, num, name, val);
return 1;
default:
return pc_setglobalreg(sd, num, val);
@@ -3432,7 +3456,7 @@ struct script_state* script_alloc_state(struct script_code* rootscript, int pos,
st->oid = oid;
st->sleep.timer = INVALID_TIMER;
st->npc_item_flag = battle_config.item_enabled_npc;
-
+
if( st->script->instances != USHRT_MAX )
st->script->instances++;
else {
@@ -3457,11 +3481,11 @@ struct script_state* script_alloc_state(struct script_code* rootscript, int pos,
void script_free_state(struct script_state* st) {
if( idb_exists(script->st_db,st->id) ) {
struct map_session_data *sd = st->rid ? map->id2sd(st->rid) : NULL;
-
+
if(st->bk_st) {// backup was not restored
ShowDebug("script_free_state: Previous script state lost (rid=%d, oid=%d, state=%d, bk_npcid=%d).\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
}
-
+
if(sd && sd->st == st) { //Current script is aborted.
if(sd->state.using_fake_npc){
clif->clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
@@ -3864,7 +3888,6 @@ void op_1(struct script_state* st, int op)
script_pushint(st, i1);
}
-
/// Checks the type of all arguments passed to a built-in function.
///
/// @param st Script state whose stack arguments should be inspected.
@@ -3945,7 +3968,6 @@ void script_check_buildin_argtype(struct script_state* st, int func)
}
}
-
/// Executes a buildin command.
/// Stack: C_NAME(<command>) C_ARG <arg0> <arg1> ... <argN>
int run_func(struct script_state *st)
@@ -4207,15 +4229,15 @@ void run_script_main(struct script_state *st) {
int string_id = *((int *)(&st->script->script_buf[st->pos]));
uint8 translations = *((uint8 *)(&st->script->script_buf[st->pos+sizeof(int)]));
struct map_session_data *lsd = NULL;
-
+
st->pos += sizeof(int) + sizeof(uint8);
-
+
if( (!st->rid || !(lsd = map->id2sd(st->rid)) || !lsd->lang_id) && !map->default_lang_id )
script->push_str(stack,C_CONSTSTR,script->string_list+string_id);
else {
uint8 k, wlang_id = lsd ? lsd->lang_id : map->default_lang_id;
int offset = st->pos;
-
+
for(k = 0; k < translations; k++) {
uint8 lang_id = *(uint8 *)(&st->script->script_buf[offset]);
offset += sizeof(uint8);
@@ -4223,12 +4245,9 @@ void run_script_main(struct script_state *st) {
break;
offset += sizeof(char*);
}
-
script->push_str(stack,C_CONSTSTR,
- ( k == translations ) ? script->string_list+string_id : *(char**)(&st->script->script_buf[offset]) );
-
+ ( k == translations ) ? script->string_list+string_id : *(char**)(&st->script->script_buf[offset]) );
}
-
st->pos += ( ( sizeof(char*) + sizeof(uint8) ) * translations );
}
break;
@@ -4342,7 +4361,6 @@ int script_config_read(char *cfgName) {
char line[1024],w1[1024],w2[1024];
FILE *fp;
-
if( !( fp = fopen(cfgName,"r") ) ) {
ShowError("File not found: %s\n", cfgName);
return 1;
@@ -4417,7 +4435,6 @@ void script_add_autobonus(const char *autobonus)
}
}
-
/// resets a temporary character array variable to given value
void script_cleararray_pc(struct map_session_data* sd, const char* varname, void* value) {
struct script_array *sa = NULL;
@@ -4426,39 +4443,38 @@ void script_cleararray_pc(struct map_session_data* sd, const char* varname, void
int key;
key = script->add_str(varname);
-
+
if( !(src = script->array_src(NULL,sd,varname,NULL) ) )
return;
-
+
if( value )
script->array_ensure_zero(NULL,sd,reference_uid(key,0),NULL);
-
+
if( !(sa = idb_get(src->arrays, key)) ) /* non-existent array, nothing to empty */
return;
-
+
size = sa->size;
list = script->array_cpy_list(sa);
-
+
for(i = 0; i < size; i++) {
script->set_reg(NULL,sd,reference_uid(key, list[i]),varname,value,NULL);
}
}
-
/// sets a temporary character array variable element idx to given value
/// @param refcache Pointer to an int variable, which keeps a copy of the reference to varname and must be initialized to 0. Can be NULL if only one element is set.
void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache) {
int key;
-
+
if( idx >= SCRIPT_MAX_ARRAYSIZE ) {
ShowError("script_setarray_pc: Variable '%s' has invalid index '%u' (char_id=%d).\n", varname, idx, sd->status.char_id);
return;
}
key = ( refcache && refcache[0] ) ? refcache[0] : script->add_str(varname);
-
+
script->set_reg(NULL,sd,reference_uid(key, idx),varname,value,NULL);
-
+
if( refcache )
{// save to avoid repeated script->add_str calls
refcache[0] = key;
@@ -4469,23 +4485,22 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32
**/
int script_reg_destroy(DBKey key, DBData *data, va_list ap) {
struct script_reg_state *src;
-
+
if( data->type != DB_DATA_PTR )/* got no need for those! */
return 0;
-
+
src = DB->data2ptr(data);
-
+
if( src->type ) {
struct script_reg_str *p = (struct script_reg_str *)src;
-
+
if( p->value )
aFree(p->value);
-
+
ers_free(pc->str_reg_ers,p);
} else {
ers_free(pc->num_reg_ers,(struct script_reg_num*)src);
}
-
return 0;
}
/**
@@ -4496,10 +4511,10 @@ void script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct sc
if( data->type ) {
struct script_reg_str *p = (struct script_reg_str*)data;
-
+
if( p->value )
aFree(p->value);
-
+
ers_free(pc->str_reg_ers,p);
} else {
ers_free(pc->num_reg_ers,(struct script_reg_num*)data);
@@ -4643,16 +4658,15 @@ void do_final_script(void) {
if( script->labels != NULL )
aFree(script->labels);
-
+
ers_destroy(script->array_ers);
-
+
if( script->generic_ui_array )
aFree(script->generic_ui_array);
-
+
script->clear_translations(false);
-
script->parser_clean_leftovers();
-
+
if( script->lang_export_file )
aFree(script->lang_export_file);
}
@@ -4662,11 +4676,10 @@ void do_final_script(void) {
**/
uint8 script_add_language(const char *name) {
uint8 lang_id = script->max_lang_id;
-
+
RECREATE(script->languages, char *, ++script->max_lang_id);
-
script->languages[lang_id] = aStrdup(name);
-
+
return lang_id;
}
/**
@@ -4682,9 +4695,9 @@ void script_load_translations(void) {
if (map->minimal) // No translations in minimal mode
return;
-
+
script->translation_db = strdb_alloc(DB_OPT_DUP_KEY, NAME_LENGTH*2+1);
-
+
if( script->languages ) {
for(i = 0; i < script->max_lang_id; i++)
aFree(script->languages[i]);
@@ -4692,33 +4705,33 @@ void script_load_translations(void) {
}
script->languages = NULL;
script->max_lang_id = 0;
-
+
script->add_language("English");/* 0 is default, which is whatever is in the npc files hardcoded (in our case, English) */
-
+
if (libconfig->read_file(&translations_conf, config_filename)) {
ShowError("load_translations: can't read '%s'\n", config_filename);
return;
}
-
+
if( !(translations = libconfig->lookup(&translations_conf, "translations")) ) {
ShowError("load_translations: invalid format on '%s'\n",config_filename);
return;
}
-
+
if( script->string_list )
aFree(script->string_list);
-
+
script->string_list = NULL;
script->string_list_pos = 0;
script->string_list_size = 0;
-
+
size = libconfig->setting_length(translations);
-
+
for(i = 0; i < size; i++) {
const char *translation_file = libconfig->setting_get_string_elem(translations, i);
-
script->load_translation(translation_file, ++lang_id, &total);
}
+ libconfig->destroy(&translations_conf);
if( total ) {
DBIterator *main_iter;
@@ -4726,32 +4739,27 @@ void script_load_translations(void) {
DBMap *string_db;
struct string_translation *st = NULL;
uint32 j = 0;
-
-
+
CREATE(script->translation_buf, char *, total);
script->translation_buf_size = total;
-
+
main_iter = db_iterator(script->translation_db);
-
for( string_db = dbi_first(main_iter); dbi_exists(main_iter); string_db = dbi_next(main_iter) ) {
sub_iter = db_iterator(string_db);
-
for( st = dbi_first(sub_iter); dbi_exists(sub_iter); st = dbi_next(sub_iter) ) {
script->translation_buf[j++] = st->buf;
}
-
dbi_destroy(sub_iter);
}
-
dbi_destroy(main_iter);
}
-
+
for(k = 0; k < script->max_lang_id; k++) {
if( !strcmpi(script->languages[k],map->default_lang_str) ) {
break;
}
}
-
+
if( k == script->max_lang_id ) {
ShowError("load_translations: map server default_language setting '%s' is not a loaded language\n",map->default_lang_str);
map->default_lang_id = 0;
@@ -4766,21 +4774,21 @@ void script_load_translations(void) {
const char * script_get_translation_file_name(const char *file) {
static char file_name[200];
int i, len = (int)strlen(file), last_bar = -1, last_dot = -1;
-
+
for(i = 0; i < len; i++) {
if( file[i] == '/' || file[i] == '\\' )
last_bar = i;
else if ( file[i] == '.' )
last_dot = i;
}
-
+
if( last_bar != -1 || last_dot != -1 ) {
if( last_bar != -1 && last_dot < last_bar )
last_dot = -1;
safestrncpy(file_name, file+(last_bar >= 0 ? last_bar+1 : 0), ( last_dot >= 0 ? ( last_bar >= 0 ? last_dot - last_bar : last_dot ) : sizeof(file_name) ));
return file_name;
}
-
+
return file;
}
@@ -4795,25 +4803,25 @@ void script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
size_t i;
FILE *fp;
struct script_string_buf msgid = { 0 }, msgstr = { 0 };
-
+
if( !(fp = fopen(file,"rb")) ) {
ShowError("load_translation: failed to open '%s' for reading\n",file);
return;
}
-
+
script->add_language(script->get_translation_file_name(file));
if( lang_id >= atcommand->max_message_table )
atcommand->expand_message_table();
-
+
while(fgets(line, sizeof(line), fp)) {
size_t len = strlen(line), cursor = 0;
-
+
if( len <= 1 )
continue;
-
+
if( line[0] == '#' )
continue;
-
+
if( strncasecmp(line,"msgctxt \"", 9) == 0 ) {
msgctxt[0] = '\0';
for(i = 9; i < len - 2; i++) {
@@ -4847,14 +4855,14 @@ void script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
}
script_string_buf_addb(&msgstr,0);
}
-
+
if( msgctxt[0] && msgid.pos > 1 && msgstr.pos > 1 ) {
size_t msgstr_len = msgstr.pos;
unsigned int inner_len = 1 + (uint32)msgstr_len + 1; //uint8 lang_id + msgstr_len + '\0'
-
+
if( strcasecmp(msgctxt, "messages.conf") == 0 ) {
int k;
-
+
for(k = 0; k < MAX_MSG; k++) {
if( atcommand->msg_table[0][k] && strcmpi(atcommand->msg_table[0][k],msgid.ptr) == 0 ) {
if( atcommand->msg_table[lang_id][k] )
@@ -4863,29 +4871,24 @@ void script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
break;
}
}
-
} else {
struct string_translation *st = NULL;
if( !( string_db = strdb_get(script->translation_db, msgctxt) ) ) {
string_db = strdb_alloc(DB_OPT_DUP_KEY, 0);
-
strdb_put(script->translation_db, msgctxt, string_db);
}
-
+
if( !(st = strdb_get(string_db, msgid.ptr) ) ) {
CREATE(st, struct string_translation, 1);
-
st->string_id = script->string_dup(msgid.ptr);
-
strdb_put(string_db, msgid.ptr, st);
}
-
RECREATE(st->buf, char, st->len + inner_len);
-
+
WBUFB(st->buf, st->len) = lang_id;
safestrncpy((char*)WBUFP(st->buf, st->len + 1), msgstr.ptr, msgstr_len + 1);
-
+
st->translations++;
st->len += inner_len;
}
@@ -4894,11 +4897,11 @@ void script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
translations++;
}
}
-
+
*total += translations;
-
+
fclose(fp);
-
+
script_string_buf_destroy(&msgid);
script_string_buf_destroy(&msgstr);
@@ -4913,21 +4916,21 @@ void script_clear_translations(bool reload) {
if( script->string_list )
aFree(script->string_list);
-
+
script->string_list = NULL;
script->string_list_pos = 0;
script->string_list_size = 0;
-
+
if( script->translation_buf ) {
for(i = 0; i < script->translation_buf_size; i++) {
aFree(script->translation_buf[i]);
}
aFree(script->translation_buf);
}
-
+
script->translation_buf = NULL;
script->translation_buf_size = 0;
-
+
if( script->languages ) {
for(i = 0; i < script->max_lang_id; i++)
aFree(script->languages[i]);
@@ -4935,11 +4938,11 @@ void script_clear_translations(bool reload) {
}
script->languages = NULL;
script->max_lang_id = 0;
-
+
if( script->translation_db ) {
script->translation_db->clear(script->translation_db,script->translation_db_destroyer);
}
-
+
if( reload )
script->load_translations();
}
@@ -4949,18 +4952,17 @@ void script_clear_translations(bool reload) {
**/
int script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
DBMap *string_db = DB->data2ptr(data);
-
+
if( db_size(string_db) ) {
- DBIterator *iter = db_iterator(string_db);
struct string_translation *st = NULL;
-
+ DBIterator *iter = db_iterator(string_db);
+
for( st = dbi_first(iter); dbi_exists(iter); st = dbi_next(iter) ) {
aFree(st);
}
-
dbi_destroy(iter);
}
-
+
db_destroy(string_db);
return 0;
}
@@ -4969,10 +4971,9 @@ int script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
*
**/
void script_parser_clean_leftovers(void) {
-
if( script->buf )
aFree(script->buf);
-
+
script->buf = NULL;
script->size = 0;
@@ -4980,7 +4981,7 @@ void script_parser_clean_leftovers(void) {
script->translation_db->destroy(script->translation_db,script->translation_db_destroyer);
script->translation_db = NULL;
}
-
+
if( script->syntax.strings ) { /* used only when generating translation file */
db_destroy(script->syntax.strings);
script->syntax.strings = NULL;
@@ -4995,21 +4996,19 @@ void script_parser_clean_leftovers(void) {
* Performs cleanup after all parsing is processed
**/
int script_parse_cleanup_timer(int tid, int64 tick, int id, intptr_t data) {
-
script->parser_clean_leftovers();
script->parse_cleanup_timer_id = INVALID_TIMER;
-
+
return 0;
}
-
/*==========================================
* Initialization
*------------------------------------------*/
void do_init_script(bool minimal) {
script->parse_cleanup_timer_id = INVALID_TIMER;
-
+
script->st_db = idb_alloc(DB_OPT_BASE);
script->userfunc_db = strdb_alloc(DB_OPT_DUP_KEY,0);
script->autobonus_db = strdb_alloc(DB_OPT_DUP_KEY,0);
@@ -5029,7 +5028,6 @@ void do_init_script(bool minimal) {
return;
mapreg->init();
-
script->load_translations();
}
@@ -5063,9 +5061,9 @@ int script_reload(void) {
atcommand->binding_count = 0;
db_clear(script->st_db);
-
+
script->clear_translations(true);
-
+
if( script->parse_cleanup_timer_id != INVALID_TIMER ) {
timer->delete(script->parse_cleanup_timer_id,script->parse_cleanup_timer);
script->parse_cleanup_timer_id = INVALID_TIMER;
@@ -5823,7 +5821,7 @@ int buildin_areawarp_sub(struct block_list *bl,va_list ap)
tx = rnd()%(x3-x2+1)+x2;
ty = rnd()%(y3-y2+1)+y2;
j++;
- } while( map->getcell(index,tx,ty,CELL_CHKNOPASS) && j < max );
+ } while (map->getcell(index, bl, tx, ty, CELL_CHKNOPASS) && j < max);
pc->setpos((TBL_PC *)bl,index,tx,ty,CLR_OUTSIGHT);
}
@@ -6290,7 +6288,7 @@ BUILDIN(__setr) {
if (!not_array_variable(*namevalue)) {
// array variable being copied into another array variable
- if (sd == NULL && not_server_variable(*namevalue) && !(sd = script->rid2sd(st))) {
+ if (sd == NULL && not_server_variable(*namevalue) && (sd = script->rid2sd(st)) == NULL) {
// player must be attached in order to copy a player variable
ShowError("script:set: no player attached for player variable '%s'\n", namevalue);
return true;
@@ -6584,15 +6582,15 @@ BUILDIN(deletearray)
st->state = END;
return false;// not a variable
}
-
+
script->array_ensure_zero(st,NULL,data->u.num,reference_getref(data));
-
+
if ( !(sa = idb_get(src->arrays, id)) ) { /* non-existent array, nothing to empty */
return true;// not a variable
}
end = script->array_highest_key(st,sd,name,reference_getref(data));
-
+
if( start >= end )
return true;// nothing to free
@@ -6600,7 +6598,7 @@ BUILDIN(deletearray)
value = (void *)"";
else
value = (void *)0;
-
+
if( script_hasdata(st,3) ) {
unsigned int count = script_getnum(st, 3);
if( count > end - start )
@@ -6626,14 +6624,14 @@ BUILDIN(deletearray)
list = script->array_cpy_list(sa);
size = sa->size;
qsort(list, size, sizeof(unsigned int), script_array_index_cmp);
-
+
ARR_FIND(0, size, i, list[i] >= start);
-
+
for( ; i < size && list[i] < start + count; i++ ) {
// Clear any entries between start and start+count, if they exist
script->set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
}
-
+
for( ; i < size && list[i] < end; i++ ) {
// Move back count positions any entries between start+count to fill the gaps
void* v = script->get_val2(st, reference_uid(id, list[i]), reference_getref(data));
@@ -6647,7 +6645,7 @@ BUILDIN(deletearray)
unsigned int *list = NULL, size = 0;
list = script->array_cpy_list(sa);
size = sa->size;
-
+
for(i = 0; i < size; i++) {
if( list[i] >= start ) // Less expensive than sorting it, most likely
script->set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
@@ -7126,7 +7124,7 @@ BUILDIN(getitem) {
if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) {
clif->additem(sd, 0, 0, flag);
if( pc->candrop(sd,&it) )
- map->addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &it, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -7234,7 +7232,7 @@ BUILDIN(getitem2)
if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT))) {
clif->additem(sd, 0, 0, flag);
if( pc->candrop(sd,&item_tmp) )
- map->addflooritem(&item_tmp,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -7423,17 +7421,15 @@ BUILDIN(makeitem)
return false;
}
-
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = nameid;
item_tmp.identify=1;
-
- map->addflooritem(&item_tmp,amount,m,x,y,0,0,0,0);
+
+ map->addflooritem(NULL, &item_tmp, amount, m, x, y, 0, 0, 0, 0);
return true;
}
-
/// Counts / deletes the current item given by idx.
/// Used by buildin_delitem_search
/// Relies on all input data being already fully valid.
@@ -7456,7 +7452,6 @@ void buildin_delitem_delete(struct map_session_data* sd, int idx, int* amount, b
amount[0]-= delamount;
}
-
/// Searches for item(s) and checks, if there is enough of them.
/// Used by delitem and delitem2
/// Relies on all input data being already fully valid.
@@ -7564,7 +7559,6 @@ bool buildin_delitem_search(struct map_session_data* sd, struct item* it, bool e
}
}
-
/// Deletes items from the target/attached player.
/// Prioritizes ordinary items.
///
@@ -8484,7 +8478,7 @@ BUILDIN(successrefitem)
if (script_hasdata(st, 3))
up = script_getnum(st, 3);
-
+
if (num > 0 && num <= ARRAYLENGTH(script->equip))
i=pc->checkequip(sd,script->equip[num-1]);
if (i >= 0) {
@@ -8619,7 +8613,7 @@ BUILDIN(delequip)
pc->delitem(sd, i, 1, 0, DELITEM_FAILREFINE, LOG_TYPE_SCRIPT);
return true;
}
-
+
ShowError("script:delequip: no item found in position '%d' for player '%s' (AID:%d/CID:%d).\n", num, sd->status.name,sd->status.account_id, sd->status.char_id);
st->state = END;
clif->scriptclose(sd, st->oid);
@@ -9039,7 +9033,7 @@ BUILDIN(getgroupid)
/// end
BUILDIN(end) {
st->state = END;
-
+
/* are we stopping inside a function? */
if( st->stack->defsp >= 1 && st->stack->stack_data[st->stack->defsp-1].type == C_RETINFO ) {
int i;
@@ -11095,7 +11089,6 @@ BUILDIN(homunculus_checkcall) {
return true;
}
-
// [Zephyrus]
BUILDIN(homunculus_shuffle) {
TBL_PC *sd;
@@ -11135,7 +11128,7 @@ BUILDIN(roclass)
sex = script_getnum(st,3);
else {
TBL_PC *sd;
- if (st->rid && (sd=script->rid2sd(st)))
+ if (st->rid && (sd=script->rid2sd(st)) != NULL)
sex = sd->status.sex;
else
sex = 1; //Just use male when not found.
@@ -11420,6 +11413,10 @@ BUILDIN(disablewaitingroomevent) {
/// <type>=16 : the name of the waiting room event
/// <type>=32 : if the waiting room is full
/// <type>=33 : if there are enough users to trigger the event
+/// -- Custom Added
+/// <type>=34 : minimum player of waiting room
+/// <type>=35 : maximum player of waiting room
+/// <type>=36 : minimum zeny required
///
/// getwaitingroomstate(<type>,"<npc_name>") -> <info>
/// getwaitingroomstate(<type>) -> <info>
@@ -11427,6 +11424,7 @@ BUILDIN(getwaitingroomstate) {
struct npc_data *nd;
struct chat_data *cd;
int type;
+ int i;
type = script_getnum(st,2);
if( script_hasdata(st,3) )
@@ -11440,7 +11438,13 @@ BUILDIN(getwaitingroomstate) {
}
switch(type) {
- case 0: script_pushint(st, cd->users); break;
+ case 0:
+ for (i = 0; i < cd->users; i++) {
+ struct map_session_data *sd = cd->usersd[i];
+ mapreg->setreg(reference_uid(script->add_str("$@chatmembers"), i), sd->bl.id);
+ }
+ script_pushint(st, cd->users);
+ break;
case 1: script_pushint(st, cd->limit); break;
case 2: script_pushint(st, cd->trigger&0x7f); break;
case 3: script_pushint(st, ((cd->trigger&0x80)!=0)); break;
@@ -11449,6 +11453,10 @@ BUILDIN(getwaitingroomstate) {
case 16: script_pushstrcopy(st, cd->npc_event);break;
case 32: script_pushint(st, (cd->users >= cd->limit)); break;
case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
+
+ case 34: script_pushint(st, cd->minLvl); break;
+ case 35: script_pushint(st, cd->maxLvl); break;
+ case 36: script_pushint(st, cd->zeny); break;
default: script_pushint(st, -1); break;
}
return true;
@@ -11565,7 +11573,6 @@ BUILDIN(isloggedin) {
return true;
}
-
/*==========================================
*
*------------------------------------------*/
@@ -11885,7 +11892,6 @@ BUILDIN(pvpon) {
bl.m = m;
clif->maptypeproperty2(&bl,ALL_SAMEMAP);
-
if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
return true;
@@ -12294,7 +12300,7 @@ BUILDIN(successremovecards)
if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))) {
// get back the cart in inventory
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -12319,7 +12325,7 @@ BUILDIN(successremovecards)
if ((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))) {
//chk if can be spawn in inventory otherwise put on floor
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
clif->misceffect(&sd->bl,3);
@@ -12368,7 +12374,7 @@ BUILDIN(failedremovecards)
if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -12399,7 +12405,7 @@ BUILDIN(failedremovecards)
if((flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
clif->misceffect(&sd->bl,2);
@@ -13806,12 +13812,20 @@ BUILDIN(message) {
/*==========================================
* npctalk (sends message to surrounding area)
+ * usage: npctalk "<message>"{,"<npc name>"};
*------------------------------------------*/
BUILDIN(npctalk)
{
- struct npc_data* nd = (struct npc_data *)map->id2bl(st->oid);
+ struct npc_data* nd;
const char *str = script_getstr(st,2);
+ if (script_hasdata(st, 3)) {
+ nd = npc->name2id(script_getstr(st, 3));
+ }
+ else {
+ nd = (struct npc_data *)map->id2bl(st->oid);
+ }
+
if (nd) {
char name[NAME_LENGTH], message[256];
safestrncpy(name, nd->name, sizeof(name));
@@ -13977,7 +13991,6 @@ BUILDIN(getnpcclass)
return true;
}
-
/*==========================================
* getlook char info. getlook(arg)
*------------------------------------------*/
@@ -14082,13 +14095,13 @@ BUILDIN(getmapxy)
script_pushint(st,-1);
return false;
}
-
+
if( !is_string_variable(reference_getname(script_getdata(st, 2))) ) {
ShowWarning("script: buildin_getmapxy: %s is not a string variable\n",reference_getname(script_getdata(st, 2)));
script_pushint(st,-1);
return false;
}
-
+
if( is_string_variable(reference_getname(script_getdata(st, 3))) ) {
ShowWarning("script: buildin_getmapxy: %s is a string variable, should be int\n",reference_getname(script_getdata(st, 3)));
script_pushint(st,-1);
@@ -14180,7 +14193,7 @@ BUILDIN(getmapxy)
num=st->stack->stack_data[st->start+2].u.num;
name=script->get_str(script_getvarid(num));
prefix=*name;
-
+
if(not_server_variable(prefix))
sd=script->rid2sd(st);
else
@@ -14557,7 +14570,7 @@ BUILDIN(equip2)
script_pushint(st,0);
return true;
}
-
+
nameid = script_getnum(st,2);
if( (item_data = itemdb->exists(nameid)) == NULL )
{
@@ -14831,8 +14844,6 @@ BUILDIN(explode)
size_t len = strlen(str);
int i = 0, j = 0;
int start;
-
-
char *temp;
const char* name;
@@ -15403,7 +15414,6 @@ BUILDIN(countstr)
return true;
}
-
/// Changes the display name and/or display class of the npc.
/// Returns 0 is successful, 1 if the npc does not exist.
///
@@ -16153,7 +16163,6 @@ BUILDIN(checkvending) // check vending [Nab4]
return true;
}
-
// check chatting [Marka]
BUILDIN(checkchatting) {
TBL_PC *sd = NULL;
@@ -16295,7 +16304,6 @@ BUILDIN(pcfollow) {
int id, targetid;
TBL_PC *sd = NULL;
-
id = script_getnum(st,2);
targetid = script_getnum(st,3);
@@ -16315,7 +16323,6 @@ BUILDIN(pcstopfollow)
int id;
TBL_PC *sd = NULL;
-
id = script_getnum(st,2);
if(id)
@@ -16733,7 +16740,7 @@ BUILDIN(getvariableofnpc)
if( !nd->u.scr.script->local.vars )
nd->u.scr.script->local.vars = i64db_alloc(DB_OPT_RELEASE_DATA);
-
+
script->push_val(st->stack, C_NAME, reference_getuid(data), &nd->u.scr.script->local);
return true;
}
@@ -16770,7 +16777,7 @@ BUILDIN(warpportal) {
if( bl->type == BL_NPC )
unit->bl2ud2(bl); // ensure nd->ud is safe to edit
-
+
group = skill->unitsetting(bl, AL_WARP, 4, spx, spy, 0);
if( group == NULL )
return true;// failed
@@ -16823,7 +16830,7 @@ BUILDIN(checkcell) {
return true;
}
- script_pushint(st, map->getcell(m, x, y, type));
+ script_pushint(st, map->getcell(m, NULL, x, y, type));
return true;
}
@@ -17726,7 +17733,7 @@ BUILDIN(has_instance) {
int16 m;
int instance_id = -1;
bool type = strcmp(script->getfuncname(st),"has_instance2") == 0 ? true : false;
-
+
str = script_getstr(st, 2);
if( (m = map->mapname2mapid(str)) < 0 ) {
@@ -17755,7 +17762,7 @@ BUILDIN(has_instance) {
if( i != sd->instances )
instance_id = sd->instance[i];
}
- if( instance_id == -1 && sd->status.party_id && (p = party->search(sd->status.party_id)) && p->instances ) {
+ if (instance_id == -1 && sd->status.party_id && (p = party->search(sd->status.party_id)) != NULL && p->instances) {
for( i = 0; i < p->instances; i++ ) {
if( p->instance[i] >= 0 ) {
ARR_FIND(0, instance->list[p->instance[i]].num_map, j, map->list[instance->list[p->instance[i]].map[j]].instance_src_map == m);
@@ -17940,7 +17947,7 @@ BUILDIN(instance_check_guild)
c++;
}
}
-
+
if( c < amount )
script_pushint(st,0);
else
@@ -18039,7 +18046,6 @@ BUILDIN(areamobuseskill) {
return true;
}
-
BUILDIN(progressbar)
{
struct map_session_data * sd = script->rid2sd(st);
@@ -18101,7 +18107,6 @@ BUILDIN(pushpc)
return true;
}
-
/// Invokes buying store preparation window
/// buyingstore <slots>;
BUILDIN(buyingstore)
@@ -18116,7 +18121,6 @@ BUILDIN(buyingstore)
return true;
}
-
/// Invokes search store info window
/// searchstores <uses>,<effect>;
BUILDIN(searchstores)
@@ -18393,7 +18397,6 @@ BUILDIN(bindatcmd) {
if( script_hasdata(st,5) ) group_lv_char = script_getnum(st,5);
if( script_hasdata(st,6) ) log = script_getnum(st,6) ? true : false;
-
if( atcommand->binding_count == 0 ) {
CREATE(atcommand->binding,struct atcmd_binding_data*,1);
@@ -18608,7 +18611,7 @@ BUILDIN(getrandgroupitem) {
if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) {
clif->additem(sd, 0, 0, flag);
if( pc->candrop(sd,&it) )
- map->addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &it, get_count, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -18668,11 +18671,11 @@ BUILDIN(npcskill) {
skill_level = script_getnum(st, 3);
stat_point = script_getnum(st, 4);
npc_level = script_getnum(st, 5);
-
+
if( !(sd = script->rid2sd(st)) )
return false;
-
- nd = (struct npc_data *)map->id2bl(sd->npc_id);
+
+ nd = (struct npc_data *)map->id2bl(sd->npc_id);
if (stat_point > battle_config.max_third_parameter) {
ShowError("npcskill: stat point exceeded maximum of %d.\n",battle_config.max_third_parameter );
@@ -18778,7 +18781,7 @@ BUILDIN(montransform) {
clif->ShowScript(&sd->bl, msg);
status_change_end(bl, SC_MONSTER_TRANSFORM, INVALID_TIMER); // Clear previous
sc_start2(NULL, bl, SC_MONSTER_TRANSFORM, 100, mob_id, type, tick);
-
+
if (script_hasdata(st, 4))
sc_start4(NULL, bl, type, 100, val1, val2, val3, val4, tick);
}
@@ -18862,7 +18865,7 @@ bool script_hqueue_add(int idx, int var)
script->hq[idx].item[i] = var;
script->hq[idx].items++;
- if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var))) {
+ if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
for (i = 0; i < sd->queues_count; i++) {
if (sd->queues[i] == -1) {
break;
@@ -18908,7 +18911,7 @@ bool script_hqueue_remove(int idx, int var) {
script->hq[idx].item[i] = -1;
script->hq[idx].items--;
- if( var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) ) {
+ if (var >= START_ACCOUNT_NUM && (sd = map->id2sd(var)) != NULL) {
for(i = 0; i < sd->queues_count; i++) {
if( sd->queues[i] == idx ) {
break;
@@ -18986,7 +18989,7 @@ bool script_hqueue_del(int idx)
int i;
for (i = 0; i < script->hq[idx].size; i++) {
struct map_session_data *sd;
- if( script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) ) {
+ if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) {
int j;
for(j = 0; j < sd->queues_count; j++) {
if( sd->queues[j] == script->hq[idx].item[i] ) {
@@ -19025,7 +19028,7 @@ void script_hqueue_clear(int idx) {
for(i = 0; i < script->hq[idx].size; i++) {
if( script->hq[idx].item[i] > 0 ) {
- if( script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) ) {
+ if (script->hq[idx].item[i] >= START_ACCOUNT_NUM && (sd = map->id2sd(script->hq[idx].item[i])) != NULL) {
for(j = 0; j < sd->queues_count; j++) {
if( sd->queues[j] == idx ) {
break;
@@ -19292,7 +19295,7 @@ BUILDIN(checkbound)
return true;
} else
script_pushint(st,0);
-
+
return true;
}
@@ -19373,8 +19376,6 @@ BUILDIN(instance_set_respawn) {
script_pushint(st, 0);
}
}
-
-
return true;
}
/**
@@ -19676,7 +19677,6 @@ BUILDIN(channelmes)
return true;
}
-
/** By Cydh
Display script message
showscript "<message>"{,<GID>};
@@ -20128,7 +20128,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF2(atcommand,"charcommand","s"), // [MouseJstr]
BUILDIN_DEF(movenpc,"sii?"), // [MouseJstr]
BUILDIN_DEF(message,"ss"), // [MouseJstr]
- BUILDIN_DEF(npctalk,"s"), // [Valaris]
+ BUILDIN_DEF(npctalk,"s?"), // [Valaris]
BUILDIN_DEF(mobcount,"ss"),
BUILDIN_DEF(getlook,"i"),
BUILDIN_DEF(getsavepoint,"i"),
@@ -20433,7 +20433,6 @@ void script_label_add(int key, int pos) {
* Sets source-end constants for scripts to play with
**/
void script_hardcoded_constants(void) {
-
/* server defines */
script->set_constant("PACKETVER",PACKETVER,false);
script->set_constant("MAX_LEVEL",MAX_LEVEL,false);
@@ -20553,7 +20552,7 @@ void script_hardcoded_constants(void) {
**/
unsigned short script_mapindexname2id (struct script_state *st, const char* name) {
unsigned short index;
-
+
if( !(index=mapindex->name2id(name)) ) {
script->reportsrc(st);
return 0;
@@ -20561,7 +20560,6 @@ unsigned short script_mapindexname2id (struct script_state *st, const char* name
return index;
}
-
void script_defaults(void) {
// aegis->athena slot position conversion table
unsigned int equip[SCRIPT_EQUIP_TABLE_SIZE] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_GARMENT,EQP_SHOES,EQP_ACC_L,EQP_ACC_R,EQP_HEAD_MID,EQP_HEAD_LOW,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_GARMENT,EQP_SHADOW_ARMOR, EQP_SHADOW_WEAPON, EQP_SHADOW_SHIELD, EQP_SHADOW_SHOES, EQP_SHADOW_ACC_R, EQP_SHADOW_ACC_L};
@@ -20574,7 +20572,7 @@ void script_defaults(void) {
script->st_ers = NULL;
script->stack_ers = NULL;
script->array_ers = NULL;
-
+
script->hq = NULL;
script->hqi = NULL;
script->hqs = script->hqis = 0;
@@ -20654,6 +20652,14 @@ void script_defaults(void) {
script->push_val = push_val;
script->get_val = get_val;
script->get_val2 = get_val2;
+ script->get_val_ref_str = get_val_npcscope_str;
+ script->get_val_scope_str = get_val_npcscope_str;
+ script->get_val_npc_str = get_val_npcscope_str;
+ script->get_val_instance_str = get_val_instance_str;
+ script->get_val_ref_num = get_val_npcscope_num;
+ script->get_val_scope_num = get_val_npcscope_num;
+ script->get_val_npc_num = get_val_npcscope_num;
+ script->get_val_instance_num = get_val_instance_num;
script->push_str = push_str;
script->push_copy = push_copy;
script->pop_stack = pop_stack;
@@ -20720,6 +20726,15 @@ void script_defaults(void) {
script->print_line = script_print_line;
script->errorwarning_sub = script_errorwarning_sub;
script->set_reg = set_reg;
+ script->set_reg_ref_str = set_reg_npcscope_str;
+ script->set_reg_scope_str = set_reg_npcscope_str;
+ script->set_reg_npc_str = set_reg_npcscope_str;
+ script->set_reg_instance_str = set_reg_instance_str;
+ script->set_reg_ref_num = set_reg_npcscope_num;
+ script->set_reg_scope_num = set_reg_npcscope_num;
+ script->set_reg_npc_num = set_reg_npcscope_num;
+ script->set_reg_instance_num = set_reg_instance_num;
+
script->stack_expand = stack_expand;
script->push_retinfo = push_retinfo;
script->op_3 = op_3;
@@ -20798,7 +20813,7 @@ void script_defaults(void) {
script->global_casecheck.str_pos = 0;
memset(script->global_casecheck.str_hash, 0, sizeof(script->global_casecheck.str_hash));
// end ENABLE_CASE_CHECK
-
+
/**
* Array Handling
**/
diff --git a/src/map/script.h b/src/map/script.h
index ad8ae82cb..ff660dec8 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -629,6 +629,14 @@ struct script_interface {
void (*detach_rid) (struct script_state* st);
struct script_data* (*push_val)(struct script_stack* stack, enum c_op type, int64 val, struct reg_db *ref);
struct script_data *(*get_val) (struct script_state* st, struct script_data* data);
+ char* (*get_val_ref_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ char* (*get_val_scope_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ char* (*get_val_npc_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ char* (*get_val_instance_str) (struct script_state* st, const char* name, struct script_data* data);
+ int (*get_val_ref_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ int (*get_val_scope_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ int (*get_val_npc_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ int (*get_val_instance_num) (struct script_state* st, const char* name, struct script_data* data);
void* (*get_val2) (struct script_state* st, int64 uid, struct reg_db *ref);
struct script_data* (*push_str) (struct script_stack* stack, enum c_op type, char* str);
struct script_data* (*push_copy) (struct script_stack* stack, int pos);
@@ -696,6 +704,14 @@ struct script_interface {
const char* (*print_line) (StringBuf *buf, const char *p, const char *mark, int line);
void (*errorwarning_sub) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
int (*set_reg) (struct script_state *st, TBL_PC *sd, int64 num, const char *name, const void *value, struct reg_db *ref);
+ void (*set_reg_ref_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
+ void (*set_reg_scope_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
+ void (*set_reg_npc_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
+ void (*set_reg_instance_str) (struct script_state* st, int64 num, const char* name, const char *str);
+ void (*set_reg_ref_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
+ void (*set_reg_scope_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
+ void (*set_reg_npc_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
+ void (*set_reg_instance_num) (struct script_state* st, int64 num, const char* name, int val);
void (*stack_expand) (struct script_stack *stack);
struct script_data* (*push_retinfo) (struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref);
void (*op_3) (struct script_state *st, int op);
diff --git a/src/map/skill.c b/src/map/skill.c
index 2582ca2b6..a9ebf6998 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -115,7 +115,7 @@ int skill_get_index( uint16 skill_id ) {
else
ShowWarning("skill_get_index: skill id '%d' is not being handled!\n",skill_id);
}
-
+
// validate result
if( !skill_id || skill_id >= MAX_SKILL_DB )
return 0;
@@ -365,7 +365,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
#else // not RENEWAL
hp = ( status->get_lv(src) + status_get_int(src) ) / 8 * (4 + ( skill_id == AB_HIGHNESSHEAL ? ( sd ? pc->checkskill(sd,AL_HEAL) : 10 ) : skill_lv ) * 8);
#endif // RENEWAL
- if( sd && ((skill2_lv = pc->checkskill(sd, HP_MEDITATIO)) > 0) )
+ if (sd && (skill2_lv = pc->checkskill(sd, HP_MEDITATIO)) > 0)
hp += hp * skill2_lv * 2 / 100;
else if( src->type == BL_HOM && (skill2_lv = homun->checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0 )
hp += hp * skill2_lv * 2 / 100;
@@ -375,10 +375,10 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
if( ( (target && target->type == BL_MER) || !heal ) && skill_id != NPC_EVILLAND )
hp >>= 1;
- if( sd && (skill2_lv = pc->skillheal_bonus(sd, skill_id)) )
+ if (sd && (skill2_lv = pc->skillheal_bonus(sd, skill_id)) != 0)
hp += hp*skill2_lv/100;
- if( tsd && (skill2_lv = pc->skillheal2_bonus(tsd, skill_id)) )
+ if (tsd && (skill2_lv = pc->skillheal2_bonus(tsd, skill_id)) != 0)
hp += hp*skill2_lv/100;
sc = status->get_sc(src);
@@ -481,14 +481,14 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
clif->skill_fail(sd, skill_id, USESKILL_FAIL_SKILLINTERVAL, 0);
return 1;
}
-
+
/**
* It has been confirmed on a official server (thanks to Yommy) that item-cast skills bypass all the restrictions below
* Also, without this check, an exploit where an item casting + healing (or any other kind buff) isn't deleted after used on a restricted map
**/
if( sd->skillitem == skill_id )
return 0;
-
+
if( sd->sc.data[SC_ALL_RIDING] )
return 1;//You can't use skills while in the new mounts (The client doesn't let you, this is to make cheat-safe)
@@ -970,7 +970,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
case DC_UGLYDANCE:
rate = 5+5*skill_lv;
- if(sd && (temp=pc->checkskill(sd,DC_DANCINGLESSON)))
+ if (sd && (temp=pc->checkskill(sd,DC_DANCINGLESSON)) > 0)
rate += 5+temp;
status_zap(bl, 0, rate);
break;
@@ -2105,7 +2105,6 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
return unit->blown(target, dx, dy, count, flag); // send over the proper flag
}
-
/*
Checks if 'bl' should reflect back a spell cast by 'src'.
type is the type of magic attack: 0: indirect (aoe), 1: direct (targeted)
@@ -2213,7 +2212,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
if(csc && csc->data[SC_GRAVITATION] && csc->data[SC_GRAVITATION]->val3 == BCT_SELF )
return 0;
}
-
+
dmg = battle->calc_attack(attack_type,src,bl,skill_id,skill_lv,flag&0xFFF);
//Skotlex: Adjusted to the new system
@@ -2232,11 +2231,11 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
}
}
- if( dmg.flag&BF_MAGIC
+ if( dmg.flag&BF_MAGIC
&& (skill_id != NPC_EARTHQUAKE || (battle_config.eq_single_target_reflectable && (flag & 0xFFF) == 1)) ) { /* Need more info cause NPC_EARTHQUAKE is ground type */
// Earthquake on multiple targets is not counted as a target skill. [Inkfish]
int reflecttype;
- if( (dmg.damage || dmg.damage2) && (reflecttype = skill->magic_reflect(src, bl, src==dsrc)) ) {
+ if ((dmg.damage || dmg.damage2) && (reflecttype = skill->magic_reflect(src, bl, src==dsrc)) != 0) {
//Magic reflection, switch caster/target
struct block_list *tbl = bl;
rmdamage = true;
@@ -2406,7 +2405,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
{
//bonus from SG_FRIEND [Komurka]
int level;
- if(sd->status.party_id>0 && (level = pc->checkskill(sd,SG_FRIEND)))
+ if(sd->status.party_id>0 && (level = pc->checkskill(sd,SG_FRIEND)) > 0)
party->skill_check(sd, sd->status.party_id, TK_COUNTER,level);
}
break;
@@ -2610,7 +2609,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
can_copy(tsd,copy_skill,bl)) // Split all the check into their own function [Aru]
{
int lv, idx = 0;
- if( sc && sc->data[SC__REPRODUCE] && (lv = sc->data[SC__REPRODUCE]->val1) ) {
+ if (sc && sc->data[SC__REPRODUCE] && (lv = sc->data[SC__REPRODUCE]->val1) > 0) {
//Level dependent and limitation.
lv = min(lv,skill->get_max(copy_skill));
@@ -2731,7 +2730,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
short dir_x, dir_y;
dir_x = dirx[(dir+4)%8];
dir_y = diry[(dir+4)%8];
- if( map->getcell(bl->m, bl->x+dir_x, bl->y+dir_y, CELL_CHKNOPASS) != 0 )
+ if (map->getcell(bl->m, bl, bl->x + dir_x, bl->y + dir_y, CELL_CHKNOPASS) != 0)
skill->addtimerskill(src, tick + 300 * ((flag&2) ? 1 : 2), bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag|4);
}
break;
@@ -2800,7 +2799,6 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
battle->drain(sd, bl, dmg.damage, dmg.damage2, tstatus->race, tstatus->mode&MD_BOSS);
}
-
if( damage > 0 ) {
/**
* Post-damage effects
@@ -2835,7 +2833,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
if (!(flag&2)
&& (skill_id == MG_COLDBOLT || skill_id == MG_FIREBOLT || skill_id == MG_LIGHTNINGBOLT)
- && (sc = status->get_sc(src))
+ && (sc = status->get_sc(src)) != NULL
&& sc->data[SC_DOUBLECASTING]
&& rnd() % 100 < sc->data[SC_DOUBLECASTING]->val2
) {
@@ -3374,13 +3372,13 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
case WZ_METEOR:
if( skl->type >= 0 ) {
int x = skl->type>>16, y = skl->type&0xFFFF;
- if( path->search_long(NULL, src->m, src->x, src->y, x, y, CELL_CHKWALL) )
+ if( path->search_long(NULL, src, src->m, src->x, src->y, x, y, CELL_CHKWALL) )
skill->unitsetting(src,skl->skill_id,skl->skill_lv,x,y,skl->flag);
- if( path->search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL)
- && !map->getcell(src->m, skl->x, skl->y, CELL_CHKLANDPROTECTOR) )
+ if( path->search_long(NULL, src, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL)
+ && !map->getcell(src->m, src, skl->x, skl->y, CELL_CHKLANDPROTECTOR) )
clif->skill_poseffect(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,tick);
}
- else if( path->search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) )
+ else if( path->search_long(NULL, src, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) )
skill->unitsetting(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,skl->flag);
break;
case GN_CRAZYWEED_ATK: {
@@ -3497,7 +3495,7 @@ int skill_activate_reverberation(struct block_list *bl, va_list ap) {
struct skill_unit_group *sg;
if( bl->type != BL_SKILL )
return 0;
- if( su->alive && (sg = su->group) && sg->skill_id == WM_REVERBERATION && sg->unit_id == UNT_REVERBERATION ) {
+ if( su->alive && (sg = su->group) != NULL && sg->skill_id == WM_REVERBERATION && sg->unit_id == UNT_REVERBERATION ) {
int64 tick = timer->gettick();
clif->changetraplook(bl,UNT_USED_TRAPS);
map->foreachinrange(skill->trap_splash, bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, bl, tick);
@@ -3724,7 +3722,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
break;
case KN_CHARGEATK: {
- bool path_exists = path->search_long(NULL, src->m, src->x, src->y, bl->x, bl->y,CELL_CHKWALL);
+ bool path_exists = path->search_long(NULL, src, src->m, src->x, src->y, bl->x, bl->y,CELL_CHKWALL);
unsigned int dist = distance_bl(src, bl);
uint8 dir = map->calc_dir(bl, src->x, src->y);
@@ -4044,7 +4042,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
tx -= dirx[dir];
ty -= diry[dir];
// If target cell is a wall then break
- if(map->getcell(bl->m,tx,ty,CELL_CHKWALL))
+ if(map->getcell(bl->m, bl, tx, ty, CELL_CHKWALL))
break;
skill->blown(src,bl,1,dir,0);
// Splash around target cell, but only cells inside area; we first have to check the area is not negative
@@ -4175,7 +4173,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
for( y = src->y - range; y <= src->y + range; ++y )
for( x = src->x - range; x <= src->x + range; ++x ) {
if( !map->find_skill_unit_oncell(src,x,y,SA_LANDPROTECTOR,NULL,1) ) {
- if( src->type != BL_PC || map->getcell(src->m,x,y,CELL_CHKWATER) ) // non-players bypass the water requirement
+ if (src->type != BL_PC || map->getcell(src->m, src, x, y, CELL_CHKWATER)) // non-players bypass the water requirement
count++; // natural water cell
else if( (su = map->find_skill_unit_oncell(src,x,y,SA_DELUGE,NULL,1)) != NULL
|| (su = map->find_skill_unit_oncell(src,x,y,NJ_SUITON,NULL,1)) != NULL ) {
@@ -4492,7 +4490,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
break;
case WL_FROSTMISTY:
// Doesn't deal damage through non-shootable walls.
- if( path->search(NULL,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKWALL) )
+ if( path->search(NULL,src,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKWALL) )
skill->attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag|SD_ANIMATION);
break;
case WL_HELLINFERNO:
@@ -4514,7 +4512,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
break;
}
case RA_WUGBITE:
- if( path->search(NULL,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKNOREACH) ) {
+ if( path->search(NULL,src,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKNOREACH) ) {
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
}else if( sd && skill_id == RA_WUGBITE ) // Only RA_WUGBITE has the skill fail message.
clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
@@ -4532,14 +4530,14 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
struct skill_unit *su = BL_CAST(BL_SKILL,bl);
struct skill_unit_group* sg;
- if( su && (sg=su->group) && skill->get_inf2(sg->skill_id)&INF2_TRAP ) {
+ if( su && (sg=su->group) != NULL && skill->get_inf2(sg->skill_id)&INF2_TRAP ) {
if( !(sg->unit_id == UNT_USED_TRAPS || (sg->unit_id == UNT_ANKLESNARE && sg->val2 != 0 )) ) {
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = sg->item_id?sg->item_id:ITEMID_TRAP;
item_tmp.identify = 1;
if( item_tmp.nameid )
- map->addflooritem(&item_tmp,1,bl->m,bl->x,bl->y,0,0,0,0);
+ map->addflooritem(bl, &item_tmp, 1, bl->m, bl->x, bl->y, 0, 0, 0, 0);
}
skill->delunit(su);
}
@@ -4945,7 +4943,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
}
if( ud->skill_id == RA_WUGSTRIKE ){
- if( !path->search(NULL,src->m,src->x,src->y,target->x,target->y,1,CELL_CHKNOREACH))
+ if( !path->search(NULL,src,src->m,src->x,src->y,target->x,target->y,1,CELL_CHKNOREACH))
break;
}
@@ -4999,7 +4997,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
}
if( inf&BCT_ENEMY
- && (sc = status->get_sc(target)) && sc->data[SC_FOGWALL]
+ && (sc = status->get_sc(target)) != NULL && sc->data[SC_FOGWALL]
&& rnd() % 100 < 75
) {
// Fogwall makes all offensive-type targeted skills fail at 75%
@@ -5037,7 +5035,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
skill->consume_requirement(sd,ud->skill_id,ud->skill_lv,1);
}
#ifdef OFFICIAL_WALKPATH
- if( !path->search_long(NULL, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL) )
+ if( !path->search_long(NULL, src, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL) )
break;
#endif
if( (src->type == BL_MER || src->type == BL_HOM) && !skill->check_condition_mercenary(src, ud->skill_id, ud->skill_lv, 1) )
@@ -6744,7 +6742,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
eflag = pc->additem(sd,&item_tmp,1,LOG_TYPE_PRODUCE);
if(eflag) {
clif->additem(sd,0,0,eflag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
break;
@@ -6911,7 +6909,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( dstsd )
hp = hp * (100 + pc->checkskill(dstsd,SM_RECOVERY)*10) / 100;
}
- if( dstsd && (i = pc->skillheal2_bonus(dstsd, skill_id)) ) {
+ if (dstsd && (i = pc->skillheal2_bonus(dstsd, skill_id)) != 0) {
hp += hp * i / 100;
sp += sp * i / 100;
}
@@ -7083,7 +7081,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
}
clif->skill_nodamage(src,bl,TK_HIGHJUMP,skill_lv,1);
- if(!map->count_oncell(src->m,x,y,BL_PC|BL_NPC|BL_MOB,0) && map->getcell(src->m,x,y,CELL_CHKREACH)) {
+ if (!map->count_oncell(src->m, x, y, BL_PC | BL_NPC | BL_MOB, 0) && map->getcell(src->m, src, x, y, CELL_CHKREACH)) {
clif->slide(src,x,y);
unit->movepos(src, x, y, 1, 0);
}
@@ -7449,7 +7447,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
// Mercenaries can remove any trap
// Players can only remove their own traps or traps on Vs maps.
- if( su && (sg = su->group) && (src->type == BL_MER || sg->src_id == src->id || map_flag_vs(bl->m)) && (skill->get_inf2(sg->skill_id)&INF2_TRAP) )
+ if( su && (sg = su->group) != NULL && (src->type == BL_MER || sg->src_id == src->id || map_flag_vs(bl->m)) && (skill->get_inf2(sg->skill_id)&INF2_TRAP) )
{
clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
if( sd && !(sg->unit_id == UNT_USED_TRAPS || (sg->unit_id == UNT_ANKLESNARE && sg->val2 != 0 )) && sg->unit_id != UNT_THORNS_TRAP ) {
@@ -7464,9 +7462,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = skill->dbs->db[su->group->skill_id].itemid[i];
item_tmp.identify = 1;
- if( item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) ) {
+ if (item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) != 0) {
clif->additem(sd,0,0,success);
- map->addflooritem(&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, skill->dbs->db[su->group->skill_id].amount[i], sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -7476,9 +7474,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = su->group->item_id?su->group->item_id:ITEMID_TRAP;
item_tmp.identify = 1;
- if( item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) ) {
+ if (item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) != 0) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
}
@@ -7492,7 +7490,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
{
struct skill_unit *su=NULL;
- if((bl->type==BL_SKILL) && (su=(struct skill_unit *)bl) && (su->group) ){
+ if (bl->type==BL_SKILL && (su=(struct skill_unit *)bl) != NULL && su->group != NULL) {
switch(su->group->unit_id){
case UNT_ANKLESNARE:
if (su->group->val2 != 0)
@@ -7673,7 +7671,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case CG_LONGINGFREEDOM:
{
- if (tsc && !tsce && (tsce=tsc->data[SC_DANCING]) && tsce->val4
+ if (tsc && !tsce && (tsce=tsc->data[SC_DANCING]) != NULL && tsce->val4
&& (tsce->val1&0xFFFF) != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex]
{
clif->skill_nodamage(src,bl,skill_id,skill_lv,
@@ -7902,7 +7900,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade && !pc_isdead(dstsd)) {
if (map->list[dstsd->bl.m].flag.nowarp && !map_flag_gvg2(dstsd->bl.m))
continue;
- if(map->getcell(src->m,src->x+dx[j],src->y+dy[j],CELL_CHKNOREACH))
+ if (map->getcell(src->m, src, src->x + dx[j], src->y + dy[j], CELL_CHKNOREACH))
dx[j] = dy[j] = 0;
pc->setpos(dstsd, map_id2index(src->m), src->x+dx[j], src->y+dy[j], CLR_RESPAWN);
}
@@ -9013,8 +9011,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if ( sd ) {
int i, max;
sc_start(src, bl, SC_EXPLOSIONSPIRITS, 100, skill_lv, skill->get_time(skill_id, skill_lv));
- clif->skill_nodamage(src, bl, skill_id, skill_lv,
- sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
+ sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
max = pc->getmaxspiritball(sd, 0);
for ( i = 0; i < max; i++ )
pc->addspiritball(sd, skill->get_time(MO_CALLSPIRITS, skill_lv), max);
@@ -9044,7 +9042,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( !dstsd )
break;
if ( sd && (dstsd->class_&MAPID_BASEMASK) != MAPID_GUNSLINGER ) {
- int i, max = pc->getmaxspiritball(dstsd, 5);
+ int i, max = pc->getmaxspiritball(dstsd, 5);
for ( i = 0; i < max; i++ ) {
pc->addspiritball(dstsd, skill->get_time(MO_CALLSPIRITS, 1), max);
}
@@ -10460,8 +10458,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
tmpx = x - area + rnd()%(area * 2 + 1);
tmpy = y - area + rnd()%(area * 2 + 1);
- if( i == 0 && path->search_long(NULL, src->m, src->x, src->y, tmpx, tmpy, CELL_CHKWALL)
- && !map->getcell(src->m, tmpx, tmpy, CELL_CHKLANDPROTECTOR))
+ if (i == 0 && path->search_long(NULL, src, src->m, src->x, src->y, tmpx, tmpy, CELL_CHKWALL)
+ && !map->getcell(src->m, src, tmpx, tmpy, CELL_CHKLANDPROTECTOR))
clif->skill_poseffect(src,skill_id,skill_lv,tmpx,tmpy,tick);
if( i > 0 )
@@ -11119,7 +11117,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
break;
case WZ_FIREPILLAR:
- if( map->getcell(src->m, x, y, CELL_CHKLANDPROTECTOR) )
+ if (map->getcell(src->m, src, x, y, CELL_CHKLANDPROTECTOR))
return NULL;
if((flag&1)!=0)
limit=1000;
@@ -11128,7 +11126,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
case WZ_QUAGMIRE: //The target changes to "all" if used in a gvg map. [Skotlex]
case AM_DEMONSTRATION:
case GN_HELLS_PLANT:
- if( skill_id == GN_HELLS_PLANT && map->getcell(src->m, x, y, CELL_CHKLANDPROTECTOR) )
+ if (skill_id == GN_HELLS_PLANT && map->getcell(src->m, src, x, y, CELL_CHKLANDPROTECTOR))
return NULL;
if (map_flag_vs(src->m) && battle_config.vs_traps_bctall
&& (src->type&battle_config.vs_traps_bctall))
@@ -11370,7 +11368,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
case SO_FIRE_INSIGNIA:
case SO_WIND_INSIGNIA:
case SO_EARTH_INSIGNIA:
- if( map->getcell(src->m, x, y, CELL_CHKLANDPROTECTOR) )
+ if (map->getcell(src->m, src, x, y, CELL_CHKLANDPROTECTOR))
return NULL;
break;
case SO_CLOUD_KILL:
@@ -11451,9 +11449,9 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
val1 = skill_lv;
val2 = 0;
- if( !group->state.song_dance && !map->getcell(src->m,ux,uy,CELL_CHKREACH) )
+ if (!group->state.song_dance && !map->getcell(src->m, src, ux, uy, CELL_CHKREACH))
continue; // don't place skill units on walls (except for songs/dances/encores)
- if( battle_config.skill_wall_check && skill->get_unit_flag(skill_id)&UF_PATHCHECK && !path->search_long(NULL,src->m,ux,uy,x,y,CELL_CHKWALL) )
+ if( battle_config.skill_wall_check && skill->get_unit_flag(skill_id)&UF_PATHCHECK && !path->search_long(NULL,src,src->m,ux,uy,x,y,CELL_CHKWALL) )
continue; // no path between cell and center of casting.
switch( skill_id ) {
@@ -11463,7 +11461,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
break;
case WZ_ICEWALL:
val1 = (skill_lv <= 1) ? 500 : 200 + 200*skill_lv;
- val2 = map->getcell(src->m, ux, uy, CELL_GETTYPE);
+ val2 = map->getcell(src->m, src, ux, uy, CELL_GETTYPE);
break;
case HT_LANDMINE:
case MA_LANDMINE:
@@ -11575,14 +11573,14 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
nullpo_ret(sg=src->group);
nullpo_ret(ss=map->id2bl(sg->src_id));
- if( skill->get_type(sg->skill_id) == BF_MAGIC && map->getcell(src->bl.m, src->bl.x, src->bl.y, CELL_CHKLANDPROTECTOR) && sg->skill_id != SA_LANDPROTECTOR )
+ if (skill->get_type(sg->skill_id) == BF_MAGIC && map->getcell(src->bl.m, &src->bl, src->bl.x, src->bl.y, CELL_CHKLANDPROTECTOR) && sg->skill_id != SA_LANDPROTECTOR)
return 0; //AoE skills are ineffective. [Skotlex]
sc = status->get_sc(bl);
if (sc && sc->option&OPTION_HIDE && sg->skill_id != WZ_HEAVENDRIVE && sg->skill_id != WL_EARTHSTRAIN )
return 0; //Hidden characters are immune to AoE skills except to these. [Skotlex]
- if (sc && sc->data[SC_VACUUM_EXTREME] && map->getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR))
+ if (sc && sc->data[SC_VACUUM_EXTREME] && map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKLANDPROTECTOR))
status_change_end(bl, SC_VACUUM_EXTREME, INVALID_TIMER);
if ( sc && sc->data[SC_HOVERING] && ( sg->skill_id == SO_VACUUM_EXTREME || sg->skill_id == SO_ELECTRICWALK || sg->skill_id == SO_FIREWALK || sg->skill_id == WZ_QUAGMIRE ) )
@@ -12057,7 +12055,6 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id,sg->skill_lv),SCFLAG_NONE);
break;
-
case UNT_MAGENTATRAP:
case UNT_COBALTTRAP:
case UNT_MAIZETRAP:
@@ -13379,7 +13376,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
for (i=0;i<size*size;i++) {
int x = sd->bl.x+(i%size-range);
int y = sd->bl.y+(i/size-range);
- if (map->getcell(sd->bl.m,x,y,CELL_CHKWALL)) {
+ if (map->getcell(sd->bl.m, &sd->bl, x, y, CELL_CHKWALL)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -13831,7 +13828,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case ST_WATER:
if (sc && (sc->data[SC_DELUGE] || sc->data[SC_NJ_SUITON]))
break;
- if (map->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKWATER))
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKWATER))
break;
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
@@ -13953,7 +13950,6 @@ int skill_check_condition_castbegin_unknown(struct status_change *sc, uint16 *sk
return -1;
}
-
int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) {
struct skill_condition require;
struct status_data *st;
@@ -15313,7 +15309,6 @@ int skill_sit (struct map_session_data *sd, int type)
int range = 0, lv;
nullpo_ret(sd);
-
if((lv = pc->checkskill(sd,RG_GANGSTER)) > 0) {
flag|=1;
range = skill->get_splash(RG_GANGSTER, lv);
@@ -15409,7 +15404,6 @@ int skill_attack_area(struct block_list *bl, va_list ap) {
flag = va_arg(ap,int);
type = va_arg(ap,int);
-
if (skill->area_temp[1] == bl->id) //This is the target of the skill, do a full attack and skip target checks.
return skill->attack(atk_type,src,dsrc,bl,skill_id,skill_lv,tick,flag);
@@ -15417,7 +15411,6 @@ int skill_attack_area(struct block_list *bl, va_list ap) {
|| !status->check_skilluse(NULL, bl, skill_id, 2))
return 0;
-
switch (skill_id) {
case WZ_FROSTNOVA: //Skills that don't require the animation to be removed
case NPC_ACIDBREATH:
@@ -15823,7 +15816,7 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce
) {
//Check for walls.
int i;
- ARR_FIND( 0, 8, i, map->getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
+ ARR_FIND( 0, 8, i, map->getcell(bl->m, bl, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
if( i == 8 )
wall = false;
}
@@ -15884,7 +15877,7 @@ bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *s
if( bl->type == BL_PC ) { //Check for walls.
int i;
- ARR_FIND( 0, 8, i, map->getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
+ ARR_FIND( 0, 8, i, map->getcell(bl->m, bl, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
if( i == 8 )
wall = false;
}
@@ -16355,7 +16348,7 @@ int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap) {
nullpo_ret(group);
- if( !(skill->get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP|INF2_NOLP)) && map->getcell(su->bl.m, su->bl.x, su->bl.y, CELL_CHKLANDPROTECTOR) )
+ if (!(skill->get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP|INF2_NOLP)) && map->getcell(su->bl.m, &su->bl, su->bl.x, su->bl.y, CELL_CHKLANDPROTECTOR))
return 0; //AoE skills are ineffective. [Skotlex]
if( battle->check_target(&su->bl,bl,group->target_flag) <= 0 )
@@ -16433,7 +16426,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = group->item_id?group->item_id:ITEMID_TRAP;
item_tmp.identify = 1;
- map->addflooritem(&item_tmp,1,bl->m,bl->x,bl->y,0,0,0,0);
+ map->addflooritem(bl, &item_tmp, 1, bl->m, bl->x, bl->y, 0, 0, 0, 0);
}
skill->delunit(su);
}
@@ -17232,7 +17225,6 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
if(make_per < 1) make_per = 1;
-
if(rnd()%10000 < make_per || qty > 1){ //Success, or crafting multiple items.
struct item tmp_item;
memset(&tmp_item,0,sizeof(tmp_item));
@@ -17375,7 +17367,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
tmp_item.amount = qty * skill->dbs->changematerial_db[i].qty[j];
if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
k++;
}
@@ -17389,7 +17381,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
} else if (tmp_item.amount) { //Success
if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
if( skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id == GN_S_PHARMACY )
clif->msgtable_skill(sd, skill_id, MSG_SKILL_SUCCESS);
@@ -17449,7 +17441,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
tmp_item.identify = 1;
if( pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
clif->msgtable_skill(sd, skill_id, MSG_SKILL_FAILURE);
}
@@ -17506,7 +17498,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
continue;
if((flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
@@ -17566,7 +17558,6 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
}
}
-
int skill_magicdecoy(struct map_session_data *sd, int nameid) {
int x, y, i, class_, skill_id;
struct mob_data *md;
@@ -17590,7 +17581,6 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
class_ = (nameid == ITEMID_BOODY_RED || nameid == ITEMID_CRYSTAL_BLUE) ? 2043 + nameid - ITEMID_BOODY_RED : (nameid == ITEMID_WIND_OF_VERDURE) ? 2046 : 2045;
-
md = mob->once_spawn_sub(&sd->bl, sd->bl.m, x, y, sd->status.name, class_, "", SZ_SMALL, AI_NONE);
if( md ) {
md->master_id = sd->bl.id;
@@ -17729,7 +17719,6 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
return 1;
}
-
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = product;
tmp_item.amount = add_amount;
@@ -17739,7 +17728,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
int flag = pc->additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME);
if (flag) {
clif->additem(sd,0,0,flag);
- map->addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+ map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
}
@@ -17805,7 +17794,7 @@ int skill_destroy_trap(struct block_list *bl, va_list ap) {
nullpo_ret(su);
tick = va_arg(ap, int64);
- if (su->alive && (sg = su->group) && skill->get_inf2(sg->skill_id)&INF2_TRAP) {
+ if (su->alive && (sg = su->group) != NULL && skill->get_inf2(sg->skill_id)&INF2_TRAP) {
switch( sg->unit_id ) {
case UNT_CLAYMORETRAP:
case UNT_FIRINGTRAP:
@@ -17978,7 +17967,6 @@ int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { /
uint16 idx = skill->get_index(skill_id);
nullpo_retr (-1, hd);
-
if (idx == 0)
return -1;
@@ -18913,7 +18901,6 @@ bool skill_parse_row_reproducedb(char* split[], int column, int current) {
return true;
}
-
bool skill_parse_row_abradb(char* split[], int columns, int current) {
// skill_id,DummyName,RequiredHocusPocusLevel,Rate
uint16 skill_id = atoi(split[0]);
diff --git a/src/map/status.c b/src/map/status.c
index 4f1813af6..25c7e13dc 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1080,7 +1080,6 @@ void initDummyData(void)
status->dummy.mode = MD_CANMOVE;
}
-
//For copying a status_data structure from b to a, without overwriting current Hp and Sp
static inline void status_cpy(struct status_data* a, const struct status_data* b)
{
@@ -1193,7 +1192,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
struct status_change_entry *sce;
#ifdef DEVOTION_REFLECT_DAMAGE
- if(src && (sce = sc->data[SC_DEVOTION])) {
+ if (src && (sce = sc->data[SC_DEVOTION]) != NULL) {
struct block_list *d_bl = map->id2bl(sce->val1);
if(d_bl &&((d_bl->type == BL_MER && ((TBL_MER *)d_bl)->master && ((TBL_MER *)d_bl)->master->bl.id == target->id)
@@ -1589,7 +1588,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
//on dead characters, said checks are left to skill.c [Skotlex]
if (target && status->isdead(target))
return 0;
- if( src && (sc = status->get_sc(src)) && sc->data[SC_COLD] && src->type != BL_MOB)
+ if( src && (sc = status->get_sc(src)) != NULL && sc->data[SC_COLD] && src->type != BL_MOB)
return 0;
}
@@ -1631,7 +1630,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
break;
case AL_TELEPORT:
//Should fail when used on top of Land Protector [Skotlex]
- if (src && map->getcell(src->m, src->x, src->y, CELL_CHKLANDPROTECTOR)
+ if (src && map->getcell(src->m, src, src->x, src->y, CELL_CHKLANDPROTECTOR)
&& !(st->mode&MD_BOSS)
&& (src->type != BL_PC || ((TBL_PC*)src)->skillitem != skill_id))
return 0;
@@ -1876,8 +1875,8 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (md->special_state.size)
flag|=2;
- if( md->guardian_data && md->guardian_data->g
- && (guardup_lv = guild->checkskill(md->guardian_data->g,GD_GUARDUP)) )
+ if (md->guardian_data && md->guardian_data->g
+ && (guardup_lv = guild->checkskill(md->guardian_data->g,GD_GUARDUP)) > 0)
flag|=4;
if (battle_config.slaves_inherit_speed && md->master_id)
@@ -1953,7 +1952,6 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
mstatus->speed -= cap_value(diff, 0, mstatus->speed - 10);
}
-
if (flag&2 && battle_config.mob_size_influence) {
// change for sized monsters [Valaris]
if (md->special_state.size==SZ_MEDIUM) {
@@ -2456,7 +2454,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
if( data && data->script )
script->run_use_script(sd, data, 0);
}
-
+
status->calc_pc_additional(sd, opt);
if( sd->pd ) { // Pet Bonus
@@ -2603,7 +2601,6 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
if( (skill_lv = pc->checkskill(sd,WM_LESSON)) > 0 )
bstatus->max_sp += 30 * skill_lv;
-
// Apply relative modifiers from equipment
if(sd->sprate < 0)
sd->sprate = 0;
@@ -2705,7 +2702,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
if( (sd->status.weapon == W_1HAXE || sd->status.weapon == W_2HAXE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0 )
bstatus->hit += 3*skill_lv;
- if((sd->status.weapon == W_MACE || sd->status.weapon == W_2HMACE) && ((skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0))
+ if((sd->status.weapon == W_MACE || sd->status.weapon == W_2HMACE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0)
bstatus->hit += 2*skill_lv;
// ----- FLEE CALCULATION -----
@@ -2782,7 +2779,6 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
#endif
bstatus->adelay = 2*bstatus->amotion;
-
// ----- DMOTION -----
//
i = 800-bstatus->agi*4;
@@ -3540,12 +3536,6 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
st->cri = status->calc_critical(bl, sc, bst->cri, true);
else
st->cri = status->calc_critical(bl, sc, bst->cri + 3*(st->luk - bst->luk), true);
- /**
- * after status_calc_critical so the bonus is applied despite if you have or not a sc bugreport:5240
- **/
- if( bl->type == BL_PC && ((TBL_PC*)bl)->status.weapon == W_KATAR )
- st->cri <<= 1;
-
}
if(flag&SCB_FLEE2 && bst->flee2) {
@@ -5087,7 +5077,6 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
#endif
}
-
defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool viewable) {
if(!sc || !sc->count)
@@ -5801,7 +5790,6 @@ unsigned char status_calc_element_lv(struct block_list *bl, struct status_change
return (unsigned char)cap_value(lv,1,4);
}
-
unsigned char status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element)
{
if(!sc || !sc->count)
@@ -7553,11 +7541,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if( sd ) {
int i;
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
}
- } else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
+ } else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
+ }
}
//val4 signals infinite endure (if val4 == 2 it is infinite endure from Berserk)
if( val4 )
@@ -7652,11 +7641,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if( sd ) {
int i;
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
- } else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
+ } else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ }
}
break;
case SC_NOEQUIPWEAPON:
@@ -7910,12 +7900,13 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if( bl->type&(BL_PC|BL_MER) ) {
if( sd ) {
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
}
}
- else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
+ else if (bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) != NULL) {
status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ }
}
}
break;
@@ -7931,7 +7922,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
int i;
for (i = 0; i < MAX_PC_DEVOTION; i++) {
//See if there are devoted characters, and pass the status to them. [Skotlex]
- if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])))
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
status->change_start(bl, &tsd->bl,type,10000,val1,5+val1*5,val3,val4,tick,SCFLAG_NOAVOID);
}
}
@@ -8068,7 +8059,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
struct block_list *d_bl;
struct status_change *d_sc;
- if ((d_bl = map->id2bl(val1)) && (d_sc = status->get_sc(d_bl)) && d_sc->count) {
+ if ((d_bl = map->id2bl(val1)) && (d_sc = status->get_sc(d_bl)) != NULL && d_sc->count) {
// Inherits Status From Source
const enum sc_type types[] = { SC_AUTOGUARD, SC_DEFENDER, SC_REFLECTSHIELD, SC_ENDURE };
int i = (map_flag_gvg(bl->m) || map->list[bl->m].flag.battleground)?2:3;
@@ -8970,6 +8961,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
{
int hp = status_get_hp(bl), sp = status_get_sp(bl), lv = 5;
+ if (sp < 1) sp = 1;
+ if (hp < 1) hp = 1;
+
if( rnd()%100 > (25 + 10 * val1) - status_get_int(bl) / 2)
return 0;
@@ -9531,12 +9525,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
++(sc->count);
sce = sc->data[type] = ers_alloc(status->data_ers, struct status_change_entry);
}
-
+
sce->val1 = val1;
sce->val2 = val2;
sce->val3 = val3;
sce->val4 = val4;
-
+
if (tick >= 0) {
sce->timer = timer->add(timer->gettick() + tick, status->change_timer, bl->id, type);
sce->infinite_duration = false;
@@ -9727,7 +9721,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
return 0;
st = status->get_status_data(bl);
-
+
if( sd && sce->infinite_duration && !sd->state.loggingout )
chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type);
@@ -9823,7 +9817,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
// Clear Status from others
int i;
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) && tsd->sc.data[type] )
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL && tsd->sc.data[type])
status_change_end(&tsd->bl, type, INVALID_TIMER);
}
} else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag ) {
@@ -9884,7 +9878,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
sd->delunit_prevline = line;
}
- if (sce->val4 && sce->val4 != BCT_SELF && (dsd=map->id2sd(sce->val4))) {
+ if (sce->val4 && sce->val4 != BCT_SELF && (dsd=map->id2sd(sce->val4)) != NULL) {
// end status on partner as well
dsc = dsd->sc.data[SC_DANCING];
if (dsc) {
@@ -9909,7 +9903,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
sce->val2 = 0;
-
+
if( group )
skill->del_unitgroup(group,ALC_MARK);
}
@@ -10073,7 +10067,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
struct block_list *tbl = map->id2bl(sce->val2);
struct status_change *tsc = NULL;
sce->val2 = 0;
- if( tbl && (tsc = status->get_sc(tbl)) && tsc->data[SC_STOP] && tsc->data[SC_STOP]->val2 == bl->id )
+ if (tbl && (tsc = status->get_sc(tbl)) != NULL && tsc->data[SC_STOP] && tsc->data[SC_STOP]->val2 == bl->id)
status_change_end(tbl, SC_STOP, INVALID_TIMER);
}
break;
@@ -10438,7 +10432,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
skill->unit_move(bl,timer->gettick(),1);
if (opt_flag & 2 && sd) {
- if (map->getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
+ if (map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKNPC))
npc->touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
else
npc->untouch_areanpc(sd, bl->m, bl->x, bl->y);
@@ -10455,10 +10449,7 @@ int kaahi_heal_timer(int tid, int64 tick, int id, intptr_t data) {
struct status_data *st;
int hp;
- if(!( (bl=map->id2bl(id))
- && (sc=status->get_sc(bl))
- && (sce=sc->data[SC_KAAHI])
- ))
+ if ((bl=map->id2bl(id)) == NULL || (sc=status->get_sc(bl)) == NULL || (sce=sc->data[SC_KAAHI]) == NULL)
return 0;
if(sce->val4 != tid) {
@@ -10502,7 +10493,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
sc = status->get_sc(bl);
st = status->get_status_data(bl);
- if (!(sc && (sce = sc->data[type]))) {
+ if (!sc || (sce = sc->data[type]) == NULL) {
ShowDebug("status_change_timer: Null pointer id: %d data: %"PRIdPTR" bl-type: %d\n", id, data, bl->type);
return 0;
}
@@ -10511,7 +10502,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
ShowError("status_change_timer: Mismatch for type %d: %d != %d (bl id %d)\n",type,tid,sce->timer, bl->id);
return 0;
}
-
+
sce->timer = INVALID_TIMER;
sd = BL_CAST(BL_PC, bl);
@@ -10949,15 +10940,14 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
int heal = st->max_hp * 3 / 100;
if (sc->count && sc->data[SC_AKAITSUKI] && heal)
heal = ~heal + 1;
-
+
map->freeblock_lock();
-
status->heal(bl, heal, 0, 2);
if( sc->data[type] ) {
sc_timer_next(5000 + tick, status->change_timer, bl->id, data);
}
map->freeblock_unlock();
-
+
return 0;
}
break;
@@ -11116,7 +11106,6 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
}
break;
-
case SC_SATURDAY_NIGHT_FEVER:
if( --(sce->val3) >= 0 ) {
if( !status->charge(bl, st->max_hp * 1 / 100, st->max_sp * 1 / 100) )
@@ -11657,7 +11646,7 @@ int status_change_clear_buffs (struct block_list* bl, int type) {
return 0;
map->freeblock_lock();
-
+
if (type&6) //Debuffs
for (i = SC_COMMON_MIN; i <= SC_COMMON_MAX; i++)
status_change_end(bl, (sc_type)i, INVALID_TIMER);
@@ -11704,9 +11693,9 @@ int status_change_clear_buffs (struct block_list* bl, int type) {
}
status_change_end(bl, (sc_type)i, INVALID_TIMER);
}
-
+
map->freeblock_unlock();
-
+
return 0;
}
@@ -11839,7 +11828,7 @@ int status_natural_heal(struct block_list* bl, va_list args) {
if (flag&(RGN_SHP|RGN_SSP)
&& regen->ssregen
- && (vd = status->get_viewdata(bl))
+ && (vd = status->get_viewdata(bl)) != NULL
&& vd->dead_sit == 2
) {
//Apply sitting regen bonus.
@@ -12172,7 +12161,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
if ((temp = libconfig->setting_get_member(jdb, "HPTable"))) {
int level = 0, avg_increment, base;
config_setting_t *hp = NULL;
- while (level <= MAX_LEVEL && (hp = libconfig->setting_get_elem(temp, level))) {
+ while (level <= MAX_LEVEL && (hp = libconfig->setting_get_elem(temp, level)) != NULL) {
i32 = libconfig->setting_get_int(hp);
status->dbs->HP_table[idx][++level] = min(i32, battle_config.max_hp);
}
@@ -12192,7 +12181,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
if ((temp = libconfig->setting_get_member(jdb, "SPTable"))) {
int level = 0, avg_increment, base;
config_setting_t *sp = NULL;
- while (level <= MAX_LEVEL && (sp = libconfig->setting_get_elem(temp, level))) {
+ while (level <= MAX_LEVEL && (sp = libconfig->setting_get_elem(temp, level)) != NULL) {
i32 = libconfig->setting_get_int(sp);
status->dbs->SP_table[idx][++level] = min(i32, battle_config.max_sp);
}
@@ -12221,11 +12210,10 @@ void status_read_job_db(void) { /* [malufett/Hercules] */
int i = 0;
config_t job_db_conf;
config_setting_t *jdb = NULL;
- const char *config_filename =
#ifdef RENEWAL_ASPD
- "db/re/job_db.conf";
+ const char *config_filename = "db/re/job_db.conf";
#else
- "db/pre-re/job_db.conf";
+ const char *config_filename = "db/pre-re/job_db.conf";
#endif
if ( libconfig->read_file(&job_db_conf, config_filename) ) {
diff --git a/src/map/unit.c b/src/map/unit.c
index 33360584a..04a8befc2 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -98,11 +98,11 @@ int unit_walktoxy_sub(struct block_list *bl)
memset(&wpd, 0, sizeof(wpd));
- if( !path->search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) )
+ if( !path->search(&wpd,bl,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) )
return 0;
#ifdef OFFICIAL_WALKPATH
- if( !path->search_long(NULL, bl->m, bl->x, bl->y, ud->to_x, ud->to_y, CELL_CHKNOPASS) // Check if there is an obstacle between
+ if( !path->search_long(NULL, bl, bl->m, bl->x, bl->y, ud->to_x, ud->to_y, CELL_CHKNOPASS) // Check if there is an obstacle between
&& wpd.path_len > 14 // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett]
&& (bl->type != BL_NPC) ) // If type is a NPC, please disregard.
return 0;
@@ -268,13 +268,13 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
icewall_walk_block = 0;
//Monsters will walk into an icewall from the west and south if they already started walking
- if(map->getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS)
- && (icewall_walk_block == 0 || !map->getcell(bl->m,x+dx,y+dy,CELL_CHKICEWALL) || dx < 0 || dy < 0))
+ if (map->getcell(bl->m, bl, x + dx, y + dy, CELL_CHKNOPASS)
+ && (icewall_walk_block == 0 || !map->getcell(bl->m, bl, x + dx, y + dy, CELL_CHKICEWALL) || dx < 0 || dy < 0))
return unit->walktoxy_sub(bl);
//Monsters can only leave icewalls to the west and south
//But if movement fails more than icewall_walk_block times, they can ignore this rule
- if(md && md->walktoxy_fail_count < icewall_walk_block && map->getcell(bl->m,x,y,CELL_CHKICEWALL) && (dx > 0 || dy > 0)) {
+ if (md && md->walktoxy_fail_count < icewall_walk_block && map->getcell(bl->m, bl, x, y, CELL_CHKICEWALL) && (dx > 0 || dy > 0)) {
//Needs to be done here so that rudeattack skills are invoked
md->walktoxy_fail_count++;
clif->fixpos(bl);
@@ -306,7 +306,7 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
if(sd) {
if( sd->touching_id )
npc->touchnext_areanpc(sd,false);
- if(map->getcell(bl->m,x,y,CELL_CHKNPC)) {
+ if (map->getcell(bl->m, bl, x, y, CELL_CHKNPC)) {
npc->touch_areanpc(sd,bl->m,x,y);
if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
return 0;
@@ -338,7 +338,7 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
} else if (md) {
//Movement was successful, reset walktoxy_fail_count
md->walktoxy_fail_count = 0;
- if( map->getcell(bl->m,x,y,CELL_CHKNPC) ) {
+ if (map->getcell(bl->m, bl, x, y, CELL_CHKNPC)) {
if( npc->touch_areanpc2(md) ) return 0; // Warped
} else
md->areanpc_id = 0;
@@ -494,14 +494,14 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
if( ud == NULL) return 0;
- if (battle_config.check_occupied_cells && (flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y
+ if (battle_config.check_occupied_cells && (flag&8) && !map->closest_freecell(bl->m, bl, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y
return 0;
- if (!path->search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells
+ if (!path->search(&wpd, bl, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells
return 0;
#ifdef OFFICIAL_WALKPATH
- if( !path->search_long(NULL, bl->m, bl->x, bl->y, x, y, CELL_CHKNOPASS) // Check if there is an obstacle between
+ if( !path->search_long(NULL, bl, bl->m, bl->x, bl->y, x, y, CELL_CHKNOPASS) // Check if there is an obstacle between
&& (wpd.path_len > (battle_config.max_walk_path/17)*14) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett]
&& (bl->type != BL_NPC) ) // If type is a NPC, please disregard.
return 0;
@@ -683,7 +683,7 @@ bool unit_run( struct block_list *bl, struct map_session_data *sd, enum sc_type
// Search for available path
for(i = 0; i < AREA_SIZE; i++) {
- if(!map->getcell(bl->m,to_x+dir_x,to_y+dir_y,CELL_CHKPASS))
+ if (!map->getcell(bl->m, bl, to_x + dir_x, to_y + dir_y, CELL_CHKPASS))
break;
//if sprinting and there's a PC/Mob/NPC, block the path [Kevin]
@@ -720,7 +720,7 @@ bool unit_run( struct block_list *bl, struct map_session_data *sd, enum sc_type
//Makes bl attempt to run dist cells away from target. Uses hard-paths.
int unit_escape(struct block_list *bl, struct block_list *target, short dist) {
uint8 dir = map->calc_dir(target, bl->x, bl->y);
- while( dist > 0 && map->getcell(bl->m, bl->x + dist*dirx[dir], bl->y + dist*diry[dir], CELL_CHKNOREACH) )
+ while (dist > 0 && map->getcell(bl->m, bl, bl->x + dist * dirx[dir], bl->y + dist * diry[dir], CELL_CHKNOREACH))
dist--;
return ( dist > 0 && unit->walktoxy(bl, bl->x + dist*dirx[dir], bl->y + dist*diry[dir], 0) );
}
@@ -741,7 +741,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
unit->stop_walking(bl, STOPWALKING_FLAG_FIXPOS);
unit->stop_attack(bl);
- if( checkpath && (map->getcell(bl->m,dst_x,dst_y,CELL_CHKNOPASS) || !path->search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,easy,CELL_CHKNOREACH)) )
+ if (checkpath && (map->getcell(bl->m, bl, dst_x, dst_y, CELL_CHKNOPASS) || !path->search(NULL, bl, bl->m, bl->x, bl->y, dst_x, dst_y, easy, CELL_CHKNOREACH)) )
return 0; // unreachable
ud->to_x = dst_x;
@@ -764,7 +764,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
if(sd) {
if( sd->touching_id )
npc->touchnext_areanpc(sd,false);
- if(map->getcell(bl->m,bl->x,bl->y,CELL_CHKNPC)) {
+ if (map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKNPC)) {
npc->touch_areanpc(sd,bl->m,bl->x,bl->y);
if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
return 0;
@@ -775,7 +775,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
{ // Check if pet needs to be teleported. [Skotlex]
int flag = 0;
struct block_list* pbl = &sd->pd->bl;
- if( !checkpath && !path->search(NULL,pbl->m,pbl->x,pbl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
+ if( !checkpath && !path->search(NULL,pbl,pbl->m,pbl->x,pbl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
flag = 1;
else if (!check_distance_bl(&sd->bl, pbl, AREA_SIZE)) //Too far, teleport.
flag = 2;
@@ -829,7 +829,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
sd = BL_CAST(BL_PC, bl);
su = BL_CAST(BL_SKILL, bl);
- result = path->blownpos(bl->m, bl->x, bl->y, dx, dy, count);
+ result = path->blownpos(bl, bl->m, bl->x, bl->y, dx, dy, count);
nx = result>>16;
ny = result&0xffff;
@@ -866,7 +866,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
if(sd->touching_id) {
npc->touchnext_areanpc(sd, false);
}
- if(map->getcell(bl->m, bl->x, bl->y, CELL_CHKNPC)) {
+ if (map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKNPC)) {
npc->touch_areanpc(sd, bl->m, bl->x, bl->y);
} else {
npc->untouch_areanpc(sd, bl->m, bl->x, bl->y);;
@@ -919,7 +919,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
return 2;
}
- } else if (map->getcell(m,x,y,CELL_CHKNOREACH)) {
+ } else if (map->getcell(m, bl, x, y, CELL_CHKNOREACH)) {
//Invalid target cell
ShowWarning("unit_warp: Specified non-walkable target cell: %d (%s) at [%d,%d]\n", m, map->list[m].name, x,y);
@@ -1104,8 +1104,8 @@ int unit_can_move(struct block_list *bl) {
// Icewall walk block special trapped monster mode
if(bl->type == BL_MOB) {
struct mob_data *md = BL_CAST(BL_MOB, bl);
- if(md && ((md->status.mode&MD_BOSS && battle_config.boss_icewall_walk_block == 1 && map->getcell(bl->m,bl->x,bl->y,CELL_CHKICEWALL))
- || (!(md->status.mode&MD_BOSS) && battle_config.mob_icewall_walk_block == 1 && map->getcell(bl->m,bl->x,bl->y,CELL_CHKICEWALL)))) {
+ if (md && ((md->status.mode&MD_BOSS && battle_config.boss_icewall_walk_block == 1 && map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKICEWALL))
+ || (!(md->status.mode&MD_BOSS) && battle_config.mob_icewall_walk_block == 1 && map->getcell(bl->m, bl, bl->x, bl->y, CELL_CHKICEWALL)))) {
md->walktoxy_fail_count = 1; //Make sure rudeattacked skills are invoked
return 0;
}
@@ -1651,14 +1651,14 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
* "WHY IS IT HEREE": ice wall cannot be canceled past this point, the client displays the animation even,
* if we cancel it from castend_pos, so it has to be here for it to not display the animation.
**/
- if ( skill_id == WZ_ICEWALL && map->getcell(src->m, skill_x, skill_y, CELL_CHKNOICEWALL) )
+ if (skill_id == WZ_ICEWALL && map->getcell(src->m, src, skill_x, skill_y, CELL_CHKNOICEWALL))
return 0;
}
if (!status->check_skilluse(src, NULL, skill_id, 0))
return 0;
- if( map->getcell(src->m, skill_x, skill_y, CELL_CHKWALL) ) {
+ if (map->getcell(src->m, src, skill_x, skill_y, CELL_CHKWALL)) {
// can't cast ground targeted spells on wall cells
if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
@@ -1765,10 +1765,10 @@ int unit_set_target(struct unit_data* ud, int target_id)
if (ud->target != target_id) {
struct unit_data * ux;
struct block_list* target;
- if( ud->target && (target = map->id2bl(ud->target)) && (ux = unit->bl2ud(target)) && ux->target_count > 0 )
- ux->target_count --;
- if( target_id && (target = map->id2bl(target_id)) && (ux = unit->bl2ud(target)) )
- ux->target_count ++;
+ if (ud->target && (target = map->id2bl(ud->target)) != NULL && (ux = unit->bl2ud(target)) != NULL && ux->target_count > 0)
+ --ux->target_count;
+ if (target_id && (target = map->id2bl(target_id)) != NULL && (ux = unit->bl2ud(target)) != NULL)
+ ++ux->target_count;
}
ud->target = target_id;
@@ -1940,7 +1940,7 @@ bool unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
if (bl->x == x && bl->y == y) //Same place
return true;
- return path->search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
+ return path->search(NULL,bl,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
}
/*==========================================
@@ -1967,10 +1967,10 @@ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range,
dx=(dx>0)?1:((dx<0)?-1:0);
dy=(dy>0)?1:((dy<0)?-1:0);
- if (map->getcell(tbl->m,tbl->x-dx,tbl->y-dy,CELL_CHKNOPASS)) {
+ if (map->getcell(tbl->m, bl, tbl->x - dx, tbl->y - dy, CELL_CHKNOPASS)) {
int i;
//Look for a suitable cell to place in.
- for(i=0;i<8 && map->getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CELL_CHKNOPASS);i++);
+ for (i=0;i<8 && map->getcell(tbl->m, bl, tbl->x - dirx[i], tbl->y - diry[i], CELL_CHKNOPASS); i++);
if (i==8) return false; //No valid cells.
dx = dirx[i];
dy = diry[i];
@@ -1978,7 +1978,7 @@ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range,
if (x) *x = tbl->x-dx;
if (y) *y = tbl->y-dy;
- return path->search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
+ return path->search(NULL,bl,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
}
/*==========================================
* Calculates position of Pet/Mercenary/Homunculus/Elemental
@@ -2064,7 +2064,7 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
if( status->isdead(src) || status->isdead(target)
|| battle->check_target(src,target,BCT_ENEMY) <= 0 || !status->check_skilluse(src, target, 0, 0)
#ifdef OFFICIAL_WALKPATH
- || !path->search_long(NULL, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL)
+ || !path->search_long(NULL, src, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL)
#endif
|| (sd && !pc->can_attack(sd, ud->target) )
)
@@ -2099,7 +2099,7 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
range = sstatus->rhw.range;
if( (unit->is_walking(target) || ud->state.step_attack)
- && (target->type == BL_PC || !map->getcell(target->m,target->x,target->y,CELL_CHKICEWALL)) )
+ && (target->type == BL_PC || !map->getcell(target->m, src, target->x, target->y, CELL_CHKICEWALL)))
range++; // Extra range when chasing (does not apply to mobs locked in an icewall)
if(sd && !check_distance_client_bl(src,target,range)) {
@@ -2268,7 +2268,7 @@ void unit_dataset(struct block_list *bl) {
int unit_counttargeted(struct block_list* bl)
{
struct unit_data* ud;
- if( bl && (ud = unit->bl2ud(bl)) )
+ if (bl && (ud = unit->bl2ud(bl)) != NULL)
return ud->target_count;
return 0;
}
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index 19d7ae2c5..e5483da5b 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.c
@@ -152,11 +152,10 @@ HPExport const char *Hooked (bool *fr) {
return NULL;
}
-
HPExport bool HPM_Plugin_AddHook(enum HPluginHookType type, const char *target, void *hook, unsigned int pID) {
struct HookingPointData *hpd;
- if( hp_db && (hpd = strdb_get(hp_db,target)) ) {
+ if (hp_db && (hpd = strdb_get(hp_db,target)) != NULL) {
struct HPMHookPoint **hp = NULL;
int *count = NULL;
@@ -230,4 +229,3 @@ void HPM_HP_load(void) {
#include HPM_SOURCES_INCLUDE
}
-
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index bf1aee21b..f36d91718 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -57,6 +57,10 @@ struct {
struct HPMHookPoint *HP_atcommand_cleanfloor_sub_post;
struct HPMHookPoint *HP_atcommand_mutearea_sub_pre;
struct HPMHookPoint *HP_atcommand_mutearea_sub_post;
+ struct HPMHookPoint *HP_atcommand_getring_pre;
+ struct HPMHookPoint *HP_atcommand_getring_post;
+ struct HPMHookPoint *HP_atcommand_channel_help_pre;
+ struct HPMHookPoint *HP_atcommand_channel_help_post;
struct HPMHookPoint *HP_atcommand_commands_sub_pre;
struct HPMHookPoint *HP_atcommand_commands_sub_post;
struct HPMHookPoint *HP_atcommand_cmd_db_clear_pre;
@@ -493,6 +497,8 @@ struct {
struct HPMHookPoint *HP_clif_send_actual_post;
struct HPMHookPoint *HP_clif_parse_pre;
struct HPMHookPoint *HP_clif_parse_post;
+ struct HPMHookPoint *HP_clif_packet_pre;
+ struct HPMHookPoint *HP_clif_packet_post;
struct HPMHookPoint *HP_clif_parse_cmd_pre;
struct HPMHookPoint *HP_clif_parse_cmd_post;
struct HPMHookPoint *HP_clif_decrypt_cmd_pre;
@@ -517,6 +523,10 @@ struct {
struct HPMHookPoint *HP_clif_delitem_post;
struct HPMHookPoint *HP_clif_takeitem_pre;
struct HPMHookPoint *HP_clif_takeitem_post;
+ struct HPMHookPoint *HP_clif_item_equip_pre;
+ struct HPMHookPoint *HP_clif_item_equip_post;
+ struct HPMHookPoint *HP_clif_item_normal_pre;
+ struct HPMHookPoint *HP_clif_item_normal_post;
struct HPMHookPoint *HP_clif_arrowequip_pre;
struct HPMHookPoint *HP_clif_arrowequip_post;
struct HPMHookPoint *HP_clif_arrow_fail_pre;
@@ -4229,6 +4239,8 @@ struct {
struct HPMHookPoint *HP_pc_autotrade_prepare_post;
struct HPMHookPoint *HP_pc_autotrade_populate_pre;
struct HPMHookPoint *HP_pc_autotrade_populate_post;
+ struct HPMHookPoint *HP_pc_autotrade_final_pre;
+ struct HPMHookPoint *HP_pc_autotrade_final_post;
struct HPMHookPoint *HP_pc_check_job_name_pre;
struct HPMHookPoint *HP_pc_check_job_name_post;
struct HPMHookPoint *HP_pet_init_pre;
@@ -4371,6 +4383,22 @@ struct {
struct HPMHookPoint *HP_script_push_val_post;
struct HPMHookPoint *HP_script_get_val_pre;
struct HPMHookPoint *HP_script_get_val_post;
+ struct HPMHookPoint *HP_script_get_val_ref_str_pre;
+ struct HPMHookPoint *HP_script_get_val_ref_str_post;
+ struct HPMHookPoint *HP_script_get_val_scope_str_pre;
+ struct HPMHookPoint *HP_script_get_val_scope_str_post;
+ struct HPMHookPoint *HP_script_get_val_npc_str_pre;
+ struct HPMHookPoint *HP_script_get_val_npc_str_post;
+ struct HPMHookPoint *HP_script_get_val_instance_str_pre;
+ struct HPMHookPoint *HP_script_get_val_instance_str_post;
+ struct HPMHookPoint *HP_script_get_val_ref_num_pre;
+ struct HPMHookPoint *HP_script_get_val_ref_num_post;
+ struct HPMHookPoint *HP_script_get_val_scope_num_pre;
+ struct HPMHookPoint *HP_script_get_val_scope_num_post;
+ struct HPMHookPoint *HP_script_get_val_npc_num_pre;
+ struct HPMHookPoint *HP_script_get_val_npc_num_post;
+ struct HPMHookPoint *HP_script_get_val_instance_num_pre;
+ struct HPMHookPoint *HP_script_get_val_instance_num_post;
struct HPMHookPoint *HP_script_get_val2_pre;
struct HPMHookPoint *HP_script_get_val2_post;
struct HPMHookPoint *HP_script_push_str_pre;
@@ -4501,6 +4529,22 @@ struct {
struct HPMHookPoint *HP_script_errorwarning_sub_post;
struct HPMHookPoint *HP_script_set_reg_pre;
struct HPMHookPoint *HP_script_set_reg_post;
+ struct HPMHookPoint *HP_script_set_reg_ref_str_pre;
+ struct HPMHookPoint *HP_script_set_reg_ref_str_post;
+ struct HPMHookPoint *HP_script_set_reg_scope_str_pre;
+ struct HPMHookPoint *HP_script_set_reg_scope_str_post;
+ struct HPMHookPoint *HP_script_set_reg_npc_str_pre;
+ struct HPMHookPoint *HP_script_set_reg_npc_str_post;
+ struct HPMHookPoint *HP_script_set_reg_instance_str_pre;
+ struct HPMHookPoint *HP_script_set_reg_instance_str_post;
+ struct HPMHookPoint *HP_script_set_reg_ref_num_pre;
+ struct HPMHookPoint *HP_script_set_reg_ref_num_post;
+ struct HPMHookPoint *HP_script_set_reg_scope_num_pre;
+ struct HPMHookPoint *HP_script_set_reg_scope_num_post;
+ struct HPMHookPoint *HP_script_set_reg_npc_num_pre;
+ struct HPMHookPoint *HP_script_set_reg_npc_num_post;
+ struct HPMHookPoint *HP_script_set_reg_instance_num_pre;
+ struct HPMHookPoint *HP_script_set_reg_instance_num_post;
struct HPMHookPoint *HP_script_stack_expand_pre;
struct HPMHookPoint *HP_script_stack_expand_post;
struct HPMHookPoint *HP_script_push_retinfo_pre;
@@ -5772,6 +5816,10 @@ struct {
int HP_atcommand_cleanfloor_sub_post;
int HP_atcommand_mutearea_sub_pre;
int HP_atcommand_mutearea_sub_post;
+ int HP_atcommand_getring_pre;
+ int HP_atcommand_getring_post;
+ int HP_atcommand_channel_help_pre;
+ int HP_atcommand_channel_help_post;
int HP_atcommand_commands_sub_pre;
int HP_atcommand_commands_sub_post;
int HP_atcommand_cmd_db_clear_pre;
@@ -6208,6 +6256,8 @@ struct {
int HP_clif_send_actual_post;
int HP_clif_parse_pre;
int HP_clif_parse_post;
+ int HP_clif_packet_pre;
+ int HP_clif_packet_post;
int HP_clif_parse_cmd_pre;
int HP_clif_parse_cmd_post;
int HP_clif_decrypt_cmd_pre;
@@ -6232,6 +6282,10 @@ struct {
int HP_clif_delitem_post;
int HP_clif_takeitem_pre;
int HP_clif_takeitem_post;
+ int HP_clif_item_equip_pre;
+ int HP_clif_item_equip_post;
+ int HP_clif_item_normal_pre;
+ int HP_clif_item_normal_post;
int HP_clif_arrowequip_pre;
int HP_clif_arrowequip_post;
int HP_clif_arrow_fail_pre;
@@ -9944,6 +9998,8 @@ struct {
int HP_pc_autotrade_prepare_post;
int HP_pc_autotrade_populate_pre;
int HP_pc_autotrade_populate_post;
+ int HP_pc_autotrade_final_pre;
+ int HP_pc_autotrade_final_post;
int HP_pc_check_job_name_pre;
int HP_pc_check_job_name_post;
int HP_pet_init_pre;
@@ -10086,6 +10142,22 @@ struct {
int HP_script_push_val_post;
int HP_script_get_val_pre;
int HP_script_get_val_post;
+ int HP_script_get_val_ref_str_pre;
+ int HP_script_get_val_ref_str_post;
+ int HP_script_get_val_scope_str_pre;
+ int HP_script_get_val_scope_str_post;
+ int HP_script_get_val_npc_str_pre;
+ int HP_script_get_val_npc_str_post;
+ int HP_script_get_val_instance_str_pre;
+ int HP_script_get_val_instance_str_post;
+ int HP_script_get_val_ref_num_pre;
+ int HP_script_get_val_ref_num_post;
+ int HP_script_get_val_scope_num_pre;
+ int HP_script_get_val_scope_num_post;
+ int HP_script_get_val_npc_num_pre;
+ int HP_script_get_val_npc_num_post;
+ int HP_script_get_val_instance_num_pre;
+ int HP_script_get_val_instance_num_post;
int HP_script_get_val2_pre;
int HP_script_get_val2_post;
int HP_script_push_str_pre;
@@ -10216,6 +10288,22 @@ struct {
int HP_script_errorwarning_sub_post;
int HP_script_set_reg_pre;
int HP_script_set_reg_post;
+ int HP_script_set_reg_ref_str_pre;
+ int HP_script_set_reg_ref_str_post;
+ int HP_script_set_reg_scope_str_pre;
+ int HP_script_set_reg_scope_str_post;
+ int HP_script_set_reg_npc_str_pre;
+ int HP_script_set_reg_npc_str_post;
+ int HP_script_set_reg_instance_str_pre;
+ int HP_script_set_reg_instance_str_post;
+ int HP_script_set_reg_ref_num_pre;
+ int HP_script_set_reg_ref_num_post;
+ int HP_script_set_reg_scope_num_pre;
+ int HP_script_set_reg_scope_num_post;
+ int HP_script_set_reg_npc_num_pre;
+ int HP_script_set_reg_npc_num_post;
+ int HP_script_set_reg_instance_num_pre;
+ int HP_script_set_reg_instance_num_post;
int HP_script_stack_expand_pre;
int HP_script_stack_expand_post;
int HP_script_push_retinfo_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index d9d8dc230..dacb51580 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -33,6 +33,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(atcommand->get_jail_time, HP_atcommand_get_jail_time) },
{ HP_POP(atcommand->cleanfloor_sub, HP_atcommand_cleanfloor_sub) },
{ HP_POP(atcommand->mutearea_sub, HP_atcommand_mutearea_sub) },
+ { HP_POP(atcommand->getring, HP_atcommand_getring) },
+ { HP_POP(atcommand->channel_help, HP_atcommand_channel_help) },
{ HP_POP(atcommand->commands_sub, HP_atcommand_commands_sub) },
{ HP_POP(atcommand->cmd_db_clear, HP_atcommand_cmd_db_clear) },
{ HP_POP(atcommand->cmd_db_clear_sub, HP_atcommand_cmd_db_clear_sub) },
@@ -258,6 +260,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->send_sub, HP_clif_send_sub) },
{ HP_POP(clif->send_actual, HP_clif_send_actual) },
{ HP_POP(clif->parse, HP_clif_parse) },
+ { HP_POP(clif->packet, HP_clif_packet) },
{ HP_POP(clif->parse_cmd, HP_clif_parse_cmd) },
{ HP_POP(clif->decrypt_cmd, HP_clif_decrypt_cmd) },
{ HP_POP(clif->authok, HP_clif_authok) },
@@ -270,6 +273,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->dropitem, HP_clif_dropitem) },
{ HP_POP(clif->delitem, HP_clif_delitem) },
{ HP_POP(clif->takeitem, HP_clif_takeitem) },
+ { HP_POP(clif->item_equip, HP_clif_item_equip) },
+ { HP_POP(clif->item_normal, HP_clif_item_normal) },
{ HP_POP(clif->arrowequip, HP_clif_arrowequip) },
{ HP_POP(clif->arrow_fail, HP_clif_arrow_fail) },
{ HP_POP(clif->use_card, HP_clif_use_card) },
@@ -2155,6 +2160,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->autotrade_start, HP_pc_autotrade_start) },
{ HP_POP(pc->autotrade_prepare, HP_pc_autotrade_prepare) },
{ HP_POP(pc->autotrade_populate, HP_pc_autotrade_populate) },
+ { HP_POP(pc->autotrade_final, HP_pc_autotrade_final) },
{ HP_POP(pc->check_job_name, HP_pc_check_job_name) },
/* pet */
{ HP_POP(pet->init, HP_pet_init) },
@@ -2229,6 +2235,14 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->detach_rid, HP_script_detach_rid) },
{ HP_POP(script->push_val, HP_script_push_val) },
{ HP_POP(script->get_val, HP_script_get_val) },
+ { HP_POP(script->get_val_ref_str, HP_script_get_val_ref_str) },
+ { HP_POP(script->get_val_scope_str, HP_script_get_val_scope_str) },
+ { HP_POP(script->get_val_npc_str, HP_script_get_val_npc_str) },
+ { HP_POP(script->get_val_instance_str, HP_script_get_val_instance_str) },
+ { HP_POP(script->get_val_ref_num, HP_script_get_val_ref_num) },
+ { HP_POP(script->get_val_scope_num, HP_script_get_val_scope_num) },
+ { HP_POP(script->get_val_npc_num, HP_script_get_val_npc_num) },
+ { HP_POP(script->get_val_instance_num, HP_script_get_val_instance_num) },
{ HP_POP(script->get_val2, HP_script_get_val2) },
{ HP_POP(script->push_str, HP_script_push_str) },
{ HP_POP(script->push_copy, HP_script_push_copy) },
@@ -2294,6 +2308,14 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->print_line, HP_script_print_line) },
{ HP_POP(script->errorwarning_sub, HP_script_errorwarning_sub) },
{ HP_POP(script->set_reg, HP_script_set_reg) },
+ { HP_POP(script->set_reg_ref_str, HP_script_set_reg_ref_str) },
+ { HP_POP(script->set_reg_scope_str, HP_script_set_reg_scope_str) },
+ { HP_POP(script->set_reg_npc_str, HP_script_set_reg_npc_str) },
+ { HP_POP(script->set_reg_instance_str, HP_script_set_reg_instance_str) },
+ { HP_POP(script->set_reg_ref_num, HP_script_set_reg_ref_num) },
+ { HP_POP(script->set_reg_scope_num, HP_script_set_reg_scope_num) },
+ { HP_POP(script->set_reg_npc_num, HP_script_set_reg_npc_num) },
+ { HP_POP(script->set_reg_instance_num, HP_script_set_reg_instance_num) },
{ HP_POP(script->stack_expand, HP_script_stack_expand) },
{ HP_POP(script->push_retinfo, HP_script_push_retinfo) },
{ HP_POP(script->op_3, HP_script_op_3) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 2454846f8..0dd8fbadc 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -735,6 +735,58 @@ int HP_atcommand_mutearea_sub(struct block_list *bl, va_list ap) {
}
return retVal___;
}
+void HP_atcommand_getring(struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_atcommand_getring_pre ) {
+ void (*preHookFunc) (struct map_session_data *sd);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_atcommand_getring_pre[hIndex].func;
+ preHookFunc(sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.atcommand.getring(sd);
+ }
+ if( HPMHooks.count.HP_atcommand_getring_post ) {
+ void (*postHookFunc) (struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_atcommand_getring_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
+void HP_atcommand_channel_help(int fd, const char *command, bool can_create) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_atcommand_channel_help_pre ) {
+ void (*preHookFunc) (int *fd, const char *command, bool *can_create);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_atcommand_channel_help_pre[hIndex].func;
+ preHookFunc(&fd, command, &can_create);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.atcommand.channel_help(fd, command, can_create);
+ }
+ if( HPMHooks.count.HP_atcommand_channel_help_post ) {
+ void (*postHookFunc) (int *fd, const char *command, bool *can_create);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_atcommand_channel_help_post[hIndex].func;
+ postHookFunc(&fd, command, &can_create);
+ }
+ }
+ return;
+}
void HP_atcommand_commands_sub(struct map_session_data *sd, const int fd, AtCommandType type) {
int hIndex = 0;
if( HPMHooks.count.HP_atcommand_commands_sub_pre ) {
@@ -6620,6 +6672,33 @@ int HP_clif_parse(int fd) {
}
return retVal___;
}
+const struct s_packet_db* HP_clif_packet(int packet_id) {
+ int hIndex = 0;
+ const struct s_packet_db* retVal___ = NULL;
+ if( HPMHooks.count.HP_clif_packet_pre ) {
+ const struct s_packet_db* (*preHookFunc) (int *packet_id);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_packet_pre[hIndex].func;
+ retVal___ = preHookFunc(&packet_id);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.clif.packet(packet_id);
+ }
+ if( HPMHooks.count.HP_clif_packet_post ) {
+ const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int *packet_id);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_packet_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, &packet_id);
+ }
+ }
+ return retVal___;
+}
unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) {
int hIndex = 0;
unsigned short retVal___ = 0;
@@ -6934,6 +7013,58 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) {
}
return;
}
+void HP_clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_item_equip_pre ) {
+ void (*preHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_item_equip_pre[hIndex].func;
+ preHookFunc(&idx, p, i, id, &eqp_pos);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.item_equip(idx, p, i, id, eqp_pos);
+ }
+ if( HPMHooks.count.HP_clif_item_equip_post ) {
+ void (*postHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_item_equip_post[hIndex].func;
+ postHookFunc(&idx, p, i, id, &eqp_pos);
+ }
+ }
+ return;
+}
+void HP_clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_item_normal_pre ) {
+ void (*preHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_item_normal_pre[hIndex].func;
+ preHookFunc(&idx, p, i, id);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.item_normal(idx, p, i, id);
+ }
+ if( HPMHooks.count.HP_clif_item_normal_post ) {
+ void (*postHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_item_normal_post[hIndex].func;
+ postHookFunc(&idx, p, i, id);
+ }
+ }
+ return;
+}
void HP_clif_arrowequip(struct map_session_data *sd, int val) {
int hIndex = 0;
if( HPMHooks.count.HP_clif_arrowequip_pre ) {
@@ -38679,15 +38810,15 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) {
}
return;
}
-int HP_map_getcell(int16 m, int16 x, int16 y, cell_chk cellchk) {
+int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_map_getcell_pre ) {
- int (*preHookFunc) (int16 *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_getcell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, &x, &y, &cellchk);
+ retVal___ = preHookFunc(&m, bl, &x, &y, &cellchk);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -38695,13 +38826,13 @@ int HP_map_getcell(int16 m, int16 x, int16 y, cell_chk cellchk) {
}
}
{
- retVal___ = HPMHooks.source.map.getcell(m, x, y, cellchk);
+ retVal___ = HPMHooks.source.map.getcell(m, bl, x, y, cellchk);
}
if( HPMHooks.count.HP_map_getcell_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_getcell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, &m, bl, &x, &y, &cellchk);
}
}
return retVal___;
@@ -39108,15 +39239,15 @@ int HP_map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y,
}
return retVal___;
}
-bool HP_map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag) {
+bool HP_map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag) {
int hIndex = 0;
bool retVal___ = false;
if( HPMHooks.count.HP_map_closest_freecell_pre ) {
- bool (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *type, int *flag);
+ bool (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_closest_freecell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, x, y, &type, &flag);
+ retVal___ = preHookFunc(&m, bl, x, y, &type, &flag);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -39124,13 +39255,13 @@ bool HP_map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag) {
}
}
{
- retVal___ = HPMHooks.source.map.closest_freecell(m, x, y, type, flag);
+ retVal___ = HPMHooks.source.map.closest_freecell(m, bl, x, y, type, flag);
}
if( HPMHooks.count.HP_map_closest_freecell_post ) {
- bool (*postHookFunc) (bool retVal___, int16 *m, int16 *x, int16 *y, int *type, int *flag);
+ bool (*postHookFunc) (bool retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_closest_freecell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, x, y, &type, &flag);
+ retVal___ = postHookFunc(retVal___, &m, bl, x, y, &type, &flag);
}
}
return retVal___;
@@ -39269,15 +39400,15 @@ void HP_map_clearflooritem(struct block_list *bl) {
}
return;
}
-int HP_map_addflooritem(struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) {
+int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_map_addflooritem_pre ) {
- int (*preHookFunc) (struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
+ int (*preHookFunc) (const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_addflooritem_pre[hIndex].func;
- retVal___ = preHookFunc(item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
+ retVal___ = preHookFunc(bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -39285,13 +39416,13 @@ int HP_map_addflooritem(struct item *item_data, int amount, int16 m, int16 x, in
}
}
{
- retVal___ = HPMHooks.source.map.addflooritem(item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags);
+ retVal___ = HPMHooks.source.map.addflooritem(bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags);
}
if( HPMHooks.count.HP_map_addflooritem_post ) {
- int (*postHookFunc) (int retVal___, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
+ int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_addflooritem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
+ retVal___ = postHookFunc(retVal___, bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
}
}
return retVal___;
@@ -40911,15 +41042,15 @@ int HP_map_freeblock_timer(int tid, int64 tick, int id, intptr_t data) {
}
return retVal___;
}
-int HP_map_searchrandfreecell(int16 m, int16 *x, int16 *y, int stack) {
+int HP_map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_map_searchrandfreecell_pre ) {
- int (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *stack);
+ int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_searchrandfreecell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, x, y, &stack);
+ retVal___ = preHookFunc(&m, bl, x, y, &stack);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -40927,13 +41058,13 @@ int HP_map_searchrandfreecell(int16 m, int16 *x, int16 *y, int stack) {
}
}
{
- retVal___ = HPMHooks.source.map.searchrandfreecell(m, x, y, stack);
+ retVal___ = HPMHooks.source.map.searchrandfreecell(m, bl, x, y, stack);
}
if( HPMHooks.count.HP_map_searchrandfreecell_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int16 *x, int16 *y, int *stack);
+ int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_searchrandfreecell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, x, y, &stack);
+ retVal___ = postHookFunc(retVal___, &m, bl, x, y, &stack);
}
}
return retVal___;
@@ -41093,15 +41224,15 @@ int HP_map_cell2gat(struct mapcell cell) {
}
return retVal___;
}
-int HP_map_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) {
+int HP_map_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_map_getcellp_pre ) {
- int (*preHookFunc) (struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_getcellp_pre[hIndex].func;
- retVal___ = preHookFunc(m, &x, &y, &cellchk);
+ retVal___ = preHookFunc(m, bl, &x, &y, &cellchk);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -41109,13 +41240,13 @@ int HP_map_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) {
}
}
{
- retVal___ = HPMHooks.source.map.getcellp(m, x, y, cellchk);
+ retVal___ = HPMHooks.source.map.getcellp(m, bl, x, y, cellchk);
}
if( HPMHooks.count.HP_map_getcellp_post ) {
- int (*postHookFunc) (int retVal___, struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_getcellp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, m, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk);
}
}
return retVal___;
@@ -41146,15 +41277,15 @@ void HP_map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
}
return;
}
-int HP_map_sub_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) {
+int HP_map_sub_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_map_sub_getcellp_pre ) {
- int (*preHookFunc) (struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_map_sub_getcellp_pre[hIndex].func;
- retVal___ = preHookFunc(m, &x, &y, &cellchk);
+ retVal___ = preHookFunc(m, bl, &x, &y, &cellchk);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -41162,13 +41293,13 @@ int HP_map_sub_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk)
}
}
{
- retVal___ = HPMHooks.source.map.sub_getcellp(m, x, y, cellchk);
+ retVal___ = HPMHooks.source.map.sub_getcellp(m, bl, x, y, cellchk);
}
if( HPMHooks.count.HP_map_sub_getcellp_post ) {
- int (*postHookFunc) (int retVal___, struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk);
+ int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_map_sub_getcellp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, m, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk);
}
}
return retVal___;
@@ -50425,15 +50556,15 @@ int HP_party_db_final(DBKey key, DBData *data, va_list ap) {
return retVal___;
}
/* path */
-int HP_path_blownpos(int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) {
+int HP_path_blownpos(struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_path_blownpos_pre ) {
- int (*preHookFunc) (int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
+ int (*preHookFunc) (struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_path_blownpos_pre[hIndex].func;
- retVal___ = preHookFunc(&m, &x0, &y0, &dx, &dy, &count);
+ retVal___ = preHookFunc(bl, &m, &x0, &y0, &dx, &dy, &count);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -50441,26 +50572,26 @@ int HP_path_blownpos(int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count)
}
}
{
- retVal___ = HPMHooks.source.path.blownpos(m, x0, y0, dx, dy, count);
+ retVal___ = HPMHooks.source.path.blownpos(bl, m, x0, y0, dx, dy, count);
}
if( HPMHooks.count.HP_path_blownpos_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_path_blownpos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &x0, &y0, &dx, &dy, &count);
+ retVal___ = postHookFunc(retVal___, bl, &m, &x0, &y0, &dx, &dy, &count);
}
}
return retVal___;
}
-bool HP_path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell) {
+bool HP_path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell) {
int hIndex = 0;
bool retVal___ = false;
if( HPMHooks.count.HP_path_search_pre ) {
- bool (*preHookFunc) (struct walkpath_data *wpd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
+ bool (*preHookFunc) (struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_path_search_pre[hIndex].func;
- retVal___ = preHookFunc(wpd, &m, &x0, &y0, &x1, &y1, &flag, &cell);
+ retVal___ = preHookFunc(wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -50468,26 +50599,26 @@ bool HP_path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int1
}
}
{
- retVal___ = HPMHooks.source.path.search(wpd, m, x0, y0, x1, y1, flag, cell);
+ retVal___ = HPMHooks.source.path.search(wpd, bl, m, x0, y0, x1, y1, flag, cell);
}
if( HPMHooks.count.HP_path_search_post ) {
- bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
+ bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_path_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, wpd, &m, &x0, &y0, &x1, &y1, &flag, &cell);
+ retVal___ = postHookFunc(retVal___, wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell);
}
}
return retVal___;
}
-bool HP_path_search_long(struct shootpath_data *spd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell) {
+bool HP_path_search_long(struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell) {
int hIndex = 0;
bool retVal___ = false;
if( HPMHooks.count.HP_path_search_long_pre ) {
- bool (*preHookFunc) (struct shootpath_data *spd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
+ bool (*preHookFunc) (struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_path_search_long_pre[hIndex].func;
- retVal___ = preHookFunc(spd, &m, &x0, &y0, &x1, &y1, &cell);
+ retVal___ = preHookFunc(spd, bl, &m, &x0, &y0, &x1, &y1, &cell);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -50495,13 +50626,13 @@ bool HP_path_search_long(struct shootpath_data *spd, int16 m, int16 x0, int16 y0
}
}
{
- retVal___ = HPMHooks.source.path.search_long(spd, m, x0, y0, x1, y1, cell);
+ retVal___ = HPMHooks.source.path.search_long(spd, bl, m, x0, y0, x1, y1, cell);
}
if( HPMHooks.count.HP_path_search_long_post ) {
- bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
+ bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_path_search_long_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, spd, &m, &x0, &y0, &x1, &y1, &cell);
+ retVal___ = postHookFunc(retVal___, spd, bl, &m, &x0, &y0, &x1, &y1, &cell);
}
}
return retVal___;
@@ -56614,6 +56745,39 @@ void HP_pc_autotrade_populate(struct map_session_data *sd) {
}
return;
}
+int HP_pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_pc_autotrade_final_pre ) {
+ int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_pre; hIndex++ ) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ preHookFunc = HPMHooks.list.HP_pc_autotrade_final_pre[hIndex].func;
+ retVal___ = preHookFunc(&key, data, ap___copy);
+ va_end(ap___copy);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ retVal___ = HPMHooks.source.pc.autotrade_final(key, data, ap___copy);
+ va_end(ap___copy);
+ }
+ if( HPMHooks.count.HP_pc_autotrade_final_post ) {
+ int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_post; hIndex++ ) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ postHookFunc = HPMHooks.list.HP_pc_autotrade_final_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ va_end(ap___copy);
+ }
+ }
+ return retVal___;
+}
int HP_pc_check_job_name(const char *name) {
int hIndex = 0;
int retVal___ = 0;
@@ -58540,6 +58704,222 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat
}
return retVal___;
}
+char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ char* retVal___ = NULL;
+ if( HPMHooks.count.HP_script_get_val_ref_str_pre ) {
+ char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_ref_str_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_ref_str(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_ref_str_post ) {
+ char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_ref_str_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ char* retVal___ = NULL;
+ if( HPMHooks.count.HP_script_get_val_scope_str_pre ) {
+ char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_scope_str_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_scope_str(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_scope_str_post ) {
+ char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_scope_str_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ char* retVal___ = NULL;
+ if( HPMHooks.count.HP_script_get_val_npc_str_pre ) {
+ char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_npc_str_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_npc_str(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_npc_str_post ) {
+ char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_npc_str_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+char* HP_script_get_val_instance_str(struct script_state *st, const char *name, struct script_data *data) {
+ int hIndex = 0;
+ char* retVal___ = NULL;
+ if( HPMHooks.count.HP_script_get_val_instance_str_pre ) {
+ char* (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_instance_str_pre[hIndex].func;
+ retVal___ = preHookFunc(st, name, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_instance_str(st, name, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_instance_str_post ) {
+ char* (*postHookFunc) (char* retVal___, struct script_state *st, const char *name, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_instance_str_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, name, data);
+ }
+ }
+ return retVal___;
+}
+int HP_script_get_val_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_script_get_val_ref_num_pre ) {
+ int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_ref_num_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_ref_num(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_ref_num_post ) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_ref_num_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_script_get_val_scope_num_pre ) {
+ int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_scope_num_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_scope_num(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_scope_num_post ) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_scope_num_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+int HP_script_get_val_npc_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_script_get_val_npc_num_pre ) {
+ int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_npc_num_pre[hIndex].func;
+ retVal___ = preHookFunc(st, n, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_npc_num(st, n, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_npc_num_post ) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_npc_num_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
+int HP_script_get_val_instance_num(struct script_state *st, const char *name, struct script_data *data) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_script_get_val_instance_num_pre ) {
+ int (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_instance_num_pre[hIndex].func;
+ retVal___ = preHookFunc(st, name, data);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_instance_num(st, name, data);
+ }
+ if( HPMHooks.count.HP_script_get_val_instance_num_post ) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, const char *name, struct script_data *data);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_instance_num_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, name, data);
+ }
+ }
+ return retVal___;
+}
void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) {
int hIndex = 0;
void* retVal___ = NULL;
@@ -60263,6 +60643,214 @@ int HP_script_set_reg(struct script_state *st, TBL_PC *sd, int64 num, const char
}
return retVal___;
}
+void HP_script_set_reg_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_ref_str_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_ref_str_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, str);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_ref_str(st, n, num, name, str);
+ }
+ if( HPMHooks.count.HP_script_set_reg_ref_str_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_ref_str_post[hIndex].func;
+ postHookFunc(st, n, &num, name, str);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_scope_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_scope_str_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, str);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_scope_str(st, n, num, name, str);
+ }
+ if( HPMHooks.count.HP_script_set_reg_scope_str_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_post[hIndex].func;
+ postHookFunc(st, n, &num, name, str);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_npc_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_npc_str_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, str);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_npc_str(st, n, num, name, str);
+ }
+ if( HPMHooks.count.HP_script_set_reg_npc_str_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_post[hIndex].func;
+ postHookFunc(st, n, &num, name, str);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_instance_str(struct script_state *st, int64 num, const char *name, const char *str) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_instance_str_pre ) {
+ void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_pre[hIndex].func;
+ preHookFunc(st, &num, name, str);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_instance_str(st, num, name, str);
+ }
+ if( HPMHooks.count.HP_script_set_reg_instance_str_post ) {
+ void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_post[hIndex].func;
+ postHookFunc(st, &num, name, str);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_ref_num_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_ref_num_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, &val);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_ref_num(st, n, num, name, val);
+ }
+ if( HPMHooks.count.HP_script_set_reg_ref_num_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_ref_num_post[hIndex].func;
+ postHookFunc(st, n, &num, name, &val);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_scope_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_scope_num_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, &val);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_scope_num(st, n, num, name, val);
+ }
+ if( HPMHooks.count.HP_script_set_reg_scope_num_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_post[hIndex].func;
+ postHookFunc(st, n, &num, name, &val);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_npc_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_npc_num_pre ) {
+ void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_pre[hIndex].func;
+ preHookFunc(st, n, &num, name, &val);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_npc_num(st, n, num, name, val);
+ }
+ if( HPMHooks.count.HP_script_set_reg_npc_num_post ) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_post[hIndex].func;
+ postHookFunc(st, n, &num, name, &val);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_instance_num(struct script_state *st, int64 num, const char *name, int val) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_script_set_reg_instance_num_pre ) {
+ void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, int *val);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_pre[hIndex].func;
+ preHookFunc(st, &num, name, &val);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_instance_num(st, num, name, val);
+ }
+ if( HPMHooks.count.HP_script_set_reg_instance_num_post ) {
+ void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, int *val);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_post[hIndex].func;
+ postHookFunc(st, &num, name, &val);
+ }
+ }
+ return;
+}
void HP_script_stack_expand(struct script_stack *stack) {
int hIndex = 0;
if( HPMHooks.count.HP_script_stack_expand_pre ) {
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index ff2feefa0..79eda0e5e 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -139,10 +139,10 @@ int db2sql(config_setting_t *entry, int n, const char *source) {
// bindonequip
StrBuf->Printf(&buf, "'%u',", it->flag.bindonequip?1:0);
-
+
// forceserial
StrBuf->Printf(&buf, "'%u',", it->flag.force_serial?1:0);
-
+
// buyingstore
StrBuf->Printf(&buf, "'%u',", it->flag.buyingstore?1:0);
diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c
index 4f235907d..a11f8643b 100644
--- a/src/test/test_spinlock.c
+++ b/src/test/test_spinlock.c
@@ -18,7 +18,6 @@
#define PERINC 100000
#define LOOPS 47
-
static SPIN_LOCK lock;
static unsigned int val = 0;
static volatile int32 done_threads = 0;
@@ -41,7 +40,6 @@ static void *worker(void *p){
return NULL;
}//end: worker()
-
int do_init(int argc, char **argv){
rAthread *t[THRC];
int j, i;
@@ -88,27 +86,20 @@ int do_init(int argc, char **argv){
ShowStatus("Test passed.\n");
exit(0);
}
-
-
-return 0;
+ return 0;
}//end: do_init()
-
void do_abort(void) {
}//end: do_abort()
-
void set_server_type(void) {
SERVER_TYPE = SERVER_TYPE_UNKNOWN;
}//end: set_server_type()
-
int do_final(void) {
return EXIT_SUCCESS;
}//end: do_final()
-
int parse_console(const char* command){
return 0;
}//end: parse_console
-
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index 356cdd352..72457b73a 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -188,7 +188,7 @@ char *remove_extension(char *mapname)
char *ptr, *ptr2;
ptr = strchr(mapname, '.');
if (ptr) { //Check and remove extension.
- while (ptr[1] && (ptr2 = strchr(ptr+1, '.')))
+ while (ptr[1] && (ptr2 = strchr(ptr+1, '.')) != NULL)
ptr = ptr2; //Skip to the last dot.
if (strcmp(ptr,".gat") == 0)
*ptr = '\0'; //Remove extension.
@@ -256,7 +256,6 @@ void cmdline_args_init_local(void)
CMDLINEARG_DEF2(map-list, maplist, "Alternative map list file", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(map-cache, mapcache, "Alternative map cache file", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(rebuild, rebuild, "Forces a rebuild of the map cache, rather than only adding missing maps", CMDLINE_OPT_NORMAL);
-
}
int do_init(int argc, char** argv)
diff --git a/tools/HPMHookGen/doxygen.conf b/tools/HPMHookGen/doxygen.conf
index 66c1d6158..380a3d8de 100644
--- a/tools/HPMHookGen/doxygen.conf
+++ b/tools/HPMHookGen/doxygen.conf
@@ -1,10 +1,16 @@
-# Doxyfile 1.8.4
+# Doxyfile 1.8.10
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Hercules HPMHookGen"
PROJECT_NUMBER =
+PROJECT_BRIEF =
+PROJECT_LOGO =
OUTPUT_DIRECTORY = doxyoutput
CREATE_SUBDIRS = NO
+ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = NO
REPEAT_BRIEF = NO
@@ -22,20 +28,31 @@ INHERIT_DOCS = NO
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
+TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = h=C
+MARKDOWN_SUPPORT = YES
+AUTOLINK_SUPPORT = YES
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
+GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = NO
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
+LOOKUP_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
+EXTRACT_PACKAGE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
@@ -47,7 +64,9 @@ HIDE_IN_BODY_DOCS = YES
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
+HIDE_COMPOUND_REFERENCE= NO
SHOW_INCLUDE_FILES = NO
+SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
@@ -55,6 +74,7 @@ SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
+STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = NO
@@ -66,6 +86,10 @@ SHOW_FILES = NO
SHOW_NAMESPACES = NO
FILE_VERSION_FILTER =
LAYOUT_FILE =
+CITE_BIB_FILES =
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = NO
@@ -73,9 +97,16 @@ WARN_IF_DOC_ERROR = NO
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
-INPUT = ../../src/map ../../src/common ../../src/char ../../src/login
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ../../src/map \
+ ../../src/common \
+ ../../src/char \
+ ../../src/login
INPUT_ENCODING = UTF-8
-FILE_PATTERNS = *.c *.h
+FILE_PATTERNS = *.c \
+ *.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
@@ -88,28 +119,43 @@ IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = NO
+SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
GENERATE_HTML = NO
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
+HTML_EXTRA_STYLESHEET =
+HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_DYNAMIC_SECTIONS = NO
+HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
@@ -139,8 +185,21 @@ TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
+USE_MATHJAX = NO
+MATHJAX_FORMAT = HTML-CSS
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+MATHJAX_EXTENSIONS =
+MATHJAX_CODEFILE =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
+EXTERNAL_SEARCH = NO
+SEARCHENGINE_URL =
+SEARCHDATA_FILE = searchdata.xml
+EXTERNAL_SEARCH_ID =
+EXTRA_SEARCH_MAPPINGS =
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
@@ -149,45 +208,84 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
+LATEX_FOOTER =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
+LATEX_BIB_STYLE = plain
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
+RTF_SOURCE_CODE = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
+MAN_SUBDIR =
MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
GENERATE_XML = YES
XML_OUTPUT = xml
XML_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK = NO
+DOCBOOK_OUTPUT = docbook
+DOCBOOK_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
-INCLUDE_PATH =
+INCLUDE_PATH = ../../src
INCLUDE_FILE_PATTERNS =
-PREDEFINED = __attribute__(x)= HPMHOOKGEN
+PREDEFINED = __attribute__(x)= \
+ HPMHOOKGEN
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = NO
+EXTERNAL_PAGES = YES
PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
MSCGEN_PATH =
+DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
@@ -198,6 +296,7 @@ CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO
UML_LOOK = NO
+UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
@@ -206,8 +305,13 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = png
+INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
+MSCFILE_DIRS =
+DIAFILE_DIRS =
+PLANTUML_JAR_PATH =
+PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
diff --git a/travis.sh b/travis.sh
index 51a0a0611..05f6732d5 100755
--- a/travis.sh
+++ b/travis.sh
@@ -92,7 +92,7 @@ EOF
ARGS="--load-script npc/dev/test.txt "
ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt"
echo "Running Hercules with command line: ./map-server --run-once $ARGS"
- ASAN_OPTIONS=detect_leaks=0 ./map-server --run-once $ARGS 2>runlog.txt
+ ./map-server --run-once $ARGS 2>runlog.txt
export errcode=$?
export teststr=$(cat runlog.txt)
if [[ -n "${teststr}" ]]; then