Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2016, 03:55 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
sub EVENT_DEATH_COMPLETE {
	if(quest::ChooseRandom(0..3) == 0) {
		quest::say("I am free of this mortal cell! Prepare for my wrath!");
		quest::spawn(quest::ChooseRandom(123..125), 0, 0, $x, $y, $z);
	}
}
Code:
perl -c checkcode.pl
Reply With Quote
  #2  
Old 10-03-2016, 05:37 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Quote:
Originally Posted by ghanja View Post
Code:
sub EVENT_DEATH_COMPLETE {
	if(quest::ChooseRandom(0..3) == 0) {
		quest::say("I am free of this mortal cell! Prepare for my wrath!");
		quest::spawn(quest::ChooseRandom(123..125), 0, 0, $x, $y, $z);
	}
}
Code:
perl -c checkcode.pl
Thank your for all the feed back and info from everyone. Being able to condense that down to three lines showed me some new stuff. the ChooseRandom I hadn't seen before. Could you use that to pick between numbers that are not X..X but instead a list of numbers. Like if i did ChooseRandom(123, 125, 1001, 2005)? Or even have both ChooseRandom(123, 125, 1001..2005)?
Reply With Quote
  #3  
Old 10-03-2016, 05:41 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by lordnivek1 View Post
Thank your for all the feed back and info from everyone. Being able to condense that down to three lines showed me some new stuff. the ChooseRandom I hadn't seen before. Could you use that to pick between numbers that are not X..X but instead a list of numbers. Like if i did ChooseRandom(123, 125, 1001, 2005)? Or even have both ChooseRandom(123, 125, 1001..2005)?
Yes.

Also, having read atrayas post just now, I see I missed you stated you wanted a 20% chance (4:1 odds), thus change:

Code:
if(quest::ChooseRandom(0..3) == 0) {
to

Code:
if(quest::ChooseRandom(0..4) == 0) {
as the prior is 3:1 odds, or 25% chance.
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 03:41 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