EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Aggro Zone Quest (https://www.eqemulator.org/forums/showthread.php?t=36771)

NatedogEZ 04-21-2013 08:28 AM

Aggro Zone Quest
 
I was fairly bored and wanted a better way to aggro an entire zone if a player skips to the last boss of X zone.


Code:

sub EVENT_COMBAT
{
        if ($combat_state == 1)
        {
                AGGRO_ZONE();
                quest::shout("You aggroed the zone!"); #Random text
        }
       
        if ($combat_state == 0)
        {
                #Only turn this on if you use the GMMOVE
                #quest::repopzone();
        }
}


sub AGGRO_ZONE
{
#NPCIDs go in this skiplist that you DO NOT want to be aggroed!
my @skiplist = qw(
425022
1356
);
 if ($client)
                {
                        my @trash = $entity_list->GetNPCList();
                        foreach $ent (@trash)
                        {
                                my $trashaggro = $ent->CastToNPC();
                                my $trashnpctype = $trashaggro->GetNPCTypeID();
                                        if ( grep { $_ eq $trashnpctype } @skiplist )
                                        {
                                        #DO NOTHING
                                        }
                                        else
                                        {
                                        #Only Turn this on if players are EXPLOITING with pets
                                        #$trashaggro->GMMove($x, $y, $z, 0);
                                        #Adding All Aggro onto the PET which will transfer to player
                                        $trashaggro->AddToHateList($client, 1);
                                        }
                        }
                }
                else
                {
                my $hate_target = $npc->GetHateTop();
                my $hate_pet = $hate_target->CastToMob();
                my @trash = $entity_list->GetNPCList();
                        foreach $ent (@trash)
                        {
                                my $trashaggro = $ent->CastToNPC();
                                my $trashnpctype = $trashaggro->GetNPCTypeID();
                                        if ( grep { $_ eq $trashnpctype } @skiplist )
                                        {
                                        #DO NOTHING
                                        }
                                        else
                                        {
                                        #Only Turn this on if players are EXPLOITING with pets
                                        #$trashaggro->GMMove($x, $y, $z, 0);
                                        #Adding All Aggro onto the PET which will transfer to player
                                        $trashaggro->AddToHateList($hate_pet, 1);
                                        }
                        }
                }
}


To use this in zones where you don't want certain NPCs to aggro you can add them to the skiplist Inside the AGGRO_ZONE sub! Just the NPC ID in non quoted format.

In its current form it will only Aggro everything to you or your pet.

NatedogEZ 04-21-2013 06:38 PM

#Adding All Aggro onto the PET which will transfer to player

At the top should read...

#Adding All Aggro onto the Client --- copy paste error ftl


Doesn't change how it works... just a Side note as to what it is doing.



The bottom one that reads the same string of text is correct in what it is doing.


All times are GMT -4. The time now is 11:34 AM.

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