Author Topic: Creation of a Boss  (Read 369 times)

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« on: September 30, 2010, 01:03:05 am »


               As said and not to mess up the other thread, I'll put this on an extra one so it's easier to read through:

I'm in the middle of the creation of a new boss for our server and this is what I want her to be like (she's a Demi-goddess anyways which explains her powers there):


* The Boss is spawned by a trigger at the start of the level (actually might place the trigger on "OnEnter" of the
room she's in), naturally

* have stages of combat during which she'll change immunities, damage types she uses and resistances, also spawning 2 associates every two minutes (next 2 only if those that are still present have been slain) and I don't want her to be able to die with the associates still spawned (she can be hurt, but won't die, like leaving her at a certain amount of HP until players kill the associates - then they'll have 2 minutes to kill her off . If failing, she'll spawn again 2 associates and players will have to try time it again)

* fight will be on a round
platform (you know the tile with the invisible bridge) and I want her
and her associates NOT to follow players away from the platform (make
her not lureable)



Her Abilities should be something like this:

* call in 2 more associates every 2 min if the first ones have been slain

* Stages of Combat should be something like this (I appreciate other ideas of you guys as well if you have just suggest)

Stage 1 (change  visual (let's call it VIS 1) , high melee resistances, only truely damageable by Clerics, Mages, Sorcs)

Stage 2 (change visual again, high magical resistances, only truely damageable by melee weapons)

Stage
3 (again change to another form and causing visual effects randomly go off in a
sphere around her if possible every few combat rounds, for
example the "mystical explosion", while trying to keep any magician wizs
and sorcs busy or if in range of touch attack of those trying to stun one of them (no save) then hurrying back to
attack the melees with her own melee (2-h-axe)

Stage 4 (visual change to her true form,
pulling ALL players close to her and knocking them down, then pushing
them away so they are "sent flying off the platform" (porting them to random places in the room, maybe 4 diferent options on that)  and would have to
run back to her to face her again. In this form have 50% immunity to
every damage type)


HUGE Question is:
Is all of that
possible without a heartbeat?
Or at least, only a heartbeat that fires
while in combat mode, so the server doesn't get stressed too much? And
would someone be willing to script that?
I'd would be really happy if
someone could help me out there...




This is what I go so far from TERRORBLE here:

Terrorble wrote...

DM-Chemosh wrote...

* The Boss is spawned by a trigger at the start of the level, naturally

Make
an encounter that fires once or however you want, put it down. 
Right-click the encounter area to set a spawn point.  Move that spawn
point to where you want the boss to be.

*
She should say a few 5 sentences to the players (in which time I want
them to not be able to attack her!), then spawn 2 associates I made and
allow players to attack her.

* fight will be on a round platform
(you know the tile with the invisible bridge) and I want her and her
associates NOT to follow players away from the platform (make her not
lureable)


In the properties of the boss, you'll
have to make a custom script for the OnSpawn event (i.e. edit the
existing one, just give it a new name when you save it and only use it
for that boss version)  You'd need to add something like this
within that script:


**these next 4 lines need to go at the
very top of the OnSpawn script right after the #include statements and
before the void main().  We need to use this non-standard function
later, so we have to define it first.
void CreateObjectVoid(int nObjectType, string sTemplate, location lLoc, int bUseAppearAnimation = FALSE)
{
    CreateObject(nObjectType, sTemplate, lLoc, bUseAppearAnimation);
}

//put all this next stuff right after the void main() {
object oArea = GetArea(OBJECT_SELF);  //determines the area the boss that just spawned is in
string sAreaTag = GetTag(oArea);
//create an effect that we can apply to PC/NPCs so they can't do anything while the boss is talking to them
effect eNoMove = EffectCutSceneParalyze();  //or maybe EffectCutSceneDominated();
object oTarget = GetFirstObjectInArea(oArea);  //Get the first thing in the area
while(
GetIsObjectValid(oTarget) )  //start a loop that will cycle thru all
objects in the area until it runs out of valid things to check
{
//if the thing we're looking at is a creature then...
if( GetObjectType(oTarget) == OBJECT_TYPE_CREATURE )
{
    //Freeze the object for 40.0 seconds with the paralyze or dominated effect we made
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNoMove, oTarget, 40.0);
}
//cycle to next object in the area and do the same thing
oTarget = GetNextObjectInArea(oArea);
}
//set up a few lines for our actress to spout off before annhiliating your players.  add more as you like
string sBossChatter1 = "I are going to pwn you.";
string sBossChatter2 = "Look 'round you, this be your eternal resting place.  Like it?";
string sBossChatter3 = "'nuf talk, it's dying time!";
string sBossChatter4 = "Oh and where are my cronies...";

//Recite the lines at 5, 15, 25 and 35 second intervals.  Hopefully the players are close enough to hear/see them
//Remember we froze everyone in place for 40seconds
DelayCommand(5.0, SpeakString(sBossChatter1, TALKVOLUME_TALK));
DelayCommand(15.0, SpeakString(sBossChatter2, TALKVOLUME_TALK));
DelayCommand(25.0, SpeakString(sBossChatter3, TALKVOLUME_TALK));
DelayCommand(35.0, SpeakString(sBossChatter4, TALKVOLUME_TALK));

//You'll have to put down 2 waypoints where you want the "associates" to be.  Their tags need to be: cronie_WP1 and 2
object oWP1 = GetNearestObjectByTag("cronie_WP1");
object oWP2 = GetNearestObjectByTag("cronie_WP2");
//Now that we have the WPs, get their locations so we can create the "associates" there
location locWP1 = GetLocation(oWP1);
location locWP2 = GetLocation(oWP2);
//After 36 seconds, create the associates at their respective waypoints.
//In this case, the associates' blueprint resrefs are "cronie1" and "cronie2"
DelayCommand(36.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "cronie1", locWP1));
DelayCommand(36.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "cronie2", locWP2));

**This
previous part has a few limitations:  as soon as the boss spawns, it
freezes everyone.  So the encouter will need to be small-ish and very
close to where the boss spawns.  There are other ways to do this so that
the boss is already there, then the players are frozen just as they
enter a trigger area.  Problem is, if one player is way ahead of the
group, the rest will miss out.  This script will not freeze someone who
enters the area during or after the boss spawns.  The boss will speak
its lines, but only those who are close will see/hear the text (you can
change those lines to use TALKVOLUME_SHOUT to ensure everyone hears it) 
When the boss summons the cronies, I assume that the cronies are
different... and I'm not at my machine to see if this compiles.

Her Abilities should be something like this:
* call in 2 more associates every 2 min if the first ones have been slain
* have stages of combat:


This part goes in the OnSpawn script for each of the associates:

//You need to insert the tag of your boss here.  For every version of this boss you make, keep all the tags identical
object oBoss = GetNearestObjectByTag("tag-of-boss");
//Get the tag of the cronie that this OnSpawn script is running for
sCronieTag = GetTag(OBJECT_SELF);
//Set a variable on the boss, then delete it in 2min to prevent cronies from spawning needlessly
SetLocalInt(oBoss, sCronieTag, TRUE);
DelayCommand(120.0, DeleteLocalInt(oBoss, "Cronie"));


This next long part goes in the OnDamaged script for your boss:

object oSelf = OBJECT_SELF;
//Check and see if it's time to summon new associates
object oCronie;
if( !GetLocalInt(oSelf, "Tag-of-cronie1-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie1-goes-here");
    //if we can't locate cronie1, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie1", locWP1)
    }
}
//Now do the same thing, but check for the 2nd cronie and create it if we can't find it
if( !GetLocalInt(oSelf, "Tag-of-cronie2-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie2-goes-here");
    //if we can't locate cronie2, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie2", locWP2)
    }
}
//Now we see if the boss is damaged enough to enter Stage2
//So
recall that if you want a highly melee resistant stage1, then make the
boss with all resistances how you like it in the palette.
//When the stage1 version reaches <20% total HP it will create the stage2 version which you need to make in the palette
//Determine what percent of your boss's HP are left
float fPercentHP = GetCurrentHitPoints(oSelf)/(GetMaxHitPoints(oSelf);
//if it's less than 20%, let's go to the next stage
if( fPercentHP < 20.0 )
{
    //Pick effects that we can play to make ushering in the next stage a little more exciting
    effect e1 = EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD);
    effect e2 = EffectVisualEffect(VFX_DUR_BLIND);
    effect e3 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
    effect e4 = EffectVisualEffect(VFX_FNF_PWKILL);
    effect e5 = EffectKnockdown();
    //Destroy the stage1 boss version and create stage2 in its place
    location locBoss = GetLocation(oSelf);
    DestroyObject(oSelf);
    CreateObject(OBJECT_TYPE_CREATURE, "blueprint-resref-of-stage2-goes-here", locBoss);
    //Run our visual effects
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e1, locBoss);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e3, locBoss);
    DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    //We're going to knockdown and temporarily blind anything close to the boss
   object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    while( GetIsObjectValid(oTarget) )
    {
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5);
        DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e5, oTarget, 4.0);
    oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    }





