summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmistry <Equinox1991@gmail.com>2016-08-10 23:07:42 +0800
committerHaru <haru@dotalux.com>2016-08-14 17:53:23 +0200
commit26f1241ca5e58d95845aba101d7026759fa15e4b (patch)
treeddbe9bf60c41783db7e08d5eb640b99164720ef1 /src
parent694070de091852a2b3426072d2141224391a8cc8 (diff)
downloadhercules-26f1241ca5e58d95845aba101d7026759fa15e4b.tar.gz
hercules-26f1241ca5e58d95845aba101d7026759fa15e4b.tar.bz2
hercules-26f1241ca5e58d95845aba101d7026759fa15e4b.tar.xz
hercules-26f1241ca5e58d95845aba101d7026759fa15e4b.zip
Update pc_steal_coin parameter
Added skill_lv as parameter to *pc_steal_coin() Closes #1395 as merged Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.c13
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/skill.c2
3 files changed, 9 insertions, 8 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 414b236d7..51d02ff40 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5392,13 +5392,15 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
/**
* Steals zeny from a monster through the RG_STEALCOIN skill.
*
- * @param sd Source character
- * @param target Target monster
+ * @param sd Source character
+ * @param target Target monster
+ * @param skill_lv Skill Level
*
* @return Amount of stolen zeny (0 in case of failure)
- **/
-int pc_steal_coin(struct map_session_data *sd, struct block_list *target) {
- int rate, skill_lv;
+ */
+int pc_steal_coin(struct map_session_data *sd, struct block_list *target, uint16 skill_lv)
+{
+ int rate;
struct mob_data *md = BL_CAST(BL_MOB, target);
if (sd == NULL || md == NULL)
@@ -5410,7 +5412,6 @@ int pc_steal_coin(struct map_session_data *sd, struct block_list *target) {
if (mob_is_treasure(md))
return 0;
- skill_lv = pc->checkskill(sd, RG_STEALCOIN);
rate = skill_lv * 10 + (sd->status.base_level - md->level) * 2 + sd->battle_status.dex / 2 + sd->battle_status.luk / 2;
if(rnd()%1000 < rate) {
int amount = md->level * skill_lv / 10 + md->level * 8 + rnd()%(md->level * 2 + 1); // mob_lv * skill_lv / 10 + random [mob_lv*8; mob_lv*10]
diff --git a/src/map/pc.h b/src/map/pc.h
index df5416bc1..fd446813f 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -901,7 +901,7 @@ END_ZEROED_BLOCK; /* End */
bool (*can_insert_card_into) (struct map_session_data* sd, int idx_card, int idx_equip);
int (*steal_item) (struct map_session_data *sd,struct block_list *bl, uint16 skill_lv);
- int (*steal_coin) (struct map_session_data *sd,struct block_list *bl);
+ int (*steal_coin) (struct map_session_data *sd,struct block_list *bl, uint16 skill_lv);
int (*modifybuyvalue) (struct map_session_data *sd,int orig_value);
int (*modifysellvalue) (struct map_session_data *sd,int orig_value);
diff --git a/src/map/skill.c b/src/map/skill.c
index a7ed0b8f2..40001659c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6538,7 +6538,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case RG_STEALCOIN:
if(sd) {
- int amount = pc->steal_coin(sd, bl);
+ int amount = pc->steal_coin(sd, bl, skill_lv);
if( amount > 0 ) {
dstmd->state.provoke_flag = src->id;
mob->target(dstmd, src, skill->get_range2(src, skill_id, skill_lv));