Changed folder name.
Changed folder name.
This commit is contained in:
84
_module/nss/horsekey.nss
Normal file
84
_module/nss/horsekey.nss
Normal file
@@ -0,0 +1,84 @@
|
||||
//Script Name: horsekey3
|
||||
//////////////////////////////////////////
|
||||
// Created By: Genisys (Guile)
|
||||
// Created On: 9/17/08
|
||||
|
||||
/////////////////////////////////////////
|
||||
/*
|
||||
This script handles the Horse Items a
|
||||
player can buy from a store to spawn
|
||||
in a mount, the item in destroyed after
|
||||
a single use!
|
||||
|
||||
*/
|
||||
////////////////////////////////////////
|
||||
#include "x2_inc_switches"
|
||||
|
||||
//Required Horse Include
|
||||
#include "x3_inc_horse"
|
||||
|
||||
//Main Script
|
||||
void main()
|
||||
{
|
||||
|
||||
//All Major Variables Declared (Commonly used variables as well)
|
||||
|
||||
int nEvent = GetUserDefinedItemEventNumber(); //Which event triggered this
|
||||
object oPC; //The player character using the item
|
||||
object oItem; //The item being used
|
||||
object oSpellOrigin; //The origin of the spell
|
||||
object oSpellTarget; //The target of the spell
|
||||
int iSpell; //The Spell ID number
|
||||
object oTarget; //Define oTarget below
|
||||
object oObject; //Define oObject below
|
||||
int nInt; //A commonly used intergal (Must be defined)
|
||||
int nLvl; //Commonly used intergal for levels (ie. GetHitDice(oTarget); etc.)
|
||||
string sTag; //Used to define a tagname of something
|
||||
string sResref; //Used to define a resref name of something
|
||||
string sMsg; //Used to define a message
|
||||
effect eEffect; //Used to define an effect to be applied to an object or location
|
||||
effect eVis; //Used to define a visual effect to be applied to an object or location
|
||||
location lTarget; //The Target Location of the PC ONLY! (USE - Getlocation(oPC);)
|
||||
location lway; //The Target location for the Activated Item's Target only! (See below)
|
||||
object oSpawn;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Set the return value for the item event script
|
||||
// * X2_EXECUTE_SCRIPT_CONTINUE - continue calling script after executed script is done
|
||||
// * X2_EXECUTE_SCRIPT_END - end calling script after executed script is done
|
||||
int nResult = X2_EXECUTE_SCRIPT_END;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//Deterimine which event has fired for the item...
|
||||
switch (nEvent)
|
||||
{
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/////////////Cast Spell: Unique Power /or/ Activate Item//////////////////
|
||||
|
||||
//I seperated this cause it's more commonly used..
|
||||
case X2_ITEM_EVENT_ACTIVATE:
|
||||
// * This code runs when the Unique Power property of the item is used
|
||||
// * or the item is activated. Note that this event fires for PCs only.
|
||||
{
|
||||
oPC = GetItemActivator(); // The player who activated the item
|
||||
oItem = GetItemActivated(); // The item that was activated
|
||||
oTarget = GetItemActivatedTarget(); //The target of the item's power
|
||||
lway = GetItemActivatedTargetLocation(); //To get the location of the target!
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "x3_horse001", lTarget);
|
||||
|
||||
HorseSetOwner(oSpawn, oPC, TRUE);
|
||||
DestroyObject(oItem, 0.0f);
|
||||
break;
|
||||
}
|
||||
|
||||
//Switch Statment End
|
||||
}
|
||||
|
||||
//Pass the return value back to the calling script
|
||||
SetExecutedScriptReturnValue(nResult);
|
||||
}
|
||||
|
Reference in New Issue
Block a user