|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
09-30-2008, 02:45 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
get class that did finishing blow
how would i get the class of the player that got the finishing blow on a mob and then repop him if its not = to random class
example
Code:
my $Random;
sub EVENT_SPAWN
{
quest::setnexthpevent(20);
$Random = quest::ChooseRandom(Warrior,Cleric,Paladin,Ranger,Shadowknight,Druid,Monk,Bard,Rogue,Shaman,Necromancer,Wizard,Magician,Enchanter,Beastlord,Berserker);
}
sub EVENT_HP
{
if($hpevent == 20)
{
quest::shout("Only The powers of a $Random can defeat me!");
quest::setnexthpevent(0);
}
if($hpevent == 0)
{
if($client->$class eq $Random)
{
quest::spawn2(1325,0,0,-144.6,-401.2,-2.7,63.1);
quest::shout("You Cannot Defeat me!");
quest::depop();
}
else
{
quest::shout("You are the right class!");
}
}
}
|
09-30-2008, 07:18 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
is there no way to find who did the killing blow?
|
|
|
|
10-01-2008, 02:37 AM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
ok i got this working but not all the way.
Code:
my $Random;
my $x;
my $y;
my $z;
my $h;
sub EVENT_SPAWN
{
$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
{
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!");
$mob->SetTarget($mobid);
$npc->kill();
}
}
when they die they give exp and then shouting You Cannot Defeat me but then leaves a corpse thats lootable and does not respawn..
what i want to do is not give exp if i can but i don't really care about the exp what i care about is if your not the right class that kills them then don't leave a corpse and repop.
|
|
|
|
10-01-2008, 02:38 AM
|
Sarnak
|
|
Join Date: May 2008
Location: Halas
Posts: 42
|
|
edit: Or not...
|
10-01-2008, 04:09 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
or not? im guessing you posted something that did not work?
|
10-01-2008, 07:29 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,490
|
|
EVENT_DEATH will trigger as the mob dies, so you will not be able to prevent it from dying and leaving a corpse. However, why don't you make it do all this at a 0% health event? Granted if your NPC does not have a lot of hit points, there is a possibility of him still dying upon final blow from 1% to death... Just an option.
|
10-01-2008, 07:48 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
ok i have no problem with doing that but how do i find out who hit him last at that point
|
10-01-2008, 09:31 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,490
|
|
You can always run a test to see if it picks up the person that damages him into the HP event.
Try having setting up a few health events and have the NPC say $name in health events when damaging with 2 or 3 characters to test it out.
|
10-01-2008, 11:08 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
its calling out the npcs name at the hp events. so im guessing its not triggered by the player
|
10-01-2008, 11:28 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
If you want to delete the corpse after it dies, you should check out this quest I posted here:
http://www.eqemulator.net/forums/showthread.php?t=25927
You will still need a way to get the class that got the kill, but one you do, you can replace the IsEmpty check in my script to check for the class instead. Might be useful.
So, are you trying to ensure that a certain class is soloing this NPC, or the only thing that matters is if the right class gets the killing blow? If you are trying to make sure that the right class is the only one killing it, you could probably just have it check everyone on the hate list and check their class and if they aren't the right one it depops.
|
10-01-2008, 11:56 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,490
|
|
I think he is talking final blow. Just like in some of the trials in MPG.
|
10-02-2008, 12:20 AM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
Quote:
Originally Posted by joligario
I think he is talking final blow. Just like in some of the trials in MPG.
|
exactly.. i want to see who got the final blow so i can say somewhere in the fight you need to be this class to kill me then if there not don't let them kill it basically.
|
|
|
|
10-02-2008, 06:26 PM
|
Discordant
|
|
Join Date: Oct 2005
Location: michigain
Posts: 260
|
|
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?
|
|
|
|
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 09:30 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|