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 12-24-2010, 08:10 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default I need some quest help. Scripted boss fight

I actually still need help. I have a bunch of mobs spawned on bleachers in theater zone.

I wanna make certain ones run over and help the bosses during the fight when the boss hits x % hp.

I know how to do the HP events but im not sure how to take individual mobs and make them move. If i put it in a script with their name wouldnt all the mobs with that name move to the location?



After some reading im not sure that can be done. If i can someone lemme know and possibly how to do it, if not ill thing of somthin else.
Reply With Quote
  #2  
Old 12-24-2010, 11:43 PM
Jaekob
Sarnak
 
Join Date: May 2010
Posts: 39
Default

To avoid having every NPC with the same name respond, you can always name your perl file by the NPC ID. So instead of an_orc_pawn.pl you can just have 1003.pl (or whatever). Also certain naming conventions will appear as the same name but will be different NPC ID's. #'s before a name and _'s after will allow you the same NPC appearance with a different script.

There are several different ways to get a NPC to agro at a certain time. Have the first NPC despawn and a KOS replacement spawn during the hp event is probably the easiest way to make it happen. You can also use quest objects to put the PC on the NPC's hate list, thus creating agro.
Reply With Quote
  #3  
Old 12-25-2010, 01:16 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

I mean all my npcs have the same npcid. I would need to move em via theyre spawnID no?

Cant find any quest code to do that
Reply With Quote
  #4  
Old 12-25-2010, 01:27 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Astal View Post
I mean all my npcs have the same npcid. I would need to move em via theyre spawnID no?

Cant find any quest code to do that
Here, this should help you out a bit.

This could probably most appropriately be used on a controller NPC or a boss hp event to control the other NPC's.

Code:
my @NPCLIST = $entity_list->GetNPCList();
			my $NPCToRespond = 555; #NPCID to respond
			my $NPCToBeAttacked = 556; #NPCID to be attacked
			foreach $entity (@NPCLIST){
				if($entity->GetNPCTypeID() == $NPCToRespond) {
				$entity->AddToHateList($NPCToBeAttacked, 1);
				}
			}
Reply With Quote
  #5  
Old 12-25-2010, 01:57 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Akkadius View Post
Here, this should help you out a bit.

This could probably most appropriately be used on a controller NPC or a boss hp event to control the other NPC's.

Code:
my @NPCLIST = $entity_list->GetNPCList();
			my $NPCToRespond = 555; #NPCID to respond
			my $NPCToBeAttacked = 556; #NPCID to be attacked
			foreach $entity (@NPCLIST){
				if($entity->GetNPCTypeID() == $NPCToRespond) {
				$entity->AddToHateList($NPCToBeAttacked, 1);
				}
			}

K ill have to look into it, im not as good at perl as you guys.
Reply With Quote
  #6  
Old 12-27-2010, 11:29 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I haven't tested the script below, but it should work as-is I think. It is similar to what Akkadius posted, but this tells the NPCs to attack a random mob on the boss' hate list. This should let it attack players or pets. The only thing you should need to adjust is the NPCID that you want to assist in your event. Also, note that this script requires the RandomRange() plugin, which I don't think is included in the standard PEQ quests distribution. You can find that plugin in the plugins section of these forums if you don't already have it.

Code:
sub EVENT_SPAWN {

	quest::setnexthpevent(50);
}

sub EVENT_HP {

	if ($hpevent == 50) {
		my $NPCToRespond = 555555; # NPCID to call in to assist
		my @hatelist = $npc->GetHateList();	# Get the NPC's current Hate List
		my $HateCount = @hatelist;	# Total mobs on the NPC's hate list
		my @npclist = $entity_list->GetNPCList();	# Get the full NPC list for the zone
		foreach $ent (@npclist)
		{
			if($ent->GetNPCTypeID() == $NPCToRespond)	# Verify that the current NPC being checked is the NPCID we want
			{
				my $RandomHateNum = plugin::RandomRange(0, $HateCount);	# Choose a random mob in the Hate List array
				my $RandomHateEnt = $hatelist[$RandomHateNum];	# Get the Hate list entry for the selected number of the array
				if ($RandomHateEnt && $RandomHateEnt->GetEnt())	# Verify that the hate entry exists and that we can get the entity
				{
					my $HateEnt = $RandomHateEnt->GetEnt();	# Get the hated entity
					$ent->AddToHateList($HateEnt, 1);	# Tell the current NPC to attack the random mob on the boss' hate list.
				}
			}
		}
	}

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 12-27-2010, 09:59 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

thanks a ton ill try implementing it soon as im not so sick
Reply With Quote
  #8  
Old 12-28-2010, 05:19 PM
Jaekob
Sarnak
 
Join Date: May 2010
Posts: 39
Default

Nice piece of code there Trevius. I might have to make use of that.

You're right about the RandomRange plugin it's not with the current quest package but will be with the next release. Several plugin's got added right after the latest release.
Reply With Quote
  #9  
Old 01-04-2011, 02:01 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Just wanted to let ya know. i tried your code its not working.

The hp event is working I tested it with a shout.


Im using the spawn2 ID for NPCToRespond id number.

Not sure if thats correct or not

Edit: Replaced it with the normal NPCID like 999483 but all the npcs with that ID aggro in the zone lol

I think i need a way to use the Spawn2 ID
Reply With Quote
  #10  
Old 01-04-2011, 04:04 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 541
Default

You have to use the NPCID, make a new NPC for the quest so its got a unique ID.
Reply With Quote
  #11  
Old 01-05-2011, 03:16 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Caryatis View Post
You have to use the NPCID, make a new NPC for the quest so its got a unique ID.
Eh that would require WAY to much work for me. I have about 50 mobs spawned on the bleachers in theater.

Not that worried about it if It cant be done by the spawn2 ids.
Reply With Quote
  #12  
Old 01-05-2011, 06:22 PM
Jaekob
Sarnak
 
Join Date: May 2010
Posts: 39
Default

One way to do this without creating 50 new NPC's is to create one new NPC. When you desire the NPC to attack, send a signal to the NPC, have it depop and then respawn as the new NPC. At the same time the singal is sent, set a timer keyed to start the script Trevius provided which will get you the agro to the random PC fighting the boss. This could be done with one or ten of the 50 NPC's and you could make it happen multiple times over the course of the event.

If you want a exact example let me know and I'll post the .pl's for you to look at of a working event of this nature.
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 07:09 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