diff options
-rw-r--r-- | Changelog-SVN.txt | 3 | ||||
-rw-r--r-- | db/skill_cast_db.txt | 2 | ||||
-rw-r--r-- | src/map/skill.c | 52 | ||||
-rw-r--r-- | src/map/status.c | 55 |
4 files changed, 36 insertions, 76 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 4451c3512..0c883bffc 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -1,6 +1,9 @@ Date Added 03/08 + * Added chance for Enchant Poison to poison enemy, and reduced Deadly Poison + chance [celest] + * Compacted some code for Deadly Poison [celest] * Added DracoRPG's code for Soul Breaker - the magic attack part should work as it should now, thanks! ^^ [celest] * Reverted the reverted jA event change but this time without bugs (hopefully) [Shinomori] diff --git a/db/skill_cast_db.txt b/db/skill_cast_db.txt index 93badb7a2..aacc0b9eb 100644 --- a/db/skill_cast_db.txt +++ b/db/skill_cast_db.txt @@ -97,7 +97,7 @@ 135,0,0,500:1000:2000:3000:4000:5000:6000:7000:8000:9000,0 //AS_CLOAKING#クローキング# 136,0,0,0,6000:7000:8000:9000:10000:11000:12000:13000:14000:15000 //AS_SONICBLOW#ソニックブロー# -138,0,0,30000:45000:60000:75000:90000:105000:120000:135000:150000:165000,0 //AS_ENCHANTPOISON#エンチャントポイズン# +138,0,0,30000:45000:60000:75000:90000:105000:120000:135000:150000:165000,10000:20000:30000:40000:50000:60000:70000:80000:90000:100000 //AS_ENCHANTPOISON#エンチャントポイズン# 139,0,0,20000:25000:30000:35000:40000:45000:50000:55000:60000:65000,0 //AS_POISONREACT#?イズンリアクト# 140,0,0,5000:10000:15000:20000:25000:30000:35000:40000:45000:50000,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000 //AS_VENOMDUST#ベナムダスト# 141,1000,0,5500:6000:6500:7000:7500:8000:8500:9000:9500:10000,15000:20000:25000:30000:35000:40000:45000:50000:55000:60000 //AS_SPLASHER#ベナムスプラッシャー# 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; diff --git a/src/map/status.c b/src/map/status.c index 53c59670f..f81952518 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4464,54 +4464,21 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) return 0; } break; + case SC_POISON: - if(sc_data[SC_SLOWPOISON].timer == -1) { - if( (--sc_data[type].val3) > 0) { - int hp = status_get_max_hp(bl); - if(status_get_hp(bl) > hp>>2) { - if(sd) { - hp = 3 + hp*3/200; - pc_heal(sd,-hp,0); - } - else if(bl->type == BL_MOB) { - struct mob_data *md; - nullpo_retr(0, md=(struct mob_data *)bl); - /*if((md=((struct mob_data *)bl)) == NULL) - break;*/ - hp = 3 + hp/200; - md->hp -= hp; - } - } - sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data ); - // hmm setting up a timer and breaking then to call status_change_end just right away? - // I think you're missing a: - return 0; - - } - } - else - { - sc_data[type].timer=add_timer(1000+tick,status_change_timer, bl->id, data ); - // hmm setting up a timer and breaking then to call status_change_end just right away? - // I think you're missing brackets and a: - return 0; - } - break; case SC_DPOISON: if (sc_data[SC_SLOWPOISON].timer == -1 && (--sc_data[type].val3) > 0) { int hp = status_get_max_hp(bl); - if (status_get_hp(bl) > hp>>2) { - if(sd) { - hp = 3 + hp/50; - pc_heal(sd, -hp, 0); - } else if (bl->type == BL_MOB) { - struct mob_data *md; - nullpo_retr(0, md=(struct mob_data *)bl); - /*if ((md=((struct mob_data *)bl)) == NULL) - break;*/ - hp = 3 + hp/100; - md->hp -= hp; - } + if (type == SC_POISON && status_get_hp(bl) < hp>>2) + break; + if(sd) { + hp = (type == SC_DPOISON) ? 3 + hp/50 : 3 + hp*3/200; + pc_heal(sd, -hp, 0); + } else if (bl->type == BL_MOB) { + struct mob_data *md; + nullpo_retr(0, md=(struct mob_data *)bl); + hp = (type == SC_DPOISON) ? 3 + hp/100 : 3 + hp/200; + md->hp -= hp; } } if (sc_data[type].val3 > 0) |