diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-21 16:39:14 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-21 16:39:14 +0000 |
commit | 8f40fa6af0e9e18b0fd48fc3da35f3de0b9ce5bd (patch) | |
tree | 807e224c5b1bbd45909bbeb15ebcf6a318b3d47a /src/map | |
parent | 41f1a34c8593a40b4c5dc4178d7138e7e166eea0 (diff) | |
download | hercules-8f40fa6af0e9e18b0fd48fc3da35f3de0b9ce5bd.tar.gz hercules-8f40fa6af0e9e18b0fd48fc3da35f3de0b9ce5bd.tar.bz2 hercules-8f40fa6af0e9e18b0fd48fc3da35f3de0b9ce5bd.tar.xz hercules-8f40fa6af0e9e18b0fd48fc3da35f3de0b9ce5bd.zip |
- Added BL_HOM handling to battle_gettarget.
- Some cleaning in skill.c in regard to homun skills.
- Madness Canceller now stacks with other aspd bonuses, just like Berserk does.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8403 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 5 | ||||
-rw-r--r-- | src/map/skill.c | 73 | ||||
-rw-r--r-- | src/map/status.c | 8 |
3 files changed, 34 insertions, 52 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index f1d51bb15..c645399e7 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -100,6 +100,8 @@ int battle_gettarget(struct block_list *bl) return ((struct mob_data*)bl)->target_id; case BL_PET: return ((struct pet_data*)bl)->target_id; + case BL_HOM: + return ((struct homun_data*)bl)->target_id; } return 0; } @@ -3043,7 +3045,6 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, } } if (rdamage > 0) { //By sending attack type "none" skill_additional_effect won't be invoked. [Skotlex] - if(tsd && src != target) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src)); battle_delay_damage(tick+wd.amotion, target, src, 0, 0, 0, rdamage, ATK_DEF, rdelay); @@ -4090,7 +4091,7 @@ void battle_set_defaults() { battle_config.equip_skill_break_rate = 100; // [Valaris], adapted by [Skotlex] battle_config.pk_mode = 0; // [Valaris] battle_config.pk_level_range = 0; // [Skotlex] - battle_config.manner_system = 1; // [Valaris] + battle_config.manner_system = 0xFFF; // [Valaris] battle_config.pet_equip_required = 0; // [Valaris] battle_config.multi_level_up = 0; // [Valaris] battle_config.max_exp_gain_rate = 0; // [Skotlex] diff --git a/src/map/skill.c b/src/map/skill.c index 218e8ae53..df2b796e6 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5542,63 +5542,44 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in AREA_SIZE, BL_MOB, bl, src); } } - else - { - // Failed - if (hd) - clif_skill_fail(hd->master, skillid, 0, 0); - else if (sd) - clif_skill_fail(sd, skillid, 0, 0); - } + // Failed + else if (hd && hd->master) + clif_skill_fail(hd->master, skillid, 0, 0); + else if (sd) + clif_skill_fail(sd, skillid, 0, 0); break; case HVAN_CHAOTIC: //[orn] { - if(hd){ - //HOM,PC,MOB - struct block_list* heal_target=NULL; - int heal = skill_calc_heal( src, 1+rand()%skilllv ); - static const int per[10][2]={{20,50},{50,60},{25,75},{60,64},{34,67}, - {34,67},{34,67},{34,67},{34,67},{34,67}}; - int rnd = rand()%100; - if(rnd<per[skilllv-1][0]) - { - heal_target = &hd->bl; - }else if(rnd<per[skilllv-1][1]) - { - if(!status_isdead(&hd->master->bl)) - heal_target = &hd->master->bl; - else - heal_target = &hd->bl; - }else{//MOB - heal_target = map_id2bl(hd->target_id); - if(heal_target==NULL) - heal_target = &hd->bl; - } - clif_skill_nodamage(src,heal_target,AL_HEAL,heal,1); - clif_skill_nodamage(src,heal_target,skillid,heal,1); - status_heal(heal_target, heal, 0, 0); + static const int per[10][2]={{20,50},{50,60},{25,75},{60,64},{34,67}, + {34,67},{34,67},{34,67},{34,67},{34,67}}; + int rnd = rand()%100; + if(rnd<per[skilllv-1][0]) //Self + bl = src; + else if(rnd<per[skilllv-1][1]) //Master + bl = battle_get_master(src); + else //Enemy + bl = map_id2bl(battle_gettarget(src)); + + if (!bl) bl = src; + i = skill_calc_heal( src, 1+rand()%skilllv); + //Eh? why double skill packet? + clif_skill_nodamage(src,bl,AL_HEAL,i,1); + clif_skill_nodamage(src,bl,skillid,i,1); + status_heal(bl, i, 0, 0); + if (hd) skill_blockmerc_start(hd, skillid, skill_get_time2(skillid,skilllv)) ; - } - } - break; - case HAMI_BLOODLUST: //[orn] - case HFLI_FLEET: //[orn] - case HFLI_SPEED: //[orn] - if ( hd ) { - clif_skill_nodamage(src,bl,skillid,skilllv, - sc_start(&hd->bl,type,100,skilllv,skill_get_time(skillid,skilllv))) ; - skill_blockmerc_start(hd, skillid, skill_get_time2(skillid,skilllv)) ; } - else - clif_skill_fail(hd->master,skillid,0,0); break; - case HLIF_CHANGE: //[orn] + //Homun single-target support skills [orn] + case HAMI_BLOODLUST: + case HFLI_FLEET: + case HFLI_SPEED: + case HLIF_CHANGE: clif_skill_nodamage(src,bl,skillid,skilllv, sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv))); if (hd) skill_blockmerc_start(hd, skillid, skill_get_time2(skillid,skilllv)); break; - default: ShowWarning("skill_castend_nodamage_id: Unknown skill used:%d\n",skillid); map_freeblock_unlock(); diff --git a/src/map/status.c b/src/map/status.c index ec18d8569..71fc5dc62 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3587,9 +3587,6 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change * if(sc->data[SC_STAR_COMFORT].timer!=-1) max = sc->data[SC_STAR_COMFORT].val2; - if(sc->data[SC_MADNESSCANCEL].timer!=-1 && max < 200) - max = 200; - if(sc->data[SC_TWOHANDQUICKEN].timer!=-1 && max < sc->data[SC_TWOHANDQUICKEN].val2) max = sc->data[SC_TWOHANDQUICKEN].val2; @@ -3639,8 +3636,11 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change * } aspd_rate -= max; + //These stack with the rest of bonuses. if(sc->data[SC_BERSERK].timer!=-1) - aspd_rate -= 300; //Stacks with the rest of bonuses. + aspd_rate -= 300; + else if(sc->data[SC_MADNESSCANCEL].timer!=-1) + aspd_rate -= 200; } if(sc->data[i=SC_ASPDPOTION3].timer!=-1 || sc->data[i=SC_ASPDPOTION2].timer!=-1 || |