Added "Removed Files" folder

Added "Removed Files" folder in case we needed to review any of them.
This commit is contained in:
Jaysyn904 2022-10-10 10:39:34 -04:00
parent c1d6da2ed3
commit 151d074880
290 changed files with 55612 additions and 0 deletions
_module/_removed files
evercliententer.nsseverclientexit.nsseverheartbeat.nssevermodload.nsseverpcdeath.nsseverpcdying.nsseverpcequip.nsseverpclevelup.nsseverpcrespawn.nsseverpcrest.nsseverpcunequip.nsseverunaquire.nsshgll_classft_inc.nsshgll_const_inc.nsshgll_featreq_inc.nsshgll_func_inc.nsshgll_leto_inc.nsshgll_spells_inc.nsshgll_struct_stat.nssnw_s0_acidfoga.nssnw_s0_acidfogc.nssnw_s0_bescurse.nssnw_s0_bladebara.nssnw_s0_bladebarc.nssnw_s0_calllghtn.nssnw_s0_chlightn.nssnw_s0_conecold.nssnw_s0_crgrund.nssnw_s0_crpdooma.nssnw_s0_crpdoomc.nssnw_s0_crundead.nssnw_s0_delfirea.nssnw_s0_delfirebal.nssnw_s0_destruc.nssnw_s0_eleswarm.nssnw_s0_enedrain.nssnw_s0_enervat.nssnw_s0_findtrap.nssnw_s0_fingdeath.nssnw_s0_fireball.nssnw_s0_firestrm.nssnw_s0_flmarrow.nssnw_s0_flmstrike.nssnw_s0_gate.nssnw_s0_grplanar.nssnw_s0_hammgods.nssnw_s0_horrwilt.nssnw_s0_icestorm.nssnw_s0_implosion.nssnw_s0_imprinvis.nssnw_s0_incclouda.nssnw_s0_inccloudc.nssnw_s0_knock.nssnw_s0_lghtnbolt.nssnw_s0_lsplanar.nssnw_s0_metswarm.nssnw_s0_mordswrd.nssnw_s0_negray.nssnw_s0_planar.nssnw_s0_pwkill.nssnw_s0_raisdead.nssnw_s0_regen.nssnw_s0_resserec.nssnw_s0_shadconj.nssnw_s0_shades.nssnw_s0_slaylive.nssnw_s0_slow.nssnw_s0_splresis.nssnw_s0_stormvenc.nssnw_s0_summon.nssnw_s0_summon4.nssnw_s0_summon5.nssnw_s0_summon6.nssnw_s0_summon7.nssnw_s0_summon8.nssnw_s0_summon9.nssnw_s0_summshad.nssnw_s0_summshad02.nssnw_s0_timestop.nssnw_s0_timestop1.nssnw_s0_timestop3.nssnw_s0_vamptch.nssnw_s0_wallfirea.nssnw_s0_wallfirec.nssnwnx_admin_t.nssnwnx_area_t.nssnwnx_chat_t.nssnwnx_creature_t.nssnwnx_dialog_t.nssnwnx_dialog_t1.nssnwnx_dialog_t2.nssnwnx_dialog_t3.nssnwnx_effect_t.nssnwnx_feedback_t.nssnwnx_itemprop_t.nssnwnx_object_t.nssnwnx_player_t.nssnwnx_race_t.nssnwnx_sql_t.nssold_thunderclap.nss

@ -0,0 +1,363 @@
//Script Name: evercliententer
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 6/14/08 (Updated_8/10/08)
/////////////////////////////////////////
/*
This my premier OnClientEnter Module Event Script
for all my modules NWNX2 / Leto Modules
This script goes in the OnClient Enter Event
if you are using the nwnx2 system & leto!
*/
/////////////////////////////////////////////////////////////////
//This script does multiple things, it checks to see if...
//If the PC is immortal or level 40 (apply special effects)
//If the character they have has been banned. (not a total bann)
//If they logged out while dead, if so make them dead instantly!!! ;)
//If the player is playing a legal character or not...read below...
//And if the Player themself have been banned from the module or not..
///////////////////////////////////////////////////////////////////////
//Required Includes (Don't touch!)
#include "nw_i0_tool"
#include "gen_inc_color"
#include "fky_chat_inc"
///////////////////////////
//Repetitive Variables..
effect eEffect;
int nInt;
object oItem;
object aTarget;
location bTarget;
void main()
{
//Declare Major Variables..
object oPC;
oPC = GetEnteringObject();
object oTarget;
oTarget = oPC;
object oPlayer = oPC;
object oPP = oPC;
if(GetIsDM(oPC))
{return; }
//object oInfo = GetItemPossessedBy(oPP, "pcidname");
//string sID = GetStringRight(GetName(oInfo), 14);
//Tell us if the entering CHARACTER has been banned or not
int nBann = GetCampaignInt(GetName(GetModule()), "CBANN", oPP);
object oTag;
location lTag;
//This part is about verifying the Player's name..
//A player must have at least a 2 character name or they are going to
//return with an error! If they have spaces in their name it will return
//with an error as well, including alt code!
string sPCNM = GetName(oPP);
string sPCNMR = GetStringRight(sPCNM, 2);
string sNC1; string sNC2; string sRNC1; string sRNC2;
int nBad;
//Find the second character of the players name..
sNC1 = GetSubString(sPCNM, 0, 1);
//Find the second character of the players name..
sNC2 = GetSubString(sPCNM, 0, 2);
//Find the last letter in the player's name.
sRNC1 = GetSubString(sPCNMR, 0, 1);
//Find the next to the last letter in the player's name.
sRNC2 = GetSubString(sPCNMR, 0, 2);
/////////////////////////////////////////////////////////////////////////////
//Please leave the credits to the module within the message.
//Colorful Server Message sent to all PCs when they enter the module..
string sMessage;
sMessage = GetRGB(1,7,7); //The color (See above)
sMessage += "Welcome "; //The text to be colorized by the above color.
sMessage += GetRGB(15,15,1);//The next color.
sMessage += "to a "; //The next text to be colorized by the above color.
sMessage += GetRGB(15,1,1);//etc..
sMessage += "Revised Edition ";
sMessage += GetRGB(7,7,15);
sMessage += "of the ";
sMessage += GetRGB(1,15,1);
sMessage += "Classic Module";
sMessage += GetRGB(13,9,13);
sMessage += "Paths of Ascension ";
sMessage += GetRGB(12,10,7);
sMessage += "Created By: AW_Olorin ";
sMessage += GetRGB();
sMessage += "Revised By ";
sMessage += GetRGB(15,5,1);
sMessage += "Genisys (Guile) ";
sMessage += GetRGB(12,10,7);
sMessage += "on 7/21/08";
//Float welcome message by..
DelayCommand(13.3, FloatingTextStringOnCreature(sMessage, oPC, FALSE));
/////////////////////////IMPORTANT//////////////////////////////////
//You must make all the "" below into " " to check for legal names
//I turned it off because a lot of my characters have bad names!
//Simply put the cursor between "" and hit the space bar for "" to " "
if(sNC1 =="")
{ nBad =1; }
else if(sNC2 =="")
{ nBad =1; }
else if(sRNC1 =="")
{ nBad =1; }
else if(sRNC2 =="")
{ nBad =1; }
else { nBad = 0; }
/////////////////////////////////////////////////////////////////////
//If it's a DM entering the module...
if(GetIsDM(oPC))
{
//If the DM has never logged on before..
if(GetItemPossessedBy(oPC, "dmtoolz")==OBJECT_INVALID)
{
//Change "dmtoolz" to the tag name of any items you want given to DMs
//the first time they enter only...(copy / paste for more items)
//simply type // at the start of a line to deactivate it..
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
//CreateItemOnObject("dmtoolz", oPC, 1);
//This message is here for a reason!
DelayCommand(10.0, SendMessageToPC(oPC,
"<còòò>You have been given DM Items and your DM Character was saved," +
"<còòò> please login with the updated version of your DM Character and" +
"<còòò> delete the original, thank you."));
//You may want to create a journal tagnamed "dmrules" and define
//what your DMs are not allowed to do here..
//simply delete the // on the line below to activate the jounral entry
//AddJournalQuestEntry("dmrules", 1, oPC, FALSE, FALSE);
}
}
/////////////////////////////////////////////////////////////////////////////
//SimTools & Higher Ground's Legendary Leveler Functions
////////////////////////////////////////////////////////
string sCDKey = GetPCPublicCDKey(oPC);
Speech_OnClientEnter(oPC);
int nPerm, nPerm2;
if (USING_NWNX_DB)
{
nPerm = GetPersistentInt(GetModule(), "FKY_CHT_BANSHOUT" + sCDKey);
nPerm2 = GetPersistentInt(GetModule(), "FKY_CHT_BANPLAYER" + sCDKey);;
if (ENABLE_LANGUAGES) DoLanguageSetupNWNX(oPC);
}
else //using Bioware db
{
nPerm = GetCampaignInt("FKY_CHT", "FKY_CHT_BANSHOUT" + sCDKey);
nPerm2 = GetCampaignInt("FKY_CHT", "FKY_CHT_BANPLAYER" + sCDKey);
if (ENABLE_LANGUAGES) DoLanguageSetupBio(oPC);
}
if (nPerm) SetLocalInt(oPC, "FKY_CHT_BANSHOUT", TRUE);
if (nPerm2 || GetLocalInt(oPC, "FKY_CHT_BANPLAYER")) DoBoot(oPC);//Boot them if Valid Object
//below removes the Letoscript string so the changes won't be applied again on the next logout
string Script = GetLocalString(oPC, "LetoScript");
if( Script != "" )
{
SetLocalString(oPC, "LetoScript", "");
}
///////////////////////////////////////////////
//Let's make sure that the following code is only executed
//on Players and not DMs..
if(!GetIsPC(oPC))return;
if(GetIsDMPossessed(oPC))return;
if(GetIsDM(oPC))return;
////////////////////////////////////////////////////////////////////////
////////JOURNAL ENTRIES////////
///////////////////////////////
//These function add journal entries by the tag names below
//If you do not have these journal entries you can create them
//I only included the 1st entry (1).
AddJournalQuestEntry("severrules", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("x2spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("shifter", 1, oPC, FALSE, FALSE);
//////////////////IMPORTANT////////////////IMPORTANT////////////////////////
//This function scans the Entering PC to see if they have a legal character.
//Delete the // Below to activate the anti-cheat script
//DelayCommand(9.0, ExecuteScript("cheatercheck2", oPC));
/////////////////////////////////////////////////////////////////////////////
//If level 40 lets do some cool stuff to them :) (optional of course)
//Simply type // before any effect you do not wish to apply...
if(GetHitDice(oPC) == 40)
{
//Lets make the concealed 40%
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Lets make the look like a ghost.. :)
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC);
}
//////////////////////////////////////////////////////////////////////////////
//This is the immortal option, you must utilize the makeimmortal script
//to make players immortal (please read that script.)
if(GetItemPossessedBy(oPC, "immotoken") != OBJECT_INVALID)
{
//Run this script on the player (See script to configure settings)
ExecuteScript("powerimmortal", oPC);
}
//////////////////////////////////////////////////////////////////////////////
//If a player has been found with an illegal character they will have this item.
//It will prevent them from logging onto your server with that character.
if (GetItemPossessedBy(oPC, "banned")!= OBJECT_INVALID)
{
AssignCommand(oPC, ClearAllActions());
SetCutsceneMode(oPC, TRUE);
SetCameraMode(oPC, CAMERA_MODE_CHASE_CAMERA);
DelayCommand(4.0, FloatingTextStringOnCreature("You have an illegal character which is not allowed on this server.", oPC));
DelayCommand(5.0, SetCutsceneMode(oPC, FALSE));
DelayCommand(6.0, BootPC(oPC));
}
//Since the player was dead when they logged, kill them!
if (GetItemPossessedBy(oPC, "death")!= OBJECT_INVALID)
{
effect eEffect;
eEffect = EffectDeath();
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
SendMessageToPC(oPC, "You died because you were dead when you logged out.");
}
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//Let's see if the player's character has been banned from the module..
//Not the save as a player being banned altogether..
if(nBann ==1)
{
//Boot the PC fast!
DelayCommand(3.9, BootPC(oPP));
return;
}
//Let's see if the player playing the character has been banned altogether!
if(GetCampaignInt(GetName(GetModule()), "BANN", oPP)==TRUE)
{
//If so boot them fast!
DelayCommand(3.5, BootPC(oPP));
//In Case They Can't be Booted..(Allow them to enter the module first..)
//Then lock thier game down! (Note; You cannot have a script in OnCutscenAbort!)
DelayCommand(9.0, SetCutsceneMode(oPP, TRUE, FALSE));
//They can't see nothing!
DelayCommand(9.1, FadeToBlack(oPP, FADE_SPEED_FAST));
//Turn them into a chiken :)
DelayCommand(9.2, ApplyEffectToObject
(DURATION_TYPE_PERMANENT, EffectPolymorph(113, TRUE), oPP));
DelayCommand(9.3, ExportSingleCharacter(oPP)); //Make the polymorph permanent!
return;
}
//////////////////////////////////////////////////////////////////////////////
//Let's prevent badly named characters from logging onto the server..
// /*(Delete the // at the start of this line to deactivate this section)
//Let's verify they have a legal name!
//NOTE This function works in conjunction with another script
//in which an NPC at the start verifies if the PC is playing a legal name.
//If the first 2 or last 2 letters of their name are bad..
if(nBad==1)
{
//Delay the following to allow the PC to enter the module..
DelayCommand(10.0,
FloatingTextStringOnCreature("You character name is not allowed!", oPP));
return;
}
else // (do not touch this line!) */
{
//Welcome to them to the server..
DelayCommand(5.0, SendMessageToPC(oPP,
"<còòò>Welcome to this CEP2 Persistent Module Created by <c }ò>Genisys"));
}
///////////////////////////////////////////////////////////////
//If the player has been inside of a party room, but logged out, then
//teleport them to the start and take the token!
if (GetItemPossessedBy(oPC, "partyroom")!= OBJECT_INVALID)
{
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="partyroom") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
aTarget = GetWaypointByTag("home");
bTarget = GetLocation(aTarget);
if (GetAreaFromLocation(bTarget)==OBJECT_INVALID) return;
//Allow them to fully enter the module..
DelayCommand(8.0, AssignCommand(oPC, ClearAllActions()));
DelayCommand(8.1, AssignCommand(oPC, ActionJumpToLocation(bTarget)));
}
//////////////////////////////////////////////////////////////////////////////
//Remove all Arena Tokens on enter..
if (GetItemPossessedBy(oPC, "arenatoken")!= OBJECT_INVALID)
{
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="arenatoken") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
//End Script
}

@ -0,0 +1,358 @@
//Script Name: everclientexit
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 7/05/08 (Updated_8/10/08)
/////////////////////////////////////////
/*
This is my premier CEP2 - NWNX2 / Leto
OnClientExit Event Script.
*/
/////////////////////////////////////////////////////////////////
/*
This script does multiple things, it checks to see if...
If the PC is immortal or level 40 (apply special effects)
If the character they have has been banned. (not a total bann)
If they logged out while dead, if so make them dead instantly!!! ;)
If the player is playing a legal character or not...read below..
And if the Player themself have been banned from the module or not..
*/
//////////////////////////////////////////////////////////////////////
//Redundant Variables Declared
effect eEffect;
int nInt;
object oItem;
object aTarget;
location bTarget;
////////////////////////////////////////
//Required Includes
//#include "hgll_func_inc"
#include "fky_chat_inc"
/////////////////////////////////////////
//PROTOTYPE DECLARED
void SendMessageToAllPC(string sMessage);
/////////////////////////////////////////
//Main Script
void main()
{
//Declare Major Variables..
object oPC;
oPC = GetEnteringObject();
object oTarget;
oTarget = oPC;
object oPlayer = oPC;
object oPP = oPC;
object oInfo = GetItemPossessedBy(oPP, "pcidname");
string sID = GetStringRight(GetName(oInfo), 14);
//This means the entering Character has been banned.
int nBann = GetCampaignInt(GetName(GetModule()), "CBANN", oPP);
object oTag;
location lTag;
//This part is about verifying the Player's name..
//A player must have at least a 2 character name or they are going to
//return with an error! If they have spaces in their name it will return
//with an error as well, including alt code!
string sPCNM = GetName(oPP);
string sPCNMR = GetStringRight(sPCNM, 2);
string sNC1; string sNC2; string sRNC1; string sRNC2;
int nBad;
//Find the second character of the players name..
sNC1 = GetSubString(sPCNM, 0, 1);
//Find the second character of the players name..
sNC2 = GetSubString(sPCNM, 0, 2);
//Find the last letter in the player's name.
sRNC1 = GetSubString(sPCNMR, 0, 1);
//Find the next to the last letter in the player's name.
sRNC2 = GetSubString(sPCNMR, 0, 2);
////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////
//Sim Tools & Legendary Level Functions..
//////////////////////////////////////////////////////
object M = GetModule();
string Script = GetLocalString(oPC, "LetoScript");
if( Script != "" )
{
SetLocalString(oPC, "LetoScript", "");
LetoScript(Script);
}
Speech_OnClientExit(GetExitingObject());
////////////////////////////////////////////////////////////////////
//Your Code Goes here..
/////////////////////////IMPORTANT//////////////////////////////////
//You must make all the "" below into " " to check for legal names
//I turned it off because a lot of my characters have bad names!
//Simply put the cursor between "" and hit the space bar for "" to " "
if(sNC1 =="")
{ nBad =1; }
else if(sNC2 =="")
{ nBad =1; }
else if(sRNC1 =="")
{ nBad =1; }
else if(sRNC2 =="")
{ nBad =1; }
else { nBad = 0; }
//See below to activate this system..
////////////////////////////////////////////////////////////////////////
//If it's a DM entering the module...
if(GetIsDM(oPC))
{
//If the DM has never logged on before..
if(GetItemPossessedBy(oPC, "dmtoolz")==OBJECT_INVALID)
{
//Change "dmtoolz" to the tag name of any items you want given to DMs
//the first time they enter only...(copy / paste for more items)
//simply type // at the start of a line to deactivate it..
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
CreateItemOnObject("dmtoolz", oPC, 1);
//CreateItemOnObject("dmtoolz", oPC, 1);
//This message is here for a reason!
DelayCommand(10.0, FloatingTextStringOnCreature(
"<còòò>You have been given DM Items and your DM Character was saved," +
"<còòò> please login with the updated version of your DM Character and" +
"<còòò> delete the original, thank you.", oPC, FALSE));
//You may want to create a journal tagnamed "dmrules" and define
//what your DMs are not allowed to do here..
//simply delete the // on the line below to activate the jounral entry
//AddJournalQuestEntry("dmrules", 1, oPC, FALSE, FALSE);
}
}
//This is for the rest of the script, if it's not a PC stop here!
if(!GetIsPC(oPC))return;
/////////////////////////////////////////////////////////////////////////////
//These function add journal entries by the tag names below
//If you wish to create more, just copy / paste and change
//The tagname which is in "here", and the entry # remains 1 only!
AddJournalQuestEntry("rules", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("pcinfo", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("x2spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("shifter", 1, oPC, FALSE, FALSE);
//////////////////IMPORTANT////////////////IMPORTANT////////////////////////
//This function scans the Entering PC to see if they have a legal character.
//Delete the // Below to activate the anti-cheat script
//DelayCommand(9.0, ExecuteScript("cheatercheck2", oPC));
/////////////////////////////////////////////////////////////////////////////
//If level 40 lets do some cool stuff to them :) (optional of course)
//If you do not wish to use this options you will need to delete the // below
// /* <<(don't touch this part)
if(GetHitDice(oPC) == 40)
{
//Lets make the concealed 40%
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Lets make the look like a ghost.. :)
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC);
}
// don't touch this line */
//////////////////////////////////////////////////////////////////////////////
//This is the immortal option, you must utilize the "makeimmortal" script
//to make players immortal (please read that script.)
if(GetItemPossessedBy(oPC, "immotoken") != OBJECT_INVALID)
{
//Run this script on the player (See script to configure settings)
ExecuteScript("powerimmortal", oPC);
}
//////////////////////////////////////////////////////////////////////////////
//If a player has been found with an illegal character they will have this item.
//It will prevent them from logging onto your server with that character.
//Note this will only work if you have activated the Anti-Cheat option above!
if (GetItemPossessedBy(oPC, "banned")!= OBJECT_INVALID)
{
AssignCommand(oPC, ClearAllActions());
SetCutsceneMode(oPC, TRUE);
SetCameraMode(oPC, CAMERA_MODE_CHASE_CAMERA);
DelayCommand(4.0, FloatingTextStringOnCreature("You have an illegal character which is not allowed on this server.", oPC));
DelayCommand(5.0, SetCutsceneMode(oPC, FALSE));
DelayCommand(6.0, BootPC(oPC));
}
////////////////////////////////////////////////////////////////////////////
//Since the player was dead when they logged, kill them!
if (GetItemPossessedBy(oPC, "death")!= OBJECT_INVALID)
{
effect eEffect;
eEffect = EffectDeath();
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
SendMessageToPC(oPC, "You died because you were dead when you logged out.");
}
//////////////////////////////////////////////////////////////////////////////
//This function is currently disabled (Not in use, may be used later on)
/*
//Let's make sure All players have a valid PC Name ID Item..
if(oInfo==OBJECT_INVALID)
{
//Open the "eq_pcidname" script to learn more
CreateItemOnObject("pcidname", oPP, 1);
} // */
////////////////////////////////////////////////////////////////////////
//Let's see if the entering CHARACTER has been banned from the module..
//Not the save as a player being banned altogether..
if(nBann ==1)
{
//Boot the PC fast!
DelayCommand(3.9, BootPC(oPP));
return;
}
//Let's see if the player has been banned altogether!
//Note the TRUE after oPP = Single Player / FALSE = Multiplayer Mode
if(GetCampaignInt(GetName(GetModule()), "BANN", oPP)==TRUE)
{
//If so boot them fast!
DelayCommand(3.5, BootPC(oPP));
//In Case They Can't be Booted..(Allow them to enter the module first..)
//Then lock thier game down! (Note; You cannot have a script in OnCutscenAbort!)
DelayCommand(9.0, SetCutsceneMode(oPP, TRUE, FALSE));
//They can't see nothing!
DelayCommand(9.1, FadeToBlack(oPP, FADE_SPEED_FAST));
//Turn the PC into a punk chicken :)
DelayCommand(9.2, ApplyEffectToObject
(DURATION_TYPE_PERMANENT, EffectPolymorph(113, TRUE), oPP));
DelayCommand(9.3, ExportSingleCharacter(oPP)); //Make it permanent!
return;
}
//////////////////////////////////////////////////////////////////////////////
//Let's prevent badly named characters from logging onto the server..
//Delete the /* below this line to activate the name checking system.
/*
//Let's verify the Entering PC has a legal name!
//NOTE This function works in conjunction with another script
//in which an NPC at the start verifies if the PC is playing a legal name.
//If the first 2 or last 2 letters of their name are bad..
if(nBad==1)
{
//Delay the following to allow the PC to enter the module..
DelayCommand(10.0,
FloatingTextStringOnCreature("You character name is not allowed!", oPP));
//Tell the database the player character is banned
DelayCommand(11.0, SetCampaignInt(GetName(GetModule()), "BANN", 1, oPP));
//Boot the PC
DelayCommand(14.0, BootPC(oPP));
return;
}
else
{
//do nothing..
}
// (do not touch this line!) */
///////////////////////////////////////////////////////////////
//If the player has been inside of a party room, but logged out, then
//teleport them to the start and take the token!
if (GetItemPossessedBy(oPC, "partyroom")!= OBJECT_INVALID)
{
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="partyroom") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
aTarget = GetWaypointByTag("home");
bTarget = GetLocation(aTarget);
if (GetAreaFromLocation(bTarget)==OBJECT_INVALID) return;
//Allow them to fully enter the module..
DelayCommand(8.0, AssignCommand(oPC, ClearAllActions()));
DelayCommand(8.1, AssignCommand(oPC, ActionJumpToLocation(bTarget)));
}
//Finally! Send this message to the PC..
//(Please change to match your module name)
//(I would appreciate credit to my work in your start message thanks.)
//Welcome them PC to the server with a colorful message
DelayCommand(5.0, SendMessageToPC(oPP,
//Enter your module name below
"<c òò>Welcome to (ENTER MODULE NAME)" + //Make sure you use one space!
"<c }ò> a 1.68 Persistent Module " +
"<c ò>Created by Genisys " +
//Enter your name below
"<còòò>Designed By: (YOUR NAME HERE)"));
//Main Script End
}
//PROTOTYPE DEFINED
void SendMessageToAllPC(string sMessage)
{
object PC = GetFirstPC();
while(GetIsObjectValid(PC))
{
FloatingTextStringOnCreature(sMessage, PC);
PC = GetNextPC();
}
}

@ -0,0 +1,77 @@
//Script Name: everheartbeat
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 4/20/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
Some parts of this script were taken from
AW_Olorin's Paths of Ascension Module
This script goes in the OnHeartbeat
Event of the Module Properties
*/
////////////////////////////////////////
//Required Include
#include "nw_i0_tool"
//Main Script
void main()
{
object oPC = GetFirstPC();
/////////////////////////////////////////////////////////////////////////////
//Prevent Trap Setting in any area where the placeable object "No Crown"
//is located (Which is found on the custom paletted)
//I recommend you place this object anywhere you don't want traps set!
while(GetIsObjectValid(oPC))
{
object detector = GetNearestObjectByTag("nocrown", oPC, 0);
if (GetIsObjectValid(detector))
{
object trap = GetNearestTrapToObject(detector, FALSE);
if ( GetTrapCreator(trap) == oPC && !GetIsDM(oPC) && GetIsPC(oPC))
if (GetArea(oPC) != GetArea(GetObjectByTag("throneofdeath")))
{
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetWaypointByTag("prison"))));
SendMessageToPC(oPC, "You have been sent to jail for setting a trap in a restricted area.");
}
}
oPC = GetNextPC();
}
////////////////////////////////////////////////////////////////////////
//GLOBAL MESSAGING SYSTEM By: AW_OLORIN (Paths of Ascension)
// Server Time Keeper
int timekeeper = GetLocalInt(GetModule(), "loadtimer");
SetLocalInt(GetModule(), "loadtimer", (timekeeper +1));
// DM announcement check
//This feature isn't currently in Use, but DO NOT REMOVE IT!!!
int iAnnounceTimer = GetLocalInt(GetModule(),"iAnnounceTimer");
SetLocalInt(GetModule(), "iAnnounceTimer", (iAnnounceTimer +1) );
if(iAnnounceTimer >= GetLocalInt(GetModule(),"iAnnounce_Period"))
{
string sAnnouncement = GetLocalString(GetModule(),"Announcement");
string sAuthor = GetLocalString(GetModule(),"Announcement_Author");
SetLocalInt(GetModule(),"iAnnounceTimer",0);
if(sAnnouncement == "") return;
oPC = GetFirstPC();
while(GetIsObjectValid(oPC))
{
if(GetIsDM(oPC))
SendMessageToPC(oPC,"Module wide announcement being sent, created by DM " + sAuthor + ".");
SendMessageToPC(oPC,sAnnouncement);
oPC = GetNextPC();
}
}
//Main Script End
}

@ -0,0 +1,167 @@
////////////////////////////////////
//Created by Genisys / Guile 7/05/08
////////////////////////////////////
/*
script name: evermodload
This is my premier NWNX2 / Leto
CEP2 OnModuleLoad Event Script
*/
////////////////////////////////////
#include "fky_chat_inc"
#include "x2_inc_switches"
#include "x2_inc_restsys"
#include "aps_include"
#include "x2_inc_restsys"
#include "se_inc_reset"
///SCRIPT MAIN////////
void main()
{
//The NWNX2 Reset Plugin Function
//the first # must be 1 month Higher than the current module month!
//see the script "se_inc_reset" to see how it works..
SE_NWNX_ResetModuleCheck(7, 30.0, 120.0);
////////////////////////////////////////////////////////////////////////
//This sets color in Tokens in conversatoins, it requires that
//you use the #s below for tokens, ie, <CUSTOM1001> where
//you want the text to be colorized.
string sColor = GetName(GetObjectByTag("COLORS"));
SetCustomToken(1001, GetSubString(sColor, 0, 6)); //white
SetCustomToken(1002, GetSubString(sColor, 6, 6)); //yellow
SetCustomToken(1003, GetSubString(sColor, 12, 6)); //magenta
SetCustomToken(1004, GetSubString(sColor, 18, 6)); //cyan
SetCustomToken(1005, GetSubString(sColor, 24, 6)); //red
SetCustomToken(1006, GetSubString(sColor, 30, 6)); //green
SetCustomToken(1007, GetSubString(sColor, 36, 6)); //blue
//More Custom Tokens for Conversations
//By GENISYS (Guile)
SetCustomToken(100, "</c>"); // CLOSE tag
SetCustomToken(101, "<cþ >"); // red
SetCustomToken(102, "<c þ >"); // green
SetCustomToken(103, "<c þ>"); // blue
SetCustomToken(104, "<c þþ>"); // cyan
SetCustomToken(105, "<cþ þ>"); // magenta
SetCustomToken(106, "<cþþ >"); // yellow
SetCustomToken(107, "<c >"); // black
SetCustomToken(108, "<c¥ >"); // dark red
SetCustomToken(109, "<c ¥ >"); // dark green
SetCustomToken(110, "<c ¥>"); // dark blue
SetCustomToken(111, "<c ¥¥>"); // dark cyan
SetCustomToken(112, "<c¥ ¥>"); // dark magenta
SetCustomToken(113, "<c¥¥ >"); // dark yellow
SetCustomToken(114, "<c¥¥¥>"); // grey
SetCustomToken(117, "<cŒŒŒ>"); // dark grey
SetCustomToken(115, "<cþ¥ >"); // orange
SetCustomToken(116, "<cþŒ >"); // dark orange
SetCustomToken(117, "<cÚ¥#>"); // brown
SetCustomToken(118, "<c† >"); // dark brown
SetCustomToken(119, "<cªkþ>"); // Light Purple
SetCustomToken(120, "<c ð >"); // Neon Green
SetCustomToken(121, "<c ‚ð>"); // Light Blue
SetCustomToken(122, "<c` ¡>"); // Purple
SetCustomToken(123, "<c ð >"); //Neon Green
/////////////////AUTOMATIC CHARACTER SAVING FUCTION////////////////////////
//Note this function is Polymorphing Friendly (Designed for that purpose!)
//This feature stores All PC's location on the module ever 3 minutes...
//To deactivate this feature, simply type // at the start of the line below.
//DelayCommand(60.0, ExecuteScript("savepcinfo", OBJECT_SELF));
//////////////////////////////////////////////////////////////////////////
//This is part of the SimTools by Funkyswerve...
// Init placeholders for ODBC gateway
SQLInit();
// Init placeholders for chat gateway
InitSpeech();
/////////////MAIN BIOWARE X2 FUNCTIONS (DO NOT REMOVE!)/////////////
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
{
// * Setting the switch below will enable a seperate Use Magic Device Skillcheck for
// * rogues when playing on Hardcore+ difficulty. This only applies to scrolls
SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
// * Activating the switch below will make AOE spells hurt neutral NPCS by default
// SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE);
}
// * AI: Activating the switch below will make the creaures using the WalkWaypoint function
// * able to walk across areas
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
// * Spells: Activating the switch below will make the Glyph of Warding spell behave differently:
// * The visual glyph will disappear after 6 seconds, making them impossible to spot
SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE);
// * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing,
// * but since it is described this way in the book, here is the switch to get it back...
SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE);
// * Craft Feats: Use this to disable Item Creation Feats if you do not want
// * them in your module
// SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
// * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size.
// * We do not support this check for balancing reasons, but you can still activate it...
// SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE);
// * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
// * did not fit into NWNs spell system and was confusing, so we took it out...
// SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE);
// * Spellcasting: Some people don't like caster's abusing expertise to raise their AC
// * Uncommenting this line will drop expertise mode whenever a spell is cast by a player
// SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
// * Item Event Scripts: The game's default event scripts allow routing of all item related events
// * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a
// * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...)
// * is triggered. Check "x2_it_example.nss" for an example.
// * This feature is disabled by default.
SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
// * If Tagbased scripts are enabled, and you are running a Local Vault Server
// * you should use the line below to add a layer of security to your server, preventing
// * people to execute script you don't want them to. If you use the feature below,
// * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a
// * maximum of 16 chars, instead of the pure tag of the object.
// * i.e. without the line below a user activating an item with the tag "test",
// * will result in the execution of a script called "test". If you uncomment the line below
// * the script called will be "1_test.nss"
// SetUserDefinedItemEventPrefix("1_");
}
// * This initializes Bioware's wandering monster system as used in Hordes of the Underdark
// * You can deactivate it, making your module load faster if you do not use it.
// * If you want to use it, make sure you set "x2_mod_def_rest" as your module's OnRest Script
// SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE);
if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
{
// * This allows you to specify a different 2da for the wandering monster system.
// SetWanderingMonster2DAFile("des_restsystem");
//* Do not change this line.
WMBuild2DACache();
}
}

