Update for NWN .35

Update for NWN .35
This commit is contained in:
Jaysyn904
2023-08-01 20:16:07 -04:00
parent d4680a7df3
commit 1ddbeca4f1
1526 changed files with 68311 additions and 2534 deletions

View File

@@ -12,6 +12,6 @@ if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
}

View File

@@ -4,5 +4,5 @@ object oPC = GetEnteringObject();
//AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("x2spells", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("feats", 1, oPC, FALSE, FALSE);
}

View File

@@ -13,8 +13,8 @@ if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
//Note these journal tagnames are CaSe SenSiTiVe!!
AddJournalQuestEntry("spellz", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("spellz", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("featz", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("featz", 1, oPC, FALSE, FALSE);
}

View File

@@ -13,6 +13,6 @@ if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);
}

View File

@@ -1,143 +0,0 @@
//#include "inc_array"
#include "nwnx_time"
// nwnx_data also includes inc_array, so don't double dip.
#include "nwnx_data"
void Log(string msg)
{
WriteTimestampedLogEntry(msg);
}
void TestArrayOnModule()
{
string array = "test";
// By default, temporary arrays are created on the module.
Array_PushBack_Str(array, "BItem1");
Array_PushBack_Str(array, "AItem2");
Array_PushBack_Str(array, "AItem3");
Array_PushBack_Str(array, "BItem2");
Array_Debug_Dump(array, "After first load");
int foo = Array_Find_Str(array, "AItem3");
Log("Found element AItem3 at index = " + IntToString(foo));
Array_Set_Str(array, 2, "Suck it up...");
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
Array_Erase(array, 1);
Array_Debug_Dump(array, "After delete 1");
Array_PushBack_Str(array, "MItem1");
Array_PushBack_Str(array, "QItem2");
Array_PushBack_Str(array, "NItem3");
Array_PushBack_Str(array, "KItem2");
Array_Debug_Dump(array, "After add more");
Array_SortAscending(array);
Array_Debug_Dump(array, "After sort");
Array_Shuffle(array);
Array_Debug_Dump(array, "After shuffle");
Log( (Array_Contains_Str(array, "NItem3")) ? "Passed.. found it" : "Failed.. should have found it" );
Log( (Array_Contains_Str(array, "KItem2")) ? "Passed.. found it" : "Failed.. should have found it" );
Log( (Array_Contains_Str(array, "xxxxxx")) ? "Failed.. not found" : "Passed.. should not exist" );
Array_Clear(array);
// Load up the array with 100 entries
int i;
struct NWNX_Time_HighResTimestamp b;
b = NWNX_Time_GetHighResTimeStamp();
Log("Start Time: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
for (i=0; i<1000; i++)
{
Array_PushBack_Str(array, IntToString(d100()) + " xxx " + IntToString(i));
}
b = NWNX_Time_GetHighResTimeStamp();
Log("Loaded 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
Array_Shuffle(array);
b = NWNX_Time_GetHighResTimeStamp();
Log("Shuffled 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
for (i=5; i<995; i++)
{
// Delete the third entry a bunch of times
Array_Erase(array, 3);
}
b = NWNX_Time_GetHighResTimeStamp();
Log("Delete ~990: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
Array_Debug_Dump(array, "After mass insert/delete");
}
void TestArrayOnChicken()
{
string array="chicken";
// Let's create an array "on" our favorite creature: the deadly nw_chicken
// Note - arrays aren't really attached to the item, but the module, and they
// are tagged with the objects string representation.
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
if (!GetIsObjectValid(oCreature))
{
Log("NWNX_Creature test: Failed to create creature");
return;
}
Array_PushBack_Str(array, "BItem1", oCreature);
Array_PushBack_Str(array, "AItem2", oCreature);
Array_PushBack_Str(array, "AItem3", oCreature);
Array_PushBack_Str(array, "BItem2", oCreature);
Array_Debug_Dump(array, "After Chicken array load", oCreature);
}
void TestNWNXArray()
{
Log("");
Log("Start NWNX_Data test.");
string array = "test2";
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem2");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem3");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem2");
Array_Debug_Dump(array, "After first load");
int foo = NWNX_Data_Array_Find_Str(GetModule(), array, "ZItem3");
Log("Found element AItem3 at index = " + IntToString(foo));
NWNX_Data_Array_Set_Str(GetModule(), array, 2, "Suck it up...");
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
NWNX_Data_Array_Erase(NWNX_DATA_TYPE_STRING, GetModule(), array, 1);
Array_Debug_Dump(array, "After delete 1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "MItem1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "QItem2");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "NItem3");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "KItem2");
Array_Debug_Dump(array, "After add more");
NWNX_Data_Array_SortAscending(NWNX_DATA_TYPE_STRING, GetModule(), array);
Array_Debug_Dump(array, "After sort");
}
// Uncomment and assign to some event click.
/* */
void main()
{
Log("Start");
TestArrayOnModule();
TestArrayOnChicken();
TestNWNXArray();
}
/* */

View File

@@ -83,7 +83,7 @@ void HandleCommands(object oPC)
//Call for DM help
if(GetStringLeft(GetStringLowerCase(GetPCChatMessage()), 5) == "!help")
{
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, GetName(GetPCChatSpeaker()) + ": Uh Hey guy I have a problem" , "Town Cryer");
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, ": Uh Hey guy I have a problem" , GetName(GetPCChatSpeaker()) );
}
//Do a party roll for the PC

View File

