Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 09-14-2014, 09:47 PM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 905
Default

K, so in order for this to work each NPC in the spawn cycle needs to be unique to that spawn cycle. Other wise random NPCs in the zone will signal the controller and mess up the cycle.

Cycle assumes a 10 minute respawn timer and will spawn a named on the 6th spawn guaranteed.

Code:
#Each NPC in Spawn Cycle including Named

sub EVENT_DEATH {
	#Replace with NPCID of Controller
	quest::signalwith(npcid, 1);
	}
Code:
#Controller
#Script assumes spawn cycle is 10 minutes
#Script assumes controller is the physical location of the spawned npc

sub EVENT_SPAWN {
	$counter == 0;
	#Replace with NPCIDs of Place Holders AND Named NPC
	quest::spawn2(quest::ChooseRandom(npcid,npcid,npcid),0,0,$x,$y,$z,$h);
	}

sub EVENT_TIMER {
	if($timer eq "NPCID_SpawnCycle"); {
		#Replace with NPCIDs of Place Holders AND Named NPC
		quest::spawn2(quest::ChooseRandom(npcid,npcid,npcid),0,0,$x,$y,$z,$h);
		quest::stoptimer("NPCID_SpawnCycle");
		}
	elsif($timer eq "NPCID_Spawned"); {
		#Replace with NPCID of Named NPC
		quest::spawn2(npcid,0,0,$x,$y,$z,$h);
		quest::stoptimer("NPCID_Spawned");
		}	
	}
	
sub EVENT_SIGNAL {
	my $globalname = "NPCID_Controller";
	if ($signal == 1) {
		$counter +=1;
		if (!defined $qglobals($globalname) && ($counter <= 5)) {
			quest::starttimer("NPCID_SpawnCycle",600);
			}
		elsif (!defined $qglobals($globalname) && ($counter == 6)) {
			quest::starttimer("NPCID_Spawned",600);
			$counter == 0;
			}
		}
	}

In the chooserandom to make the named more rare, put more placeholder ids in there. So for a 10% spawn chance you'd need 10 ids in the parenthesis.

This also assumes people are actively killing the spawn. IE this replicates a regular spawn cycle except with a guaranteed named at least once per hour.
__________________
Clumsy's World: Resurgence [2019-Present]
Clumsy's World 2.0 [2014-2016]
Clumsy's World [2006-2012]
Reply With Quote
 


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