EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Sample Custom Boss Script (https://www.eqemulator.org/forums/showthread.php?t=37298)

Figback65 09-16-2013 10:30 PM

Sample Custom Boss Script
 
I use this for one of my custom raid bosses.

Code:

sub EVENT_SPAWN {
quest::setnexthpevent(90);
quest::shout("My Lands My Domain. Flee you filth.");
}

sub EVENT_AGGRO {
quest::say("You can NEVARUN!");
quest::settimer(1,30);
}

sub EVENT_HP {
my $hate1 = $npc->GetHateRandom();
my $hate2 = $npc->GetHateRandom();
my $hate3 = $npc->GetHateRandom();
my $hate4 = $npc->GetHateRandom();
my $hate5 = $npc->GetHateRandom();
my $hate6 = $npc->GetHateRandom();
my $hate7 = $npc->GetHateRandom();
my $hate8 = $npc->GetHateRandom();
my $hate9 = $npc->GetHateRandom();
my $hate10 = $npc->GetHateRandom();
my $hate11 = $npc->GetHateRandom();
my $hate12 = $npc->GetHateRandom();
 
if($hpevent == 90) {
quest::say("Assist me my woodland friends!");
$guardian1 = quest::spawn2(15091,0,0,$x,$y,$z,0);
$guardian2 = quest::spawn2(15091,0,0,$x,$y,$z,0);
$guardian3 = quest::spawn2(15025,0,0,$x,$y,$z,0);
$guardian4 = quest::spawn2(15025,0,0,$x,$y,$z,0);
$guardian5 = quest::spawn2(15041,0,0,$x,$y,$z,0);
$guardian6 = quest::spawn2(15041,0,0,$x,$y,$z,0);
$attack1 = $entity_list->GetMobID($guardian1);
$attack2 = $entity_list->GetMobID($guardian2);
$attack3 = $entity_list->GetMobID($guardian3);
$attack4 = $entity_list->GetMobID($guardian4);
$attack5 = $entity_list->GetMobID($guardian5);
$attack6 = $entity_list->GetMobID($guardian6);
$guardian1atk = $attack1->CastToNPC();
$guardian2atk = $attack2->CastToNPC();
$guardian3atk = $attack3->CastToNPC();
$guardian4atk = $attack4->CastToNPC();
$guardian5atk = $attack5->CastToNPC();
$guardian6atk = $attack6->CastToNPC();
$guardian1atk->AddToHateList($hate1, 1);
$guardian2atk->AddToHateList($hate2, 1);
$guardian3atk->AddToHateList($hate3, 1);
$guardian4atk->AddToHateList($hate4, 1);
$guardian5atk->AddToHateList($hate5, 1);
$guardian6atk->AddToHateList($hate6, 1);
quest::setnexthpevent(70);
}

if($hpevent == 70) {
        $npc->CastSpell(15975, $mobid, 10, -1);
        quest::modifynpcstat("min_hit", 150);
        quest::modifynpcstat("max_hit", 250);
        quest::setnexthpevent(51);
}

if($hpevent == 51) {
        $npc->BuffFadeBySpellID(15975);
        quest::modifynpcstat("min_hit", 50);
        quest::modifynpcstat("max_hit", 150);
        quest::setnexthpevent(50);
}

if($hpevent == 50) {
        quest::say("Assist me my woodland friends!");
        $guardian4 = quest::spawn2(15025,0,0,$x,$y,$z,0);
        $guardian5 = quest::spawn2(15041,0,0,$x,$y,$z,0);
        $guardian6 = quest::spawn2(15041,0,0,$x,$y,$z,0);

        $attack4 = $entity_list->GetMobID($guardian4);
        $attack5 = $entity_list->GetMobID($guardian5);
        $attack6 = $entity_list->GetMobID($guardian6);

        $guardian4atk = $attack4->CastToNPC();
        $guardian5atk = $attack5->CastToNPC();
        $guardian6atk = $attack6->CastToNPC();

        $guardian4atk->AddToHateList($hate4, 1);
        $guardian5atk->AddToHateList($hate5, 1);
        $guardian6atk->AddToHateList($hate6, 1);
        quest::setnexthpevent(30);
}
  if($hpevent == 30) {
 
    $npc->CastSpell(15975, $mobid, 10, -1);
          quest::modifynpcstat("min_hit", 150);
        quest::modifynpcstat("max_hit", 250);

        $guardian1 = quest::spawn2(15091,0,0,$x,$y,$z,0);
        $guardian2 = quest::spawn2(15091,0,0,$x,$y,$z,0);
        $guardian3 = quest::spawn2(15025,0,0,$x,$y,$z,0);
        $guardian4 = quest::spawn2(15025,0,0,$x,$y,$z,0);
        $guardian5 = quest::spawn2(15041,0,0,$x,$y,$z,0);
        $guardian6 = quest::spawn2(15041,0,0,$x,$y,$z,0);
        $guardian7 = quest::spawn2(12177,0,0,$x,$y,$z,0);
        $guardian8 = quest::spawn2(12177,0,0,$x,$y,$z,0);
    $attack1 = $entity_list->GetMobID($guardian1);
        $attack2 = $entity_list->GetMobID($guardian2);
        $attack3 = $entity_list->GetMobID($guardian3);
        $attack4 = $entity_list->GetMobID($guardian4);
        $attack5 = $entity_list->GetMobID($guardian5);
        $attack6 = $entity_list->GetMobID($guardian6);
        $attack7 = $entity_list->GetMobID($guardian7);
        $attack8 = $entity_list->GetMobID($guardian8);
    $guardian1atk = $attack1->CastToNPC();
        $guardian2atk = $attack2->CastToNPC();
        $guardian3atk = $attack3->CastToNPC();
        $guardian4atk = $attack4->CastToNPC();
        $guardian5atk = $attack5->CastToNPC();
        $guardian6atk = $attack6->CastToNPC();
        $guardian7atk = $attack7->CastToNPC();
        $guardian8atk = $attack8->CastToNPC();
    $guardian1atk->AddToHateList($hate1, 1);
        $guardian2atk->AddToHateList($hate2, 1);
        $guardian3atk->AddToHateList($hate3, 1);
        $guardian4atk->AddToHateList($hate4, 1);
        $guardian5atk->AddToHateList($hate5, 1);
        $guardian6atk->AddToHateList($hate6, 1);
        $guardian7atk->AddToHateList($hate7, 1);
        $guardian8atk->AddToHateList($hate8, 1);
}
}

sub EVENT_TIMER {
        my $hate = $npc->GetHateRandom();
       
        if($timer == 1) {
                $npc->SpellFinished(438,$hate);
                quest::say("You dont stand a chance!");
        }
}


Kingly_Krab 09-16-2013 10:49 PM

Your scripts make me angry. D: You define so many variables for no reason.

Figback65 09-16-2013 11:42 PM

lol, Definitely needs cleaned.

sorvani 09-17-2013 08:42 AM

Quote:

Originally Posted by Kingly_Krab (Post 224271)
Your scripts make me angry. D: You define so many variables for no reason.

That would be the way all self taught programmers start.

"Don't be a dick" - Wil Wheaton

Luccian 09-17-2013 11:09 AM

Quote:

Originally Posted by sorvani (Post 224280)
That would be the way all self taught programmers start.

"Don't be a dick" - Wil Wheaton

Never have I loved someone so much, as I love you right now.

Dunge0nMastr 09-17-2013 11:11 AM

My first scripts were more variable definitions than anything related to the actual script :P gotta learn somewhere before you can start breaking things down.

Perhaps a proper response would have been a trick or two the OP could have used to reduce the variable declarations perhaps 8)

wolfwalkereci 09-17-2013 01:13 PM

Quote:

Originally Posted by Dunge0nMastr (Post 224282)
My first scripts were more variable definitions than anything related to the actual script :P gotta learn somewhere before you can start breaking things down.

Perhaps a proper response would have been a trick or two the OP could have used to reduce the variable declarations perhaps 8)

Agreed there. A lot of us that learned on our own through playing with our own server started with bloated code. Hell most of mine still sucks but it works :D

Figback65 keep on trucking and thanks for posting something.

Kingly_Krab 09-17-2013 04:00 PM

Sorry, I spoke with him on his server, actually going to talk with him later about lowering his variable count and everything, reducing the size of scripts, but yielding more efficiency. Didn't mean to come across as a dick. :P

Dunge0nMastr 09-17-2013 04:19 PM

well played then sir :P


All times are GMT -4. The time now is 08:32 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.