diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-08 12:21:28 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-08 12:21:28 +0000 |
commit | c23c79fe6a1bbf54d414007ead915f739e636b85 (patch) | |
tree | 338b58cbc7347ae108864eb5270fa852b638f939 /src/map/skill.c | |
parent | c348cfa676c0cc54f1a1114c1b5654f97163f86c (diff) | |
download | hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.gz hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.bz2 hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.tar.xz hercules-c23c79fe6a1bbf54d414007ead915f739e636b85.zip |
Updated Deadly Poison and Enchant Poison
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1215 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 0baadbb05..d0db25ddb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -756,42 +756,32 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s switch(skillid){ case 0: /* 通常攻? */ /* 自動鷹 */ - if( sd && pc_isfalcon(sd) && sd->status.weapon == 11 && (skill=pc_checkskill(sd,HT_BLITZBEAT))>0 && - rand()%1000 <= sd->paramc[5]*10/3+1 ) { - int lv=(sd->status.job_level+9)/10; - skill_castend_damage_id(src,bl,HT_BLITZBEAT,(skill<lv)?skill:lv,tick,0xf00000); - } - // スナッチャ? - if(sd && sd->status.weapon != 11 && (skill=pc_checkskill(sd,RG_SNATCHER)) > 0) - if((skill*15 + 55) + (skill2 = pc_checkskill(sd,TF_STEAL))*10 > rand()%1000) { + if(sd) { + struct status_change *sc_data = status_get_sc_data(bl); + if (pc_isfalcon(sd) && sd->status.weapon == 11 && (skill=pc_checkskill(sd,HT_BLITZBEAT))>0 && + rand()%1000 <= sd->paramc[5]*10/3+1 ) { + int lv=(sd->status.job_level+9)/10; + skill_castend_damage_id(src,bl,HT_BLITZBEAT,(skill<lv)?skill:lv,tick,0xf00000); + } + // スナッチャ? + if(sd->status.weapon != 11 && (skill=pc_checkskill(sd,RG_SNATCHER)) > 0 && + (skill*15 + 55) + (skill2 = pc_checkskill(sd,TF_STEAL))*10 > rand()%1000) { if(pc_steal_item(sd,bl)) clif_skill_nodamage(src,bl,TF_STEAL,skill2,1); else if (battle_config.display_snatcher_skill_fail) clif_skill_fail(sd,skillid,0,0); } - // エンチャントデットリ?ポイズン(猛毒?果) - if (sd && sd->sc_data[SC_EDP].timer != -1 && rand() % 10000 < sd->sc_data[SC_EDP].val2 * sc_def_vit) { - int mhp = status_get_max_hp(bl); - int hp = status_get_hp(bl); - int lvl = sd->sc_data[SC_EDP].val1; - int diff; - // MHPの1/4以下にはならない - if(hp > mhp>>2) { - if(bl->type == BL_PC) { - diff = mhp*10/100; - if (hp - diff < mhp>>2) - diff = hp - (mhp>>2); - pc_heal(dstsd, -hp, 0); - } else if(bl->type == BL_MOB) { - struct mob_data *md = (struct mob_data *)bl; - hp -= mhp*15/100; - if (hp > mhp>>2) - md->hp = hp; - else - md->hp = mhp>>2; - } - } - status_change_start(bl,SC_DPOISON,lvl,0,0,0,skill_get_time2(ASC_EDP,lvl),0); + // enchant poison has a chance of poisoning enemy + if (sd->sc_data[SC_ENCPOISON].timer != -1 && sc_data && sc_data[SC_POISON].timer == -1 && + rand() % 100 < sd->sc_data[SC_ENCPOISON].val1 * sc_def_vit) { + status_change_start(bl,SC_POISON,sd->sc_data[SC_ENCPOISON].val1, + 0,0,0,skill_get_time2(AS_ENCHANTPOISON,sd->sc_data[SC_ENCPOISON].val1),0); + } + // エンチャントデットリ?ポイズン(猛毒?果) + if (sd->sc_data[SC_EDP].timer != -1 && sc_data && sc_data[SC_DPOISON].timer == -1 && + rand() % 100 < sd->sc_data[SC_EDP].val2 * sc_def_vit) + status_change_start(bl,SC_DPOISON,sd->sc_data[SC_EDP].val1, + 0,0,0,skill_get_time2(ASC_EDP,sd->sc_data[SC_EDP].val1),0); } break; |