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 05-13-2011, 11:06 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default Quick question, Damaging an NPC via Signal when another mob is killed

You can send a signal from one npc to another correct?

If so am I using $npc->SetHP correctly here? Can you have a -# inside the brackets or do you have to do that a different way?


Code:
#azog mon
sub EVENT_SIGNAL {
	quest::shout("Signal Sent");
	$npc->SetHP(-100000); #damage azog mon by 5%
}

Code:
#hand
sub EVENT_DEATH {
quest::signal(999430, 0); #signal azog mon to get damaged
}
Reply With Quote
  #2  
Old 05-13-2011, 11:20 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Astal View Post
You can send a signal from one npc to another correct?

If so am I using $npc->SetHP correctly here? Can you have a -# inside the brackets or do you have to do that a different way?


Code:
#azog mon
sub EVENT_SIGNAL {
	quest::shout("Signal Sent");
	$npc->SetHP(-100000); #damage azog mon by 5%
}

Code:
#hand
sub EVENT_DEATH {
quest::signal(999430, 0); #signal azog mon to get damaged
}
As for the SetHP, it sets the HP to a value within the hitpoints of the NPC. So you will need to grab the NPC hitpoints first.

Code:
 
        my $curhp = $npc->GetHP();
        my $HealPoints = -100000;
        $npc->SetHP($curhp + $HealPoints);
Or you can use the plugin::MobHealPoints(Hitpoints to heal); from the plugins repo.

plugin::MobHealPoints(-100000);

Will achieve the same effect.

And usually a good way to go about using signals is to lace them with an ID using signalwith so that you can use different signals that do different things throughout an event.

For example:
quest::signalwith(int npc_id, int signal_id, int wait_ms);

Code:
#hand
sub EVENT_DEATH {
quest::signalwith(999430, 4, 1); #signal azog mon to get damaged
}

Code:
#azog mon
sub EVENT_SIGNAL {
        if($signal == 4){
	quest::shout("Signal Sent");
	$my $curhp = $npc->GetHP();
        my $HealPoints = -100000;
        $npc->SetHP($curhp + $HealPoints); #damage azog mon by 5%
        }
}
Reply With Quote
  #3  
Old 05-13-2011, 11:48 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Akkadius View Post
As for the SetHP, it sets the HP to a value within the hitpoints of the NPC. So you will need to grab the NPC hitpoints first.

Code:
 
        my $curhp = $npc->GetHP();
        my $HealPoints = -100000;
        $npc->SetHP($curhp + $HealPoints);
Or you can use the plugin::MobHealPoints(Hitpoints to heal); from the plugins repo.

plugin::MobHealPoints(-100000);

Will achieve the same effect.

And usually a good way to go about using signals is to lace them with an ID using signalwith so that you can use different signals that do different things throughout an event.

For example:
quest::signalwith(int npc_id, int signal_id, int wait_ms);

Code:
#hand
sub EVENT_DEATH {
quest::signalwith(999430, 4, 1); #signal azog mon to get damaged
}

Code:
#azog mon
sub EVENT_SIGNAL {
        if($signal == 4){
	quest::shout("Signal Sent");
	$my $curhp = $npc->GetHP();
        my $HealPoints = -100000;
        $npc->SetHP($curhp + $HealPoints); #damage azog mon by 5%
        }
}
thanks akka, i was gonna do signalwith but i didnt know if the id was an int or a string.

You may notice its a little similar to your one mob, not on purpose of course, its hard coming up with a bunch of different unique boss fight scripts.

Did one with totems that heal the boss, this one, i need 5 more hehehe
Reply With Quote
  #4  
Old 05-13-2011, 12:00 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

My one mob? Oh yeah that one mob!
Reply With Quote
  #5  
Old 05-13-2011, 12:12 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Akkadius View Post
My one mob? Oh yeah that one mob!
kurns tower or whatever hehehe
Reply With Quote
  #6  
Old 05-13-2011, 12:41 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 966
Default

Along these same lines what is the best way to self kill or depop a NPC so that the respawn timer is fired?

using quest::depop{}; does not cause the respawn timer to kick in so as soon as the dymanic zone shuts down and starts up again the NPC will be back up.
using $npc->Damage(.........); does do it since the mob "dies"
Reply With Quote
Reply


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 04:59 AM.


 

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