Follow up 43068e1777d4b75baa3f36e1c5ff13ca5289e0f4:
* Eff_Crystalize on Sropho_Card (4522) has defined duration. * Bonus added: * `bonus4 bAddEff,eff,n,y,t;` * Adds a n/100% chance to cause status eff for t milliseconds on the target when attacking * Just like `bonus3 bAddEff,eff,n,y;` but with user-defined duration; * `bonus4 bAddEffWhenHit,eff,n,y,t;` * Adds a n/100% chance to cause status eff for t milliseconds on the target when being hit by physical damage * Just like `bonus3 bAddEffWhenHit,eff,n,y;` but with user-defined duration; * bonus5 bAddEffOnSkill,sk,eff,n,y,t; * Adds a n/100% chance to cause status eff for t milliseconds on the target when using skill sk * Just like `bonus4 bAddEffOnSkill,sk,eff,n,y;` but with user-defined duration; Signed-off-by: Cydh Ramdh <cydh@pservero.com>
This commit is contained in:
parent
8701b9b09d
commit
997836897f
@ -2626,7 +2626,7 @@
|
||||
4519,Butoijo_Card,Butoijo Card,6,20,,10,,,,,,,,2,,,,,{ bonus2 bAddRace,RC_Angel,20; },{},{}
|
||||
4520,Leak_Card,Leak Card,6,20,,10,,,,,,,,4,,,,,{ bonus bStr,3; bonus2 bAddEff,Eff_Confusion,5000; bonus3 bAddEff,Eff_Confusion,5000,ATF_SKILL; },{},{}
|
||||
4521,Sedora_Card,Sedora Card,6,20,,10,,,,,,,,2,,,,,{ bonus bCritAtkRate,15; },{},{}
|
||||
4522,Sropho_Card,Sropho Card,6,20,,10,,,,,,,,2,,,,,{ bonus3 bAddEff,Eff_Crystalize,500,ATF_SHORT; },{},{}
|
||||
4522,Sropho_Card,Sropho Card,6,20,,10,,,,,,,,2,,,,,{ bonus4 bAddEff,Eff_Crystalize,500,ATF_SHORT,3000; },{},{}
|
||||
4523,Pot_Dofle_Card,Pot Dofle Card,6,20,,10,,,,,,,,16,,,,,{ bonus bDefEle,Ele_Water; bonus2 bSubRace,RC_Fish,10; },{},{}
|
||||
4524,King_Dramoh_Card,King Dramoh Card,6,20,,10,,,,,,,,769,,,,,{ bonus bStr,2; if(BaseClass==Job_Swordman){ bonus bStr,2+(getrefine()/3); } },{},{}
|
||||
4525,Kraken_Card,Kraken Card,6,20,,10,,,,,,,,4,,,,,{ bonus bFlee,10; skill "TF_HIDING",1; skill "RG_RAID",1; bonus5 bAutoSpellOnSkill,"RG_RAID","NPC_WIDEBLEEDING",1,250,1; },{},{ sc_end SC_HIDING; }
|
||||
|
@ -14,7 +14,8 @@ This list contains all available constants referenced in the 'bonus' commands.
|
||||
|
||||
* Status effect (eff)
|
||||
Eff_Stone, Eff_Freeze, Eff_Stun, Eff_Sleep, Eff_Poison, Eff_Curse, Eff_Silence,
|
||||
Eff_Confusion, Eff_Blind, Eff_Bleeding, Eff_DPoison, Eff_Fear, Eff_Burning
|
||||
Eff_Confusion, Eff_Blind, Eff_Bleeding, Eff_DPoison, Eff_Fear, Eff_Burning,
|
||||
Eff_Crystalize
|
||||
|
||||
* Element (e)
|
||||
Ele_Neutral, Ele_Water, Ele_Earth, Ele_Fire, Ele_Wind, Ele_Poison,
|
||||
@ -275,15 +276,24 @@ bonus2 bAddEffWhenHit,eff,n; Adds a n/100% chance to cause status eff on the en
|
||||
bonus2 bResEff,eff,n; Adds a n/100% tolerance to status eff
|
||||
|
||||
bonus3 bAddEff,eff,n,y; Adds a n/100% chance to cause status eff on the target when attacking
|
||||
bonus3 bAddEffWhenHit,eff,n,y; Adds a n/100% chance to cause status eff on the enemy when being hit by physical damage
|
||||
bonus4 bAddEff,eff,n,y,t; Adds a n/100% chance to cause status eff for t milliseconds on the target when attacking
|
||||
bonus3 bAddEffWhenHit,eff,n,y; Adds a n/100% chance to cause status eff on the target when being hit by physical damage
|
||||
bonus4 bAddEffWhenHit,eff,n,y,t; Adds a n/100% chance to cause status eff for t milliseconds on the target when being hit by physical damage
|
||||
y is the trigger criteria:
|
||||
Effect target: (Default: Attacked target)
|
||||
ATF_SELF = trigger effect on self
|
||||
ATF_TARGET = trigger effect on target (default)
|
||||
ATF_TARGET = trigger effect on target
|
||||
Attack range criteria: (Default: All attacks)
|
||||
ATF_SHORT = trigger on melee attacks
|
||||
ATF_LONG = trigger on ranged attacks (default: trigger on all attacks)
|
||||
ATF_LONG = trigger on ranged attacks
|
||||
Skill/attack type criteria: (Default: Physical/weapon)
|
||||
ATF_WEAPON = trigger on weapon skill / physical attacks
|
||||
ATF_MAGIC = trigger on magic skills
|
||||
ATF_MISC = trigger on misc skills
|
||||
|
||||
bonus3 bAddEffOnSkill,sk,eff,n; Adds a n/100% chance to cause status eff on enemy when using skill sk
|
||||
bonus4 bAddEffOnSkill,sk,eff,n,y; Adds a n/100% chance to cause status eff when using skill sk
|
||||
bonus4 bAddEffOnSkill,sk,eff,n,y; Adds a n/100% chance to cause status eff on the target when using skill sk
|
||||
bonus5 bAddEffOnSkill,sk,eff,n,y,t; Adds a n/100% chance to cause status eff for t milliseconds on the target when using skill sk
|
||||
y is the trigger criteria:
|
||||
ATF_SELF = trigger effect on self
|
||||
ATF_TARGET = trigger effect on target
|
||||
|
@ -2657,7 +2657,7 @@ REPLACE INTO `item_db_re` VALUES (4518,'Banaspaty_Card','Banaspaty Card',6,20,NU
|
||||
REPLACE INTO `item_db_re` VALUES (4519,'Butoijo_Card','Butoijo Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'bonus2 bAddRace,RC_Angel,20;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4520,'Leak_Card','Leak Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,NULL,NULL,NULL,'bonus bStr,3; bonus2 bAddEff,Eff_Confusion,5000; bonus3 bAddEff,Eff_Confusion,5000,ATF_SKILL;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4521,'Sedora_Card','Sedora Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'bonus bCritAtkRate,15;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4522,'Sropho_Card','Sropho Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'bonus3 bAddEff,Eff_Crystalize,500,ATF_SHORT;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4522,'Sropho_Card','Sropho Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,'bonus4 bAddEff,Eff_Crystalize,500,ATF_SHORT,3000;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4523,'Pot_Dofle_Card','Pot Dofle Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,16,NULL,NULL,NULL,NULL,'bonus bDefEle,Ele_Water; bonus2 bSubRace,RC_Fish,10;',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4524,'King_Dramoh_Card','King Dramoh Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,769,NULL,NULL,NULL,NULL,'bonus bStr,2; if(BaseClass==Job_Swordman){ bonus bStr,2+(getrefine()/3); }',NULL,NULL);
|
||||
REPLACE INTO `item_db_re` VALUES (4525,'Kraken_Card','Kraken Card',6,20,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,NULL,NULL,NULL,'bonus bFlee,10; skill "TF_HIDING",1; skill "RG_RAID",1; bonus5 bAutoSpellOnSkill,"RG_RAID","NPC_WIDEBLEEDING",1,250,1;',NULL,'sc_end SC_HIDING;');
|
||||
|
@ -394,13 +394,13 @@ enum mob_ai {
|
||||
};
|
||||
|
||||
enum auto_trigger_flag {
|
||||
ATF_SELF=0x01,
|
||||
ATF_TARGET=0x02,
|
||||
ATF_SHORT=0x04,
|
||||
ATF_LONG=0x08,
|
||||
ATF_WEAPON=0x10,
|
||||
ATF_MAGIC=0x20,
|
||||
ATF_MISC=0x40,
|
||||
ATF_SELF = 0x01,
|
||||
ATF_TARGET = 0x02,
|
||||
ATF_SHORT = 0x04,
|
||||
ATF_LONG = 0x08,
|
||||
ATF_WEAPON = 0x10,
|
||||
ATF_MAGIC = 0x20,
|
||||
ATF_MISC = 0x40,
|
||||
};
|
||||
|
||||
struct block_list {
|
||||
|
125
src/map/pc.c
125
src/map/pc.c
@ -1984,6 +1984,8 @@ int pc_disguise(struct map_session_data *sd, int class_)
|
||||
#define PC_BONUS_CHK_CLASS(cl,bonus) { if (!CHK_CLASS((cl))) { PC_BONUS_SHOW_ERROR((bonus),Class,(cl)); }}
|
||||
/// Check for valid Size, break & show error message if invalid Size
|
||||
#define PC_BONUS_CHK_SIZE(sz,bonus) { if (!CHK_MOBSIZE((sz))) { PC_BONUS_SHOW_ERROR((bonus),Size,(sz)); }}
|
||||
/// Check for valid SC, break & show error message if invalid SC
|
||||
#define PC_BONUS_CHK_SC(sc,bonus) { if ((sc) <= SC_NONE || (sc) >= SC_MAX) { PC_BONUS_SHOW_ERROR((bonus),Effect,(sc)); }}
|
||||
|
||||
static void pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, short rate, short flag, unsigned short card_id)
|
||||
{
|
||||
@ -2046,21 +2048,35 @@ static void pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short
|
||||
return;
|
||||
}
|
||||
|
||||
static void pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id, short rate, short arrow_rate, unsigned char flag)
|
||||
/**
|
||||
* Add inflict effect bonus for player while attacking/atatcked
|
||||
* @param effect Effect array
|
||||
* @param max Max array
|
||||
* @param sc SC/Effect type
|
||||
* @param rate Success chance
|
||||
* @param arrow_rate success chance if bonus comes from arrow-type item
|
||||
* @param flag Target flag
|
||||
* @param duration Duration. If 0 use default duration lookup for associated skill with level 7
|
||||
**/
|
||||
static void pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type sc, short rate, short arrow_rate, unsigned char flag, unsigned int duration)
|
||||
{
|
||||
uint16 i;
|
||||
|
||||
if (!(flag&(ATF_SHORT|ATF_LONG)))
|
||||
flag|=ATF_SHORT|ATF_LONG; //Default range: both
|
||||
flag |= ATF_SHORT|ATF_LONG; //Default range: both
|
||||
if (!(flag&(ATF_TARGET|ATF_SELF)))
|
||||
flag|=ATF_TARGET; //Default target: enemy.
|
||||
flag |= ATF_TARGET; //Default target: enemy.
|
||||
if (!(flag&(ATF_WEAPON|ATF_MAGIC|ATF_MISC)))
|
||||
flag|=ATF_WEAPON; //Default type: weapon.
|
||||
flag |= ATF_WEAPON; //Default type: weapon.
|
||||
|
||||
if (!duration)
|
||||
duration = skill_get_time2(status_sc2skill(sc),7);
|
||||
|
||||
for (i = 0; i < max && effect[i].flag; i++) {
|
||||
if (effect[i].id == id && effect[i].flag == flag)
|
||||
{
|
||||
if (effect[i].sc == sc && effect[i].flag == flag) {
|
||||
effect[i].rate += rate;
|
||||
effect[i].arrow_rate += arrow_rate;
|
||||
effect[i].duration = max(effect[i].duration, duration);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2068,20 +2084,33 @@ static void pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id
|
||||
ShowWarning("pc_bonus_addeff: Reached max (%d) number of add effects per character!\n", max);
|
||||
return;
|
||||
}
|
||||
effect[i].id = id;
|
||||
effect[i].sc = sc;
|
||||
effect[i].rate = rate;
|
||||
effect[i].arrow_rate = arrow_rate;
|
||||
effect[i].flag = flag;
|
||||
effect[i].duration = duration;
|
||||
}
|
||||
|
||||
static void pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_type id, short rate, short skill, unsigned char target)
|
||||
/**
|
||||
* Add inflict effect bonus for player while attacking using skill
|
||||
* @param effect Effect array
|
||||
* @param max Max array
|
||||
* @param sc SC/Effect type
|
||||
* @param rate Success chance
|
||||
* @param flag Target flag
|
||||
* @param duration Duration. If 0 use default duration lookup for associated skill with level 7
|
||||
**/
|
||||
static void pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_type sc, short rate, short skill_id, unsigned char target, unsigned int duration)
|
||||
{
|
||||
uint8 i;
|
||||
for( i = 0; i < max && effect[i].skill; i++ )
|
||||
{
|
||||
if( effect[i].id == id && effect[i].skill == skill && effect[i].target == target )
|
||||
{
|
||||
|
||||
if (!duration)
|
||||
duration = skill_get_time2(status_sc2skill(sc),7);
|
||||
|
||||
for( i = 0; i < max && effect[i].skill_id; i++ ) {
|
||||
if( effect[i].sc == sc && effect[i].skill_id == skill_id && effect[i].target == target ) {
|
||||
effect[i].rate += rate;
|
||||
effect[i].duration = max(effect[i].duration, duration);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2089,10 +2118,11 @@ static void pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max,
|
||||
ShowWarning("pc_bonus_addeff_onskill: Reached max (%d) number of add effects on skill per character!\n", max);
|
||||
return;
|
||||
}
|
||||
effect[i].id = id;
|
||||
effect[i].sc = sc;
|
||||
effect[i].rate = rate;
|
||||
effect[i].skill = skill;
|
||||
effect[i].skill_id = skill_id;
|
||||
effect[i].target = target;
|
||||
effect[i].duration = duration;
|
||||
}
|
||||
|
||||
/** Adjust/add drop rate modifier for player
|
||||
@ -3071,20 +3101,14 @@ void pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
||||
sd->subclass[type2]+=val;
|
||||
break;
|
||||
case SP_ADDEFF: // bonus2 bAddEff,eff,n;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus2: SP_ADDEFF: %d invalid effect.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF);
|
||||
pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), (sc_type)type2,
|
||||
sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, 0);
|
||||
sd->state.lr_flag != 2 ? val : 0, sd->state.lr_flag == 2 ? val : 0, 0, 0);
|
||||
break;
|
||||
case SP_ADDEFF2: // bonus2 bAddEff2,eff,n;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus2: SP_ADDEFF2: %d is invalid effect.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF2);
|
||||
pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), (sc_type)type2,
|
||||
sd->state.lr_flag!=2?val:0, sd->state.lr_flag==2?val:0, ATF_SELF);
|
||||
sd->state.lr_flag != 2 ? val : 0, sd->state.lr_flag == 2 ? val : 0, ATF_SELF, 0);
|
||||
break;
|
||||
case SP_RESEFF: // bonus2 bResEff,eff,n;
|
||||
if (type2 < SC_COMMON_MIN || type2 > SC_COMMON_MAX) {
|
||||
@ -3270,12 +3294,9 @@ void pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
||||
sd->critaddrace[type2] += val*10;
|
||||
break;
|
||||
case SP_ADDEFF_WHENHIT: // bonus2 bAddEffWhenHit,eff,n;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus2: SP_ADDEFF_WHENHIT: %d is invalid effect.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF_WHENHIT);
|
||||
if(sd->state.lr_flag != 2)
|
||||
pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), (sc_type)type2, val, 0, 0);
|
||||
pc_bonus_addeff(sd->addeff_atked, ARRAYLENGTH(sd->addeff_atked), (sc_type)type2, val, 0, 0, 0);
|
||||
break;
|
||||
case SP_SKILL_ATK: // bonus2 bSkillAtk,sk,n;
|
||||
if(sd->state.lr_flag == 2)
|
||||
@ -3702,30 +3723,21 @@ void pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
|
||||
break;
|
||||
|
||||
case SP_ADDEFF: // bonus3 bAddEff,eff,n,y;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus3: SP_ADDEFF: %d is not supported.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF);
|
||||
pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), (sc_type)type2,
|
||||
sd->state.lr_flag!=2?type3:0, sd->state.lr_flag==2?type3:0, val);
|
||||
sd->state.lr_flag != 2 ? type3 : 0, sd->state.lr_flag == 2 ? type3 : 0, val, 0);
|
||||
break;
|
||||
|
||||
case SP_ADDEFF_WHENHIT: // bonus3 bAddEffWhenHit,eff,n,y;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus3: SP_ADDEFF_WHENHIT: %d is not supported.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF_WHENHIT);
|
||||
if(sd->state.lr_flag != 2)
|
||||
pc_bonus_addeff(sd->addeff2, ARRAYLENGTH(sd->addeff2), (sc_type)type2, type3, 0, val);
|
||||
pc_bonus_addeff(sd->addeff_atked, ARRAYLENGTH(sd->addeff_atked), (sc_type)type2, type3, 0, val, 0);
|
||||
break;
|
||||
|
||||
case SP_ADDEFF_ONSKILL: // bonus3 bAddEffOnSkill,sk,eff,n;
|
||||
if (type3 <= SC_NONE || type3 >= SC_MAX) {
|
||||
ShowError("pc_bonus3: SP_ADDEFF_ONSKILL: %d is not supported.\n", type3);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type2,SP_ADDEFF_ONSKILL);
|
||||
if( sd->state.lr_flag != 2 )
|
||||
pc_bonus_addeff_onskill(sd->addeff3, ARRAYLENGTH(sd->addeff3), (sc_type)type3, val, type2, ATF_TARGET);
|
||||
pc_bonus_addeff_onskill(sd->addeff_onskill, ARRAYLENGTH(sd->addeff_onskill), (sc_type)type3, val, type2, ATF_TARGET, 0);
|
||||
break;
|
||||
|
||||
case SP_ADDELE: // bonus3 bAddEle,e,x,bf;
|
||||
@ -3795,13 +3807,22 @@ void pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type
|
||||
}
|
||||
break;
|
||||
|
||||
case SP_ADDEFF: // bonus4 bAddEff,eff,n,y,t;
|
||||
PC_BONUS_CHK_SC(type3,SP_ADDEFF);
|
||||
pc_bonus_addeff(sd->addeff, ARRAYLENGTH(sd->addeff), (sc_type)type2,
|
||||
sd->state.lr_flag != 2 ? type3 : 0, sd->state.lr_flag == 2 ? type3 : 0, type4, val);
|
||||
break;
|
||||
|
||||
case SP_ADDEFF_WHENHIT: // bonus4 bAddEffWhenHit,eff,n,y,t;
|
||||
PC_BONUS_CHK_SC(type3,SP_ADDEFF_WHENHIT);
|
||||
if (sd->state.lr_flag != 2)
|
||||
pc_bonus_addeff(sd->addeff_atked, ARRAYLENGTH(sd->addeff_atked), (sc_type)type2, type3, 0, 0, val);
|
||||
break;
|
||||
|
||||
case SP_ADDEFF_ONSKILL: // bonus4 bAddEffOnSkill,sk,eff,n,y;
|
||||
if (type2 <= SC_NONE || type2 >= SC_MAX) {
|
||||
ShowError("pc_bonus4: SP_ADDEFF_ONSKILL: %d is not supported.\n", type2);
|
||||
break;
|
||||
}
|
||||
PC_BONUS_CHK_SC(type3,SP_ADDEFF_ONSKILL);
|
||||
if( sd->state.lr_flag != 2 )
|
||||
pc_bonus_addeff_onskill(sd->addeff3, ARRAYLENGTH(sd->addeff3), (sc_type)type3, type4, type2, val);
|
||||
pc_bonus_addeff_onskill(sd->addeff_onskill, ARRAYLENGTH(sd->addeff_onskill), (sc_type)type3, type4, type2, val, 0);
|
||||
break;
|
||||
|
||||
case SP_SET_DEF_RACE: // bonus4 bSetDefRace,r,n,t,y;
|
||||
@ -3856,6 +3877,12 @@ void pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type
|
||||
if(sd->state.lr_flag != 2)
|
||||
pc_bonus_autospell_onskill(sd->autospell3, ARRAYLENGTH(sd->autospell3), type2, (val&1?-type3:type3), (val&2?-type4:type4), type5, current_equip_card_id);
|
||||
break;
|
||||
|
||||
case SP_ADDEFF_ONSKILL: // bonus5 bAddEffOnSkill,sk,eff,n,y,t;
|
||||
PC_BONUS_CHK_SC(type3,SP_ADDEFF_ONSKILL);
|
||||
if( sd->state.lr_flag != 2 )
|
||||
pc_bonus_addeff_onskill(sd->addeff_onskill, ARRAYLENGTH(sd->addeff_onskill), (sc_type)type3, type4, type2, type5, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
ShowWarning("pc_bonus5: unknown type %d %d %d %d %d %d!\n",type,type2,type3,type4,type5,val);
|
||||
|
22
src/map/pc.h
22
src/map/pc.h
@ -112,16 +112,22 @@ struct s_autospell {
|
||||
bool lock; // bAutoSpellOnSkill: blocks autospell from triggering again, while being executed
|
||||
};
|
||||
|
||||
/// AddEff and AddEff2 bonus struct
|
||||
struct s_addeffect {
|
||||
enum sc_type id;
|
||||
short rate, arrow_rate;
|
||||
unsigned char flag;
|
||||
enum sc_type sc; /// SC type/effect
|
||||
short rate, /// Rate
|
||||
arrow_rate; /// Arrow rate
|
||||
unsigned char flag; /// Flag
|
||||
unsigned int duration; /// Duration the effect applied
|
||||
};
|
||||
|
||||
/// AddEffOnSkill bonus struct
|
||||
struct s_addeffectonskill {
|
||||
enum sc_type id;
|
||||
short rate, skill;
|
||||
unsigned char target;
|
||||
enum sc_type sc; /// SC type/effect
|
||||
short rate, /// Rate
|
||||
skill_id; /// Skill ID
|
||||
unsigned char target; /// Target
|
||||
unsigned int duration; /// Duration the effect applied
|
||||
};
|
||||
|
||||
///Struct of add drop item/group rate
|
||||
@ -358,8 +364,8 @@ struct map_session_data {
|
||||
|
||||
// zeroed structures start here
|
||||
struct s_autospell autospell[MAX_PC_BONUS], autospell2[MAX_PC_BONUS], autospell3[MAX_PC_BONUS];
|
||||
struct s_addeffect addeff[MAX_PC_BONUS], addeff2[MAX_PC_BONUS];
|
||||
struct s_addeffectonskill addeff3[MAX_PC_BONUS];
|
||||
struct s_addeffect addeff[MAX_PC_BONUS], addeff_atked[MAX_PC_BONUS];
|
||||
struct s_addeffectonskill addeff_onskill[MAX_PC_BONUS];
|
||||
|
||||
struct s_skill_bonus { //skillatk raises bonus dmg% of skills, skillheal increases heal%, skillblown increases bonus blewcount for some skills.
|
||||
unsigned short id;
|
||||
|
@ -949,18 +949,21 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
||||
if( skill_id != WS_CARTTERMINATION && skill_id != AM_DEMONSTRATION && skill_id != CR_REFLECTSHIELD && skill_id != MS_REFLECTSHIELD && skill_id != ASC_BREAKER ) {
|
||||
// Trigger status effects
|
||||
enum sc_type type;
|
||||
int i;
|
||||
uint8 i;
|
||||
unsigned int time = 0;
|
||||
for( i = 0; i < ARRAYLENGTH(sd->addeff) && sd->addeff[i].flag; i++ ) {
|
||||
rate = sd->addeff[i].rate;
|
||||
if( attack_type&BF_LONG ) // Any ranged physical attack takes status arrows into account (Grimtooth...) [DracoRPG]
|
||||
rate += sd->addeff[i].arrow_rate;
|
||||
if( !rate ) continue;
|
||||
if( !rate )
|
||||
continue;
|
||||
|
||||
if( (sd->addeff[i].flag&(ATF_WEAPON|ATF_MAGIC|ATF_MISC)) != (ATF_WEAPON|ATF_MAGIC|ATF_MISC) ) {
|
||||
// Trigger has attack type consideration.
|
||||
if( (sd->addeff[i].flag&ATF_WEAPON && attack_type&BF_WEAPON) ||
|
||||
(sd->addeff[i].flag&ATF_MAGIC && attack_type&BF_MAGIC) ||
|
||||
(sd->addeff[i].flag&ATF_MISC && attack_type&BF_MISC) ) ;
|
||||
(sd->addeff[i].flag&ATF_MISC && attack_type&BF_MISC) )
|
||||
;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
@ -972,31 +975,32 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
||||
continue; //Range Failed.
|
||||
}
|
||||
|
||||
type = sd->addeff[i].id;
|
||||
skill = skill_get_time2(status_sc2skill(type),7);
|
||||
type = sd->addeff[i].sc;
|
||||
time = sd->addeff[i].duration;
|
||||
|
||||
if (sd->addeff[i].flag&ATF_TARGET)
|
||||
status_change_start(src,bl,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,skill,SCSTART_NONE);
|
||||
status_change_start(src,bl,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,time,SCSTART_NONE);
|
||||
|
||||
if (sd->addeff[i].flag&ATF_SELF)
|
||||
status_change_start(src,src,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,skill,SCSTART_NONE);
|
||||
status_change_start(src,src,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,time,SCSTART_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
if( skill_id ) {
|
||||
// Trigger status effects on skills
|
||||
enum sc_type type;
|
||||
int i;
|
||||
for( i = 0; i < ARRAYLENGTH(sd->addeff3) && sd->addeff3[i].skill; i++ ) {
|
||||
if( skill_id != sd->addeff3[i].skill || !sd->addeff3[i].rate )
|
||||
uint8 i;
|
||||
unsigned int time = 0;
|
||||
for( i = 0; i < ARRAYLENGTH(sd->addeff_onskill) && sd->addeff_onskill[i].skill_id; i++ ) {
|
||||
if( skill_id != sd->addeff_onskill[i].skill_id || !sd->addeff_onskill[i].rate )
|
||||
continue;
|
||||
type = sd->addeff3[i].id;
|
||||
skill = skill_get_time2(status_sc2skill(type),7);
|
||||
type = sd->addeff_onskill[i].sc;
|
||||
time = sd->addeff[i].duration;
|
||||
|
||||
if( sd->addeff3[i].target&ATF_TARGET )
|
||||
status_change_start(src,bl,type,sd->addeff3[i].rate,7,0,0,0,skill,SCSTART_NONE);
|
||||
if( sd->addeff3[i].target&ATF_SELF )
|
||||
status_change_start(src,src,type,sd->addeff3[i].rate,7,0,0,0,skill,SCSTART_NONE);
|
||||
if( sd->addeff_onskill[i].target&ATF_TARGET )
|
||||
status_change_start(src,bl,type,sd->addeff_onskill[i].rate,7,0,0,0,time,SCSTART_NONE);
|
||||
if( sd->addeff_onskill[i].target&ATF_SELF )
|
||||
status_change_start(src,src,type,sd->addeff_onskill[i].rate,7,0,0,0,time,SCSTART_NONE);
|
||||
}
|
||||
//"While the damage can be blocked by Pneuma, the chance to break armor remains", irowiki. [Cydh]
|
||||
if (dmg_lv == ATK_BLOCK && skill_id == AM_ACIDTERROR) {
|
||||
@ -2142,30 +2146,30 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
||||
sd = BL_CAST(BL_PC, src);
|
||||
dstsd = BL_CAST(BL_PC, bl);
|
||||
|
||||
if(dstsd && attack_type&BF_WEAPON)
|
||||
{ //Counter effects.
|
||||
if(dstsd && attack_type&BF_WEAPON) { //Counter effects.
|
||||
enum sc_type type;
|
||||
int i, time;
|
||||
for(i=0; i < ARRAYLENGTH(dstsd->addeff2) && dstsd->addeff2[i].flag; i++)
|
||||
{
|
||||
rate = dstsd->addeff2[i].rate;
|
||||
if (attack_type&BF_LONG)
|
||||
rate+=dstsd->addeff2[i].arrow_rate;
|
||||
if (!rate) continue;
|
||||
uint8 i;
|
||||
unsigned int time = 0;
|
||||
|
||||
if ((dstsd->addeff2[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
|
||||
{ //Trigger has range consideration.
|
||||
if((dstsd->addeff2[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
|
||||
(dstsd->addeff2[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
|
||||
for (i = 0; i < ARRAYLENGTH(dstsd->addeff_atked) && dstsd->addeff_atked[i].flag; i++) {
|
||||
rate = dstsd->addeff_atked[i].rate;
|
||||
if (attack_type&BF_LONG)
|
||||
rate += dstsd->addeff_atked[i].arrow_rate;
|
||||
if (!rate)
|
||||
continue;
|
||||
|
||||
if ((dstsd->addeff_atked[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT)) { //Trigger has range consideration.
|
||||
if((dstsd->addeff_atked[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
|
||||
(dstsd->addeff_atked[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
|
||||
continue; //Range Failed.
|
||||
}
|
||||
type = dstsd->addeff2[i].id;
|
||||
time = skill_get_time2(status_sc2skill(type),7);
|
||||
type = dstsd->addeff_atked[i].sc;
|
||||
time = dstsd->addeff_atked[i].duration;
|
||||
|
||||
if (dstsd->addeff2[i].flag&ATF_TARGET)
|
||||
if (dstsd->addeff_atked[i].flag&ATF_TARGET)
|
||||
status_change_start(src,src,type,rate,7,0,0,0,time,SCSTART_NONE);
|
||||
|
||||
if (dstsd->addeff2[i].flag&ATF_SELF && !status_isdead(bl))
|
||||
if (dstsd->addeff_atked[i].flag&ATF_SELF && !status_isdead(bl))
|
||||
status_change_start(src,bl,type,rate,7,0,0,0,time,SCSTART_NONE);
|
||||
}
|
||||
}
|
||||
|
@ -3087,8 +3087,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt)
|
||||
+ sizeof(sd->autospell2)
|
||||
+ sizeof(sd->autospell3)
|
||||
+ sizeof(sd->addeff)
|
||||
+ sizeof(sd->addeff2)
|
||||
+ sizeof(sd->addeff3)
|
||||
+ sizeof(sd->addeff_atked)
|
||||
+ sizeof(sd->addeff_onskill)
|
||||
+ sizeof(sd->skillatk)
|
||||
+ sizeof(sd->skillusesprate)
|
||||
+ sizeof(sd->skillusesp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user