Big Demonic Update
Big Demonic Update. Full compile. Updated release archive.
This commit is contained in:
220
_module/nss/bp_t_randloc.nss
Normal file
220
_module/nss/bp_t_randloc.nss
Normal file
@@ -0,0 +1,220 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: script(file)name: _incl_rndloc
|
||||
//:: Type: includefile
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Generates random Locations v1.0
|
||||
Notes: To be refined and functions added.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Hikade (nick: agem)
|
||||
//:://////////////////////////////////////////////
|
||||
// * (CONSTANTS) VARIABLES >
|
||||
// NOTE: Only Vars here because i think editing the
|
||||
// nwscript.nss is pointless due to the PATCH issue.
|
||||
// Sorry this makes Function Declaration(s) less
|
||||
// transparent, but this is the it is...
|
||||
/* values form the nwscript.nss
|
||||
int SHAPE_SPELLCYLINDER = 0;
|
||||
int SHAPE_CONE = 1;
|
||||
int SHAPE_CUBE = 2;
|
||||
int SHAPE_SPELLCONE = 3;
|
||||
int SHAPE_SPHERE = 4;
|
||||
*/
|
||||
int BASE_SHAPE_CONE = SHAPE_CONE; // :=1
|
||||
int BASE_SHAPE_BOX = SHAPE_CUBE; // :=2
|
||||
int BASE_SHAPE_CIRCLE = SHAPE_SPHERE; // :=4
|
||||
int BASE_SHAPE_STAR = SHAPE_SPELLCYLINDER; // :=3
|
||||
int DIMENSION_2D = 0;
|
||||
int DIMENSION_HEMISPHERE = 1;
|
||||
int DIMENSION_HEMISPHERE_PLUS = 2;
|
||||
int DIMENSION_3D = 3;
|
||||
int DIMENSION_3D_PLUS = 4;
|
||||
// * (CONSTANTS) VARIABLES <
|
||||
|
||||
// * Function Declaration(s) >
|
||||
|
||||
// Creates an Random Location in BASE_SHAPE_* (see Variables)
|
||||
// - lTarget: Starting location from where to generate random location
|
||||
// - iMaxRange : Maximal distance allowed for generated location
|
||||
// - iMinRange : Minimal distance allowed for generated location
|
||||
// -> When iMinRange=0 generated location can be on startingpoint
|
||||
// -> When iMinRange=iMaxRange then generated location is always at Maximal Distance e.g. a empty circle
|
||||
// - Shape : BASE_SHAPE_BOX = SHAPE_CUBE :=2 is Default (others see var BASE_SHAPE_*)
|
||||
// - fAngle: Only used for certain BASE_SHAPE_*(see following)
|
||||
// -> BASE_SHAPE_CONE Sets the center angle off Cone (Half Cone)
|
||||
// -> BASE_SHAPE_STAR Sets Staring angel for first Starpoint
|
||||
// - fAngle: Only used for certain BASE_SHAPE_*(see following)
|
||||
// -> BASE_SHAPE_CONE +- angel of Cone center angel
|
||||
// -> BASE_SHAPE_STAR Set value for ammount of Starpoints e.g. 5.0f = FIVE STAR
|
||||
// - nDimension: Set Dimesion Type (see var DIMENSION_*)
|
||||
// -> DIMENSION_2D :normal 2D you will most commonly use e.g. full circle
|
||||
// -> DIMENSION_HEMISPHERE :Top Part of halfsphere, special: location z-value are porportional distance
|
||||
// -> DIMENSION_HEMISPHERE_PLUS : Top Part of halfsphere and z-values will always be visible
|
||||
// -> DIMENSION_3D: Full Sphere, ideal for floating things, special: location z-value are porportional distance
|
||||
// -> DIMENSION_3D_Plus : Full Sphere, ideal for floating things, and z-values will mostly be visible
|
||||
// Handy special cases:
|
||||
// -> BASE_SHAPE_STAR with only 1 Starpoint is a Line with one direction.
|
||||
// -> BASE_SHAPE_STAR with 2 Starpoints is a Line with a middlepoint that has in an left/right property
|
||||
location RndLoc(location lTarget,int iMaxRange,int iMinRange=0,int nShape_Type=2,float fAngle=0.0f, float fAngleWidth=90.0f,int nDimension=0);
|
||||
/*
|
||||
float SetFacingType(float fDirection,location lTarget,object oSource=OBJECT_SELF);
|
||||
*/
|
||||
void FillArea();
|
||||
// Creates an Random Sign 1/-1
|
||||
int RndSign();
|
||||
// Creates an Random Float
|
||||
float RndFloat(int nMaxFloat);
|
||||
// Creates an Random Angle
|
||||
float RndAngle(int iDeg=360);
|
||||
// Creates an Random Unit Vector
|
||||
vector RndUnitVector();
|
||||
// Create an Random z-value for an vector based on DIMENSION_*
|
||||
float RndZCoor(float fZCoor,int iMaxRange,int iMinRange,int nDimension=0);
|
||||
|
||||
// * Function Implementation >
|
||||
// Creates an Random Sign 1/-1
|
||||
int RndSign() {
|
||||
int iRndSign;
|
||||
if(Random(2)) iRndSign = -1; else iRndSign =1;
|
||||
return iRndSign;
|
||||
}
|
||||
|
||||
// Creates an Random Float
|
||||
float RndFloat(int nMaxFloat) {
|
||||
float fRandom;
|
||||
int iPrefixPoint = Random(nMaxFloat);//+1;
|
||||
int iSufixPoint = Random(10)+1;
|
||||
return fRandom = IntToFloat(iPrefixPoint)+(IntToFloat(iSufixPoint)/10);
|
||||
}
|
||||
|
||||
// Creates an Random Angle
|
||||
float RndAngle(int iDeg=360) {
|
||||
float fAngle;
|
||||
int iRndDeg = Random(iDeg)+1;
|
||||
int iRndMinute = Random(10)+1;
|
||||
return fAngle = IntToFloat(iRndDeg)+(IntToFloat(iRndMinute)/10);
|
||||
}
|
||||
|
||||
// Creates an Random Unit Vector
|
||||
vector RndUnitVector() {
|
||||
vector vRndUnitVector = AngleToVector(RndAngle());
|
||||
return vRndUnitVector;
|
||||
}
|
||||
/*
|
||||
float SetFacingType(float fDirection,location lTarget,object oSource=OBJECT_SELF)
|
||||
{
|
||||
vector vTarget = GetPositionFromLocation(lTarget);
|
||||
vector vSource =GetPosition(oSource);
|
||||
vector vDirection = AngleToVector(fDurection);
|
||||
float fFacing = VectorToAngle(vTarget-vSource)+ fDirection;
|
||||
return fFacing;
|
||||
}
|
||||
*/
|
||||
|
||||
// Create an Random z-value for an vector based on DIMENSION_*
|
||||
float RndZCoor(float fZCoor,int iMaxRange,int iMinRange,int nDimension) {
|
||||
float fRndZCoor;
|
||||
switch (nDimension) {
|
||||
//DIMENSION_HEMISPHERE
|
||||
case 1 :
|
||||
{
|
||||
int zOffSet = Random(iMaxRange-iMinRange);
|
||||
fZCoor = fZCoor + (zOffSet + iMinRange);
|
||||
}
|
||||
break;
|
||||
// DIMENSION_HEMISPHERE_PLUS
|
||||
case 2 :
|
||||
{
|
||||
int zOffSet = Random(12);
|
||||
fZCoor = fZCoor + (zOffSet);
|
||||
}
|
||||
break;
|
||||
// DIMENSION_3D
|
||||
case 3 :
|
||||
{
|
||||
int zOffSet = Random(iMaxRange-iMinRange);
|
||||
fZCoor =fZCoor + (zOffSet + iMinRange)*RndSign();
|
||||
}
|
||||
break;
|
||||
//DIMENSION_3D_PLUS
|
||||
case 4 :
|
||||
{
|
||||
int zOffSet = Random(8);
|
||||
fZCoor = fZCoor + (zOffSet)*RndSign();
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return fRndZCoor=fZCoor;
|
||||
}
|
||||
|
||||
// Creates an Random Location in BASE_SHAPE_*
|
||||
location RndLoc(location lTarget,int iMaxRange,int iMinRange=0,int nShape_Type=2, float fAngle=0.0f, float fAngleWidth=90.0f,int nDimension=0) {
|
||||
object oTargetArea = GetAreaFromLocation(lTarget);
|
||||
vector vTarget = GetPositionFromLocation(lTarget);
|
||||
float fTargetfacing = GetFacingFromLocation(lTarget);
|
||||
switch (nShape_Type) {
|
||||
case 2: // BASE_SHAPE_BOX = SHAPE_CUBE :=2
|
||||
{
|
||||
if(Random(2)) {
|
||||
int xOffSet = Random(iMaxRange-iMinRange);
|
||||
int yOffSet = Random(iMaxRange);
|
||||
// To enable Q2,Q3,Q4 positions of vector
|
||||
vTarget.x = vTarget.x + (xOffSet + iMinRange)*RndSign();
|
||||
vTarget.y = vTarget.y + (yOffSet)* RndSign();
|
||||
} else {
|
||||
int xOffSet = Random(iMaxRange);
|
||||
int yOffSet = Random(iMaxRange-iMinRange);
|
||||
// To enable Q2,Q3,Q4 positions of vector
|
||||
vTarget.x = vTarget.x + (xOffSet) *RndSign();
|
||||
vTarget.y = vTarget.y + (yOffSet + iMinRange)*RndSign();
|
||||
}
|
||||
// Adds according z-value if demanded
|
||||
vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension);
|
||||
}
|
||||
break;
|
||||
case 4: // BASE_SHAPE_CIRCLE = SHAPE_SPHERE :=4
|
||||
{
|
||||
int iRndRange = Random((iMaxRange+1)-iMinRange);
|
||||
vector vRandomUnitVector = RndUnitVector();
|
||||
vRandomUnitVector *= IntToFloat(iRndRange+iMinRange);
|
||||
vTarget += vRandomUnitVector;
|
||||
// Adds according z-value if demanded
|
||||
vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension);
|
||||
}
|
||||
break;
|
||||
case 1: // BASE_SHAPE_CONE = SHAPE_CONE :=1
|
||||
{
|
||||
int iRndRange = Random((iMaxRange+1)-iMinRange);
|
||||
float fRndAngle = RndAngle(FloatToInt(fAngleWidth)/2*RndSign());
|
||||
fRndAngle += fAngle;
|
||||
vector vRndVector = AngleToVector(fRndAngle);
|
||||
vRndVector *= IntToFloat(iRndRange+iMinRange);
|
||||
vTarget += vRndVector;
|
||||
// Adds according z-value if demanded
|
||||
vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension);
|
||||
}
|
||||
break;
|
||||
/* //difference to SHAPE_CONE unknown and a CYLINDER can be made by BASE_SHAPE_CIRCLE
|
||||
case SHAPE_SPELLCONE:
|
||||
{
|
||||
}break;
|
||||
*/
|
||||
case 3: // BASE_SHAPE_STAR = SHAPE_SPELLCYLINDER :=3
|
||||
{
|
||||
int iRndRange = Random((iMaxRange+1)-iMinRange);
|
||||
float fStartingAngle = fAngle;
|
||||
float fAngleStep = (360.0f/fAngleWidth);
|
||||
float fRndAngel = Random(FloatToInt(fAngleWidth)+1)*fAngleStep;
|
||||
vector vRandomVector = AngleToVector(fRndAngel)*IntToFloat(iRndRange+iMinRange);
|
||||
vTarget += vRandomVector;
|
||||
// Adds according z-value if demanded
|
||||
vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
// return Random Location of wished type
|
||||
return lTarget= Location(oTargetArea,vTarget,fTargetfacing);
|
||||
}
|
@@ -11,6 +11,7 @@
|
||||
//:: Created On: 20240331
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_combmove"
|
||||
|
||||
void main()
|
||||
{
|
||||
@@ -27,7 +28,18 @@ void main()
|
||||
|
||||
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE);
|
||||
|
||||
int nInsanity = GetLocalInt(OBJECT_SELF,"INSANITY");
|
||||
//:: End any active grapple from Improved Grab
|
||||
EndGrapple(oNPC, GetGrappleTarget(oNPC));
|
||||
EndGrapple(GetGrappleTarget(oNPC), oNPC);
|
||||
|
||||
int nBalor = GetStringLeft(GetTag(OBJECT_SELF), 9) == "POA_BALOR" ? TRUE : FALSE;
|
||||
if(nBalor)
|
||||
{
|
||||
DelayCommand(0.0f, ExecuteScript("nw_s3_balordeth",OBJECT_SELF));
|
||||
}
|
||||
|
||||
|
||||
int nInsanity = GetLocalInt(OBJECT_SELF,"INSANITY");
|
||||
if(nInsanity)
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
|
@@ -73,7 +73,7 @@ while(GetIsObjectValid(oMon)==TRUE)
|
||||
//Only add +1 of the object is indeed a hostile Creature/NPC and not a PC!
|
||||
if(!GetIsPC(oMon) && GetObjectType(oMon)==OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
nCount+=1;
|
||||
nCount+=0; //:: 0 = disable this whole mess. -Jaysyn
|
||||
}
|
||||
//find the next monster..
|
||||
oMon = GetNextObjectInArea(GetArea(oPC));
|
||||
|
225
_module/nss/nw_s1_summtanar.nss
Normal file
225
_module/nss/nw_s1_summtanar.nss
Normal file
@@ -0,0 +1,225 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Summon Tanarri
|
||||
//:: NW_S0_SummSlaad
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Summons a Quasit to aid the threatened Demon
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Aug 14, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 25, 2001
|
||||
#include "bp_t_randloc"
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
string sTag = GetTag(OBJECT_SELF);
|
||||
int nNum;
|
||||
string sRes;
|
||||
effect eSummon;
|
||||
|
||||
if((GetStringLeft(sTag, 9) == "POA_BALOR") || (sTag == "NW_DEMON") || (sTag == "fiendw_npcb"))
|
||||
{
|
||||
switch(Random(6))
|
||||
{
|
||||
case 0:
|
||||
//nNum = d10(4);
|
||||
nNum = 10 + d10();
|
||||
sRes = "poa_dretch01";
|
||||
break;
|
||||
case 1:
|
||||
nNum = d4();
|
||||
sRes = "poa_hezrou01";
|
||||
break;
|
||||
case 2:
|
||||
nNum = 1;
|
||||
sRes = "poa_nalfeshnee01";
|
||||
break;
|
||||
case 3:
|
||||
nNum = 1;
|
||||
sRes = "poa_glabrezu01";
|
||||
break;
|
||||
case 4:
|
||||
nNum = 1;
|
||||
sRes = "poa_marilith01";
|
||||
break;
|
||||
case 5:
|
||||
nNum = 1;
|
||||
sRes = "poa_balor01";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if(GetStringLeft(sTag, 10) == "POA_DRETCH")
|
||||
{
|
||||
if(d100()<=35)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_dretch01";
|
||||
}
|
||||
}
|
||||
if((GetStringLeft(sTag, 12) == "POA_GLABREZU") || (sTag=="ZEP_GLABREZU"))
|
||||
{
|
||||
switch(Random(3))
|
||||
{
|
||||
case 0:
|
||||
nNum = 10 + d10();
|
||||
sRes = "poa_dretch01";
|
||||
break;
|
||||
case 1:
|
||||
if(d100()<=50)
|
||||
{
|
||||
nNum = d2();
|
||||
sRes = "poa_vrock01";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(d100()<=20)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_glabrezu01";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if((GetStringLeft(sTag, 10) == "POA_HEZROU") || (sTag=="Hezrou"))
|
||||
{
|
||||
switch(Random(2))
|
||||
{
|
||||
case 0:
|
||||
nNum = 10 + d10();
|
||||
sRes = "poa_dretch01";
|
||||
break;
|
||||
case 1:
|
||||
if(d100()<=35)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_hezrou01";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(GetStringLeft(sTag, 14) == "POA_NALFESHNEE")
|
||||
{
|
||||
switch(Random(2))
|
||||
{
|
||||
case 0:
|
||||
if(d100()<=50)
|
||||
{
|
||||
nNum = d4();
|
||||
sRes = "poa_vrock01";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(d100()<=50)
|
||||
{
|
||||
nNum = d4();
|
||||
sRes = "poa_hezrou01";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(d100()<=50)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_glabrezu01";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(d100()<=20)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_nalfeshnee01";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if((GetStringLeft(sTag, 12) == "POA_MARILITH") || (sTag=="ZEP_MARILITH") || (sTag=="ZEP_MERILITH2") || (sTag=="ZEP_MARILITHBG"))
|
||||
{
|
||||
switch(Random(5))
|
||||
{
|
||||
case 0:
|
||||
nNum = 10 + d10();
|
||||
sRes = "poa_dretch01";
|
||||
break;
|
||||
case 1:
|
||||
nNum = d4();
|
||||
sRes = "poa_hezrou01";
|
||||
break;
|
||||
case 2:
|
||||
if(d100()<=50)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_nalfeshnee01";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(d100()<=20)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_glabrezu01";
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(d100()<=20)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_marilith01";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if((GetStringLeft(sTag, 12) == "POA_SUCCUBUS") || (sTag=="NW_DMSUCUBUS") || (sTag=="ZEP_SUCCUBUS") || (sTag=="ZEP_SUCUBUSA") || (sTag=="ZEP_FLSUCC_001") || (sTag=="FIENDW_NPCA"))
|
||||
{
|
||||
if(d100()<=30)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_vrock01";
|
||||
}
|
||||
}
|
||||
if((GetStringLeft(sTag, 9) == "POA_BABAU"))
|
||||
{
|
||||
if(d100()<=40)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_babau01";
|
||||
}
|
||||
}
|
||||
|
||||
if((GetStringLeft(sTag, 9) == "POA_VROCK") || (sTag=="NW_DMVROCK"))
|
||||
{
|
||||
switch(Random(2))
|
||||
{
|
||||
case 0:
|
||||
nNum = d10(2);
|
||||
sRes = "poa_dretch01";
|
||||
break;
|
||||
case 1:
|
||||
if(d100()<=35)
|
||||
{
|
||||
nNum = 1;
|
||||
sRes = "poa_vrock01";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(DEBUG) {
|
||||
SendMessageToAllDMs(sTag + " >> " + IntToString(nNum) + " >> " + sRes);
|
||||
}
|
||||
object oCreature;
|
||||
if(sRes!="") {
|
||||
int i;
|
||||
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_HORRID_WILTING),GetSpellTargetLocation());
|
||||
for (i = 0; i < nNum; i++) {
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
oCreature = CreateObject(OBJECT_TYPE_CREATURE,sRes,RndLoc(PRCGetSpellTargetLocation(),5,DIMENSION_HEMISPHERE),FALSE);
|
||||
ChangeFaction(oCreature,OBJECT_SELF);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eVis,GetLocation(oCreature));
|
||||
//eSummon = EffectSummonCreature(sRes,VFX_FNF_SUMMON_MONSTER_3);
|
||||
//ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, RndLoc(GetSpellTargetLocation(),5,DIMENSION_HEMISPHERE), HoursToSeconds(24));
|
||||
}
|
||||
}
|
||||
}
|
62
_module/nss/nw_s3_balordeth.nss
Normal file
62
_module/nss/nw_s3_balordeth.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
// HCR v3.2.0 - Execute default death script after fireball effects is complete.
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
||||
//:: FileName: NW_S3_BALORDETH
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
Fireball explosion does 100 damage to all within 100ft.
|
||||
*/
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 9, 2002
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "prc_inc_spells"
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
||||
void main()
|
||||
{
|
||||
// Declare major variables.
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
|
||||
// Apply the fireball explosion.
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
|
||||
location lTarget = GetLocation(OBJECT_SELF);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
|
||||
|
||||
// Cycle through the targets until an invalid object is captured.
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 30.4f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
// Fire cast spell at event for the specified target.
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL));
|
||||
|
||||
// Calculate delay based on distance between explosion and the target.
|
||||
fDelay = (GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20);
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget, FloatToInt(fDelay)))
|
||||
{
|
||||
// Adjust damage based on Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = PRCGetReflexAdjustedDamage(10, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
|
||||
if (nDamage > 0)
|
||||
{
|
||||
// Apply effects to the currently selected target.
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
|
||||
// This visual effect is applied to the target object not the
|
||||
// location as above. This visual effect represents the flame that
|
||||
// erupts on the target not on the ground.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
|
||||
// Select the next target.
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, 30.4f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
|
||||
}
|
||||
|
||||
// HCR 3.0 - Call default death script.
|
||||
//ExecuteScript("nw_c2_default7", OBJECT_SELF);
|
||||
}
|
||||
//::////////////////////////////////////////////////////////////////////////////
|
99
_module/nss/retriever_onhb.nss
Normal file
99
_module/nss/retriever_onhb.nss
Normal file
@@ -0,0 +1,99 @@
|
||||
//:: Retriever onHeartbeat
|
||||
//::
|
||||
//:: retriever_onhb.nss
|
||||
//::
|
||||
//::
|
||||
|
||||
// Define constants for each ray type
|
||||
const int FIRE = 1;
|
||||
const int COLD = 2;
|
||||
const int ELECTRICITY = 3;
|
||||
const int PETRIFICATION = 4;
|
||||
|
||||
// Define cooldowns for rays in seconds
|
||||
const float COOLDOWN = 24.0; // Cooldown period in seconds
|
||||
|
||||
void FireEyeRay(object oTarget, int nRayType);
|
||||
void CheckAndFireRay(object oRetriever);
|
||||
|
||||
// Main Heartbeat function
|
||||
void main()
|
||||
{
|
||||
object oRetriever = OBJECT_SELF;
|
||||
CheckAndFireRay(oRetriever);
|
||||
|
||||
DelayCommand(0.0f, ExecuteScript("codi_heartbeat"));
|
||||
}
|
||||
|
||||
// Function to check cooldowns and fire a ray if possible
|
||||
void CheckAndFireRay(object oRetriever)
|
||||
{
|
||||
object oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oRetriever, 1);
|
||||
if (!GetIsObjectValid(oTarget))
|
||||
{
|
||||
PrintString("No valid target found.");
|
||||
return; // No valid target found
|
||||
}
|
||||
|
||||
float fDistance = GetDistanceBetween(oRetriever, oTarget);
|
||||
PrintString("Distance to target: " + FloatToString(fDistance));
|
||||
|
||||
if (fDistance > 100.0)
|
||||
{
|
||||
PrintString("Target out of range.");
|
||||
return; // Target is out of range
|
||||
}
|
||||
|
||||
float fCurrentTime = IntToFloat(GetTimeSecond());
|
||||
float fLastUsed = IntToFloat(GetLocalInt(oRetriever, "LAST_USED_TIME"));
|
||||
int nRayType = Random(4) + 1; // Randomly select a ray type
|
||||
|
||||
if (fLastUsed == 0.0 || fCurrentTime - fLastUsed >= COOLDOWN)
|
||||
{
|
||||
FireEyeRay(oTarget, nRayType);
|
||||
SetLocalInt(oRetriever, "LAST_USED_TIME", FloatToInt(fCurrentTime));
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintString("Cooldown active. Time left: " + FloatToString(fLastUsed + COOLDOWN - fCurrentTime) + " seconds.");
|
||||
}
|
||||
}
|
||||
|
||||
// Function to handle the firing of a specific ray
|
||||
void FireEyeRay(object oTarget, int nRayType)
|
||||
{
|
||||
int nDC = 18;
|
||||
effect eVisual;
|
||||
effect eDamage;
|
||||
switch (nRayType)
|
||||
{
|
||||
case FIRE:
|
||||
eVisual = EffectVisualEffect(VFX_COM_HIT_FIRE);
|
||||
eDamage = EffectDamage(d6(12), DAMAGE_TYPE_FIRE);
|
||||
break;
|
||||
case COLD:
|
||||
eVisual = EffectVisualEffect(VFX_COM_HIT_FROST);
|
||||
eDamage = EffectDamage(d6(12), DAMAGE_TYPE_COLD);
|
||||
break;
|
||||
case ELECTRICITY:
|
||||
eVisual = EffectVisualEffect(VFX_COM_HIT_ELECTRICAL);
|
||||
eDamage = EffectDamage(d6(12), DAMAGE_TYPE_ELECTRICAL);
|
||||
break;
|
||||
case PETRIFICATION:
|
||||
eVisual = EffectVisualEffect(VFX_DUR_PETRIFY);
|
||||
if (!FortitudeSave(oTarget, nDC, FALSE))
|
||||
{
|
||||
effect ePetrify = EffectPetrify();
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePetrify, oTarget);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply visual effects and damage
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
|
||||
if (ReflexSave(oTarget, nDC, TRUE) == TRUE) // TRUE for half damage
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d6(6), DAMAGE_TYPE_FIRE), oTarget);
|
||||
}
|
||||
}
|
@@ -14,6 +14,8 @@ void main()
|
||||
nClass = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_NINJA, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_BARD, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
|
||||
+GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
|
||||
|
||||
@@ -34,17 +36,51 @@ void main()
|
||||
{
|
||||
if(nSearch >= 34)
|
||||
{
|
||||
SendMessageToPC(oPC, "You found a secret lever!");
|
||||
|
||||
int nHench;
|
||||
object oHench;
|
||||
object oTarget;
|
||||
|
||||
// Send a message to the player's chat window.
|
||||
SendMessageToPC(oPC, "You have found a secret lever!");
|
||||
|
||||
// Have text appear over the PC's head.
|
||||
FloatingTextStringOnCreature("You have found a secret lever!", oPC);
|
||||
|
||||
// Find the location to which to teleport.
|
||||
oTarget = GetWaypointByTag("royalrogueway");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
// Save the PC's current location for the return trip.
|
||||
SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC));
|
||||
|
||||
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
||||
// Teleport the PC.
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
AssignCommand(oPC, JumpToObject(oTarget));
|
||||
|
||||
DelayCommand(2.0, AssignCommand(oPC, ClearAllActions()));
|
||||
// Also teleport associates.
|
||||
oHench = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
|
||||
AssignCommand(oHench, ClearAllActions());
|
||||
AssignCommand(oHench, JumpToObject(oTarget));
|
||||
oHench = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
|
||||
AssignCommand(oHench, ClearAllActions());
|
||||
AssignCommand(oHench, JumpToObject(oTarget));
|
||||
oHench = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
|
||||
AssignCommand(oHench, ClearAllActions());
|
||||
AssignCommand(oHench, JumpToObject(oTarget));
|
||||
oHench = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
|
||||
AssignCommand(oHench, ClearAllActions());
|
||||
AssignCommand(oHench, JumpToObject(oTarget));
|
||||
|
||||
DelayCommand(2.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
|
||||
// Support for multiple henchmen (includes horses).
|
||||
nHench = 1;
|
||||
oHench = GetHenchman(oPC, 1);
|
||||
while ( oHench != OBJECT_INVALID )
|
||||
{
|
||||
AssignCommand(oHench, ClearAllActions());
|
||||
AssignCommand(oHench, JumpToObject(oTarget));
|
||||
// Next henchman.
|
||||
oHench = GetHenchman(oPC, ++nHench);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user