PDA

View Full Version : Custom spell help


emho24
07-07-2016, 05:31 PM
I'd apprecate any assistance with a set of custom spells, point me in the right direction if you are able.

I'd like to create a set of custom spells that directly interact with each other. The first spell is a detrimental spell that will be used as an NPC aoe. It needs to be unresistable with no partial resists, but can be mitigated by a set percentage if the player has the correct resist buff.

Example:
- Boss casts custom aoe
- player 1 does not have the associated custom resist buff and gets hit with unresistable 1000 damage
- player 2 currently has the associated custom resist buff and 90% of the damage is mitgated, player gets hit with 100 damage.

Thoughts?

Kingly_Krab
07-07-2016, 08:48 PM
The custom spell is the easy part really, you just have to write the encounter based on if the client has X buff or not they receive Y damage. This is just an example and definitely is not a final version to say the least, I'm just trying to show you how to do it.
sub EVENT_SPAWN {
quest::setnexthpevent(80);
}

sub EVENT_HP {
if ($hpevent ~~ [20, 40, 60, 80]) {
Spell();
quest::setnexthpevent(($hpevent - 20));
}
}

sub Spell {
my @hate = $npc->GetHateList();
foreach my $hate_ent (@hate) {
if ($hate_ent->GetEnt()->IsClient()) {
if ($hate_ent->GetEnt()->FindBuff(X)) {
$hate_ent->GetEnt()->Damage(100);
$hate_ent->GetEnt()->Message(315, "You have been hit for 100 points of damage, mitigating 900 damage because you have X buff.");
} else {
$hate_ent->GetEnt()->Damage(1000);
$hate_ent->GetEnt()->Message(315, "You have been hit for 1,000 points of damage because you did not have X buff.");
}
}
}
}

emho24
07-08-2016, 03:53 PM
Thanks, this was exactly what was looking for. So much to learn.

I was able to make some modifications to your example and get my stuff working as intended.

Maze_EQ
07-09-2016, 10:30 AM
I like kingly's way, but I always use two different spells for X and Y.

X has certain item/buff and Y not having.

I