@ -0,0 +1,702 @@
//Script Name: everpcdeath
/////////////////////////////////////////
//Created By: Genisys / Guile
//Created On: 1/11/08 (Updated_8/10/08)
/////////////////////////////////////////
/*
This is my premier OnPlayerDeath Module Event Script which I designed
specifically for all my modules, it's rather nice and is part of
multiple systems, so do not edit ANYTHING you do not know what it's for!
*/
////////////////////////////////////////////////////////////////////////
//Rquired Includes.. (Don't touch!)
#include "nw_i0_plot"
#include "x2_inc_compon"
#include "setxp_inc"
///////////////////////////////////////////////////////////////////////////
/////////////////IMPORTANT OPTIONAL SETTINGS///////////////////////////////
//The constant intergal below allows you to choose where or not to utilize
//the PVP Death System I have scripted, please read below to learn more..
//FALSE = Disabled / TRUE = Enabled
const int nPVP = TRUE;
//This constant will decide whether or not you want to send a PVP message
//to all players when PVP transpires (This is for PVP Servers)
//FALSE = Disabled / TRUE = Enabled
const int nPVPMessage = TRUE;
//If you wish to restrict PVP to the arena only, then..
//Set the below setting to TRUE / FALSE = Deactivated (Default)
const int nArenaOnly = FALSE;
//This determines the level difference allowed in PVP (default 5)
//If set to 5 players within 4 levels of each other will not be
//Penalized for Killing one another. (Works both ways!)
//Add +1 for the level you want so if you want 8 level difference make it 9!
//(Set this whether you allow PVP or not!)
const int nDif = 5; //(Between 5 - 40) / (40 = Disabled)
//This is how you set the reward for XP given to the player for
//fair PVP Kills, this # is multiplied by the level difference!
const int nReward1 = 80; //(ie. if 3 Levels difference / 80 X 3)
//This is how ytou set the reward for Gold given to the player for
//fair PVP Kills, this # is multiplied by the level difference!
const int nReward2 = 800;
/////////OPTIONS END//////////////////////////////////////////////////
////DO NOT TOUCH ANYTHING BELOW UNLESS IT SAYS - ///OPTION////
//////////////////////////////////////////////////////////////////////
///// This Part was Created by: bushido
///// Developed by: Wouter Dhondt
///// Modified by: Genisys / Guile For Persistency..
////////////////////////////////////////////////////////
//This is the PVP Stats (Used to keep track of PVP Activity)
//This allows DMs and Players to see PVP Activity.
void AdjustPlayerStats()
{
//Delare Variables
object oDied = GetLastPlayerDied();
object oAttacker = GetLastHostileActor(oDied);
object oKiller;
//Only if the player who died is a PC
if(GetIsPC(GetLastPlayerDied()))
{
//Let's make sure we properly identify who the Attacker is...
if (GetIsPC(GetMaster(oAttacker)))
{
oKiller = GetMaster(oAttacker);
}
else
{
//Let's make sure the Killer is a PC
if(GetIsPC(oAttacker))
{
oKiller = oAttacker;
}
}
// Increment or set the death variable
int iDied = GetCampaignInt("PVP_SCORE", "iDied", oDied);
int nCount = iDied + 1;
SetCampaignInt("PVP_SCORE", "iDied", nCount, oDied);
// Is this object a PC?
if (GetIsPC(oKiller) == TRUE)
{
// Increment or set the killer var
int iKilled = GetCampaignInt("PVP_SCORE", "iKilled", oKiller);
int nDeaths = iKilled + 1;
SetCampaignInt("PVP_SCORE", "iKilled", nDeaths, oKiller);
}
}
//AdjustPlayerStats End..
}
///////////////////////////////////////////////////////////////
// Raise OnDeath function (Standard Bioware Function)
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
effect eBad = GetFirstEffect(oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
//Remove effect if it is negative.
RemoveEffect(oPlayer, eBad);
}
eBad = GetNextEffect(oPlayer);
}
//Fire cast spell at event for the specified target
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}
// Respawn/Teleporter OnDeath function (By Bushido / Modified By Genisys)
// Optionally you can create the waypoints described to send the dead player
// to that location. You must create an item named arenatoken (tag & resref name)
//Then you must use give it to them & take it away from them on enter/exit of
//an area by a script, this will deem that area as the arena.
void Respawn(object oPlayer)
{
string waiting = "<c B+>The gods show you favor, your life is restored.";
if (GetIsDead(oPlayer))
{
object oPC = GetLastPlayerDied();
if (GetItemPossessedBy(oPC, "arenatoken")!= OBJECT_INVALID)
{
//Create a way point and tagname it "arenawp"
object oTarget = GetWaypointByTag("arenawp");
effect eTeleport = EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport, oPlayer);
//Tell the player why they are being restored.
FloatingTextStringOnCreature(waiting, oPC);
//Resurrect the player
Raise(oPlayer);
//Teleport the raised player to the arena spawn point.
DelayCommand(0.1, AssignCommand(oPlayer, ClearAllActions()));
DelayCommand(0.2, AssignCommand(oPlayer, JumpToObject(oTarget)));
}
else
{
CreateItemOnObject("death", oPC);
}
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////Main Script/////////////////////////////////////
////////////////////////////////////////////////////////////////////////
void main()
{
//Declare Major Variables...
object oPlayer = GetLastPlayerDied();
object oPC = GetLastPlayerDied();
object oTarget = oPlayer;
object oToken = GetItemPossessedBy(oPlayer, "death");
object oItem;
object oPP = oPlayer;
string sArea = GetTag(GetArea(oPlayer));
string sName = GetName(GetModule());
location lDead = GetLocation(oPlayer);
//If the player is being tortured, ressurect them...
object hell = GetArea(oPlayer);
object helltest = GetArea(GetObjectByTag("satan1"));
if (hell == helltest)
{
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer));
return;
}
object oInfo = GetItemPossessedBy(oPP, "pcidname");
string sID = GetStringRight(GetName(oInfo), 14);
//PVP Variables..
object oDead = GetLastPlayerDied();
object oKiller = GetLastHostileActor(oDead);
object oVictor;
object oDied;
int nInt;
int kLvl = GetHitDice(oKiller);
int pLvl = GetHitDice(oDead);
int dLvl = kLvl - pLvl;
int aLvl = pLvl - kLvl;
effect eKill = EffectDeath(TRUE);
effect eVis = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);
//Define who oKiller is..
//Define the attacker& dead guy
object oAttacker = GetLastHostileActor(oDied);
oDied = oPlayer;
//Let's make sure we properly identify who the Attacker is...
if (GetIsPC(GetMaster(oAttacker)))
{
oKiller = GetMaster(oAttacker);
}
else
{
//Let's make sure the Killer is a PC
if(GetIsPC(oAttacker))
{
oKiller = oAttacker;
}
}
//Count up & Store in Database the kills and deaths
AdjustPlayerStats();
///////////LOCATION SAVING OPTION/////////////////////////////////
//Type: // Below this line to activate location saving on death
/*(Before this!)
//Store the PC's location, because if they are ressurected they can
//come back to this place when they logg back on..(unless location changed)
SetCampaignLocation(sName, "SAVED_LOC", lDead, oPlayer);
//Tell the PC thier location was saved..
SendMessageToPC(oPC, "Location Saved.");
//(leave this alone) */
//////////////////////////////////////////////////////////////
//Lets auto ressurect anyone in the arena and give death tokens to the others.
Respawn(oPlayer);
// * make friendly to Each of the 3 common factions
AssignCommand(oPlayer, ClearAllActions());
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
}
//////////////////////////////////////////////////////////////////////////
//Fancy death visual effect when they die.
location lSelf = GetLocation(oPC);
effect eVis2 = EffectVisualEffect(234);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis2, lSelf);
/////////////////////////////////////////////////////////////////////////////
//Have the player tell everyone around them he is dying (actually dead)
AssignCommand(oPlayer, ActionSpeakString("I'm dying, help!",
TALKVOLUME_TALK));
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//Pop up the Death GUI Panel only if they don't meet the following..
//If the player is not immortal
if(GetItemPossessedBy(oPC, "immotoken") == OBJECT_INVALID)
{
//If the player does not have an arena token
if(GetItemPossessedBy(oPC, "arenatoken") == OBJECT_INVALID)
{
//Show the player the Death Panel
DelayCommand(2.0, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
}
}
////////////////////////PVP MESSAGE//////////////////////////////////////
///////See the const int nPVPMessage above to turn on/off)///////////////
if(nPVPMessage == TRUE)
{
////Send PVP Stats Messages to all PCs./////////
//This shouts whever a player has died, who killed them and also
//alerts DMs of any pvp action going on! (Though done below as well.)
//This can also alert DM's not playing as a DM as well too!
oPC = GetFirstPC();
int count = 0;
int nVictims = GetCampaignInt("PVP_SCORE", "iKilled", oKiller);
int vLvl = GetHitDice(oVictor);
int dLvl = GetHitDice(oPlayer);
string sKilled;
//Send Message to all PC's
sKilled = "<cá >";
sKilled += GetName(oPlayer);
sKilled += "<c áó> ";
sKilled += "Lvl ";
sKilled += IntToString(dLvl);
sKilled += "<c rÀ> Was slain by - ";
sKilled += "<c¥ >";
sKilled += GetName(oVictor);
sKilled += "<c áó> ";
sKilled += "Lvl - ";
sKilled += IntToString(vLvl);
sKilled += "<c¥ > ";
sKilled += GetName(oVictor);
sKilled += "<cP¯ > has ";
sKilled += IntToString(nVictims);
sKilled += "<c¥ > kills. </c>";
//Lets make sure the killer is a PC
if(GetIsPC(oVictor))
{
//Write the PVP Information in the log file. (For those not allowing PVP)
WriteTimestampedLogEntry("**The Following Player: ");
WriteTimestampedLogEntry(GetPCPlayerName(oVictor));
WriteTimestampedLogEntry(" - ");
WriteTimestampedLogEntry(GetPCPublicCDKey(oVictor));
WriteTimestampedLogEntry(" - ");
WriteTimestampedLogEntry(GetPCIPAddress(oVictor));
WriteTimestampedLogEntry(" ** Has Killed This Player: ");
WriteTimestampedLogEntry(GetName(oPlayer));
WriteTimestampedLogEntry(" - ");
WriteTimestampedLogEntry(GetPCPlayerName(oPlayer));
while (GetIsPC(oPC) == TRUE)
{
SendMessageToPC(oPC, sKilled);
oPC = GetNextPC();
}
}
//end PVP message function
}
////////////NO PVP ON SERVER ALLOWED!///////////
//IF PVP IS NOT ALLOWED!
if(nPVP == FALSE)
{
object oDumbo;
//If it's not a PC let's make sure an associate of a PC has not killed the PC
if(!GetIsPC(oKiller))
{
//Let's get the master of the asscoiate..
if(GetIsPC(GetMaster(oKiller)))
{
oDumbo = GetMaster(oKiller);
}
}
//Otherwise let's make sure the Attacker is a PC..
else
{
if(GetIsPC(oKiller))
{
oDumbo = oKiller;
}
}
//Let's Double Check to make sure it's a PC who killed the PC.
if(GetIsPC(oDumbo))
{
//Apply the respawn penalty to the Killer instead!!
ApplyRespawnPenalty(oDumbo);
//Raise the Player Who Died without a penalty
//Note these must be delayed because of GUI Panel!
DelayCommand(2.1,
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oDead));
DelayCommand(2.2, Raise(oDead));
//Remove the death token from the dead guy
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="death") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
string sBadPC = GetName(oDumbo);
sBadPC += " / ";
sBadPC += GetPCPlayerName(oDumbo);
sBadPC += " / ";
sBadPC += GetPCPublicCDKey(oDumbo);
sBadPC += " Has killed - ";
sBadPC += GetName(oPC);
sBadPC += " In the ";
sBadPC += GetName(GetArea(oPC));
sBadPC += " Area.";
//Send Message to All DMs about the Attack..
SendMessageToAllDMs(sBadPC);
}
//End No PVP Check..
}
//////////IF PVP IS RESTRICTED TO THE ARENA//////////////
if(nArenaOnly == TRUE)
{
//If a PC kills a PC outside of the arena..
if(GetItemPossessedBy(oDead, "arenatoken")==OBJECT_INVALID)
{
//Raise the Player Who Died
DelayCommand(2.3,
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oDead));
DelayCommand(2.4, Raise(oDead));
//Remove the death token from the dead guy
oItem = GetFirstItemInInventory(oDead);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="death") DestroyObject(oItem);
oItem = GetNextItemInInventory(oDead);
}
//Kill the offender and alert the DMs!
//Type // below at the start of the line to deactivate!
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oKiller);
//Apply the respawn penalty to the Killer instead!!
ApplyRespawnPenalty(oKiller);
//Send Message to All DMs about the Attack..
string sArena;
sArena = GetName(oKiller);
sArena += " / ";
sArena += GetPCPlayerName(oKiller);
sArena += " ";
sArena += "Has killed - ";
sArena += GetName(oDead);
sArena += "Outside of the Arena!";
SendMessageToAllDMs(sArena);
}
}
///////////////////////////////////////////////////////////////////////////
//////////////////PVP SCRIPT FUNCTIONS/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////PVP Option (See the const int nPVP above to turn on/off)///////
if (nPVP == TRUE)
{
//////Start PVP Reward/Penalty Function//////
//Only continue if the killer is a PC!
if(GetIsPC(oKiller) == TRUE)
{
//More PVP Variables
//Get the Killer's HD + nDif + 1
int nAdj = GetHitDice(oKiller) + 1;
int nCheck = nAdj + nDif;
//Will return 1 or less if they are more than nDif levels
//lower than the person they killed
int nDeed = nCheck - pLvl;
//Ok, this part rewards players for killing players who kill low
//level players, if they are flagged for killing low level players,
//and anyone can easially recognized them by the flag on thier back.
if(GetLocalInt(oDead, "effer") >=1)
{
//Lower their effy score by one.
nInt = GetLocalInt(oDead, "effer");
nInt -= 1;
//Decrement thier effer status (because they got killed)
SetLocalInt(oDead, "effer", nInt);
//If they are at 0 Effy Kills, Remove the flag from them
//Otherwise they can be killed again!!! (After it's been lowered!)
if (GetLocalInt(oDead, "effer") <=0)
{
effect eEffect;
eEffect = GetFirstEffect(oDead);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect)==EFFECT_TYPE_VISUALEFFECT)
{
//Note sure about this one!
if (EFFECT_TYPE_VISUALEFFECT == VFX_DUR_FLAG_RED)
{
RemoveEffect(oDead, eEffect);
eEffect = GetNextEffect(oDead);
}
}
}
//Now reward the Killer of the bad player with the flag.
//Adjust to your likings.
GiveGoldToCreature(oKiller, 5000);
GiveXPToCreature(oKiller, 500);
}
}
//If the player is too low of a level
//Punish them for killing a much high level player.
//This is to prevent lower level players from killing higher
//level players (which allows the higher levels to ignore them!)
if (nDeed <=1)
{
//Flag them as an Effy Killer (Because they are picking fights!)
nInt = GetLocalInt(oKiller, "effer");
nInt += 1;
int nKind;
nKind = GetObjectType(oKiller);
if (nKind != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_FLAG_RED), oKiller);
else ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_FLAG_RED), GetLocation(oKiller));
SetLocalInt(oKiller, "effer", nInt);
//Raise the Player Who Died without a penalty
//Note these must be delayed because of GUI Panel!
DelayCommand(2.1,
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oDead));
DelayCommand(2.2, Raise(oDead));
//Remove the death token from the dead guy
oItem = GetFirstItemInInventory(oDead);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="death") DestroyObject(oItem);
oItem = GetNextItemInInventory(oDead);
}
//Kill the offender & take xp/gold
//Type // below at the start of the line to deactivate!
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oKiller);
//Penalize the killer Gold / XP
ApplyRespawnPenalty(oKiller);
AssignCommand(oKiller, ClearAllActions());
AssignCommand(oKiller, ActionSpeakString("I have offended the Gods and must be punished!!!", TALKVOLUME_SHOUT));
//Notify the DMs
SendMessageToAllDMs("We have an effy kill in progress, please investigate"
+ GetName(oKiller) + ". Has Killed Player " + GetName(oDead));
//end low level check.
}
//If the killer is 5 levels higher than the player they kill
int aCheck = dLvl;
if(aCheck >= nDif)
{
//Flag them as an Effy Killer
int nInt;
nInt = GetLocalInt(oKiller, "effer");
nInt += 1;
int nKind;
nKind = GetObjectType(oKiller);
if (nKind != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_FLAG_RED), oKiller);
else ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_FLAG_RED), GetLocation(oKiller));
SetLocalInt(oDead, "effer", nInt);
//Raise the Player Who Died
//This must be delayed due to the GUI Panel that pops up.
DelayCommand(2.1,
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oDead));
DelayCommand(2.2, Raise(oDead));
//Remove the death token from the dead guy
object oItem;
oItem = GetFirstItemInInventory(oDead);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="death") DestroyObject(oItem);
oItem = GetNextItemInInventory(oDead);
}
//Kill the offender & take xp/gold
//Type // below at the start of the line to deactivate!
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oKiller);
//Take XP & Gold from the Offending Killer
if (GetHitDice(oKiller)<40)//Only if less than level 40
{
SetXP(oKiller,GetXP(oKiller)-1000);//NOTE: They can Lose a Level!
}
//Remove Gold / XP from the Offender
ApplyRespawnPenalty(oKiller);
//Make them shout that they have been bad...
AssignCommand(oKiller, ClearAllActions());
AssignCommand(oKiller, ActionSpeakString
("I have offended the Gods and must be punished!!!", TALKVOLUME_SHOUT));
//Notify the DMs
SendMessageToAllDMs("We have a low level bashing in progress, please investigate"
+ GetName(oKiller) + ". Has Killed Player " + GetName(oPlayer));
//End Effy Check..
}
//This is the reward of fair PVP
//Lets make sure the killer is at least 1 level
//lower than the player they kill
else if(aLvl >= 1)
{
//award xp/gold by level difference,
//If the player is 1 to nDif levels lower than the player they kill
if (aLvl <=nDif)
{
//Adjust this to your likings..
int nXP = aLvl * nReward1;
int nGold = aLvl * nReward2;
GiveXPToCreature(oKiller,nXP);
GiveGoldToCreature(oKiller,nGold);
//The dead guy shouts how he lost badly. :)
AssignCommand(oDead, ActionSpeakString("I got pwned!!", TALKVOLUME_SHOUT));
}
}
//If the killer is at least 1 level higher than the player they kill
else if (dLvl <=nDif)
{
//Lets make sure the killer is within 1-4 Level difference
if (dLvl >=1)
{
int nXP = dLvl * nReward1;
int nGold = dLvl * nReward2;
GiveXPToCreature(oKiller,nXP);
GiveGoldToCreature(oKiller,nGold);
//The dead guy shouts how he lost badly. :)
AssignCommand(oDead, ActionSpeakString("I got pwned!!", TALKVOLUME_SHOUT));
}
}
//end pc check
}
//end pvp function
}
/////////////////////////////////////////////////////////////////////////
//Script End WOOSH!!
}

@ -0,0 +1,104 @@
//::///////////////////////////////////////////////
//:: Script Name: everpcdying
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a character is dying. Dying
is when the character is between 0 and -9 hit
points; -10 and below is death. To use, redirect
the OnDying event script of the module to this script.
*/
//:://////////////////////////////////////////////
//:: Author : Scott Thorne
//:: Updated: July 25, 2002
//:://////////////////////////////////////////////
//::Modified by Genisys (Guile)
//::Modified On: 4/23/08 (Updated 8/10/08)
//////////////////////////////////////////////////
//Required Include
#include "nw_i0_tool"
//PROTOTYPE DECLARED
void bleed(int iBleedAmt);
//Main Script
void main()
{
//Declare Major Variables
object oDying = GetLastPlayerDying();
object oPlayer = GetLastPlayerDying();
object oPC = GetLastPlayerDying();
string ddVarName = "dd"+GetName(oPC);
object oModule = GetModule();
SetLocalInt (oModule, ddVarName, 1);
//If the player is being tortured in Hell, ressurect them...
object hell = GetArea(oPlayer);
object helltest = GetArea(GetObjectByTag("satan1"));
if (hell == helltest)
{
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer));
return;
}
AssignCommand(oDying, ClearAllActions());
AssignCommand(oDying, bleed(1));
//Main Script End
}
//PROTOTYPE DEFINED
void bleed(int iBleedAmt)
{
object oPC = GetLastPlayerDying();
if (!GetIsPC(oPC)){
return;
}
string ddVarName = "dd"+GetName(oPC);
object oModule = GetModule();
effect eBleedEff;
/* keep executing recursively until character is dead or at +1 hit points */
if (GetCurrentHitPoints() <= 0) {
/* a positive bleeding amount means damage, otherwise heal the character */
if (iBleedAmt > 0) {
eBleedEff = EffectDamage(iBleedAmt);
} else {
eBleedEff = EffectHeal(-iBleedAmt); /* note the negative sign */
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, OBJECT_SELF);
/* -10 hit points is the death threshold, at or beyond it the character dies */
if (GetCurrentHitPoints() <= -10) {
SetLocalInt (oModule, ddVarName, 1);
PlayVoiceChat(VOICE_CHAT_DEATH); /* scream one last time */
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), OBJECT_SELF); /* make death dramatic */
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF); /* now kill them */
return;
}
if (iBleedAmt > 0) { /* only check if character has not stablized */
if (d10(1) == 1) {
/* 10% chance to stablize */
iBleedAmt = -iBleedAmt; /* reverse the bleeding process */
PlayVoiceChat(VOICE_CHAT_LAUGH);
/* laugh at death -- this time */
} else {
switch (d6()) {
case 1: PlayVoiceChat(VOICE_CHAT_PAIN1); break;
case 2: PlayVoiceChat(VOICE_CHAT_PAIN2); break;
case 3: PlayVoiceChat(VOICE_CHAT_PAIN3); break;
case 4: PlayVoiceChat(VOICE_CHAT_HEALME); break;
case 5: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
case 6: PlayVoiceChat(VOICE_CHAT_HELP);
}
}
}
DelayCommand(6.0,bleed(iBleedAmt)); /* do this again next round */
}
}

@ -0,0 +1,85 @@
//Script Name: everpcequip
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 5/10/08 (updated 8/10/08)
/////////////////////////////////////////
/*
This script handles the equipping of all items tagged "arena"
Players cannot equip items in the arena unless it's tagnamed "arena"
Likewise players cannot equipt items tagnamed "arena" outside of the arena.
*/
////////////////////////////////////////
//Required Include
#include "x2_inc_switches"
//Main Script
void main()
{
//Declare Major Variables
object oItem = GetPCItemLastEquipped();
object oPC = GetPCItemLastEquippedBy();
int nSlot;
object nItem;
//You need to assign the tagname "TheArena" to any areas you deem as an Arena
//All items tagnamed "Arena" are unequipped if the person is NOT in the Arena.
//All Non-Arena items are unequipped if the player is IN the Arena
//If the player is in the arena and eqiupping a non-arena item
if(GetTag(GetArea(oPC)) == "TheArena")
{
for (nSlot=0; nSlot<NUM_INVENTORY_SLOTS; nSlot++)
{
nItem = GetItemInSlot(nSlot, oPC);
if (GetIsObjectValid(nItem))
{
//If it's not an arena item remove it!
if(GetTag(nItem) != "arena")
{
AssignCommand(oPC, ActionUnequipItem(oItem));
}
}
}
}
//If not in the arena, and equipping arena items..
if(GetTag(GetArea(oPC)) != "TheArena")
{
for (nSlot=0; nSlot<NUM_INVENTORY_SLOTS; nSlot++)
{
nItem = GetItemInSlot(nSlot, oPC);
if (GetIsObjectValid(nItem))
{
//If it's not an arena item remove it!
if(GetTag(nItem) == "arena")
{
AssignCommand(oPC, ActionUnequipItem(oItem));
}
}
}
}
////////////////BIOWARE XP2 TAG BASE SCRIPTING CODE/////////////////////////
// -------------------------------------------------------------------------
// Generic Item Script Execution Code
// If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// it will execute a script that has the same name as the item's tag
// inside this script you can manage scripts for all events by checking against
// GetUserDefinedItemEventNumber(). See x2_it_example.nss
// -------------------------------------------------------------------------
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_EQUIP);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
//End script
}

@ -0,0 +1,162 @@
//Script Name: everpclevelup
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 5/20/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
This OnPlayerLevelUp Module Event script
must be in your Module Event, it does
quite a few things when the PC levels
up, and there are optional settings
below, so please read this fully!
*/
////////////////////////////////////////
//Some of the functions below are other
//scripters work & bioware functions
///////////////////////////////////////
//Required Include (Do not touch!)
#include "fky_chat_inc"
//////////////////////////////////////////////////
//PROTOTYPE DECLARED
void SendMessageToAllPC(string sMessage);
//Main Script
void main()
{
//Declare Major Variables
object oPC = GetPCLevellingUp();
object oPP = oPC;
object oTarget;
oTarget = oPC;
int nInt;
nInt = GetObjectType(oTarget);
int nHD = GetHitDice(oPC);
effect eEffect;
location lSaved = GetLocation(oPP);
//If it's not a PC stop the script
if (!GetIsPC(oPC)) return;
//////////////SIMTOOLS//////////////////////////////////////////////////////
//If you are not using sim tools, then delete the // below this line
// /*
//These functions are for SimTools by FunkySwerve (Higher Ground)
if (ENABLE_LANGUAGES)//check to see if they gained a level in a language class, and if so, add that language
{
object oPC = GetPCLevellingUp();
if (USING_NWNX_DB)
{
if ((GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) && (!GetLocalInt(oPC, "FKY_CHAT_LANG37")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG37", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG37", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG44")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG44", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG44", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG5")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG5", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG5", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG14")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG14", TRUE);
SetPersistentInt(oPC, "FKY_CHAT_LANG14", TRUE);
}
}
else
{
object oStorage = GetItemPossessedBy(oPC, TAG_OF_LANGUAGE_STORAGE_OBJECT);
if ((GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) && (!GetLocalInt(oPC, "FKY_CHAT_LANG37")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG37", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG37", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG44")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG44", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG44", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG5")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG5", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG5", TRUE);
}
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) && (!GetLocalInt(oPC, "FKY_CHAT_LANG14")))
{
SetLocalInt(oPC, "FKY_CHAT_LANG14", TRUE);
SetLocalInt(oStorage, "FKY_CHAT_LANG14", TRUE);
}
}
}
// DON'T TOUCH THIS LINE! */
///////////PLAYER LOCATION SAVING////////////////////////////////////////
//These functions save the location of the player, the control for this
//option are in the "startingjump" script which must go in your loading
//area for your module's starting area..
//Store the PC's current location..
//Type // at the start of both functions below to deactive it.
SetCampaignLocation(GetName(GetModule()), "SAVED_LOC", lSaved, oPP);
//Tell the PC thier location was saved..
SendMessageToPC(oPC, "Location Saved.");
////////////AUTOMATIC CHARACTER SAVING ON LEVEL UP OPTION///////////////////
//Delete the // on the next 2 lines below to activate Automatic Character Saving.
// DelayCommand(2.0, ExportSingleCharacter(oPC));
// FloatingTextStringOnCreature("Your character was saved!", oPC);
//////////////////////////////////////////////////////////////////////////////
if(nHD == 5 || nHD == 10 || nHD == 15 || nHD == 20 ||
nHD == 25 || nHD == 30 || nHD == 35 || nHD == 40)
{
SendMessageToAllPC(GetName(oPC) + " has reached level " + IntToString(nHD)
+ " Congratulations!");
if(nHD == 40)
{
//Lets make them concealed 40%
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Make all level 40 PCs glow like a ghost
ApplyEffectToObject(DURATION_TYPE_PERMANENT,
SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC);
}
}
//Apply a visual effect of knock each time a PC levels up :)
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), GetLocation(oTarget));
//////////////ANTI-CHEATING OPTION/////////////////////////////////////////
//This function scans the PC who just leveled up to see if they are playing
//a legal character or not, just delete the // below to use
//DelayCommand(2.0, ExecuteScript("cheatercheck4", oPC));
////////////////////////////////////////////////////////////////////////////
//Main Script End
}
//PROTOTYPE DEFINED
void SendMessageToAllPC(string sMessage)
{
object oPC = GetFirstPC();
while(GetIsObjectValid(oPC))
{
SendMessageToPC(oPC, sMessage);
oPC = GetNextPC();
}
}