@@ -1,504 +0,0 @@
#include "nwnx_regex"
/// @addtogroup data Data
/// @brief Provides a number of data structures for NWN code to use (simulated arrays)
/// @{
/// @file nwnx_data.nss
const int INVALID_INDEX = -1;
const int TYPE_FLOAT = 0;
const int TYPE_INTEGER = 1;
const int TYPE_OBJECT = 2;
const int TYPE_STRING = 3;
/// @defgroup data_array_at Array At
/// @brief Returns the element at the index.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param index The index.
/// @return The element of associated type.
/// @{
string Array_At_Str(string tag, int index, object obj=OBJECT_INVALID);
float Array_At_Flt(string tag, int index, object obj=OBJECT_INVALID);
int Array_At_Int(string tag, int index, object obj=OBJECT_INVALID);
object Array_At_Obj(string tag, int index, object obj=OBJECT_INVALID);
/// @}
/// Clears the entire array, such that size==0.
void Array_Clear(string tag, object obj=OBJECT_INVALID);
/// @defgroup data_array_contains Array Contains
/// @brief Checks if array contains the element.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param element The element.
/// @return TRUE if the collection contains the element.
/// @{
int Array_Contains_Flt(string tag, float element, object obj=OBJECT_INVALID);
int Array_Contains_Int(string tag, int element, object obj=OBJECT_INVALID);
int Array_Contains_Obj(string tag, object element, object obj=OBJECT_INVALID);
int Array_Contains_Str(string tag, string element, object obj=OBJECT_INVALID);
/// @}
/// Copies the array of name otherTag over the array of name tag.
void Array_Copy(string tag, string otherTag, object obj=OBJECT_INVALID);
/// Erases the element at index, and shuffles any elements from index size-1 to index + 1 left.
void Array_Erase(string tag, int index, object obj=OBJECT_INVALID);
/// @defgroup data_array_find Array Find
/// @brief Get the index at which the element is located.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param element The element.
/// @return Returns the index at which the element is located, or ARRAY_INVALID_INDEX.
/// @{
int Array_Find_Flt(string tag, float element, object obj=OBJECT_INVALID);
int Array_Find_Int(string tag, int element, object obj=OBJECT_INVALID);
int Array_Find_Obj(string tag, object element, object obj=OBJECT_INVALID);
int Array_Find_Str(string tag, string element, object obj=OBJECT_INVALID);
/// @}
/// @defgroup data_array_insert Array Insert
/// @brief Inserts the element at the index, where size > index >= 0.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param index The index.
/// @param element The element.
/// @{
void Array_Insert_Flt(string tag, int index, float element, object obj=OBJECT_INVALID);
void Array_Insert_Int(string tag, int index, int element, object obj=OBJECT_INVALID);
void Array_Insert_Obj(string tag, int index, object element, object obj=OBJECT_INVALID);
void Array_Insert_Str(string tag, int index, string element, object obj=OBJECT_INVALID);
/// @}
/// @defgroup data_array_pushback Array Pushback
/// @brief Pushes an element to the back of the collection.
/// @remark Functionally identical to an insert at index size-1.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param element The element.
/// @{
void Array_PushBack_Flt(string tag, float element, object obj=OBJECT_INVALID);
void Array_PushBack_Int(string tag, int element, object obj=OBJECT_INVALID);
void Array_PushBack_Obj(string tag, object element, object obj=OBJECT_INVALID);
void Array_PushBack_Str(string tag, string element, object obj=OBJECT_INVALID);
/// @}
/// Resizes the array. If the array is shrinking, it chops off elements at the ned.
void Array_Resize(string tag, int size, object obj=OBJECT_INVALID);
/// Reorders the array such each possible permutation of elements has equal probability of appearance.
void Array_Shuffle(string tag, object obj=OBJECT_INVALID);
/// Returns the size of the array.
int Array_Size(string tag, object obj=OBJECT_INVALID);
/// Sorts the collection based on descending order.
void Array_SortAscending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID);
/// Sorts the collection based on descending order.
void Array_SortDescending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID);
/// @defgroup data_array_set Array Set
/// @brief Sets the element at the index, where size > index >= 0.
/// @ingroup data
/// @param obj The object.
/// @param tag The tag.
/// @param index The index.
/// @param element The element.
/// @{
void Array_Set_Flt(string tag, int index, float element, object obj=OBJECT_INVALID);
void Array_Set_Int(string tag, int index, int element, object obj=OBJECT_INVALID);
void Array_Set_Obj(string tag, int index, object element, object obj=OBJECT_INVALID);
void Array_Set_Str(string tag, int index, string element, object obj=OBJECT_INVALID);
/// @}
/// @}
//
// Local Utility Functions.
//
string GetTableName(string tag, object obj=OBJECT_INVALID, int bare=FALSE) {
if (obj == OBJECT_INVALID)
obj = GetModule();
string sName = "array_" + ObjectToString(obj) + "_" + tag;
// Remove invalid characters from the tag rather than failing.
string sCleansed = NWNX_Regex_Replace(sName, "[^A-Za-z0-9_\$@#]", "");
// But provide some feedback.
if (GetStringLength(sName) != GetStringLength(sCleansed) || GetStringLength(sCleansed) == 0) {
WriteTimestampedLogEntry("WARNING: Invalid table name detected for array with tag <" + tag + ">. Only characters (a-zA-Z0-9), _, @, $ and # are allowed. Using <"+sCleansed+"> instead.");
}
// BARE returns just the table name with no wrapping.
if (bare == TRUE) {
return sCleansed;
}
// Table name wraped in quotes to avoid token expansion.
return "\""+sCleansed+"\"";
}
string GetTableCreateString(string tag, object obj=OBJECT_INVALID) {
// for simplicity sake, everything is turned into a string. Possible enhancement
// to create specific tables for int/float/whatever.
return "CREATE TABLE IF NOT EXISTS " + GetTableName(tag, obj) + " ( ind INTEGER PRIMARY KEY, value TEXT )";
}
int TableExists(string tag, object obj=OBJECT_INVALID) {
string stmt = "SELECT name FROM sqlite_master WHERE type = 'table' AND name = @tablename;";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindString(sqlQuery, "@tablename", GetTableName(tag, obj, TRUE));
return SqlStep(sqlQuery);
}
void ExecuteStatement(string statement, object obj=OBJECT_INVALID) {
if (obj == OBJECT_INVALID)
obj = GetModule();
// There's no direct "execute this.." everything has to be prepared then executed.
//WriteTimestampedLogEntry("SQL: " + statement);
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), statement);
SqlStep(sqlQuery);
}
void CreateArrayTable(string tag, object obj=OBJECT_INVALID) {
string createStatement = GetTableCreateString(tag, obj);
ExecuteStatement(createStatement, obj);
}
// Get the table row count. Returns -1 on error (0 is a valid number of rows in a table)
int GetRowCount(string tag, object obj=OBJECT_INVALID) {
if (obj == OBJECT_INVALID)
obj = GetModule();
CreateArrayTable(tag, obj);
string stmt = "SELECT COUNT(1) FROM " + GetTableName(tag, obj);
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
if ( SqlStep(sqlQuery) ) {
return SqlGetInt(sqlQuery, 0);
}
return -1;
}
////////////////////////////////////////////////////////////////////////////////
// return the value contained in location "index"
string Array_At_Str(string tag, int index, object obj=OBJECT_INVALID)
{
// Just "create if not exists" to ensure it exists for the insert.
CreateArrayTable(tag, obj);
string stmt = "SELECT value FROM " + GetTableName(tag, obj) + " WHERE ind = @ind";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", index);
if ( SqlStep(sqlQuery) ) {
return SqlGetString(sqlQuery, 0);
}
return "";
}
float Array_At_Flt(string tag, int index, object obj=OBJECT_INVALID)
{
string st = Array_At_Str(tag, index, obj);
if (st == "") {
return 0.0;
}
return StringToFloat(st);
}
int Array_At_Int(string tag, int index, object obj=OBJECT_INVALID)
{
string st = Array_At_Str(tag, index, obj);
if (st == "") {
return 0;
}
return StringToInt(st);
}
object Array_At_Obj(string tag, int index, object obj=OBJECT_INVALID)
{
string st = Array_At_Str(tag, index, obj);
if (st == "") {
return OBJECT_INVALID;
}
return StringToObject(st);
}
void Array_Clear(string tag, object obj=OBJECT_INVALID)
{
ExecuteStatement("delete from "+GetTableName(tag, obj), obj);
}
////////////////////////////////////////////////////////////////////////////////
// Return true/value (1/0) if the array contains the value "element"
int Array_Contains_Str(string tag, string element, object obj=OBJECT_INVALID)
{
CreateArrayTable(tag, obj);
string stmt = "SELECT COUNT(1) FROM "+GetTableName(tag, obj)+" WHERE value = @element";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindString(sqlQuery, "@element", element);
int pos = -1;
if ( SqlStep(sqlQuery) ) {
pos = SqlGetInt(sqlQuery, 0);
if (pos > 0) {
return TRUE;
}
}
return FALSE;
}
int Array_Contains_Flt(string tag, float element, object obj=OBJECT_INVALID)
{
return Array_Contains_Str(tag, FloatToString(element), obj);
}
int Array_Contains_Int(string tag, int element, object obj=OBJECT_INVALID)
{
return Array_Contains_Str(tag, IntToString(element), obj);
}
int Array_Contains_Obj(string tag, object element, object obj=OBJECT_INVALID)
{
return Array_Contains_Str(tag, ObjectToString(element), obj);
}
////////////////////////////////////////////////////////////////////////////////
void Array_Copy(string tag, string otherTag, object obj=OBJECT_INVALID)
{
CreateArrayTable(otherTag, obj);
ExecuteStatement("INSERT INTO "+GetTableName(otherTag, obj)+" SELECT * FROM "+GetTableName(tag, obj), obj);
}
////////////////////////////////////////////////////////////////////////////////
void Array_Erase(string tag, int index, object obj=OBJECT_INVALID)
{
int rows = GetRowCount(tag, obj);
// Silently fail if "index" is outside the range of valid indicies.
if (index >= 0 && index < rows) {
string stmt = "DELETE FROM "+GetTableName(tag, obj)+" WHERE ind = @ind";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", index);
SqlStep(sqlQuery);
stmt = "UPDATE "+GetTableName(tag, obj)+" SET ind = ind - 1 WHERE ind > @ind";
sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", index);
SqlStep(sqlQuery);
}
}
////////////////////////////////////////////////////////////////////////////////
// return the index in the array containing "element"
// if not found, return INVALID_INDEX
int Array_Find_Str(string tag, string element, object obj=OBJECT_INVALID)
{
string stmt = "SELECT IFNULL(MIN(ind),@invalid_index) FROM "+GetTableName(tag, obj)+" WHERE value = @element";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@invalid_index", INVALID_INDEX);
SqlBindString(sqlQuery, "@element", element);
if ( SqlStep(sqlQuery) ) {
return SqlGetInt(sqlQuery, 0);
}
return INVALID_INDEX;
}
int Array_Find_Flt(string tag, float element, object obj=OBJECT_INVALID)
{
return Array_Find_Str(tag, FloatToString(element), obj);
}
int Array_Find_Int(string tag, int element, object obj=OBJECT_INVALID)
{
return Array_Find_Str(tag, IntToString(element), obj);
}
int Array_Find_Obj(string tag, object element, object obj=OBJECT_INVALID)
{
return Array_Find_Str(tag, ObjectToString(element), obj);
}
////////////////////////////////////////////////////////////////////////////////
// Insert a new element into position 'index'. If index is beyond the number of rows in the array,
// this will quietly fail. This could be changed if you wanted to support sparse
// arrays.
void Array_Insert_Str(string tag, int index, string element, object obj=OBJECT_INVALID)
{
int rows = GetRowCount(tag, obj);
// Index numbers are off by one, much like C arrays, so for "rows=10" - values are 0-9.
// It's not unreasonable to fail if you try to insert ind=10 into an array who's indexes
// only go to 9, but I guess it doesn't hurt as long as we're not allowing gaps in
// index numbers.
if (index >= 0 && index <= rows) {
// index is passed as an integer, so immune (as far as I know) to SQL injection for a one shot query.
ExecuteStatement("UPDATE "+GetTableName(tag, obj)+" SET ind = ind + 1 WHERE ind >= "+IntToString(index), obj);
// Element, however, is not.
string stmt = "INSERT INTO "+GetTableName(tag, obj)+" VALUES ( @ind, @element )";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", index);
SqlBindString(sqlQuery, "@element", element);
SqlStep(sqlQuery);
}
}
void Array_Insert_Flt(string tag, int index, float element, object obj=OBJECT_INVALID)
{
Array_Insert_Str(tag, index, FloatToString(element), obj);
}
void Array_Insert_Int(string tag, int index, int element, object obj=OBJECT_INVALID)
{
Array_Insert_Str(tag, index, IntToString(element), obj);
}
void Array_Insert_Obj(string tag, int index, object element, object obj=OBJECT_INVALID)
{
Array_Insert_Str(tag, index, ObjectToString(element), obj);
}
////////////////////////////////////////////////////////////////////////////////
// Insert a new element at the end of the array.
void Array_PushBack_Str(string tag, string element, object obj=OBJECT_INVALID)
{
// If rowCount = 10, indexes are from 0 to 9, so this becomes the 11th entry at index 10.
int rowCount = GetRowCount(tag, obj);
string stmt = "INSERT INTO "+GetTableName(tag, obj)+" VALUES ( @ind, @element )";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", rowCount);
SqlBindString(sqlQuery, "@element", element);
SqlStep(sqlQuery);
}
void Array_PushBack_Flt(string tag, float element, object obj=OBJECT_INVALID)
{
Array_PushBack_Str(tag, FloatToString(element), obj);
}
void Array_PushBack_Int(string tag, int element, object obj=OBJECT_INVALID)
{
Array_PushBack_Str(tag, IntToString(element), obj);
}
void Array_PushBack_Obj(string tag, object element, object obj=OBJECT_INVALID)
{
Array_PushBack_Str(tag, ObjectToString(element), obj);
}
////////////////////////////////////////////////////////////////////////////////
// Cuts the array off at size 'size'. Elements beyond size are removed.
void Array_Resize(string tag, int size, object obj=OBJECT_INVALID)
{
// Int immune to sql injection so easier to one-shot it.
ExecuteStatement("DELETE FROM "+GetTableName(tag, obj)+" WHERE ind >= " + IntToString(size), obj);
}
////////////////////////////////////////////////////////////////////////////////
void Array_Shuffle(string tag, object obj=OBJECT_INVALID)
{
string table = GetTableName(tag, obj, TRUE);
ExecuteStatement("CREATE TABLE " +table+ "_temp AS SELECT ROW_NUMBER() OVER(ORDER BY RANDOM())-1, value FROM " +table, obj);
ExecuteStatement("DELETE FROM " +table , obj);
ExecuteStatement("INSERT INTO " +table+ " SELECT * FROM " +table+ "_temp", obj);
ExecuteStatement("DROP TABLE " +table+ "_TEMP", obj);
}
////////////////////////////////////////////////////////////////////////////////
int Array_Size(string tag, object obj=OBJECT_INVALID)
{
return GetRowCount(tag, obj);
}
////////////////////////////////////////////////////////////////////////////////
// Sort the array by value according to 'direction' (ASC or DESC).
// Supplying a type allows for correct numerical sorting of integers or floats.
void Array_Sort(string tag, string dir="ASC", int type=TYPE_STRING, object obj=OBJECT_INVALID)
{
string table = GetTableName(tag, obj, TRUE);
string direction = GetStringUpperCase(dir);
if ( ! (direction == "ASC" || direction == "DESC") ) {
WriteTimestampedLogEntry("WARNING: Invalid sort direction <" + direction + "> supplied. Defaulting to ASC.");
direction = "ASC";
}
// default orderBy for strings.
string orderBy = "ORDER BY value " + direction;
switch(type) {
case TYPE_INTEGER:
orderBy = "ORDER BY CAST(value AS INTEGER)" + direction;
break;
case TYPE_FLOAT:
orderBy = "ORDER BY CAST(value AS DECIMAL)" + direction;
break;
}
ExecuteStatement("CREATE TABLE " +table+ "_temp AS SELECT ROW_NUMBER() OVER(" + orderBy + ")-1, value FROM " +table, obj);
ExecuteStatement("DELETE FROM " +table, obj);
ExecuteStatement("INSERT INTO " +table+ " SELECT * FROM " +table+ "_temp", obj);
ExecuteStatement("DROP TABLE " +table+ "_temp", obj);
}
void Array_SortAscending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID)
{
Array_Sort(tag, "ASC", type, obj);
}
void Array_SortDescending(string tag, int type=TYPE_STRING, object obj=OBJECT_INVALID)
{
Array_Sort(tag, "DESC", type, obj);
}
////////////////////////////////////////////////////////////////////////////////
// Set the value of array index 'index' to a 'element'
// This will quietly eat values if index > array size
void Array_Set_Str(string tag, int index, string element, object obj=OBJECT_INVALID)
{
int rows = GetRowCount(tag, obj);
if (index >= 0 && index <= rows) {
string stmt = "UPDATE "+GetTableName(tag, obj)+" SET value = @element WHERE ind = @ind";
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
SqlBindInt(sqlQuery, "@ind", index);
SqlBindString(sqlQuery, "@element", element);
SqlStep(sqlQuery);
}
}
void Array_Set_Flt(string tag, int index, float element, object obj=OBJECT_INVALID)
{
Array_Set_Str(tag, index, FloatToString(element), obj);
}
void Array_Set_Int(string tag, int index, int element, object obj=OBJECT_INVALID)
{
Array_Set_Str(tag, index, IntToString(element), obj);
}
void Array_Set_Obj(string tag, int index, object element, object obj=OBJECT_INVALID)
{
Array_Set_Str(tag, index, ObjectToString(element), obj);
}
void Array_Debug_Dump(string tag, string title = "xxx", object obj=OBJECT_INVALID) {
if (title != "xxx") {
WriteTimestampedLogEntry("== " + title + " ======================================");
}
WriteTimestampedLogEntry("Table name = " + GetTableName(tag, obj));
string stmt = "SELECT ind, value FROM " + GetTableName(tag, obj);
sqlquery sqlQuery = SqlPrepareQueryObject(GetModule(), stmt);
int ind = -1;
string value = "";
while ( SqlStep(sqlQuery) ) {
ind = SqlGetInt(sqlQuery, 0);
value = SqlGetString(sqlQuery, 1);
WriteTimestampedLogEntry(tag + "[" + IntToString(ind) + "] = " + value);
}
}

