DMH-Online

Dungeon Masters Helper · Est. 2005

PCs Scripts

NWN Script: pc_respawn_006.htm

Author Sticky: Post Working Scripts Here
CainFortea Posted: Wednesday, 26 June 05:44AM
Script Name: Liching on Death
What it does: Instead of teleporting players back to a spot, and basically making it so that they take about 5 seconds to come back to the middle of the fight, this script makes it so that when a PC dies, he resurects right where he is standing. And has some bonuses (That of a Lich).

However, if they die while liched, they are dead. Can not be resurected. They're bodies become usable (I *think* that means you can root through their inventory. Not sure). They're bodies do not go away after a short period of time.

Basically makes death a more important issue, without totally shafting your characters.

Implementation: The script goes into the normal resurection script that came with the game, called
nw_o0_respawn. Just remove all code in the script from the line above "string sDestTag = "NW_DEATH_TEMPLE" all the way up to (but not including) "void main()"

Then simply paste the code that is included here.

Then go down to the bottom and rem out this line:
AssignCommand (oRespawner, JumpToLocation(GetLocation (oSpawnPoint)));

Then, create an object in your custom item pallet in your module. (Not sure, but I think it needs to be in every area. If someone finds this out, please send a message my way) Create a dagger, that has all the properties of the creature item "Lich Properties". Make sure the blueprint ResRef tag is "lichclaw".

Special Thanks: Thanks go to Ayrizale for his "Give PCs special powers" which I used in here, and the folks who wrote the normal resurection script.

Here we go.

NWScript:
void main()
{
        object oRespawner = GetLastRespawnButtonPresser ();
    //check to see if PC allready has Lich properties.
    //declare lich slots.
        object oLichSlots = GetItemInSlot (INVENTORY_SLOT_CWEAPON_R, oRespawner);
    if (oLichSlots == OBJECT_INVALID)
{
    //if the slot is empty, res and eqip.
        ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectResurrection(), oRespawner);
        ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints (oRespawner)), oRespawner);
        RemoveEffects(oRespawner);
     //Force the speaker to equip the item that was just given
         object oLichClaw = CreateItemOnObject ("lichclaw", oRespawner, 1);
         AssignCommand (oRespawner, ActionEquipItem (oLichClaw, INVENTORY_SLOT_CWEAPON_R));
    //and a nifty little resurecting effect.
    //heal again because they've had time to get TWHAPED while standing...
        ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectResurrection(),oRespawner);
        ApplyEffectToObject (DURATION_TYPE_INSTANT,EffectHeal (GetMaxHitPoints (oRespawner)), oRespawner);
}
      else
{
 // if not, then destroy.
        SetIsDestroyable (FALSE, FALSE, TRUE);

}



Damn too many characters thingy...

⌂ All Scripts ← PreviousNext → 👁 Category List

All PCs Scripts

📄 adjust_faction 📄 alt_idle_pc_anim 📄 bleeding 📄 bleeding_002 📄 bleeding_003 📄 bleeding_004 📄 creature_item 📄 drop_items 📄 force_zone 📄 give_pc_item 📄 inspect_inv 📄 limited_druid 📄 move_items_to_container 📄 notify_of_loot 📄 pc_respawn 📄 pc_respawn_002 📄 pc_respawn_003 📄 pc_respawn_004 📄 pc_respawn_005 📄 pc_respawn_006 📄 pc_respawn_007 📄 remove_neg 📄 save_spots 📄 strip_inv_give_gold 📄 strip_inv_plot 📄 subraces 📄 subraces_002 📄 voting