summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-01 19:51:01 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-01 19:51:01 +0300
commit7f6c805f25d34ba80ca86e53216e1d588ab1ea75 (patch)
tree615005bd9896aeb49f42b0eb0fbfc08957c4cab8
parent0d732b8e7959bc50b29874d816981d12859fb811 (diff)
downloadplugin-7f6c805f25d34ba80ca86e53216e1d588ab1ea75.tar.gz
plugin-7f6c805f25d34ba80ca86e53216e1d588ab1ea75.tar.bz2
plugin-7f6c805f25d34ba80ca86e53216e1d588ab1ea75.tar.xz
plugin-7f6c805f25d34ba80ca86e53216e1d588ab1ea75.zip
For evol skills use range 20000 - 20021s20160703release2016-07-04
For this add mapping to array index. Also rename skill into EVOL_MASS_PROVOKE.
-rw-r--r--src/ecommon/init.c5
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/skill.c14
-rw-r--r--src/emap/skill.h3
-rw-r--r--src/emap/skill_const.c2
-rw-r--r--src/emap/skill_const.h2
-rw-r--r--src/emap/skill_ground.c2
-rwxr-xr-xtools/vars.sh8
8 files changed, 31 insertions, 6 deletions
diff --git a/src/ecommon/init.c b/src/ecommon/init.c
index d91792e..f0955e1 100644
--- a/src/ecommon/init.c
+++ b/src/ecommon/init.c
@@ -45,7 +45,10 @@ void commonClean(void)
void common_online(void)
{
checkVar(MAX_SKILL, 1500);
- checkVar(MAX_SKILL_ID, 10037);
+ checkVar(MAX_SKILL_ID, 20022);
checkVar(SC_MAX, 647);
checkVar(SI_MAX, 971);
+ checkVar(OLD_MAX_SKILL_DB, 1478);
+ checkVar(MAX_EVOL_SKILLS, 22);
+ checkVar(EVOL_FIRST_SKILL, 20000);
}
diff --git a/src/emap/init.c b/src/emap/init.c
index 280c26e..9d21ab0 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -273,6 +273,7 @@ HPExport void plugin_init (void)
addHookPost(mob, read_db_mode_sub, emob_read_db_mode_sub_post);
addHookPost(npc, get_viewdata, enpc_get_viewdata_post);
addHookPost(skill, check_condition_castend, eskill_check_condition_castend_post);
+ addHookPost(skill, get_index, eskill_get_index_post);
addHookPost(pc, additem, epc_additem_post);
addHookPost(pc, isequip, epc_isequip_post);
addHookPost(pc, isUseitem, epc_isequip_post);
diff --git a/src/emap/skill.c b/src/emap/skill.c
index 65f34e1..97bd93e 100644
--- a/src/emap/skill.c
+++ b/src/emap/skill.c
@@ -24,6 +24,18 @@
#include "plugins/HPMHooking.h"
+int eskill_get_index_post(int retVal,
+ uint16 skill_id)
+{
+ if (skill_id >= EVOL_FIRST_SKILL && skill_id < EVOL_FIRST_SKILL + MAX_EVOL_SKILLS)
+ {
+ // 1478 + skill_id - 20000
+ skill_id = OLD_MAX_SKILL_DB + skill_id - EVOL_FIRST_SKILL;
+ return skill_id;
+ }
+ return retVal;
+}
+
int eskill_check_condition_castend_post(int retVal,
TBL_PC* sd,
uint16 skill_id,
@@ -143,7 +155,7 @@ bool eskill_castend_pos2_unknown(struct block_list* src,
{
switch (*skill_id)
{
- case EVOL_MASSPROVOKE:
+ case EVOL_MASS_PROVOKE:
return eskill_massprovoke_castend(src, x, y, skill_id, skill_lv, tick, flag);
default:
ShowWarning("skill_castend_pos2: Unknown skill used:%d\n", *skill_id);
diff --git a/src/emap/skill.h b/src/emap/skill.h
index db519cb..02c0607 100644
--- a/src/emap/skill.h
+++ b/src/emap/skill.h
@@ -4,6 +4,9 @@
#ifndef EVOL_MAP_SKILL
#define EVOL_MAP_SKILL
+int eskill_get_index_post(int retVal,
+ uint16 skill_id);
+
int eskill_check_condition_castend_post(int retVal,
TBL_PC* sd,
uint16 skill_id,
diff --git a/src/emap/skill_const.c b/src/emap/skill_const.c
index 30e6fde..c5fe22b 100644
--- a/src/emap/skill_const.c
+++ b/src/emap/skill_const.c
@@ -10,6 +10,6 @@
void eskill_addskill_conststants(void)
{
script->constdb_comment("Evol skills");
- script->set_constant("EVOL_MASSPROVOKE", EVOL_MASSPROVOKE, false, false);
+ script->set_constant("EVOL_MASS_PROVOKE", EVOL_MASS_PROVOKE, false, false);
script->constdb_comment(NULL);
}
diff --git a/src/emap/skill_const.h b/src/emap/skill_const.h
index 11076e8..762bffb 100644
--- a/src/emap/skill_const.h
+++ b/src/emap/skill_const.h
@@ -6,7 +6,7 @@
enum
{
- EVOL_MASSPROVOKE = 10016
+ EVOL_MASS_PROVOKE = 20000
};
void eskill_addskill_conststants(void);
diff --git a/src/emap/skill_ground.c b/src/emap/skill_ground.c
index 7a4ebc2..4422a8d 100644
--- a/src/emap/skill_ground.c
+++ b/src/emap/skill_ground.c
@@ -64,6 +64,8 @@ bool eskill_massprovoke_castend(struct block_list* src,
map->foreachinarea(eskill_massprovoke_sub, src->m, *x - r, *y - r, *x + r, *y + r, BL_MOB,
src, dist, &cnt);
if (cnt == 0)
+ {
unit->skillcastcancel(src, 1);
+ }
return false;
}
diff --git a/tools/vars.sh b/tools/vars.sh
index fc92ae4..03b7193 100755
--- a/tools/vars.sh
+++ b/tools/vars.sh
@@ -1,10 +1,14 @@
#!/bin/bash
# MAX_SKILL 1478 + 22 = 1500
-# MAX_SKILL_ID 10015 + 22 = 10037
+# MAX_SKILL_ID 10015 + 22 + 9963 = 20022
# SC_MAX 642 + 5 = 647
# SI_MAX 966 + 5 = 971
+# MAX_EVOL_SKILLS 22
+# EVOL_FIRST_SKILL 20000
+# OLD_MAX_SKILL_DB 1478
# can be used for custom skill id: 10016 - 10036
-export VARS="-DMAX_SKILL=1500 -DMAX_SKILL_ID=10037 -DSC_MAX=647 -DSI_MAX=971"
+export VARS=" -DOLD_MAX_SKILL_DB=1478 -DMAX_SKILL=1500 -DMAX_SKILL_ID=20022 -DMAX_EVOL_SKILLS=22 -DEVOL_FIRST_SKILL=20000 -DSC_MAX=647 -DSI_MAX=971"
+export CPPFLAGS="${VARS}"