summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-01 18:18:32 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-01 18:18:32 +0000
commit7564712d7fc9d13890011fdd22215e9ff912e1a4 (patch)
tree029e50b1c4a0f231a784b8aae076926043dfb17a /src/map/skill.c
parenta6bc36f6d9a6bbf163554e9cf9523b43216c0c04 (diff)
downloadhercules-7564712d7fc9d13890011fdd22215e9ff912e1a4.tar.gz
hercules-7564712d7fc9d13890011fdd22215e9ff912e1a4.tar.bz2
hercules-7564712d7fc9d13890011fdd22215e9ff912e1a4.tar.xz
hercules-7564712d7fc9d13890011fdd22215e9ff912e1a4.zip
- Turn Undead and Offensive Resurrection should now work on undead players.
- Fixed the range checking of Repair weapon - Rude attacked is now also triggered when you hit a target that can't move out of their melee attack range. - Mob ai will attempt to do a long-range attacked condition skill before unlocking a target when it is attacked and said target is out of melee range of a non-walking mob. - Corrected mobskill event to set the target_id before triggering. - Moved MSC_SKILLUSED trigger to mobskill_event which is triggered in battle_calc_damage. It is also triggered on skill_castend_nodamage_id - Added party_share_loot for handling party-share loot. it should now work with autoloot as well. - Fixed skill_break_rate breaking stuff even if the rate is 0. - pc_stopwalking will not send a fixpos packet if you are sitting. - mob_can_reach rude-attacked condition now uses the mob's field of view. - SC_NOCHAT is automatically started on pc_authok if manner is negative. - Map server now refuses to start if you try to define a label with the same name as some const.txt defined character parameter. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5414 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c59
1 files changed, 25 insertions, 34 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index e29784924..07e6ea73b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1426,7 +1426,7 @@ int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int
if (where&where_list[i]) {
if (sc && sc->count && sc->data[scdef[i]].timer != -1)
where&=~where_list[i];
- else if (rand()%10000 > rate)
+ else if (rand()%10000 >= rate)
where&=~where_list[i];
else if (!sd) //Cause Strip effect.
status_change_start(bl,scatk[i],100,0,0,0,0,
@@ -1894,23 +1894,6 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
if (dmg.dmg_lv == ATK_DEF || damage > 0) //Counter status effects [Skotlex]
skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
- /* ƒ_ƒ??ƒW‚ª‚ ‚é‚È‚ç’ljÁ?‰Ê”»’è */
- if(!status_isdead(bl) && bl->type==BL_MOB && src!=bl) /* ƒXƒLƒ‹Žg—p?Œ‚ÌMOBƒXƒLƒ‹ */
- {
- struct mob_data *md=(struct mob_data *)bl;
-// nullpo_retr(0, md); //Just so you know.. these are useless. When you cast a pointer, the pointer still is the same, so if bl is not null, the after-casted pointer will never be nulll :/ [Skotlex]
- if(battle_config.mob_changetarget_byskill && sd)
- {
- int target ;
- target=md->target_id;
- md->target_id=src->id;
- mobskill_use(md,tick,MSC_SKILLUSED|(skillid<<16));
- md->target_id=target;
- }
- else
- mobskill_use(md,tick,MSC_SKILLUSED|(skillid<<16));
- }
-
if(sd && dmg.flag&BF_WEAPON && src != bl && src == dsrc && damage > 0) {
int hp = 0,sp = 0;
if(sd->right_weapon.hp_drain_rate && sd->right_weapon.hp_drain_per > 0 && dmg.damage > 0 && rand()%1000 < sd->right_weapon.hp_drain_rate) {
@@ -5655,6 +5638,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
return 1;
}
+ if (dstmd) //Mob skill event for no damage skills (damage ones are handled in battle_calc_damage) [Skotlex]
+ mobskill_event(dstmd, src, tick, MSC_SKILLUSED|(skillid<<16));
+
map_freeblock_unlock();
return 0;
}
@@ -8640,21 +8626,26 @@ int skill_use_id (struct map_session_data *sd, int target_id, int skill_num, int
else
clif_skillcasting(&sd->bl,sd->bl.id, target_id, 0,0, skill_num,casttime);
/* ‰r?¥”½?ƒ‚ƒ“ƒXƒ^? */
- if (bl->type == BL_MOB && (mode = status_get_mode(bl))&MD_CASTSENSOR && (md = (struct mob_data *)bl) &&
- (!md->special_state.ai || skill_get_inf(skill_num) != INF_SUPPORT_SKILL) //Avoid having summons target master from supportive skills. [Skotlex]
- ) {
- switch (md->state.skillstate) {
- case MSS_ANGRY:
- case MSS_RUSH:
- case MSS_FOLLOW:
- if (!(mode&(MD_AGGRESSIVE|MD_ANGRY)))
- break; //Only Aggressive mobs change target while chasing.
- case MSS_IDLE:
- case MSS_WALK:
- md->target_id = sd->bl.id;
- md->state.targettype = ATTACKABLE;
- md->state.aggressive = (mode&MD_ANGRY)?1:0;
- md->min_chase = md->db->range3;
+ if (bl->type == BL_MOB)
+ {
+ md = (struct mob_data *)bl;
+ mobskill_event(md, &sd->bl, tick, -1); //Cast targetted skill event.
+ if ((mode=status_get_mode(bl))&MD_CASTSENSOR &&
+ battle_check_target(bl, &sd->bl, BCT_ENEMY) > 0)
+ {
+ switch (md->state.skillstate) {
+ case MSS_ANGRY:
+ case MSS_RUSH:
+ case MSS_FOLLOW:
+ if (!(mode&(MD_AGGRESSIVE|MD_ANGRY)))
+ break; //Only Aggressive mobs change target while chasing.
+ case MSS_IDLE:
+ case MSS_WALK:
+ md->target_id = sd->bl.id;
+ md->state.targettype = ATTACKABLE;
+ md->state.aggressive = (mode&MD_ANGRY)?1:0;
+ md->min_chase = md->db->range3;
+ }
}
}
}
@@ -9038,7 +9029,7 @@ void skill_repairweapon(struct map_session_data *sd, int idx)
if(item->nameid <= 0 || item->attribute == 0)
return; //Again invalid item....
- if(sd!=target_sd && !battle_check_range(&sd->bl,&target_sd->bl,skill_get_range2(&sd->bl, sd->skillid,sd->skilllv))){
+ if(sd!=target_sd && !battle_check_range(&sd->bl,&target_sd->bl,skill_get_range2(&sd->bl, sd->menuskill_id,pc_checkskill(sd, sd->menuskill_id)))){
clif_item_repaireffect(sd,item->nameid,1);
return;
}