|
@@ -2527,6 +2527,7 @@ int pc_disguise(struct map_session_data *sd, int class_)
|
|
* @param battle_flag: Battle flag
|
|
* @param battle_flag: Battle flag
|
|
* @param card_id: Used to prevent card stacking
|
|
* @param card_id: Used to prevent card stacking
|
|
* @param flag: Flags used for extra arguments
|
|
* @param flag: Flags used for extra arguments
|
|
|
|
+ * &0: forces the skill to be casted on self, rather than on the target
|
|
* &1: forces the skill to be casted on target, rather than self
|
|
* &1: forces the skill to be casted on target, rather than self
|
|
* &2: random skill level in [1..lv] is chosen
|
|
* &2: random skill level in [1..lv] is chosen
|
|
*/
|
|
*/
|
|
@@ -2552,7 +2553,7 @@ static void pc_bonus_autospell(std::vector<s_autospell> &spell, uint16 id, uint1
|
|
}
|
|
}
|
|
|
|
|
|
for (auto &it : spell) {
|
|
for (auto &it : spell) {
|
|
- if ((it.card_id == card_id || it.rate < 0 || rate < 0) && it.id == id && it.lv == lv && it.flag == battle_flag) {
|
|
|
|
|
|
+ if ((it.card_id == card_id || it.rate < 0 || rate < 0) && it.id == id && it.lv == lv && it.battle_flag == battle_flag && it.flag == flag) {
|
|
if (!battle_config.autospell_stacking && it.rate > 0 && rate > 0) // Stacking disabled
|
|
if (!battle_config.autospell_stacking && it.rate > 0 && rate > 0) // Stacking disabled
|
|
return;
|
|
return;
|
|
it.rate = cap_value(it.rate + rate, -10000, 10000);
|
|
it.rate = cap_value(it.rate + rate, -10000, 10000);
|
|
@@ -4463,7 +4464,7 @@ void pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
|
|
{
|
|
{
|
|
int target = skill_get_inf(type2); //Support or Self (non-auto-target) skills should pick self.
|
|
int target = skill_get_inf(type2); //Support or Self (non-auto-target) skills should pick self.
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type2, INF2_NOTARGETSELF));
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type2, INF2_NOTARGETSELF));
|
|
- pc_bonus_autospell(sd->autospell, type2, type3, val, 0, current_equip_card_id, target ? 1 : 0);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell, type2, type3, val, 0, current_equip_card_id, target ? AUTOSPELL_FORCE_TARGET : AUTOSPELL_FORCE_SELF);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case SP_AUTOSPELL_WHENHIT: // bonus3 bAutoSpellWhenHit,sk,y,n;
|
|
case SP_AUTOSPELL_WHENHIT: // bonus3 bAutoSpellWhenHit,sk,y,n;
|
|
@@ -4471,7 +4472,7 @@ void pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
|
|
{
|
|
{
|
|
int target = skill_get_inf(type2); //Support or Self (non-auto-target) skills should pick self.
|
|
int target = skill_get_inf(type2); //Support or Self (non-auto-target) skills should pick self.
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type2, INF2_NOTARGETSELF));
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type2, INF2_NOTARGETSELF));
|
|
- pc_bonus_autospell(sd->autospell2, type2, type3, val, BF_NORMAL|BF_SKILL, current_equip_card_id, target ? 1 : 0);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell2, type2, type3, val, BF_NORMAL|BF_SKILL, current_equip_card_id, target ? AUTOSPELL_FORCE_TARGET : AUTOSPELL_FORCE_SELF);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case SP_ADD_MONSTER_DROP_ITEMGROUP: // bonus3 bAddMonsterDropItemGroup,ig,r,n;
|
|
case SP_ADD_MONSTER_DROP_ITEMGROUP: // bonus3 bAddMonsterDropItemGroup,ig,r,n;
|
|
@@ -4589,12 +4590,12 @@ void pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type
|
|
switch(type){
|
|
switch(type){
|
|
case SP_AUTOSPELL: // bonus4 bAutoSpell,sk,y,n,i;
|
|
case SP_AUTOSPELL: // bonus4 bAutoSpell,sk,y,n,i;
|
|
if(sd->state.lr_flag != 2)
|
|
if(sd->state.lr_flag != 2)
|
|
- pc_bonus_autospell(sd->autospell, type2, type3, type4, 0, current_equip_card_id, val);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell, type2, type3, type4, 0, current_equip_card_id, val & AUTOSPELL_FORCE_ALL);
|
|
break;
|
|
break;
|
|
|
|
|
|
case SP_AUTOSPELL_WHENHIT: // bonus4 bAutoSpellWhenHit,sk,y,n,i;
|
|
case SP_AUTOSPELL_WHENHIT: // bonus4 bAutoSpellWhenHit,sk,y,n,i;
|
|
if(sd->state.lr_flag != 2)
|
|
if(sd->state.lr_flag != 2)
|
|
- pc_bonus_autospell(sd->autospell2, type2, type3, type4, BF_NORMAL|BF_SKILL, current_equip_card_id, val);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell2, type2, type3, type4, BF_NORMAL|BF_SKILL, current_equip_card_id, val & AUTOSPELL_FORCE_ALL);
|
|
break;
|
|
break;
|
|
|
|
|
|
case SP_AUTOSPELL_ONSKILL: // bonus4 bAutoSpellOnSkill,sk,x,y,n;
|
|
case SP_AUTOSPELL_ONSKILL: // bonus4 bAutoSpellOnSkill,sk,x,y,n;
|
|
@@ -4603,7 +4604,7 @@ void pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type
|
|
int target = skill_get_inf(type3); //Support or Self (non-auto-target) skills should pick self.
|
|
int target = skill_get_inf(type3); //Support or Self (non-auto-target) skills should pick self.
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type3, INF2_NOTARGETSELF));
|
|
target = target&INF_SUPPORT_SKILL || (target&INF_SELF_SKILL && !skill_get_inf2(type3, INF2_NOTARGETSELF));
|
|
|
|
|
|
- pc_bonus_autospell_onskill(sd->autospell3, type2, type3, type4, val, current_equip_card_id, target ? 1 : 0);
|
|
|
|
|
|
+ pc_bonus_autospell_onskill(sd->autospell3, type2, type3, type4, val, current_equip_card_id, target ? AUTOSPELL_FORCE_TARGET : AUTOSPELL_FORCE_SELF);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -4672,17 +4673,17 @@ void pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type
|
|
switch(type){
|
|
switch(type){
|
|
case SP_AUTOSPELL: // bonus5 bAutoSpell,sk,y,n,bf,i;
|
|
case SP_AUTOSPELL: // bonus5 bAutoSpell,sk,y,n,bf,i;
|
|
if(sd->state.lr_flag != 2)
|
|
if(sd->state.lr_flag != 2)
|
|
- pc_bonus_autospell(sd->autospell, type2, type3, type4, type5, current_equip_card_id, val);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell, type2, type3, type4, type5, current_equip_card_id, val & AUTOSPELL_FORCE_ALL);
|
|
break;
|
|
break;
|
|
|
|
|
|
case SP_AUTOSPELL_WHENHIT: // bonus5 bAutoSpellWhenHit,sk,y,n,bf,i;
|
|
case SP_AUTOSPELL_WHENHIT: // bonus5 bAutoSpellWhenHit,sk,y,n,bf,i;
|
|
if(sd->state.lr_flag != 2)
|
|
if(sd->state.lr_flag != 2)
|
|
- pc_bonus_autospell(sd->autospell2, type2, type3, type4, type5, current_equip_card_id, val);
|
|
|
|
|
|
+ pc_bonus_autospell(sd->autospell2, type2, type3, type4, type5, current_equip_card_id, val & AUTOSPELL_FORCE_ALL);
|
|
break;
|
|
break;
|
|
|
|
|
|
case SP_AUTOSPELL_ONSKILL: // bonus5 bAutoSpellOnSkill,sk,x,y,n,i;
|
|
case SP_AUTOSPELL_ONSKILL: // bonus5 bAutoSpellOnSkill,sk,x,y,n,i;
|
|
if(sd->state.lr_flag != 2)
|
|
if(sd->state.lr_flag != 2)
|
|
- pc_bonus_autospell_onskill(sd->autospell3, type2, type3, type4, type5, current_equip_card_id, val);
|
|
|
|
|
|
+ pc_bonus_autospell_onskill(sd->autospell3, type2, type3, type4, type5, current_equip_card_id, val & AUTOSPELL_FORCE_ALL);
|
|
break;
|
|
break;
|
|
|
|
|
|
case SP_ADDEFF_ONSKILL: // bonus5 bAddEffOnSkill,sk,eff,n,y,t;
|
|
case SP_ADDEFF_ONSKILL: // bonus5 bAddEffOnSkill,sk,eff,n,y,t;
|