Mikado Posted April 15, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 26 Reputation: 2 Joined: 11/08/12 Last Seen: March 22 Share Posted April 15, 2013 (edited) Hi all. I need to add a status change everytime a player is hit by a skill or a normal attack (that doesn't miss and does actual damage, even if it's bypassed through devotion). Under which function should I start this status change? Thanks in advance. Edited April 15, 2013 by Mikado Quote Link to comment Share on other sites More sharing options...
Jhedzkie Posted April 15, 2013 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 298 Reputation: 15 Joined: 11/17/11 Last Seen: February 18 Share Posted April 15, 2013 (edited) i think you can put it after every attack. battle.c struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,uint16 skill_id,uint16 skill_lv,int count) { struct Damage d; switch(attack_type) { case BF_WEAPON: d = battle_calc_weapon_attack(bl,target,skill_id,skill_lv,count); break; case BF_MAGIC: d = battle_calc_magic_attack(bl,target,skill_id,skill_lv,count); break; case BF_MISC: d = battle_calc_misc_attack(bl,target,skill_id,skill_lv,count); break; default: ShowError("battle_calc_attack: unknown attack type! %d\n",attack_type); memset(&d,0,sizeof(d)); break; } if( d.damage + d.damage2 < 1 ) { //Miss/Absorbed //Weapon attacks should go through to cause additional effects. if (d.dmg_lv == ATK_DEF /*&& attack_type&(BF_MAGIC|BF_MISC)*/) // Isn't it that additional effects don't apply if miss? d.dmg_lv = ATK_MISS; d.dmotion = 0; } else // Some skills like Weaponry Research will cause damage even if attack is dodged d.dmg_lv = ATK_DEF; // ->>> maybe put it here? return d; } just a thought tho. not so sure about it. Edited April 16, 2013 by Jhedzkie Quote Link to comment Share on other sites More sharing options...
Lighta Posted April 16, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted April 16, 2013 if you want to add a status to a attack that go trought put it in skill_additional_effet, this would be trigger only if dmg>0. But your starting condition is quite big not sure that really what you wanna do. Quote Link to comment Share on other sites More sharing options...
Mikado Posted April 16, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 26 Reputation: 2 Joined: 11/08/12 Last Seen: March 22 Author Share Posted April 16, 2013 @Jhedzkie: I put it in the else statement and it worked as I intended, thank you. Quote Link to comment Share on other sites More sharing options...
Question
Mikado
Hi all.
I need to add a status change everytime a player is hit by a skill or a normal attack (that doesn't miss and does actual damage, even if it's bypassed through devotion). Under which function should I start this status change?
Thanks in advance.
Edited by MikadoLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.