Author Topic: Turn Undead script  (Read 323 times)

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Turn Undead script
« on: November 14, 2014, 09:51:15 pm »


               

Forgive me this is probably really, really wrong. I was hoping to get some help with this.

This is my custom turn undead spell I have been working on. Basically what I’m trying to do is apply damage to the undead. The Damage increases by 5 each level for the cleric. So at level one it does 5 damage, at level two it does 10 at third level 15 so on and so on up to level 20. It stops at 20 because that is the max level for my server. There is no multi-classing on the server as well so I don’t think I need to check for cleric position.  Also I can’t for the life of me figure out how this script is called from. Usually a script is called from on enter or an item or something. So I know this wrong in my script.


Any help with this would be greatly appreciated.




void main()
{

object A = GetFirstPC();
object B = GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,A);
SignalEvent(A, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));// not sure what this even does or whats its used for.But I saw it in the original turn undead script.

int P = GetHitDice( A);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(285), A);

if  (P == 1)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(5 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);

}

if (P == 2)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(10 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);

}

if (P == 3)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(15 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 4)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(20 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 5)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(25 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 6)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(30 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 7)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(35 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 8)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(40 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 9)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(45 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 10)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(50 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 11)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(55 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 12)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(60 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 13)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(65 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 14)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(70 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 15)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(75 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 16)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(80 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 17)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(85 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 18)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(90 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 19)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(95 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}

if (P == 20)
{

location lTarget = GetLocation(B);
B = GetFirstObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE/*you can put a number here too, like 12.0 or whatever*/,
lTarget,FALSE,OBJECT_TYPE_CREATURE);

//Loop thru all CREATURE-type targets in a sphere with radius size HUGE
while(GetIsObjectValid(B))
{
if (GetIsEnemy(B, A))    AssignCommand(A,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(100 ,DAMAGE_TYPE_DIVINE),B,0.0));
if (GetIsEnemy(B, A))    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(50), B);

  B = GetNextObjectInShape(SHAPE_SPHERE,RADIUS_SIZE_LARGE,lTarget,FALSE,OBJECT_TYPE_CREATURE);


}
}}}}}}}}}}}}}}}}}}}}}


               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Turn Undead script
« Reply #1 on: November 14, 2014, 11:03:34 pm »


               

The script for turn undead is specified in spells.2da as nw_s2_turndead.nss.   You probably want to start with that.  If you want I pulled together one that does basically what you are asking for. It does 5*level damage to each undead/planar creature within meters of the target location.  It counts blackguard and paladin level the same as the original but does not do any of the bonuses for domains or anything. It compiles but I have not tested it in game. If you copy it into your module (as nw_s2_turndead.nss) and compile it, it should do basically what you want. It may be pretty powerful as is, with the range set to 20.0 meters.


Edit: added missing event cast at line.



//::///////////////////////////////////////////////
//:: Turn Undead
//:: NW_S2_TurnDead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Checks domain powers and class to determine
    the proper turning abilities of the casting
    character.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 2, 2001
//:: Updated On: Jul 15, 2003 - Georg Zoeller
//:://////////////////////////////////////////////
//:: MODIFIED MARCH 5 2003 for Blackguards
//:: MODIFIED JULY 24 2003 for Planar Turning to include turn resistance hd
//:: modified by meaglyn for surek to do 5 * level (max level 20) point of damage to all undead in range.

void main()
{
    int nClericLevel = GetLevelByClass(CLASS_TYPE_CLERIC);
    int nPaladinLevel = GetLevelByClass(CLASS_TYPE_PALADIN);
    int nBlackguardlevel = GetLevelByClass(CLASS_TYPE_BLACKGUARD);
    location lTarget = GetSpellTargetLocation();
    int nClassLevel = nClericLevel;
    int nRacial;
    float fDelay;

    // GZ: Since paladin levels stack when turning, blackguard levels should stack as well
    // GZ: but not with the paladin levels (thus else if).
    if((nBlackguardlevel - 2) > 0 && (nBlackguardlevel > nPaladinLevel))
    {
        nClassLevel += (nBlackguardlevel - 2);
    }
    else if((nPaladinLevel - 2) > 0)
    {
        nClassLevel += (nPaladinLevel -2);
    }

    if (nClassLevel > 20) nClassLevel = 20;
    int nDamage = 5 * nClassLevel;
    effect eDamage = EffectDamage(nDamage);
    effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);

    effect eImpactVis = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpactVis, GetLocation(OBJECT_SELF));

    //Get nearest enemy within 20m (60ft)  
    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, lTarget, TRUE, OBJECT_TYPE_CREATURE);
    while(GetIsObjectValid(oTarget))
    {
        if(!GetIsFriend(oTarget))
        {
            nRacial = GetRacialType(oTarget);
       if (nRacial ==  RACIAL_TYPE_OUTSIDER || nRacial == RACIAL_TYPE_UNDEAD {
                    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
          fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
          DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
          DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
       }
        }
        oTarget =  GetNextObjectInShape(SHAPE_SPHERE, 20.0, lTarget, TRUE, OBJECT_TYPE_CREATURE);
    }
}



               
               

               
            

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Turn Undead script
« Reply #2 on: November 14, 2014, 11:21:42 pm »


               

Thank you Meaglyn. It works just how I wanted it to, many many thanks.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Turn Undead script
« Reply #3 on: November 15, 2014, 12:33:55 am »


               

You're welcome. I just noticed I left out the event... You probably want to add this line somewhere in the inner if, like right before the "fdelay = ":



SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));

               
               

               
            

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Turn Undead script
« Reply #4 on: November 15, 2014, 01:39:39 am »


               

I'f you don't mind me asking. What is this event for?  what is its purpose? I looked in the lexicon but was still confused on what it does.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Turn Undead script
« Reply #5 on: November 15, 2014, 02:38:18 am »


               

It's signaling an event to the target object. The event it's using in this case is SpellCastAt so that the target object's OnSpellCastAt script fires. This commonly allows for a reaction to being targeted by hostile spells. Typically for creature's that's nw_c2_defaultb.nss.