jastey Posted July 21, 2018 Share Posted July 21, 2018 I'd need help with the following problems: 1. My NPC has an innate ability which he should trigger if kicked out of the party. How do I script this? I tried "Spell(Myself,"c#brxxxx")" but (of course) it complains that "c#brxxxx" is not in the spell.ids. 2. I want to check whether a custom innate ability of my NPC was cast onto someone else. I tried "SpellCastOnMe("c#grey","c#grxxxx")" but it complaints that "c#grxxxx" is not in the spell.ids, either. I'm not even sure this would trigger/detect innate abilities at all. (And as far as I understood, I can't include those spells in the spell.ids because then it screws up the spell choice for the PC.) How would I script the use / detection of a custom innate ability? Quote Link to comment
argent77 Posted July 21, 2018 Share Posted July 21, 2018 1. Try SpellRES("c#brxxxx",Myself) or ApplySpellRES("c#brxxxx",Myself) if you want it applied instantly.2. Only for EE games: try SpellCastOnMeRES("c#brxxxx","c#grey") - Returns true only if cast in the last script round. Another option would be using spell states: Add a spell state to the spell in question (opcode 328) and check it via CheckSpellState("c#grey",MY_SPELL_STATE). It has the advantage that the spell state can be checked as long as the spell is active.No need to add entries to SPELL.IDS. This is only really needed if you want spells to be available at spell selection (e.g. during character creation or for sorcerers at level up). Quote Link to comment
K4thos Posted July 21, 2018 Share Posted July 21, 2018 2. Only for EE games: try SpellCastOnMeRES("c#brxxxx","c#grey") - Returns true only if cast in the last script round. Another option would be using spell states: Add a spell state to the spell in question (opcode 328) and check it via CheckSpellState("c#grey",MY_SPELL_STATE). It has the advantage that the spell state can be checked as long as the spell is active. And for not EE games you can try setting opcode #309 (Modify Local Variable) directly in spell to 1 on hit and to 0 when the spell is over, in order to make the spell detectable via Global("SomeVarSetBySpell","LOCALS",1) in scripts. If the check is done via baldur.bcs this feature would require TriggerOverride functionality added by ToBEX. Quote Link to comment
jastey Posted July 22, 2018 Author Share Posted July 22, 2018 Thank you both! For my first question I am using ApplySpellRES (although ignoring the IESDP description of max 7 letters for now until I experience in game that an 8 letter name really doesn't work.) The second thing I realized is more complex to accomplish than I thought, so I will just leave it. Quote Link to comment
Ardanis Posted July 23, 2018 Share Posted July 23, 2018 Make c#brxxxx cast c#brxxxy via 146 effect, make your NPC immune to c#brxxxy (via 206), and have it set a global variable you can check in scripts. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.