The Crimson Keep Forum :: Neverwinter Nights :: Script Archives ~ Runboard
Community logo

Greetings from The Crimson Keep. If you would like to contact the Keep via email, click Here. If you need a good search engine ( powered by Ask Jeeves ) please consider using this one, Dogs Trust. Everytime it is used, money will be automatically donated to a good cause at no expense to you, thankyou.
The Crimson Keep Forum
 Neverwinter Nights
  Script Archives
Support
Search
RSS

runboard.com       Sign up (learn about it) | Sign in (lost password?)


Page:  1  2 

 
Demortia
Head Administrator
Global user

Registered: 11-2004
Location: UK
Posts: 434
Avatar
Reply | Quote
Coffin and Sarcophagus contents


This script spawns either a decayed corpse or a fresh corpse ( chosen at random ) inside a coffin or sarchophagus.
This script does require custom items made with a ResRef that matches the entries in the script.

( In the Dunwich module, all corpses are edible (( specifically for Undead Character use )). Living Character eating a corpse have a large chance of suffering some vile disease. Undead can eat corpses with no ill effect. Corpses are considered food items and have unique power scripts attached.
They are also useful to tomb robbers who can make easy money selling corpses to certain indiviuals emoticon )


//OnOpen : For Coffins, Spawns Decayed Corpse or Fresh Corpse
void main()

{
object oPC = GetLastOpenedBy();
if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

if (d100()<=30)
   {
   CreateItemOnObject("food_corpsefrs", OBJECT_SELF);
   //Note, the "food_corpsefrs" item must
   //exist as a custom item.
   }

else
   {
   CreateItemOnObject("food_corpsedec", OBJECT_SELF);
   //Note, the "food_corpsedec" item must
   //exist as a custom item.
 }
}

Last edited by Demortia, 8/1/2008, 1:23 pm


---
Image
A Guest once said to me "Oh I like Roleplaying, I just dont like it when people stand around pretending to be Vampires!"
8/1/2008, 1:00 pm Send Email to Demortia MSN
 
Demortia
Head Administrator
Global user

Registered: 11-2004
Location: UK
Posts: 434
Avatar
Reply | Quote
Strip magical effects from equiped items.


This script is a great equaliser, with most people, their character is immune to just about everything because they custom make their own items to include a ridiculous ammount of magical effects that render them nearly invincible.

This script is placed as an "On Actions Taken" script from a conversation. The Dunwich module uses a "Gatekeeper" NPC that runs through several steps that check that a character is valid and meets all rules and requirements for access to the Module.
The final script to run is this one, which "teleports" a players character to a starting position waypoint within the module propper, and runs a magic stripping set of functions.

For the PC to teleport successfully, there must be a Waypoint with the tag "Entrypoint_1" at the entry point of the module. Its easy enough to change the tag reference in the script to anything required.


//Action Taken : Ports Character to Entry Point 1 Waypoint
#include "x2_inc_itemprop"

void main()
{

object oPC = GetPCSpeaker();
object oTarget;
location lTarget;
oTarget = GetWaypointByTag("Entrypoint_1");
lTarget = GetLocation(oTarget);

if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;

int nInt;
nInt = GetObjectType(oTarget);

if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oTarget));


// The following script strips the character of all
//magical effects applied to weapons, armour and items.

object oItem;

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_HEAD, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_BOOTS, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_BELT, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_ARROWS, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_BOLTS, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_BULLETS, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_CLOAK, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);

oTarget = oPC;
oItem = GetItemInSlot(INVENTORY_SLOT_NECK, oTarget);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);
}




Last edited by Demortia, 8/1/2008, 7:08 pm


---
Image
A Guest once said to me "Oh I like Roleplaying, I just dont like it when people stand around pretending to be Vampires!"
8/1/2008, 7:06 pm Send Email to Demortia MSN
 
Demortia
Head Administrator
Global user

Registered: 11-2004
Location: UK
Posts: 434
Avatar
Reply | Quote
Recycle Bins ( or Trash Barrels )


It sometimes gets tedious for a DM ( NWN version of ST ) to go around mopping up and deleteing the items people drop on the ground. So this is a handy way for people to dispose of unwanted items permanently.

This script should be attached to the "OnOpen" section of any type of container, a chest or a barrel will do ( remove all other scripts that may be present )

Any items placed in the barrel or chest will be permently deleted.


//OnOpen : Destroys all items placed in the trash barrel

void main()

{
object oItem;
oItem = GetFirstItemInInventory(OBJECT_SELF);

while (GetIsObjectValid(oItem))
   {
      if (GetPlotFlag(oItem))
      SetPlotFlag(oItem, FALSE);
      DestroyObject(oItem);
      oItem = GetNextItemInInventory(OBJECT_SELF);
   }


int nInt;
for (nInt=0; nInt<NUM_INVENTORY_SLOTS; nInt++)
   {
      oItem = GetItemInSlot(nInt, OBJECT_SELF);
      if (GetPlotFlag(oItem))
      SetPlotFlag(oItem, FALSE);
      DestroyObject(oItem);
   }

AssignCommand(OBJECT_SELF, TakeGoldFromCreature(GetGold(OBJECT_SELF), OBJECT_SELF, TRUE));
}





---
Image
A Guest once said to me "Oh I like Roleplaying, I just dont like it when people stand around pretending to be Vampires!"
8/1/2008, 7:15 pm Send Email to Demortia MSN
 


Add a reply

Page:  1  2 






Link to us   -  Blogs   -  Hall of Honour   -  Chat
You are not logged in (login)      Board's time is: 11/29/2009, 9:48 pm