Author Topic: unkillable untill you break it...  (Read 1204 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
unkillable untill you break it...
« on: May 22, 2016, 07:11:41 am »


               

okay I wanted to poke your brains to see what would be the best way to do this... I am working on a quest where the vilain of the quest is basically unkillable untill you destroy 3 placeable before you can kill the monster.


 


thanks for your input! '<img'>



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
unkillable untill you break it...
« Reply #1 on: May 22, 2016, 10:13:30 am »


               If you don't need the monster to engage in combat until it can be killed, the simplest way is to set its plot flag. However, that changes combat behaviour, so some minor AI tweaking is necessary if the monster is a combatant.

Alternatively, you can make the monster immortal, if you don't mind that it can take damage but never goes below 1 HP. SetImmortal can be used to make the monster mortal once the placeables are destroyed.

To make the monster invulnerable, with a little more work, you can use a skin or EffectImmunity to make it immune to everything.

You'll probably want to use an aura or other clue to tell the player when the monster has ceased to be invulnerable.
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
unkillable untill you break it...
« Reply #2 on: May 22, 2016, 03:28:56 pm »


               

well basically the plan was that you have to fight it, find out it is unkillable and  you basically have to fend him of as you destroy the placeables that protect him



               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
unkillable untill you break it...
« Reply #3 on: May 22, 2016, 07:10:37 pm »


               

You could make it more dramatic to have the creature creature immune to any spell/ability etc that can kill him and just have a heal spell auto cast at any point the creature takes x amount of damage....have a text string speech where the creature laughs and states how thy are immortal and include a clue as to where or what the PC needs to do to counteract the bosses immortality......As the PC distroys the objects, have a vaiarble set to disable the immunity's you have set of the baddy bad thing.



               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
unkillable untill you break it...
« Reply #4 on: May 22, 2016, 09:46:44 pm »


               


You could make it more dramatic to have the creature creature immune to any spell/ability etc that can kill him and just have a heal spell auto cast at any point the creature takes x amount of damage....have a text string speech where the creature laughs and states how thy are immortal and include a clue as to where or what the PC needs to do to counteract the bosses immortality......As the PC distroys the objects, have a vaiarble set to disable the immunity's you have set of the baddy bad thing.




  As an extension to that line of thinking, you could even have the placeable fire a beam to the boss when it heals it, so there's a very distinct visual clue as to what to destroy.


 Just making it immune to everything, but not plot/immortal, isn't enough.  Divine might, if your module has it, bypasses all immunities and resistances, so PCs using that to damage otherwise unhurtable creatures always has to be considered, thus the need to heal if that method is used.


               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
unkillable untill you break it...
« Reply #5 on: May 23, 2016, 04:12:06 am »


               


  As an extension to that line of thinking, you could even have the placeable fire a beam to the boss when it heals it, so there's a very distinct visual clue as to what to destroy.


 Just making it immune to everything, but not plot/immortal, isn't enough.  Divine might, if your module has it, bypasses all immunities and resistances, so PCs using that to damage otherwise unhurtable creatures always has to be considered, thus the need to heal if that method is used.




*In a slippery voice.......Ya, that's it Yaaaaa


Lol. Me likey it.


 


Any way, firing a beam at the boss is doable, but might require a more complicated script that will require current location and vectors of the boss and finding an effect that you can fire at the boss that would look right. A simpler tack might be to have a heal visual effect happen on the placeable objects at the same time as on the boss.



               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
unkillable untill you break it...
« Reply #6 on: May 23, 2016, 06:23:07 am »


               

Had a post typed and lost it...  here's the less cool version of it:


 


 


I have these lines in my OnSpawn Event for NPCs



    if( GetLocalInt(OBJECT_SELF,"ODE") == 1 )
    {
       SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);
    }
 
    if( GetLocalInt(OBJECT_SELF,"ECRE") == 1 )
    {
        SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT);
    }

