Jump to content

Spell Script Problem


Recommended Posts

Ok so I have an NPC who has this script:

 

scriptname CRdrakeburndeathscript

Short talkstate
short caststate

Begin OnDeath

CRMOSbookref.enable
crmosbookfire.enable
crmosbookfire2.enable

end

Begin GameMode

If Talkstate == 0
if CRdrakeburnREF.getdistance player < 200
	StartConversation player
	set talkstate to 1
endif
endif

If caststate == 0
If CRdrakeburnREF.getdisposition player < 1 && CRdrakeburnREF.getav aggression == 50
	CRdrakeburnREF.cast CRdrakeburnsummon CRdrakeburnref
	set caststate to 1
endif
endif
end

 

The code to begin the conversation works fine and he yells at you for being there, etc, etc. The conversation then ends, having executed the following:

 

CRdrakeburnREF.moddisposition player -100
CRdrakeburnREF.setav aggression 50

 

His script sees the state of disposition and aggression to be true and therefore triggers the casting of his special spell (which he doesn't possess but that's fine) the spell has this code:

 

ScriptName CRraisedeadscript

short state

Begin GameMode

if state == 0
CRDrakeburnREF.placeatme CRCreatureSkeleton2 2, -200, 1
CRdrakeburnREF.placeatme CRCreatureSkeleton3 1, -200, 1
set state to 1 
endif

end

 

now what happens is you come near him, he talks to you, ends the conversation, stands up from his chair (his one AI package) and "casts" his spell (goes through the motions, makes the sound, etc) but nothing happens, no skellies appear.

 

I had another AI package on him which would make him rush me to initiate conversation and the spell worked at that point for some reason, but any time I approached him before he rushes me, or now that I've removed the find player AI pack, the summon doesn't work! what am I missing here?

 

I should also mention that if I put the CRDrakeburnREF.placeatme commands in his personal script along with the spell casting trigger, it works just fine, but when I had the AI pack for him to rush at me, he would summon them twice if allowed to acquire me himself, but if I jumped in and got in range before the rush, he would just summon the ones which weren't trigger by the actual scriptspell. So in closing: why would the spell script only work if he comes and finds me first? I guess since I've removed the rush function, I can just add the placeatme function and leave the spell casting there too simply for the effect and animation/sound, etc.

Edited by icecreamassassin
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...