Skip to content

issues with GetCasterLevel() and multiple ActionCastSpellAtObject() as instant

for characters which has multiple caster classes all spells even if from different classes with different levels will be cast at the same casterlevel if they are cast instantly at the same time even tho GetCasterLevel() is only called from within the spell scripts.

https://nwnlexicon.com/index.php?title=GetCasterLevel
"If used outside a spell script, it will return the last caster level of the last spell cast by oCreature"
this seems to be the case even when only used within the spell script when multiple spells are cast instantly together.

also ActionCastSpellAtObject() seems to have a few bugs of its own:
https://nwnlexicon.com/index.php?title=ActionCastSpellAtObject

also could it be possible to set nDomainLevel to "any" somehow or does it have to be specified? right now i have it loop through all the domain levels, it kinda works but for some caster classes the actions show up in the action queue for all the domain levels i loop through, (but only those that the players actually have will be cast)

Comments

  • ShadooowShadooow Member Posts: 402
    Instant casting via ActionCastSpell will cause the spell have CL equal to innatelvl*2-1.
  • MizzajlMizzajl Member Posts: 35
    Shadooow said:

    Instant casting via ActionCastSpell will cause the spell have CL equal to innatelvl*2-1.

    I'm not sure that is entirely correct.
    the way we use this on out server is a "fast buff wand" which we copied from PoA, originally scripted by Genisys (Guile) but we made some modifications to it. and if you use it out of combat it will try to use all your buff spells instantly.

    it works fine when you only got buffs from one class.
    but when you have buffs from different classes the buffs are all either from the lowest caster level or the highest caster level, depending on which order the spells the cast.

    one of my characters paladin 12 / sorc 18 and he gets +5 from divine favor when using the wand, and gets +4 if casting without the wand.

    another player was level 4 bard / high level paladin and his wand gave him +1 from divine favor but t would give him +5 if casting without the wand.
  • Dreadlord_AnwynDreadlord_Anwyn Member Posts: 48
    It sounds like a bug related to how NWN determines your primary class. Said functionality is probably in a core include file.
Sign In or Register to comment.