Changed folder name.
Changed folder name.
This commit is contained in:
38
_module/nss/dtrig4.nss
Normal file
38
_module/nss/dtrig4.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
void main()
|
||||
{
|
||||
if(GetIsPC(GetEnteringObject()) && !GetIsDM(GetEnteringObject()) )
|
||||
{
|
||||
object defender = GetObjectByTag("Defender4");
|
||||
location lDefender = GetLocation(GetObjectByTag("Defender4")); // Defender will be our spellcaster.
|
||||
object oTarget = GetNearestCreatureToLocation // Find Creature ...
|
||||
( // ...which is...
|
||||
CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC, // (Undead)
|
||||
lDefender,1, // (1st Closest to Defender object)
|
||||
CREATURE_TYPE_IS_ALIVE,TRUE // (Still 'alive')
|
||||
);
|
||||
if (GetIsObjectValid(oTarget) && (GetDistanceBetween(OBJECT_SELF,oTarget) < 75.0 ))
|
||||
{
|
||||
// Proceed to launch an attack - there is a valid target in range.
|
||||
int iSpellToUse;
|
||||
string sSpellName;
|
||||
switch (d6())
|
||||
{
|
||||
// randomly pick a spell to cast at the oTarget
|
||||
case 1: iSpellToUse = SPELL_NEGATIVE_ENERGY_BURST; break;
|
||||
case 2: iSpellToUse = SPELL_ICE_STORM; break;
|
||||
case 3: iSpellToUse = SPELL_HORRID_WILTING; break;
|
||||
case 4: iSpellToUse = SPELL_DELAYED_BLAST_FIREBALL; break;
|
||||
case 5: iSpellToUse = SPELL_CHAIN_LIGHTNING; break;
|
||||
case 6: iSpellToUse = SPELL_MORDENKAINENS_DISJUNCTION; break;
|
||||
}
|
||||
// Make "Defender" cast spell instantly, regardless of whether "Defender" object can legally cast the spell.
|
||||
// Debugging Message
|
||||
AssignCommand(
|
||||
defender,
|
||||
ActionCastSpellAtObject(iSpellToUse,oTarget,METAMAGIC_MAXIMIZE,TRUE,40,PROJECTILE_PATH_TYPE_HOMING,TRUE)
|
||||
);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect( VFX_FNF_SUMMON_MONSTER_3),defender, 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user