@ -0,0 +1,143 @@
//Script Name: everpcrespawn
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 5/20/08 (Updated 8/10/08)
/////////////////////////////////////////
/*
This script goes in your OnPlayerRespawn
Module Event, it determines where to
send the player when they die, also, it
applies a respawn penalty depending upon
their level, this system was also designed
for Legendary Levels (By Higher Ground)
which is in the "setxp_inc" include.
IMPORTANT: You must have a way point in your module tagnamed "deathway"
This is where all of the PCs who respawn go to!
*/
////////////////////////////////////////
//Redundant Variables Declared
object oItem;
effect eEffect;
object oTarget;
location lTarget;
//Required Includes
#include "nw_i0_plot"
//This include will penalize the PC when they respawn.
#include "setxp_inc"
//PROTOTYPE DECLARED
void Raise(object oPlayer);
//Main Script
void main()
{
object oPC = GetLastRespawnButtonPresser();
if (!GetIsPC(oPC)) return;
//////////////////IMPORTANT OPTION//////////////////////////////////
//Optionally you can use the script portpctodeath to teleport the pc
//Back to where they died, this function below allows this to happen
SetLocalLocation(oPC, "ls_death_loc", GetLocation(oPC));
////////////////////////////////////////////////////////////////////
//This removes the death token from the PC which prevents them
//from logging out to cheat the death respawn penalty and live again.
if (GetItemPossessedBy(oPC, "death")!= OBJECT_INVALID)
{
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="death") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
//Resurrect & Heal The Player.
Raise(oPC);
//Apply a cool visual effect to level 40s..
int nLvl = GetHitDice(oPC);
if (nLvl >=40)
{
//Lets make the concealed 40%
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Lets make the look like a ghost.. :)
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC);
}
//Send them to Fugue
oTarget = GetWaypointByTag("respawnpt");
lTarget = GetLocation(oTarget);
//Apply a respawn penalty (See the setxp_inc script)
ApplyRespawnPenalty(oPC);
//If the location is valid, send them there..
if (GetArea(GetAreaFromLocation(lTarget))!=OBJECT_INVALID)
{
//Send the PC to the waypoint tagnamed "deathway"
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
}
//Otherwise if the area is not valid..
else
{
//Otherwise they respawn where they died.
}
//Main Script End
}
//////BIOWARE STANDARD Raise OnDeath FUNCTION///////////
//PROTOTYPE DEFINED
// Raise OnDeath function
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
effect eBad = GetFirstEffect(oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
//Remove effect if it is negative.
RemoveEffect(oPlayer, eBad);
}
eBad = GetNextEffect(oPlayer);
}
//Fire cast spell at event for the specified target
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

@ -0,0 +1,130 @@
//Script Name: everpcrest
///////////////////////////////////////
//Created by Genisys / Guile
//Created on: 3/11/08 (Updated 8/10/08
//////////////////////////////////////
/*
This is my premier OnPlayerRest
Module Properties Event script
to handle rest within all of my
module..
*/
//////////////////////////////////////
//Redundant Variable
effect eEffect;
//Main Script
void main()
{
//Declare Major Variables
object oPC=GetLastPCRested();
object oPP = oPC;
location lSaved = GetLocation(oPP);
int nRestType=GetLastRestEventType();
int nHD = GetHitDice(oPC);
//Determine which Event has happened and run the script for that event.
switch (nRestType)
{
/////////////////////////////////////////////////////////////////////////////
case REST_EVENTTYPE_REST_STARTED:
{
//Dark the screen out on the PC..
FadeToBlack(oPC, FADE_SPEED_FAST);
//Your code goes here.
}
break;
////////////////////////////////////////////////////////////////////////////
case REST_EVENTTYPE_REST_FINISHED:
{
//remove the black out from thier screen..
FadeFromBlack(oPC, FADE_SPEED_SLOW);
//Store the PC's location, so they can come back here after relogging
SetCampaignLocation(GetName(GetModule()), "SAVED_LOC", lSaved, oPP);
//Tell the PC their location was saved..
SendMessageToPC(oPP, "Location Saved!");
FloatingTextStringOnCreature("Your character was saved.", oPC);
//Delete the // below to activate autosave when pc's finish resting.
// DelayCommand(1.0, ExportSingleCharacter(oPC));
if(nHD == 40)
{
//If the player is Legendary Level 60 give them a cool power!
if(GetXP(oPC) >5000000)
{
//The legendary character is immune to death!
eEffect = EffectImmunity(IMMUNITY_TYPE_ABILITY_DECREASE);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//The legendary character is immune to poison!
eEffect = EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
}
//Make ALL level 40s have 40% concealment
//Make them harder to hit 40% miss chance...
eEffect = EffectConcealment(40);
eEffect = SupernaturalEffect(eEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
//Apply the Ghost Like Visual to all Level 40 PCs
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT,
SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_WHITE)), oPC));
}
//if the PC is immortal (has the immotoken)
if (GetItemPossessedBy(oPC, "immotoken")!= OBJECT_INVALID)
{
//See this script to adjust the immortal options..
ExecuteScript("powerimmortal", oPC);
}
//Your code goes here.
}
break;
////////////////////////////////////////////////////////////////////////
case REST_EVENTTYPE_REST_CANCELLED:
{
FloatingTextStringOnCreature("Your character was not saved!", oPC);
FadeFromBlack(oPC, FADE_SPEED_MEDIUM);
//Your code goes here.
}
break;
/////////////////////////////////////////////////////////////////////////
default: //You will probably never see this message..
SendMessageToPC(oPC,
"If you see this message tell the DMs there is an error in the rest event script.");
//Switch Statement end..
}
//Main Script end
}

@ -0,0 +1,96 @@
//:: Script Name: everpcunequip
//::///////////////////////////////////////////////
//:: Example XP2 OnItemEquipped
//:: x2_mod_def_unequ
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
// Put into the: OnUnEquip Module Event
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
//Modified By Guile 3/24/08 (Updated 8/10/08)
//This modifcation stops a weapon switching exploit
//Which gives the makes the PC never miss!!!
///////////////////////////////////////////////////
//Required Includes
#include "x2_inc_switches"
#include "x2_inc_intweapon"
//Main Script
void main()
{
object oItem = GetPCItemLastUnequipped();
object oPC = GetPCItemLastUnequippedBy();
if (!GetIsPC(oPC)) return;
//This is my weapon swap pvp exploit fix
//Lets make sure they are actually fighting someone
if(GetIsInCombat(oPC))
{
//Lets make sure it's a weapon or shield they are unequipping
if(GetBaseItemType(oItem) != BASE_ITEM_AMULET)
{if(GetBaseItemType(oItem) != BASE_ITEM_ARROW)
{if(GetBaseItemType(oItem) != BASE_ITEM_BELT)
{if(GetBaseItemType(oItem) != BASE_ITEM_BOLT)
{if(GetBaseItemType(oItem) != BASE_ITEM_BOOTS)
{if(GetBaseItemType(oItem) != BASE_ITEM_BRACER)
{if(GetBaseItemType(oItem) != BASE_ITEM_CLOAK)
{if(GetBaseItemType(oItem) != BASE_ITEM_HELMET)
{if(GetBaseItemType(oItem) != BASE_ITEM_BULLET)
{if(GetBaseItemType(oItem) != BASE_ITEM_RING)
{
DelayCommand(0.5, AssignCommand(oPC, ClearAllActions()));
}}}}}}}}}}
//Exploit Fix END
}
///////////////////////////////////////////////////////////////////////////
//Your Code Goes here..
///////////////////////////////////////////////////////////////////////////
///////////////////BIOWARE XP2 FUNCTIONS///////////////////////////////////
//Commented out because I am not using it...
/* Delete this line to activate
// -------------------------------------------------------------------------
// Intelligent Weapon System
// -------------------------------------------------------------------------
if (IPGetIsIntelligentWeapon(oItem))
{
IWSetIntelligentWeaponEquipped(oPC,OBJECT_INVALID);
IWPlayRandomUnequipComment(oPC,oItem);
}
// DO NOT TOUCH THIS LINE! */
///////////////////////XP2 TAGBASED SCRIPTING CODE///////////////////////////
// -------------------------------------------------------------------------
// Generic Item Script Execution Code
// If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// it will execute a script that has the same name as the item's tag
// inside this script you can manage scripts for all events by checking against
// GetUserDefinedItemEventNumber(). See x2_it_example.nss
// -------------------------------------------------------------------------
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNEQUIP);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
//Main Script End
}

@ -0,0 +1,108 @@
//Script Name: onunaquireitem
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 3/05/08 (Update 8/10/08)
/////////////////////////////////////////
/*
This script goes in the OnUnAquireItem
Module Event in the Module Properties
This script accurately nails a player
for pick pocketing another player.
It doesn't fire if they are pick
pocketing anything but a player.
The Tag Standard Bioware Tag-Based
Scripting will still fire reguardless.
*/
////////////////////////////////////////
//Required Include
#include "x2_inc_switches"
void main()
{
//IMPORTANT THIS MUST BE IN YOUR OnUnAcquireItem Module Event Script
//This is a fix for the Inventory Organizing System!
object oPC = GetModuleItemLostBy();
if(GetLocalInt(oPC, "ORGANIZING")==1)
{ return; }
object oItem = GetModuleItemLost();
object oRobbed;
oRobbed = GetModuleItemLostBy();
object oThief;
oThief = GetModuleItemAcquiredBy();
object oLost;
oLost = GetModuleItemLost();
object oFound;
oFound = GetModuleItemAcquired();
string sMsg;
sMsg = "You can't pick player's pockets, it's not permitted!";
//Let's make sure the thief is a PC, or continue on to the tag based scripting
if (GetIsPC(oThief))
{
//Lets see if they have Pick Pocket Skills
if(GetSkillRank(SKILL_PICK_POCKET, oThief, TRUE)>0)
{
//Lets make sure they took it from a PC and not an NPC or Monster.
if(GetIsPC(oRobbed))
{
//Let's make sure the thief isn't crafting.
if(oRobbed != oThief)
{
//Lets make sure the the thief is the one who disturbed the inventory
//of the person who lost the item. (This needs to be tested thoroughly)
// if(GetLastDisturbed()== oThief)
//Delete the // Below and the // where } appears below as well to activate.
// {
//Give the item back, destroy the one they took, and kill the thief.
ActionTakeItem(oFound, oThief);
ActionGiveItem(oFound, oRobbed);
SendMessageToPC(oThief, sMsg);
effect eEffect;
eEffect = EffectDeath();
eEffect = SupernaturalEffect(eEffect);
DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oThief));
AssignCommand(oThief, SpeakString("I'm a thief!!", TALKVOLUME_SHOUT));
//}
}
}
}
}
//This script destroys all items dropped if not in combat (disarmed)
//or if the item is put into a container in the module.
//Simply place // before Execute to turn off.
ExecuteScript("trashem",OBJECT_SELF);
///////////////////////////////////////////////////////////////////////////
//Your Code Goes here...
///////////////////////////////////////////////////////////////////////////
///////////STANDARD XP2 TAG BASED SCRIPTING CODE///////////////////////////
//Tag Based Scripting Check
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNACQUIRE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
//Main Script End
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,39 @@
// This lists all of the constant ints that are to be used for LL
// This is the path to your servervault. It must be set correctly for Letoscript to work.
const string NWNPATH = "C:/NeverwinterNights/NWN/servervault/";//windows sample
// const string NWNPATH = "/home/funkyswerve/nwn/servervault/";//linux sample
const int PHOENIX = FALSE;//set this to true if you are using the older version of Letoscript, 3-18, rather than the newer 3-24 (other versions are 'bridge' versions with bugs)
const int DEBUG = FALSE;//set this to TRUE to enable debugging
const int DEV_CRIT_DISABLED = FALSE;//set this to TRUE to disable devastating critical feat selection on levelup
// Experience Requirements for Legendary Levels
// Adjust as desired. These were set by increasing the additional amount required for the
// previous level by 25%. Level 40 required 39000 experience points, so Level 41 was set
// to require 39000 x 1.25 = 48800 experience points. This will be ALOT on some worlds,
// and not enough on others, so adjust to suit your needs
const int BASE_XP_LVL_40 = 780000;
const int XP_REQ_LVL41 = 821000;
const int XP_REQ_LVL42 = 863000;
const int XP_REQ_LVL43 = 900000;
const int XP_REQ_LVL44 = 100000;
const int XP_REQ_LVL45 = 1100000;
const int XP_REQ_LVL46 = 1200000;
const int XP_REQ_LVL47 = 1300000;
const int XP_REQ_LVL48 = 1400000;
const int XP_REQ_LVL49 = 1600000;
const int XP_REQ_LVL50 = 1800000;
const int XP_REQ_LVL51 = 2200000;
const int XP_REQ_LVL52 = 2400000;
const int XP_REQ_LVL53 = 2600000;
const int XP_REQ_LVL54 = 2800000;
const int XP_REQ_LVL55 = 3000000;
const int XP_REQ_LVL56 = 3400000;
const int XP_REQ_LVL57 = 3800000;
const int XP_REQ_LVL58 = 4200000;
const int XP_REQ_LVL59 = 4600000;
const int XP_REQ_LVL60 = 5000000;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,284 @@
#include "hgll_const_inc"
//--------------------------------DECLARATIONS--------------------------------//
// This function bridges Letoscript into NWNX.
string LetoScript(string script);
// This function returns the bicfilename of the character specified.
string GetBicFileName(object oPC);
// This function finds the most recently edited .bic file in the player's folder,
// and applies whatever changes are conatained within the string of Letoscript. You must
// set the path to your servervault folder in the hgll_const_inc script for it to work.
// The easiest way to ensure that the ingame character is the most recently edited
// file is to save the character at least 3 seconds or more before calling this function.
void ApplyLetoScriptToPC(string Script, object oPC);
// This function tells Letoscript to add a stat point to the specified stat.
string AddStatPoint(int nStat);
// This function tells Letoscript to add a skill point to the specified skill.
string AddSkillPoint(int iSkill);
// This function tells Letoscript to add +1 to all the character's saving throws.
string ModifySaves();
// This function tells Letoscript to add the specified number of hit points to the character.
string AddHitPoints(int nHP, int nLevel);
// This function tells Letoscript to add the specified feat to the character, treating
// it as if he had gained it on character creation (level 0). This ensures that deleveling
// the character thus will not remove the feat.
string AddFeat(int iFeat = -1);
//----------------------------------FUNCTIONS---------------------------------//
//--------------------------FUNCTIONS TAKEN FROM DAR--------------------------//
string LetoScript(string script)
{
SetLocalString(GetModule(), "NWNX!LETO!SCRIPT", script);
return GetLocalString(GetModule(), "NWNX!LETO!SCRIPT");
}
string SetDocumentedLevel(int level = 1) {
string script = "";
if (PHOENIX)
{
if(level > -1) script = "<gff:set 'Lootable' {value="+IntToString(level)+"}>";
}
else
{
if(level > -1) script = "/Lootable = "+IntToString(level)+";";
}
return script;
}
string GetBicFileName(object oPC)
{
string sChar, sBicName;
string sPCName = GetStringLowerCase(GetName(oPC));
int i, iNameLength = GetStringLength(sPCName);
for(i=0; i < iNameLength; i++) {
sChar = GetSubString(sPCName, i, 1);
if (TestStringAgainstPattern("(*a|*n|*w|'|-|_)", sChar)) {
if (sChar != " ") sBicName += sChar;
}
}
return GetStringLeft(sBicName, 16);
}
//------------------------------FUNCTIONS ADDED-------------------------------//
void ApplyLetoScriptToPC(string Script, object oPC)
{
string VaultPath = NWNPATH;
string Player = GetPCPlayerName(oPC);
string BicPath = VaultPath + Player + "/";
string BicFile;
if (PHOENIX)
{
BicFile = BicPath + GetBicFileName(oPC)+ ".bic";
Script = "<file:open 1 <qq:"+BicFile+">>"+Script+"<file:save 1 <qq:"+BicFile+">><file:close 1>";
}
else
{
Script =
"$RealFile = q<" + BicPath + "> + FindNewestBic q<" + BicPath + ">;" +
"$EditFile = $RealFile + '.utc';" +
"FileRename $RealFile, $EditFile;" +
"%bic = $EditFile or die;" +
Script +
"%bic = '>';" +
"close %bic;" +
"FileRename $EditFile, $RealFile;";
}
SetLocalString(oPC, "LetoScript", Script);
//DelayCommand(3.0f, ActivatePortal(oPC, "62.167.237.11:5122", "", "",TRUE));
DelayCommand(3.0f, BootPC(oPC));
//DelayCommand(3.0f, ActivatePortal(oPC, "64.137.237.115:5121", "", "", TRUE));
}
string AddStatPoint(int nStat)
{
string sReturn;
switch (nStat)
{
case ABILITY_STRENGTH: sReturn = "Str"; break;
case ABILITY_DEXTERITY: sReturn = "Dex"; break;
case ABILITY_CONSTITUTION: sReturn = "Con"; break;
case ABILITY_INTELLIGENCE: sReturn = "Int"; break;
case ABILITY_WISDOM: sReturn = "Wis"; break;
case ABILITY_CHARISMA: sReturn = "Cha"; break;
default: return "";
}
if (PHOENIX)
{
return "<gff:set '"+sReturn+"' {value=(<"+sReturn+">+1)}>";
}
else
{
return "/"+sReturn+" = /"+sReturn+" + 1;";
}
}
string AddSkillPoint(int iSkill)
{
string sSkill = IntToString(iSkill);
if (PHOENIX)
{
return
"<gff:set 'SkillList/["+sSkill+"]/Rank' {value=(<SkillList/["+sSkill+"]/Rank>+1)}>"+
"<gff:set 'LvlStatList/[0]/SkillList/["+sSkill+"]/Rank' {value=(<SkillList/["+sSkill+"]/Rank>+1)}>";
}
else
{
return
"/SkillList/["+sSkill+"]/Rank = /SkillList/["+sSkill+"]/Rank +1; "+
"/LvlStatList/[0]/SkillList/["+sSkill+"]/Rank = /SkillList/["+sSkill+"]/Rank +1; ";
}
}
string ModifySaves()
{
string sLeto;
if (PHOENIX)
{
sLeto = "<gff:set 'fortbonus' {type='byte' value=<gff:get 'fortbonus'>+1}>" +
"<gff:set 'refbonus' {type='byte' value=<gff:get 'refbonus'>+1}>" +
"<gff:set 'willbonus' {type='byte' value=<gff:get 'willbonus'>+1}>";
}
else
{
sLeto = "/fortbonus = /fortbonus +1; /refbonus = /refbonus +1; /willbonus = /willbonus +1; ";
}
return sLeto;
}
string AddHitPoints(int nHP, int nLevel)
{
int nLvlHPAddedAt;
string sLeto;
string sLvl;
string sHP = IntToString(nHP);
if (nLevel < 41)
{
nLvlHPAddedAt = 0;//we add the hp at a different level each level so that the 255 field limit is never reached - if it was, it would roll over, causing the loss of 255 hps
}
else
{
nLvlHPAddedAt = nLevel - 40;
}
sLvl = IntToString(nLvlHPAddedAt);
if (PHOENIX)
{
sLeto = "<gff:set 'HitPoints' {type='short' value=<gff:get 'HitPoints'>+" + sHP + "}>" +
"<gff:set 'LvlStatList/["+sLvl+"]/LvlStatHitDie' {type='short' value=<gff:get 'LvlStatList/["+sLvl+"]/LvlStatHitDie'>+" + sHP + "}>" +
"<gff:set 'MaxHitPoints' {type='short' value=<gff:get 'MaxHitPoints'>+" + sHP + "}>" +
"<gff:set 'CurrentHitPoints' {type='short' value=<gff:get 'CurrentHitPoints'>+" + sHP + "}>" +
"<gff:set 'PregameCurrent' {type='short' value=<gff:get 'PregameCurrent'>+" + sHP + "}>";
}
else
{
sLeto = "/HitPoints = /HitPoints + " + sHP + "; ";
sLeto += "/LvlStatList/[" + IntToString(nLvlHPAddedAt) + "]/LvlStatHitDie = /LvlStatList/[" + IntToString(nLvlHPAddedAt) + "]/LvlStatHitDie + " + sHP + "; ";
sLeto += "/MaxHitPoints = /MaxHitPoints + " + sHP + "; ";
sLeto += "/CurrentHitPoints = /CurrentHitPoints + " + sHP + "; ";
sLeto += "/PregameCurrent = /PregameCurrent + " + sHP + "; ";
}
return sLeto;
}
string AddFeat(int iFeat = -1)
{
string sLeto;
string sEnd;
if(iFeat < 0) return "";
if(iFeat > 763 && iFeat < 824)//Greater Ability Feats
{
if(iFeat <= 773)//CHA
{
if (PHOENIX)
{
sLeto = "<gff:set 'Cha' {value=(<Cha>+1)}>";
}
else
{
sLeto = "/Cha = /Cha + 1;";
}
}
else if(iFeat <= 783)//CON
{
if (PHOENIX)
{
sLeto = "<gff:set 'Con' {value=(<Con>+1)}>";
}
else
{
sLeto = "/Con = /Con + 1;";
}
}
else if(iFeat <= 793)//DEX
{
if (PHOENIX)
{
sLeto = "<gff:set 'Dex' {value=(<Dex>+1)}>";
}
else
{
sLeto = "/Dex = /Dex + 1;";
}
}
else if(iFeat <= 803)//INT
{
if (PHOENIX)
{
sLeto = "<gff:set 'Int' {value=(<Int>+1)}>";
}
else
{
sLeto = "/Int = /Int + 1;";
}
}
else if(iFeat <= 813)//WIS
{
if (PHOENIX)
{
sLeto = "<gff:set 'Wis' {value=(<Wis>+1)}>";
}
else
{
sLeto = "/Wis = /Wis + 1;";
}
}
else // <= 823 STR
{
if (PHOENIX)
{
sLeto = "<gff:set 'Str' {value=(<Str>+1)}>";
}
else
{
sLeto = "/Str = /Str + 1;";
}
}
}
else
{
sLeto = "";
}
if (PHOENIX)
{
sEnd = "<gff:add 'FeatList/Feat' {type='word' value="+IntToString(iFeat)+"}>" +
"<gff:add 'LvlStatList/[0]/FeatList/Feat' {type='word' value="+IntToString(iFeat)+"}>";
}
else
{
sEnd = "add /FeatList/Feat, type => gffWord, value => " + IntToString(iFeat) + ";" +
"add /LvlStatList/[0]/FeatList/Feat, type => gffWord, value => " + IntToString(iFeat) + ";";
}
return sLeto + sEnd;
}
//below used to compile
/*
void main()
{
}
*/

