summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-03-01 14:57:56 -0300
committerJesusaves <cpntb1@ymail.com>2021-03-01 14:57:56 -0300
commitb59dd805edc48d4883f277cb80c5156760e19039 (patch)
tree829d3de18933d57b3cf051a48e3a03253a1024aa
parent7b48f7b7652239620aa50512f1a8791a1f48366f (diff)
downloadevol-hercules-b59dd805edc48d4883f277cb80c5156760e19039.tar.gz
evol-hercules-b59dd805edc48d4883f277cb80c5156760e19039.tar.bz2
evol-hercules-b59dd805edc48d4883f277cb80c5156760e19039.tar.xz
evol-hercules-b59dd805edc48d4883f277cb80c5156760e19039.zip
Add support to custom Homunculus skills.
-rw-r--r--src/emap/skill.c12
-rwxr-xr-xtools/vars.sh3
2 files changed, 12 insertions, 3 deletions
diff --git a/src/emap/skill.c b/src/emap/skill.c
index 38fb265..3bfb1ad 100644
--- a/src/emap/skill.c
+++ b/src/emap/skill.c
@@ -18,6 +18,7 @@
#include "common/timer.h"
#include "map/pc.h"
#include "map/npc.h"
+#include "map/homunculus.h"
#include "map/script.h"
#include "map/skill.h"
@@ -92,8 +93,14 @@ bool eskill_castend_nodamage_id_unknown(struct block_list *src,
}
//ShowDebug("Operation start!\n");
// 1: Check if src can become a sd; If not, ABORT
- struct map_session_data *sd = NULL;
- sd = BL_CAST(BL_PC, src);
+ struct map_session_data *sd = NULL;
+ if (src->type == BL_HOM) {
+ struct homun_data *hd = NULL;
+ hd = BL_CAST(BL_HOM, src);
+ sd = hd->master;
+ } else {
+ sd = BL_CAST(BL_PC, src);
+ }
if (!sd)
return true;
@@ -102,6 +109,7 @@ bool eskill_castend_nodamage_id_unknown(struct block_list *src,
pc->setreg(sd, script->add_variable("@skillTarget"), bl->id);
pc->setreg(sd, script->add_variable("@skillTargetX"), bl->x);
pc->setreg(sd, script->add_variable("@skillTargetY"), bl->y);
+ pc->setreg(sd, script->add_variable("@skillCaster"), src->id);
//ShowDebug("Data filled! Targed was %d\n", bl->id);
if (sd)
{
diff --git a/tools/vars.sh b/tools/vars.sh
index 5a9cd7b..925da00 100755
--- a/tools/vars.sh
+++ b/tools/vars.sh
@@ -8,8 +8,9 @@
# EVOL_FIRST_SKILL 20000
# OLD_MAX_SKILL_DB 1510
# MAX_SKILL_TREE 200
+# MAX_HOMUNSKILL 43 -> 53
# can be used for custom skill id: 10016 - 10036+20
-export VARS=" -DOLD_MAX_SKILL_DB=1510 -DMAX_STORAGE=500 -DMAX_INVENTORY=120 -DMAX_AMOUNT=32500 -DMAX_SKILL_DB=1660 -DMAX_SKILL_ID=20150 -DMAX_EVOL_SKILLS=150 -DEVOL_FIRST_SKILL=20000 -DMAX_SKILL_TREE=200 -DSC_MAX=658 -DSI_MAX=991 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531"
+export VARS=" -DOLD_MAX_SKILL_DB=1510 -DMAX_STORAGE=500 -DMAX_INVENTORY=120 -DMAX_AMOUNT=32500 -DMAX_SKILL_DB=1660 -DMAX_SKILL_ID=20150 -DMAX_EVOL_SKILLS=150 -DEVOL_FIRST_SKILL=20000 -DMAX_SKILL_TREE=200 -DMAX_HOMUNSKILL=53 -DSC_MAX=658 -DSI_MAX=991 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531"
export CPPFLAGS="${VARS}"