diff options
-rw-r--r-- | npc/quests/quests_ayothaya.txt | 1 | ||||
-rw-r--r-- | src/char/char.c | 5 | ||||
-rw-r--r-- | src/login/login.c | 5 | ||||
-rw-r--r-- | src/map/pc.c | 13 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/skill.c | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 |
8 files changed, 26 insertions, 18 deletions
diff --git a/npc/quests/quests_ayothaya.txt b/npc/quests/quests_ayothaya.txt index 73769b2a8..738b4c006 100644 --- a/npc/quests/quests_ayothaya.txt +++ b/npc/quests/quests_ayothaya.txt @@ -1515,6 +1515,7 @@ ayo_in01,181,193,4 script Shaman#thai 4_F_THAISHAMAN,{ mes "[Boonthom]"; mes "The ancient building consists"; mes "of 2 levels. Before you enter the 2nd underground level, please return to me so that I can tell you how to enter that place."; + close; } mes "[Boonthom]"; mes "Did you forget what materials"; diff --git a/src/char/char.c b/src/char/char.c index 9275678e6..51411791e 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3807,8 +3807,11 @@ int char_parse_frommap(int fd) int packet_id = RFIFOW(fd,0); if (VECTOR_LENGTH(HPM->packets[hpParse_FromMap]) > 0) { int result = HPM->parse_packets(fd,packet_id,hpParse_FromMap); - if (result == 1) + if (result == 1) { + if (sockt->session[fd] == NULL) + return 0; continue; + } if (result == 2) return 0; } diff --git a/src/login/login.c b/src/login/login.c index 7f5f78a4d..6b422eef2 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -817,8 +817,11 @@ int login_parse_fromchar(int fd) if (VECTOR_LENGTH(HPM->packets[hpParse_FromChar]) > 0) { int result = HPM->parse_packets(fd,command,hpParse_FromChar); - if (result == 1) + if (result == 1) { + if (sockt->session[fd] == NULL) + return 0; continue; + } if (result == 2) return 0; } 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)); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index f10e868b7..2023730f7 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5256,8 +5256,8 @@ typedef bool (*HPMHOOK_pre_pc_can_insert_card_into) (struct map_session_data **s typedef bool (*HPMHOOK_post_pc_can_insert_card_into) (bool retVal___, struct map_session_data *sd, int idx_card, int idx_equip); typedef int (*HPMHOOK_pre_pc_steal_item) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv); typedef int (*HPMHOOK_post_pc_steal_item) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv); -typedef int (*HPMHOOK_pre_pc_steal_coin) (struct map_session_data **sd, struct block_list **bl); -typedef int (*HPMHOOK_post_pc_steal_coin) (int retVal___, struct map_session_data *sd, struct block_list *bl); +typedef int (*HPMHOOK_pre_pc_steal_coin) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv); +typedef int (*HPMHOOK_post_pc_steal_coin) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv); typedef int (*HPMHOOK_pre_pc_modifybuyvalue) (struct map_session_data **sd, int *orig_value); typedef int (*HPMHOOK_post_pc_modifybuyvalue) (int retVal___, struct map_session_data *sd, int orig_value); typedef int (*HPMHOOK_pre_pc_modifysellvalue) (struct map_session_data **sd, int *orig_value); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 8a343473c..9ef56800f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -54767,15 +54767,15 @@ int HP_pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 } return retVal___; } -int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl) { +int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_pc_steal_coin_pre ) { - int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl); + int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_steal_coin_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &bl); + retVal___ = preHookFunc(&sd, &bl, &skill_lv); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -54783,13 +54783,13 @@ int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl) { } } { - retVal___ = HPMHooks.source.pc.steal_coin(sd, bl); + retVal___ = HPMHooks.source.pc.steal_coin(sd, bl, skill_lv); } if( HPMHooks.count.HP_pc_steal_coin_post ) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_steal_coin_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, bl); + retVal___ = postHookFunc(retVal___, sd, bl, skill_lv); } } return retVal___; |