@ -0,0 +1,808 @@
//Returns the level of the input bard spell. Returns -1 if the input is not a bard spell.
int GetBardSpellLevel(int nSpell);
//Returns the level of the input sorcerer spell. Returns -1 if the input is not a sorcerer spell.
int GetSorcSpellLevel(int nSpell);
//This returns the name of any input sorcerer or bard spell.
string GetSpellName(int nSpell);
int GetBardSpellLevel(int nSpell)
{
int nResult = -1; //Defaults to not a Bard Spell
switch (nSpell/150)
{
case 0://0-149
switch (nSpell/25)
{
case 0://0-24
switch(nSpell)
{
case 4: nResult=3; break;
case 8: nResult=2; break;
case 9: nResult=2; break;
case 13: nResult=2; break;
case 15: nResult=3; break;
case 16: nResult=1; break;
case 20: nResult=3; break;
case 21: nResult=2; break;
}
break;
case 1://25-49
switch(nSpell)
{
case 26: nResult=3; break;
case 31: nResult=4; break;
case 32: nResult=1; break;
case 33: nResult=0; break;
case 34: nResult=2; break;
case 35: nResult=3; break;
case 36: nResult=2; break;
case 37: nResult=0; break;
case 40: nResult=4; break;
case 41: nResult=3; break;
case 45: nResult=4; break;
}
break;
case 2://50-74
switch(nSpell)
{
case 54: nResult=3; break;
case 66: nResult=1; break;
case 67: nResult=5; break;
}
break;
case 3://75-99
switch(nSpell)
{
case 75: nResult=3; break;
case 78: nResult=3; break;
case 80: nResult=5; break;
case 82: nResult=4; break;
case 83: nResult=2; break;
case 86: nResult=1; break;
case 88: nResult=4; break;
case 90: nResult=2; break;
case 92: nResult=3; break;
case 94: nResult=1; break;
}
break;
case 4://100-124
switch(nSpell)
{
case 100: nResult=0; break;
case 102: nResult=1; break;
case 113: nResult=6; break;
case 118: nResult=5; break;
case 120: nResult=2; break;
case 121: nResult=5; break;
}
break;
case 5://125-149
switch(nSpell)
{
case 126: nResult=4; break;
case 146: nResult=3; break;
case 147: nResult=3; break;
}
break;
}
break;
case 1://150-299
switch (nSpell/25)
{
case 6://150-174
switch (nSpell)
{
case 151: nResult=0; break;
case 155: nResult=1; break;
case 157: nResult=2; break;
case 163: nResult=2; break;
case 165: nResult=1; break;
case 166: nResult=3; break;
case 167: nResult=2; break;
case 174: nResult=1; break;
}
break;
case 7://175-199
switch (nSpell)
{
case 175: nResult=2; break;
case 176: nResult=3; break;
case 177: nResult=4; break;
case 179: nResult=5; break;
case 180: nResult=6; break;
}
break;
}
break;
case 2://300-449
switch (nSpell/25)
{
case 12://300-324
switch (nSpell)
{
case 321: nResult=1; break;
case 322: nResult=3; break;
}
break;
case 14://350-374
switch (nSpell)
{
case 354: nResult=2; break;
case 355: nResult=2; break;
case 356: nResult=2; break;
case 365: nResult=2; break;
case 368: nResult=6; break;
case 369: nResult=6; break;
case 373: nResult=4; break;
}
break;
case 15://375-399
switch (nSpell)
{
case 376: nResult=4; break;
case 377: nResult=3; break;
}
break;
case 16://400-424
switch (nSpell)
{
case 416: nResult=0; break;
}
break;
case 17://425-449
switch (nSpell)
{
case 436: nResult=1; break;
case 442: nResult=1; break;
case 445: nResult=6; break;
}
break;
}
break;
case 3://450-569
switch (nSpell/25)
{
case 18://450-474
switch (nSpell)
{
case 456: nResult=1; break;
case 457: nResult=2; break;
case 458: nResult=3; break;
}
break;
case 21://525-549
switch (nSpell)
{
case 539: nResult=3; break;
case 544: nResult=1; break;
case 545: nResult=3; break;
}
break;
case 22://550-569
switch (nSpell)
{
case 569: nResult=2; break;
}
break;
}
break;
}
return nResult;
}
int GetSorcSpellLevel(int nSpell)
{
int nResult=-1;//Defaults to not a sorcerer spell
switch (nSpell/150)
{
case 0://0-149
switch (nSpell/25)
{
case 0://0-24
switch (nSpell)
{
case 0: nResult=6; break;
case 2: nResult=5; break;
case 4: nResult=4; break;
case 8: nResult=2; break;
case 9: nResult=2; break;
case 10: nResult=1; break;
case 13: nResult=2; break;
case 14: nResult=6; break;
case 15: nResult=4; break;
case 16: nResult=1; break;
case 18: nResult=6; break;
case 20: nResult=3; break;
case 21: nResult=3; break;
case 23: nResult=5; break;
case 24: nResult=1; break;
}
break;
case 1://25-49
switch (nSpell)
{
case 25: nResult=5; break;
case 26: nResult=4; break;
case 27: nResult=4; break;
case 28: nResult=7; break;
case 30: nResult=8; break;
case 36: nResult=2; break;
case 37: nResult=0; break;
case 39: nResult=7; break;
case 40: nResult=5; break;
case 41: nResult=3; break;
case 44: nResult=9; break;
case 45: nResult=5; break;
case 47: nResult=4; break;
case 49: nResult=2; break;
}
break;
case 2://50-74
switch (nSpell)
{
case 50: nResult=1; break;
case 51: nResult=9; break;
case 52: nResult=4; break;
case 54: nResult=4; break;
case 55: nResult=5; break;
case 56: nResult=7; break;
case 58: nResult=3; break;
case 59: nResult=3; break;
case 63: nResult=9; break;
case 64: nResult=2; break;
case 65: nResult=6; break;
case 66: nResult=1; break;
case 67: nResult=6; break;
case 69: nResult=8; break;
case 71: nResult=5; break;
case 72: nResult=6; break;
case 73: nResult=9; break;
case 74: nResult=6; break;
}
break;
case 3://75-99
switch (nSpell)
{
case 75: nResult=3; break;
case 78: nResult=3; break;
case 82: nResult=5; break;
case 83: nResult=3; break;
case 86: nResult=1; break;
case 88: nResult=4; break;
case 89: nResult=8; break;
case 90: nResult=2; break;
case 92: nResult=3; break;
case 93: nResult=2; break;
case 94: nResult=2; break;
case 95: nResult=5; break;
case 96: nResult=5; break;
case 98: nResult=4; break;
case 99: nResult=5; break;
}
break;
case 4://100-124
switch (nSpell)
{
case 100: nResult=0; break;
case 101: nResult=3; break;
case 102: nResult=1; break;
case 107: nResult=1; break;
case 110: nResult=8; break;
case 111: nResult=8; break;
case 113: nResult=6; break;
case 115: nResult=2; break;
case 116: nResult=9; break;
case 117: nResult=8; break;
case 118: nResult=5; break;
case 119: nResult=4; break;
case 120: nResult=2; break;
case 121: nResult=6; break;
case 122: nResult=9; break;
case 123: nResult=7; break;
}
break;
case 5://125-149
switch (nSpell)
{
case 127: nResult=4; break;
case 128: nResult=6; break;
case 130: nResult=4; break;
case 131: nResult=9; break;
case 132: nResult=7; break;
case 134: nResult=8; break;
case 135: nResult=7; break;
case 137: nResult=3; break;
case 141: nResult=7; break;
case 143: nResult=1; break;
case 144: nResult=0; break;
case 145: nResult=4; break;
case 146: nResult=4; break;
}
break;
}
break;
case 1://150-299
switch (nSpell/25)
{
case 6://150-174
switch (nSpell)
{
case 150: nResult=2; break;
case 151: nResult=0; break;
case 155: nResult=1; break;
case 157: nResult=2; break;
case 158: nResult=6; break;
case 159: nResult=4; break;
case 160: nResult=7; break;
case 161: nResult=9; break;
case 165: nResult=1; break;
case 166: nResult=3; break;
case 169: nResult=7; break;
case 171: nResult=3; break;
case 172: nResult=4; break;
case 174: nResult=1; break;
}
break;
case 7://175-199
switch (nSpell)
{
case 175: nResult=2; break;
case 176: nResult=3; break;
case 177: nResult=4; break;
case 178: nResult=9; break;
case 179: nResult=5; break;
case 180: nResult=6; break;
case 181: nResult=7; break;
case 182: nResult=8; break;
case 184: nResult=6; break;
case 185: nResult=9; break;
case 186: nResult=6; break;
case 188: nResult=3; break;
case 190: nResult=9; break;
case 191: nResult=4; break;
case 192: nResult=2; break;
case 193: nResult=9; break;
}
break;
}
break;
case 2://300-449
switch (nSpell/25)
{
case 12://300-324
switch (nSpell)
{
case 321: nResult=1; break;
case 322: nResult=3; break;
}
break;
case 14://350-374
switch (nSpell)
{
case 354: nResult=2; break;
case 355: nResult=2; break;
case 356: nResult=2; break;
case 365: nResult=2; break;
case 367: nResult=8; break;
case 368: nResult=4; break;
case 369: nResult=5; break;
case 370: nResult=3; break;
case 371: nResult=1; break;
}
break;
case 15://375-399
switch (nSpell)
{
case 375: nResult=4; break;
case 376: nResult=6; break;
case 377: nResult=3; break;
}
break;
case 16://400-424
switch (nSpell)
{
case 415: nResult=1; break;
case 416: nResult=0; break;
case 417: nResult=1; break;
case 419: nResult=2; break;
case 424: nResult=0; break;
}
break;
case 17://425-449
switch (nSpell)
{
case 427: nResult=8; break;
case 430: nResult=7; break;
case 436: nResult=2; break;
case 439: nResult=0; break;
case 440: nResult=5; break;
case 443: nResult=8; break;
case 447: nResult=1; break;
case 448: nResult=6; break;
}
break;
}
break;
case 3://450-569
switch (nSpell/25)
{
case 18://450-474
switch (nSpell)
{
case 456: nResult=1; break;
case 457: nResult=2; break;
case 458: nResult=3; break;
case 459: nResult=5; break;
case 460: nResult=6; break;
case 461: nResult=7; break;
case 462: nResult=8; break;
case 463: nResult=9; break;
}
break;
case 19://475-499
switch (nSpell)
{
case 485: nResult=6; break;
case 486: nResult=6; break;
}
break;
case 20://500-524
switch (nSpell)
{
case 515: nResult=7; break;
case 516: nResult=5; break;
case 518: nResult=2; break;
case 519: nResult=2; break;
case 520: nResult=2; break;
case 521: nResult=1; break;
case 522: nResult=1; break;
case 523: nResult=3; break;
case 524: nResult=5; break;
}
break;
case 21://525-549
switch (nSpell)
{
case 526: nResult=3; break;
case 527: nResult=2; break;
case 528: nResult=6; break;
case 533: nResult=9; break;
case 534: nResult=1; break;
case 539: nResult=3; break;
case 541: nResult=8; break;
case 542: nResult=2; break;
case 543: nResult=1; break;
case 544: nResult=1; break;
case 545: nResult=3; break;
}
break;
case 22://550-569
switch (nSpell)
{
case 569: nResult=2; break;
}
break;
}
break;
}
return nResult;
}
string GetSpellName(int nSpell)
{
string sResult = "";
switch (nSpell/150)
{
case 0://0-149
switch (nSpell/25)
{
case 0://0-24
switch (nSpell)
{
case 0: sResult = "Acid Fog"; break;
case 2: sResult = "Animate Dead"; break;
case 4: sResult = "Bestow Curse"; break;
case 8: sResult = "Blindness and Deafness"; break;
case 9: sResult = "Bull's Strength"; break;
case 10: sResult = "Burning Hands"; break;
case 13: sResult = "Cat's Grace"; break;
case 14: sResult = "Chain Lightning"; break;
case 15: sResult = "Charm Monster"; break;
case 16: sResult = "Charm Person"; break;
case 18: sResult = "Circle of Death"; break;
case 20: sResult = "Clairaudience and Clairvoyance"; break;
case 21: sResult = "Clarity"; break;
case 23: sResult = "Cloudkill"; break;
case 24: sResult = "Color Spray"; break;
}
break;
case 1://25-49
switch (nSpell)
{
case 25: sResult = "Cone of Cold"; break;
case 26: sResult = "Confusion"; break;
case 27: sResult = "Contagion"; break;
case 28: sResult = "Control Undead"; break;
case 30: sResult = "Create Undead"; break;
case 31: sResult = "Cure Critical Wounds"; break;
case 32: sResult = "Cure Light Wounds"; break;
case 33: sResult = "Cure Minor Wounds"; break;
case 34: sResult = "Cure Moderate Wounds"; break;
case 35: sResult = "Cure Serious Wounds"; break;
case 36: sResult = "Darkness"; break;
case 37: sResult = "Daze"; break;
case 39: sResult = "Delayed Blast Fireball"; break;
case 40: sResult = "Dismissal"; break;
case 41: sResult = "Dispel Magic"; break;
case 44: sResult = "Dominate Monster"; break;
case 45: sResult = "Dominate Person"; break;
case 47: sResult = "Elemental Shield"; break;
case 49: sResult = "Endurance"; break;
}
break;
case 2://50-74
switch (nSpell)
{
case 50: sResult = "Endure Elements"; break;
case 51: sResult = "Energy Drain"; break;
case 52: sResult = "Enervation"; break;
case 54: sResult = "Fear"; break;
case 55: sResult = "Feeblemind"; break;
case 56: sResult = "Finger of Death"; break;
case 58: sResult = "Fireball"; break;
case 59: sResult = "Flame Arrow"; break;
case 63: sResult = "Gate"; break;
case 64: sResult = "Ghoul Touch"; break;
case 65: sResult = "Globe of Invulnerability"; break;
case 66: sResult = "Grease"; break;
case 67: sResult = "Greater Dispelling"; break;
case 69: sResult = "Greater Planar Binding"; break;
case 71: sResult = "Greater Shadow Conjuration"; break;
case 72: sResult = "Greater Spell Breach"; break;
case 73: sResult = "Greater Spell Mantle"; break;
case 74: sResult = "Greater Stoneskin"; break;
}
break;
case 3://75-99
switch (nSpell)
{
case 75: sResult = "Gust of Wind"; break;
case 78: sResult = "Haste"; break;
case 80: sResult = "Healing Circle"; break;
case 82: sResult = "Hold Monster"; break;
case 83: sResult = "Hold Person"; break;
case 86: sResult = "Identify"; break;
case 88: sResult = "Improved Invisibility"; break;
case 89: sResult = "Incendiary Cloud"; break;
case 90: sResult = "Invisibility"; break;
case 92: sResult = "Invisibility Sphere"; break;
case 93: sResult = "Knock"; break;
case 94: sResult = "Lesser Dispel"; break;
case 95: sResult = "Lesser Mind Blank"; break;
case 96: sResult = "Lesser Planar Binding"; break;
case 97: sResult = "Lesser Restoration"; break;
case 98: sResult = "Lesser Spell Breach"; break;
case 99: sResult = "Lesser Spell Mantle"; break;
}
break;
case 4://100-124
switch (nSpell)
{
case 100: sResult = "Light"; break;
case 101: sResult = "Lightning Bolt"; break;
case 102: sResult = "Mage Armor"; break;
case 107: sResult = "Magic Missle"; break;
case 110: sResult = "Mass Blindness and Deafness"; break;
case 111: sResult = "Mass Charm"; break;
case 113: sResult = "Mass Haste"; break;
case 115: sResult = "Melf's Acid Arrow"; break;
case 116: sResult = "Meteor Swarm"; break;
case 117: sResult = "Mind Blank"; break;
case 118: sResult = "Mind Fog"; break;
case 119: sResult = "Minor Globe of Invulnerability"; break;
case 120: sResult = "Ghostly Visage"; break;
case 121: sResult = "Ethereal Visage"; break;
case 122: sResult = "Mordenkainen's Disjunction"; break;
case 123: sResult = "Mordenkainen's Sword"; break;
}
break;
case 5://125-149
switch (nSpell)
{
case 126: sResult = "Neutralize Poison"; break;
case 127: sResult = "Phantasmal Killer"; break;
case 128: sResult = "Planar Binding"; break;
case 130: sResult = "Polymorph Self"; break;
case 131: sResult = "Power Word Kill"; break;
case 132: sResult = "Power Word Stun"; break;
case 134: sResult = "Premonition"; break;
case 135: sResult = "Premonition"; break;
case 137: sResult = "Protection from Elements"; break;
case 141: sResult = "Protection from Spells"; break;
case 143: sResult = "Ray of Enfeeblement"; break;
case 144: sResult = "Ray of Frost"; break;
case 145: sResult = "Remove Blindness and Deafness"; break;
case 146: sResult = "Remove Curse"; break;
case 147: sResult = "Remove Disease"; break;
}
break;
}
break;
case 1://150-299
switch (nSpell/25)
{
case 6://150-174
switch (nSpell)
{
case 150: sResult = "Resist Elements"; break;
case 151: sResult = "Resistance"; break;
case 155: sResult = "Scare"; break;
case 157: sResult = "See Invisibility"; break;
case 158: sResult = "Shades"; break;
case 159: sResult = "Shadow Conjuration"; break;
case 160: sResult = "Shadow Shield"; break;
case 161: sResult = "Shapechange"; break;
case 163: sResult = "Silence"; break;
case 165: sResult = "Sleep"; break;
case 166: sResult = "Slow"; break;
case 167: sResult = "Sound Burst"; break;
case 169: sResult = "Spell Mantle"; break;
case 171: sResult = "Stinking Cloud"; break;
case 172: sResult = "Stoneskin"; break;
case 174: sResult = "Summon Creature I"; break;
}
break;
case 7://175-199
switch (nSpell)
{
case 175: sResult = "Summon Creature II"; break;
case 176: sResult = "Summon Creature III"; break;
case 177: sResult = "Summon Creature IV"; break;
case 178: sResult = "Summon Creature IX"; break;
case 179: sResult = "Summon Creature V"; break;
case 180: sResult = "Summon Creature VI"; break;
case 181: sResult = "Summon Creature VII"; break;
case 182: sResult = "Summon Creature VIII"; break;
case 184: sResult = "Tenser's Transformation"; break;
case 185: sResult = "Timestop"; break;
case 186: sResult = "True Seeing"; break;
case 188: sResult = "Vampric Touch"; break;
case 190: sResult = "Wail of the Banshee"; break;
case 191: sResult = "Wall of Fire"; break;
case 192: sResult = "Web"; break;
case 193: sResult = "Weird"; break;
}
break;
}
break;
case 2://300-449
switch (nSpell/25)
{
case 12://300-324
switch (nSpell)
{
case 321: sResult = "Protection from Alignment"; break;
case 322: sResult = "Magic Circle Against Alignment"; break;
}
break;
case 14://350-374
switch (nSpell)
{
case 354: sResult = "Eagle's Splendor"; break;
case 355: sResult = "Owl's Wisdom"; break;
case 356: sResult = "Fox's Cunning"; break;
case 365: sResult = "Ultravision"; break;
case 367: sResult = "Horrid Wilting"; break;
case 368: sResult = "Ice Storm"; break;
case 369: sResult = "Energy Buffer"; break;
case 370: sResult = "Negative Energy Burst"; break;
case 371: sResult = "Negative Energy Ray"; break;
case 373: sResult = "War Cry"; break;
}
break;
case 15://375-399
switch (nSpell)
{
case 376: sResult = "Legend Lore"; break;
case 377: sResult = "Find Traps"; break;
}
break;
case 16://400-424
switch (nSpell)
{
case 415: sResult = "True Strike"; break;
case 416: sResult = "Flare"; break;
case 417: sResult = "Shield"; break;
case 419: sResult = "Continual Flame"; break;
case 424: sResult = "Acid Splash"; break;
}
break;
case 17://425-449
switch (nSpell)
{
case 427: sResult = "Sunburst"; break;
case 430: sResult = "Banishment"; break;
case 436: sResult = "Balagarn's Iron Horn"; break;
case 439: sResult = "Electric Jolt"; break;
case 440: sResult = "Firebrand"; break;
case 441: sResult = "Wounding Whispers"; break;
case 442: sResult = "Amplify"; break;
case 443: sResult = "Greater Sanctuary"; break;
case 445: sResult = "Dirge"; break;
case 447: sResult = "Isaac's Lesser Missle Storm"; break;
case 448: sResult = "Isaac's Greater Missle Storm"; break;
}
break;
}
break;
case 3://450-569
switch (nSpell/25)
{
case 18://450-474
switch (nSpell)
{
case 456: sResult = "Expeditious Retreat"; break;
case 457: sResult = "Tasha's Hideous Laughter"; break;
case 458: sResult = "Displacement"; break;
case 459: sResult = "Bigby's Interposing Hand"; break;
case 460: sResult = "Bigby's Forceful Hand"; break;
case 461: sResult = "Bigby's Grasping Hand"; break;
case 462: sResult = "Bigby's Clenched Fist"; break;
case 463: sResult = "Bigby's Crushing Hand"; break;
}
break;
case 19://475-499
switch (nSpell)
{
case 485: sResult = "Flesh to Stone"; break;
case 486: sResult = "Stone to Flesh"; break;
}
break;
case 20://500-524
switch (nSpell)
{
case 515: sResult = "Great Thunderclap"; break;
case 516: sResult = "Ball Lightning"; break;
case 518: sResult = "Combust"; break;
case 519: sResult = "Death Armor"; break;
case 520: sResult = "Gedlee's Electric Loop"; break;
case 521: sResult = "Horizikaul's Boom"; break;
case 522: sResult = "Ironguts"; break;
case 523: sResult = "Mestil's Acid Breath"; break;
case 524: sResult = "Mestil's Acid Sheath"; break;
}
break;
case 21://525-549
switch (nSpell)
{
case 526: sResult = "Scintillating Sphere"; break;
case 527: sResult = "Stone Bones"; break;
case 528: sResult = "Undeath to Death"; break;
case 533: sResult = "Black Blade of Disaster"; break;
case 534: sResult = "Shelgarn's Persistent Blade"; break;
case 539: sResult = "Keen Edge"; break;
case 541: sResult = "Blackstaff"; break;
case 542: sResult = "Flame Weapon"; break;
case 543: sResult = "Ice Dagger"; break;
case 544: sResult = "Magic Weapon"; break;
case 545: sResult = "Greater Magic Weapon"; break;
}
break;
case 22://550-569
switch (nSpell)
{
case 569: sResult = "Cloud of Bewilderment"; break;
}
break;
}
break;
}
return sResult;
}
//void main(){}

@ -0,0 +1,39 @@
// Original script taken from post by CID-78 in the Bioware scripting forums.
// Modified to return 'base' skills as well, though they must be passed through
// another filter for feats and stat bonuses after this function.
struct xAbility
{
int nSTR; //stats in 2da order
int nDEX;
int nCON;
int nINT;
int nWIS;
int nCHA;
int nANIMAL_EMPATHY;//skills in 2da order
int nCONCENTRATION;
int nDISABLE_TRAP;
int nDISCIPLINE;
int nHEAL;
int nHIDE;
int nLISTEN;
int nLORE;
int nMOVE_SILENTLY;
int nOPEN_LOCK;
int nPARRY;
int nPERFORM;
int nPERSUADE;
int nPICK_POCKET;
int nSEARCH;
int nSET_TRAP;
int nSPELLCRAFT;
int nSPOT;
int nTAUNT;
int nUSE_MAGIC_DEVICE;
int nAPPRAISE;
int nTUMBLE;
int nCRAFT_TRAP;
int nBLUFF;
int nINTIMIDATE;
int nCRAFT_ARMOR;
int nCRAFT_WEAPON;
};

@ -0,0 +1,64 @@
//::///////////////////////////////////////////////
//:: Acid Fog: On Enter
//:: NW_S0_AcidFogA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All creatures within the AoE take 2d6 acid damage
per round and upon entering if they fail a Fort Save
their movement is halved.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eSlow = EffectMovementSpeedDecrease(50);
object oTarget = GetEnteringObject();
float fDelay = GetRandomDelay(1.0, 2.2);
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_ACID_FOG));
//Spell resistance check
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
//Roll Damage
//Enter Metamagic conditions
nDamage = d8(5);
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 40;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Make a Fortitude Save to avoid the effects of the movement hit.
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ACID, GetAreaOfEffectCreator(), fDelay))
{
//slowing effect
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSlow, oTarget);
// * BK: Removed this because it reduced damage, didn't make sense nDamage = d6();
}
//Set Damage Effect with the modified damage
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
//Apply damage and visuals
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
}
}

@ -0,0 +1,79 @@
//::///////////////////////////////////////////////
//:: Acid Fog: Heartbeat
//:: NW_S0_AcidFogC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All creatures within the AoE take 2d6 acid damage
per round and upon entering if they fail a Fort Save
their movement is halved.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage = d8(3);
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
object oTarget;
float fDelay;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 24;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
//Start cycling through the AOE Object for viable targets including doors and placable objects.
oTarget = GetFirstInPersistentObject(OBJECT_SELF);
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ACID, GetAreaOfEffectCreator(), fDelay))
{
nDamage = d6();
}
fDelay = GetRandomDelay(0.4, 1.2);
//Fire cast spell at event for the affected target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_ACID_FOG));
//Spell resistance check
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
//Apply damage and visuals
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target.
oTarget = GetNextInPersistentObject(OBJECT_SELF);
}
}

@ -0,0 +1,64 @@
//::///////////////////////////////////////////////
//:: Bestow Curse
//:: NW_S0_BesCurse.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Afflicted creature must save or suffer a -2 penalty
to all ability scores. This is a supernatural effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Bob McCabe
//:: Created On: March 6, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: July 20, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
effect eCurse = EffectCurse(4, 4, 4, 4, 4, 4);
//Make sure that curse is of type supernatural not magical
eCurse = SupernaturalEffect(eCurse);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Signal spell cast at event
SignalEvent(oTarget, EventSpellCastAt(oTarget, SPELL_BESTOW_CURSE));
//Make SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make Will Save
if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetEpicSpellSaveDC()))
{
//Apply Effect and VFX
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Blade Barrier: On Enter
//:: NW_S0_BladeBarA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a wall 10m long and 2m thick of whirling
blades that hack and slice anything moving into
them. Anything caught in the blades takes
2d6 per caster level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 20, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
int nMetaMagic = GetMetaMagicFeat();
int nLevel = GetCasterLevel(GetAreaOfEffectCreator());
//Make level check
if (nLevel > 25)
{
nLevel = 25;
}
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire spell cast at event
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_BLADE_BARRIER));
//Roll Damage
int nDamage = d6(nLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = nLevel * 6;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);
}
//Make SR Check
if (!MyResistSpell(GetAreaOfEffectCreator(), oTarget) )
{
if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetEpicSpellSaveDC()))
{
nDamage = nDamage/2;
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING);
//Apply damage and VFX
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

@ -0,0 +1,82 @@
//::///////////////////////////////////////////////
//:: Blade Barrier: Heartbeat
//:: NW_S0_BladeBarA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a wall 10m long and 2m thick of whirling
blades that hack and slice anything moving into
them. Anything caught in the blades takes
2d6 per caster level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 20, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
object oTarget;
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
int nMetaMagic = GetMetaMagicFeat();
int nLevel = GetCasterLevel(GetAreaOfEffectCreator());
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// Add damage to placeables/doors now that the command support bit fields
//--------------------------------------------------------------------------
oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR);
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire spell cast at event
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_BLADE_BARRIER));
//Make SR Check
if (!MyResistSpell(GetAreaOfEffectCreator(), oTarget) )
{
//Roll Damage
int nDamage = d6(nLevel);
//Enter Metamagic conditions
if(nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = nLevel * 6;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);
}
if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetEpicSpellSaveDC()))
{
nDamage = nDamage/2;
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING);
//Apply damage and VFX
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR);
}
}

@ -0,0 +1,98 @@
//::///////////////////////////////////////////////
//:: Call Lightning
//:: NW_S0_CallLghtn.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This spells smites an area around the caster
with bolts of lightning which strike all enemies.
Bolts do 1d10 per level up 10d10
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = GetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 20)
{
nCasterLvl = 20;
}
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CALL_LIGHTNING));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetRandomDelay(0.4, 1.75);
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll damage for each target
nDamage = d6(nCasterLvl);
//Resolve metamagic
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLvl;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage / 2;
}
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY);
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,186 @@
//::///////////////////////////////////////////////
//:: Chain Lightning
//:: NW_S0_ChLightn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The primary target is struck with 1d6 per caster,
1/2 with a reflex save. 1 secondary target per
level is struck for 1d6 / 2 caster levels. No
repeat targets can be chosen.
*/
//:://////////////////////////////////////////////
//:: Created By: Brennon Holmes
//:: Created On: March 8, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 26, 2001
//:: Update Pass By: Preston W, On: July 26, 2001
/*
bugfix by Kovi 2002.07.28
- successful saving throw and (improved) evasion was ignored for
secondary targets,
- all secondary targets suffered exactly the same damage
2002.08.25
- primary target was not effected
*/
#include "x0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
//Limit caster level
// June 2/04 - Bugfix: Cap the level BEFORE the damage calculation, not after. Doh.
if (nCasterLevel > 20)
{
nCasterLevel = 20;
}
int nDamage = d6(nCasterLevel);
int nDamStrike;
int nNumAffected = 0;
int nMetaMagic = GetMetaMagicFeat();
//Declare lightning effect connected the casters hands
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF, BODY_NODE_HAND);;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eDamage;
object oFirstTarget = GetSpellTargetObject();
object oHolder;
object oTarget;
location lSpellLocation;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/is +50%
}
//Damage the initial target
if (spellsIsTarget(oFirstTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oFirstTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING));
//Make an SR Check
if (!MyResistSpell(OBJECT_SELF, oFirstTarget))
{
//Adjust damage via Reflex Save or Evasion or Improved Evasion
nDamStrike = GetReflexAdjustedDamage(nDamage, oFirstTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY);
//Set the damage effect for the first target
eDamage = EffectDamage(nDamStrike, DAMAGE_TYPE_ELECTRICAL);
//Apply damage to the first target and the VFX impact.
if(nDamStrike > 0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oFirstTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oFirstTarget);
}
}
}
//Apply the lightning stream effect to the first target, connecting it with the caster
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oFirstTarget,0.5);
//Reinitialize the lightning effect so that it travels from the first target to the next target
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oFirstTarget, BODY_NODE_CHEST);
float fDelay = 0.2;
int nCnt = 0;
// *
// * Secondary Targets
// *
//Get the first target in the spell shape
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
while (GetIsObjectValid(oTarget) && nCnt < nCasterLevel)
{
//Make sure the caster's faction is not hit and the first target is not hit
if (oTarget != oFirstTarget && spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
//Connect the new lightning stream to the older target and the new target
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5));
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING));
//Do an SR check
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
nDamage = d6(nCasterLevel) ;
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/is +50%
}
//Adjust damage via Reflex Save or Evasion or Improved Evasion
nDamStrike = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY);
//Apply the damage and VFX impact to the current target
eDamage = EffectDamage(nDamStrike /2, DAMAGE_TYPE_ELECTRICAL);
if(nDamStrike > 0) //age > 0)
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget));
}
}
oHolder = oTarget;
//change the currect holder of the lightning stream to the current target
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST);
}
else
{
// * April 2003 trying to make sure beams originate correctly
effect eNewLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST);
if(GetIsEffectValid(eNewLightning))
{
eLightning = eNewLightning;
}
}
fDelay = fDelay + 0.1f;
}
//Count the number of targets that have been hit.
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
nCnt++;
}
// April 2003: Setting the new origin for the beam
// oFirstTarget = oTarget;
//Get the next target in the shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,105 @@
//::///////////////////////////////////////////////
//:: Cone of Cold
//:: NW_S0_ConeCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// Cone of cold creates an area of extreme cold,
// originating at your hand and extending outward
// in a cone. It drains heat, causing 1d6 points of
// cold damage per caster level (maximum 15d6).
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: 10/18/02000
//:://////////////////////////////////////////////
//:: Last Updated By: Aidan Scanlan On: April 11, 2001
//:: Update Pass By: Preston W, On: July 25, 2001
float SpellDelay (object oTarget, int nShape);
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
location lTargetLocation = GetSpellTargetLocation();
object oTarget;
//Limit Caster level for the purposes of damage.
if (nCasterLevel > 25)
{
nCasterLevel = 25;
}
//Declare the spell shape, size and the location. Capture the first target object in the shape.
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
// March 2003. Removed this as part of the reputation pass
// if((GetSpellId() == 340 && !GetIsFriend(oTarget)) || GetSpellId() == 25)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CONE_OF_COLD));
//Get the distance between the target and caster to delay the application of effects
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20.0;
//Make SR check, and appropriate saving throw(s).
if(!MyResistSpell(OBJECT_SELF, oTarget, fDelay) && (oTarget != OBJECT_SELF))
{
//Detemine damage
nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Adjust damage according to Reflex Save, Evasion or Improved Evasion
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_COLD);
// Apply effects to the currently selected target.
effect eCold = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
effect eVis = EffectVisualEffect(VFX_IMP_FROST_L);
if(nDamage > 0)
{
//Apply delayed effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCold, oTarget));
}
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Create Greater Undead
//:: NW_S0_CrGrUnd.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons an undead type pegged to the character's
level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = nCasterLevel;
nDuration = 24;
effect eSummon;
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
//Make metamagic extend check
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Determine undead to summon based on level
if (nCasterLevel <= 15)
{
eSummon = EffectSummonCreature("vampire01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 16) && (nCasterLevel <= 18))
{
eSummon = EffectSummonCreature("lichlord01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 19) && (nCasterLevel <= 24))
{
eSummon = EffectSummonCreature("demilich01",VFX_FNF_SUMMON_UNDEAD);
}
else
{
eSummon = EffectSummonCreature("greatlich02",VFX_FNF_SUMMON_UNDEAD);
}
//Apply summon effect and VFX impact.
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
}

@ -0,0 +1,51 @@
//::///////////////////////////////////////////////
//:: Creeping Doom: On Enter
//:: NW_S0_AcidFogA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature caught in the swarm take an initial
damage of 1d20, but there after they take
1d4 per swarm counter on the AOE.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
//Declare major variables
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
object oTarget = GetEnteringObject();
effect eSpeed = EffectMovementSpeedDecrease(50);
effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eSpeed, eVis2);
float fDelay;
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_CREEPING_DOOM));
fDelay = GetRandomDelay(1.0, 1.8);
//Spell resistance check
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
//Roll Damage
nDamage = d6(4)+ 6;
//Set Damage Effect with the modified damage
eDam = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
//Apply damage and visuals
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
}
}

@ -0,0 +1,85 @@
//::///////////////////////////////////////////////
//:: Creeping Doom: Heartbeat
//:: NW_S0_CrpDoomC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature caught in the swarm take an initial
damage of 1d20, but there after they take
1d6 per swarm counter on the AOE.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
//Declare major variables
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
object oTarget = GetEnteringObject();
string sConstant1 = "NW_SPELL_CONSTANT_CREEPING_DOOM1" + ObjectToString(GetAreaOfEffectCreator());
string sConstant2 = "NW_SPELL_CONSTANT_CREEPING_DOOM2" + ObjectToString(GetAreaOfEffectCreator());
int nSwarm = GetLocalInt(OBJECT_SELF, sConstant1);
int nDamCount = GetLocalInt(OBJECT_SELF, sConstant2);
float fDelay;
if(nSwarm < 1)
{
nSwarm = 1;
}
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
//Get first target in spell area
oTarget = GetFirstInPersistentObject();
while(GetIsObjectValid(oTarget) && nDamCount < 1000)
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
fDelay = GetRandomDelay(1.0, 2.2);
//------------------------------------------------------------------
// According to the book, SR Does not count against creeping doom
//------------------------------------------------------------------
//Spell resistance check
// if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
// {
SignalEvent(oTarget,EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_CREEPING_DOOM));
//Roll Damage
nDamage = d6(nSwarm)+ 12;
//Set Damage Effect with the modified damage
eDam = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
//Apply damage and visuals
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
nDamCount = nDamCount + nDamage;
// }
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
if(nDamCount >= 1000)
{
DestroyObject(OBJECT_SELF, 1.0);
}
else
{
nSwarm++;
SetLocalInt(OBJECT_SELF, sConstant1, nSwarm);
SetLocalInt(OBJECT_SELF, sConstant2, nDamCount);
}
}

@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Create Undead
//:: NW_S0_CrUndead.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Spell summons a Ghoul, Shadow, Ghast, Wight or
Wraith
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = nCasterLevel;
nDuration = 24;
effect eSummon;
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Set the summoned undead to the appropriate template based on the caster level
if (nCasterLevel <= 13)
{
eSummon = EffectSummonCreature("doomknight01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 14) && (nCasterLevel <= 18))
{
eSummon = EffectSummonCreature("vampire01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 19) && (nCasterLevel <= 25))
{
eSummon = EffectSummonCreature("lichlord01",VFX_FNF_SUMMON_UNDEAD); // change later
}
else if ((nCasterLevel >= 26))
{
eSummon = EffectSummonCreature("demilich01",VFX_FNF_SUMMON_UNDEAD);
}
//Apply VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
}

@ -0,0 +1,98 @@
//::///////////////////////////////////////////////
//:: Delayed Blast Fireball: On Enter
//:: NW_S0_DelFireA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The caster creates a trapped area which detects
the entrance of enemy creatures into 3 m area
around the spell location. When tripped it
causes a fiery explosion that does 1d6 per
caster level up to a max of 20d6 damage.
*/
//:://////////////////////////////////////////////
//:: Georg: Removed Spellhook, fixed damage cap
//:: Created By: Preston Watamaniuk
//:: Created On: July 27, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
object oCaster = GetAreaOfEffectCreator();
location lTarget = GetLocation(OBJECT_SELF);
int nDamage;
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(oCaster);
int nFire = GetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL");
//Limit caster level
if (nCasterLevel > 30)
{
nCasterLevel = 30;
}
effect eDam;
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
//Check the faction of the entering object to make sure the entering object is not in the casters faction
if(nFire == 0)
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
SetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL",TRUE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Cycle through the targets in the explosion area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DELAYED_BLAST_FIREBALL));
//Make SR check
if (!MyResistSpell(oCaster, oTarget))
{
nDamage = d8(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);//Damage/Healing is +50%
}
//Change damage according to Reflex, Evasion and Improved Evasion
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE, GetAreaOfEffectCreator());
//Set up the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
else
{
//They will be taking SOMETHING!
nDamage = d8(12);
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
//Apply VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
}
}
}
//Get next target in the sequence
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
DestroyObject(OBJECT_SELF, 1.0);
}
}
}

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Delayed Blast Fireball
//:: NW_S0_DelFirebal.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The caster creates a trapped area which detects
the entrance of enemy creatures into 3 m area
around the spell location. When tripped it
causes a fiery explosion that does 1d6 per
caster level up to a max of 20d6 damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 27, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables including Area of Effect Object
effect eAOE = EffectAreaOfEffect(AOE_PER_DELAY_BLAST_FIREBALL);
location lTarget = GetSpellTargetLocation();
int nDuration = GetCasterLevel(OBJECT_SELF);
//Make sure the duration is at least one round
if (nDuration == 0)
{
nDuration = 1;
}
int nMetaMagic = GetMetaMagicFeat();
//Check Extend metamagic feat.
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2;//Duration is +100%
}
//Create an instance of the AOE Object using the Apply Effect function
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
}

