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 10-19-2016, 01:50 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

That looks like a general concept.

Run with it!
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #2  
Old 10-19-2016, 02:03 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Well thank you both for the help. I cant wait to get home from work and try some of this out.
Reply With Quote
  #3  
Old 10-19-2016, 02:20 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by lordnivek1 View Post
Well thank you both for the help. I cant wait to get home from work and try some of this out.
Not entirely sure of the "modified" behavior you're looking for, since you've found it's almost surely not possible (at this time) to add an augmented item without source changes.

However, I would use quest::ChooseRandom in place of Perl's rand. Also, know, that rand(4) would produce fractions (i.e. 0.43456, 1.2235, etc.) so that conditional, while it -could- some year be true as you have it written, if you are insistent on using rand(), then:

Code:
my $random = int(rand(3));
Is what you'd be after. Why only 3? Because a pointer to an array element begins at 0, not 1. You have four elements listed, so, 0, 1, 2 and 3 would be valid pointers.

Here is an example of something (without iterating through the %itemcount hash for simplicity, as I'm not sure your comfort level of hashes) utilizing an EVENT_ITEM (i.e. trade) event:

Code:
sub EVENT_ITEM {
	@eligibleitemidarray = (100,200,300,400);
	if (($item1 ~~ @eligibleitemidarray) || 
	($item2 ~~ @eligibleitemidarray) || 
	($item3 ~~ @eligibleitemidarray) || 
	($item4 ~~ @eligibleitemidarray)) {
		my @add_aug1 = ('1000', '1001', '1005', '1007');
		my @add_aug2 = ('5000', '5001', '5005', '5007');
		my $random = quest::ChooseRandom(0..3);
		$client->SummonItem(XXX, 0, 1, $add_aug1[$random], $add_aug2[$random])
	}
	else {
		plugin::return_items(\%itemcount);
	}	
}
Reply With Quote
  #4  
Old 10-19-2016, 02:54 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

all my knowledge and familiarity with any of this comes from the wiki introduction to perl scripting, ulitmate perl reference and what I can copy and past from code I find searching the forums/quest folder haha.
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 09:18 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