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-26-2013, 02:02 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,604
Default

Merry Christmas, this works 100%, if the NPC is at 1 health it will hit for 0, keep that in mind.

I fixed your issue, shouting the target doesn't return the target's name, also, re-defining things is unnecessary the way you did it.

Also, I put in 'int' in order to keep you from hitting for decimals and keep the health from becoming decimals.
Code:
sub EVENT_SPELL_EFFECT_CLIENT 
{  
	my $client = $entity_list->GetClientByID($caster_id);
	if($client->GetTarget()->IsNPC()) 
	{	 
		TESTLIFETAP();
	}
}

sub TESTLIFETAP 
{
	my $client = $entity_list->GetClientByID($caster_id);
	if($client->GetTarget()->GetHP() >= 500) 
	{ 
		$client->GetTarget()->SetHP(int($client->GetTarget()->GetHP() - 500));
		$client->Emote("hit " . $client->GetTarget()->GetCleanName() . " for " . int($client->GetTarget()->GetHP() - 500) . " points of non-melee damage.");
	}
	elsif($client->GetTarget()->GetHP() < 500) 
	{
		$client->GetTarget()->SetHP(int($client->GetTarget()->GetHP() - ($client->GetTarget()->GetHP() * .25)));
		$client->Emote("hit " . $client->GetTarget()->GetCleanName() . " for " . int($client->GetTarget()->GetHP() - ($client->GetTarget()->GetHP() * .25)) . " points of non-melee damage.");
	}
}
Reply With Quote
  #2  
Old 10-26-2013, 02:11 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Thanks a lot KK.

I didn't even think about adding int.. definitely something I'll keep in mind for future scripts I make. Huge help.
Reply With Quote
Reply

Thread Tools
Display Modes

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:59 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