I am having trouble figuring out how to have enemies only be damaged by certain skills depending on States to the enemy applied, is there a way to do this with events or preexisting scripts?
Such as having an Enemy only be damaged by the skill 'Back Slash' because it has the State 'Front Guard' applied
Try something like this in the damage formula of your skill 'Back Slash'
[SIZE=10.5pt]if[/SIZE] [SIZE=10.5pt]b[/SIZE][SIZE=10.5pt].[/SIZE][SIZE=10.5pt]state[/SIZE][SIZE=10.5pt]?([/SIZE][SIZE=10.5pt]x[/SIZE][SIZE=10.5pt]);[/SIZE][SIZE=10.5pt] damage formula [/SIZE][SIZE=10.5pt];[/SIZE] [SIZE=10.5pt]else[/SIZE][SIZE=10.5pt];[/SIZE][SIZE=10.5pt] 0[/SIZE][SIZE=10.5pt];[/SIZE] [SIZE=10.5pt]end[/SIZE]
[SIZE=10.5pt]where x is the state id of 'Front Guard'[/SIZE]
[SIZE=10.5pt]What this does is check if state x is present. If it is, then the damage you define is applied; if not then damage = zero. Note the semi-colons, they are important.[/SIZE]
[SIZE=10.5pt]A neater way of putting that formula would be[/SIZE]
[SIZE=10.5pt]b.state?(x)? damage formula : 0[/SIZE]
[SIZE=10.5pt]The colon acts as the if/else. The first is more obvious in its meaning, so if you don't use different formulas very often it is easier to remember what's going on.[/SIZE]
That isn't exactly what I meant, what I meant was I need to have the skill be able damage enemies with and without the '--- Guard' state but have enemies with the '--- Guard' state only be able to be damaged by skills 'marked' in some way so that the skill will damage otherwise invincible enemies be damaged
I hope I explained it better, I will still experiment with the formula to see if I can get it to work
EDIT: I forgot other bits in your post so this post might be pointless
you need to alter ALL skill damage formula for that. 😀 .
it would be easier to use element instead. create the front guard state which immune to all element (including physical) except one element called back stab. then in the skill back stab... use that element.
and enemy without that state can still be damaged with the skill back stab as long as they not immune to back stab element.
but you must careful if you create some state / equipment that reduced element resistance against physical. make it also reduce back stab element too.
Thank you ksjp and Estriole for the assistance with my problem