Badlands Action
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Dedication to Action and fun.
 
HomeLatest imagesSearchRegisterLog in

 

 badlands darkness

Go down 
2 posters
AuthorMessage
lolthatguy

lolthatguy


Posts : 293
Join date : 2013-05-05
Age : 29
Location : larry town

badlands darkness Empty
PostSubject: badlands darkness   badlands darkness EmptyMon Jul 27, 2015 7:09 pm

yo, highv, could you post your altered darkness spell script here so I can play test with it? It seems like darkness gets treated differently on my mod, but I dunno why.
Back to top Go down
Highv Priest
Admin
Highv Priest


Posts : 642
Join date : 2012-09-13

badlands darkness Empty
PostSubject: Re: badlands darkness   badlands darkness EmptyWed Jul 29, 2015 11:14 pm

Script = nw_s0_darknessa


//::///////////////////////////////////////////////
//:: Darkness: On Enter
//:: NW_S0_DarknessA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a globe of darkness around those in the area
of effect.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Feb 28, 2002
//:://////////////////////////////////////////////
#include "x0_i0_spells"
#include "x2_inc_spellhook"

void main()
{
int nMetaMagic = GetMetaMagicFeat();
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_DARKNESS);
effect eDark = EffectBlindness();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eDark, eDur);
eLink = EffectLinkEffects(eLink, eInvis);
effect eLink2 = EffectLinkEffects(eInvis, eDur);

int nDuration = GetCasterLevel(OBJECT_SELF);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
object oTarget = GetEnteringObject();

// * July 2003: If has darkness then do not put it on it again
if (GetHasEffect(EFFECT_TYPE_DARKNESS, oTarget) == TRUE)
{
return;
}
if(GetHasEffect(EFFECT_TYPE_ULTRAVISION, oTarget) == TRUE)
{
return;
}
if(GetHasEffect(EFFECT_TYPE_TRUESEEING, oTarget) == TRUE)
{
return;
}
if(GetItemHasItemProperty(GetItemInSlot(INVENTORY_SLOT_CARMOUR, oTarget), ITEM_PROPERTY_TRUE_SEEING))
{
return;
}
if(GetLocalInt(oTarget, "DARKVISION"))
{
return;
}

if(GetIsObjectValid(oTarget) && oTarget != GetAreaOfEffectCreator())
{
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetEffectSpellId(eLink)));
}
else
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetEffectSpellId(eLink), FALSE));
}
// Creatures immune to the darkness spell are not affected.
if ( ResistSpell(OBJECT_SELF,oTarget) != 2 )
{
//Fire cast spell at event for the specified target
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
}
}
else if (oTarget == GetAreaOfEffectCreator())
{
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetEffectSpellId(eLink), FALSE));
// Creatures immune to the darkness spell are not affected.
if ( ResistSpell(OBJECT_SELF,oTarget) != 2 )
{
//Fire cast spell at event for the specified target
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget);
}
}
}
Back to top Go down
https://badlandsaction.forumotion.com
 
badlands darkness
Back to top 
Page 1 of 1
 Similar topics
-
» Darkness Modifications

Permissions in this forum:You cannot reply to topics in this forum
Badlands Action :: Talking about nwn :: Q&A-
Jump to: