Changed folder name.
Changed folder name.
This commit is contained in:
111
_module/nss/godlyitem23.nss
Normal file
111
_module/nss/godlyitem23.nss
Normal file
@@ -0,0 +1,111 @@
|
||||
//Script Name:
|
||||
//////////////////////////////////////////
|
||||
// Created By: Genisys (Guile)
|
||||
// Created On: 8/13/08
|
||||
//
|
||||
// (TABASED ITEM SCRIPT TEMPLATE)
|
||||
/////////////////////////////////////////
|
||||
/*
|
||||
This template is used for ALL events which
|
||||
happen for an item which has the same
|
||||
tagname as the name of this script.
|
||||
(You need to name this script the item's tagname)
|
||||
|
||||
Every event below will fire when the event
|
||||
happens, ie. If the player activates the item
|
||||
the X2_ITEM_EVENT_ACTIVATE: script code will run.
|
||||
|
||||
*/
|
||||
////////////////////////////////////////
|
||||
#include "x2_inc_switches"
|
||||
|
||||
//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 oGazed;
|
||||
object oArea;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//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)
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//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!
|
||||
oArea = GetArea(oPC);
|
||||
|
||||
oGazed = GetFirstObjectInArea(oArea);
|
||||
while(GetIsObjectValid(oGazed))
|
||||
{
|
||||
if(GetObjectType(oGazed)==OBJECT_TYPE_CREATURE && oGazed != oPC)
|
||||
{
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_MORDENKAINENS_DISJUNCTION,
|
||||
oGazed, METAMAGIC_ANY, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_EPIC_RUIN,
|
||||
oGazed, METAMAGIC_ANY, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_FINGER_OF_DEATH,
|
||||
oGazed, METAMAGIC_MAXIMIZE, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_WORD_OF_FAITH,
|
||||
oGazed, METAMAGIC_ANY, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_NEGATIVE_ENERGY_BURST,
|
||||
oGazed, METAMAGIC_EMPOWER, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_SLOW,
|
||||
oGazed, METAMAGIC_EXTEND, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_VAMPIRIC_TOUCH,
|
||||
oGazed, METAMAGIC_EMPOWER, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
AssignCommand(oPC, ActionCastSpellAtObject(SPELL_HARM,
|
||||
oGazed, METAMAGIC_MAXIMIZE, TRUE, 40, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
|
||||
}
|
||||
|
||||
oGazed = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Switch Statment End
|
||||
}
|
||||
|
||||
//Pass the return value back to the calling script
|
||||
SetExecutedScriptReturnValue(nResult);
|
||||
}
|
||||
|
Reference in New Issue
Block a user