summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c52
-rw-r--r--src/map/status.c55
2 files changed, 32 insertions, 75 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;
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)