EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   NPC HP Lock (https://www.eqemulator.org/forums/showthread.php?t=32549)

Bdiddy 11-27-2010 02:33 PM

NPC HP Lock
 
Not sure if this is the right forum or not, please move if not.
On an NPC I've made I want to have it's HP lock at 50% and have 5-10 adds spawn at that 50%. I do not want the HP to unlock until the adds are dead. I still want the NPC to have agro and attacking while the HP is locked though. Then at 25% I want just the adds to pop but not HP lock. Any idea on how to do this?

Akkadius 11-27-2010 04:26 PM

Quote:

Originally Posted by Bdiddy (Post 194552)
Not sure if this is the right forum or not, please move if not.
On an NPC I've made I want to have it's HP lock at 50% and have 5-10 adds spawn at that 50%. I do not want the HP to unlock until the adds are dead. I still want the NPC to have agro and attacking while the HP is locked though. Then at 25% I want just the adds to pop but not HP lock. Any idea on how to do this?

You would have to simulate it using a timer. I believe I made a plugin for it, I will post something later.

Caryatis 11-27-2010 08:34 PM

I had a few events which locked HP at certain stages, when adds were involved I would use a foreach loop(assume 121212 for your add NPCTypeID that you want the HP to lock when they spawn):

Code:

sub EVENT_COMBAT
{
        if($combat_state == 1) {
                quest::setnexthpevent(50);
        }
}

sub EVENT_HP
{
        if($hpevent == 50) {
                quest:settimer("hplock", 6);
                ##Spawn mobs here
                quest::setnexthpevent(25);
        }
        elsif ($hpevent == 25) {
                ##Spawn mobs here
        }
}

sub EVENT_TIMER
{
        if($timer eq "hplock") {
                my @npcsInZone = $entity_list->GetNPCList();
                my $stopTimer = 0;
                ## Search through all npcs in zone
                foreach $npcs(@npcsInZone) {
                        ## If we find an add, then set HP to 50%
                        if($npcs->GetNPCTypeID() == 121212) {
                                $mob->SetHP($mob->GetMaxHP() / 2);
                                $stopTimer = 1;
                        }
                }
                if($stopTimer == 0) {
                        quest:stoptimer("hplock");
                }
        }
}

** I havent wrote a perl script in a few months so I make no claims this doesnt contain a few syntax errors **

nenelan 11-29-2010 09:52 AM

I personally like using
Code:

$npc->NPCSpecialAttacks(parse, permtag);
fABDINCMU will give it immune to fleeing, immune to Melee,magic,fear,root,stuns,charms,mezzes and slows. Just remember if you still want it to summon, Enrage, Rampage, Flurry, Triple and Quad, you still have to add those in too even when you make it invulnerable. To remove it, just do the line again after it receives 5 signals from the trash mobs on their death and carry on (do the same line, removing the fAB and whatever other Immunes you want).

Hope this helped.


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

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