If I want a NPC to do something when they are damaged or at the end of a combat roud I set ODE|Int|1 or ECRE|Int|1 in their variables.  


 


Then in the OnUserDefined script under the corresponding event section you can do pretty much anything you want. Some of my NPCs say things at the end of rounds to drive the plot or berate and belittle the player, some get a second wind (i.e. buffs before they die), some call for help spawning other NPCs to aid them, one runs to the nearest cocoon and breaks it open releasing a swarm of little spiders.  I have a few NPCs who are possessed and when they die their possessor is exposed leading to a new opponent.


 


I wrote this up (no testing), but it could work to set your NPC immortal if you put the correct TAGs in the script.  



//For example: under the ON_COMBAT_ROUND_EVENT of the OnUserDefined script
 
//If the NPC running this code has the tag unkillable_dude
if( GetTag(OBJECT_SELF) == "unkillable_dude" )
{
    //Let's get the int we stored the first end of round to see how many valid
    //placeables there were in our area that make us immortal
    int x = GetLocalInt(OBJECT_SELF,"placeable_valid");
 
    //If we found at least one placeable making us immortal then go thru the
    //stored objects and see if they are still valid.  If so, make sure we're still
    //immortal.
    if( x >= 1 )
    {
        int i, bValid = FALSE;
 
        for( i=x; i>0; i-- )
        {
            if( GetIsObjectValid(GetLocalObject(OBJECT_SELF,"UDP_"+IntToString(i))) )
            {
                //As soon as we find a valid object exit the for-loop and set us as immortal
                bValid = TRUE;
                break;
            }
         }  
            if( bValid && !GetImmortal(OBJECT_SELF) )
            {
                SetImmortal(OBJECT_SELF,TRUE);
            }
            //This is to ensure we don't end up an unkillable NPC somehow
            if( !bValid ) SetImmortal(OBJECT_SELF,FALSE);
    }
    //At the end of the first round it's going to loop thru all objects in the area
    //and find those with the tag unkillable_dudes_placeable. We'll set each one
    //we find on the NPC so next time we can just check if each of those is valid
    //without having to search thru every object in the area each time.
    else
    {
        x = 0;
        object oArea = GetArea(OBJECT_SELF);
        object o = GetFirstObjectInArea(oArea);
 
        while( GetIsObjectValid(o) )
        {
            if( GetTag(o) == "unkillable_dudes_placeable" )
            {
                x++;
                SetLocalObject(OBJECT_SELF,"UDP_"+IntToString(x),o);
                SetLocalInt(OBJECT_SELF,"placeable_valid",x);
            }
        o = GetNextObjectInArea(oArea);
        }
    }
}

VFX (beams) could be added.


The placeables themselves could have multifiring traps set on them and explode when destroyed.


 


You would likely need a script OnAreaEnter that checks if the placeables are there or not and creates them if they aren't.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
unkillable untill you break it...
« Reply #7 on: May 25, 2016, 03:45:49 pm »


               

Did a variation of this for one of my bosses.


The boss was a God, who had a large arena around him - and there was around 5 placeables buzzing with elemental energy.


The players had to run to each of the placeables, turn them off, to make the God vulnerable to one or two elements associated with that placeable.


Eg: The Wrath placeable would make him vulnerable to Fire, Acid and Slashing Damage.


 


However, the trick here was that the placeables reactivate themselves after 60 seconds - meaning the player has to spread their time over damage to the God, but also watching for the placeables reactivating.


When they reactivate - the God basically becomes invulnerable again. Makes the boss battle very hard to complete for a solo player.


 


However to achieve this - I had to use the onDamage Hook I made for nwnx - allowed me to set damage values to 0 when placeables were active etc.


 


Yeah - use Immortal - if you want the boss to be damageable but unkillable


         - use plot - if you want to be invulnerable to harm and death.


 


You need to use at least one of these to prevent instant death effects from killing your boss.