@ -0,0 +1,82 @@
//::///////////////////////////////////////////////
//:: Destruction
//:: NW_S0_Destruc
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The target creature is destroyed if it fails a
Fort save, otherwise it takes 10d6 damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 13, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
int nCasterLevel = GetCasterLevel(OBJECT_SELF)/2;
effect eSlay = EffectDeath();
effect eDam;
effect eVis = EffectVisualEffect(234);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DESTRUCTION));
//Make SR check
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a saving throw check
//This spell is no longer a Death Effect They make a save or die.
if(!/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC()))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSlay, oTarget);
}
else
{
nDamage = d8(1) * nCasterLevel;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
//Apply VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Elemental Swarm
//:: NW_S0_EleSwarm.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This spell creates a conduit from the caster
to the elemental planes. The first elemental
summoned is a 24 HD Air elemental. Whenever an
elemental dies it is replaced by the next
elemental in the chain Air, Water, Earth, Fire
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: Update Pass By: Preston W, On: July 30, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
nDuration = 24;
effect eSummon;
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
//Check for metamagic duration
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2; //Duration is +100%
}
//Set the summoning effect
// eSummon = EffectSwarm(FALSE, "NW_SW_AIRGREAT", "NW_SW_WATERGREAT","NW_SW_EARTHGREAT","NW_SW_FIREGREAT");
eSummon = EffectSwarm(TRUE, "airgreat8", "watergreat8", "earthgreat8", "firegreat8");
//Apply the summon effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSummon, OBJECT_SELF, HoursToSeconds(nDuration));
}

@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Energy Drain
//:: NW_S0_EneDrain.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Target loses 2d4 levels.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nDrain = d4(2);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDrain = 8;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDrain = nDrain + (nDrain/2); //Damage/Healing is +50%
}
effect eDrain = EffectNegativeLevel(nDrain);
eDrain = SupernaturalEffect(eDrain);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERGY_DRAIN));
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}

@ -0,0 +1,79 @@
//::///////////////////////////////////////////////
//:: Enervation
//:: NW_S0_Enervat.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Target Loses 1d4 levels for 1 hour per caster
level
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nDrain = d4();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDrain = 4;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDrain = nDrain + (nDrain/2); //Damage/Healing is +50%
}
else if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
effect eDrain = EffectNegativeLevel(nDrain);
effect eLink = EffectLinkEffects(eDrain, eDur);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERVATION));
//Resist magic check
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}

@ -0,0 +1,36 @@
//::///////////////////////////////////////////////
//:: Find Traps
//:: NW_S0_FindTrap
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Finds and removes all traps within 30m.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 29, 2001
//:://////////////////////////////////////////////
void main()
{
effect eVis = EffectVisualEffect(VFX_IMP_KNOCK);
int nCnt = 1;
object oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt);
while(GetIsObjectValid(oTrap) && GetDistanceToObject(oTrap) <= 30.0)
{
if(GetIsTrapped(oTrap))
{
int DC = GetTrapDisarmDC(oTrap);
if (DC <= 30){
SetTrapDetectedBy(oTrap, OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTrap));
DelayCommand(2.0, SetTrapDisabled(oTrap));
}
}
nCnt++;
oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt);
}
}

@ -0,0 +1,97 @@
//::///////////////////////////////////////////////
//:: Finger of Death
//:: NW_S0_FingDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// You can slay any one living creature within range.
// The victim is entitled to a Fortitude saving throw to
// survive the attack. If he succeeds, he instead
// sustains 3d6 points of damage +1 point per caster
// level.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 17, 2000
//:://////////////////////////////////////////////
//:: Updated By: Georg Z, On: Aug 21, 2003 - no longer affects placeables
#include "x0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH_L);
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE,OBJECT_SELF))
{
//GZ: I still signal this event for scripting purposes, even if a placeable
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FINGER_OF_DEATH));
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
//Make SR check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make Forttude save
if (!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DEATH))
{
//Apply the death effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
// Target shouldn't take damage if they are immune to death magic.
//NOTE: I have made it where they take dmg no matter what!
// if ( GetIsImmune( oTarget, IMMUNITY_TYPE_DEATH) == FALSE )
// {
//Roll damage(d6 X Caster Level up 40!)
nDamage = d6(1) * nCasterLvl;
//Make metamagic checks
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLvl;
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
//Apply damage effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
// }
}
}
}
}
}

@ -0,0 +1,109 @@
//::///////////////////////////////////////////////
//:: Fireball
//:: NW_S0_Fireball
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// A fireball is a burst of flame that detonates with
// a low roar and inflicts 1d6 points of damage per
// caster level (maximum of 10d6) to all creatures
// within the area. Unattended objects also take
// damage. The explosion creates almost no pressure.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18 , 2000
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
//:: Last Updated By: AidanScanlan, On: April 11, 2001
//:: Last Updated By: Preston Watamaniuk, On: May 25, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = GetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 15)
{
nCasterLvl = 15;
}
//Apply the fireball explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
if((GetSpellId() == 341) || GetSpellId() == 58)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll damage for each target
nDamage = d6(nCasterLvl);
//Resolve metamagic
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLvl;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage / 2;
}
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,104 @@
//::///////////////////////////////////////////////
//:: Fire Storm
//:: NW_S0_FireStm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a zone of destruction around the caster
within which all living creatures are pummeled
with fire.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 11, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 21, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
int nDamage2;
//Level Capp
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
if(nCasterLevel > 30)
{
nCasterLevel == 30;
}
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
effect eFireStorm = EffectVisualEffect(VFX_FNF_FIRESTORM);
float fDelay;
//Apply Fire and Forget Visual in the area;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFireStorm, GetLocation(OBJECT_SELF));
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while(GetIsObjectValid(oTarget))
{
//This spell smites everyone who is more than 2 meters away from the caster.
//if (GetDistanceBetween(oTarget, OBJECT_SELF) > 2.0)
//{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
fDelay = GetRandomDelay(1.5, 2.5);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIRE_STORM));
//Make SR check, and appropriate saving throw(s).
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll Damage
nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);//Damage/Healing is +50%
}
//Save versus both holy and fire damage
nDamage2 = nDamage; //No Save for Divine Dmg..
//GetReflexAdjustedDamage(nDamage/2, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DIVINE);
nDamage = GetReflexAdjustedDamage(nDamage/2, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
if(nDamage > 0)
{
// Apply effects to the currently selected target. For this spell we have used
//both Divine and Fire damage.
effect eDivine = EffectDamage(nDamage2, DAMAGE_TYPE_DIVINE);
effect eFire = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDivine, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,99 @@
//::///////////////////////////////////////////////
//:: Flame Arrow
//:: NW_S0_FlmArrow
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Fires a stream of fiery arrows at the selected
target that do 4d6 damage per arrow. 1 Arrow
per 4 levels is created.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 20, 2001
//:: Updated By: Georg Zoeller, Aug 18 2003: Uncapped
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables ( fDist / (3.0f * log( fDist ) + 2.0f) )
object oTarget = GetSpellTargetObject();
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nDamage = 0;
int nMetaMagic = GetMetaMagicFeat();
int nCnt;
effect eMissile;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
int nMissiles = (nCasterLvl)/4;
float fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
float fDelay = fDist/(3.0 * log(fDist) + 2.0);
//Limit missiles to five
if(nMissiles == 0)
{
nMissiles = 1;
}
/* Uncapped because PHB does list any cap and we now got epic levels
else if (nMissiles > 5)
{
nMissiles = 5;
}*/
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FLAME_ARROW));
//Apply a single damage hit for each missile instead of as a single mass
//Make SR Check
for (nCnt = 1; nCnt <= nMissiles; nCnt++)
{
if(!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll damage
int nDam = d6(3) + 8;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDam = 26;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDam = nDam + nDam/2; //Damage/Healing is +50%
}
nDam = GetReflexAdjustedDamage(nDam, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
//Set damage effect
effect eDam = EffectDamage(nDam, DAMAGE_TYPE_FIRE);
//Apply the MIRV and damage effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget));
}
// * May 2003: Make it so the arrow always appears, even if resisted
eMissile = EffectVisualEffect(VFX_IMP_MIRV_FLAME);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
}
}
}

@ -0,0 +1,108 @@
//::///////////////////////////////////////////////
//:: Flame Strike
//:: NW_S0_FlmStrike
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// A flame strike is a vertical column of divine fire
// roaring downward. The spell deals 1d6 points of
// damage per level, to a maximum of 15d6. Half the
// damage is fire damage, but the rest of the damage
// results directly from divine power and is therefore
// not subject to protection from elements (fire),
// fire shield (chill shield), etc.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 19, 2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: Aug 1, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget;
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nDamage, nDamage2;
int nMetaMagic = GetMetaMagicFeat();
effect eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
effect eHoly;
effect eFire;
//Limit caster level for the purposes of determining damage.
if (nCasterLvl > 25)
{
nCasterLvl = 25;
}
//Declare the spell shape, size and the location. Capture the first target object in the shape.
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR);
//Apply the location impact visual to the caster location instead of caster target creature.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, GetSpellTargetLocation());
//Cycle through the targets within the spell shape until an invalid object is captured.
while ( GetIsObjectValid(oTarget) )
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FLAME_STRIKE));
//Make SR check, and appropriate saving throw(s).
if (!MyResistSpell(OBJECT_SELF, oTarget, 0.6))
{
nDamage = d6(nCasterLvl);
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLvl;
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);
}
//Adjust the damage based on Reflex Save, Evasion and Improved Evasion
nDamage2 = GetReflexAdjustedDamage(nDamage/2, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DIVINE);
nDamage = GetReflexAdjustedDamage(nDamage/2, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
//Make a faction check so that only enemies receieve the full brunt of the damage.
if(!GetIsFriend(oTarget))
{
eHoly = EffectDamage(nDamage2,DAMAGE_TYPE_DIVINE);
DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHoly, oTarget));
}
// Apply effects to the currently selected target.
eFire = EffectDamage(nDamage,DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM,GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR);
}
}

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Gate
//:: NW_S0_Gate.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:: Summons a Balor to fight for the caster.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
void CreateBalor();
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
//Make metamagic extend check
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Summon the Balor and apply the VFX impact
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
location lSpellTargetLOC = GetSpellTargetLocation();
if(GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL) ||
GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL) ||
GetHasSpellEffect(SPELL_HOLY_AURA))
{
eSummon = EffectSummonCreature("gatebalor01",VFX_FNF_SUMMON_GATE,3.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
}
else
{
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lSpellTargetLOC);
DelayCommand(3.0, CreateBalor());
}
}
void CreateBalor()
{
CreateObject(OBJECT_TYPE_CREATURE, "gatebalor1", GetSpellTargetLocation());
}

@ -0,0 +1,102 @@
//::///////////////////////////////////////////////
//:: Greater Planar Binding
//:: NW_S0_GrPlanar.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons an outsider dependant on alignment, or
holds an outsider if the creature fails a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eGate;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eDur3 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eLink = EffectLinkEffects(eDur, EffectParalyze());
eLink = EffectLinkEffects(eLink, eDur2);
eLink = EffectLinkEffects(eLink, eDur3);
object oTarget = GetSpellTargetObject();
int nRacial = GetRacialType(oTarget);
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Check to see if a valid target has been chosen
if (GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GREATER_PLANAR_BINDING));
//Check for racial type
if(nRacial == RACIAL_TYPE_OUTSIDER)
{
//Allow will save to negate hold effect
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC()+20))
{
//Apply the hold effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration/2));
}
}
}
}
else
{
//If the ground was clicked on summon an outsider based on alignment
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
float fDelay = 3.0;
switch (nAlign)
{
case ALIGNMENT_EVIL:
eSummon = EffectSummonCreature("succubus03", VFX_FNF_SUMMON_GATE, 3.0);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
break;
case ALIGNMENT_GOOD:
eSummon = EffectSummonCreature("avenger03", VFX_FNF_SUMMON_CELESTIAL, 3.0);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL);
break;
case ALIGNMENT_NEUTRAL:
eSummon = EffectSummonCreature("slaad03", VFX_FNF_SUMMON_MONSTER_3, 1.0);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
fDelay = 1.0;
break;
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), RoundsToSeconds(nDuration));
}
}

@ -0,0 +1,110 @@
//::///////////////////////////////////////////////
//:: Hammer of the Gods
//:: [NW_S0_HammGods.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Does 1d8 damage to all enemies within the
//:: spells 20m radius and dazes them if a
//:: Will save is failed.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 21, 2001
//:: Update Pass By: Preston W, On: Aug 1, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
effect eDam;
effect eDaze = EffectDazed();
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eMind, eDaze);
eLink = EffectLinkEffects(eLink, eDur);
effect eVis = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);
effect eStrike = EffectVisualEffect(VFX_FNF_STRIKE_HOLY);
float fDelay;
int nDamageDice = nCasterLvl/2;
if(nDamageDice == 0)
{
nDamageDice = 1;
}
//Limit caster level
if (nDamageDice > 15)
{
nDamageDice = 15;
}
int nDamage;
//Apply the holy strike VFX
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, GetSpellTargetLocation());
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, GetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
//Make faction checks
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HAMMER_OF_THE_GODS));
//Make SR Check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
fDelay = GetRandomDelay(0.6, 1.3);
//Roll damage
nDamage = d8(nDamageDice);
//Make metamagic checks
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 * nDamageDice;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = FloatToInt( IntToFloat(nDamage) * 1.5 );
}
//Make a will save for half damage and negation of daze effect
if (MySavingThrow(SAVING_THROW_WILL, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DIVINE, OBJECT_SELF, 0.5))
{
nDamage = nDamage / 2;
}
else
{
//Apply daze effect
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(d6())));
}
//Set damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE );
//Apply the VFX impact and damage effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in shape
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, GetSpellTargetLocation());
}
}

@ -0,0 +1,105 @@
//::///////////////////////////////////////////////
//:: Horrid Wilting
//:: NW_S0_HorrWilt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All living creatures (not undead or constructs)
suffer 1d8 damage per caster level to a maximum
of 25d8 damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 12 , 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
int bInt;
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = GetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_HORRID_WILTING);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Limit Caster level for the purposes of damage
if (nCasterLvl > 35)
{
nCasterLvl = 35;
}
//Apply the horrid wilting explosion at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
// GZ: Not much fun if the caster is always killing himself
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HORRID_WILTING));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetRandomDelay(1.5, 2.5);
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
if(GetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT && GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Roll damage for each target
nDamage = d8(nCasterLvl);
//Resolve metamagic
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 8 * nCasterLvl;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage / 2;
} //Epic DC Bonus Added
if(/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay))
{
nDamage = nDamage/2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the flame that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget);
}
}

@ -0,0 +1,97 @@
//::///////////////////////////////////////////////
//:: Ice Storm
//:: NW_S0_IceStorm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Everyone in the area takes 3d6 Bludgeoning
and 2d6 Cold damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 12, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oCaster = OBJECT_SELF;
int nCasterLvl = GetCasterLevel(oCaster);
int nMetaMagic = GetMetaMagicFeat();
int nDamage, nDamage2, nDamage3;
int nVariable = nCasterLvl/2;
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_ICESTORM); //USE THE ICESTORM FNF
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eDam,eDam2, eDam3;
//Get the spell target location as opposed to the spell target.
location lTarget = GetSpellTargetLocation();
//Apply the ice storm VFX at the location captured above.
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
fDelay = GetRandomDelay(0.75, 2.25);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ICE_STORM));
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Roll damage for each target
nDamage = d6(3);
nDamage2 = d6(2);
nDamage3 = d6(nVariable);
//Resolve metamagic
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 18;
nDamage2 = 12;
nDamage3 = 6 * nVariable;
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage / 2);
nDamage2 = nDamage2 + (nDamage2 / 2);
nDamage3 = nDamage3 + (nDamage3 / 2);
}
nDamage2 = nDamage2 + nDamage3;
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING);
eDam2 = EffectDamage(nDamage2, DAMAGE_TYPE_COLD);
// Apply effects to the currently selected target.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam2, oTarget));
//This visual effect is applied to the target object not the location as above. This visual effect
//represents the impact that erupts on the target not on the ground.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,80 @@
//::///////////////////////////////////////////////
//:: Implosion
//:: NW_S0_Implosion.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All persons within a 5ft radius of the spell must
save at +3 DC or die.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 13, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget;
effect eDeath = EffectDeath(TRUE);
effect eEffect;
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nMult = d6(1);
int nTotalDmg = nMult * nCasterLvl;
eDeath = SupernaturalEffect(eDeath);
effect eImplode= EffectVisualEffect(VFX_FNF_IMPLOSION);
float fDelay;
//Apply the implose effect
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImplode, GetSpellTargetLocation());
//Get the first target in the shape
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
if (oTarget != OBJECT_SELF && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_IMPLOSION));
fDelay = GetRandomDelay(0.4, 1.2);
//Make SR check
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
{
//Make Reflex save
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))
{
//Apply death effect and the VFX impact
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
}
//Apply Damage If spell is not resisted by magic...
eEffect = EffectDamage(nTotalDmg, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget, 0.0f);
}
}
//Get next target in the shape
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetSpellTargetLocation());
}
}

@ -0,0 +1,66 @@
///::///////////////////////////////////////////////
//:: Improved Invisibility
//:: NW_S0_ImprInvis.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Target creature can attack and cast spells while
invisible
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eImpact = EffectVisualEffect(VFX_IMP_HEAD_MIND);
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_IMPROVED);
effect eVis = EffectVisualEffect(VFX_DUR_INVISIBILITY);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eCover = EffectConcealment(55);
effect eLink = EffectLinkEffects(eDur, eCover);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_IMPROVED_INVISIBILITY, FALSE));
int nDuration = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oTarget, TurnsToSeconds(nDuration));
}

@ -0,0 +1,67 @@
//::///////////////////////////////////////////////
//:: Incendiary Cloud
//:: NW_S0_IncCloud.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Person within the AoE take 4d6 fire damage
per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
//:: March 2003: Removed movement speed penalty
#include "X0_I0_SPELLS"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
object oTarget;
//Declare and assign personal impact visual effect.
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
// effect eSpeed = EffectMovementSpeedDecrease(50);
effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = eVis2; //EffectLinkEffects(eSpeed, eVis2);
float fDelay;
//Capture the first target object in the shape.
oTarget = GetEnteringObject();
//Declare the spell shape, size and the location.
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_INCENDIARY_CLOUD));
//Make SR check, and appropriate saving throw(s).
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
fDelay = GetRandomDelay(0.5, 2.0);
//Roll damage.
nDamage = d8(6) + 16;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 64;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Adjust damage for Reflex Save, Evasion and Improved Evasion
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE, GetAreaOfEffectCreator());
// Apply effects to the currently selected target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget);
}
}

@ -0,0 +1,80 @@
//::///////////////////////////////////////////////
//:: Incendiary Cloud
//:: NW_S0_IncCloudC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Objects within the AoE take 4d6 fire damage
per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
//:: Updated By: GeorgZ 2003-08-21: Now affects doors and placeables as well
#include "X0_I0_SPELLS"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
object oTarget;
//Declare and assign personal impact visual effect.
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
float fDelay;
//Capture the first target object in the shape.
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Declare the spell shape, size and the location.
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
fDelay = GetRandomDelay(0.5, 2.0);
//Make SR check, and appropriate saving throw(s).
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
{
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_INCENDIARY_CLOUD));
//Roll damage.
nDamage = d8(4) + 16;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 50;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Adjust damage for Reflex Save, Evasion and Improved Evasion
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(),SAVING_THROW_TYPE_FIRE, GetAreaOfEffectCreator());
// Apply effects to the currently selected target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,35 @@
//::///////////////////////////////////////////////
//:: Knock
//:: NW_S0_Knock
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Opens doors not locked by magical means.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 29, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk
//:: VFX Pass By: Preston W, On: June 22, 2001
#include "nw_i0_spells"
void main()
{
object oTarget;
effect eVis = EffectVisualEffect(VFX_IMP_KNOCK);
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 50.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
float fDelay;
while(GetIsObjectValid(oTarget))
{
fDelay = GetRandomDelay(0.5, 2.5);
if( GetLocked(oTarget))
{
if (GetLockUnlockDC(oTarget) <= 30){
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
AssignCommand(oTarget, ActionUnlockObject(oTarget));
}
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, 50.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,112 @@
//::///////////////////////////////////////////////
//:: Lightning Bolt
//:: NW_S0_LightnBolt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Does 1d6 per level in a 5ft tube for 30m
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: March 8, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: May 2, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
//Limit caster level
if (nCasterLevel > 15)
{
nCasterLevel = 15;
}
int nDamage;
int nMetaMagic = GetMetaMagicFeat();
//Set the lightning stream to start at the caster's hands
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF, BODY_NODE_HAND);
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eDamage;
object oTarget = GetSpellTargetObject();
location lTarget = GetLocation(oTarget);
object oNextTarget, oTarget2;
float fDelay;
int nCnt = 1;
oTarget2 = GetNearestObject(OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt);
while(GetIsObjectValid(oTarget2) && GetDistanceToObject(oTarget2) <= 30.0)
{
//Get first target in the lightning area by passing in the location of first target and the casters vector (position)
oTarget = GetFirstObjectInShape(SHAPE_SPELLCYLINDER, 30.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetPosition(OBJECT_SELF));
while (GetIsObjectValid(oTarget))
{
//Exclude the caster from the damage effects
if (oTarget != OBJECT_SELF && oTarget2 == oTarget)
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_LIGHTNING_BOLT));
//Make an SR check
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Roll damage
nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
//Adjust damage based on Reflex Save, Evasion and Improved Evasion
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(),SAVING_THROW_TYPE_ELECTRICITY);
//Set damage effect
eDamage = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
fDelay = GetSpellEffectDelay(GetLocation(oTarget), oTarget);
//Apply VFX impcat, damage effect and lightning effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget));
}
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,1.0);
//Set the currect target as the holder of the lightning effect
oNextTarget = oTarget;
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNextTarget, BODY_NODE_CHEST);
}
}
//Get the next object in the lightning cylinder
oTarget = GetNextObjectInShape(SHAPE_SPELLCYLINDER, 30.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetPosition(OBJECT_SELF));
}
nCnt++;
oTarget2 = GetNearestObject(OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt);
}
}

@ -0,0 +1,114 @@
//::///////////////////////////////////////////////
//:: Lesser Planar Binding
//:: NW_S0_LsPlanar.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons an outsider dependant on alignment, or
holds an outsider if the creature fails a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eGate;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eDur3 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eLink = EffectLinkEffects(eDur, EffectParalyze());
eLink = EffectLinkEffects(eLink, eDur2);
eLink = EffectLinkEffects(eLink, eDur3);
object oTarget = GetSpellTargetObject();
int nRacial = GetRacialType(oTarget);
if(nDuration == 0)
{
nDuration = 1;
}
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Check to see if the target is valid
if (GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_LESSER_PLANAR_BINDING));
//Check to make sure the target is an outsider
if(nRacial == RACIAL_TYPE_OUTSIDER)
{
//Make a will save
if(!WillSave(oTarget, GetSpellSaveDC()))
{
//Apply the linked effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration/2));
}
}
}
}
else
{
//Get the alignment of the caster
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
float fDelay = 3.0;
switch (nAlign)
{
//Set the summon effect based on alignment
case ALIGNMENT_EVIL:
{
eSummon = EffectSummonCreature("succubus01",VFX_FNF_SUMMON_GATE , fDelay);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
}
break;
case ALIGNMENT_GOOD:
{
eSummon = EffectSummonCreature("lantern01", 219 ,fDelay);
//eGate = EffectVisualEffect(219);
}
break;
case ALIGNMENT_NEUTRAL:
{
eSummon = EffectSummonCreature("slaad01", VFX_FNF_SUMMON_MONSTER_3);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3, ,1.0);
}
break;
}
//Apply the summon effect and the VFX impact
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eGate, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
}
}

@ -0,0 +1,94 @@
//::///////////////////////////////////////////////
//:: Meteor Swarm
//:: NW_S0_MetSwarm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Everyone in a 50ft radius around the caster
takes 20d6 fire damage. Those within 6ft of the
caster will take no damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 24 , 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 22, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic;
int nDamage;
effect eFire;
effect eMeteor = EffectVisualEffect(VFX_FNF_METEOR_SWARM);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
//Apply the meteor swarm VFX area impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMeteor, GetLocation(OBJECT_SELF));
//Get first object in the spell area
float fDelay;
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
fDelay = GetRandomDelay();
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_METEOR_SWARM));
//Make sure the target is outside the 2m safe zone
if (GetDistanceBetween(oTarget, OBJECT_SELF) > 2.0)
{
//Make SR check
if (!MyResistSpell(OBJECT_SELF, oTarget, 0.5))
{
//Roll damage
nDamage = d6(20);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 120;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(),SAVING_THROW_TYPE_FIRE);
//Set the damage effect
eFire = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply damage effect and VFX impact.
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
}
//Get next target in the spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
}
}

@ -0,0 +1,50 @@
//::///////////////////////////////////////////////
//:: Mordenkainen's Sword
//:: NW_S0_MordSwrd.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a Helmed Horror to battle for the caster
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 29, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("mordsword01");
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), RoundsToSeconds(nDuration));
}

@ -0,0 +1,96 @@
//::///////////////////////////////////////////////
//:: Negative Energy Ray
//:: NW_S0_NegRay
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Fires a bolt of negative energy at the target
doing 1d6 damage. Does an additional 1d6
damage for 2 levels after level 1 (3,5,7,9) to
a maximum of 5d6 at level 9.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Sept 13, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = GetMetaMagicFeat();
if(nCasterLevel > 20)
{
nCasterLevel = 20;
}
nCasterLevel = (nCasterLevel + 1) / 2;
int nDamage = d6(nCasterLevel);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 6 * nCasterLevel;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eRay;
if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY));
eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make a saving throw check
if(/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_NEGATIVE))
{
nDamage /= 2;
}
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
//Apply the VFX impact and effects
//DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}
}
else
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_NEGATIVE_ENERGY_RAY, FALSE));
eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
effect eHeal = EffectHeal(nDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
}

@ -0,0 +1,107 @@
//::///////////////////////////////////////////////
//:: Planar Binding
//:: NW_S0_Planar.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons an outsider dependant on alignment, or
holds an outsider if the creature fails a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eGate;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eDur3 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eLink = EffectLinkEffects(eDur, EffectParalyze());
eLink = EffectLinkEffects(eLink, eDur2);
eLink = EffectLinkEffects(eLink, eDur3);
int nRacial = GetRacialType(oTarget);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
if(nDuration == 0)
{
nDuration == 1;
}
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Check to make sure a target was selected
if (GetIsObjectValid(oTarget))
{
//Check the racial type of the target
if(nRacial == RACIAL_TYPE_OUTSIDER)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PLANAR_BINDING));
//Make a Will save
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC()+2))
{
//Apply the linked effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration/2));
}
}
}
}
else
{
//Set the summon effect based on the alignment of the caster
float fDelay = 3.0;
switch (nAlign)
{
case ALIGNMENT_EVIL:
eSummon = EffectSummonCreature("succubus02",VFX_FNF_SUMMON_GATE, fDelay);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
break;
case ALIGNMENT_GOOD:
eSummon = EffectSummonCreature("hound02", VFX_FNF_SUMMON_CELESTIAL, fDelay);
//eGate = EffectVisualEffect(219);
break;
case ALIGNMENT_NEUTRAL:
eSummon = EffectSummonCreature("slaad02",VFX_FNF_SUMMON_MONSTER_3, 1.0);
//eGate = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
//fDelay = 1.0;
break;
}
//Apply the summon effect and VFX impact
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eGate, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
}
}

@ -0,0 +1,136 @@
//::///////////////////////////////////////////////
//:: Power Word, Kill
//:: NW_S0_PWKill
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// When power word, kill is uttered, you can either
// target a single creature or let the spell affect a
// group.
// If power word, kill is targeted at a single creature,
// that creature dies if it has 100 or fewer hit points.
// If the power word, kill is cast as an area spell, it
// kills creatures in a 15-foot-radius sphere. It only
// kills creatures that have 20 or fewer hit points, and
// only up to a total of 200 hit points of such
// creatures. The spell affects creatures with the lowest.
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Dec 18, 2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 22, 2001
//:: Update Pass By: Preston W, On: Aug 3, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
int nDamageDealt = 0;
int nHitpoints, nMin;
object oWeakest;
effect eDeath = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eWord = EffectVisualEffect(VFX_FNF_PWKILL);
float fDelay;
int bKill;
//Apply the VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eWord, GetSpellTargetLocation());
//Check for the single creature or area targeting of the spell
if (GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_POWER_WORD_KILL));
//Check the creatures HP
if ( GetCurrentHitPoints(oTarget) <= 200 )
{
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//Apply the death effect and the VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}
else
{
//Continue through the while loop while the damage deal is less than 200.
while (nDamageDealt < 200)
{
//Set nMin higher than the highest HP amount allowed
nMin = 25;
oWeakest = OBJECT_INVALID;
//Get the first target in the spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetSpellTargetLocation());
while (GetIsObjectValid(oTarget))
{
//Make sure the target avoids all allies.
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
bKill = GetLocalInt(oTarget, "NW_SPELL_PW_KILL_" + GetTag(OBJECT_SELF));
//Get the HP of the current target
nHitpoints = GetCurrentHitPoints(oTarget);
//Check if the currently selected target is lower in HP than the weakest stored creature
if ((nHitpoints < nMin) && ((nHitpoints > 0) && (nHitpoints <= 20)) && bKill == FALSE)
{
nMin = nHitpoints;
oWeakest = oTarget;
}
}
//Get next target in the spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetSpellTargetLocation());
}
//If no weak targets are available then break out of the loop
if (!GetIsObjectValid(oWeakest))
{
nDamageDealt = 250;
}
else
{
fDelay = GetRandomDelay(0.75, 2.0);
SetLocalInt(oWeakest, "NW_SPELL_PW_KILL_" + GetTag(OBJECT_SELF), TRUE);
//Fire cast spell at event for the specified target
SignalEvent(oWeakest, EventSpellCastAt(OBJECT_SELF, SPELL_POWER_WORD_KILL));
if(!MyResistSpell(OBJECT_SELF, oWeakest, fDelay))
{
//Apply the VFX impact and death effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oWeakest));
if(!GetIsImmune(oWeakest, IMMUNITY_TYPE_DEATH))
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oWeakest));
}
//Add the creatures HP to the total
nDamageDealt = nDamageDealt + nMin;
string sTag = "NW_SPELL_PW_KILL_" + GetTag(OBJECT_SELF);
DelayCommand(fDelay + 0.25, DeleteLocalInt(oWeakest, sTag));
}
}
}
}
}

