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 02-28-2017, 03:07 PM
Nerdgasm
Discordant
 
Join Date: Apr 2013
Posts: 426
Default Few questions...

Heya, so I had a few questions...

1. Is there a way I can make spells do damage based off of your own HP? Example; Spell A does 190% of your HP, and how would I go about doing that?

1a. Second part to that, can I make that damage be multiplied by strength/stamina, etc? If so... how?

Had some ideas for the scripts based off a potion script I have that restores 10% of your total hp, but I'm not sure where to go from there... Lol.
__________________
I am the All Mighty Mittens!
Reply With Quote
  #2  
Old 03-01-2017, 11:06 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Nerdgasm View Post
Heya, so I had a few questions...

1. Is there a way I can make spells do damage based off of your own HP? Example; Spell A does 190% of your HP, and how would I go about doing that?
Yes. Either via source code or LUA/Perl spell script.


Quote:
Originally Posted by Nerdgasm View Post
1a. Second part to that, can I make that damage be multiplied by strength/stamina, etc? If so... how?
Yes. Depends on which method you choose above. But since this is in the Quests Q/A, I'll assume you mean how via the quest script system.

Think spell script. Then:

Code:
if ($client->IsClient()) {
   quest::say ("That is not a valid target jackass!");  
} else {
  $client->GetTarget()->Damage($client, xDmg, xSpellID);
}
Rudimentary, I know, sorry heading to bed. But, it will point you in the right direction.

Quote:
Originally Posted by Nerdgasm View Post
Had some ideas for the scripts based off a potion script I have that restores 10% of your total hp, but I'm not sure where to go from there... Lol.
[/QUOTE]

Well that's slightly different then. You'd append a script to an item, with potion graphic, etc.

But toy around with:

Code:
$client->GetMaxHP()
or

Code:
$client->HealDamage($client->GetMaxHP * 0.10);
I -suppose- it's HealDamage, it's been awhile since I've healed a certain percentage via script (it's normally items/spells).
Reply With Quote
  #3  
Old 03-17-2017, 01:37 AM
Nerdgasm
Discordant
 
Join Date: Apr 2013
Posts: 426
Default

My hero <3.

Got a base script for a %dmg spell I could nab from ya and tweak with?
__________________
I am the All Mighty Mittens!
Reply With Quote
  #4  
Old 03-17-2017, 02:28 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Nerdgasm View Post
My hero <3.

Got a base script for a %dmg spell I could nab from ya and tweak with?
Elaborate for me, in explanation format. I'll write up whatever you want, is possible and that my knowledge allows.
Reply With Quote
  #5  
Old 03-17-2017, 06:42 PM
Nerdgasm
Discordant
 
Join Date: Apr 2013
Posts: 426
Default

I'll pm you. =)
__________________
I am the All Mighty Mittens!
Reply With Quote
  #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
  #7  
Old 03-18-2017, 10:26 PM
Nerdgasm
Discordant
 
Join Date: Apr 2013
Posts: 426
Default

Pretty close,

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->GetMaxHP() * 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);
		
	}
}
Change in red, I mean it was exactly what I was looking for, however I don't want it to do the current hp, I want it to do the MAX HP, so if they have 3000 max hp but only have 2000 hp left, it'll do 300 damage, instead of 200. However, it did work perfectly, you sir, are amazing.
__________________
I am the All Mighty Mittens!
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 03:57 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