View File

@@ -29,14 +29,16 @@
//:: Created On: June 11/03
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "nwnx_webhook"
#include "nwnx_util"
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
const string NWNX_DISCORD_URL = "/api/webhooks/709533785091342397/8Rsb8-or0Ticc5xDNxLP2tldtx_vPR4Zqu41rs_KzNq5stylkMECcEAIdEDDVXteaQmO/slack";
#include "x2_inc_switches"
#include "nwnx_webhook"
#include "nwnx_util"
void main()
@@ -93,7 +95,7 @@ void main()
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
}
//
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_Util_GetEnvironmentVariable("NWNX_WEBHOOK_DEVELOPER_CHANNEL"), "In a child's eyes, a mother is a goddess. She can be glorious or terrible, benevolent or filled with wrath, but she commands love either way. I am convinced that this is the greatest power in the universe.", "The Madman");
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, GetName(GetPCChatSpeaker()) + "In a child's eyes, a mother is a goddess. She can be glorious or terrible, benevolent or filled with wrath, but she commands love either way. I am convinced that this is the greatest power in the universe.", "The Madman");
//
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura of Blinding On Enter
//:: NW_S1_AuraBlndA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be blinded because of the
sheer ugliness or beauty of the creature.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD/3);
effect eBlind = EffectBlindness();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
effect eLink = EffectLinkEffects(eBlind, eDur);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
//Entering object must make a will save or be blinded for the duration.
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_BLINDING));
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
//Apply the blind effect and the VFX impact
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}

View File

@@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Aura of Frost on Heartbeat
//:: NW_S1_AuraColdC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes frost damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nFrost = 1 + (nHD/3);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
//Get the first target in the aura of cold
oTarget = GetFirstInPersistentObject();
while (GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_COLD));
//Roll damage based on the creatures HD
nDamage = d4(nFrost);
//Make a Fortitude save for half
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_COLD))
{
nDamage = nDamage / 2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
//Apply the VFX constant and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
//Get the next target in the aura of cold
oTarget = GetNextInPersistentObject();
}
}

View File

@@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Aura of Electricity on Heartbeat
//:: NW_S1_AuraElecC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes electrical damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
int nHD = GetHitDice(oNPC);
int nZap = 1 + (nHD / 3);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 + nCHAMod + (nHD/2);
int nDamage;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
//Get first target in spell area
object oTarget = GetFirstInPersistentObject();
while (GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
nDamage = d4(nZap);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_AURA_ELECTRICITY));
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY))
{
nDamage = nDamage / 2;
}
eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and effects
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
}

View File

@@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Aura of Fire on Heartbeat
//:: NW_S1_AuraFireC.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Prolonged exposure to the aura of the creature
causes fire damage to all within the aura.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetFirstInPersistentObject(); //:: Get first target in spell area
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nBurn = 1 + (nHD/3);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nDamSave;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
while(GetIsObjectValid(oTarget))
{
/* if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget))
{
oTarget = GetNextInPersistentObject(OBJECT_SELF);
continue;
} */
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_FIRE));
//Roll damage
nDamage = d4(nBurn);
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_FIRE))
{
nDamage = nDamage / 2;
}
//Set the damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
//Get next target in spell area
oTarget = GetNextInPersistentObject();
}
}

View File

@@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Aura of Menace On Enter
//:: NW_S1_AuraMencA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura all those that fail
a will save are stricken with Doom.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
int nDuration = 1 + (GetHitDice(oNPC)/3);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (GetHitDice(oNPC)/2);
int nLevel = GetCasterLevel(OBJECT_SELF);
int nMetaMagic = PRCGetMetaMagicFeat();
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
effect eLink = CreateDoomEffectsLink();
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_AURA_MENACE));
//Spell Resistance and Saving throw
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink , oTarget, TurnsToSeconds(nDuration));
}
}
}

View File

@@ -0,0 +1,35 @@
//::///////////////////////////////////////////////
//:: Aura of Protection: On Enter
//:: NW_S1_AuraProtA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Acts as a double strength Magic Circle against
evil and a Minor Globe for those friends in
the area.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On:Jan 8, 2002, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
void main()
{
//Declare major variables
effect eProt = CreateProtectionFromAlignmentLink(ALIGNMENT_EVIL);
effect eGlobe = EffectSpellLevelAbsorption(3, 0);
effect eDur = EffectVisualEffect(VFX_DUR_GLOBE_MINOR);
effect eLink = EffectLinkEffects(eProt, eGlobe);
eLink = EffectLinkEffects(eLink, eDur);
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
//Faction Check
if(GetIsFriend(oTarget, GetAreaOfEffectCreator()))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura Stunning On Enter
//:: NW_S1_AuraStunA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be stunned.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDuration = GetHitDice(oNPC);
int nDC = 10 + nCHAMod + (nDuration/2);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDeath = EffectStunned();
effect eLink = EffectLinkEffects(eVis2, eDeath);
nDuration = GetScaledDuration(nDuration, oTarget);
if(!GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_STUN));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Aura of the Unnatural On Enter
//:: NW_S1_AuraMencA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura all animals are struck with
fear.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eFear = EffectFrightened();
effect eLink = EffectLinkEffects(eVis, eFear);
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
int nDuration = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nRacial = GetRacialType(oTarget);
int nDC = 10 + nCHAMod + (GetHitDice(oNPC)/2);
if(GetIsEnemy(oTarget))
{
nDuration = (nDuration / 3) + 1;
//Make a saving throw check
if(nRacial == RACIAL_TYPE_ANIMAL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_UNNATURAL));
//if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR)) //:: This ability only affects animals & they don't get a save.
//{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
//}
}
}
}

View File

@@ -0,0 +1,46 @@
//::///////////////////////////////////////////////
//:: Aura Unearthly Visage On Enter
//:: NW_S1_AuraUnEaA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be killed because of the
sheer ugliness or beauty of the creature.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eDeath = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
if(GetIsEnemy(oTarget, oNPC))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_AURA_UNEARTHLY_VISAGE));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Bolt: Acid
//:: NW_S1_BltAcid
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt;
//ankheg
if(GetAppearanceType(oNPC) == APPEARANCE_TYPE_BEETLE_SLICER)
{
nDamage = d4(4);
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ACID));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ACID);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Charm
//:: NW_S1_BltCharm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eBolt = EffectCharmed();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_CHARM));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Charisma Drain
//:: NW_S1_BltChrDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fortitude save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD / 3;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_CHARISMA, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,60 @@
//::///////////////////////////////////////////////
//:: Bolt: Cold
//:: NW_S1_BltCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_COLD));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_COLD);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Constitution Drain
//:: NW_S1_BltConDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD /3);
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_CONSTITUTION, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Confuse
//:: NW_S1_BltConf
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis2 = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eBolt = EffectConfused();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_CONFUSE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
}
}

View File

@@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Daze
//:: NW_S1_BltDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
#include "NW_I0_SPELLS"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eBolt = EffectDazed();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DAZE));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Death
//:: NW_S1_BltDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eBolt = EffectDeath();
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DEATH));
//Make a saving throw check
if(TouchAttackRanged(oTarget))
{
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Dexterity Drain
//:: NW_S1_BltDexDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_DEXTERITY, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Bolt: Disease
//:: NW_S1_BltDisease
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to infect
the target with a disease. The disease used
is chosen based upon the racial type of the
caster.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(oNPC);
int nDisease;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DISEASE));
//Here we use the racial type of the attacker to select an
//appropriate disease.
switch (nRacial)
{
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
nDisease = DISEASE_FILTH_FEVER;
break;
case RACIAL_TYPE_OUTSIDER:
if(GetTag(oNPC) == "NW_SLAADRED")
{
nDisease = DISEASE_RED_SLAAD_EGGS;
}
else
{
nDisease = DISEASE_DEMON_FEVER;
}
break;
case RACIAL_TYPE_MAGICAL_BEAST:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
case RACIAL_TYPE_ABERRATION:
nDisease = DISEASE_BLINDING_SICKNESS;
break;
default:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
}
//Assign effect and chosen disease
effect eBolt = EffectDisease(nDisease);
//Make the ranged touch attack.
if (TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget);
}
}

View File

@@ -0,0 +1,53 @@
//::///////////////////////////////////////////////
//:: Bolt: Dominated
//:: NW_S1_BltDomn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
effect eBolt = EffectDominated();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis2);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_DOMINATE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Bolt: Fire
//:: NW_S1_BoltFire
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_FIRE));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Intelligence Drain
//:: NW_S1_BltIntDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Knockdown
//:: NW_S1_BltKnckD
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eBolt = EffectKnockdown();
effect eDam = EffectDamage(d6(), DAMAGE_TYPE_BLUDGEONING);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_KNOCKDOWN));
//Make a saving throw check
if (!/*Reflex Save*/ PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}

View File

@@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Bolt: Lightning
//:: NW_S1_BltLightn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Does 1d6 per level to a single target. Reflex
save for half
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 10, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_HAND);
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_LIGHTNING));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, oTarget, 1.7);
}
}
}

View File

@@ -0,0 +1,49 @@
//::///////////////////////////////////////////////
//:: Bolt: Level Drain
//:: NW_S1_BltLvlDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = nHD/5;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt = EffectNegativeLevel(1);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_LEVEL_DRAIN));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
//eBolt = LEVEL DRAIN EFFECT
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Paralyze
//:: NW_S1_BltParal
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eBolt = EffectParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
eLink = EffectLinkEffects(eLink, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_PARALYZE));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@@ -0,0 +1,123 @@
//::///////////////////////////////////////////////
//:: Bolt: Poison
//:: NW_S1_BltPoison.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Must make a ranged touch attack. If successful
the target is struck down with poison that
scales with level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(OBJECT_SELF);
int nPoison;
effect ePoison;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_POISON));
//Determine the poison type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
if (nHD <= 9)
{
nPoison = POISON_QUASIT_VENOM;
}
else if (nHD > 9 && nHD < 13)
{
nPoison = POISON_BEBILITH_VENOM;
}
else if (nHD >= 13)
{
nPoison = POISON_PIT_FIEND_ICHOR;
}
break;
case RACIAL_TYPE_VERMIN:
if (nHD < 3)
{
nPoison = POISON_TINY_SPIDER_VENOM;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_SMALL_SPIDER_VENOM;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_MEDIUM_SPIDER_VENOM;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_HUGE_SPIDER_VENOM;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_GARGANTUAN_SPIDER_VENOM;
}
else if (nHD >= 18)
{
nPoison = POISON_COLOSSAL_SPIDER_VENOM;
}
break;
default:
if (nHD < 3)
{
nPoison = POISON_NIGHTSHADE;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_BLADE_BANE;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_BLOODROOT;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_LICH_DUST;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_DARK_REAVER_POWDER;
}
else if (nHD >= 18 )
{
nPoison = POISON_BLACK_LOTUS_EXTRACT;
}
break;
}
//Make a ranged touch attack
if (TouchAttackRanged (oTarget))
{
ePoison = EffectPoison(nPoison);
//Apply effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget);
}
}

View File

@@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Bolt: Shards
//:: NW_S1_BltShard
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_SHARDS));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Set damage effect
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_PLUS_ONE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
}
}
}

View File

