Fixed bugreport:1551 poison and edp poison now give proper exp to caster vs mobs.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16142 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-05-24 13:59:59 +00:00
parent 806c569bd1
commit d8d54895b7
2 changed files with 14 additions and 5 deletions

View File

@ -790,11 +790,11 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
struct status_change_entry *sce; struct status_change_entry *sce;
// Enchant Poison gives a chance to poison attacked enemies // Enchant Poison gives a chance to poison attacked enemies
if((sce=sc->data[SC_ENCPOISON])) //Don't use sc_start since chance comes in 1/10000 rate. if((sce=sc->data[SC_ENCPOISON])) //Don't use sc_start since chance comes in 1/10000 rate.
status_change_start(bl,SC_POISON,sce->val2, sce->val1,0,0,0, status_change_start(bl,SC_POISON,sce->val2, sce->val1,src->id,0,0,
skill_get_time2(AS_ENCHANTPOISON,sce->val1),0); skill_get_time2(AS_ENCHANTPOISON,sce->val1),0);
// Enchant Deadly Poison gives a chance to deadly poison attacked enemies // Enchant Deadly Poison gives a chance to deadly poison attacked enemies
if((sce=sc->data[SC_EDP])) if((sce=sc->data[SC_EDP]))
sc_start4(bl,SC_DPOISON,sce->val2, sce->val1,0,0,0, sc_start4(bl,SC_DPOISON,sce->val2, sce->val1,src->id,0,0,
skill_get_time2(ASC_EDP,sce->val1)); skill_get_time2(ASC_EDP,sce->val1));
} }
} }
@ -817,7 +817,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
skilllv = pc_checkskill(sd, TF_POISON); skilllv = pc_checkskill(sd, TF_POISON);
case TF_POISON: case TF_POISON:
case AS_SPLASHER: case AS_SPLASHER:
if(!sc_start(bl,SC_POISON,(4*skilllv+10),skilllv,skill_get_time2(skillid,skilllv)) if(!sc_start2(bl,SC_POISON,(4*skilllv+10),skilllv,src->id,skill_get_time2(skillid,skilllv))
&& sd && skillid==TF_POISON && sd && skillid==TF_POISON
) )
clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0);

View File

@ -6825,11 +6825,15 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_DPOISON: case SC_DPOISON:
//Lose 10/15% of your life as long as it doesn't brings life below 25% //Lose 10/15% of your life as long as it doesn't brings life below 25%
if (status->hp > status->max_hp>>2) if (status->hp > status->max_hp>>2) {
{
int diff = status->max_hp*(bl->type==BL_PC?10:15)/100; int diff = status->max_hp*(bl->type==BL_PC?10:15)/100;
if (status->hp - diff < status->max_hp>>2) if (status->hp - diff < status->max_hp>>2)
diff = status->hp - (status->max_hp>>2); diff = status->hp - (status->max_hp>>2);
if( val2 && bl->type == BL_MOB ) {
struct block_list* src = map_id2bl(val2);
if( src )
mob_log_damage((TBL_MOB*)bl,src,diff);
}
status_zap(bl, diff, 0); status_zap(bl, diff, 0);
} }
// fall through // fall through
@ -9151,6 +9155,11 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_DPOISON: case SC_DPOISON:
if (--(sce->val3) > 0) { if (--(sce->val3) > 0) {
if (!sc->data[SC_SLOWPOISON]) { if (!sc->data[SC_SLOWPOISON]) {
if( sce->val2 && bl->type == BL_MOB ) {
struct block_list* src = map_id2bl(sce->val2);
if( src )
mob_log_damage((TBL_MOB*)bl,src,sce->val4);
}
map_freeblock_lock(); map_freeblock_lock();
status_zap(bl, sce->val4, 0); status_zap(bl, sce->val4, 0);
if (sc->data[type]) { // Check if the status still last ( can be dead since then ). if (sc->data[type]) { // Check if the status still last ( can be dead since then ).