So
I've made it a bit further this time... I should've editted my first
post oops.  Hopefully more later.  So far this will get your stage2 boss
in play.  To get later stages I just need to make a modification to
this last segment and probably tell you what to name the blueprint
resrefs for your boss versions.
               
               

               


                     Modifié par DM-Chemosh, 30 septembre 2010 - 01:15 .
                     
                  


            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #1 on: September 30, 2010, 02:17:04 am »


               THANKS so much for all your work thus war, Terror! Amazes me that people are willing to dedicate their free time to help others out here, didn't see much of that on other forums! Could you adjust the script to what I wrote in my thread in here, since I changed some things after I thought about some stuff that one of you other guys brought up (especially with cutscene and stuff which I revised)?

Thanks a looooooot in advance, man!

Here's the edited version:

Her Abilities should be something like this:

* call in 2 more associates every 2 min if the first ones have been slain

* Stages of Combat should be something like this (I appreciate other ideas of you guys as well if you have just suggest)

Stage 1 (change  visual (let's call it VIS 1) , high melee resistances, only truely damageable by Clerics, Mages, Sorcs)

Stage 2 (change visual again, high magical resistances, only truely damageable by melee weapons)

Stage
3 (again change to another form and causing visual effects randomly go off in a
sphere around her if possible every few combat rounds, for
example the "mystical explosion", while trying to keep any magician wizs
and sorcs busy or if in range of touch attack of those trying to stun one of them (no save) then hurrying back to
attack the melees with her own melee (2-h-axe)

Stage 4 (visual change to her true form,
pulling ALL players close to her and knocking them down, then pushing
them
away so they are "sent flying off the platform" (porting them to random
places in the room, maybe 4 diferent options on that)  and would have
to
run back to her to face her again. In this form have 50% immunity to
every damage type)
               
               

               


                     Modifié par DM-Chemosh, 30 septembre 2010 - 01:17 .
                     
                  


            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Creation of a Boss
« Reply #2 on: September 30, 2010, 05:53:55 am »


               It might be a couple days before I get back to this, but in the mean time you should put in what's there so far and see if you can get it to work.



When you say "change visual", do you mean the visual effects that play between stages or the boss's appearance, or an effect on the boss (e.g. glow red, ghost smoke, glow green, etc)?
               
               

               
            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #3 on: September 30, 2010, 03:30:50 pm »


               Actually, I mean the appearance of the boss '<img'> That can be done accompanied by a VFX, though.
               
               

               
            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #4 on: September 30, 2010, 11:50:29 pm »


               There seem to be some errors in that script...


This next long part goes in the OnDamaged script for your boss:

object oSelf = OBJECT_SELF;
//Check and see if it's time to summon new associates
object oCronie;
if( !GetLocalInt(oSelf, "Tag-of-cronie1-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie1-goes-here");
    //if we can't locate cronie1, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie1", locWP1)
    } << no semikolon after expression
}
//Now do the same thing, but check for the 2nd cronie and create it if we can't find it
if( !GetLocalInt(oSelf, "Tag-of-cronie2-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie2-goes-here");
    //if we can't locate cronie2, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie2", locWP2)
    } << no semikolon after expression
}
//Now we see if the boss is damaged enough to enter Stage2
//So recall that if you want a highly melee resistant stage1, then make the boss with all resistances how you like it ///in the palette.//When the stage1 version reaches <20% total HP it will create the stage2 version which you need //to make in the palette
//Determine what percent of your boss's HP are left
float fPercentHP = GetCurrentHitPoints(oSelf)/(GetMaxHitPoints(oSelf); << unknown state in compiler
//if it's less than 20%, let's go to the next stage
if( fPercentHP < 20.0 )
{
    //Pick effects that we can play to make ushering in the next stage a little more exciting
    effect e1 = EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD);
    effect e2 = EffectVisualEffect(VFX_DUR_BLIND);
    effect e3 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
    effect e4 = EffectVisualEffect(VFX_FNF_PWKILL);
    effect e5 = EffectKnockdown();
    //Destroy the stage1 boss version and create stage2 in its place
    location locBoss = GetLocation(oSelf);
    DestroyObject(oSelf);
    CreateObject(OBJECT_TYPE_CREATURE, "blueprint-resref-of-stage2-goes-here", locBoss);
    //Run our visual effects
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e1, locBoss);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e3, locBoss);
    DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    //We're going to knockdown and temporarily blind anything close to the boss
   object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    while( GetIsObjectValid(oTarget) )
    {
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5);
        DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e5, oTarget, 4.0);
    oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    } << unexpected end compound statement

