generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
140
_module/nss/b_balordeth1.nss
Normal file
140
_module/nss/b_balordeth1.nss
Normal file
@@ -0,0 +1,140 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Balor On Death
|
||||
//:: NW_S3_BALORDETH
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Fireball explosion does 50 damage to all within
|
||||
20ft
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 9, 2002
|
||||
//::////////////////////////////////Kamaji / Shiva [Challenge]
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
#include "spawner"
|
||||
#include "x0_i0_petrify"
|
||||
#include "poolrestore"
|
||||
#include "loot"
|
||||
#include "rank"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetLastKiller();
|
||||
object oMod = GetModule();
|
||||
int oChest;
|
||||
int oExploit = GetLocalInt(oMod, "xcheck");
|
||||
int nInt1=GetLocalInt(oMod, "d2");
|
||||
int nInt2=GetLocalInt(oMod, "d1");
|
||||
int nInt3=GetLocalInt(oMod, "d3");
|
||||
int nInt4=GetLocalInt(oMod, "d2a");
|
||||
int nInt5=GetLocalInt(oMod, "d5");
|
||||
int nInt6=GetLocalInt(oMod, "d4");
|
||||
int oKil = GetLocalInt(oPC, "iKilled");
|
||||
int iMode = GetLocalInt(oMod, "gamemode");
|
||||
object oP1 = GetObjectByTag("pool1");
|
||||
object oP2 = GetObjectByTag("pool2");
|
||||
object oP3 = GetObjectByTag("fountain1");
|
||||
object oP4 = GetObjectByTag("fountain2");
|
||||
object oLever1 = GetObjectByTag("pool_lever");
|
||||
object oLever2 = GetObjectByTag("fount_lever");
|
||||
object oSpawner = GetObjectByTag("spawner");
|
||||
effect eEffect = EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY);
|
||||
|
||||
SetLocalInt(oMod, "sw_mb", 0);
|
||||
SetLocalInt(oMod, "ch_mb", 0);
|
||||
|
||||
if (oExploit!=1)
|
||||
{
|
||||
LastHit();
|
||||
oKil = oKil +1;
|
||||
SetLocalInt(oPC, "iKilled", oKil);
|
||||
if (nInt2==1)
|
||||
{
|
||||
QuickRestore(oPC);
|
||||
DelayCommand(2.0, FloatingTextStringOnCreature("W I N N E R", oPC));
|
||||
|
||||
AssignCommand(oSpawner, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
SetLocalInt(oPC, "marilithdead", 1);
|
||||
oKil = oKil +1;
|
||||
SetLocalInt(oPC, "iKilled", oKil);
|
||||
SetLocked(GetObjectByTag("arena_gate"), FALSE);
|
||||
SetLocalInt(oMod, "challenge",0);
|
||||
if (iMode==1)
|
||||
{AddJournalQuestEntry("boss2_0", 1, oPC, FALSE, FALSE);}
|
||||
else{AddJournalQuestEntry("boss2", 1, oPC, FALSE, FALSE);}
|
||||
SetLocalInt(oMod, "d1_complete", 1);
|
||||
SetLocalInt(oPC, "cutscene_on", 1);
|
||||
SetLocalInt(oMod, "cutscene_flag", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((nInt1==1)||(nInt4==1)||(nInt5==1)||(nInt6==1)||(nInt3==1))
|
||||
{
|
||||
if (oExploit!=1)
|
||||
{
|
||||
int oGameMode = GetLocalInt(oMod, "gamemode");
|
||||
if (oGameMode==1)
|
||||
{
|
||||
DelayCommand( 9.8, spawner (oPC, "boss002", 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
DelayCommand( 9.8, spawner (oPC, "boss1", 0));
|
||||
}
|
||||
GetRank(oPC);
|
||||
DeathStats(oPC);
|
||||
if ((nInt3!=1)&&(nInt5!=1)&&(nInt6!=1))
|
||||
{BattleRest(oPC);}
|
||||
DoEffect(9.8,VFX_FNF_PWKILL, "monster_wp");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
//Get the spell target location as opposed to the spell target.
|
||||
location lTarget = GetLocation(OBJECT_SELF);
|
||||
//Limit Caster level for the purposes of damage
|
||||
//Apply the fireball explosion at the location captured above.
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL));
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget, FloatToInt(fDelay)))
|
||||
{
|
||||
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = PRCGetReflexAdjustedDamage(50, oTarget, PRCGetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
|
||||
//Set the damage effect
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
//This visual effect is applied to the target object not the location as above. This visual effect
|
||||
//represents the flame that erupts on the target not on the ground.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user