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-09-2012, 02:56 PM
MaxDarkhart
Fire Beetle
 
Join Date: Jun 2010
Posts: 4
Post Help spawning a mob randomly in 1 of 3 possible locations

I am creating a custom instance. I need to figure out how to get a boss mob to randomly spawn in any one of three possible pre-determined locations when the instance opens. That way no one knows exactly where the boss is when they zone into the instance.

It is a solo instance with a duration of an hour and if the player dies they can get back into the same instance to finish their task. I would prefer once the instance starts the boss stays in his original place until the instance ends.

When a new instance is started the boss is hopefully in another of the three locations.

I have been searching the forums for days and I have a feeling it can be done with spawn2, spawnentry and spawngroup settings in the database but I am just not seeing the correlations.

Any help would be greatly appreciated, many thanks in advance.
Reply With Quote
  #2  
Old 09-09-2012, 07:49 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i've never really messed with instances, but i assume that you should be able to use the zone's player.pl or an invisible "controller" npc script and select a random spawn location by using one of the quest spawning methods. if the zone used in the instance is also a regularly accessible zone, i don't know off the top of my head how you'd go about making sure the boss didn't spawn anywhere but an instanced zone.

EDIT: i'm guessing the instance version and corresponding version of the script you used would allow you to make sure the boss didn't spawn elsewhere.

Last edited by c0ncrete; 09-09-2012 at 07:55 PM.. Reason: brain fart
Reply With Quote
  #3  
Old 09-09-2012, 10:32 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

You could make an invisible npc with a quest like
sub EVENT_SPAWN{
quest::signalwith (xxxxx, quest:: ChooseRandom(1, 2,3));
}

