Jump to content

How to make working script: NPC Ressurects dead NPC


Recommended Posts

Posted (edited)

So how does one make script that resurects dead NPCs by other NPCs

IF
    GlobalTimerExpired("rqTobCheckOnMen","GLOBAL")
    Dead("rqt7clt2")
    Global("rqt7clt2Ress","LOCALS",0)
THEN
    RESPONSE #100
        ReallyForceSpell("rqt7clt2",CLERIC_RESURRECTION)
        SetGlobal("rqt7clt2Ress","LOCALS",1)
        ActionOverride("rqt7clt2",PickUpItem("HELM08"))
        ActionOverride("rqt7clt2",PickUpItem("PLAT19"))
        ActionOverride("rqt7clt2",PickUpItem("SHLD17"))
        ActionOverride("rqt7clt2",PickUpItem("BLUN31"))
        ActionOverride("rqt7clt2",PickUpItem("SLNG04"))
        ActionOverride("rqt7clt2",PickUpItem("BULL03"))
        ActionOverride("rqt7clt2",PickUpItem("POTN55"))
END

I have created this script it works up until the actual resurrection part

I do see textual confirmation of casting this spell yet NPC is not returned back to life. I have tried ReallyForceSpellDead but it does not work either.

Any suggestions?

Edited by svj
Link to comment

So, an example of a resurrection script that actually works (abbreviated):

IF
	Global("bd_khal_spawn","bd2000",0)  // Boareskyr Bridge & Bridgefort
	BeenInParty("khalid")  // Khalid
THEN
	RESPONSE #100
		SetGlobal("bd_khal_spawn","bd2000",1)  // Boareskyr Bridge & Bridgefort
		MoveGlobal("bd2000","khalid",[2900.1310])  // Khalid
		ApplySpellRES("bdresurr","khalid")  // No such index
		SmallWait(1)
        ...
		Continue()
END

The key here is that the creature being resurrected is a global creature. Khalid exists in the GAM file of the save, rather than being in one of the ARE files packed up in the SAV. And that means that he can be targeted by script name even if he isn't in the current area, or he's dead. Non-global creatures that are dead can't be targeted.

So what do you do? You fake it. Sure, cast the spell, get the animation - but actually bringing back this (non-global) creature is just a CreateCreature action.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...