@@ -2527,6 +2527,7 @@ int pc_disguise(struct map_session_data *sd, int class_)
* @param battle_flag: Battle flag
* @param card_id: Used to prevent card stacking
* @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
* &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) {
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
return;
it.rate = cap_value(it.rate + rate, -10000, 10000);
@@ -4463,15 +4464,15 @@ 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.
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;
case SP_AUTOSPELL_WHENHIT: // bonus3 bAutoSpellWhenHit,sk,y,n;
if(sd->state.lr_flag != 2)
{
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));
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;
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){
case SP_AUTOSPELL: // bonus4 bAutoSpell,sk,y,n,i;
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;
case SP_AUTOSPELL_WHENHIT: // bonus4 bAutoSpellWhenHit,sk,y,n,i;
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;
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.
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;
@@ -4672,17 +4673,17 @@ void pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type
switch(type){
case SP_AUTOSPELL: // bonus5 bAutoSpell,sk,y,n,bf,i;
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;
case SP_AUTOSPELL_WHENHIT: // bonus5 bAutoSpellWhenHit,sk,y,n,bf,i;
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;
case SP_AUTOSPELL_ONSKILL: // bonus5 bAutoSpellOnSkill,sk,x,y,n,i;
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;
case SP_ADDEFF_ONSKILL: // bonus5 bAddEffOnSkill,sk,eff,n,y,t;
22c7f39There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test this latest commit, but this script still back to the caster:
bonus3 bAutoSpell,"MG_COLDBOLT",1,1000;
bonus3 bAutoSpell,"MG_FIREBOLT",1,1000;
bonus3 bAutoSpell,"MG_LIGHTNINGBOLT",1,1000;
22c7f39There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Anjuts please open issue with detailed how to reproduce, and full script of the item from item id.
Edit:
issue comfirm, i just open new issue #6346