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 10-02-2008, 09:34 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default Healing Bot Issue

Here is the code for my healer. I'm trying to get her to whisper to anyone who enters her proximity AND is <= 70% health AND has Realm faction. If someone is ally, he is called "citizen." If someone is less than ally buut greater than amiable, he is called "friend." The script works in part; she whispers, but she does so to anyone whose health is <= 70%, no matter what faction. Any suggestions?

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);
		$factioncheck = $client->GetCharacterFactionLevel(484);
			{
			if ($factioncheck >= 1101)
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, citizen of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
			if ($factioncheck >= 101)
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, friend of the realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
  			}
		}
	}
Reply With Quote
  #2  
Old 10-04-2008, 09:25 AM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

I think I've fixed this. I added a my $factioncheck = undef; statement just above the SetAppearance function, and it seems to be working now:

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) 	
		{
               my $factioncheck = undef;
    		$npc->SetAppearance(1);
		$factioncheck = $client->GetCharacterFactionLevel(484);
			{
			if ($factioncheck >= 1101)
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, citizen of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
			if ($factioncheck >= 101)
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, friend of the realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
  			}
		}
	}
Reply With Quote
  #3  
Old 10-04-2008, 10:13 AM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Okay, one more time. The subsequent "if" statements were wrong. Here is the full corrected code for anyone who wants it:

Code:
#Heal bot

sub EVENT_SAY 
	{ 
	if($text=~/hail/i)
		{
		$npc->SetAppearance(0); #healer stands#
		quest::say("Hail, $name. You have done well to come to me. I am a daughter of the Realm, but have within me the bloodline of the Healers. Alas, this craft has passed out of all memory of men in this age. But I know it well; and if you wish, I will use it to heal your wounds. The ingredients I need are not easily obtained. I have spent all I possess to gain the meager amount you see before you. I ask only for enough money to secure more so that I may continue to help the people of the Realm. One platinum piece is all I ask. In return, your wounds will be fully healed.");
		}
	}	

sub EVENT_SPAWN
	{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
	}

sub EVENT_ENTER
 	{
	my $player = $entity_list->GetClientByID($userid);
	my $get_player = $player->CastToClient();
	my $player_hps = $get_player->GetHPRatio();
	if ($player_hps <= 70) 	
		{
		my $factioncheck = undef;
    		$npc->SetAppearance(1); # healer sits#
		$factioncheck = $client->GetCharacterFactionLevel(484); #faction ID of the Realm#
			{
			if ($factioncheck >= 1101)  #ally status# 
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, citizen of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
			elsif ($factioncheck >= 101) # amiably, kindly, warmly #
				{
				$client->Message(257,"A mysterious voice calls to you, 'Come quickly, $name, friend of the Realm, and let me have a look at those wounds. I am inside the city, near the causeway to the Wall.' ");
				}
			else
				{#do nothing
				} 
  			}
		}
	}

sub EVENT_ITEM
	{
 	if (($platinum>=1))
		{
   		$npc->SetAppearance(0); #healer stands#
    		quest::selfcast(13);
    		quest::say("Many thanks to you, $name. You have aided the armies of the realm more than you know. Be well, and may the blessings of the free peoples go with you.");
		$npc->SetAppearance(1); #healer sits#
		}
	else 
		{
		plugin::return_items(\%itemcount);
    		quest::say("I'm very sorry, $name, but that isn't enough. I require one platinum piece.");
		$npc->SetAppearance(1); #healer sits#
 		}
	}
Reply With Quote
  #4  
Old 10-05-2008, 02:06 PM
Skizoke
Sarnak
 
Join Date: Sep 2008
Location: Alabama
Posts: 70
Default

Thanks, I'm going to try this out.
Reply With Quote
  #5  
Old 10-05-2008, 02:12 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

note: return items DOES NOT work with money =)
if you give npc wrong ammount, it will simply eat it
Reply With Quote
  #6  
Old 10-05-2008, 06:22 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
note: return items DOES NOT work with money =)
if you give npc wrong ammount, it will simply eat it
Ahh, that was one thing I did not check, so thanks!
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 07:16 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