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
  #1  
Old 11-07-2012, 05:24 AM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default reset issue?

Alright, after a year or so absence, I try to dive into scripting and I realize I forgot way too much.. and didn't know a whole lot before I quit! =P
After a few hours of VARIOUS testing, I'm stumped.. A little help would be awesome!

Basic idea of event
1 - spawn mob
2 - 1 add spawns on aggro, and more every 25%
3 - if he or one of the adds kills a player, an add will spawn
4 - once main guy dies, everything else despawns, if still around

I have found 2 problems so far.. play testing on a monk, if I spawn the adds, and FD, the "$npc->SetHP(2500);" will heal him back to full, but it won't reset the hp event - no more adds until the next hpevent(x) is met.. is there a way to reset this maybe?

Also, for the life of me, I can't get timers to work.. I would like for him to despawn after so many minutes of no aggro..

This is the base code now, took the timers out obviously because I can't remember for the life of me how to get these to work properly.. =\

Code:
sub EVENT_SPAWN
	{
	quest::shout("Foolish mortals! You should not have awoken me from my slumber!");
	quest::setnexthpevent(100);
	}

	
sub EVENT_COMBAT 
	{
	if ($combat_state = 1) 
		{
		$npc->SetHP(2500);
		}
	}
	
sub EVENT_HP
	{
	if($hpevent == 100)
		{
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::setnexthpevent(75);
		}
	if($hpevent == 75)
		{
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::setnexthpevent(50);
		}
	if($hpevent == 50)
		{
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
		quest::setnexthpevent(25);
		}
	if($hpevent == 25)
		{
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
		quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
		quest::setnexthpevent(0);
		}
	if($hpevent ==0)
		{
		quest::shout("Impossible!");
		quest::depopall(111253);
		quest::depopall(111254);
		quest::depopall(111255);
		}
	}	
	
sub EVENT_SLAY
	{
	quest::shout("Soandso will be pleased with your death! I shall feast on your corpse!");
	quest::spawn2(111253,0,0,"202.1","357","-24.2","128");
	}

sub EVENT_DEATH
	{
	quest::shout("Impossible!");
	quest::depopall(111253);
	quest::depopall(111254);
	quest::depopall(111255);
	}
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 06:20 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3