What can I say? I'm a n00b on scripting and don't really know how to fix that...I assume, those semikolons need to be at the end of those lines BEFORE the error (with the cronie WPs), but for the rest...uhm...no idea '<img'>

               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Creation of a Boss
« Reply #5 on: October 01, 2010, 05:49:34 pm »


               I think you don't need the semicolon after "}".  You do need an extra "}" at the end though.  Every { must have a matching }.
               
               

               
            

Legacy_ent.devil

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Creation of a Boss
« Reply #6 on: October 01, 2010, 11:51:33 pm »


               

DM-Chemosh wrote...

There seem to be some errors in that script...


This next long part goes in the OnDamaged script for your boss:

object oSelf = OBJECT_SELF;
//Check and see if it's time to summon new associates
object oCronie;
if( !GetLocalInt(oSelf, "Tag-of-cronie1-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie1-goes-here");
    //if we can't locate cronie1, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie1", locWP1); // semicolon missing
    }
}
//Now do the same thing, but check for the 2nd cronie and create it if we can't find it
if( !GetLocalInt(oSelf, "Tag-of-cronie2-goes-here") )
{
    oCronie = GetNearestObjectByTag( "Tag-of-cronie2-goes-here");
    //if we can't locate cronie2, it must be dead so let's make a new one
    if( GetIsObjectValid(oCronie) == OBJECT_INVALID )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie2", locWP2); // semicolon missing
    }
}
//Now we see if the boss is damaged enough to enter Stage2
//So recall that if you want a highly melee resistant stage1, then make the boss with all resistances how you like it ///in the palette.//When the stage1 version reaches <20% total HP it will create the stage2 version which you need //to make in the palette
//Determine what percent of your boss's HP are left
float fPercentHP = GetCurrentHitPoints(oSelf)/GetMaxHitPoints(oSelf); // had an open brace but not a close
//if it's less than 20%, let's go to the next stage
if( fPercentHP < 20.0 )
{
    //Pick effects that we can play to make ushering in the next stage a little more exciting
    effect e1 = EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD);
    effect e2 = EffectVisualEffect(VFX_DUR_BLIND);
    effect e3 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
    effect e4 = EffectVisualEffect(VFX_FNF_PWKILL);
    effect e5 = EffectKnockdown();
    //Destroy the stage1 boss version and create stage2 in its place
    location locBoss = GetLocation(oSelf);
    DestroyObject(oSelf);
    CreateObject(OBJECT_TYPE_CREATURE, "blueprint-resref-of-stage2-goes-here", locBoss);
    //Run our visual effects
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e1, locBoss);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e3, locBoss);
    DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    //We're going to knockdown and temporarily blind anything close to the boss
   object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    while( GetIsObjectValid(oTarget) )
    {
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5);
        DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e5, oTarget, 4.0);
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    }
} // missing close bracket


