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 07-01-2010, 04:46 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

$platinum != 25000 || 50000 || 75000 || 100000 || 125000 || 150000 || 175000 || 200000 || 225000 || 250000

Each condition is checked sequentially independent of the others, bitwise success is anything not 0 while failure is zero.

condition 1: $platinum != 25000 (true if $platinum != 25000)
condition 2: 50000 (always true)
condition 3: 75000 (always true)
condition 4: 100000 (always true)
condition 5: 125000 (always true)
condition 6: 150000 (always true)
condition 7: 175000 (always true)
condition 8: 200000 (always true)
condition 9: 225000 (always true)
condition 10: 250000 (always true)

Because 9/10 of the statements are true and they're all an inclusive disjunction it will always trigger as true. However even if it 'worked' as I imagine you want it to it would still always trigger because there will always be one condition that will evaluate as true.

ex: F v F v F v F v F v T = T

Personally I think you're making it far too complicated; here is how I would accomplish it.

Code:
sub EVENT_SAY
{
	if ($ulevel >=70)
	{
		if ($text =~/hail/i)
		{
			quest::say("Hello, I have heard that AA exp moves rather slowly on this server, so I am here to take advantage of that and sell level 70s [AA].");
		}
		elsif ($text =~/AA/i)
		{
			quest::say("Yes, it is 25K platinum for 5 AAs or 50k platinum for 10 AAs or 75k platinum for 15 AAs or 100k platinum for 20 AAs or 125k platinum for 25 AAs or 150k platinum for 30 AAs or 175k platinum for 35 AAs or 200k platinum for 40 AAs or 225k platinum for 45 AAs or 250k platinum for 50 AAs or . You must be level 70+ and have AA experience turned on to 100% or it will not work!");
		}
		else
		{
			quest::say("You must be level 70+ before I can help you.");
		}
	}
}

sub EVENT_ITEM
{
	if($ulevel >=70)
	{
		if($platinum > 0 && $platinum <= 250000 && ($platinum % 25000) == 0)
		{
			$client->AddAAPoints(5 * int($platinum / 25000));
		}
		else
		{
			quest::givecash($copper, $silver, $gold, $platinum);
			quest::say("That's the wrong amount.");
		}
	}
	else
	{
		quest::say("Reach level 70 first.");
		quest::givecash($copper, $silver, $gold, $platinum);
	}
}
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 01:28 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