BioWare Forums: View Post For Code Display


You are viewing a single post. Please do not take this post out of context.
Read the full topic: Post Working Scripts Here

Author Sticky: Post Working Scripts Here
Rockey Posted: Sunday, 23 June 11:04PM
1. Creature Spawn (Chest w/ Stirges in it)
2. Will Spawn 4 stirges when the chest is opened.

3. Include's BioWare's generic script for 'Do-Once' and random treasure generator. You will need to create a stirg in your area, right click and 'Add to Palette'. Then copy its BluePrint ResRef tag. This tag will need to be placed in the Create_Object call (replace "stirg001" with your tag). This code is to be placed into the onOpen event for a chest.

4.
NWScript:
// Stirg Trap Chest
/*
    Includes BioWares scripts for generating Treasure and
    'Do-Once' code.
    This script will spawn 4 stirges that will attack the
    players upon opening the chest. Create a chest and place this code into your
    'onOpen' script. You must create a stirg in your area, right click it and
    'Add to Palette' first. Then, take the BluePrint ResRef string and enter it
    into the CreateObject function below (currently where the value "stirg001"
    is, replace if yours is different). Once you have this BluePrint ResRef
    (under advanced), you can delete the instance of the stirg in your area
    (your palette will remember it).
*/
// Created By: Kevin Pisz
// Created On: 06/23/02
//
//  BioWare's info:
//
//:: Created By:   Brent
//:: Created On:   February 26 2001
//
#include "NW_O2_CONINCLUDE"
void main()
{
    if (GetLocalInt (OBJECT_SELF, "NW_DO_ONCE") != 0)
    {
       return;
    }
    object oLastOpener = GetLastOpener();
    //Uncomment below if you want randomly generated treasure
    //GenerateLowTreasure (oLastOpener, OBJECT_SELF);
    SetLocalInt (OBJECT_SELF, "NW_DO_ONCE",1);
    ShoutDisturbed();
    location llocation = GetLocation(OBJECT_SELF);
    object oStirg1 = CreateObject(OBJECT_TYPE_CREATURE, "stirge001", llocation, FALSE);
    object oStirg2 = CreateObject(OBJECT_TYPE_CREATURE, "stirge001", llocation, FALSE);
    object oStirg3 = CreateObject(OBJECT_TYPE_CREATURE, "stirge001", llocation, FALSE);
    object oStirg4 = CreateObject(OBJECT_TYPE_CREATURE, "stirge001", llocation, FALSE);
}

This post taken from the BioWare Forums
Powered by BioBoards Version 2.05.006
Please read our Copyright and Trademark Information