Initial Commit

Initial Commit
This commit is contained in:
Jaysyn904 2025-04-03 11:24:16 -04:00
parent 3ba3cf1b81
commit 5e558169a0
6086 changed files with 1502996 additions and 1 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.hak
*.mod
*.md5

View File

@ -1,2 +1,5 @@
# AOC_PRC8
# Arena of Champions [PRC8-CEP3]
Repository for development of the PRC8 version of the Arena of Champions module by Commche.
Original here: https://neverwintervault.org/project/nwn1/module/arena-champions-buildmaster

3
_content/BuildHaks.cmd Normal file
View File

@ -0,0 +1,3 @@
cd _tools\
NWN.CLI.exe -k
cd ..

View File

@ -0,0 +1,4 @@
:loop
"C:\NWN Work\nwnsc.exe" -o -w -n "C:\Games\Steam\steamapps\common\Neverwinter Nights" -i "D:\NWN Repos\AoC_PRC8\_content\_haks\aoc_prc8_merge";"D:\NWN Repos\PRC8\nwn\nwnprc\trunk\include" "D:\NWN Repos\AoC_PRC8\_content\_haks\aoc_prc8_merge\*.nss"
if %errorLevel% == -1 goto :loop
pause

View File

@ -0,0 +1,475 @@
#include "custom_set_lib"
struct perceivedEvent
{
int isValid;
object lastPerceived;
int lastPerceptionHeard;
int lastPerceptionInaudible;
int lastPerceptionSeen;
int lastPerceptionVanished;
};
struct disturbedEvent
{
int isValid;
object lastDisturbed;
object inventoryDisturbItem;
int inventoryDisturbType;
};
struct attackedEvent
{
int isValid;
object lastAttacker;
};
struct damagedEvent
{
int isValid;
object lastdamager;
int totalDamageDealt;
int damageAcid;
int damageBludgeoning;
int damageCold;
int damageDivine;
int damageElectrical;
int damageFire;
int damageMagical;
int damageNegative;
int damagePiercing;
int damagePositive;
int damageSlashing;
int damageSonic;
};
struct blockedEvent
{
int isValid;
object blockingDoor;
};
//::///////////////////////////////////////////////
//:: GetLastPerceivedEvent
//:://////////////////////////////////////////////
//
// Retrieves the last perception event data from target.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct perceivedEvent GetLastPerceivedEvent(object target = OBJECT_SELF);
//::///////////////////////////////////////////////
//:: SetLastPerceivedEvent
//:://////////////////////////////////////////////
//
// Stores the perception event data for the caller.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
void SetLastPerceivedEvent(struct perceivedEvent evt);
//::///////////////////////////////////////////////
//:: PerceivedEvent
//:://////////////////////////////////////////////
//
// Returns the data available for a caller perception event.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct perceivedEvent PerceivedEvent();
//::///////////////////////////////////////////////
//:: GetLastDisturbedEvent
//:://////////////////////////////////////////////
//
// Retrieves the last inventory dirsturbed event data from target.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct disturbedEvent GetLastDisturbedEvent(object target = OBJECT_SELF);
//::///////////////////////////////////////////////
//:: SetLastDisturbedEvent
//:://////////////////////////////////////////////
//
// Stores the inventory dirsturbed event data for the caller.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
void SetLastDisturbedEvent(struct disturbedEvent evt);
//::///////////////////////////////////////////////
//:: DisturbedEvent
//:://////////////////////////////////////////////
//
// Returns the data available for a caller inventory dirsturbed event.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct disturbedEvent DisturbedEvent();
//::///////////////////////////////////////////////
//:: GetLastAttackedEvent
//:://////////////////////////////////////////////
//
// Retrieves the last on attacked event data from target.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct attackedEvent GetLastAttackedEvent(object target = OBJECT_SELF);
//::///////////////////////////////////////////////
//:: SetLastAttackedEvent
//:://////////////////////////////////////////////
//
// Stores the on attacked event data on the caller.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
void SetLastAttackedEvent(struct attackedEvent evt);
//::///////////////////////////////////////////////
//:: AttackedEvent
//:://////////////////////////////////////////////
//
// Returns the available on attacked event data.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct attackedEvent AttackedEvent();
//::///////////////////////////////////////////////
//:: CreatePCClone
//:://////////////////////////////////////////////
//
// Creates a clone of PC at cloneLocation. The clone will
// use the set of script corresponding to scriptset.
// If spawn is TRUE then CustomSet_respawn is called.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
object CreatePCClone(object PC,location cloneLocation,int scriptset = CustomSet_DefaultSet,int spawn = TRUE);
//::///////////////////////////////////////////////
//:: GetLastDamagedEvent
//:://////////////////////////////////////////////
//
// Retrieves the last on damaged event data from target.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct damagedEvent GetLastDamagedEvent(object target = OBJECT_SELF);
//::///////////////////////////////////////////////
//:: SetLastDamagedEvent
//:://////////////////////////////////////////////
//
// Stores the on damaged event data on the caller.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
void SetLastDamagedEvent(struct damagedEvent evt);
//::///////////////////////////////////////////////
//:: DamagedEvent
//:://////////////////////////////////////////////
//
// Returns the data available for a caller on damaged event.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct damagedEvent DamagedEvent();
//::///////////////////////////////////////////////
//:: GetLastBlockedEvent
//:://////////////////////////////////////////////
//
// Retrieves the last on blocked event data from target.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct blockedEvent GetLastBlockedEvent(object target = OBJECT_SELF);
//::///////////////////////////////////////////////
//:: SetLastBlockedEvent
//:://////////////////////////////////////////////
//
// Stores the on blocked event data on the caller.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
void SetLastBlockedEvent(struct blockedEvent evt);
//::///////////////////////////////////////////////
//:: BlockedEvent
//:://////////////////////////////////////////////
//
// Returns the data available for a caller on blocked event.
//
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 04/11/2004
//:://////////////////////////////////////////////
struct blockedEvent BlockedEvent();
void SetDialog(string dialog,object target= OBJECT_SELF);
string GetDialog(object target= OBJECT_SELF);
struct perceivedEvent GetLastPerceivedEvent(object target = OBJECT_SELF)
{
struct perceivedEvent retval;
retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceivedIsValid");
retval.lastPerceived = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastPerceived");
retval.lastPerceptionInaudible = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionInaudible");
retval.lastPerceptionSeen = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionSeen");
retval.lastPerceptionVanished = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionVanished");
return retval;
}
void SetLastPerceivedEvent(struct perceivedEvent evt)
{
object target = OBJECT_SELF;
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceivedIsValid",evt.isValid);
SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastPerceived",evt.lastPerceived);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionInaudible",evt.lastPerceptionInaudible);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionSeen",evt.lastPerceptionSeen);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionVanished",evt.lastPerceptionVanished);
}
struct perceivedEvent PerceivedEvent()
{
struct perceivedEvent retval;
retval.lastPerceived = GetLastPerceived();
retval.isValid = GetIsObjectValid(retval.lastPerceived);
retval.lastPerceptionInaudible = GetLastPerceptionInaudible();
retval.lastPerceptionSeen = GetLastPerceptionSeen();
retval.lastPerceptionVanished = GetLastPerceptionVanished();
return retval;
}
struct disturbedEvent GetLastDisturbedEvent(object target = OBJECT_SELF)
{
struct disturbedEvent retval;
retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDisturbedValid");
retval.lastDisturbed = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDisturbed");
retval.inventoryDisturbItem = GetLocalObject(target,"PC_CLONE_SYSTEM_InventoryDisturbItem");
retval.inventoryDisturbType = GetLocalInt(target,"PC_CLONE_SYSTEM_inventoryDisturbType");
return retval;
}
void SetLastDisturbedEvent(struct disturbedEvent evt)
{
object target = OBJECT_SELF;
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDisturbedValid",evt.isValid);
SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDisturbed",evt.lastDisturbed);
SetLocalObject(target,"PC_CLONE_SYSTEM_InventoryDisturbItem",evt.inventoryDisturbItem);
SetLocalInt(target,"PC_CLONE_SYSTEM_inventoryDisturbType",evt.inventoryDisturbType);
}
struct disturbedEvent DisturbedEvent()
{
struct disturbedEvent retval;
retval.lastDisturbed = GetLastDisturbed();
retval.inventoryDisturbItem = GetInventoryDisturbItem();
retval.isValid = GetIsObjectValid(retval.lastDisturbed) && GetIsObjectValid(retval.inventoryDisturbItem);
retval.inventoryDisturbType = GetInventoryDisturbType();
return retval;
}
struct attackedEvent GetLastAttackedEvent(object target = OBJECT_SELF)
{
struct attackedEvent retval;
retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastAttackerValid");
retval.lastAttacker = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastAttacker");
return retval;
}
void SetLastAttackedEvent(struct attackedEvent evt)
{
object target = OBJECT_SELF;
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastAttackerValid",evt.isValid);
SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastAttacker",evt.lastAttacker);
}
struct attackedEvent AttackedEvent()
{
struct attackedEvent retval;
retval.lastAttacker = GetLastAttacker();
retval.isValid = GetIsObjectValid(retval.lastAttacker);
return retval;
}
object CreatePCClone(object PC,location cloneLocation,int scriptset = CustomSet_DefaultSet,int spawn = TRUE)
{
object copy = CopyObject(PC,cloneLocation);
SetLocalInt(copy,"PC_CLONE_SYSTEM",TRUE);
SetLocalInt(copy,CustomSetScriptSet,scriptset);
if(spawn)
{
CustomSet_respawn(copy);
}
AssignCommand(copy,DelayCommand(RoundsToSeconds(1),ExecuteScript("clone_heartbeat",copy)));
return copy;
}
struct damagedEvent GetLastDamagedEvent(object target = OBJECT_SELF)
{
struct damagedEvent retval;
retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDamagerValid");
retval.lastdamager = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDamager");
retval.totalDamageDealt = GetLocalInt(target,"PC_CLONE_SYSTEM_GetTotalDamageDealt");
retval.damageAcid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ACID));
retval.damageBludgeoning = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_BLUDGEONING));
retval.damageCold = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_COLD));
retval.damageDivine = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_DIVINE));
retval.damageElectrical = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ELECTRICAL));
retval.damageFire = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_FIRE));
retval.damageMagical = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_MAGICAL));
retval.damageNegative = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_NEGATIVE));
retval.damagePiercing = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_PIERCING));
retval.damagePositive = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_POSITIVE));
retval.damageSlashing = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SLASHING));
retval.damageSonic = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SONIC));
return retval;
}
void SetLastDamagedEvent(struct damagedEvent evt)
{
object target = OBJECT_SELF;
SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDamagerValid",evt.isValid);
SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDamager",evt.lastdamager);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetTotalDamageDealt",evt.totalDamageDealt);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ACID),evt.damageAcid);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_BLUDGEONING),evt.damageBludgeoning);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_COLD),evt.damageCold);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_DIVINE),evt.damageDivine);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ELECTRICAL),evt.damageElectrical);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_FIRE),evt.damageFire);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_MAGICAL),evt.damageMagical);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_NEGATIVE),evt.damageNegative);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_PIERCING),evt.damagePiercing);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_POSITIVE),evt.damagePositive);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SLASHING),evt.damageSlashing);
SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SONIC),evt.damageSonic);
}
struct damagedEvent DamagedEvent()
{
struct damagedEvent retval;
retval.lastdamager = GetLastDamager();
retval.isValid = GetIsObjectValid(retval.lastdamager);
retval.totalDamageDealt = GetTotalDamageDealt();
retval.damageAcid = GetDamageDealtByType(DAMAGE_TYPE_ACID);
retval.damageBludgeoning = GetDamageDealtByType(DAMAGE_TYPE_BLUDGEONING);
retval.damageCold = GetDamageDealtByType(DAMAGE_TYPE_COLD);
retval.damageDivine = GetDamageDealtByType(DAMAGE_TYPE_DIVINE);
retval.damageElectrical = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
retval.damageFire = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
retval.damageMagical = GetDamageDealtByType(DAMAGE_TYPE_MAGICAL);
retval.damageNegative = GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE);
retval.damagePiercing = GetDamageDealtByType(DAMAGE_TYPE_PIERCING);
retval.damagePositive = GetDamageDealtByType(DAMAGE_TYPE_POSITIVE);
retval.damageSlashing = GetDamageDealtByType(DAMAGE_TYPE_SLASHING);
retval.damageSonic = GetDamageDealtByType(DAMAGE_TYPE_SONIC);
return retval;
}
struct blockedEvent GetLastBlockedEvent(object target = OBJECT_SELF)
{
struct blockedEvent retval;
retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetBlockingDoorIsValid");
retval.blockingDoor = GetLocalObject(target,"PC_CLONE_SYSTEM_GetBlockingDoor");
return retval;
}
void SetLastBlockedEvent(struct blockedEvent evt)
{
SetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_GetBlockingDoorIsValid",evt.isValid);
SetLocalObject(OBJECT_SELF,"PC_CLONE_SYSTEM_GetBlockingDoor",evt.blockingDoor);
}
struct blockedEvent BlockedEvent()
{
struct blockedEvent retval;
retval.blockingDoor = GetBlockingDoor();
retval.isValid = GetIsObjectValid(retval.blockingDoor);
return retval;
}
void SetDialog(string dialog,object target= OBJECT_SELF)
{
SetLocalString(target,"PC_CLONE_SYSTEM_DLG",dialog);
}
string GetDialog(object target= OBJECT_SELF)
{
return GetLocalString(target,"PC_CLONE_SYSTEM_DLG");
}