@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: [Raise Dead]
//:: [NW_S0_RaisDead.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Brings a character back to life with 1 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001
void main()
{
//Declare major variables
object oTarget = GetSpellTargetObject();
object oPC = oTarget;
object oItem;
//Remove the death token
object oDeath = GetItemPossessedBy(oPC, "death");
DestroyObject(oDeath, 0.0f);
effect eRaise = EffectResurrection();
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
if (GetLocalInt(GetArea(oTarget), "streamed")==2){
return;
}
if(GetIsDead(oTarget))
{
SetPlotFlag(oTarget, 0);
SetCampaignInt(GetName(GetModule()), "DEATH_LOG", 0, oPC);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAISE_DEAD, FALSE));
//Apply raise dead effect and VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
}
}

@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Regenerate
//:: NW_S0_Regen
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Grants the selected target 6 HP of regeneration
every round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 22, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eRegen = EffectRegenerate(12, 6.0);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_NATURE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eRegen, eDur);
int nMeta = GetMetaMagicFeat();
int nLevel = GetCasterLevel(OBJECT_SELF);
//Meta-Magic Checks
if (nMeta == METAMAGIC_EXTEND)
{
nLevel *= 2;
}
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_REGENERATE, FALSE));
//Apply effects and VFX
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nLevel));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}

@ -0,0 +1,52 @@
//::///////////////////////////////////////////////
//:: [Ressurection]
//:: [NW_S0_Ressurec.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Brings a character back to life with full
//:: health.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001
void main()
{
//Get the spell target
object oTarget = GetSpellTargetObject();
object oPC = oTarget;
object oItem;
object oDeath = GetItemPossessedBy(oPC, "death");
DestroyObject(oDeath, 0.0f);
if (!GetIsDead(oTarget)){return;}
if (GetLocalInt(GetArea(oTarget), "streamed")==2){
return;
}
//Check to make sure the target is dead first
if (GetIsDead(oTarget))
{
SetPlotFlag(oTarget, 0);
//Remove the Death Logging from the player..
SetCampaignInt(GetName(GetModule()), "DEATH_LOG", 0, oPC);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESURRECTION, FALSE));
//Declare major variables
int nHealed = GetMaxHitPoints(oTarget);
effect eRaise = EffectResurrection();
effect eHeal = EffectHeal(nHealed + 10);
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
//Apply the heal, raise dead and VFX impact effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
}
}

@ -0,0 +1,105 @@
//::///////////////////////////////////////////////
//:: Shadow Conjuration
//:: NW_S0_ShadConj.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If the opponent is clicked on Shadow Bolt is cast.
If the caster clicks on himself he will cast
Mage Armor and Mirror Image. If they click on
the ground they will summon a Shadow.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
void ShadowBolt (object oTarget, int nMetaMagic);
void main()
{
int nMetaMagic = GetMetaMagicFeat();
object oTarget = GetSpellTargetObject();
int nCast;
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eVis;
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if (GetIsObjectValid(oTarget))
{
if (oTarget == OBJECT_SELF)
{
nCast = 1;
}
else
{
nCast = 2;
}
}
else
{
nCast = 3;
}
switch (nCast)
{
case 1:
{
eVis = EffectVisualEffect(VFX_IMP_AC_BONUS);
effect eAC = EffectACIncrease(4, AC_DODGE_BONUS, AC_VS_DAMAGE_TYPE_ALL);
effect eMirror = EffectVisualEffect(VFX_DUR_BLUR);
effect eMiss = EffectConcealment(40);
effect eLink = EffectLinkEffects(eAC, eMirror);
eLink = EffectLinkEffects(eLink, eVis);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eMiss, OBJECT_SELF, HoursToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, TurnsToSeconds(nDuration));
}
case 2:
if (!ResistSpell(OBJECT_SELF, oTarget))
{
ShadowBolt(oTarget, nMetaMagic);
}
case 3:
eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("shadfiend01");
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
}
}
void ShadowBolt (object oTarget, int nMetaMagic)
{
int nDamage;
int nBolts = GetCasterLevel(OBJECT_SELF)/5;
int nCnt;
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eDam;
for (nCnt = 0; nCnt < nBolts; nCnt++)
{
int nDam = d6(2);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 12;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage/2; //Damage/Healing is +50%
}
if (ReflexSave(oTarget, GetSpellSaveDC()))
{
nDamage = nDamage/2;
}
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}

@ -0,0 +1,105 @@
//::///////////////////////////////////////////////
//:: Shades
//:: NW_S0_Shades.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If the opponent is clicked on Shadow Bolt is cast.
If the caster clicks on himself he will cast
Stoneskin and Mirror Image. If they click on
the ground they will summon a Shadow Lord.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
void ShadowBolt (object oTarget, int nMetaMagic);
void main()
{
int nMetaMagic = GetMetaMagicFeat();
object oTarget = GetSpellTargetObject();
int nCast;
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eVis;
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if (GetIsObjectValid(oTarget))
{
if (oTarget == OBJECT_SELF)
{
nCast = 1;
}
else
{
nCast = 2;
}
}
else
{
nCast = 3;
}
switch (nCast)
{
case 1:
{
eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
effect eStone = EffectDamageReduction(5, DAMAGE_POWER_PLUS_FIVE, nDuration * 10);
effect eMirror = EffectVisualEffect(VFX_DUR_BLUR);
effect eLink = EffectLinkEffects(eStone, eMirror);
effect eMiss = EffectConcealment(40);
eLink = EffectLinkEffects(eLink, eVis);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eMiss, OBJECT_SELF, HoursToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, HoursToSeconds(nDuration));
}
case 2:
if (!ResistSpell(OBJECT_SELF, oTarget))
{
ShadowBolt(oTarget, nMetaMagic);
}
case 3:
eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("shadlord01");
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
}
}
void ShadowBolt (object oTarget, int nMetaMagic)
{
int nDamage;
int nBolts = GetCasterLevel(OBJECT_SELF)/5;
int nCnt;
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
for (nCnt = 0; nCnt < nBolts; nCnt++)
{
int nDam = d6(4);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 24;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage/2; //Damage/Healing is +50%
}
if (ReflexSave(oTarget, GetSpellSaveDC()))
{
nDamage = nDamage/2;
}
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}

@ -0,0 +1,85 @@
//::///////////////////////////////////////////////
//:: [Slay Living]
//:: [NW_S0_SlayLive.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Caster makes a touch attack and if the target
//:: fails a Fortitude save they die.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: January 22nd / 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
object oTarget = GetSpellTargetObject();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLAY_LIVING));
//Make SR check
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make melee touch attack
if(TouchAttackMelee(oTarget))
{
//Make Fort save
if (!/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_DEATH))
{
//Apply the death effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
//Roll damage
nDamage = d6(3)+ nCasterLevel;
//Make metamagic checks
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 18 + nCasterLevel;
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2);
}
//Apply damage effect and VFX impact
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}
}
}
}

@ -0,0 +1,84 @@
//::///////////////////////////////////////////////
//:: Slow
//:: NW_S0_Slow.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Character can take only one partial action
per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 29, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget;
effect eSlow = EffectSlow();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eSlow, eDur);
effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);
int nMetaMagic = GetMetaMagicFeat();
//Determine spell duration as an integer for later conversion to Rounds, Turns or Hours.
int nDuration = GetCasterLevel(OBJECT_SELF);
int nLevel = nDuration;
int nCount = 0;
location lSpell = GetSpellTargetLocation();
//Metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
//Declare the spell shape, size and the location. Capture the first target object in the shape.
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
//Cycle through the targets within the spell shape until an invalid object is captured or the number of
//targets affected is equal to the caster level.
while(GetIsObjectValid(oTarget) && nCount < nLevel)
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW));
if (!MyResistSpell(OBJECT_SELF, oTarget) && !/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetEpicSpellSaveDC()))
{
//Apply the slow effect and VFX impact
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
//Count the number of creatures affected
nCount++;
}
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
}
}

@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Spell Resistance
//:: NW_S0_SplResis
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The target creature gains 12 + Caster Level SR.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: March 19, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nLevel = GetCasterLevel(OBJECT_SELF);
//Epic Spell Resistance Added
int nDC;
int nAdjs;
nAdjs = GetCasterLevel(OBJECT_SELF) - 20;
if(GetCasterLevel(OBJECT_SELF)>=23)
{
nDC = nAdjs/3;
SendMessageToPC(OBJECT_SELF, "Your Epic Spell Resistance Bonus = + " + IntToString(nDC) + " DC");
}
else if(GetCasterLevel(OBJECT_SELF) <=22)
{
nDC = 0;
}
//Epic Resistance Added
int nBonus = 12 + nLevel + nDC;
effect eSR = EffectSpellResistanceIncrease(nBonus);
effect eVis = EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eDur2 = EffectVisualEffect(249);
effect eLink = EffectLinkEffects(eSR, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SPELL_RESISTANCE, FALSE));
//Check for metamagic extension
if (nMetaMagic == METAMAGIC_EXTEND)
{
nLevel = nLevel *2; //Duration is +100%
}
//Apply VFX impact and SR bonus effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nLevel));
}

@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Storm of Vengeance: Heartbeat
//:: NW_S0_StormVenC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates an AOE that decimates the enemies of
the cleric over a 30ft radius around the caster
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 8, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
effect eAcid = EffectDamage(d8(5), DAMAGE_TYPE_ACID);
effect eElec = EffectDamage(d8(7), DAMAGE_TYPE_ELECTRICAL);
effect eStun = EffectStunned();
effect eVisAcid = EffectVisualEffect(VFX_IMP_ACID_S);
effect eVisElec = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eVisStun = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eStun, eVisStun);
eLink = EffectLinkEffects(eLink, eDur);
float fDelay;
//Get first target in spell area
object oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_STORM_OF_VENGEANCE));
//Make an SR Check
fDelay = GetRandomDelay(0.5, 2.0);
if(MyResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay) == 0)
{
//Make a saving throw check
// * if the saving throw is made they still suffer acid damage.
// * if they fail the saving throw, they suffer Electrical damage too
if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY, GetAreaOfEffectCreator(), fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
if (d2()==1)
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget));
}
}
else
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eElec, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)));
}
}
}
//Get next target in spell area
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE);
}
}

@ -0,0 +1,260 @@
//::///////////////////////////////////////////////
//:: Summon Creature Series
//:: NW_S0_Summon
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Carries out the summoning of the appropriate
creature for the Summon Monster Series of spells
1 to 9
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
effect SetSummonEffect(int nSpellID);
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nSpellID = GetSpellId();
int nDuration = GetCasterLevel(OBJECT_SELF);
nDuration = 24;
if(nDuration == 1)
{
nDuration = 4;
}
effect eSummon = SetSummonEffect(nSpellID);
//Make metamagic check for extend
int nMetaMagic = GetMetaMagicFeat();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
}
effect SetSummonEffect(int nSpellID)
{
int nFNF_Effect;
int nRoll = d3();
string sSummon;
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER)) //WITH THE ANIMAL DOMAIN
{
if(nSpellID == SPELL_SUMMON_CREATURE_I)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "NW_S_BOARDIRE";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_II)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "NW_S_WOLFDIRE";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_III)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "direspider4";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
sSummon = "diretiger5";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_V)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
sSummon = "direbear6";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "airelder7";
break;
case 2:
sSummon = "waterelder7";
break;
case 3:
sSummon = "fireelder7";
break;
}
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "airgreat8";
break;
case 2:
sSummon = "watergreat8";
break;
case 3:
sSummon = "firegreat8";
break;
}
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "asummon9";
break;
case 2:
sSummon = "bsummon9";
break;
case 3:
sSummon = "csummon9";
break;
}
}
else if(nSpellID == SPELL_SUMMON_CREATURE_IX)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "asummon9";
break;
case 2:
sSummon = "csummon9";
break;
case 3:
sSummon = "dsummon9";
break;
}
}
}
else //WITOUT THE ANIMAL DOMAIN
{
if(nSpellID == SPELL_SUMMON_CREATURE_I)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "NW_S_badgerdire";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_II)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "NW_S_BOARDIRE";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_III)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
sSummon = "NW_S_WOLFDIRE";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
sSummon = "direspider4";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_V)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
sSummon = "diretiger5";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
sSummon = "direbear6";
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "airelder7";
break;
case 2:
sSummon = "waterelder7";
break;
case 3:
sSummon = "fireelder7";
break;
}
}
else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "airgreat8";
break;
case 2:
sSummon = "watergreat8";
break;
case 3:
sSummon = "firegreat8";
break;
}
}
else if(nSpellID == SPELL_SUMMON_CREATURE_IX)
{
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
switch (nRoll)
{
case 1:
sSummon = "asummon9";
break;
case 2:
sSummon = "bsummon9";
break;
case 3:
sSummon = "csummon9";
break;
}
}
}
//effect eVis = EffectVisualEffect(nFNF_Effect);
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
effect eSummonedMonster = EffectSummonCreature(sSummon, nFNF_Effect);
return eSummonedMonster;
}

@ -0,0 +1,54 @@
//::///////////////////////////////////////////////
//:: Summon Monster IV
//:: NW_S0_Summon4
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a Sword Spider to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("direspider4");
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
{
eSummon = EffectSummonCreature("diretiger5");
}
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,52 @@
//::///////////////////////////////////////////////
//:: Summon Monster V
//:: NW_S0_Summon5
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a dire spider to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12 , 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("diretiger5");
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
{
eSummon = EffectSummonCreature("direbear6");
}
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Summon Monster VI
//:: NW_S0_Summon6
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a dire bear to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("direbear6");
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
{
int nRoll = d4();
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("airelder7");
break;
case 2:
eSummon = EffectSummonCreature("waterelder7");
break;
case 3:
eSummon = EffectSummonCreature("earthelder7");
break;
case 4:
eSummon = EffectSummonCreature("fireelder7");
break;
}
}
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,90 @@
//::///////////////////////////////////////////////
//:: Summon Monster VII
//:: NW_S0_Summon7
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a Minogon to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
int nRoll = d4();
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
{
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("airegreat8");
break;
case 2:
eSummon = EffectSummonCreature("watergreat8");
break;
case 3:
eSummon = EffectSummonCreature("earthgreat8");
break;
case 4:
eSummon = EffectSummonCreature("firegreat8");
break;
}
}
else
{
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("airelder7");
break;
case 2:
eSummon = EffectSummonCreature("waterelder7");
break;
case 3:
eSummon = EffectSummonCreature("earthelder7");
break;
case 4:
eSummon = EffectSummonCreature("fireelder7");
break;
}
}
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,92 @@
//::///////////////////////////////////////////////
//:: Summon Monster VIII
//:: NW_S0_Summon8
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a greater earth elemental to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
int nRoll = d4();
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER))
{
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("asummon9");
break;
case 2:
eSummon = EffectSummonCreature("bsummon9");
break;
case 3:
eSummon = EffectSummonCreature("csummon9");
break;
case 4:
eSummon = EffectSummonCreature("dsummon9");
break;
}
}
else
{
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("airgreat8");
break;
case 2:
eSummon = EffectSummonCreature("watergreat8");
break;
case 3:
eSummon = EffectSummonCreature("earthgreat8");
break;
case 4:
eSummon = EffectSummonCreature("firegreat8");
break;
}
}
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Summon Monster IX
//:: NW_S0_Summon9
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons a elder elemental to fight for the character
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 25, 2001
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
int nRoll = d4();
switch (nRoll)
{
case 1:
eSummon = EffectSummonCreature("asummon9");
break;
case 2:
eSummon = EffectSummonCreature("bsummon9");
break;
case 3:
eSummon = EffectSummonCreature("csummon9");
break;
case 4:
eSummon = EffectSummonCreature("dsummon9");
break;
}
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), TurnsToSeconds(nDuration));
}

@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Summon Shadow
//:: NW_S0_SummShad.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Spell powerful ally from the shadow plane to
battle for the wizard
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 26, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = nCasterLevel;
effect eSummon;
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Set the summoned undead to the appropriate template based on the caster level
if (nCasterLevel <= 7)
{
eSummon = EffectSummonCreature("shadow01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 8) && (nCasterLevel <= 17))
{
eSummon = EffectSummonCreature("shadhound01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 18) && (nCasterLevel <= 23))
{
eSummon = EffectSummonCreature("shadfiend01",VFX_FNF_SUMMON_UNDEAD); // change later
}
else if ((nCasterLevel >= 24))
{
eSummon = EffectSummonCreature("shadlord01",VFX_FNF_SUMMON_UNDEAD);
}
//Apply VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
}

@ -0,0 +1,64 @@
//::///////////////////////////////////////////////
//:: Summon Shadow
//:: NW_S0_SummShad02.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Spell powerful ally from the shadow plane to
battle for the wizard
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 26, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetLevelByClass(CLASS_TYPE_CLERIC);
effect eSummon;
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
//Set the summoned undead to the appropriate template based on the caster level
if (nCasterLevel <= 7)
{
eSummon = EffectSummonCreature("shadow01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 8) && (nCasterLevel <= 17))
{
eSummon = EffectSummonCreature("shadhound01",VFX_FNF_SUMMON_UNDEAD);
}
else if ((nCasterLevel >= 18) && (nCasterLevel <= 23))
{
eSummon = EffectSummonCreature("shadfiend01",VFX_FNF_SUMMON_UNDEAD); // change later
}
else if ((nCasterLevel >= 24))
{
eSummon = EffectSummonCreature("shadlord01",VFX_FNF_SUMMON_UNDEAD);
}
//Apply VFX impact and summon effect
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(24));
}

@ -0,0 +1,158 @@
//::///////////////////////////////////////////////
//:: Time Stop
//:: NW_S0_TimeStop.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All persons in the Area are frozen in time
except the caster.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
// Place the following variable on an area to disable timestop in that area.
// NAME : TIMESTOP_DISABLED TYPE : Int VALUE : 1
// If set to zero, the duration will default to 1 + 1d4 rounds. Otherwise, the
// duration will be the number of seconds the variable is changed to.
const int TIME_STOP_OVERRIDE_DURATION = 13;
// ex. const int TIME_STOP_OVERRIDE_DURATION = 9; Timestop lasts 9 seconds.
// Number of seconds before Timestop can be recast after being cast. Countdown
//messages are sent based on this time. Set to 0.0 if you dont want there to
//be any cooldown
const float TIME_STOP_COOLDOWN_TIME = 0.0;
//If set to 1, Timestop will not be usable\
const int TIME_STOP_DISABLE = 0;
#include "x2_inc_spellhook"
int DetermineDuration()
{
int nDuration = 1 + d4(1);
float fDuration = RoundsToSeconds(nDuration);
int nSeconds = FloatToInt(fDuration);
if (TIME_STOP_OVERRIDE_DURATION != 0) nSeconds = TIME_STOP_OVERRIDE_DURATION;
return nSeconds;
}
void TimeStopDelay(object oCaster)
{
float Delay1 = TIME_STOP_COOLDOWN_TIME * 0.25;
string Message1 = IntToString(FloatToInt(Delay1));
float Delay2 = TIME_STOP_COOLDOWN_TIME * 0.50;
string Message2 = IntToString(FloatToInt(Delay2));
float Delay3 = TIME_STOP_COOLDOWN_TIME * 0.75;
string Message3 = IntToString(FloatToInt(Delay3));
SetLocalInt(oCaster, "TIMESTOP_DELAY", 1);
DelayCommand(Delay1, FloatingTextStringOnCreature("Time Stop Recastable In " + Message3 + " seconds", oCaster, FALSE));
DelayCommand(Delay2, FloatingTextStringOnCreature("Time Stop Recastable In " + Message2 + " seconds", oCaster, FALSE));
DelayCommand(Delay3, FloatingTextStringOnCreature("Time Stop Recastable In " + Message1 + " seconds", oCaster, FALSE));
DelayCommand(TIME_STOP_COOLDOWN_TIME, FloatingTextStringOnCreature("Time Stop Ready", oCaster, FALSE));
DelayCommand(TIME_STOP_COOLDOWN_TIME, DeleteLocalInt(oCaster, "TIMESTOP_DELAY"));
}
void Timestop(object oCaster)
{
object oArea = GetArea(oCaster);
effect eParalyze = EffectCutsceneParalyze();
int nDuration = DetermineDuration();
float fDuration = IntToFloat(nDuration);
object oTarget = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oTarget)) {
if (GetIsPC(oTarget) == TRUE || GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) {
if (GetIsDM(oTarget) == FALSE) {
if (oTarget != oCaster) {
FloatingTextStringOnCreature("Time Stopped", oTarget, FALSE);
AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oTarget, fDuration)); } } }
oTarget = GetNextObjectInArea(oArea); }
}
void TimestopCheck(object oCaster, int nDuration)
{
if (nDuration == 0) return;
nDuration = nDuration - 1;
float fDuration = IntToFloat(nDuration);
object oArea = GetArea(oCaster);
location lCaster = GetLocation(oCaster);
effect eParalyze = EffectCutsceneParalyze();
object oTarget = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oTarget)) {
if (GetIsPC(oTarget) == TRUE || GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) {
if (GetIsDM(oTarget) == FALSE) {
if (oTarget != oCaster) {
effect eEffect = GetFirstEffect(oTarget);
while (GetIsEffectValid(eEffect)) {
if (GetEffectType(eEffect) == EFFECT_TYPE_CUTSCENE_PARALYZE) {
SetLocalInt(oTarget, "TIME_STOPPED", 1); }
eEffect = GetNextEffect(oTarget); }
if (GetLocalInt(oTarget, "TIME_STOPPED") == 0) {
FloatingTextStringOnCreature("Time Stopped", oTarget, FALSE);
AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oTarget, fDuration)); }
DeleteLocalInt(oTarget, "TIME_STOPPED"); } } }
oTarget = GetNextObjectInArea(oArea); }
DelayCommand(1.0, TimestopCheck(oCaster, nDuration));
}
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
string sName = GetName(OBJECT_SELF);
if (TIME_STOP_DISABLE == 1) {
FloatingTextStringOnCreature("Timestop is disabled on this server", OBJECT_SELF, FALSE);
return; }
if (GetLocalInt(GetArea(OBJECT_SELF), "TIMESTOP_DISABLED") == 1 && GetName(OBJECT_SELF) != "Archmage Jezebeth") {
FloatingTextStringOnCreature("Time Stop is not permitted in this area", OBJECT_SELF, FALSE);
return; }
if (GetLocalInt(OBJECT_SELF, "TIMESTOP_DELAY") == 1) {
FloatingTextStringOnCreature("Timestop is not castable yet", OBJECT_SELF, FALSE);
return; }
if (TIME_STOP_COOLDOWN_TIME != 0.0) {
string Message = IntToString(FloatToInt(TIME_STOP_COOLDOWN_TIME));
FloatingTextStringOnCreature("Time Stop Recastable In " + Message + " seconds", OBJECT_SELF, FALSE);
DelayCommand(0.6, TimeStopDelay(OBJECT_SELF)); }
//Declare major variables
location lTarget = GetSpellTargetLocation();
effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP);
int nDuration = DetermineDuration();
//Fire cast spell at event for the specified target
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lTarget);
Timestop(OBJECT_SELF);
DelayCommand(1.0, TimestopCheck(OBJECT_SELF, nDuration));
}

@ -0,0 +1,56 @@
//::///////////////////////////////////////////////
//:: Time Stop
//:: NW_S0_TimeStop.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All persons in the Area are frozen in time
except the caster.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
/*This is a modified version of kaltors PW friendly time stop script
It has been modified to do several new functions
--It not will not dominate summoned units, to prevent them from becomine masterless
--It follows standard 9.0 second timestop with a .75 delay
--It applies a small visual affect to all units to show a timestop in effect
--It applies a knockdown effect to summoned units to prevent them doing anything(no summoned unit has
immune to knockdown to my knowledge
--it applies a Immobilize effect to prevent units from moving (an occasional bug with big PW's on high CPU load).
*/
void main()
{
object oArea = GetArea(OBJECT_SELF);
location lLocation = GetLocation(OBJECT_SELF);
object oTG = GetFirstObjectInArea(oArea);
int nRoll = 2 + d4();
int bonus = ( (GetCasterLevel(OBJECT_SELF)-20) / 10 );
if(bonus < 1 || bonus >40)
{ bonus = 0; }
SendMessageToPC(OBJECT_SELF, "Time stopped for " + IntToString(nRoll+bonus) + " rounds.");
while (oTG != OBJECT_INVALID)
{
if(GetObjectType(oTG) == OBJECT_TYPE_CREATURE && oTG != OBJECT_SELF){
if(!GetIsObjectValid(GetMaster(oTG))){
DelayCommand(0.35f, AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneDominated(), oTG, (RoundsToSeconds(nRoll+bonus) + 2.0))));
}
else{
DelayCommand(0.35f, AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectKnockdown(), oTG, (RoundsToSeconds(nRoll+bonus) + 2.0))));
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BLUR), oTG, 3.75f);
DelayCommand(0.35f, AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneImmobilize(), oTG, (RoundsToSeconds(nRoll+bonus) + 2.0))));
}
oTG = GetNextObjectInArea(oArea);
}
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), lLocation);
}

@ -0,0 +1,76 @@
// Function to get creature(s) within radius and apply the alternate TimeStop
int TestScrollUsage()
{
int n = GetLevelByClass(CLASS_TYPE_BARD) +
GetLevelByClass(CLASS_TYPE_SORCERER) +
GetLevelByClass(CLASS_TYPE_WIZARD) +
GetLevelByClass(CLASS_TYPE_ROGUE);
return Random(15) < n;
}
// Begin Main Function
void main()
{
int fDur = 12+ d6();
float dur = IntToFloat(fDur);
if (!TestScrollUsage() && !GetIsDM(OBJECT_SELF) && GetRacialType(OBJECT_SELF) != RACIAL_TYPE_DRAGON) {
SendMessageToPC(OBJECT_SELF, "Casting from item failed");
return;
}
int nRoll;
int nRoll2 = d4();
if (nRoll2 == 1){nRoll = 2;}
if (nRoll2 == 2 || nRoll2 == 3){nRoll = 3;}
if (nRoll2 == 4){nRoll = 4;}
object dragon = GetNearestCreature(CREATURE_TYPE_RACIAL_TYPE, RACIAL_TYPE_DRAGON);
object area = GetArea(dragon);
string pc = GetPCPlayerName(OBJECT_SELF);
object area2 = GetArea(OBJECT_SELF);
string busted = GetName(area2);
if (GetRacialType(OBJECT_SELF) == RACIAL_TYPE_DRAGON){
area = GetArea(GetWaypointByTag("sage"));
fDur = 18+ d6();}
if (dragon != OBJECT_INVALID && area == area2){
SendMessageToPC(OBJECT_SELF, "There is a disturbance in the time stream, and you cannot cast Time Stop.");
return;
}
if (GetLocalInt(GetArea(OBJECT_SELF), "streamed")==2) {
SendMessageToPC(OBJECT_SELF, "Time is already stopped");
return;
}
DelayCommand(1.0, SetLocalInt(GetArea(OBJECT_SELF), "streamed", 2));
DelayCommand(dur, DeleteLocalInt(OBJECT_SELF, "streamed"));
//Signal event to start the TimeStop
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));
// Begin custom TimeStop
SendMessageToAllDMs("Timestop cast by " + pc + " in " + busted);
float fDist = 200.0;
object oNearestC; // Define nearest creature
// Begin loop to find all creatures within the fDist meter radius
oNearestC = GetFirstObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oNearestC))
{
// This makes sure the Caster is not Timestopped and skips any PC's/NPC's associates
if (oNearestC != OBJECT_SELF) {
AssignCommand(oNearestC, ClearAllActions());
DelayCommand(0.01, SetCommandable( FALSE, oNearestC ));
DelayCommand(dur, SetCommandable( FALSE, oNearestC ));
}
// Get the next creature in the fDist meter radius and continue loop
oNearestC = GetNextObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
}
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetSpellTargetLocation());
}