Then spawn an npc with id xxxxx in the same instance with a quest like
sub EVENT_SIGNAL{
if ($signal == 1){
quest:: spawn2(...);
}
....

and do that for each signal
Reply With Quote
  #4  
Old 09-10-2012, 12:02 AM
MaxDarkhart
Fire Beetle
 
Join Date: Jun 2010
Posts: 4
Post

Quote:
Originally Posted by c0ncrete View Post
i've never really messed with instances, but i assume that you should be able to use the zone's player.pl or an invisible "controller" npc script and select a random spawn location by using one of the quest spawning methods. if the zone used in the instance is also a regularly accessible zone, i don't know off the top of my head how you'd go about making sure the boss didn't spawn anywhere but an instanced zone.

EDIT: i'm guessing the instance version and corresponding version of the script you used would allow you to make sure the boss didn't spawn elsewhere.
First let me say, I greatly appreciate your response.

I have been racking my brain trying to figure out why this can't be handled with database entries using chance and spawn limits.

I currently have 3 different spawn2 entries with each of the pre-determined locations from the zone the instance is based on that I would like as the spawn points, they are all version 1 same as the instance.

I have one spawnentry associated with the spawngroup below, the npcid of the boss and a 33% chance set to it.

I have one spawngroup with a spawnlimit of 1. This is also the spawngroup that is associated with each of the 3 locations in the spawn2 table.

Other than a headache this hasn't accomplished what I thought it would which was a 33% chance of the boss spawning at any one of the locations in spawn2, instead it just spawns him at the same location each time, I believe it's the first in the list.

From everything I have been reading the past few days this was my best attempt at getting this to work through database settings.

As far as your suggestion is concerned, the extent of my perl programming ability has been mainly just to alter and/or adapt scripts I have pulled from these forums. Very trial and error. I am still learning as I go and although I understand what you are saying, I am presently at a loss on how I would put that together.

I have however run acrossed this post :

http://www.eqemulator.org/forums/showthread.php?t=21138

and I can see a possibility of maybe being able to adapt this script to accomplish what I am trying to do.

I am still very much open to suggestions, examples or links to posts that might help me learn this stuff.

Again, thanks for your help.
Reply With Quote
  #5  
Old 09-10-2012, 12:13 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I feel like this would be the easiest way to do what you want. Say you are making an instance of a zone with version 1, then create two npcs. I'll refer to their IDs as npc1 and npc2. Spawn both of them in arbitrary locations in the zone and edit spawn2 to make sure they are in instance 1. On npc1, put a script like

Code:
sub EVENT_SPAWN{
 quest::signalwith(npc2, quest::ChooseRandom(1, 2, 3);
}
When the instance starts, this npc will spawn and randomly send a value of 1, 2, or 3 to npc2. On npc2, put this script

Code:
sub EVENT_SIGNAL{
 if ($signal == 1)
 {
   quest::spawn2(bossID, 0, 0, boss-x1, boss-y1, boss-z1, boss-h1);
 }
 if ($signal == 2)
 {
   quest::spawn2(bossID, 0, 0, boss-x2, boss-y2, boss-z1, boss-h2);
 }
 if ($signal == 3)
 {
   quest::spawn2(bossID, 0, 0, boss-x3, boss-y3, boss-z3, boss-h3);
 }
}
Be sure you have done #reloadquests before creating the instance, and it should work.
Reply With Quote
  #6  
Old 09-10-2012, 03:34 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

honestly, the only way you can keep the players from knowing where the boss has spawned is to not spawn it immediately, but via script when some sort of criteria is met.

say if a zone had three corridors full of minions, each leading to larger chambers where the boss -could- spawn, you could use the zone's player.pl to pick which of the three areas will have the boss, then have a sub-boss right outside the chamber in question spawn the main boss upon the sub-boss's death. you could use player.pl to randomly select which of the three chambers would spawn the main boss and then send a signal to the appropriate sub-boss.

this way, you don't have to worry about MQ users having an unfair advantage... but on the flip side, trackers won't be able to assist in location of the main boss.

Last edited by c0ncrete; 09-10-2012 at 03:38 AM.. Reason: grammar and clarity
Reply With Quote
  #7  
Old 09-10-2012, 03:57 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

there are several different ways you can implement this via script, each with its own set of pros and cons. it really depends on the details of the scenario and how you want things handled.

feel free to PM me if you want to kick around some ideas. sometimes i honestly have more fun scripting than playing.
Reply With Quote
  #8  
Old 09-10-2012, 07:35 AM
MaxDarkhart
Fire Beetle
 
Join Date: Jun 2010
Posts: 4
Post

@ Randymarsh9

Thank you sir, this I think is exactly what I am looking for. I wasn't quite sure from your first post what you meant with the new functions I have never seen before until I found this:

http://www.eqemulator.net/wiki/wikka...heet#functions

which is gonna make my life a whole lot easier with learning to program the perl quest system with EQEmu. I seriously appreciate your example for clarification. It actually makes sense to me now for the most part. One question though, will the boss location change if the player dies and re-enters the instance and if so is there a way to prevent it? Thank you SO much for your time and help with this.

@c0ncrete

Thank you for your replies and I may just take you up on some brainstorning since I have such a long way to go with this server and I have alot of novel ideas I would like to try to impliment that I haven't really seen on all the many servers I have played on here thru the years. You are right I too like building as much or more than playing sometimes myself. It is quite the learning process and I like the challenge of making things work that you may not have seen yet in EQEmu. The community is absolutely amazing in what they have created here.

This instance is actually part of an epic revamp of the original bot quest by Congdar I am working on in which you will need to enter at least 4 instances at different levels to get a drop from the main boss to hand in to get your next bot. Hopefully this will help alot with balancing bot play with the overall content. The instance is actually the top floor of Befallen and I have already placed objects to block off access to the other floors so essentially I have the areas behind each of the 3 original unlocked doors to play with. I have also pulled the key from the locked door so it can't be accessed even if you have the original key from befallen. I have created 67 custom befallen mobs at level 20-25 to place along the way to each of the furtherest rooms in each section and would like the boss to spawn randomly in just one of the 3 furtherest rooms per instance, so word of mouth on boss location can't ruin the fun. Not really worried about MQ at this point but I would like to make him untrackable if that works from the database setting. It is a solo instance so I am trying to balance it so it is a good fight for a player and the 1 bot of their choice they have earned so far but death isn't out of the question.

I have to do this at least 3 more times so what I learn here is gonna help my greatly down the road too, I am sure.

Thanks again to both of you for all the help, ideas and solutions, it is greatly appreciated

Max
Reply With Quote
  #9  
Old 09-10-2012, 11:46 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Does it not work with using normal spawngroups (having 3 spawnpoints equal in chance) and limiting the spawn to 1?
Reply With Quote
  #10  
Old 09-10-2012, 11:50 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Quote:
Originally Posted by joligario View Post
Does it not work with using normal spawngroups (having 3 spawnpoints equal in chance) and limiting the spawn to 1?

He said in a previous post that setting the spawnlimit to 1 only uses the first spawnpoint. I'll have to look into that, cause if that's true that needs to be fixed.

But, if that is a problem and once it's fixed then yes using the DB is the best way to do this.
Reply With Quote
  #11  
Old 09-10-2012, 01:19 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Ah. Got wrapped up in all the chatter I missed it. You are right, that would need a fix..
Reply With Quote
  #12  
Old 09-10-2012, 01:30 PM
MaxDarkhart
Fire Beetle
 
Join Date: Jun 2010
Posts: 4
Post

Quote:
Originally Posted by cavedude View Post
He said in a previous post that setting the spawnlimit to 1 only uses the first spawnpoint. I'll have to look into that, cause if that's true that needs to be fixed.

But, if that is a problem and once it's fixed then yes using the DB is the best way to do this.
I checked to make sure since I normally sort descending since all my IDs are at the end of the PEQ DB and far outside your numbering conventions so my content is easy to find and my IDs should hopefully never end up being duplicated by your work on future DBs.

I was wrong it is actually using the last location if you sort ascending.

Thank you very much for looking into this since it seemed to me also that the scenerio layed out in my previous post should have worked for this.
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 11:12 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3