Added the missing bits, purely from a syntax point of view not validated the actual code itself.
               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Creation of a Boss
« Reply #7 on: October 01, 2010, 11:57:22 pm »


               << no semicolon after expression = the semi-colon is missing from the line prior to where you inserted this, for example, there should be a semi-colon at the end of the line CreateObject(OBJECT_TYPE_CREATURE, "cronie1", locWP1)



<< unknown state in compiler  = you are trying to get a float type result by dividing one integer into another, you will need to convert the integers into floats first before the division



<< unexpected end compound statement = as stated above, you are missing a closing } somewhere.



My tutorial (linked below in sig) may be of some help, has a section in there on common error messages

               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Creation of a Boss
« Reply #8 on: October 02, 2010, 03:32:26 am »


               

DM-Chemosh wrote...

* The Boss is spawned by a trigger at the start of the level, naturally

Make
an encounter that fires once or however you want, put it down. 
Right-click the encounter area to set a spawn point.  Move that spawn
point to where you want the boss to be.

*
She should say a few 5 sentences to the players (in which time I want
them to not be able to attack her!), then spawn 2 associates I made and
allow players to attack her.

* fight will be on a round platform
(you know the tile with the invisible bridge) and I want her and her
associates NOT to follow players away from the platform (make her not
lureable)


In the properties of the boss, you'll
have to make a custom script for the OnSpawn event (i.e. edit the
existing one, just give it a new name when you save it and only use it
for that boss version)  You'd need to add something like this
within that script:


