Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
114
_removed/x2_s0_balllghtng.nss
Normal file
114
_removed/x2_s0_balllghtng.nss
Normal file
@@ -0,0 +1,114 @@
|
||||
///::///////////////////////////////////////////////
|
||||
//:: Isaacs Lesser Missile Storm
|
||||
//:: x0_s0_MissStorm1
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Up to 10 missiles, each doing 1d6 damage to all
|
||||
targets in area.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: July 31, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By:
|
||||
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
//SpawnScriptDebugger(); 503
|
||||
// DoMissileStorm(1, 15, GetSpellId(), 503,VFX_IMP_LIGHTNING_S ,DAMAGE_TYPE_ELECTRICAL );
|
||||
|
||||
int nD6Dice = 15; int nCap=1; int nSpell=GetSpellId(); int nMIRV = 503;
|
||||
int nVIS = VFX_FNF_ELECTRIC_EXPLOSION; int nDAMAGETYPE = DAMAGE_TYPE_ELECTRICAL;
|
||||
int nONEHIT = FALSE;
|
||||
|
||||
object oTarget = OBJECT_INVALID;
|
||||
int nCasterLvl = GetCasterLevel(OBJECT_SELF);
|
||||
int nDamage = 0;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
int nCnt = 1;
|
||||
effect eMissile = EffectVisualEffect(nMIRV);
|
||||
effect eVis = EffectVisualEffect(nVIS);
|
||||
float fDist = 0.0;
|
||||
float fDelay = 0.0;
|
||||
float fDelay2, fTime;
|
||||
location lTarget = GetSpellTargetLocation(); // missile spread centered around caster
|
||||
|
||||
|
||||
|
||||
int nEnemies = 0;
|
||||
|
||||
oTarget = GetSpellTargetObject();
|
||||
// * caster cannot be harmed by this spell
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && (oTarget != OBJECT_SELF))
|
||||
{
|
||||
// GZ: You can only fire missiles on visible targets
|
||||
if (GetObjectSeen(oTarget,OBJECT_SELF))
|
||||
{
|
||||
nEnemies++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nEnemies == 0) return; // * Exit if no enemies to hit
|
||||
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpell));
|
||||
|
||||
// * recalculate appropriate distances
|
||||
fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
|
||||
fDelay = fDist/(3.0 * log(fDist) + 2.0);
|
||||
|
||||
|
||||
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
|
||||
{
|
||||
|
||||
|
||||
int nDam = d6(nD6Dice);
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic == METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDam = nD6Dice*6;//Damage is at max
|
||||
}
|
||||
if (nMetaMagic == METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDam = nDam + nDam/2; //Damage/Healing is +50%
|
||||
}
|
||||
fTime = fDelay;
|
||||
fDelay2 += 0.1;
|
||||
fTime += fDelay2;
|
||||
|
||||
//Set damage effect
|
||||
effect eDam = EffectDamage(nDam, nDAMAGETYPE);
|
||||
//Apply the MIRV and damage effect
|
||||
DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget));
|
||||
DelayCommand(fDelay2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget));
|
||||
DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
|
||||
}
|
||||
else
|
||||
{ // * apply a dummy visual effect
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user