@@ -0,0 +1,47 @@
//::///////////////////////////////////////////////
//:: Bolt: Slow
//:: NW_S1_BltSlow
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex save is
needed to or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: June 18 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
effect eBolt = EffectSlow();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_SLOW));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Strength Drain
//:: NW_S1_BltStrDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_STRENGTH, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,50 @@
//::///////////////////////////////////////////////
//:: Bolt: Stun
//:: NW_S1_BltStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Reflex or Will save is
needed to halve damage or avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD + 1) / 2;
if (nCount == 0) { nCount = 1; }
nCount = GetScaledDuration(nCount, oTarget);
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eBolt = EffectStunned();
eBolt = GetScaledEffect(eBolt, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBolt, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_STUN));
//Make a saving throw check
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,44 @@
//::///////////////////////////////////////////////
//:: Bolt: Web
//:: NW_S1_BltWeb
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Glues a single target to the ground with
sticky strands of webbing.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 28, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nCount = 1 + (nHD /2);
if (nCount == 0) { nCount = 1; }
effect eVis = EffectVisualEffect(VFX_DUR_WEB);
effect eStick = EffectEntangle();
effect eLink = EffectLinkEffects(eVis, eStick);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_WEB));
//Make a saving throw check
if (!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC) && TouchAttackRanged(oTarget))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount));
}
}

View File

@@ -0,0 +1,48 @@
//::///////////////////////////////////////////////
//:: Bolt: Wisdom Drain
//:: NW_S1_BltWisDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature must make a ranged touch attack to hit
the intended target. Fort save is
needed to avoid effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nCount = (nHD /3);
if (nCount == 0) { nCount = 1; }
int nDamage = d6(nCount);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eBolt;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM));
//Make a saving throw check
if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget))
{
eBolt = EffectAbilityDecrease(ABILITY_WISDOM, nCount);
eBolt = SupernaturalEffect(eBolt);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Cone: Acid
//:: NW_S1_ConeAcid
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = GetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_ACID));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ACID);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Cone: Cold
//:: NW_S1_ConeCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = GetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_COLD));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,99 @@
//::///////////////////////////////////////////////
//:: Cone: Disease
//:: NW_S1_ConeDisea
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creature spits out a cone of disease that cannot
be avoided unless a Reflex save is made.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nRacial = MyPRCGetRacialType(oNPC);
int nDisease;
location lTargetLocation = GetSpellTargetLocation();
float fDelay;
effect eCone = EffectDisease(nDisease);
effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S);
//Determine the disease type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
nDisease = DISEASE_DEMON_FEVER;
break;
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
if(nHD <= 3)
{
nDisease = DISEASE_ZOMBIE_CREEP;
}
else if (nHD > 3 && nHD <= 10)
{
nDisease = DISEASE_GHOUL_ROT;
}
else if(nHD > 10)
{
nDisease = DISEASE_MUMMY_ROT;
}
default:
if(nHD <= 3)
{
nDisease = DISEASE_MINDFIRE;
}
else if (nHD > 3 && nHD <= 10)
{
nDisease = DISEASE_RED_ACHE;
}
else if(nHD > 10)
{
nDisease = DISEASE_SHAKES;
}
break;
}
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_DISEASE));
//Get the delay time
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,78 @@
//::///////////////////////////////////////////////
//:: Cone: Lightning
//:: NW_S1_ConeElec
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminates from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = GetSpellTargetLocation();
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNPC, BODY_NODE_HAND);
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_CONE_LIGHTNING));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,75 @@
//::///////////////////////////////////////////////
//:: Cone: Sonic
//:: NW_S1_ConeSonic
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of damage eminated from the monster. Does
a set amount of damage based upon the creatures HD
and can be halved with a Reflex Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
int nLoop = nHD / 3;
float fDelay;
if(nLoop == 0)
{
nLoop = 1;
}
//Calculate the damage
for (nLoop; nLoop > 0; nLoop--)
{
nDamage = nDamage + d6(2);
}
location lTargetLocation = GetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_SONIC));
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,DAMAGE_TYPE_SONIC);
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,119 @@
//::///////////////////////////////////////////////
//:: Dragon Breath Fear
//:: NW_S1_DragFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Calculates the proper DC Save for the
breath weapon based on the HD of the dragon.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//Declare major variables
int nAge = GetHitDice(OBJECT_SELF);
int nCount;
int nDC;
float fDelay;
object oTarget;
effect eBreath = EffectFrightened();
effect eFear = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eBreath, eDur);
eLink = EffectLinkEffects(eLink, eFear);
//Determine the duration and save DC
if (nAge <= 6) //Wyrmling
{
nDC = 13;
nCount = 1;
}
else if (nAge >= 7 && nAge <= 9) //Very Young
{
nDC = 15;
nCount = 2;
}
else if (nAge >= 10 && nAge <= 12) //Young
{
nDC = 17;
nCount = 3;
}
else if (nAge >= 13 && nAge <= 15) //Juvenile
{
nDC = 19;
nCount = 4;
}
else if (nAge >= 16 && nAge <= 18) //Young Adult
{
nDC = 21;
nCount = 5;
}
else if (nAge >= 19 && nAge <= 21) //Adult
{
nDC = 24;
nCount = 6;
}
else if (nAge >= 22 && nAge <= 24) //Mature Adult
{
nDC = 27;
nCount = 7;
}
else if (nAge >= 25 && nAge <= 27) //Old
{
nDC = 28;
nCount = 8;
}
else if (nAge >= 28 && nAge <= 30) //Very Old
{
nDC = 30;
nCount = 9;
}
else if (nAge >= 31 && nAge <= 33) //Ancient
{
nDC = 32;
nCount = 10;
}
else if (nAge >= 34 && nAge <= 37) //Wyrm
{
nDC = 34;
nCount = 11;
}
else if (nAge > 37) //Great Wyrm
{
nDC = 37;
nCount = 12;
}
PlayDragonBattleCry();
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 14.0, GetSpellTargetLocation(), TRUE);
//Get first target in spell area
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF && !GetIsReactionTypeFriendly(oTarget))
{
nCount = GetScaledDuration(nCount, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_DRAGON_BREATH_FEAR));
//Determine the effect delay time
fDelay = GetDistanceBetween(oTarget, OBJECT_SELF)/20;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR, OBJECT_SELF, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 14.0, GetSpellTargetLocation(), TRUE);
}
}

View File

@@ -0,0 +1,45 @@
//::///////////////////////////////////////////////
//:: Aura of Fear On Enter
//:: NW_S1_DragFearA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Upon entering the aura of the creature the player
must make a will save or be struck with fear because
of the creatures presence.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eFear = EffectFrightened();
effect eLink = EffectLinkEffects(eFear, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
int nHD = GetHitDice(GetAreaOfEffectCreator());
int nDC = 10 + GetHitDice(GetAreaOfEffectCreator())/3;
int nDuration = GetScaledDuration(nHD, oTarget);
if(GetIsEnemy(oTarget, GetAreaOfEffectCreator()))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_FEAR));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}

View File

@@ -0,0 +1,41 @@
//::///////////////////////////////////////////////
//:: Ferocity 3
//:: NW_S1_Feroc3
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The Dex and Str of the target increases
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 13, 2001
//:://////////////////////////////////////////////
void main()
{
//:: Declare major variables
object oNPC = OBJECT_SELF;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION); //:: Determine the duration by getting the con modifier
int nIncrease = 9;
int nDuration = 1 + nCONMod;
if(nDuration == 0) { nDuration = 1; }
effect eDex = EffectAbilityIncrease(ABILITY_DEXTERITY, nIncrease);
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, nIncrease);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eStr, eDex);
eLink = EffectLinkEffects(eLink, eDur);
eLink = ExtraordinaryEffect(eLink); //:: Make effect extraordinary
//effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE);
SignalEvent(oNPC, EventSpellCastAt(oNPC, SPELLABILITY_FEROCITY_3, FALSE));
if (nCONMod > 0)
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oNPC, RoundsToSeconds(nDuration));
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF) ;
}
}

View File

@@ -0,0 +1,69 @@
//::///////////////////////////////////////////////
//:: Gaze: Destroy Law
//:: NW_S1_GazeChaos
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save and are of Lawful alignment.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentLawChaos(oTarget) == ALIGNMENT_LAWFUL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DESTROY_LAW));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: Gaze: Charm
//:: NW_S1_GazeCharm
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectCharmed();
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
nDuration = GetScaledDuration(nDuration, oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_CHARM));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,77 @@
//::///////////////////////////////////////////////
//:: Gaze: Confusion
//:: NW_S1_GazeConfu
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectConfused();
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_CONFUSION));
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze: Daze
//:: NW_S1_GazeDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDazed();
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eGaze, eVisDur);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DAZE));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Gaze: Death
//:: NW_S1_GazeDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) || oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,78 @@
//::///////////////////////////////////////////////
//:: Gaze: Dominate
//:: NW_S1_GazeDomn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDominated();
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DOMINATE));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(GetIsEnemy(oTarget))
{
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze of Doom
//:: NW_S1_GazeDoom.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If the target fails a save they recieve a -2
penalty to all saves, attack rolls, damage and
skill checks for the duration of the spell.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 22, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
effect eSaves = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2);
effect eAttack = EffectAttackDecrease(2);
effect eDamage = EffectDamageDecrease(2);
effect eSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eAttack, eDamage);
eLink = EffectLinkEffects(eLink, eSaves);
eLink = EffectLinkEffects(eLink, eSkill);
eLink = EffectLinkEffects(eLink, eDur);
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation());
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(oTarget != oNPC)
{
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DOOM));
//Spell Resistance and Saving throw
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink , oTarget, RoundsToSeconds(nDuration));
}
}
}
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation());
}
}

