Author Topic: How to change the creature created by Placeable "Zombie Corpose"?  (Read 312 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

I tried to change sCreature variable to my creature blueprint, but it return the default zombie.


 


nw_o2_zombie



//::///////////////////////////////////////////////
//:: NW_O2_ZOMBIE.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
   Turns the placeable into a zombie
   if a player comes near enough.
*/
//:://////////////////////////////////////////////
//:: Created By:   Brent
//:: Created On:   January 17, 2002
//:://////////////////////////////////////////////
/*
Patch 1.71

- total rewrite from efficiency reasons - will use AOE instead of heartbeat
- spawn animation improved
*/

void main()
{
   if(GetObjectType(OBJECT_SELF) == OBJECT_TYPE_PLACEABLE)
   {
       location lLoc = GetLocation(OBJECT_SELF);
       object oNew = CreateObject(OBJECT_TYPE_PLACEABLE,"70_pl_zombie",lLoc,FALSE,GetTag(OBJECT_SELF));
       ApplyEffectAtLocation(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectAreaOfEffect(AOE_MOB_HORRIFICAPPEARANCE,"nw_o2_zombie","nw_o2_zombie","nw_o2_zombie")),lLoc);
       object oAOE = GetNearestObjectByTag("VFX_MOB_HORRIFICAPPEARANCE",oNew);
       SetLocalInt(oAOE,"X1_L_IMMUNE_TO_DISPEL",10);
       SetLocalObject(oAOE,"PLACEABLE",oNew);
       DestroyObject(OBJECT_SELF);
   }
   else if(!GetLocalInt(OBJECT_SELF,"DO_ONCE"))
   {
       object oCreature = GetEnteringObject();
       if(GetIsPC(oCreature) || GetIsPossessedFamiliar(oCreature))
       {
           effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
           string sCreature = "NW_ZOMBWARR01";
           // * 10% chance of a zombie lord instead
           if (Random(100) > 90)
           {
               sCreature = "NW_ZOMBIEBOSS";
           }
           object oMonster = CreateObject(OBJECT_TYPE_CREATURE, sCreature, GetLocation(OBJECT_SELF));
           AssignCommand(oMonster, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 2.0));
           ApplyEffectToObject(DURATION_TYPE_INSTANT, eMind, oMonster);
           SetPlotFlag(OBJECT_SELF, FALSE);
           DestroyObject(OBJECT_SELF);
           object oSource = GetLocalObject(OBJECT_SELF,"PLACEABLE");
           DestroyObject(oSource);
           SetLocalInt(OBJECT_SELF,"DO_ONCE",TRUE);
       }
   }
}


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
How to change the creature created by Placeable "Zombie Corpose"?
« Reply #1 on: June 20, 2014, 06:15:55 pm »


               

Considering that script spawns Zombie Warriors and Zombie Lords apparently, if you're getting the default zombie then maybe it's another script entirely.  What's the blueprint of the default zombie?



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
How to change the creature created by Placeable "Zombie Corpose"?
« Reply #2 on: June 20, 2014, 06:30:22 pm »


               

I have a version somewhere that uses a variable stored on the placeable to store the resref of the creature that spawns. I'll see if I can find it.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
How to change the creature created by Placeable "Zombie Corpose"?
« Reply #3 on: June 20, 2014, 07:53:07 pm »


               

Here is something that I put together for these kinds of critters.


 


and just in case it is not clear… you can use local variables to specify the spawn using that stuff i did.