Function Resist Event, for auto skip casting
Posted: Sun May 14, 2017 5:51 pm
A new function to optimise and help the NPC resist analysis.
After npc debuffing, if a spell is resisted 2 times on this the script skip automatically the futur casting.
I have not done a full-scale test yet, so find the test capture doing in the guildhall.
I let you imagine a bite, this is the kind of function that I like. And for badass the main event part of script.
After npc debuffing, if a spell is resisted 2 times on this the script skip automatically the futur casting.
I have not done a full-scale test yet, so find the test capture doing in the guildhall.
I let you imagine a bite, this is the kind of function that I like. And for badass the main event part of script.
Code: Select all
#Event Resist_Auto_Ban "Your target resisted the #1# spell#*#"
Sub Event_Resist_Auto_Ban(line,SpellName)
/if (${Target.Type.NotEqual[NPC]}) /return FALSE
/declare ResistTargetName string local
/declare ResistSpellName string local
/declare ResistSpellState string local
| Make clean string Name
/call CleanString "${Target.Name}"
/varset ResistTargetName ${Macro.Return}
/call CleanString "${SpellName}"
/varset ResistSpellName ${Macro.Return}
| Only if target is Debuffed (SHM)
/if (${NetWorst.Request[radius300 pc shm101]}) {
/if (!${NPCDebuffList.Find[|${Target.Name}:${Target.ID}|]}) /return
}
| Init Resist Var
/if (!${Defined[Resist_${ResistSpellName}]}) /declare Resist_${ResistSpellName} string global
/if (!${Resist_${ResistSpellName}.Length}) {
| Init the first Spell Resist try
/varset Resist_${ResistSpellName} |${ResistTargetName}#1|
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "ResistSpell" "RESIST_${ResistSpellName}" "${Resist_${ResistSpellName}}"
/varset ResistSpellState 1
} else /if (!${Resist_${ResistSpellName}.Find[|${ResistTargetName}#]}) {
| Set the first Spell Resist try
/varset Resist_${ResistSpellName} ${Resist_${ResistSpellName}}${ResistTargetName}#1|
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "ResistSpell" "RESIST_${ResistSpellName}" "${Resist_${ResistSpellName}}"
/varset ResistSpellState 1
} else /if (!${Resist_${ResistSpellName}.Find[|${ResistTargetName}#1]}) {
| Set the second Spell Resist try
/call StringReplaceAll "Resist_${ResistSpellName}" "|${ResistTargetName}#1|" "|${ResistTargetName}#2|"
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "ResistSpell" "RESIST_${ResistSpellName}" "${Resist_${ResistSpellName}}"
/varset ResistSpellState 2
} else /if (!${Resist_${ResistSpellName}.Find[|${ResistTargetName}#HOLD|]}) {
| Hold the Spell Resist
/call StringReplaceAll "Resist_${ResistSpellName}" "|${ResistTargetName}#2|" "|${ResistTargetName}#HOLD|"
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "ResistSpell" "RESIST_${ResistSpellName}" "${Resist_${ResistSpellName}}"
/varset ResistSpellState HOLD
}
/if (${Resist_${ResistSpellName}.Length}) {
/if (${broadcast}==1) /${broadcastTell} [AutoResist] Change State: <${ResistSpellState}> for cast <${CastName}> and target [ ${Spawn[${CastTarget}].CleanName} ].
/if (${broadcast}==1) /${chat} [AutoResist] Change State: <${ResistSpellState}> for cast <${CastName}> and target [ ${Spawn[${CastTarget}].CleanName} ].
}
/return