View File

@@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Good
//:: NW_S1_GazeEvil
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,74 @@
//::///////////////////////////////////////////////
//:: Gaze: Fear
//:: NW_S1_GazeFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
nDuration = GetScaledDuration(nDuration , oTarget);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectFrightened();
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eLink = EffectLinkEffects(eGaze, eVisDur);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
nDuration = GetScaledDuration(nDuration , oTarget);
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_FEAR));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Evil
//:: NW_S1_GazeGood
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DEATH));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Gaze: Deatroy Chaos
//:: NW_S1_GazeLaw
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 13, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
if(nDuration == 0) { nDuration = 1; }
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
if(GetAlignmentLawChaos(oTarget) == ALIGNMENT_CHAOTIC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_DESTROY_LAW));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Gaze: Stun
//:: NW_S1_GazeStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Cone shape that affects all within the AoE if they
fail a Will Save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 9, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "x0_i0_match"
void main()
{
//--------------------------------------------------------------------------
// Make sure we are not blind
//--------------------------------------------------------------------------
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, OBJECT_SELF))
{
FloatingTextStrRefOnCreature(84530, OBJECT_SELF, FALSE);
return;
}
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDuration = 1 + (nHD / 3);
location lTargetLocation = GetSpellTargetLocation();
effect eGaze = EffectStunned();
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eVisDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eLink = EffectLinkEffects(eDur, eVisDur);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_GAZE_STUNNED));
//Determine effect delay
float fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*WillSave*/PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
eGaze = GetScaledEffect(eGaze, oTarget);
eLink = EffectLinkEffects(eLink, eGaze);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,41 @@
//::///////////////////////////////////////////////
//:: Golem Breath
//:: NW_S1_GolemGas
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Iron Golem spits out a cone of poison.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//Declare major variables
location lTargetLocation = GetSpellTargetLocation();
object oTarget;
effect eCone = EffectPoison(POISON_IRON_GOLEM);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_GOLEM_BREATH_GAS));
//Determine effect delay
float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
//Apply poison effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Hell Hound Fire Breath
//:: NW_S1_HndBreath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A cone of fire eminates from the hound.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d6(2);
float fDelay;
location lTargetLocation = GetSpellTargetLocation();
effect eCone;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HELL_HOUND_FIREBREATH));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Set damage effect
eCone = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE);
}
}

View File

@@ -0,0 +1,67 @@
//::///////////////////////////////////////////////
//:: Howl: Confuse
//:: NW_S1_HowlConf
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 20ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eHowl = EffectConfused();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_CONFUSE));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Daze
//:: NW_S1_HowlDaze
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
effect eHowl = EffectDazed();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_DAZE));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,59 @@
//::///////////////////////////////////////////////
//:: Howl: Death
//:: NW_S1_HowlDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD);
effect eHowl = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_DEATH));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Howl: Fear
//:: NW_S1_HowlFear
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eHowl = EffectFrightened();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_FEAR));
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Paralysis
//:: NW_S1_HowlParal
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
if(nDuration == 0) { nDuration = 1; }
float fDelay;
effect eHowl = EffectParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_PARALYSIS));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_NONE, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,65 @@
//::///////////////////////////////////////////////
//:: Howl: Sonic
//:: NW_S1_HowlSonic
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDamage;
int nSonic = nHD/4;
if(nSonic == 0) { nSonic = 1; }
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY);
float fDelay;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_SONIC));
nDamage = d6(nSonic);
//Make a saving throw check
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SONIC, oNPC, fDelay))
{
nDamage = nDamage / 2;
}
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_SONIC);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,66 @@
//::///////////////////////////////////////////////
//:: Howl: Stun
//:: NW_S1_HowlStun
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A howl emanates from the creature which affects
all within 10ft unless they make a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/4);
int nDuration = 1 + (nHD/4);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_STUN);
effect eHowl = EffectStunned();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != oNPC)
{
fDelay = GetDistanceToObject(oTarget)/10;
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_HOWL_STUN));
//Make a saving throw check
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,61 @@
//::///////////////////////////////////////////////
//:: Krenshar Fear Stare
//:: NW_S1_KrenScare
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Causes those in the gaze to be struck with fear
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nMetaMagic = PRCGetMetaMagicFeat();
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
effect eFear = EffectFrightened();
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link the fear and mind effects
effect eLink = EffectLinkEffects(eFear, eMind);
eLink = EffectLinkEffects(eLink, eDur);
//Get first target in the spell cone
oTarget = GetFirstObjectInShape(SHAPE_CONE, 10.0, GetSpellTargetLocation(), TRUE);
while(GetIsObjectValid(oTarget))
{
//Make faction check
if(GetIsEnemy(oTarget))
{
fDelay = GetDistanceToObject(oTarget)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_KRENSHAR_SCARE));
//Make a will save
if(!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR))
{
//Apply the linked effects and the VFX impact
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in the spell cone
oTarget = GetNextObjectInShape(SHAPE_CONE, 10.0, GetSpellTargetLocation(), TRUE);
}
}

View File

@@ -0,0 +1,63 @@
//::///////////////////////////////////////////////
//:: Salt Mephit Breath
//:: NW_S1_MephSalt
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Salt Mephit shoots out a bolt of corrosive material
that causes 1d4 damage and reduces AC and Attack by 2
This should be a cone - Jaysyn
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d4();
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt, eAttack, eAC;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ACID);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nDamage == 0) {nTouch = 0;}
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MEPHIT_SALT_BREATH));
//Set damage, AC mod and attack mod effects
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
eAC = EffectACDecrease(2);
eAttack = EffectAttackDecrease(2);
effect eLink = EffectLinkEffects(eAttack, eAC);
eLink = EffectLinkEffects(eLink, eDur);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,67 @@
//::///////////////////////////////////////////////
//:: Steam Mephit Breath
//:: NW_S1_MephSteam
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Steam Mephit shoots out a bolt of steam
that causes 1d4 damage and reduces AC by 4
and Attack by 2
This should be a cone - Jaysyn
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nDamage = d4();
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
effect eBolt, eAttack, eAC;
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Make a ranged touch attack
int nTouch = TouchAttackRanged(oTarget);
if(nDamage == 0) {nTouch = 0;}
if(nTouch > 0)
{
if(nTouch == 2)
{
nDamage *= 2;
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MEPHIT_STEAM_BREATH));
//Set damage, AC mod and attack mod effects
eBolt = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
eAC = EffectACDecrease(4);
eAttack = EffectAttackDecrease(2);
effect eLink = EffectLinkEffects(eAC, eAttack);
eLink = EffectLinkEffects(eLink, eDur);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}

View File

