Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-27-2010, 08:34 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

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 **
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:15 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3