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 09-30-2008, 02:45 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default 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!");
}
}
}
Reply With Quote
  #2  
Old 09-30-2008, 07:18 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

is there no way to find who did the killing blow?
Reply With Quote
  #3  
Old 10-01-2008, 02:37 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

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.
Reply With Quote
  #4  
Old 10-01-2008, 02:38 AM
VallonTallonZek
Sarnak
 
Join Date: May 2008
Location: Halas
Posts: 42
Default

edit: Or not...
Reply With Quote
  #5  
Old 10-01-2008, 04:09 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

or not? im guessing you posted something that did not work?
Reply With Quote
  #6  
Old 10-01-2008, 07:29 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

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.
Reply With Quote
  #7  
Old 10-01-2008, 07:48 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

ok i have no problem with doing that but how do i find out who hit him last at that point
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 05:05 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3