**these next 4 lines need to go at the
very top of the OnSpawn script right after the #include statements and
before the void main().  We need to use this non-standard function
later, so we have to define it first.
void CreateObjectVoid(int nObjectType, string sTemplate, location lLoc, int bUseAppearAnimation = FALSE)
{
    CreateObject(nObjectType, sTemplate, lLoc, bUseAppearAnimation);
}

//put all this next stuff right after the void main() {
object oArea = GetArea(OBJECT_SELF);  //determines the area the boss that just spawned is in
string sAreaTag = GetTag(oArea);
//create an effect that we can apply to PC/NPCs so they can't do anything while the boss is talking to them
effect eNoMove = EffectCutSceneParalyze();  //or maybe EffectCutSceneDominated();
object oTarget = GetFirstObjectInArea(oArea);  //Get the first thing in the area
while(
GetIsObjectValid(oTarget) )  //start a loop that will cycle thru all
objects in the area until it runs out of valid things to check
{
//if the thing we're looking at is a creature then...
if( GetObjectType(oTarget) == OBJECT_TYPE_CREATURE )
{
    //Freeze the object for 40.0 seconds with the paralyze or dominated effect we made
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNoMove, oTarget, 40.0);
}
//cycle to next object in the area and do the same thing
oTarget = GetNextObjectInArea(oArea);
}
//set up a few lines for our actress to spout off before annhiliating your players.  add more as you like
string sBossChatter1 = "I are going to pwn you.";
string sBossChatter2 = "Look 'round you, this be your eternal resting place.  Like it?";
string sBossChatter3 = "'nuf talk, it's dying time!";
string sBossChatter4 = "Oh and where are my cronies...";

//Recite the lines at 5, 15, 25 and 35 second intervals.  Hopefully the players are close enough to hear/see them
//Remember we froze everyone in place for 40seconds
DelayCommand(5.0, SpeakString(sBossChatter1, TALKVOLUME_TALK));
DelayCommand(15.0, SpeakString(sBossChatter2, TALKVOLUME_TALK));
DelayCommand(25.0, SpeakString(sBossChatter3, TALKVOLUME_TALK));
DelayCommand(35.0, SpeakString(sBossChatter4, TALKVOLUME_TALK));

//You'll have to put down 2 waypoints where you want the "associates" to be.  Their tags need to be: cronie_WP1 and 2
object oWP1 = GetNearestObjectByTag("cronie_WP1");
object oWP2 = GetNearestObjectByTag("cronie_WP2");
//Now that we have the WPs, get their locations so we can create the "associates" there
location locWP1 = GetLocation(oWP1);
location locWP2 = GetLocation(oWP2);
//After 36 seconds, create the associates at their respective waypoints.
//In this case, the associates' blueprint resrefs are "cronie1" and "cronie2"
DelayCommand(36.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "cronie1", locWP1));
DelayCommand(36.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "cronie2", locWP2));

**This
previous part has a few limitations:  as soon as the boss spawns, it
freezes everyone.  So the encouter will need to be small-ish and very
close to where the boss spawns.  There are other ways to do this so that
the boss is already there, then the players are frozen just as they
enter a trigger area.  Problem is, if one player is way ahead of the
group, the rest will miss out.  This script will not freeze someone who
enters the area during or after the boss spawns.  The boss will speak
its lines, but only those who are close will see/hear the text (you can
change those lines to use TALKVOLUME_SHOUT to ensure everyone hears it) 
When the boss summons the cronies, I assume that the cronies are
different... and I'm not at my machine to see if this compiles.

Her Abilities should be something like this:
* call in 2 more associates every 2 min if the first ones have been slain
* have stages of combat:


This part goes in the OnSpawn script for each of the associates:

//You need to insert the tag of your boss here.  For every version of this boss you make, keep all the tags identical
object oBoss = GetNearestObjectByTag("tag-of-boss");
//Get the tag of the cronie that this OnSpawn script is running for
string sCronieTag = GetTag(OBJECT_SELF);
//Set a variable on the boss, then delete it in 2min to prevent cronies from spawning needlessly
SetLocalInt(oBoss, sCronieTag, TRUE);
DelayCommand(120.0, DeleteLocalInt(oBoss, "Cronie"));


This next long part goes in the OnDamaged script for your boss:

