AOC_PRC8/_module/nss/phoenix_rod.nss
Jaysyn904 5e558169a0 Initial Commit
Initial Commit
2025-04-03 11:24:16 -04:00

291 lines
11 KiB
Plaintext

void LightsOn()
{
object oArea = GetArea(OBJECT_SELF);
int x,y;
vector vLoc;
location lLoc;
string sLight;
string sLight2;
for(x=0;x<32;x++)
{
for(y=0;y<32;y++)
{
vLoc = Vector(IntToFloat(x),IntToFloat(y),0.0);
lLoc = Location(oArea,vLoc,0.0);
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".1";
sLight2 = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".2";
SetTileMainLightColor(lLoc,GetLocalInt(oArea,sLight),GetLocalInt(oArea,sLight2));
DeleteLocalInt(oArea,sLight);
DeleteLocalInt(oArea,sLight2);
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".3";
sLight2 = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".4";
SetTileSourceLightColor(lLoc,GetLocalInt(oArea,sLight),GetLocalInt(oArea,sLight2));
DeleteLocalInt(oArea,sLight);
DeleteLocalInt(oArea,sLight2);
}
}
RecomputeStaticLighting(oArea);
}
void LightsOut()
{
object oArea = GetArea(OBJECT_SELF);
int x,y;
vector vLoc;
location lLoc;
string sLight;
for(x=0;x<32;x++)
{
for(y=0;y<32;y++)
{
vLoc = Vector(IntToFloat(x),IntToFloat(y),0.0);
lLoc = Location(oArea,vLoc,0.0);
//Save Color first for all lights
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".1";
SetLocalInt(oArea,sLight,GetTileMainLight1Color(lLoc));
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".2";
SetLocalInt(oArea,sLight,GetTileMainLight2Color(lLoc));
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".3";
SetLocalInt(oArea,sLight,GetTileSourceLight1Color(lLoc));
sLight = "LIGHT" + IntToString(x) + "." + IntToString(y) + ".4";
SetLocalInt(oArea,sLight,GetTileSourceLight2Color(lLoc));
SetTileMainLightColor(lLoc,TILE_MAIN_LIGHT_COLOR_BLACK,TILE_MAIN_LIGHT_COLOR_BLACK);
SetTileSourceLightColor(lLoc,TILE_MAIN_LIGHT_COLOR_BLACK,TILE_MAIN_LIGHT_COLOR_BLACK);
}
}
RecomputeStaticLighting(oArea);
}
void CleanTargs()
{
object oSTarget1 = GetObjectByTag("FireworksSTarget1");
object oSTarget2 = GetObjectByTag("FireworksSTarget2");
object oSTarget3 = GetObjectByTag("FireworksSTarget3");
object oSTarget4 = GetObjectByTag("FireworksSTarget4");
object oSTarget5 = GetObjectByTag("FireworksSTarget5");
object oSTarget6 = GetObjectByTag("FireworksSTarget6");
object oSTarget7 = GetObjectByTag("FireworksSTarget7");
object oSTarget8 = GetObjectByTag("FireworksSTarget8");
object oSTarget9 = GetObjectByTag("FireworksSTarget9");
object oSTarget10 = GetObjectByTag("FireworksSTarget10");
object oSTarget11 = GetObjectByTag("FireworksSTarget11");
object oSTarget12 = GetObjectByTag("FireworksSTarget12");
object oMTarget = GetObjectByTag("FireworksMTarget3");
object oMTarget1 = GetObjectByTag("FireworksMTarget1");
object oMTarget2 = GetObjectByTag("FireworksMTarget2");
object oLTarget = GetObjectByTag("FireworksLTarget3");
object oLTarget1 = GetObjectByTag("FireworksLTarget1");
object oLTarget2 = GetObjectByTag("FireworksLTarget2");
float fTimeDelay = 3.0;
DestroyObject(oSTarget1,fTimeDelay);
DestroyObject(oSTarget2,fTimeDelay);
DestroyObject(oSTarget3,fTimeDelay);
DestroyObject(oSTarget4,fTimeDelay);
DestroyObject(oSTarget5,fTimeDelay);
DestroyObject(oSTarget6,fTimeDelay);
DestroyObject(oSTarget7,fTimeDelay);
DestroyObject(oSTarget8,fTimeDelay);
DestroyObject(oSTarget9,fTimeDelay);
DestroyObject(oSTarget10,fTimeDelay);
DestroyObject(oSTarget11,fTimeDelay);
DestroyObject(oSTarget12,fTimeDelay);
DestroyObject(oMTarget,fTimeDelay);
DestroyObject(oMTarget1,fTimeDelay);
DestroyObject(oMTarget2,fTimeDelay);
DestroyObject(oLTarget,fTimeDelay);
DestroyObject(oLTarget1,fTimeDelay);
DestroyObject(oLTarget2,fTimeDelay);
}
void SetWrath()
{
object oTarget = GetWaypointByTag("center_arena");
object oArea = GetArea(oTarget);
float z = 0.0;
float x,y,tx,ty;
float fAngle = 30.0;
int nCount;
vector nTarget = GetPosition(oTarget);
vector nCreate;
string sTag;
tx = nTarget.x;
ty = nTarget.y;
//12 small targets in a clock pattern
for(nCount = 1;nCount < 13;nCount++)
{
x = tx + (cos(fAngle)*10);
y = ty + (sin(fAngle)*10);
sTag = "FireworksSTarget" + IntToString(nCount);
CreateObject(OBJECT_TYPE_PLACEABLE,"fireworksstarget",Location(oArea,Vector(x,y,z),0.0),FALSE,sTag);
fAngle += 30.0;
}
x = tx;
y = ty;
//3 Medium and Large targets same x,y different z
for (nCount = 1;nCount < 4;nCount++)
{
sTag = "FireworksLTarget" + IntToString(nCount);
CreateObject(OBJECT_TYPE_PLACEABLE,"fireworksltarget",Location(oArea,Vector(x,y,z),0.0),FALSE,sTag);
z += 1.5;
}
}
void WrathCast(float oDelay, int eEffect, object oTarget)
{
DelayCommand(oDelay,
ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectVisualEffect(eEffect),
oTarget));
}
void ApplyWrathDamage(int iAmount, int dType, int pType, object oCreature)
{
effect eEffect = EffectDamage(iAmount, dType, pType);
ApplyEffectToObject(DURATION_TYPE_INSTANT,
eEffect, oCreature);
}
void WrathDamage(object oPC)
{
object oArea = GetArea(OBJECT_SELF);
object oCreature = GetFirstObjectInArea(oArea);
int iDice;
string sString;
while (GetIsObjectValid(oCreature))
{
if ((GetObjectType(oCreature)==OBJECT_TYPE_CREATURE)&&
(!GetIsPC(oCreature))&&(GetIsEnemy(oCreature, oPC))&&
(GetTag(oCreature)!="starfall")&&(GetTag(oCreature)!="reaper"))
{
ApplyWrathDamage(500, DAMAGE_TYPE_FIRE, DAMAGE_POWER_NORMAL, oCreature);
ApplyWrathDamage(500, DAMAGE_TYPE_COLD, DAMAGE_POWER_NORMAL, oCreature);
ApplyWrathDamage(500, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_NORMAL, oCreature);
ApplyWrathDamage(500, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_NORMAL, oCreature);
ApplyWrathDamage(500, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL, oCreature);
ApplyWrathDamage(150, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_ENERGY, oCreature);
}
if ((GetTag(oCreature)=="starfall")&&(GetIsEnemy(oCreature, oPC)))
{
PlayVoiceChat(VOICE_CHAT_LAUGH, oCreature);
iDice = d6();
switch (iDice)
{
case 1: {sString = "After years of posessing the Phoenix Rod, I have developed immunity to its power!";
break;}
case 2: {sString = "Your rod won't work on me, fool!";
break;}
case 3: {sString = "Well what do you know, the phoenix must like me! Gonna have to fight your own battle, whelp!";
break;}
case 4: {sString = "It is useless against me, mortal!";
break;}
case 5: {sString = "Need help defeating me do you?";
break;}
case 6: {sString = "Try again, grasshopper!";
break;}
}
AssignCommand(oCreature, SpeakString(sString));
}
oCreature =GetNextObjectInArea(oArea);
}
}
void WrathMessage (object oPC)
{
SendMessageToPC(oPC, "500 Fire Damage to all creatures");
SendMessageToPC(oPC, "500 Cold Damage to all creatures");
SendMessageToPC(oPC, "500 Divine Damage to all creatures");
SendMessageToPC(oPC, "500 Negative Damage to all creatures");
SendMessageToPC(oPC, "500 Positive Damage to all creatures");
SendMessageToPC(oPC, "500 Magical Damage to all creatures");
SendMessageToPC(oPC, "A massive shockwave does 150 instant damage to all");
}
void WrathSpell(object oPC, float oDelay)
{
object oSTarget1 = GetObjectByTag("FireworksSTarget1");
object oSTarget2 = GetObjectByTag("FireworksSTarget2");
object oSTarget3 = GetObjectByTag("FireworksSTarget3");
object oSTarget4 = GetObjectByTag("FireworksSTarget4");
object oSTarget5 = GetObjectByTag("FireworksSTarget5");
object oSTarget6 = GetObjectByTag("FireworksSTarget6");
object oSTarget7 = GetObjectByTag("FireworksSTarget7");
object oSTarget8 = GetObjectByTag("FireworksSTarget8");
object oSTarget9 = GetObjectByTag("FireworksSTarget9");
object oSTarget10 = GetObjectByTag("FireworksSTarget10");
object oSTarget11 = GetObjectByTag("FireworksSTarget11");
object oSTarget12 = GetObjectByTag("FireworksSTarget12");
object oLTarget = GetObjectByTag("FireworksLTarget3");
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(488),
oLTarget);
WrathCast(oDelay+1.0, VFX_FNF_FIRESTORM, oSTarget1);
WrathCast(oDelay+1.2, VFX_IMP_DIVINE_STRIKE_HOLY , oSTarget2);
WrathCast(oDelay+1.4, VFX_FNF_MYSTICAL_EXPLOSION, oSTarget3);
WrathCast(oDelay+1.6, VFX_FNF_ICESTORM, oSTarget4);
WrathCast(oDelay+1.8, VFX_FNF_FIRESTORM, oSTarget5);
WrathCast(oDelay+2.0, VFX_IMP_DIVINE_STRIKE_HOLY, oSTarget6);
WrathCast(oDelay+2.2, VFX_FNF_MYSTICAL_EXPLOSION, oSTarget7);
WrathCast(oDelay+2.4, VFX_FNF_ICESTORM, oSTarget8);
WrathCast(oDelay+2.6, VFX_FNF_FIRESTORM, oSTarget9);
WrathCast(oDelay+2.8, VFX_IMP_DIVINE_STRIKE_HOLY, oSTarget10);
WrathCast(oDelay+3.0, VFX_FNF_MYSTICAL_EXPLOSION, oSTarget11);
WrathCast(oDelay+3.2, VFX_FNF_ICESTORM, oSTarget12);
WrathCast(oDelay+1.9, VFX_FNF_HOWL_MIND, oSTarget3);
WrathCast(oDelay+2.3, VFX_FNF_HOWL_MIND, oSTarget6);
WrathCast(oDelay+2.9, VFX_FNF_HOWL_MIND, oSTarget9);
WrathCast(oDelay+3.1, VFX_FNF_HOWL_MIND, oSTarget12);
}
void Wrath(object oPC, float oDelay)
{
effect eEffect = EffectDamage(150, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_ENERGY);
SendMessageToPC(oPC, "The Phoenix's wrath is released:");
SetWrath();
//DelayCommand(0.0, LightsOut());
DelayCommand(0.5, WrathSpell(oPC, oDelay));
DelayCommand(8.0, WrathDamage(oPC));
DelayCommand(7.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));
DelayCommand(8.2, WrathMessage(oPC));
DelayCommand(10.5, CleanTargs());
//DelayCommand(11.0, LightsOn());
}
void main()
{
object oPC = OBJECT_SELF;
FloatingTextStringOnCreature("** Release the Phoenix-Dragon **", oPC);
object oMod = GetModule();
int iTime;
int iValidArea = GetLocalInt(oPC, "pvp_area");
float dWrathDelay = 5.0;
object oTarget = GetWaypointByTag("center_arena");
SetLocalInt(oMod, "WrathTime", 1);
if ((GetIsDay()==TRUE)||(GetIsDawn()==TRUE))
{DelayCommand(dWrathDelay+300.0, SetLocalInt(oMod, "WrathTime", 0));}
if ((GetIsNight()==TRUE)||(GetIsDusk()==TRUE))
{DelayCommand(dWrathDelay+420.0, SetLocalInt(oMod, "WrathTime", 0));}
Wrath(oPC, dWrathDelay);
}