I’m really loving making spells.
I just put together another spell. A spell called: “Obscurement”
The goal is to cause a (Thick) cloud around the caster to hide him (and his party if he has one). Enemies entering it would become blinded. So it effects enemies but not caster and friends (party and familiars and henchmen).
I got most of the spell VFX effects done in the script that compiles (yay!!) but not how to script the blindness for enemies. The cloud I took from the cloud of bewilderment and I put a placeable cloud of dust too. Please take a look at the spell below. Try it out too. I really would like to make the cloud so thick no one can see people inside it. Can I double the cloud effect to make it thicker?
//A mix of the spell cloud of bewilderment and another spell obscurement. Trying to improve a spell
//of Obscurement so itmakes a cloud and the caster and party hide in it. Those outside of
// caster and party entering it will be blinded. That is the pupose of ths spell.
#include “NW_I0_SPELLS”
#include “x0_i0_spells”
#include “x2_inc_spellhook”
void main()
{
DeleteLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”);
SetLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”, SPELL_SCHOOL_CONJURATION);
/*
Spellcast Hook Code
Added 2003-07-07 by Georg Zoeller
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;
}
//Declare major variables
effect eAOE = EffectAreaOfEffect(39);
location lTarget = GetSpellTargetLocation();
int nDuration = (GetCasterLevel(OBJECT_SELF)+ GetChangesToCasterLevel(OBJECT_SELF));
effect eImpact = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
if (nDuration < 1)
{
nDuration = 1;
}
int nMetaMagic = GetMetaMagicFeat();
//Make metamagic check for extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Create the AOE object at the selected location
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
{
DeleteLocalInt(OBJECT_SELF, “X2_L_LAST_SPELLSCHOOL_VAR”);
// Erasing the variable used to store the spell’s spell school
}
location lPC = GetLocation(OBJECT_SELF);
object oArea = GetArea(OBJECT_SELF);
int nObjectType = OBJECT_TYPE_PLACEABLE;
string strTemplate = "plc_dustplume"; // Standard chicken
int bUseAppearAnimation = TRUE;
object OM = CreateObject(nObjectType, strTemplate, lPC, bUseAppearAnimation);
DelayCommand(60.0, DestroyObject(OM));
int i;
int pn;
int iFace;
vector vOM1;
while (i < 20)
{
pn = d4();
vOM1 = GetPosition(OM);
switch (pn)
{
case 1:
vOM1.x += IntToFloat(d4());
vOM1.y += IntToFloat(d4());
break;
case 2:
vOM1.x -= IntToFloat(d4());
vOM1.y += IntToFloat(d4());
break;
case 3:
vOM1.x += IntToFloat(d4());
vOM1.y -= IntToFloat(d4());
break;
case 4:
vOM1.x -= IntToFloat(d4());
vOM1.y -= IntToFloat(d4());
break;
}
iFace = d100();
location lPC1 = Location(oArea, vOM1, IntToFloat(iFace));
object OM1 = CreateObject(nObjectType, strTemplate, lPC1, bUseAppearAnimation);
DelayCommand(60.0, DestroyObject(OM1));
i++;
}
SendMessageToAllDMs("Obscuring Mist was cast by "+GetPCPlayerName(OBJECT_SELF)+".");
}