@ -0,0 +1,125 @@
//::///////////////////////////////////////////////
//:: Vampiric Touch
//:: NW_S0_VampTch
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
drain 1d6
HP per 2 caster levels from the target.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 29, 2001
//:://////////////////////////////////////////////
/*
bugfix by Kovi 2002.07.22
- did double damage with maximize
- temporary hp was stacked
2002.08.25
- got temporary hp some immune creatures (Negative Energy Protection), lost
temporary hp against other resistant (SR, Shadow Shield)
Georg 2003-09-11
- Put in melee touch attack check, as the fixed attack bonus is now calculated correctly
*/
#include "x0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
//--------------------------------------------------------------------------
/* Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
//--------------------------------------------------------------------------
if (!X2PreSpellCastCode())
{
return;
}
//--------------------------------------------------------------------------
// End of Spell Cast Hook
//--------------------------------------------------------------------------
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDDice = nCasterLevel /2;
if ((nDDice) == 0)
{
nDDice = 1;
}
//--------------------------------------------------------------------------
// GZ: Cap according to the book
//--------------------------------------------------------------------------
else if (nDDice>20)
{
nDDice = 20;
}
int nDamage = d6(nDDice);
//--------------------------------------------------------------------------
//Enter Metamagic conditions
//--------------------------------------------------------------------------
nDamage = MaximizeOrEmpower(6,nDDice,nMetaMagic);
int nDuration = nCasterLevel/2;
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration *= 2;
}
//--------------------------------------------------------------------------
//Limit damage to max hp + 10
//--------------------------------------------------------------------------
int nMax = GetCurrentHitPoints(oTarget) + 20;
if(nMax < nDamage)
{
nDamage = nMax;
}
effect eHeal = EffectTemporaryHitpoints(nDamage);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eHeal, eDur);
effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
if(!GetIsReactionTypeFriendly(oTarget) &&
GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD &&
GetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT &&
!GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION, oTarget))
{
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_VAMPIRIC_TOUCH, FALSE));
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_VAMPIRIC_TOUCH, TRUE));
// GZ: * GetSpellCastItem() == OBJECT_INVALID is used to prevent feedback from showing up when used as OnHitCastSpell property
if (TouchAttackMelee(oTarget,GetSpellCastItem() == OBJECT_INVALID)>0)
{
if(MyResistSpell(OBJECT_SELF, oTarget) == 0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, OBJECT_SELF);
RemoveTempHitPoints();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, HoursToSeconds(nDuration));
}
}
}
}
}

@ -0,0 +1,60 @@
//::///////////////////////////////////////////////
//:: Wall of Fire: On Enter
//:: NW_S0_WallFireA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Person within the AoE take 4d6 fire damage
per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
object oTarget;
//Declare and assign personal impact visual effect.
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
//Capture the first target object in the shape.
oTarget = GetEnteringObject();
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WALL_OF_FIRE));
//Make SR check, and appropriate saving throw(s).
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget))
{
//Roll damage.
nDamage = d6(4) + 16;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 40;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
if(nDamage > 0)
{
// Apply effects to the currently selected target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}
}

@ -0,0 +1,78 @@
//::///////////////////////////////////////////////
//:: Wall of Fire: Heartbeat
//:: NW_S0_WallFireA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Person within the AoE take 4d6 fire damage
per round.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "epicdc_inc"
void main()
{
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nDamage;
effect eDam;
object oTarget;
//Declare and assign personal impact visual effect.
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
//Capture the first target object in the shape.
//--------------------------------------------------------------------------
// GZ 2003-Oct-15
// When the caster is no longer there, all functions calling
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
//--------------------------------------------------------------------------
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
{
DestroyObject(OBJECT_SELF);
return;
}
oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
//Declare the spell shape, size and the location.
while(GetIsObjectValid(oTarget))
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WALL_OF_FIRE));
//Make SR check, and appropriate saving throw(s).
if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget))
{
//Roll damage.
nDamage = d6(4) + 16;
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 40;//Damage is at max
}
if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
}
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetEpicSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
if(nDamage > 0)
{
// Apply effects to the currently selected target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 1.0);
}
}
}
//Select the next target within the spell shape.
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
}

@ -0,0 +1,26 @@
#include "nwnx_admin"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Administration unit test begin..");
string sString = "FuzzyKittens";
NWNX_Administration_SetPlayerPassword(sString);
NWNX_Tests_Report("NWNX_Administration", "{Set/Get}PlayerPassword", NWNX_Administration_GetPlayerPassword() == sString);
NWNX_Administration_ClearPlayerPassword();
NWNX_Tests_Report("NWNX_Administration", "ClearPlayerPassword", NWNX_Administration_GetPlayerPassword() == "");
NWNX_Administration_SetDMPassword(sString);
NWNX_Tests_Report("NWNX_Administration", "{Set/Get}DMPassword", NWNX_Administration_GetDMPassword() == sString);
NWNX_Administration_SetPlayOption(NWNX_ADMINISTRATION_OPTION_EXAMINE_EFFECTS, TRUE);
NWNX_Tests_Report("NWNX_Administration", "{Set/Get}PlayOption", NWNX_Administration_GetPlayOption(NWNX_ADMINISTRATION_OPTION_EXAMINE_EFFECTS));
NWNX_Administration_SetDebugValue(NWNX_ADMINISTRATION_DEBUG_MOVEMENT_SPEED, TRUE);
NWNX_Tests_Report("NWNX_Administration", "{Set/Get}DebugValue", NWNX_Administration_GetDebugValue(NWNX_ADMINISTRATION_DEBUG_MOVEMENT_SPEED));
WriteTimestampedLogEntry("NWNX_Administration unit test end.");
}

@ -0,0 +1,73 @@
#include "nwnx_area"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Area unit test begin..");
object oArea = GetAreaFromLocation(GetStartingLocation());
if (GetIsObjectValid(oArea))
{
WriteTimestampedLogEntry("Using starting area: " + GetName(oArea));
object oPC = GetFirstPC();
if (GetIsObjectValid(oPC) && GetArea(oPC) == oArea)
{
NWNX_Tests_Report("NWNX_Area", "GetNumberOfPlayersInArea", NWNX_Area_GetNumberOfPlayersInArea(oArea) == 1);
}
else
{
WriteTimestampedLogEntry("No player in area, skipping 'GetNumberOfPlayersInArea' test");
}
NWNX_Area_SetPVPSetting(oArea, NWNX_AREA_PVP_SETTING_PARTY_PVP);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}PVPSetting", NWNX_Area_GetPVPSetting(oArea) == NWNX_AREA_PVP_SETTING_PARTY_PVP);
NWNX_Area_SetAreaSpotModifier(oArea, 25);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}AreaSpotModifier", NWNX_Area_GetAreaSpotModifier(oArea) == 25);
NWNX_Area_SetAreaListenModifier(oArea, 25);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}AreaListenModifier", NWNX_Area_GetAreaListenModifier(oArea) == 25);
NWNX_Area_SetNoRestingAllowed(oArea, TRUE);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}NoRestingAllowed", NWNX_Area_GetNoRestingAllowed(oArea));
NWNX_Area_SetWindPower(oArea, 2);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}WindPower", NWNX_Area_GetWindPower(oArea) == 2);
NWNX_Area_SetWeatherChance(oArea, NWNX_AREA_WEATHER_CHANCE_LIGHTNING, 50);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}WeatherChance", NWNX_Area_GetWeatherChance(oArea, NWNX_AREA_WEATHER_CHANCE_LIGHTNING) == 50);
NWNX_Area_SetFogClipDistance(oArea, 12.5f);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}FogClipDistance", NWNX_Area_GetFogClipDistance(oArea) == 12.5f);
NWNX_Area_SetShadowOpacity(oArea, 75);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}ShadowOpacity", NWNX_Area_GetShadowOpacity(oArea) == 75);
NWNX_Area_SetDayNightCycle(oArea, NWNX_AREA_DAYNIGHTCYCLE_ALWAYS_DARK);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}DayNightCycle", NWNX_Area_GetDayNightCycle(oArea) == NWNX_AREA_DAYNIGHTCYCLE_ALWAYS_DARK);
NWNX_Area_SetSunMoonColors(oArea, NWNX_AREA_COLOR_TYPE_MOON_DIFFUSE, FOG_COLOR_GREEN);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}SunMoonColors", NWNX_Area_GetSunMoonColors(oArea, NWNX_AREA_COLOR_TYPE_MOON_DIFFUSE) == FOG_COLOR_GREEN);
vector vLoc = GetPositionFromLocation(GetStartingLocation());
object oWP = CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", GetStartingLocation());
object oAT = NWNX_Area_CreateTransition(oArea, oWP, vLoc.x, vLoc.y, vLoc.z);
NWNX_Tests_Report("NWNX_Area", "CreateTransition", oAT != OBJECT_INVALID);
string sResult = NWNX_Area_GetTileModelResRef(oArea, vLoc.x, vLoc.y);
NWNX_Tests_Report("NWNX_Area", "GetTileModelResRef", sResult != "");
NWNX_Area_SetTileAnimationLoop(oArea, vLoc.x, vLoc.y, 1, FALSE);
NWNX_Tests_Report("NWNX_Area", "{Set/Get}TileAnimationLoop", NWNX_Area_GetTileAnimationLoop(oArea, vLoc.x, vLoc.y, 1) == FALSE);
}
else
{
WriteTimestampedLogEntry("No valid area found, aborting.");
}
WriteTimestampedLogEntry("NWNX_Area unit test end.");
}

@ -0,0 +1,20 @@
#include "nwnx_chat"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Chat unit test begin..");
float fDefaultTalk = NWNX_Chat_GetChatHearingDistance();
NWNX_Chat_SetChatHearingDistance(fDefaultTalk + 10.0f);
NWNX_Tests_Report("NWNX_Chat", "SetChatHearingDistance Default", fDefaultTalk == NWNX_Chat_GetChatHearingDistance() - 10.0f);
object oPC = GetFirstPC();
float fPCWhisper = NWNX_Chat_GetChatHearingDistance(oPC, NWNX_CHAT_CHANNEL_PLAYER_WHISPER);
NWNX_Chat_SetChatHearingDistance(fPCWhisper + 2.0f, oPC, NWNX_CHAT_CHANNEL_PLAYER_WHISPER);
NWNX_Tests_Report("NWNX_Chat", "SetChatHearingDistance Per PC", fPCWhisper == NWNX_Chat_GetChatHearingDistance(oPC, NWNX_CHAT_CHANNEL_PLAYER_WHISPER) - 2.0f);
WriteTimestampedLogEntry("NWNX_Chat unit test end.");
}

@ -0,0 +1,256 @@
#include "nwnx_creature"
#include "nwnx_tests"
const int FEAT_BARBARIAN_RAGE_2 = 326;
void main()
{
WriteTimestampedLogEntry("NWNX_Creature unit test begin..");
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
if (!GetIsObjectValid(oCreature))
{
WriteTimestampedLogEntry("NWNX_Creature test: Failed to create creature");
return;
}
//
// FEAT related functions
//
int nFeatCountLvl1 = NWNX_Creature_GetFeatCountByLevel(oCreature, 1);
int nFeatCountTotal = NWNX_Creature_GetFeatCount(oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetKnowsFeat", NWNX_Creature_GetKnowsFeat(oCreature, FEAT_PLAYER_TOOL_01) == 0);
NWNX_Creature_AddFeat(oCreature, FEAT_PLAYER_TOOL_01);
NWNX_Tests_Report("NWNX_Creature", "AddFeat", NWNX_Creature_GetKnowsFeat(oCreature, FEAT_PLAYER_TOOL_01) == 1);
NWNX_Tests_Report("NWNX_Creature", "GetFeatCountByLevel", NWNX_Creature_GetFeatCountByLevel(oCreature, 1) == nFeatCountLvl1);
NWNX_Tests_Report("NWNX_Creature", "GetFeatCount", NWNX_Creature_GetFeatCount(oCreature) == (nFeatCountTotal+1));
NWNX_Tests_Report("NWNX_Creature", "GetFeatByIndex", NWNX_Creature_GetFeatByIndex(oCreature, nFeatCountTotal) == FEAT_PLAYER_TOOL_01);
NWNX_Creature_RemoveFeat(oCreature, FEAT_PLAYER_TOOL_01);
NWNX_Tests_Report("NWNX_Creature", "RemoveFeat", NWNX_Creature_GetKnowsFeat(oCreature, FEAT_PLAYER_TOOL_01) == 0);
NWNX_Tests_Report("NWNX_Creature", "GetFeatCount", NWNX_Creature_GetFeatCount(oCreature) == nFeatCountTotal);
NWNX_Tests_Report("NWNX_Creature", "GetFeatByIndex", NWNX_Creature_GetFeatByIndex(oCreature, nFeatCountTotal) == -1);
NWNX_Creature_AddFeatByLevel(oCreature, FEAT_PLAYER_TOOL_01, 1);
NWNX_Tests_Report("NWNX_Creature", "AddFeatByLevel", NWNX_Creature_GetKnowsFeat(oCreature, FEAT_PLAYER_TOOL_01) == 1);
NWNX_Tests_Report("NWNX_Creature", "GetFeatCountByLevel", NWNX_Creature_GetFeatCountByLevel(oCreature, 1) > nFeatCountLvl1);
NWNX_Tests_Report("NWNX_Creature", "GetFeatCount", NWNX_Creature_GetFeatCount(oCreature) == (nFeatCountTotal+1));
NWNX_Tests_Report("NWNX_Creature", "GetFeatByIndex", NWNX_Creature_GetFeatByIndex(oCreature, nFeatCountTotal) == FEAT_PLAYER_TOOL_01);
NWNX_Tests_Report("NWNX_Creature", "GetFeatByLevel", NWNX_Creature_GetFeatByLevel(oCreature, 1, nFeatCountLvl1) == FEAT_PLAYER_TOOL_01);
NWNX_Tests_Report("NWNX_Creature", "GetFeatGrantLevel", NWNX_Creature_GetFeatGrantLevel(oCreature, FEAT_PLAYER_TOOL_01) == 1);
NWNX_Creature_AddFeat(oCreature, FEAT_BARBARIAN_RAGE);
NWNX_Tests_Report("NWNX_Creature", "GetHighestLevelOfFeat", NWNX_Creature_GetHighestLevelOfFeat(oCreature, FEAT_BARBARIAN_RAGE) == FEAT_BARBARIAN_RAGE);
NWNX_Creature_AddFeat(oCreature, FEAT_BARBARIAN_RAGE_2);
NWNX_Tests_Report("NWNX_Creature", "GetHighestLevelOfFeat", NWNX_Creature_GetHighestLevelOfFeat(oCreature, FEAT_BARBARIAN_RAGE) == FEAT_BARBARIAN_RAGE_2);
NWNX_Creature_AddFeat(oCreature, FEAT_STUNNING_FIST);
NWNX_Tests_Report("NWNX_Creature", "GetFeatRemainingUses", NWNX_Creature_GetFeatRemainingUses(oCreature, FEAT_STUNNING_FIST) == 1);
NWNX_Creature_SetFeatRemainingUses(oCreature, FEAT_STUNNING_FIST, 0);
NWNX_Tests_Report("NWNX_Creature", "GetFeatRemainingUses", NWNX_Creature_GetFeatRemainingUses(oCreature, FEAT_STUNNING_FIST) == 0);
int uses = NWNX_Creature_GetFeatTotalUses(oCreature, FEAT_STUNNING_FIST);
WriteTimestampedLogEntry("Creature has " + IntToString(uses) + " total uses of STUNNING FIST left");
//
// SPECIAL ABILITY functions
//
struct NWNX_Creature_SpecialAbility ability;
ability.id = 1; ability.ready = 1; ability.level = 1;
int nAbilityCount = NWNX_Creature_GetSpecialAbilityCount(oCreature);
NWNX_Creature_AddSpecialAbility(oCreature, ability);
NWNX_Tests_Report("NWNX_Creature", "AddSpecialAbility", NWNX_Creature_GetSpecialAbilityCount(oCreature) > nAbilityCount);
ability = NWNX_Creature_GetSpecialAbility(oCreature, nAbilityCount);
NWNX_Tests_Report("NWNX_Creature", "GetSpecialAbility", ability.id == 1);
NWNX_Creature_RemoveSpecialAbility(oCreature, nAbilityCount);
NWNX_Tests_Report("NWNX_Creature", "RemoveSpecialAbility", NWNX_Creature_GetSpecialAbilityCount(oCreature) == nAbilityCount);
//
// SPELL functions
//
// TODO: Need a wizard.
//
// MISC
//
int nBaseAC = NWNX_Creature_GetBaseAC(oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetBaseAC", nBaseAC >= 0);
NWNX_Creature_SetBaseAC(oCreature, nBaseAC + 5);
NWNX_Tests_Report("NWNX_Creature", "SetBaseAC", NWNX_Creature_GetBaseAC(oCreature) > nBaseAC);
int nOldStr = GetAbilityScore(oCreature, ABILITY_STRENGTH, TRUE);
NWNX_Creature_SetRawAbilityScore(oCreature, ABILITY_STRENGTH, 25);
NWNX_Tests_Report("NWNX_Creature", "SetAbilityScore", nOldStr != GetAbilityScore(oCreature, ABILITY_STRENGTH, TRUE));
NWNX_Tests_Report("NWNX_Creature", "SetAbilityScore", 25 == GetAbilityScore(oCreature, ABILITY_STRENGTH, TRUE));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPolymorph(POLYMORPH_TYPE_BADGER), oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetPrePolymorphAbilityScore", 25 == NWNX_Creature_GetPrePolymorphAbilityScore(oCreature, ABILITY_STRENGTH));
RemoveEffect(oCreature, GetFirstEffect(oCreature));
NWNX_Tests_Report("NWNX_Creature", "GetMovementRateFactor", 1.0 == NWNX_Creature_GetMovementRateFactor(oCreature));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectMovementSpeedIncrease(25), oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetMovementRateFactor", 1.25 == NWNX_Creature_GetMovementRateFactor(oCreature));
NWNX_Creature_SetMovementRateFactor(oCreature, 1.5);
NWNX_Tests_Report("NWNX_Creature", "SetMovementRateFactor", 1.5 == NWNX_Creature_GetMovementRateFactor(oCreature));
int nLvl1HP = NWNX_Creature_GetMaxHitPointsByLevel(oCreature, 1);
NWNX_Tests_Report("NWNX_Creature", "GetMaxHitPointsByLevel", nLvl1HP >= 0);
NWNX_Creature_SetMaxHitPointsByLevel(oCreature, 1, nLvl1HP + 5);
NWNX_Tests_Report("NWNX_Creature", "SetMaxHitPointsByLevel", NWNX_Creature_GetMaxHitPointsByLevel(oCreature, 1) > nLvl1HP);
int nSkillRanks = GetSkillRank(SKILL_LISTEN, oCreature, TRUE);
NWNX_Creature_SetSkillRank(oCreature, SKILL_LISTEN, nSkillRanks + 5);
NWNX_Tests_Report("NWNX_Creature", "SetSkillRank", GetSkillRank(SKILL_LISTEN, oCreature, TRUE) > nSkillRanks);
int nBAB = GetBaseAttackBonus(oCreature);
NWNX_Creature_SetBaseAttackBonus(oCreature, 6);
NWNX_Tests_Report("NWNX_Creature", "SetBaseAttackBonus", GetBaseAttackBonus(oCreature) == 6);
SetBaseAttackBonus(4, oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetAttacksPerRound - base", NWNX_Creature_GetAttacksPerRound(oCreature, TRUE) == 2);
NWNX_Tests_Report("NWNX_Creature", "GetAttacksPerRound - override", NWNX_Creature_GetAttacksPerRound(oCreature, FALSE) == 4);
RestoreBaseAttackBonus(oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetAttacksPerRound - base", NWNX_Creature_GetAttacksPerRound(oCreature, TRUE) == 2);
NWNX_Tests_Report("NWNX_Creature", "GetAttacksPerRound - override", NWNX_Creature_GetAttacksPerRound(oCreature, FALSE) == 2);
int nGender = GetGender(oCreature);
NWNX_Creature_SetGender(oCreature, !nGender);
NWNX_Tests_Report("NWNX_Creature", "SetGender", GetGender(oCreature) != nGender);
int nSize = GetCreatureSize(oCreature);
NWNX_Creature_SetSize(oCreature, nSize + 1);
NWNX_Tests_Report("NWNX_Creature", "SetSize", GetCreatureSize(oCreature) != nSize);
int nSkillPointsRemaining = NWNX_Creature_GetSkillPointsRemaining(oCreature);
NWNX_Tests_Report("NWNX_Creature", "GetSkillPointsRemaining", nSkillPointsRemaining >= 0);
NWNX_Creature_SetSkillPointsRemaining(oCreature, nSkillPointsRemaining+1);
NWNX_Tests_Report("NWNX_Creature", "SetSkillPointsRemaining", NWNX_Creature_GetSkillPointsRemaining(oCreature) == nSkillPointsRemaining+1);
int nGold = GetGold(oCreature);
NWNX_Creature_SetGold(oCreature, nGold + 100);
NWNX_Tests_Report("NWNX_Creature", "SetGold", GetGold(oCreature) == (nGold+100));
int nSave = NWNX_Creature_GetBaseSavingThrow(oCreature, SAVING_THROW_WILL);
NWNX_Creature_SetBaseSavingThrow(oCreature, SAVING_THROW_WILL, nSave + 10);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etBaseSavingThrow", NWNX_Creature_GetBaseSavingThrow(oCreature, SAVING_THROW_WILL) == nSave+10);
int cls = NWNX_Creature_GetClassByLevel(oCreature, 1);
NWNX_Creature_LevelUp(oCreature, cls, 10);
NWNX_Tests_Report("NWNX_Creature", "LevelUp", GetLevelByPosition(1, oCreature) == 11);
NWNX_Creature_LevelDown(oCreature, 10);
NWNX_Tests_Report("NWNX_Creature", "LevelDown", GetLevelByPosition(1, oCreature) == 1);
NWNX_Creature_SetClassByPosition(oCreature, 0, CLASS_TYPE_ROGUE);
NWNX_Creature_LevelUp(oCreature, CLASS_TYPE_ROGUE, 20);
NWNX_Creature_LevelUp(oCreature, CLASS_TYPE_ROGUE, 20);
NWNX_Creature_LevelUp(oCreature, CLASS_TYPE_ROGUE, 20);
NWNX_Creature_LevelUp(oCreature, CLASS_TYPE_ROGUE, 20);
NWNX_Tests_Report("NWNX_Creature", "LevelUp+SetLevelByPosition", GetLevelByPosition(1, oCreature) == 60);
NWNX_Creature_SetLevelByPosition(oCreature, 0, 1); // Ugh, game uses 1-based indexing here..
NWNX_Tests_Report("NWNX_Creature", "SetLevelByPosition", GetLevelByPosition(1, oCreature) == 1);
float fCR = GetChallengeRating(oCreature);
NWNX_Creature_SetChallengeRating(oCreature, fCR + 1.0);
NWNX_Tests_Report("NWNX_Creature", "SetChallengeRating", GetChallengeRating(oCreature) == (fCR + 1.0));
int iOldBonus = NWNX_Creature_GetTotalEffectBonus(oCreature, NWNX_CREATURE_BONUS_TYPE_ABILITY, OBJECT_INVALID, 0, 0, -1, -1, -1, ABILITY_STRENGTH);
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH,1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStr, oCreature, 2.0f);
int iNewBonus = NWNX_Creature_GetTotalEffectBonus(oCreature, NWNX_CREATURE_BONUS_TYPE_ABILITY, OBJECT_INVALID, 0, 0, -1, -1, -1, ABILITY_STRENGTH);
NWNX_Tests_Report("NWNX_Creature", "GetTotalEffectBonus", iOldBonus+1 == iNewBonus);
int iSR = GetSpellResistance(oCreature);
NWNX_Creature_SetSpellResistance(oCreature, iSR + 10);
NWNX_Tests_Report("NWNX_Creature", "SetSpellResistance", GetSpellResistance(oCreature) == (iSR + 10));
NWNX_Creature_SetAnimalCompanionCreatureType(oCreature, ANIMAL_COMPANION_CREATURE_TYPE_PANTHER);
NWNX_Tests_Report("NWNX_Creature", "SetAnimalCompanionCreatureType", GetAnimalCompanionCreatureType(oCreature) == ANIMAL_COMPANION_CREATURE_TYPE_PANTHER);
NWNX_Creature_SetFamiliarCreatureType(oCreature, FAMILIAR_CREATURE_TYPE_PSEUDO_DRAGON);
NWNX_Tests_Report("NWNX_Creature", "SetFamiliarCreatureType", GetFamiliarCreatureType(oCreature) == FAMILIAR_CREATURE_TYPE_PSEUDO_DRAGON);
NWNX_Creature_SetAnimalCompanionName(oCreature, "Fuzzles");
NWNX_Tests_Report("NWNX_Creature", "SetAnimalCompanionName", GetAnimalCompanionName(oCreature) == "Fuzzles");
NWNX_Creature_SetFamiliarName(oCreature, "Fuzzles");
NWNX_Tests_Report("NWNX_Creature", "SetFamiliarName", GetFamiliarName(oCreature) == "Fuzzles");
int bDisarmable = NWNX_Creature_GetDisarmable(oCreature);
NWNX_Creature_SetDisarmable(oCreature, !bDisarmable);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etDisarmable", NWNX_Creature_GetDisarmable(oCreature) != bDisarmable);
//Spawn a Wizard
oCreature = CreateObject(OBJECT_TYPE_CREATURE, "NW_ELFMAGE001", GetStartingLocation());
if (!GetIsObjectValid(oCreature))
{
WriteTimestampedLogEntry("NWNX_Creature test: Failed to create creature");
return;
}
//Test specialization functions on a class that has specialization
int nSchool = NWNX_Creature_GetSpecialization(oCreature, CLASS_TYPE_WIZARD);
NWNX_Creature_SetSpecialization(oCreature, CLASS_TYPE_WIZARD, (nSchool+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etSpecialization", NWNX_Creature_GetSpecialization(oCreature, CLASS_TYPE_WIZARD) == (nSchool+1)%5);
//Test old functions for compatibility (deprecated)
nSchool = NWNX_Creature_GetWizardSpecialization(oCreature);
NWNX_Creature_SetWizardSpecialization(oCreature, (nSchool+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etWizardSpecialization", NWNX_Creature_GetWizardSpecialization(oCreature) == (nSchool+1)%5);
//Test domain functions on a class that doesn't have domains
int nDomain = NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 1);
NWNX_Tests_Report("NWNX_Creature", "GetDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 1) == 0);
NWNX_Creature_SetDomain(oCreature, CLASS_TYPE_WIZARD, 1, (nDomain+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 1) == (nDomain+1)%5);
int nDomain2 = NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 2);
NWNX_Tests_Report("NWNX_Creature", "GetDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 2) == 0);
NWNX_Creature_SetDomain(oCreature, CLASS_TYPE_WIZARD, 2, (nDomain2+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_WIZARD, 2) == (nDomain2+1)%5);
//Spawn a cleric
oCreature = CreateObject(OBJECT_TYPE_CREATURE, "NW_BANDIT004", GetStartingLocation());
if (!GetIsObjectValid(oCreature))
{
WriteTimestampedLogEntry("NWNX_Creature test: Failed to create creature");
return;
}
//Test specialization functions on a class that doesn't have specialization
nSchool = NWNX_Creature_GetSpecialization(oCreature, CLASS_TYPE_CLERIC);
NWNX_Tests_Report("NWNX_Creature", "GetSpecialization", NWNX_Creature_GetSpecialization(oCreature, CLASS_TYPE_CLERIC) == 0);
NWNX_Creature_SetSpecialization(oCreature, CLASS_TYPE_CLERIC, (nSchool+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etSpecialization", NWNX_Creature_GetSpecialization(oCreature, CLASS_TYPE_CLERIC) == (nSchool+1)%5);
//Test domain functions on a class that has domains
nDomain = NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_CLERIC, 1);
NWNX_Creature_SetDomain(oCreature, CLASS_TYPE_CLERIC, 1, (nDomain+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_CLERIC, 1) == (nDomain+1)%5);
nDomain2 = NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_CLERIC, 2);
NWNX_Creature_SetDomain(oCreature, CLASS_TYPE_CLERIC, 2, (nDomain2+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etDomain", NWNX_Creature_GetDomain(oCreature, CLASS_TYPE_CLERIC, 2) == (nDomain2+1)%5);
//Test old functions for compatibility (deprecated)
nDomain = NWNX_Creature_GetClericDomain(oCreature, 1);
NWNX_Creature_SetClericDomain(oCreature, 1, (nDomain+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etClericDomain", NWNX_Creature_GetClericDomain(oCreature, 1) == (nDomain+1)%5);
nDomain2 = NWNX_Creature_GetClericDomain(oCreature, 2);
NWNX_Creature_SetClericDomain(oCreature, 2, (nDomain2+1)%5);
NWNX_Tests_Report("NWNX_Creature", "{S,G}etClericDomain", NWNX_Creature_GetClericDomain(oCreature, 2) == (nDomain2+1)%5);
WriteTimestampedLogEntry("NWNX_Creature unit test end.");
}

@ -0,0 +1,37 @@
#include "nwnx_dialog"
void _report()
{
string sMessage = "NWNX_Dialog debug:";
int id = NWNX_Dialog_GetCurrentNodeID();
sMessage = "\nNode ID = " + IntToString(id);
int type = NWNX_Dialog_GetCurrentNodeType();
sMessage += "\nCurrent node type = " + IntToString(type) + " (";
switch (type)
{
case NWNX_DIALOG_NODE_TYPE_INVALID: sMessage += "INVALID)"; break;
case NWNX_DIALOG_NODE_TYPE_STARTING_NODE: sMessage += "STARTING_NODE)"; break;
case NWNX_DIALOG_NODE_TYPE_ENTRY_NODE: sMessage += "ENTRY_NODE)"; break;
case NWNX_DIALOG_NODE_TYPE_REPLY_NODE: sMessage += "REPLY_NODE)"; break;
}
int scripttype = NWNX_Dialog_GetCurrentScriptType();
sMessage += "\nScript type = " + IntToString(scripttype) + " (";
switch (scripttype)
{
case NWNX_DIALOG_SCRIPT_TYPE_OTHER: sMessage += "OTHER)"; break;
case NWNX_DIALOG_SCRIPT_TYPE_STARTING_CONDITIONAL: sMessage += "STARTING_CONDITIONAL)"; break;
case NWNX_DIALOG_SCRIPT_TYPE_ACTION_TAKEN: sMessage += "ACTION_TAKEN)"; break;
}
int index = NWNX_Dialog_GetCurrentNodeIndex();
sMessage += "\nNode index = " + IntToString(index);
string text = NWNX_Dialog_GetCurrentNodeText();
sMessage += "\nText = '" + text + "'";
NWNX_Dialog_SetCurrentNodeText(text + " [ADDED]");
SendMessageToPC(GetFirstPC(), sMessage);
}

@ -0,0 +1,7 @@
#include "nwnx_dialog_t"
int StartingConditional()
{
_report();
return FALSE;
}

@ -0,0 +1,7 @@
#include "nwnx_dialog_t"
int StartingConditional()
{
_report();
return TRUE;
}

@ -0,0 +1,6 @@
#include "nwnx_dialog_t"
void main()
{
_report();
}

@ -0,0 +1,80 @@
#include "nwnx_effect"
#include "nwnx_tests"
void printeff(struct NWNX_EffectUnpacked n)
{
string s = "Unpacked effect: \n";
s += "nType = " + IntToString(n.nType) + "\n";
s += "nSubType = " + IntToString(n.nSubType) + "\n";
s += "fDuration = " + FloatToString(n.fDuration) + "\n";
s += "nExpiryCalendarDay = " + IntToString(n.nExpiryCalendarDay) + "\n";
s += "nExpiryTimeOfDay = " + IntToString(n.nExpiryTimeOfDay) + "\n";
s += "oCreator = " + ObjectToString(n.oCreator) + "\n";
s += "nSpellId = " + IntToString(n.nSpellId) + "\n";
s += "bExpose = " + IntToString(n.bExpose) + "\n";
s += "bShowIcon = " + IntToString(n.bShowIcon) + "\n";
s += "nCasterLevel = " + IntToString(n.nCasterLevel) + "\n";
s += "bLinkLeftValid = " + IntToString(n.bLinkLeftValid) + "\n";
struct NWNX_EffectUnpacked link = NWNX_Effect_UnpackEffect(n.eLinkLeft);
s += "bLinkLeft (nType) = " + IntToString(link.nType) + "\n";
s += "bLinkRightValid = " + IntToString(n.bLinkRightValid) + "\n";
link = NWNX_Effect_UnpackEffect(n.eLinkRight);
s += "bLinkRight (nType) = " + IntToString(link.nType) + "\n";
s += "nNumIntegers = " + IntToString(n.nNumIntegers) + "\n";
s += "nParam0 = " + IntToString(n.nParam0) + "\n";
s += "nParam1 = " + IntToString(n.nParam1) + "\n";
s += "nParam2 = " + IntToString(n.nParam2) + "\n";
s += "nParam3 = " + IntToString(n.nParam3) + "\n";
s += "nParam4 = " + IntToString(n.nParam4) + "\n";
s += "nParam5 = " + IntToString(n.nParam5) + "\n";
s += "nParam6 = " + IntToString(n.nParam6) + "\n";
s += "nParam7 = " + IntToString(n.nParam7) + "\n";
s += "fParam0 = " + FloatToString(n.fParam0) + "\n";
s += "fParam1 = " + FloatToString(n.fParam1) + "\n";
s += "fParam2 = " + FloatToString(n.fParam2) + "\n";
s += "fParam3 = " + FloatToString(n.fParam3) + "\n";
s += "sParam0 = " + "'" + n.sParam0 + "'" + "\n";
s += "sParam1 = " + "'" + n.sParam1 + "'" + "\n";
s += "sParam2 = " + "'" + n.sParam2 + "'" + "\n";
s += "sParam3 = " + "'" + n.sParam3 + "'" + "\n";
s += "sParam4 = " + "'" + n.sParam4 + "'" + "\n";
s += "sParam5 = " + "'" + n.sParam5 + "'" + "\n";
s += "oParam0 = " + ObjectToString(n.oParam0) + "\n";
s += "oParam1 = " + ObjectToString(n.oParam1) + "\n";
s += "oParam2 = " + ObjectToString(n.oParam2) + "\n";
s += "oParam3 = " + ObjectToString(n.oParam3) + "\n";
s += "sTag = " + "'" + n.sTag + "'" + "\n";
WriteTimestampedLogEntry(s);
}
void main()
{
WriteTimestampedLogEntry("NWNX_Effect unit test begin..");
effect eCurse = EffectCurse(1, 2, 3, 4, 5, 6);
effect eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
effect e = EffectLinkEffects(eCurse, eVis);
e = TagEffect(e, "NWNX_EFFECT_TEST");
struct NWNX_EffectUnpacked unpacked = NWNX_Effect_UnpackEffect(e);
printeff(unpacked);
NWNX_Tests_Report("NWNX_Effect", "UnpackEffect", unpacked.sTag == "NWNX_EFFECT_TEST");
effect packed = NWNX_Effect_PackEffect(unpacked);
NWNX_Tests_Report("NWNX_Effect", "PackEffect", GetEffectTag(packed) == "NWNX_EFFECT_TEST");
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
ApplyEffectToObject(DURATION_TYPE_PERMANENT, packed, oCreature);
e = NWNX_Effect_SetEffectExpiredScript(EffectDarkness(), "effect_test");
unpacked = NWNX_Effect_UnpackEffect(e);
NWNX_Tests_Report("NWNX_Effect", "SetEffectExpiredScript", unpacked.sParam4 == "effect_test");
WriteTimestampedLogEntry("NWNX_Effect unit test end.");
}

@ -0,0 +1,34 @@
#include "nwnx_feedback"
#include "nwnx_tests"
const int NWNX_FEEDBACK_REST_BEGINNING_REST = 18;
const int NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE = 3;
void main()
{
WriteTimestampedLogEntry("NWNX_Feedback unit test begin..");
NWNX_Feedback_SetFeedbackMessageHidden(NWNX_FEEDBACK_REST_BEGINNING_REST, TRUE);
NWNX_Tests_Report("NWNX_Feedback", "{Set/Get}FeedbackMessageHidden (Global)", NWNX_Feedback_GetFeedbackMessageHidden(NWNX_FEEDBACK_REST_BEGINNING_REST));
NWNX_Feedback_SetCombatLogMessageHidden(NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE, TRUE);
NWNX_Tests_Report("NWNX_Feedback", "{Set/Get}CombatMessageHidden (Global)", NWNX_Feedback_GetCombatLogMessageHidden(NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE));
object oPC = GetFirstPC();
if( GetIsObjectValid(oPC) )
{
NWNX_Feedback_SetFeedbackMessageHidden(NWNX_FEEDBACK_REST_BEGINNING_REST, TRUE, oPC);
NWNX_Tests_Report("NWNX_Feedback", "{Set/Get}FeedbackMessageHidden (Personal)", NWNX_Feedback_GetFeedbackMessageHidden(NWNX_FEEDBACK_REST_BEGINNING_REST, oPC));
NWNX_Feedback_SetCombatLogMessageHidden(NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE, TRUE, oPC);
NWNX_Tests_Report("NWNX_Feedback", "{Set/Get}CombatMessageHidden (Personal)", NWNX_Feedback_GetCombatLogMessageHidden(NWNX_FEEDBACK_COMBATLOG_COMPLEX_DAMAGE, oPC));
}
else
{
WriteTimestampedLogEntry("No valid PC found, skipping personal feedback state tests");
}
WriteTimestampedLogEntry("NWNX_Feedback unit test end.");
}

@ -0,0 +1,42 @@
#include "nwnx_itemprop"
#include "nwnx_tests"
void printip(struct NWNX_IPUnpacked n)
{
string s = "Unpacked IP: \n";
s += "nProperty = " + IntToString(n.nProperty) + "\n";
s += "nSubType = " + IntToString(n.nSubType) + "\n";
s += "nCostTable = " + IntToString(n.nCostTable) + "\n";
s += "nCostTableValue = " + IntToString(n.nCostTableValue) + "\n";
s += "nParam1 = " + IntToString(n.nParam1) + "\n";
s += "nParam1Value = " + IntToString(n.nParam1Value) + "\n";
s += "nUsesPerDay = " + IntToString(n.nUsesPerDay) + "\n";
s += "nChanceToAppear = " + IntToString(n.nChanceToAppear) + "\n";
s += "bUsable = " + IntToString(n.bUsable) + "\n";
s += "nSpellId = " + IntToString(n.nSpellId) + "\n";
s += "sTag = " + "'" + n.sTag + "'" + "\n";
WriteTimestampedLogEntry(s);
}
void main()
{
WriteTimestampedLogEntry("NWNX_ItemProperty unit test begin..");
itemproperty ip = ItemPropertyDamageBonusVsRace(1,2,3);
ip = TagItemProperty(ip, "NWNX_ItemProperty_TEST");
struct NWNX_IPUnpacked unpacked = NWNX_ItemProperty_UnpackIP(ip);
printip(unpacked);
NWNX_Tests_Report("NWNX_ItemProperty", "UnpackIP", unpacked.sTag == "NWNX_ItemProperty_TEST");
itemproperty ip2 = NWNX_ItemProperty_PackIP(unpacked);
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetIsItemPropertyValid(ip2));
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetItemPropertyTag(ip2) == "NWNX_ItemProperty_TEST");
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetItemPropertyCostTable(ip2) == unpacked.nCostTable);
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetItemPropertyCostTableValue(ip2) == unpacked.nCostTableValue);
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetItemPropertyParam1(ip2) == unpacked.nParam1);
NWNX_Tests_Report("NWNX_ItemProperty", "PackIP", GetItemPropertyParam1Value(ip2) == unpacked.nParam1Value);
WriteTimestampedLogEntry("NWNX_ItemProperty unit test end.");
}

@ -0,0 +1,121 @@
#include "nwnx_object"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Object unit test begin..");
object o = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
if (!GetIsObjectValid(o))
{
WriteTimestampedLogEntry("NWNX_Object test: Failed to create creature");
return;
}
int nVarCount = NWNX_Object_GetLocalVariableCount(o);
SetLocalInt(o, "nwnx_object_test", 1);
NWNX_Tests_Report("NWNX_Object", "GetLocalVariableCount", NWNX_Object_GetLocalVariableCount(o) == (nVarCount+1));
struct NWNX_Object_LocalVariable lv = NWNX_Object_GetLocalVariable(o, nVarCount);
NWNX_Tests_Report("NWNX_Object", "GetLocalVariable", lv.key == "nwnx_object_test");
NWNX_Tests_Report("NWNX_Object", "GetLocalVariable", lv.type == NWNX_OBJECT_LOCALVAR_TYPE_INT);
string sObj = ObjectToString(o);
NWNX_Tests_Report("NWNX_Object", "StringToObject", NWNX_Object_StringToObject(sObj) == o);
NWNX_Tests_Report("NWNX_Object", "Negative: StringToObject", NWNX_Object_StringToObject("!@#!@#!@#!") == OBJECT_INVALID);
vector vPos = GetPosition(o);
vPos.x += 1;
NWNX_Object_SetPosition(o, vPos);
NWNX_Tests_Report("NWNX_Object", "SetPosition", GetPosition(o).x == vPos.x);
int nMaxHP = GetMaxHitPoints(o);
NWNX_Object_SetMaxHitPoints(o, nMaxHP + 1);
NWNX_Tests_Report("NWNX_Object", "SetMaxHitPoints", GetMaxHitPoints(o) == (nMaxHP + 1));
int nCurrHP = GetCurrentHitPoints(o);
NWNX_Object_SetCurrentHitPoints(o, nCurrHP + 1);
NWNX_Tests_Report("NWNX_Object", "SetCurrentHitPoints", GetCurrentHitPoints(o) == (nCurrHP + 1));
string dialog = "nwnxtest";
NWNX_Object_SetDialogResref(o, dialog);
NWNX_Tests_Report("NWNX_Object", "SetDialogResRef/GetDialogResRef", NWNX_Object_GetDialogResref(o) == dialog);
NWNX_Object_SetInt(o, "TestInt", 10, TRUE);
NWNX_Object_SetString(o, "TestString_1", "This is a string.", TRUE);
NWNX_Object_SetString(o, "TestString_2", "This is another string.", TRUE);
NWNX_Object_SetFloat(o, "TestFloat", 1.5f, TRUE);
NWNX_Tests_Report("NWNX_Object", "Set/GetInt", NWNX_Object_GetInt(o, "TestInt") == 10);
NWNX_Tests_Report("NWNX_Object", "Set/GetString #1", NWNX_Object_GetString(o, "TestString_1") == "This is a string.");
NWNX_Tests_Report("NWNX_Object", "Set/GetString #2", NWNX_Object_GetString(o, "TestString_2") == "This is another string.");
NWNX_Tests_Report("NWNX_Object", "Set/GetFloat", NWNX_Object_GetFloat(o, "TestFloat") == 1.5f);
string sSerialized = NWNX_Object_Serialize(o);
NWNX_Tests_Report("NWNX_Object", "Serialize", sSerialized != "");
WriteTimestampedLogEntry("Serialized chicken: " + sSerialized);
object oDeserialized = NWNX_Object_Deserialize(sSerialized);
NWNX_Tests_Report("NWNX_Object", "Deserialize", GetIsObjectValid(oDeserialized));
NWNX_Object_DeleteInt(o, "TestInt");
NWNX_Object_DeleteString(o, "TestString_1");
NWNX_Object_DeleteString(o, "TestString_2");
NWNX_Object_DeleteFloat(o, "TestFloat");
NWNX_Tests_Report("NWNX_Object", "DeleteInt", NWNX_Object_GetInt(o, "TestInt") == 0);
NWNX_Tests_Report("NWNX_Object", "DeleteString #1", NWNX_Object_GetString(o, "TestString_1") == "");
NWNX_Tests_Report("NWNX_Object", "DeleteString #2", NWNX_Object_GetString(o, "TestString_2") == "");
NWNX_Tests_Report("NWNX_Object", "DeleteFloat", NWNX_Object_GetFloat(o, "TestFloat") == 0.0f);
NWNX_Tests_Report("NWNX_Object", "(Deserialized Object) GetInt", NWNX_Object_GetInt(oDeserialized, "TestInt") == 10);
NWNX_Tests_Report("NWNX_Object", "(Deserialized Object) GetString #1", NWNX_Object_GetString(oDeserialized, "TestString_1") == "This is a string.");
NWNX_Tests_Report("NWNX_Object", "(Deserialized Object) GetString #2", NWNX_Object_GetString(oDeserialized, "TestString_2") == "This is another string.");
NWNX_Tests_Report("NWNX_Object", "(Deserialized Object) GetFloat", NWNX_Object_GetFloat(oDeserialized, "TestFloat") == 1.5f);
NWNX_Object_DeleteVarRegex(oDeserialized, ".*TestString.*");
NWNX_Tests_Report("NWNX_Object", "DeleteVarRegex", NWNX_Object_GetInt(oDeserialized, "TestInt") == 10);
NWNX_Tests_Report("NWNX_Object", "DeleteVarRegex", NWNX_Object_GetString(oDeserialized, "TestString_1") == "");
NWNX_Tests_Report("NWNX_Object", "DeleteVarRegex", NWNX_Object_GetString(oDeserialized, "TestString_2") == "");
NWNX_Tests_Report("NWNX_Object", "DeleteVarRegex", NWNX_Object_GetFloat(oDeserialized, "TestFloat") == 1.5f);
WriteTimestampedLogEntry("Deserialized " + GetName(oDeserialized) + " in " + GetName(GetArea(oDeserialized)));
object bag = CreateObject(OBJECT_TYPE_ITEM, "nw_it_contain006", GetStartingLocation()); // Bag of holding
CreateItemOnObject("x2_it_adaplate", bag, 1);
CreateItemOnObject("x2_it_adaplate", bag, 1);
CreateItemOnObject("x2_it_adaplate", bag, 1);
int iFits = NWNX_Object_CheckFit(bag, BASE_ITEM_ARROW);
NWNX_Tests_Report("NWNX_Object", "CheckFit", iFits == 1);
iFits = NWNX_Object_CheckFit(bag, BASE_ITEM_ARMOR);
NWNX_Tests_Report("NWNX_Object", "CheckFit", iFits == 0);
object oItem = GetFirstItemInInventory(bag);
while (oItem != OBJECT_INVALID)
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(bag);
}
DestroyObject(bag);
NWNX_Tests_Report("NWNX_Object", "GetDamageImmunity", NWNX_Object_GetDamageImmunity(o, DAMAGE_TYPE_FIRE) == 0);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50), o);
NWNX_Tests_Report("NWNX_Object", "GetDamageImmunity", NWNX_Object_GetDamageImmunity(o, DAMAGE_TYPE_FIRE) == 50);
object oPlc = CreateObject(OBJECT_TYPE_PLACEABLE, "nw_defportal", GetStartingLocation());
NWNX_Object_SetPlaceableIsStatic(oPlc, 1);
NWNX_Tests_Report("NWNX_Object", "SetPlaceableIsStatic 1", NWNX_Object_GetPlaceableIsStatic(oPlc) == 1);
DestroyObject(oPlc);
oPlc = CreateObject(OBJECT_TYPE_PLACEABLE, "nw_plc_driftwd1", GetStartingLocation());
NWNX_Object_SetPlaceableIsStatic(oPlc, 0);
NWNX_Tests_Report("NWNX_Object", "SetPlaceableIsStatic 2", NWNX_Object_GetPlaceableIsStatic(oPlc) == 0);
DestroyObject(oPlc);
oPlc = CreateObject(OBJECT_TYPE_PLACEABLE, "nw_plc_driftwd1", GetStartingLocation());
NWNX_Object_SetAutoRemoveKey(oPlc, 1);
NWNX_Tests_Report("NWNX_Object", "SetAutoRemoveKey", NWNX_Object_GetAutoRemoveKey(oPlc) == 1);
DestroyObject(oPlc);
DestroyObject(o);
DestroyObject(oDeserialized);
WriteTimestampedLogEntry("NWNX_Object unit test end.");
}

@ -0,0 +1,16 @@
#include "nwnx_player"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Player unit test begin..");
object oPC = GetFirstPC();
if (!GetIsObjectValid(oPC))
{
WriteTimestampedLogEntry("NWNX_Player test: No PC found");
return;
}
WriteTimestampedLogEntry("NWNX_Player unit test end.");
}

@ -0,0 +1,33 @@
#include "nwnx_race"
#include "nwnx_tests"
void main()
{
WriteTimestampedLogEntry("NWNX_Race unit test begin..");
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
int iSR = GetSpellResistance(oCreature);
int iSkillRank = GetSkillRank(SKILL_HEAL, oCreature);
int iAC = GetAC(oCreature);
int iImmune = GetIsImmune(oCreature, IMMUNITY_TYPE_CURSED);
DestroyObject(oCreature);
NWNX_Race_SetRacialModifier(RACIAL_TYPE_ANIMAL, NWNX_RACE_MODIFIER_SRCHARGEN, 10);
NWNX_Race_SetRacialModifier(RACIAL_TYPE_ANIMAL, NWNX_RACE_MODIFIER_SKILL, SKILL_HEAL, 5);
NWNX_Race_SetRacialModifier(RACIAL_TYPE_ANIMAL, NWNX_RACE_MODIFIER_AC, 1);
NWNX_Race_SetRacialModifier(RACIAL_TYPE_ANIMAL, NWNX_RACE_MODIFIER_IMMUNITY, IMMUNITY_TYPE_CURSED);
oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
int iNewSR = GetSpellResistance(oCreature);
int iNewSkillRank = GetSkillRank(SKILL_HEAL, oCreature);
int iNewAC = GetAC(oCreature);
int iNewImmune = GetIsImmune(oCreature, IMMUNITY_TYPE_CURSED);
DestroyObject(oCreature);
NWNX_Tests_Report("NWNX_Race", "SetRacialModifier SR", iSR == iNewSR - 10);
NWNX_Tests_Report("NWNX_Race", "SetRacialModifier SkillRank", iSkillRank == iNewSkillRank - 5);
NWNX_Tests_Report("NWNX_Race", "SetRacialModifier AC", iAC == iNewAC - 1);
NWNX_Tests_Report("NWNX_Race", "SetRacialModifier Immunity", iImmune != iNewImmune);
WriteTimestampedLogEntry("NWNX_Race unit test end.");
}

@ -0,0 +1,249 @@
#include "nwnx_sql"
#include "nwnx_object"
#include "nwnx_tests"
void cleanup()
{
NWNX_Tests_Report("NWNX_SQL", "Cleanup sql_test", NWNX_SQL_ExecuteQuery("DROP TABLE sql_test"));
NWNX_Tests_Report("NWNX_SQL", "Cleanup stress_test", NWNX_SQL_ExecuteQuery("DROP TABLE stress_test"));
NWNX_Tests_Report("NWNX_SQL", "Cleanup error_test", NWNX_SQL_ExecuteQuery("DROP TABLE error_test"));
}
void main()
{
WriteTimestampedLogEntry("NWNX_SQL unit test begin..");
string db_type = GetStringUpperCase(NWNX_SQL_GetDatabaseType());
WriteTimestampedLogEntry("Testing database " + db_type);
string sCreate = "";
string sInsert = "";
/* MySQL and SQLite version */
if (db_type == "MYSQL" || db_type == "SQLITE")
{
sCreate = "CREATE TABLE sql_test (" +
"colInt INT, colFloat FLOAT, colStr VARCHAR(256)," +
"colObjId INT, colObj TEXT(1000000) );";
sInsert = "INSERT INTO sql_test(colInt, colFloat, colStr, colObjId, colObj) VALUES(?, ?, ?, ?, ?)";
}
/* PostgreSQL version */
if (db_type == "POSTGRESQL")
{
sCreate = "CREATE TABLE sql_test (" +
"colInt INT, colFloat FLOAT, colStr VARCHAR(256)," +
"colObjId INT, colObj TEXT );";
// Even though we're using 0 based parameter numbers, PostgreSQL requires the parameter
// numbers in the actual SQL string to be 1 based (e.g. $1, $2... not $0, $1... )
sInsert = "INSERT INTO sql_test(colInt, colFloat, colStr, colObjId, colObj) VALUES($1, $2, $3, $4, $5)";
}
int b = NWNX_SQL_ExecuteQuery(sCreate);
NWNX_Tests_Report("NWNX_SQL", "Create Table", b);
object o = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
if (!GetIsObjectValid(o))
{
WriteTimestampedLogEntry("NWNX_SQL test: Failed to create creature");
cleanup();
return;
}
vector v = Vector(5.0, 5.0, 0.0); // slightly different location.
b = NWNX_SQL_PrepareQuery(sInsert);
NWNX_Tests_Report("NWNX_SQL", "Complex PrepareQuery", b);
NWNX_Tests_Report("NWNX_SQL", "GetPreparedQueryParamCount", NWNX_SQL_GetPreparedQueryParamCount() == 5);
NWNX_SQL_PreparedInt(0, 42);
NWNX_SQL_PreparedFloat(1, 0.42);
NWNX_SQL_PreparedString(2, "FourtyTwooo");
NWNX_SQL_PreparedObjectId(3, o);
NWNX_SQL_PreparedObjectFull(4, o);
b = NWNX_SQL_ExecutePreparedQuery();
NWNX_Tests_Report("NWNX_SQL", "Complex ExecutePreparedQuery", b);
b = NWNX_SQL_ExecuteQuery("SELECT * FROM sql_test;");
NWNX_Tests_Report("NWNX_SQL", "Select ExecuteQuery", b);
if (b)
{
while (NWNX_SQL_ReadyToReadNextRow())
{
NWNX_SQL_ReadNextRow();
int n = StringToInt(NWNX_SQL_ReadDataInActiveRow(0));
NWNX_Tests_Report("NWNX_SQL", "ReadInt", n == 42);
float f = StringToFloat(NWNX_SQL_ReadDataInActiveRow(1));
NWNX_Tests_Report("NWNX_SQL", "ReadFloat", fabs(f - 0.42) < 0.01);
string s = NWNX_SQL_ReadDataInActiveRow(2);
NWNX_Tests_Report("NWNX_SQL", "ReadString", s == "FourtyTwooo");
string sObjId = NWNX_SQL_ReadDataInActiveRow(3); // In base 10
object o2 = NWNX_Object_StringToObject(IntToHexString(StringToInt(sObjId)));
NWNX_Tests_Report("NWNX_SQL", "ReadObjectId", o == o2);
object o3 = NWNX_SQL_ReadFullObjectInActiveRow(4, GetArea(o), v.x, v.y, v.z);
NWNX_Tests_Report("NWNX_SQL", "ReadFullObject", GetIsObjectValid(o3));
// Alternatively:
// object o3 = NWNX_Object_Deserialize(NWNX_SQL_ReadDataInActiveRow(4));
}
}
object oPlc = CreateObject(OBJECT_TYPE_PLACEABLE, "nw_plc_chestburd", GetStartingLocation());
object oItem = CreateObject(OBJECT_TYPE_ITEM, "x0_it_mring013", GetStartingLocation());
if (!GetIsObjectValid(oPlc) || !GetIsObjectValid(oItem))
{
WriteTimestampedLogEntry("NWNX_SQL test: Failed to create objects..");
}
else
{
object oTmp = GetFirstItemInInventory(oPlc);
while (GetIsObjectValid(oTmp))
{
WriteTimestampedLogEntry("NWNX_SQL Destroying auto created object " + GetTag(oTmp));
DestroyObject(oTmp);
oTmp = GetNextItemInInventory(oPlc);
}
string test2 = "";
if (db_type == "MYSQL" || db_type == "SQLITE")
{
test2="INSERT INTO sql_test(colInt, colFloat, colStr, colObjId, colObj) VALUES(1337,0.0,'xxx',1337,?)";
}
if (db_type == "POSTGRESQL")
{
test2="INSERT INTO sql_test(colInt, colFloat, colStr, colObjId, colObj) VALUES(1337,0.0,'xxx',1337,$1)";
}
NWNX_SQL_PrepareQuery(test2);
NWNX_SQL_PreparedObjectFull(0, oItem);
b = NWNX_SQL_ExecutePreparedQuery();
NWNX_Tests_Report("NWNX_SQL", "Insert item full", b);
b = NWNX_SQL_ExecuteQuery("SELECT colObj FROM sql_test WHERE colInt=1337");
NWNX_Tests_Report("NWNX_SQL", "Select item", b);
if (NWNX_SQL_ReadyToReadNextRow())
{
NWNX_SQL_ReadNextRow();
object oItem2 = NWNX_SQL_ReadFullObjectInActiveRow(0, oPlc);
NWNX_Tests_Report("NWNX_SQL", "ReadFullObject Item", GetIsObjectValid(oItem2));
NWNX_Tests_Report("NWNX_SQL", "Deserialized to placeable's inventory", oItem2 == GetFirstItemInInventory(oPlc));
NWNX_Tests_Report("NWNX_SQL", "Deserialized to placeable's inventory - possessor", GetItemPossessor(oItem2) == oPlc);
object oItem3 = NWNX_SQL_ReadFullObjectInActiveRow(0, GetArea(oPlc), v.x, v.y, v.z);
NWNX_Tests_Report("NWNX_SQL", "Deserialized to area", GetArea(oItem3) == GetArea(oPlc));
object oItem4 = NWNX_SQL_ReadFullObjectInActiveRow(0, o);
NWNX_Tests_Report("NWNX_SQL", "Deserialized to creature's inventory - possessor", GetItemPossessor(oItem4) == o);
}
else
{
WriteTimestampedLogEntry("NWNX_SQL not ready to read item");
}
}
int STRESS_CNT = 10;
WriteTimestampedLogEntry("NWNX_SQL stress test.");
NWNX_SQL_ExecuteQuery("create table stress_test ( i_key int, i_int int, s_text varchar(8))");
int i;
// Brute force some inserts
for ( i=1 ; i<=STRESS_CNT ; i++ ) // Generate 1000 rows.
{
// Simulates the existing NWNX2 ODBC way of generating SQL.
NWNX_SQL_ExecuteQuery("insert into stress_test values ( " + IntToString(i) + ", " + IntToString(i*2) + ", '" + IntToString(i*100) + "')");
}
NWNX_SQL_ExecuteQuery("delete from stress_test where i_key > 0");
int res = NWNX_SQL_GetAffectedRows();
WriteTimestampedLogEntry("Deleted " + IntToString(res) + " rows.");
report ("Delete rows", res == STRESS_CNT);
// now do some elegant inserts
string test3 = "";
if (db_type == "MYSQL" || db_type == "SQLITE")
{
test3 = "insert into stress_test values ( ?, ?, ? )";
}
if (db_type == "POSTGRESQL")
{
test3 = "insert into stress_test values ( $1, $2, $3 )";
}
NWNX_SQL_PrepareQuery(test3);
for ( i = 1 ; i <= STRESS_CNT ; i++ )
{
NWNX_SQL_PreparedInt(0, i);
NWNX_SQL_PreparedInt(1, i*2);
NWNX_SQL_PreparedString(2, IntToString(i*100));
b = NWNX_SQL_ExecutePreparedQuery();
NWNX_Tests_Report("NWNX_SQL", "Elegant Looping ExecutePreparedQuery", b);
}
NWNX_SQL_ExecuteQuery("delete from stress_test where i_key > 0");
res = NWNX_SQL_GetAffectedRows();
WriteTimestampedLogEntry("Deleted " + IntToString(res) + " rows.");
NWNX_Tests_Report("Delete rows", res == STRESS_CNT);
// Test some error output.
b = NWNX_SQL_ExecuteQuery("create table error_test (col varchar(10))");
NWNX_Tests_Report("Test Table Create", b);
b = NWNX_SQL_ExecuteQuery("insert into error_test values('abcdefghij')");
NWNX_Tests_Report("good insert", b);
if (db_type != "SQLITE")
{// SQLite doesn't care about size constraints of columns
b = NWNX_SQL_ExecuteQuery("insert into error_test values('abcde000fghij')");
report ("bad insert", !b);
if (!b) {
WriteTimestampedLogEntry("There should be an error a couple rows up.");
}
}
string test4 = "";
if (db_type == "MYSQL" || db_type == "SQLITE")
{
test3 = "insert into error_test values ( ? )";
}
if (db_type == "POSTGRESQL")
{
test3 = "insert into error_test values ( $1 )";
}
NWNX_SQL_PrepareQuery(test3);
NWNX_SQL_PreparedString(100, "lala"); // out of bounds, must not crash.
NWNX_Tests_Report("NWNX_SQL", "Negative prepare query", NWNX_SQL_PrepareQuery("not a valid query!") == 0);
NWNX_Tests_Report("NWNX_SQL", "GetLastError", NWNX_SQL_GetLastError() != "");
// Test with null values
NWNX_SQL_ExecuteQuery("INSERT INTO sql_test(colInt, colFloat, colStr, colObjId, colObj) VALUES(5121, null, null, null, null)");
NWNX_Tests_Report("NWNX_SQL", "Select null", NWNX_SQL_ExecuteQuery("SELECT * FROM sql_test WHERE colInt=5121"));
if (NWNX_SQL_ReadyToReadNextRow())
{
NWNX_SQL_ReadNextRow();
int n = StringToInt(NWNX_SQL_ReadDataInActiveRow(0));
NWNX_Tests_Report("NWNX_SQL", "ReadInt", n == 5121);
float f = StringToFloat(NWNX_SQL_ReadDataInActiveRow(1));
NWNX_Tests_Report("NWNX_SQL", "ReadFloat", f == 0.0);
string s = NWNX_SQL_ReadDataInActiveRow(2);
NWNX_Tests_Report("NWNX_SQL", "ReadString", s == "");
string sObjId = NWNX_SQL_ReadDataInActiveRow(3); // In base 10
NWNX_Tests_Report("NWNX_SQL", "ReadObjectId", sObjId == "");
object obj = NWNX_SQL_ReadFullObjectInActiveRow(4);
NWNX_Tests_Report("NWNX_SQL", "ReadFullObject", obj == OBJECT_INVALID);
}
cleanup();
WriteTimestampedLogEntry("Testing database " + db_type + " complete.");
WriteTimestampedLogEntry("NWNX_SQL unit tests end.");
}

