summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-17 15:43:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-17 15:43:40 +0000
commit94e745cce4166dea9b34b617cf66b14cfa1faab1 (patch)
treef7c86a380249e7eb197297026e211014a3a24bae /src/map/skill.c
parentd5afc60338c63c69ca26211131d98986b6b5ca82 (diff)
downloadhercules-94e745cce4166dea9b34b617cf66b14cfa1faab1.tar.gz
hercules-94e745cce4166dea9b34b617cf66b14cfa1faab1.tar.bz2
hercules-94e745cce4166dea9b34b617cf66b14cfa1faab1.tar.xz
hercules-94e745cce4166dea9b34b617cf66b14cfa1faab1.zip
- Expanded the autospell structure to hold a flag, which contains the required Battle Flag conditions required for a skill to trigger.
- Added the required constants to const.txt to specify the autospell trigger properties. - Added bonus5 bAutoSpell/bAutoSpellWhenHit. The new parameter is used to specify when the spell should trigger (melee/range + weapon/magic/misc attack), see item_bonus for details. - Applied use of packet 0x28a (clif_changeoption2) to transmit opt3 changes. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10278 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 74e254333..08e0f518a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1413,14 +1413,16 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
//Reports say that autospell effects get triggered on skills and pretty much everything including splash attacks. [Skotlex]
//But Gravity Patched this silently, and it now seems to trigger only on
//weapon attacks.
- if(sd && !status_isdead(bl) && src != bl && attack_type&BF_WEAPON
-// !(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE)
- ) {
+ if(sd && !status_isdead(bl) && src != bl && sd->autospell[0].id) {
struct block_list *tbl;
struct unit_data *ud;
int i, skilllv;
for (i = 0; i < MAX_PC_BONUS && sd->autospell[i].id; i++) {
+ if(!(sd->autospell[i].flag&attack_type&BF_RANGEMASK &&
+ sd->autospell[i].flag&attack_type&BF_WEAPONMASK))
+ continue; //Attack type or range type did not match.
+
skill = (sd->autospell[i].id > 0) ? sd->autospell[i].id : -sd->autospell[i].id;
if (skillnotok(skill, sd))
@@ -1582,7 +1584,8 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
}
//Trigger counter-spells to retaliate against damage causing skills. [Skotlex]
- if(dstsd && !status_isdead(bl) && src != bl && !(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE))
+ if(dstsd && !status_isdead(bl) && src != bl && dstsd->autospell2[0].id &&
+ !(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE))
{
struct block_list *tbl;
struct unit_data *ud;
@@ -1590,6 +1593,10 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
for (i = 0; i < MAX_PC_BONUS && dstsd->autospell2[i].id; i++) {
+ if(!(dstsd->autospell2[i].flag&attack_type&BF_RANGEMASK &&
+ dstsd->autospell2[i].flag&attack_type&BF_WEAPONMASK))
+ continue; //Attack type or range type did not match.
+
skillid = (dstsd->autospell2[i].id > 0) ? dstsd->autospell2[i].id : -dstsd->autospell2[i].id;
skilllv = dstsd->autospell2[i].lv?dstsd->autospell2[i].lv:1;
if (skilllv < 0) skilllv = 1+rand()%(-skilllv);