object oSelf = OBJECT_SELF;
//Check and see if it's time to summon new associates
object oCronie;
object oWP;
location locWP;
if( !GetLocalInt(oSelf, "Tag-of-cronie1") )
{
    oWP = GetNearestObjectByTag("cronie_WP1");
    locWP = GetLocation(oWP);
    oCronie = GetNearestObjectByTag( "Tag-of-cronie1");
    //if we can't locate cronie1, it must be dead so let's make a new one
    if( !GetIsObjectValid(oCronie) )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie1", locWP);
    }
}
//Now do the same thing, but check for the 2nd cronie and create it if we can't find it
if( !GetLocalInt(oSelf, "Tag-of-cronie2") )
{
    oWP = GetNearestObjectByTag("cronie_WP2");
    locWP = GetLocation(oWP);
    oCronie = GetNearestObjectByTag( "Tag-of-cronie2");
    //if we can't locate cronie2, it must be dead so let's make a new one
    if( !GetIsObjectValid(oCronie) )
    {
        CreateObject(OBJECT_TYPE_CREATURE, "cronie2", locWP);
    }
}
//Now we see if the boss is damaged enough to enter Stage2
//So recall that if you want a highly melee resistant stage1, then make the
//boss with all resistances how you like it in the palette.
//When the stage1 version reaches <20% total HP it will create the stage2 version which you need to make in the palette
//Determine what percent of your boss's HP are left
float fHP = IntToFloat(GetCurrentHitPoints(oSelf));
float fMaxHP = IntToFloat(GetMaxHitPoints(oSelf));
float fPercentHP = fHP/fMaxHP;
//if it's less than 20%, let's go to the next stage
if( fPercentHP < 0.2 )
{
    //Pick effects that we can play to make ushering in the next stage a little more exciting
    effect e1 = EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD);
    effect e2 = EffectVisualEffect(VFX_DUR_BLIND);
    effect e3 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
    effect e4 = EffectVisualEffect(VFX_FNF_PWKILL);
    effect e5 = EffectKnockdown();
    //Destroy the stage1 boss version and create stage2 in its place
    location locBoss = GetLocation(oSelf);
    DestroyObject(oSelf);
    CreateObject(OBJECT_TYPE_CREATURE, "blueprint-resref-of-stage2-goes-here", locBoss);
    //Run our visual effects
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e1, locBoss);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e3, locBoss);
    DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    //We're going to knockdown and temporarily blind anything close to the boss
   object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    while( GetIsObjectValid(oTarget) )
    {
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5);
        DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e5, oTarget, 4.0);
    oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    }
 }