@ -0,0 +1,107 @@
//::///////////////////////////////////////////////
//:: Great Thunderclap
//:: X2_S0_GrtThdclp
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// You create a loud noise equivalent to a peal of
// thunder and its acommpanying shock wave. The
// spell has three effects. First, all creatures
// in the area must make Will saves to avoid being
// stunned for 1 round. Second, the creatures must
// make Fortitude saves or be deafened for 1 minute.
// Third, they must make Reflex saves or fall prone.
*/
//:://////////////////////////////////////////////
//:: Created By: Andrew Nobbs
//:: Created On: Nov 20, 2002
//:: Updated On: Oct 20, 2003 - some nice Vfx:)
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "x0_i0_spells"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-07-07 by Georg Zoeller
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Epic DC Bonus Added
int nDB;
int nAdjs;
nAdjs = GetCasterLevel(OBJECT_SELF) - 20;
if(GetCasterLevel(OBJECT_SELF)>=23)
{
nDB = nAdjs/3;
SendMessageToPC(OBJECT_SELF, "Your Epic DC Bonus = +" + IntToString(nDB) + " DC");
}
else if(GetCasterLevel(OBJECT_SELF) <=22)
{
nDB = 0;
}
int nDamage = 0;
int nDC = GetSpellSaveDC();
float fDelay;
effect eExplode = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eVis2 = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
effect eVis3 = EffectVisualEffect(VFX_IMP_STUN);
effect eDeaf = EffectDeaf();
effect eKnock = EffectKnockdown();
effect eStun = EffectStunned();
effect eShake = EffectVisualEffect(356);
effect eDmg = EffectDamage(d8(3), DAMAGE_TYPE_SONIC, DAMAGE_POWER_ENERGY);
location lTarget = GetSpellTargetLocation();
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eShake, OBJECT_SELF, 2.0f);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE);
while (GetIsObjectValid(oTarget))
{
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
//Get the distance between the explosion and the target to calculate delay
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SONIC))
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeaf, oTarget, RoundsToSeconds(10)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SONIC))
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStun, oTarget, RoundsToSeconds(1)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_SONIC))
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oTarget, 6.0f));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis3, oTarget,4.0f));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDmg, oTarget));
}
}
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE);
}

Some files were not shown because too many files have changed in this diff Show More