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-16-2011, 10:10 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

$cloned = $npc1 (npc you're cloning hate from)
$other = $npc2 (npc you're cloning hate to)
Reply With Quote
  #2  
Old 05-16-2011, 10:12 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

ok, what event would i put that in?

I see you define your own sub, i didnt even know you could do that

also does the npc getting the list automatically set a target?

Like would this be the correct usage

Sorry for being dumb, i cant exactly tell whats going on in the code.

Not sure how i can then use that code to get a target in the hatelist on either the npc with the hatelist code or the casting npc.

Would you guys be able to explain your sub better or help me do it an easier way with getentity list and randomhate?

Code:
sub EVENT_TIMER {
	
	my $range = 120; #maximum number
	my $minimum = 60; #minimum number

	my $random_number = int(rand($range)) + $minimum; #generate a number between $minimum and $range
  
	if (($timer eq "CastPlague" ) && (defined($entity_list->GetNPCByNPCTypeID(999426))))
	{
		hate_clone(999426, 2700253); #target player on hatelist
		plugin::CastOnTarget(21480); #Virulent Plague
		quest::shout("You cannot defeat our mother!!!");
		quest::settimer("CastPlague", $random_number);
	}	
}
Reply With Quote
  #3  
Old 05-16-2011, 10:30 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Sorry im just confused the hell out of :(
Reply With Quote
  #4  
Old 05-16-2011, 10:48 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

It was mostly used as an example of how to manipulate the hate lists. To give an idea of how to do what you want to do that way I still suggest Joli's idea.

Ex:

Code:
	#find npc of npc type 123456
	my $parent_npc = $entity_list->GetMobByNpcTypeID(123456);
	if($parent_npc) {
		my $random_target = $parent_npc->GetHateRandom();
		#do something
	}
Reply With Quote
  #5  
Old 05-16-2011, 11:13 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by KLS View Post
It was mostly used as an example of how to manipulate the hate lists. To give an idea of how to do what you want to do that way I still suggest Joli's idea.

Ex:

Code:
	#find npc of npc type 123456
	my $parent_npc = $entity_list->GetMobByNpcTypeID(123456);
	if($parent_npc) {
		my $random_target = $parent_npc->GetHateRandom();
		#do something
	}
oh, ok i have that so far, couldnt figure out how to sent the $random_target to the other mob though.

Code:
sub EVENT_ATTACK {
	$laibach = $entity_list->GetMobByNpcTypeID(999424);
	if($laibach) {
		$random_hate = $mob->GetHateRandom();
	}
}
Reply With Quote
  #6  
Old 05-16-2011, 11:27 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Try something like this, where 999424 is the NPCID of your main boss, which I assume is named Laibach. This script would be placed on each of your add NPCs. This assumes that they are attacked as well, to trigger this event, otherwise you can just signal them from your main boss to trigger this same bit of code instead.

Code:
sub EVENT_ATTACK {

	# Get Laibach if he is up
	my $laibach = $entity_list->GetMobByNpcTypeID(999424);
	# Make sure you got him before using $laibach as a pointer
	if($laibach)
	{
		# Get a random entry on Laibach's hate list
		my $HateTarget = $laibach->GetHateRandom();
		# Get the ID of that hate entry for use with CastSpell
		my $HateTargetID = $HateTarget->GetID();
		# Cast a spell on the random hate target (Courage in this example)
		$npc->CastSpell(11, $HateTargetID);
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 05-16-2011, 11:32 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by trevius View Post
Try something like this, where 999424 is the NPCID of your main boss, which I assume is named Laibach. This script would be placed on each of your add NPCs. This assumes that they are attacked as well, to trigger this event, otherwise you can just signal them from your main boss to trigger this same bit of code instead.

Code:
sub EVENT_ATTACK {

	# Get Laibach if he is up
	my $laibach = $entity_list->GetMobByNpcTypeID(999424);
	# Make sure you got him before using $laibach as a pointer
	if($laibach)
	{
		# Get a random entry on Laibach's hate list
		my $HateTarget = $laibach->GetHateRandom();
		# Get the ID of that hate entry for use with CastSpell
		my $HateTargetID = $HateTarget->GetID();
		# Cast a spell on the random hate target (Courage in this example)
		$npc->CastSpell(11, $HateTargetID);
	}
}
oh, so i can put that on my other mobs not liabach and it will work the same?

the other mobs are immune to melee, only damaged by spells
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 07:36 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