@@ -0,0 +1,53 @@
//::///////////////////////////////////////////////
//:: Bolster Undead
//:: NW_S1_MumUndead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This spell increases the Turn Resistance of
all undead around the caster by an amount
scaled with HD.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2002
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nScaling = nHD / 4;
if(nScaling == 0) {nScaling = 1;}
float fDelay;
effect eTurn = EffectTurnResistanceIncrease(nScaling);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_EVIL);
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_EVIL_30);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(oNPC));
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(GetIsFriend(oTarget))
{
fDelay = GetRandomDelay();
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_MUMMY_BOLSTER_UNDEAD, FALSE));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTurn, oTarget, RoundsToSeconds(10)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,73 @@
//::///////////////////////////////////////////////
//:: Pulse: Charisma Drain
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_CHARISMA, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Cold
//:: NW_S1_PulsCold
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = d6(nHD);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_COLD));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Pulse: Constitution Drain
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_CONSTITUTION));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Death
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
effect eHowl = EffectDeath();
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
if(oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_DEATH));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oNPC, fDelay))
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
//DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,70 @@
//::///////////////////////////////////////////////
//:: Pulse: Dexterity Drain
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_DEXTERITY));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_DEXTERITY, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,85 @@
//::///////////////////////////////////////////////
//:: Pulse: Disease
//:: NW_S1_PulsDis
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of disease spreads out from the creature
and infects all those within 10ft
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Aug 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nRacial = MyPRCGetRacialType(oNPC);
int nHD = GetHitDice(oNPC);
int nDamage = d6(nHD);
int nDisease;
float fDelay;
effect eDisease;
effect ePulse = EffectVisualEffect(266);
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePulse, GetLocation(oNPC));
//Determine the disease type based on the Racial Type
switch (nRacial)
{
case RACIAL_TYPE_VERMIN:
nDisease = DISEASE_VERMIN_MADNESS;
break;
case RACIAL_TYPE_UNDEAD:
nDisease = DISEASE_FILTH_FEVER;
break;
case RACIAL_TYPE_OUTSIDER:
nDisease = DISEASE_DEMON_FEVER;
break;
case RACIAL_TYPE_MAGICAL_BEAST:
nDisease = DISEASE_SOLDIER_SHAKES;
break;
case RACIAL_TYPE_ABERRATION:
nDisease = DISEASE_BLINDING_SICKNESS;
break;
default:
nDisease = DISEASE_MINDFIRE;
break;
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DISEASE));
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
eDisease = EffectDisease(nDisease);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Lightning
//:: NW_S0_CallLghtn.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
All creatures within 10ft of the creature take
1d6 per HD up to 10d6
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 22, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNPC, BODY_NODE_CHEST);
effect eHowl = EffectVisualEffect(VFX_IMP_PULSE_COLD);
DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHowl, GetLocation(oNPC)));
float fDelay;
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_LIGHTNING));
//Roll the damage
nDamage = d6(nHD);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget, 0.5));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,69 @@
//::///////////////////////////////////////////////
//:: Pulse: Fire
//:: NW_S1_PulsFire
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_FIRE));
//Roll the damage
nDamage = d6(nHD);
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE);
//Determine effect delay
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
if(nDamage > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

View File

@@ -0,0 +1,89 @@
//::///////////////////////////////////////////////
//:: Pulse: Holy
//:: NW_S1_PulsHoly
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants. Undead are damaged, allies are healed.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_HOLY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is not undead
if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Make a faction check
if(oTarget != oNPC)
{
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_HOLY, FALSE));
//Set heal effect
eHowl = EffectHeal(nDamage);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
else
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_DIVINE);
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE) ;
if(nDamage > 0)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_HOLY));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,72 @@
//::///////////////////////////////////////////////
//:: Pulse: Intelligence Drain
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_INTELLIGENCE));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
}
}

View File

@@ -0,0 +1,62 @@
//::///////////////////////////////////////////////
//:: Pulse: Level Drain
//:: NW_S1_PulsLvlDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(oNPC));
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
fDelay = GetSpellEffectDelay(GetLocation(oNPC), oTarget)/20;
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Apply the VFX impact and effects
eHowl = EffectNegativeLevel(1);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,87 @@
//::///////////////////////////////////////////////
//:: Pulse: Negative
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants. Undead are healed.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Roll the amount to heal or damage
nDamage = d4(nHD);
//If the target is undead
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Make a faction check
if(GetIsFriend(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_HOLY, FALSE));
//Set heal effect
eHowl = EffectHeal(nDamage);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
else
{
if(!GetIsReactionTypeFriendly(oTarget) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE);
//Set damage effect
eHowl = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
if(nDamage > 0)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_HOLY));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,138 @@
//::///////////////////////////////////////////////
//:: Pulse: Poison
//:: NW_S1_PulsPois
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. All who make a reflex save are not
poisoned.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 23, 2000
//:://////////////////////////////////////////////
#include "prc_inc_racial"
//#include "wm_include"
void main()
{
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int nRacial = MyPRCGetRacialType(oNPC);
int nPoison;
float fDelay;
effect ePoison;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
//Determine the poison type based on the Racial Type and HD
switch (nRacial)
{
case RACIAL_TYPE_OUTSIDER:
if (nHD <= 9)
{
nPoison = POISON_QUASIT_VENOM;
}
else if (nHD > 9 && nHD < 13)
{
nPoison = POISON_BEBILITH_VENOM;
}
else if (nHD >= 13)
{
nPoison = POISON_PIT_FIEND_ICHOR;
}
break;
case RACIAL_TYPE_VERMIN:
if (nHD < 3)
{
nPoison = POISON_TINY_SPIDER_VENOM;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_SMALL_SPIDER_VENOM;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_MEDIUM_SPIDER_VENOM;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_HUGE_SPIDER_VENOM;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_GARGANTUAN_SPIDER_VENOM;
}
else if (nHD >= 18)
{
nPoison = POISON_COLOSSAL_SPIDER_VENOM;
}
break;
default:
if (nHD < 3)
{
nPoison = POISON_NIGHTSHADE;
}
else if (nHD <= 3 && nHD < 6)
{
nPoison = POISON_BLADE_BANE;
}
else if (nHD <= 6 && nHD < 9)
{
nPoison = POISON_BLOODROOT;
}
else if (nHD <= 9 && nHD < 12)
{
nPoison = POISON_LARGE_SPIDER_VENOM;
}
else if (nHD <= 12 && nHD < 15)
{
nPoison = POISON_LICH_DUST;
}
else if (nHD <= 15 && nHD < 18)
{
nPoison = POISON_DARK_REAVER_POWDER;
}
else if (nHD >= 18 )
{
nPoison = POISON_BLACK_LOTUS_EXTRACT;
}
break;
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_POISON));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
ePoison = EffectPoison(nPoison);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,50 @@
//::///////////////////////////////////////////////
//:: Vrock Spores
//:: NW_S1_PulsSpore
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of disease spreads out from the creature
and infects all those within 10ft
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
float fDelay;
effect eDisease;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_DISEASE));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
eDisease = EffectDisease(DISEASE_SOLDIER_SHAKES);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,71 @@
//::///////////////////////////////////////////////
//:: Pulse: Strength Drain
//:: NW_S1_PulsDeath
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(oTarget != oNPC)
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_STRENGTH, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,51 @@
//::///////////////////////////////////////////////
//:: Pulse Whirlwind
//:: NW_S1_PulsWind
//:: Copyright (c) 2001 Bioware Corp.
//::///////////////////////////////////////////////
/*
All those that fail a save are knocked
down by the elemental whirlwind.
*/
//::///////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//::///////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nSTRMod = GetAbilityModifier(ABILITY_STRENGTH, oNPC);
int nDC = 10 +nSTRMod+ (nHD/2);
effect eDown = EffectKnockdown();
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WIND);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oNPC);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oNPC)
{
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDown, oTarget, 5.0);
}
//Get next target in spell area
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(oNPC));
}
}

View File

@@ -0,0 +1,68 @@
//::///////////////////////////////////////////////
//:: Pulse: Wisdom Drain
//:: NW_S1_PulsWisDr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
A wave of energy emanates from the creature which affects
all within 10ft. Damage can be reduced by half for all
damaging variants.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 14, 2000
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
int nDamage = nHD/5;
if (nDamage == 0) {nDamage = 1;}
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eHowl;
effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_PULSE_ABILITY_DRAIN_WISDOM));
//Determine effect delay
fDelay = GetDistanceBetween(oNPC, oTarget)/20;
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oNPC, fDelay))
{
//Set the Ability mod and change to supernatural effect
eHowl = EffectAbilityDecrease(ABILITY_WISDOM, nDamage);
eHowl = SupernaturalEffect(eHowl);
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get first target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(OBJECT_SELF));
}
}

View File

@@ -0,0 +1,64 @@
//::///////////////////////////////////////////////
//:: Smoke Claws
//:: NW_S1_SmokeClaw
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If a Belker succeeds at a touch attack the
target breaths in part of the Belker and suffers
3d4 damage per round until a Fortitude save is
made.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 23 , 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
int bSave = FALSE;
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
effect eSmoke;
float fDelay = 0.0;
//Make a touch attack
if(TouchAttackMelee(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget))
{
//Make a saving throw check
while (bSave == FALSE)
{
//Make a saving throw check
if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oNPC, fDelay))
{
bSave = TRUE;
}
else
{
//Set damage
eSmoke = EffectDamage(d4(3));
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSmoke, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
//Increment the delay
fDelay = fDelay + 6.0;
}
}
}
}
}

View File

@@ -0,0 +1,57 @@
//::///////////////////////////////////////////////
//:: Stinking Cloud On Enter
//:: NW_S1_Stink_A.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Those within the area of effect must make a
fortitude save or be dazed.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject(); //Get the first object in the persistant area
int nHD = GetHitDice(oNPC);
int nCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oNPC);
int nDC = 10 +nCONMod+ (nHD/2);
effect eStink = EffectDazed();
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eMind, eStink);
eLink = EffectLinkEffects(eLink, eDur);
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
float fDelay;
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_VERMIN)
{
if(GetIsEnemy(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_STINKING_CLOUD));
//Make a Fort Save
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_POISON))
{
fDelay = GetRandomDelay(0.25, 1.0);
//Apply the VFX impact and linked effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)));
}
}
}
}

View File