*edit1: I reposted with the corrections ent.devil added so that I can continue to edit this post myself.  Thx for corrections.
*edit2:  actually used my ol'crutch the compiler and fixed afew more things
               
               

               


                     Modifié par Terrorble, 04 octobre 2010 - 07:24 .
                     
                  


            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #9 on: October 02, 2010, 07:00:44 am »


               I had an idea about the stages and asked our server admin to provide me with a certain script that an old DM of us created once (still think it's a great script and easy to use even). I modified it (especially the resistances and immunities) for each form and the spawning process works fine now.

What needs to be done is really the spawning of her associates and spicing up the whole thing some.

Ideas? I post the script here for you to see what it's doing now:

#include "NW_O2_CONINCLUDE"
#include "x0_i0_treasure"
#include "NW_I0_GENERIC"
void addSharFormSpecificBonuses(){
    string sBluePrint = GetResRef(OBJECT_SELF);
    if(sBluePrint == "silv_shar1stform"){
        effect eBonus = EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 85);
        effect eBonus1 = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 85);
        effect eBonus2 = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100);
        effect eBonus3 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC, 85);
        effect eBonus4 = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 85);
        effect eBonus5 = EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 85);
        effect eBonus6 = EffectCutsceneGhost();
        effect eBonus7 = EffectModifyAttacks(1);
        effect eBonus8 = EffectVisualEffect(VFX_DUR_AURA_GREEN);
        effect eBonus9 = EffectDamageImmunityDecrease(DAMAGE_TYPE_BLUDGEONING, 75);
        effect eBonus10 = EffectDamageImmunityDecrease(DAMAGE_TYPE_SLASHING, 75);
        effect eBonus11 = EffectDamageImmunityDecrease(DAMAGE_TYPE_PIERCING, 75);
        effect eBonus12 = EffectSpellResistanceIncrease(35);
        eBonus = EffectLinkEffects(eBonus, eBonus1);
        eBonus = EffectLinkEffects(eBonus, eBonus2);
        eBonus = EffectLinkEffects(eBonus, eBonus3);
        eBonus = EffectLinkEffects(eBonus, eBonus4);
        eBonus = EffectLinkEffects(eBonus, eBonus5);
        eBonus = EffectLinkEffects(eBonus, eBonus6);
        eBonus = EffectLinkEffects(eBonus, eBonus7);
        eBonus = EffectLinkEffects(eBonus, eBonus8);
        eBonus = EffectLinkEffects(eBonus, eBonus9);
        eBonus = EffectLinkEffects(eBonus, eBonus10);
        eBonus = EffectLinkEffects(eBonus, eBonus11);
        eBonus = EffectLinkEffects(eBonus, eBonus12);
        eBonus = SupernaturalEffect(eBonus);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBonus, OBJECT_SELF);
    }
    else if(sBluePrint == "silv_shar2ndform"){
        effect eBonus = EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 85);
        effect eBonus1 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 85);
        effect eBonus2 = EffectDamageImmunityIncrease(DAMAGE_TYPE_PIERCING, 85);
        effect eBonus3 = EffectCutsceneGhost();
        effect eBonus4 = EffectModifyAttacks(1);
        effect eBonus5 = EffectVisualEffect(VFX_DUR_AURA_BLUE);
        effect eBonus6 = EffectDamageImmunityDecrease(DAMAGE_TYPE_ACID, 75);
        effect eBonus7 = EffectDamageImmunityDecrease(DAMAGE_TYPE_FIRE, 75);
        effect eBonus8 = EffectDamageImmunityDecrease(DAMAGE_TYPE_COLD, 75);
        effect eBonus9 = EffectDamageImmunityDecrease(DAMAGE_TYPE_SONIC, 75);
        effect eBonus10 = EffectDamageImmunityDecrease(DAMAGE_TYPE_ELECTRICAL, 75);
        effect eBonus11 = EffectDamageImmunityDecrease(DAMAGE_TYPE_NEGATIVE, 75);
        effect eBonus12 = EffectSpellResistanceIncrease(40);
        eBonus = EffectLinkEffects(eBonus, eBonus1);
        eBonus = EffectLinkEffects(eBonus, eBonus2);
        eBonus = EffectLinkEffects(eBonus, eBonus3);
        eBonus = EffectLinkEffects(eBonus, eBonus4);
        eBonus = EffectLinkEffects(eBonus, eBonus5);
        eBonus = EffectLinkEffects(eBonus, eBonus6);
        eBonus = EffectLinkEffects(eBonus, eBonus7);
        eBonus = EffectLinkEffects(eBonus, eBonus8);
        eBonus = EffectLinkEffects(eBonus, eBonus9);
        eBonus = EffectLinkEffects(eBonus, eBonus10);
        eBonus = EffectLinkEffects(eBonus, eBonus11);
        eBonus = EffectLinkEffects(eBonus, eBonus12);
        eBonus = SupernaturalEffect(eBonus);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBonus, OBJECT_SELF);
    }
    else if(sBluePrint == "silv_shar3rdform"){
        effect eBonus = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 25);
        effect eBonus1 = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 25);
        effect eBonus2 = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100);
        effect eBonus3 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC, 25);
        effect eBonus4 = EffectDamageImmunityDecrease(DAMAGE_TYPE_ACID, 25);
        effect eBonus5 = EffectCutsceneGhost();
        effect eBonus6 = EffectModifyAttacks(1);
        effect eBonus7 = EffectVisualEffect(VFX_DUR_AURA_BLUE_DARK);
        effect eBonus8 = EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 25);
        effect eBonus9 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 25);
        effect eBonus10 = EffectDamageImmunityIncrease(DAMAGE_TYPE_PIERCING, 25);
        effect eBonus11 = EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 25);
        effect eBonus12 = EffectSpellResistanceIncrease(45);
        eBonus = EffectLinkEffects(eBonus, eBonus1);
        eBonus = EffectLinkEffects(eBonus, eBonus2);
        eBonus = EffectLinkEffects(eBonus, eBonus3);
        eBonus = EffectLinkEffects(eBonus, eBonus4);
        eBonus = EffectLinkEffects(eBonus, eBonus5);
        eBonus = EffectLinkEffects(eBonus, eBonus6);
        eBonus = EffectLinkEffects(eBonus, eBonus7);
        eBonus = EffectLinkEffects(eBonus, eBonus8);
        eBonus = EffectLinkEffects(eBonus, eBonus9);
        eBonus = EffectLinkEffects(eBonus, eBonus10);
        eBonus = EffectLinkEffects(eBonus, eBonus11);
        eBonus = EffectLinkEffects(eBonus, eBonus12);
        eBonus = SupernaturalEffect(eBonus);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBonus, OBJECT_SELF);
    }
    else if(sBluePrint == "silv_sharfinal"){
        effect eBonus = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 65);
        effect eBonus1 = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 65);
        effect eBonus2 = EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 65);
        effect eBonus3 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC, 65);
        effect eBonus4 = EffectDamageImmunityDecrease(DAMAGE_TYPE_FIRE, 65);
        effect eBonus5 = EffectDamageImmunityDecrease(DAMAGE_TYPE_MAGICAL, 65);
        effect eBonus6 = EffectCutsceneGhost();
        effect eBonus7 = EffectModifyAttacks(2);
        effect eBonus8 = EffectVisualEffect(VFX_DUR_AURA_WHITE);
        effect eBonus9 = EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 65);
        effect eBonus10 = EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 65);
        effect eBonus11 = EffectDamageImmunityIncrease(DAMAGE_TYPE_PIERCING, 65);
        effect eBonus12 = EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 65);
        effect eBonus13 = EffectSpellResistanceIncrease(50);
        eBonus = EffectLinkEffects(eBonus, eBonus1);
        eBonus = EffectLinkEffects(eBonus, eBonus2);
        eBonus = EffectLinkEffects(eBonus, eBonus3);
        eBonus = EffectLinkEffects(eBonus, eBonus4);
        eBonus = EffectLinkEffects(eBonus, eBonus5);
        eBonus = EffectLinkEffects(eBonus, eBonus6);
        eBonus = EffectLinkEffects(eBonus, eBonus7);
        eBonus = EffectLinkEffects(eBonus, eBonus8);
        eBonus = EffectLinkEffects(eBonus, eBonus9);
        eBonus = EffectLinkEffects(eBonus, eBonus10);
        eBonus = EffectLinkEffects(eBonus, eBonus11);
        eBonus = EffectLinkEffects(eBonus, eBonus12);
        eBonus = EffectLinkEffects(eBonus, eBonus13);
        eBonus = SupernaturalEffect(eBonus);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBonus, OBJECT_SELF);
    }
}

