ok this is working now the only problem i have is the exp.
Code:
my $Random;
my $x;
my $y;
my $z;
my $h;
my $entity_id;
sub EVENT_SPAWN
{
$entity_id=$npc->GetID();
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();
$Random = quest::ChooseRandom(Warrior,Cleric,Paladin,Ranger,Shadowknight,Druid,Monk,Bard,Rogue,Shaman,Necromancer,Wizard,Magician,Enchanter,Beastlord,Berserker);
quest::setnexthpevent(90);
}
sub EVENT_HP
{
if($hpevent == 90)
{
quest::shout("Only The powers of a $Random can defeat me!");
}
}
sub EVENT_DEATH
{
my $corpse_id = $entity_list->GetCorpseByID($entity_id);
quest::shout("Death event started killer class = $class and name = $name!");
if ($class eq $Random) {
quest::shout("You have Defeated me!");
}
else
{
quest::spawn2(1333,0,0,$x,$y,$z,$h);
quest::shout("You Cannot Defeat me!");
my $corpse_decay = $corpse_id->CastToCorpse();
$corpse_decay->SetDecayTimer(5000);
}
}
i was thinking
could i use sub EVENT_KILLED_MERIT and some math to get how much exp was given out and then take it away?