View Single Post
  #6  
Old 03-17-2017, 11:33 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Based on your PM but showing here to keep around in case others are lurking it.

Code:
## Slash; Deals 10% of your hp to your target. (spell ID is 400).
## /quests/global/spells/400.pl

sub EVENT_SPELL_EFFECT_NPC 
{
	$responsibleclient = $entity_list->GetClientByID($caster_id);
	if ($responsibleclient) 
	{
		my $slashdamage = int($responsibleclient->GetHP() * 0.10); ## 10% of clients current HP?
		$entity_list->MessageClose($responsibleclient, 0, 30, 0, "".$responsibleclient->GetCleanName()." delivers a crippling slash to ".$npc->GetCleanName()." for $slashdamage damage!");
		$npc->Damage($responsibleclient, $slashdamage, 400, 1, 0);
		
	}
}

Code:
## Fireblast; Deals 10% of your mana to your target. (spell ID is 500).
## /quests/global/spells/500.pl

sub EVENT_SPELL_EFFECT_NPC
{
	$responsibleclient = $entity_list->GetClientByID($caster_id);
 	if ($responsibleclient) 
 	{
 		my $firedamage = int($responsibleclient->GetMana() * 0.10);
 		$entity_list->MessageClose($responsibleclient, 0, 30, 0, "".$responsibleclient->GetCleanName()." conjurs the fires of hell to burn ".$npc->GetCleanName()." for $firedamage damage!");
 		$npc->Damage($responsibleclient, $firedamage, 500, 24, 0);
 		
 	}
}
I -believe- this is what you're after?
Reply With Quote