EDIT: UPDATED THE ABOVE SCRIPT SOME (10-02-2010)


However, I'd really like to merge your parts of the script with the sphere's and talking with this one somehow. For example the:


//Run our visual effects
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e1, locBoss);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e3, locBoss);
    DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, e4, locBoss));
    //We're going to knockdown and temporarily blind anything close to the boss
   object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
    while( GetIsObjectValid(oTarget) )
    {
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5);
        DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, oTarget, 0.5));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e5, oTarget, 4.0);
    oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, locBoss);
               
               

               


                     Modifié par DM-Chemosh, 03 octobre 2010 - 02:43 .
                     
                  


            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Creation of a Boss
« Reply #10 on: October 03, 2010, 03:56:59 am »


               Two ways to add those immunities:  

1.  via scripting like you have above

2.  add them directly to the boss's creature skin in its inventory in the toolset.



I was thinking you could do the latter (I admit, I didn't want to type all that stuff).  The only thing then that I'd probably add via scripting is the extra attacks.



I still need to know if things are working this far.  So far, the code should freeze everyone when the boss spawns and while she talks.  Summon the 2 cronies.  When the boss reaches 20% life, there are some visuals and the stage2 boss version appears in the stage1 boss's place.
               
               

               
            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #11 on: October 04, 2010, 07:37:29 am »


               The OnDmg Script still seems to have errors and gives errors messages regarding line 26 if I am right currently.



I think, at this point we should just screw the idea with the freeze, since that will tick players off on our server (they're not used to that and I don't want to introduce that to them either) - I thought about another possibility though:



Once they enter the encounter trigger, she gets spawned in the part of the area she should be. Once players get there and enter another trigger I'll place close to her, I'll let her say like two sentences, spawn the associates, wait for players to attack her (last part is important! I don't want players to LURE the creatures one-by-one there, but instead if they attack ONE of those, the whole PARTY of people in there gets pulled close to her)



What do you think? The spawning of the cronies is fine, but I think it needs to be adjusted to meet the criteria of the script "onDeath" that's on her. that one basically checks WHICH blueprint creature just "died" and spawn the next "stage" in the same place. The question there is - can we attach the 2min spawn associates still to that?

               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Creation of a Boss
« Reply #12 on: October 04, 2010, 08:26:23 pm »


               I have no experience with creature AI, so preventing them from luring her is going to need someone else's input.



I've just fixed a number of mistakes I had made above.  gl
               
               

               
            

Legacy_DM-Chemosh

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Creation of a Boss
« Reply #13 on: October 05, 2010, 11:29:09 am »


               Alright. I'll test it again and let you know, Terrorble. Thanks again, man!