@@ -0,0 +1,56 @@
//::///////////////////////////////////////////////
//:: Tyrant Fog Zombie Mist Heartbeat
//:: NW_S1_TyrantFgA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creatures entering the area around the zombie
must save or take 1 point of Constitution
damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = GetAreaOfEffectCreator();
object oTarget = GetEnteringObject();
//if (NullMagicOverride(GetArea(oTarget), oTarget, oTarget)) {return;}
int bAbsent = TRUE;
int nHD = GetHitDice(oNPC);
int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC);
int nDC = 10 +nCHAMod+ (nHD/2);
effect eTest;
effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, 1);
eCon = ExtraordinaryEffect(eCon);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eCon, eDur);
if(!GetHasSpellEffect(SPELLABILITY_TYRANT_FOG_MIST, oTarget))
{
if(bAbsent == TRUE)
{
if(GetIsEnemy(oTarget, oNPC))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oNPC, SPELLABILITY_TYRANT_FOG_MIST));
//Make a saving throw check
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_POISON))
{
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(5));
}
}
}
}
}

View File

@@ -0,0 +1,25 @@
//::///////////////////////////////////////////////
//:: Tyrant Fog Zombie Mist
//:: NW_S1_TyrantFog.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creatures entering the area around the zombie
must save or take 1 point of Constitution
damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 25, 2001
//:://////////////////////////////////////////////
//#include "wm_include"
#include "prc_inc_spells"
void main()
{
//if (WildMagicOverride()) { return; }
//Declare and apply the AOE
effect eAOE = EffectAreaOfEffect(AOE_MOB_TYRANT_FOG);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100));
}

View File

@@ -0,0 +1,45 @@
//::///////////////////////////////////////////////
//:: Divine Protection
//:: NW_S2_DivProt.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Makes the target creature invisible to hostile
creatures unless they make a Will Save to ignore
the Sanctuary Effect
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 8, 2002
//:://////////////////////////////////////////////
#include "prc_inc_spells"
//#include "wm_include"
void main()
{
//if (WildMagicOverride()) { return; }
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
int nDC = 10 + GetAbilityModifier(ABILITY_CHARISMA) + GetLevelByTypeDivine(oNPC);
effect eSanc = EffectSanctuary(nDC);
effect eLink = EffectLinkEffects(eVis, eSanc);
eLink = EffectLinkEffects(eLink, eDur);
//Fire cast spell at event for the specified target
SignalEvent(OBJECT_SELF, EventSpellCastAt(oNPC, SPELLABILITY_DIVINE_PROTECTION, FALSE));
int nDuration = GetLevelByTypeDivine(oNPC);
//Enter Metamagic conditions
int nMetaMagic = PRCGetMetaMagicFeat();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
}

View File

@@ -0,0 +1,62 @@
// HCR v3.2.0 - Execute default death script after fireball effects is complete.
//::////////////////////////////////////////////////////////////////////////////
//:: FileName: NW_S3_BALORDETH
//::////////////////////////////////////////////////////////////////////////////
/*
Fireball explosion does 50 damage to all within 20ft.
*/
//::////////////////////////////////////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 9, 2002
//::////////////////////////////////////////////////////////////////////////////
#include "NW_I0_SPELLS"
#include "prc_inc_spells"
//::////////////////////////////////////////////////////////////////////////////
void main()
{
// Declare major variables.
int nMetaMagic = PRCGetMetaMagicFeat();
int nDamage;
float fDelay;
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
effect eDam;
// Apply the fireball explosion.
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
location lTarget = GetLocation(OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
// Cycle through the targets until an invalid object is captured.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
while (GetIsObjectValid(oTarget))
{
// Fire cast spell at event for the specified target.
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL));
// Calculate delay based on distance between explosion and the target.
fDelay = (GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20);
if (!PRCDoResistSpell(OBJECT_SELF, oTarget, FloatToInt(fDelay)))
{
// Adjust damage based on Reflex Save, Evasion and Improved Evasion.
nDamage = PRCGetReflexAdjustedDamage(50, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
if (nDamage > 0)
{
// Apply effects to the currently selected target.
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
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.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
}
// HCR 3.0 - Call default death script.
ExecuteScript("nw_c2_default7", OBJECT_SELF);
}
//::////////////////////////////////////////////////////////////////////////////

View File

@@ -123,7 +123,7 @@ sMessage += GetRGB(15,5,1);
sMessage += "Genisys (Guile) ";
sMessage += GetRGB(12,10,7);
sMessage += "from 8/20/08 to 3/21/09.";
string sNewb = GetRGB(1,15,1) + "This PRC Presents Path of Ascension.";
string sNewb = GetRGB(1,15,1) + "This is PRC Presents Path of Ascension.";
string sNewb2 = GetRGB(1,15,1) + "Contact Altpersona on Discord if you need assistance.";
//string sNewb = GetRGB(1,15,1) + "Be sure to read your journal frequently (press J).";
//string sNewb2 = GetRGB(1,15,1) + "Be sure to examine the Rest Menu carefully.";
@@ -192,16 +192,19 @@ 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("serverrules", 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);
AddJournalQuestEntry("xprules", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("serverrules", 1, oPC, FALSE, FALSE);
//AddJournalQuestEntry("legartjournal", 1, oPC, FALSE, FALSE);
if(GetHitDice(oPC) <=5)
{
AddJournalQuestEntry("newb", 1, oPC, FALSE, FALSE);
AddJournalQuestEntry("legartjournal", 1, oPC, FALSE, FALSE);
}
//////////////////IMPORTANT////////////////IMPORTANT////////////////////////

View File

@@ -21,7 +21,7 @@ effect eEffect;
//Main Script
void main()
{
ExecuteScript("prc_rest", OBJECT_SELF);
//Declare Major Variables
object oPC=GetLastPCRested();
object oPlayer = oPC;
@@ -199,10 +199,11 @@ if(GetIsPC(oPlayer))
ExecuteScript("powerimmortal", oPC);
}
ExecuteScript("prc_rest", oPC);
//Your code goes here. (This happens when the PC is done resting..)
}
}
}
}

View File

@@ -40,6 +40,7 @@ Relevel(oPC);
//This function Take1Level(oTarget); will take 1 level from the Target.
//It set's thier xp to the base required XP for the next lowest level.
//
void Take1Level(object oTarget)
{
int cLvl = GetHitDice(oTarget);
@@ -87,6 +88,26 @@ case 37: nXP = 630000; break;
case 38: nXP = 666000; break;
case 39: nXP = 703000; break;
case 40: nXP = 741000; break;
case 41: nXP = 780000; break;
case 42: nXP = 820000; break;
case 43: nXP = 861000; break;
case 44: nXP = 903000; break;
case 45: nXP = 946000; break;
case 46: nXP = 990000; break;
case 47: nXP = 1035000; break;
case 48: nXP = 1081000; break;
case 49: nXP = 1128000; break;
case 50: nXP = 1176000; break;
case 51: nXP = 1225000; break;
case 52: nXP = 1275000; break;
case 53: nXP = 1326000; break;
case 54: nXP = 1378000; break;
case 55: nXP = 1431000; break;
case 56: nXP = 1485000; break;
case 57: nXP = 1540000; break;
case 58: nXP = 1596000; break;
case 59: nXP = 1653000; break;
case 60: nXP = 1711000; break;
}
SetXP(oTarget, nXP);
}
@@ -142,7 +163,27 @@ case 36: nXP = 666000; break;
case 37: nXP = 703000; break;
case 38: nXP = 741000; break;
case 39: nXP = 780000; break;
case 40: nXP = GetHitDice(oTarget) + 40000; break;
case 40: nXP = 820000; break;
case 41: nXP = 861000; break;
case 42: nXP = 903000; break;
case 43: nXP = 946000; break;
case 44: nXP = 990000; break;
case 45: nXP = 1035000; break;
case 46: nXP = 1081000; break;
case 47: nXP = 1128000; break;
case 48: nXP = 1176000; break;
case 49: nXP = 1225000; break;
case 50: nXP = 1275000; break;
case 51: nXP = 1326000; break;
case 52: nXP = 1378000; break;
case 53: nXP = 1431000; break;
case 54: nXP = 1485000; break;
case 55: nXP = 1540000; break;
case 56: nXP = 1596000; break;
case 57: nXP = 1653000; break;
case 58: nXP = 1711000; break;
case 59: nXP = 1770000; break;
case 60: nXP = 1830000; break;
}
SetXP(oTarget, nXP);
@@ -283,6 +324,27 @@ case 37: nXP = 666000; break;
case 38: nXP = 703000; break;
case 39: nXP = 741000; break;
case 40: nXP = 780000; break;
case 41: nXP = 820000; break;
case 42: nXP = 861000; break;
case 43: nXP = 903000; break;
case 44: nXP = 946000; break;
case 45: nXP = 990000; break;
case 46: nXP = 1035000; break;
case 47: nXP = 1081000; break;
case 48: nXP = 1128000; break;
case 49: nXP = 1176000; break;
case 50: nXP = 1225000; break;
case 51: nXP = 1275000; break;
case 52: nXP = 1326000; break;
case 53: nXP = 1378000; break;
case 54: nXP = 1431000; break;
case 55: nXP = 1485000; break;
case 56: nXP = 1540000; break;
case 57: nXP = 1596000; break;
case 58: nXP = 1653000; break;
case 59: nXP = 1711000; break;
case 60: nXP = 1770000; break;
}

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