Skip to content

Scripting Question

I wrote a simple script with a hotkey as a trigger which results in me casting several buff spells on myself using spell(), everything worked fine but I decided I wanted to have a casting time of 0 so changed spell to ReallyForceSpell(). Now it still works as expected but the spells are not removed from my casters memory, i.e. I can keep casting again and again. Im sure the check in the trigger works fine as changing back to Spell() removes one from my casters memory each time. What am I doing wrong?

IF
   HotKey(S)
   HaveSpell(WIZARD_STRENGTH)
THEN
   RESPONSE #100
      ReallyForceSpell(Myself,WIZARD_STRENGTH)
      Continue()
END

Comments

  • horredtheplaguehorredtheplague Member, Developer Posts: 186
    Try instead:

    ApplySpell(Myself,WIZARD_STRENGTH)
    RemoveSpell(WIZARD_STRENGTH)

    I've never tested this on PC's, only on enemies. Be sure that this doesn't remove the spell from your book, only from memorization. And please let us know if it ruins your spellbook. IEDSP is not very clear on this specific detail, and if this is the case it should be noted there.

  • MikeMastersMikeMasters Member Posts: 141
    @horredtheplague I looked up RemoveSpell but the description seemed to imply it would remove it from my book, also does ApplySpell have a casting time of 0?
  • AlkaluropsAlkalurops Member Posts: 269
    RemoveSpell
    This action removes one memorised indtance of the specified spell from the spellbook of the active creature. The spell can be an innate ability, a priest spell or a wizard spell, but must be listed in spell.ids.
    It literally says "one memorised instance", so I would guess it removes... one memorised instance?
  • horredtheplaguehorredtheplague Member, Developer Posts: 186
    @Alkalurops: It says memorized and spellbook, so I'm not 100% sure which it really does. Only used it on NPC's, who were dead before I could ever check. Probably the memorized like we hope for, but for caution's sake I thought it best to warn.

    @MikeMasters: ApplySpell() has a casting time of zero, yes.
  • MathsorcererMathsorcerer Member Posts: 3,042
    I just checked--RemoveSpell took away a memorized Sleep but did not remove Sleep from the spell book. The effect "remove spell", number 172, will remove a spell from the book.
  • MikeMastersMikeMasters Member Posts: 141
    awesome thanks guys
  • MikeMastersMikeMasters Member Posts: 141
    have a follow-up scripting question. What are the codes for the innate abilities, such as draw upon holy might? for example, to reword the below script to use this innate ability

    IF
    HotKey(S)
    HaveSpell(WIZARD_VAMPIRIC_TOUCH)

    THEN
    RESPONSE #100
    ApplySpell(Myself,WIZARD_VAMPIRIC_TOUCH)
    RemoveSpell(WIZARD_VAMPIRIC_TOUCH)
    Continue()

    END



  • The user and all related content has been deleted.
Sign In or Register to comment.