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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2008, 04:21 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default my $hp?

I am setting out bots that provide full heals to those who donate plat. I'm using Angelox's buff bot script, which I've modified to include healing only. The script includes a spawn event that sets a proximity. The script triggered by the ENTER event is as follows:

Code:
sub EVENT_ENTER
	{
	$npc->SetAppearance(1);
	quest::say("Healer available. I'm inside the gate, near the causeway to the wall.");
	}
I would like to make this script trigger only when a player enters the proximity whose health is below, say, 70%. The HP events and functions seem only to apply to npcs and mobs, not players. Nor could I find a quest object that would accomplish this. Is there a variable that would return my current HP in percentage to allow me to do this? Thanks.
Reply With Quote
  #2  
Old 09-21-2008, 04:34 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This is a modified version of something I use for a fun encounter I setup recently. It should work for you:

Code:
sub EVENT_ENTER {

my $player = $entity_list->GetClientByID($userid);
my $get_player = $player->CastToClient();
my $player_hps = $get_player->GetHPRatio();

  if ($player_hps <= 70) 	{
    $npc->SetAppearance(1);
    quest::say("Healer available. I'm inside the gate, near the causeway to the wall.");
  }
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-22-2008 at 12:36 AM..
Reply With Quote
  #3  
Old 09-21-2008, 05:38 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

That works perfectly; thanks Trevius : )
Reply With Quote
Reply


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 12:03 PM.


 

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