diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-09 18:05:16 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-09 18:05:16 +0000 |
commit | 5ceaed4cf6a196d19b09b2628b0b117de495e448 (patch) | |
tree | d01fd9f12097ee18a94428a87afea676ee02cf52 /src | |
parent | a468d4bdc269495ee370449baa2f840fb5be47f9 (diff) | |
download | hercules-5ceaed4cf6a196d19b09b2628b0b117de495e448.tar.gz hercules-5ceaed4cf6a196d19b09b2628b0b117de495e448.tar.bz2 hercules-5ceaed4cf6a196d19b09b2628b0b117de495e448.tar.xz hercules-5ceaed4cf6a196d19b09b2628b0b117de495e448.zip |
- Modified bonus3 bAddEff/bAddEffWhenHit so that the last parameter is now passed directly as "trigger" flag. The possible trigger values are ATF_LONG, ATF_SHORT, ATF_TARGET, ATF_SELF. Explanation added to doc/item_bonus.txt
- Updated some cards to use the new format of bonus3 bAddEff*
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11157 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index c41c70425..dc69041eb 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1288,6 +1288,11 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor static int pc_bonus_addeff(struct s_addeffect* effect, int max, short id, short rate, short arrow_rate, unsigned char flag) { int i; + if (!(flag&(ATF_SHORT|ATF_LONG))) + flag|=ATF_SHORT|ATF_LONG; //Default range: both + if (!(flag&(ATF_TARGET|ATF_SELF))) + flag|=ATF_TARGET; //Default target: enemy. + for (i = 0; i < max && effect[i].flag; i++) { if (effect[i].id == id && effect[i].flag == flag) { @@ -1970,8 +1975,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) break; } pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), type2, - sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, - ATF_SHORT|ATF_LONG|ATF_TARGET); + sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, 0); break; case SP_ADDEFF2: if (type2 > SC_MAX) { @@ -1979,8 +1983,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) break; } pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), type2, - sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, - ATF_SHORT|ATF_LONG|ATF_SELF); + sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, 0); break; case SP_RESEFF: if (type2 < SC_COMMON_MIN || type2 > SC_COMMON_MAX) { @@ -2196,8 +2199,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) break; } if(sd->state.lr_flag != 2) - pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, val, 0, - ATF_SHORT|ATF_LONG|ATF_TARGET); + pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, val, 0, 0); break; case SP_ADDEFF_WHENHIT_SHORT: if (type2 > SC_MAX) { @@ -2205,8 +2207,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) break; } if(sd->state.lr_flag != 2) - pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, val, 0, - ATF_SHORT|ATF_TARGET); + pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, val, 0, ATF_SHORT); break; case SP_SKILL_ATK: if(sd->state.lr_flag == 2) @@ -2446,8 +2447,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val) break; } pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), type2, - sd->state.lr_flag!=2?type3:0, sd->state.lr_flag==2?type3:0, - ATF_SHORT|ATF_LONG|(val?ATF_TARGET:ATF_SELF)|(val==2?ATF_SELF:0)); + sd->state.lr_flag!=2?type3:0, sd->state.lr_flag==2?type3:0, val); break; case SP_ADDEFF_WHENHIT: @@ -2456,8 +2456,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val) break; } if(sd->state.lr_flag != 2) - pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, type3, 0, - ATF_SHORT|ATF_LONG|(val?ATF_TARGET:ATF_SELF)|(val==2?ATF_SELF:0)); + pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), type2, type3, 0, val); break; default: |