Binary file not shown.

View File

@ -0,0 +1,103 @@
#include "clone_lib"
void main()
{
if(GetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM"))
{
if(!GetIsDead(OBJECT_SELF) && GetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_DeathRun"))
{
SetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_DeathRun",FALSE);
}
struct perceivedEvent lastPerceptionEvent = GetLastPerceivedEvent();
struct perceivedEvent perceptionEvent = PerceivedEvent();
if( perceptionEvent.isValid &&
(!lastPerceptionEvent.isValid || (lastPerceptionEvent != perceptionEvent) ) )
{
SetLastPerceivedEvent(perceptionEvent);
ExecuteScript("custom_percep",OBJECT_SELF);
}
if(GetLastSpell() >= 0)
{
ExecuteScript("custom_spellcast",OBJECT_SELF);
SignalEvent(OBJECT_SELF,EventSpellCastAt(OBJECT_SELF,-1,FALSE));
}
if(GetUserDefinedEventNumber() >= 0)
{
ExecuteScript("custom_userdef",OBJECT_SELF);
SignalEvent(OBJECT_SELF,EventUserDefined(-1));
}
struct attackedEvent lastattackedEvent = GetLastAttackedEvent();
struct attackedEvent attackedEvent = AttackedEvent();
if( attackedEvent.isValid &&
(!lastattackedEvent.isValid || (lastattackedEvent != attackedEvent) ) )
{
SetLastAttackedEvent(attackedEvent);
ExecuteScript("custom_physicald",OBJECT_SELF);
}
struct disturbedEvent lastDisturbedEvent = GetLastDisturbedEvent();
struct disturbedEvent disturbedEvent = DisturbedEvent();
if( disturbedEvent.isValid &&
(!lastDisturbedEvent.isValid || (lastDisturbedEvent != disturbedEvent) ) )
{
SetLastDisturbedEvent(disturbedEvent);
ExecuteScript("custom_disturbed",OBJECT_SELF);
}
struct damagedEvent lastDamagegEvent = GetLastDamagedEvent();
struct damagedEvent damagegEvent = DamagedEvent();
if( damagegEvent.isValid &&
(!lastDamagegEvent.isValid || (lastDamagegEvent != damagegEvent) ) )
{
SetLastDamagedEvent(damagegEvent);
ExecuteScript("custom_damage",OBJECT_SELF);
}
struct blockedEvent blockedEvent = BlockedEvent();
struct blockedEvent lastBlockedEvent = GetLastBlockedEvent();
if( blockedEvent.isValid &&
(!lastBlockedEvent.isValid || (lastBlockedEvent != blockedEvent) ) )
{
SetLastBlockedEvent(blockedEvent);
ExecuteScript("custom_blocked",OBJECT_SELF);
}
if(GetIsDead(OBJECT_SELF) && !GetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_DeathRun"))
{
SetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_DeathRun",TRUE);
ExecuteScript("custom_death",OBJECT_SELF);
}
}
}

View File

@ -0,0 +1,258 @@
const string CustomSetScriptSet = "CustomSetScriptSet";
const string CustomSet_OnBlocked = "OnBlocked";
const string CustomSet_OnDamaged = "OnDamaged";
const string CustomSet_OnDeath = "OnDeath";
const string CustomSet_OnConversation = "OnConversation";
const string CustomSet_OnDisturbed = "OnDisturbed";
const string CustomSet_OnCombatRoundEnd = "OnCombatRoundEnd";
const string CustomSet_OnHeartbeat = "OnHeartbeat";
const string CustomSet_OnPhysicalAttacked = "OnPhysicalAttacked";
const string CustomSet_OnPerception = "OnPerception";
const string CustomSet_OnRested = "OnRested";
const string CustomSet_OnSpawn = "OnSpawn";
const string CustomSet_OnSpellCast = "OnSpellCast";
const string CustomSet_OnUserDefined = "OnUserDefined";
//Default script sets
const int CustomSet_DefaultSet = 1;
const int CustomSet_HenchManSet = 2;
const int CustomSet_X2_DefaultSet = 3;
// Makes target execute the custom_spawn script.
void CustomSet_respawn(object target=OBJECT_SELF);
// Earase all scripts set on target.
void CustomSet_ClearScripts(object target=OBJECT_SELF);
// Returns the set of script used by target or 0 if none is set.
int GetCustomSetScriptSet(object target = OBJECT_SELF);
// Sets the set of script that target should use. You may have to call
// CustomSet_respawn.
void SetCustomSetScriptSet(int scriptSet = CustomSet_DefaultSet,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnBlocked(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnBlocked(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnDamaged(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnDamaged(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnDeath(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnDeath(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnConversation(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnConversation(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnDisturbed(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnDisturbed(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnCombatRoundEnd(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnCombatRoundEnd(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnHeartbeat(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnHeartbeat(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnPhysicalAttacked(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnPhysicalAttacked(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnPerception(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnPerception(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnRested(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnRested(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnSpawn(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnSpawn(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnSpellCast(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnSpellCast(string script,object target = OBJECT_SELF);
// Returns the script associated with an event.
string GetCustomSet_OnUserDefined(object target = OBJECT_SELF);
// Links a script with an event.
void SetCustomSet_OnUserDefined(string script,object target = OBJECT_SELF);
void CustomSet_respawn(object target=OBJECT_SELF)
{
ExecuteScript("custom_spawn",target);
}
void CustomSet_ClearScripts(object target=OBJECT_SELF)
{
DeleteLocalString(target,CustomSet_OnBlocked);
DeleteLocalString(target,CustomSet_OnDamaged);
DeleteLocalString(target,CustomSet_OnDeath);
DeleteLocalString(target,CustomSet_OnConversation);
DeleteLocalString(target,CustomSet_OnDisturbed);
DeleteLocalString(target,CustomSet_OnCombatRoundEnd);
DeleteLocalString(target,CustomSet_OnHeartbeat);
DeleteLocalString(target,CustomSet_OnPhysicalAttacked);
DeleteLocalString(target,CustomSet_OnPerception);
DeleteLocalString(target,CustomSet_OnRested);
DeleteLocalString(target,CustomSet_OnSpawn);
DeleteLocalString(target,CustomSet_OnSpellCast);
DeleteLocalString(target,CustomSet_OnUserDefined);
}
void SetCustomSetScriptSet(int scriptSet = CustomSet_DefaultSet,object target = OBJECT_SELF)
{
SetLocalInt(target,CustomSetScriptSet,scriptSet);
}
int GetCustomSetScriptSet(object target = OBJECT_SELF)
{
return GetLocalInt(target,CustomSetScriptSet);
}
string GetCustomSet_OnBlocked(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnBlocked);
}
void SetCustomSet_OnBlocked(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnBlocked,script);
}
string GetCustomSet_OnDamaged(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnDamaged);
}
void SetCustomSet_OnDamaged(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnDamaged,script);
}
string GetCustomSet_OnDeath(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnDeath);
}
void SetCustomSet_OnDeath(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnDeath,script);
}
string GetCustomSet_OnConversation(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnConversation);
}
void SetCustomSet_OnConversation(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnConversation,script);
}
string GetCustomSet_OnDisturbed(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnDisturbed);
}
void SetCustomSet_OnDisturbed(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnDisturbed,script);
}
string GetCustomSet_OnCombatRoundEnd(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnCombatRoundEnd);
}
void SetCustomSet_OnCombatRoundEnd(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnCombatRoundEnd,script);
}
string GetCustomSet_OnHeartbeat(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnHeartbeat);
}
void SetCustomSet_OnHeartbeat(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnHeartbeat,script);
}
string GetCustomSet_OnPhysicalAttacked(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnPhysicalAttacked);
}
void SetCustomSet_OnPhysicalAttacked(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnPhysicalAttacked,script);
}
string GetCustomSet_OnPerception(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnPerception);
}
void SetCustomSet_OnPerception(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnPerception,script);
}
string GetCustomSet_OnRested(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnRested);
}
void SetCustomSet_OnRested(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnRested,script);
}
string GetCustomSet_OnSpawn(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnSpawn);
}
void SetCustomSet_OnSpawn(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnSpawn,script);
}
string GetCustomSet_OnSpellCast(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnSpellCast);
}
void SetCustomSet_OnSpellCast(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnSpellCast,script);
}
string GetCustomSet_OnUserDefined(object target = OBJECT_SELF)
{
return GetLocalString(target,CustomSet_OnUserDefined);
}
void SetCustomSet_OnUserDefined(string script,object target = OBJECT_SELF)
{
SetLocalString(target,CustomSet_OnUserDefined,script);
}

Binary file not shown.

View File

@ -0,0 +1,419 @@
//::///////////////////////////////////////////////
//:: Default eventscript
//:: default
//:://////////////////////////////////////////////
/** @file
This script is executed by the engine for events
when a creature does not have a script defined
for the event in question. This includes PCs.
The purpose of this script is to determine
which particular event triggered it's execution
and to route execution to scripts dedicated to
that event.
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "prc_alterations"
#include "prc_inc_leadersh"
const int LOCAL_DEBUG = FALSE; //DEBUG;
/**************************/
/* Declarations for Tests */
/**************************/
int IsBlocked(); // test GetBlockingDoor()
int IsCombatRoundEnd(); // Need to fake this
int IsConversation(); // test a local variable
int IsDamaged(); // test GetLastDamager()
int IsDeath(); // test GetIsDead(OBJECT_SELF)
int IsDisturbed(); // test GetLastDisturbed()
int IsHeartbeat(); // test game time
int IsPerception(); // test GetLastPerceived()
int IsPhysicalAttacked(); // test GetLastAttacker()
int IsRested(); // test GetIsResting(GetMaster())
int IsSpawn(); // run once, never again
int IsSpellCastAt(); // test GetLastSpellCaster()
int IsUserDefined(); // test GetUserDefinedEventNumber()
/*********************************/
/* Utility Function declarations */
/*********************************/
//void ForceAddHenchman(object oHenchman);
//int IsLinkboyAttached();
//void GetLinkboy();
int IsObjectChanged(object oTest, string sVarname);
int IsIntChanged(int iTest, string sVarname);
int IsStringChanged(string sTest, string sVarname);
void RunScript(int nEvent);
//void SpawnRecallLocals(object oPC);
//void StartGroupDiscussion();
/*****************************/
/* Implementation of Actions */
/*****************************/
void OnSpawn() { RunScript(EVENT_VIRTUAL_ONSPAWNED); }
void OnDeath() { RunScript(EVENT_VIRTUAL_ONDEATH); }
void OnRested() { RunScript(EVENT_VIRTUAL_ONRESTED); }
void OnHeartbeat() { RunScript(EVENT_VIRTUAL_ONHEARTBEAT); }
void OnPerception() { RunScript(EVENT_VIRTUAL_ONPERCEPTION); }
void OnBlocked() { RunScript(EVENT_VIRTUAL_ONBLOCKED); }
void OnCombatRoundEnd() { RunScript(EVENT_VIRTUAL_ONCOMBATROUNDEND); }
void OnDisturbed() { RunScript(EVENT_VIRTUAL_ONDISTURBED); }
void OnPhysicalAttacked() { RunScript(EVENT_VIRTUAL_ONPHYSICALATTACKED); }
void OnSpellCastAt() { RunScript(EVENT_VIRTUAL_ONSPELLCASTAT); }
void OnDamaged() { RunScript(EVENT_VIRTUAL_ONDAMAGED); }
void OnUserDefined() { RunScript(EVENT_VIRTUAL_ONUSERDEFINED); }
void OnConversation() { RunScript(EVENT_VIRTUAL_ONCONVERSATION); }
/******************/
/* Main Procedure */
/******************/
void main()
{
ExecuteScript("clone_sys");
if(LOCAL_DEBUG) DoDebug("default running for " + DebugObject2Str(OBJECT_SELF));
// OnConversation is exclusive of everything else, since it is just routed through this script
if(IsConversation()) OnConversation();
else
{
if(IsBlocked()) OnBlocked();
if(IsCombatRoundEnd()) OnCombatRoundEnd();
if(IsDamaged()) OnDamaged();
if(IsDeath()) OnDeath();
if(IsDisturbed()) OnDisturbed();
if(IsHeartbeat()) OnHeartbeat();
if(IsPerception()) OnPerception();
if(IsPhysicalAttacked()) OnPhysicalAttacked();
if(IsRested()) OnRested();
if(IsSpawn()) OnSpawn();
if(IsSpellCastAt()) OnSpellCastAt();
if(IsUserDefined()) OnUserDefined();
}
}
/************************/
/* Tests for conditions */
/************************/
int IsBlocked()
{
return IsObjectChanged(GetBlockingDoor(), "BlockingDoor");
}
int IsCombatRoundEnd()
{
// Need to fake this.
// Return TRUE iff you are in combat and not doing anything useful
if(GetIsInCombat() ||
(GetIsObjectValid(GetMaster()) &&
GetIsInCombat(GetMaster())
)
)
{
int nGCA = GetCurrentAction();
if(nGCA == ACTION_ATTACKOBJECT ||
nGCA == ACTION_CASTSPELL ||
nGCA == ACTION_COUNTERSPELL ||
nGCA == ACTION_HEAL ||
nGCA == ACTION_FOLLOW ||
nGCA == ACTION_ITEMCASTSPELL ||
nGCA == ACTION_KIDAMAGE ||
nGCA == ACTION_OPENDOOR ||
nGCA == ACTION_SMITEGOOD
)
{
return FALSE;
}
else
{
return TRUE;
}
}
else
{
return FALSE;
}
}
int IsConversation()
{
object oCreature = OBJECT_SELF;
if(GetLocalInt(oCreature, "default_conversation_event"))
{
DeleteLocalInt(oCreature, "default_conversation_event");
return TRUE;
}
return FALSE;
}
int IsDamaged()
{
object oCreature = OBJECT_SELF;
object oDamager = GetLastDamager(oCreature);
// The damage source must be valid
if(GetIsObjectValid(oDamager))
{
// Get previous damage data
string sOldDamage = GetLocalString(oCreature, "PRC_Event_OnDamaged_Data");
// Create string based on current damage values
// Start with the damaging object
string sNewDamage = ObjectToString(oDamager);
// Catenate amount of damage of each damage type
int i;
for(i = DAMAGE_TYPE_BLUDGEONING; i <= DAMAGE_TYPE_BASE_WEAPON; i = i << 1)
sNewDamage += IntToString(GetDamageDealtByType(i));
// Determine if the damage dealt has changed
if(sOldDamage != sNewDamage)
{
if(LOCAL_DEBUG) DoDebug("default: Damage has changed:\n" + sNewDamage);
SetLocalString(oCreature, "PRC_Event_OnDamaged_Data", sNewDamage);
// Update damage counter
SetLocalInt(oCreature, "PRC_LastDamageTaken", GetTotalDamageDealt());
return TRUE;
}
}
return FALSE;
}
int IsDeath()
{
return GetIsDead(OBJECT_SELF);
}
int IsDisturbed()
{
object oCreature = OBJECT_SELF;
object oDisturber = GetLastDisturbed();
if(GetIsObjectValid(oDisturber)) // The creature has been disturbed at least once during the game
{
// Get previous disturb data
string sOldDisturb = GetLocalString(oCreature, "PRC_Event_OnDisturbed_Data");
// Create string based on current disturb values
string sNewDisturb = ObjectToString(oDisturber);
sNewDisturb += IntToString(GetInventoryDisturbType());
sNewDisturb += ObjectToString(GetInventoryDisturbItem());
// Determine if the data has changed
if(sOldDisturb != sNewDisturb)
{
if(LOCAL_DEBUG) DoDebug("default: Disturbed has changed:\n" + sNewDisturb);
SetLocalString(oCreature, "PRC_Event_OnDisturbed_Data", sNewDisturb);
return TRUE;
}
}
return FALSE;
}
int IsHeartbeat()
{
object oCreature = OBJECT_SELF;
// PCs use the module HB
if(!GetIsPC(oCreature))
{
// Check how long since last recorded heartbeat
int nSecsChange = (GetTimeSecond() - GetLocalInt(oCreature, "PRC_LastHeartbeatSeconds") + 60) % 60;
// See if the master clock has ticked or 9 seconds have elapsed anyway
if(nSecsChange >= 6)
{
SetLocalInt(oCreature, "PRC_LastHeartbeatSeconds", GetTimeSecond());
return TRUE;
}
}
return FALSE;
}
int IsPerception()
{
object oCreature = OBJECT_SELF;
object oPerceived = GetLastPerceived();
if(GetIsObjectValid(oPerceived)) // The creature has perceived something at least once during the game
{
// Get previous perception data
string sOldPerception = GetLocalString(oCreature, "PRC_Event_OnPerception_Data");
// Create string based on current perception values
string sNewPerception = ObjectToString(oPerceived);
sNewPerception += IntToString(GetLastPerceptionHeard());
sNewPerception += IntToString(GetLastPerceptionInaudible());
sNewPerception += IntToString(GetLastPerceptionSeen());
sNewPerception += IntToString(GetLastPerceptionVanished());;
// Determine if the data has changed
if(sOldPerception != sNewPerception)
{
if(LOCAL_DEBUG) DoDebug("default: Perception has changed:\n" + sNewPerception);
SetLocalString(oCreature, "PRC_Event_OnPerception_Data", sNewPerception);
return TRUE;
}
}
return FALSE;
}
int IsPhysicalAttacked()
{
object oCreature = OBJECT_SELF;
object oAttacker = GetLastAttacker();
// Recent enough event that the attacker is at least still valid
if(GetIsObjectValid(oAttacker))
{
// Get previous attack data
string sOldAttack = GetLocalString(oCreature, "PRC_Event_OnPhysicalAttacked_Data");
// Create string for the current attack data
string sNewAttack = ObjectToString(oAttacker);
sNewAttack += ObjectToString(GetLastWeaponUsed(oAttacker));
sNewAttack += IntToString(GetLastAttackMode(oAttacker));
sNewAttack += IntToString(GetLastAttackType(oAttacker));
// Determine if the data has changed
if(sOldAttack != sNewAttack)
{
if(LOCAL_DEBUG) DoDebug("default: Attack has changed:\n" + sNewAttack);
SetLocalString(oCreature, "PRC_Event_OnPhysicalAttacked_Data", sNewAttack);
return TRUE;
}
}
return FALSE;
}
int IsRested()
{
// PCs use the module OnRest events
if(!GetIsPC(OBJECT_SELF))
{
// Goes TRUE when Master starts resting
int bMasterIsResting = GetIsResting(GetMaster());
return IsIntChanged(bMasterIsResting,"MasterIsResting") && bMasterIsResting;
}
return FALSE;
}
int IsSpawn()
{
object oCreature = OBJECT_SELF;
if(!GetLocalInt(oCreature, "PRC_OnSpawn_Marker"))
{
SetLocalInt(oCreature, "PRC_OnSpawn_Marker", TRUE);
return TRUE;
}
return FALSE;
}
int IsSpellCastAt()
{
object oCreature = OBJECT_SELF;
if(LOCAL_DEBUG) DoDebug("default: IsSpellCastAt():\n"
+ "GetLastSpellCaster() = " + DebugObject2Str(GetLastSpellCaster()) + "\n"
+ "GetLastSpell() = " + IntToString(GetLastSpell()) + "\n"
+ "GetLastSpellHarmful() = " + IntToString(GetLastSpellHarmful()) + "\n"
);
// If the event data does not contain the fake value, a spell has been cast
if(GetLastSpell() != -1)
{
// Reset the event data to the fake value
DelayCommand(0.0f, SignalEvent(oCreature, EventSpellCastAt(oCreature, -1, FALSE)));
return TRUE;
}
return FALSE;
}
int IsUserDefined()
{
object oCreature = OBJECT_SELF;
if(LOCAL_DEBUG) DoDebug("default: IsUserDefined():\n"
+ "GetUserDefinedEventNumber() = " + IntToString(GetUserDefinedEventNumber()) + "\n"
);
if(GetUserDefinedEventNumber() != -1)
{
// Reset the event data to the fake value
DelayCommand(0.0f, SignalEvent(oCreature, EventUserDefined(-1)));
return TRUE;
}
return FALSE;
}
/*********************/
/* Utility Functions */
/*********************/
int IsObjectChanged(object oTest, string sName)
{
if(oTest != GetLocalObject(OBJECT_SELF, "PRC_Event_" + sName))
{
SetLocalObject(OBJECT_SELF, "PRC_Event_" + sName, oTest);
return TRUE;
}
else
{
return FALSE;
}
}
int IsIntChanged(int iTest, string sName)
{
if(iTest != GetLocalInt(OBJECT_SELF, "PRC_Event_" + sName))
{
SetLocalInt(OBJECT_SELF, "PRC_Event_" + sName, iTest);
return TRUE;
}
else
{
return FALSE;
}
}
int IsStringChanged(string sTest, string sName)
{
if(sTest != GetLocalString(OBJECT_SELF, "PRC_Event_" + sName))
{
SetLocalString(OBJECT_SELF, "PRC_Event_" + sName, sTest);
return TRUE;
}
else
{
return FALSE;
}
}
void RunScript(int nEvent)
{
object oSelf = OBJECT_SELF;
if(LOCAL_DEBUG) DoDebug("default, event = " + IntToString(nEvent));
if(nEvent == EVENT_VIRTUAL_ONDAMAGED)
SignalEvent(oSelf, EventUserDefined(EVENT_DAMAGED));
// Determine NPC script name and run generic eventhook
ExecuteAllScriptsHookedToEvent(oSelf, nEvent);
}

Binary file not shown.

View File

@ -0,0 +1,28 @@
////////////////////////////////////////////////////////////
// OnConversation
// g_ConversationDG.nss
// Copyright (c) 2001 Bioware Corp.
////////////////////////////////////////////////////////////
// Created By: Noel Borstad
// Created On: 04/25/02001
// Description: This is the default script that is called if
// no OnConversation script is specified.
////////////////////////////////////////////////////////////
#include "custom_set_lib"
#include "inc_eventhook"
void main()
{
ExecuteAllScriptsHookedToEvent(OBJECT_SELF, EVENT_VIRTUAL_ONCONVERSATION);
if(!GetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM"))
{
if ( GetListenPatternNumber() == -1 )
{
BeginConversation();
}
}
else
{
ExecuteScript("custom_conv",OBJECT_SELF);
}
}

Binary file not shown.

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)));
}
}
}

Binary file not shown.

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();
}
}

Binary file not shown.

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();
}
}

Binary file not shown.

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();
}
}

Binary file not shown.

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 = PRCGetCasterLevel(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));
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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));
//}
}
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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));
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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));
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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));
}
}

Binary file not shown.

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);
}
}

Binary file not shown.

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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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, PRCGetSpellTargetLocation(), 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, PRCGetSpellTargetLocation(), TRUE);
}
}

Binary file not shown.

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);
}
}
}

Binary file not shown.

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) ;
}
}

Binary file not shown.

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 (PRCGetHasEffect(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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 (PRCGetHasEffect(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 = PRCGetSpellTargetLocation();
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);
}
}

Binary file not shown.

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 (PRCGetHasEffect(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 = PRCGetSpellTargetLocation();
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);
}
}

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