Author Topic: Multiple summons, but only when spells are cast via spell slots  (Read 322 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons, but only when spells are cast via spell slots
« on: January 04, 2014, 07:14:07 pm »


                I wanted a spell (Animate Dead, to be more exact) to be able to be used multiple times without unsummoning the previous summons.

I've found a nifty function for this here:
http://social.biowar...3174344#3174344
(Thanks, ShaDoOoW!)

but what I want to avoid is players using scrolls or wands to summon potentially infinite number of undead.

So, is there any check that could be used to determine if the spell is cast from a spell slot or not?
Thanks. '<img'>

Edit: I'm wondering if GetCasterLevel could do the trick somehow? What is the returned value if the source of the spell is a wand or a scroll?

Edit2: Dang, there are other problems, too. Namely, resting does not unsummon all of the undead and it looks like I'd have to modify the resting script itself for it to do so. I might just scrap the idea of multiple summons altogether.
               
               

               


                     Modifié par Grani, 04 janvier 2014 - 07:43 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple summons, but only when spells are cast via spell slots
« Reply #1 on: January 04, 2014, 07:44:44 pm »


               either GetSpellCastItem != OBJECT_INVALID or GetLastSpellCastClass == CLASS_TYPE_INVALID can be used to check whether the spell has been cast from item, the later also returns TRUE for DMs and monsters casting this spell so you might want to use the first

btw there is a new unique method of multisummons in my unofficial patch, which doesnt interfere with spellscripts at all, you might want to check it out (though it will be harder to add your restriction there, would need to use spellhook&spell ID check and then manually unsummon previous summons)
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons, but only when spells are cast via spell slots
« Reply #2 on: January 04, 2014, 08:38:02 pm »


               Thanks, I'll look into it. '<img'>