|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
02-28-2017, 03:07 PM
|
Discordant
|
|
Join Date: Apr 2013
Posts: 419
|
|
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!
|
|
|
|
03-01-2017, 11:06 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by Nerdgasm
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
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
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).
|
|
|
|
03-17-2017, 01:37 AM
|
Discordant
|
|
Join Date: Apr 2013
Posts: 419
|
|
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!
|
03-17-2017, 02:28 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Quote:
Originally Posted by Nerdgasm
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.
|
03-17-2017, 06:42 PM
|
Discordant
|
|
Join Date: Apr 2013
Posts: 419
|
|
I'll pm you. =)
__________________
I am the All Mighty Mittens!
|
|
|
|
03-17-2017, 11:33 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
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?
|
|
|
|
03-18-2017, 10:26 PM
|
Discordant
|
|
Join Date: Apr 2013
Posts: 419
|
|
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!
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:19 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|