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-24-2010, 08:14 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default Level check

I'm just learning how to work with perl. I setup an npc in the PoK, that
ports you back to tutorialb, but this seems to overide the level rule on
the zone. (It sends an 85 toon there)
I was trying to find a way for the script to check for level (15 and higher)
and just give a message instead of porting the toon, if too high.

#zone: poknowledge

sub EVENT_SAY {
if ($text=~/hail/i || $text=~/leave/i) {
quest::say("Ok $name back to the Tutorial you go!");
quest::movepc(189,-105,-127,16);

}
}
Reply With Quote
  #2  
Old 10-24-2010, 09:43 AM
covou
Sarnak
 
Join Date: Jan 2006
Posts: 31
Default

Something like this should work

Code:
sub EVENT_SAY  {
if ($text=~/hail/i || $text=~/leave/i)  {
if($level < 15) {
quest::say("Ok $name back to the Tutorial you go!");
quest::movepc(189,-105,-127,16);
}
else {
quest::say("Sorry $name but you are too experienced to venture here.");
}
}
}
Reply With Quote
  #3  
Old 10-24-2010, 08:23 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Thank you covou, that kind of works, I got a level 16 toon to try and get a port to the tutorial. The toon got the "Entering Tutorial" screen, but it put him in the Nexus with a "You are too high for this zone" message. He didn't get the message from the script.
Reply With Quote
  #4  
Old 10-24-2010, 10:11 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by Huppy View Post
Thank you covou, that kind of works, I got a level 16 toon to try and get a port to the tutorial. The toon got the "Entering Tutorial" screen, but it put him in the Nexus with a "You are too high for this zone" message. He didn't get the message from the script.
There's a rule_value, something like Character::MaxLevelForTutorial. change that to a different number than 10.

should work fine after a reboot
Reply With Quote
  #5  
Old 10-24-2010, 10:41 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Oh yes, I have that rule set for 14 (like the "live" servers). I was just trying to get this npc to not port at all, if the level was over 14.
Reply With Quote
  #6  
Old 10-25-2010, 01:59 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default This one works perfect now.

I added a $client->Message line, now any level above 14 gets nothing, except that message.


sub EVENT_SAY {
if ($text=~/hail/i || $text=~/leave/i) {
if ($ulevel < 15) {
quest::say("Ok $name back to the Tutorial you go!");
quest::movepc(189,-105,-127,16);
}
if($ulevel > 14)
{
$client->Message(14,"You are too experienced to go back to the Tutorial $name");

}

}
}
Reply With Quote
  #7  
Old 10-25-2010, 03:02 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

The script covou posted and yours appear to be functionally equivalent. The else in the first script is the same as the extra if you have in yours. Is it possible you didn't reload the quests or restart the server when you tried the first script?
Reply With Quote
  #8  
Old 10-25-2010, 05:43 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

What are you asking about lerx ? The first script I posted, ported anyone of any level to Tutorial. No matter what was set in "rules"
covou gave an added idea of the "else" to help with a level check. That worked in such a way, that the npc still ported to tutorial, but got booted to the Nexus. So I found something else to change it so the npc would not port at all if the player was over level 14, which works good now. It just gives that message. I was testing the functionality of the quest script many times as I went along and modified, redone, reloaded, etc.
Reply With Quote
  #9  
Old 10-25-2010, 06:02 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

I was saying that they did the same thing, but there is a very subtle difference. Your second script uses $ulevel instead of $level.

The only reason I commented is that they looked the same to me, and IMO the else is cleaner than a redundant if check.
Reply With Quote
  #10  
Old 10-25-2010, 06:42 AM
covou
Sarnak
 
Join Date: Jan 2006
Posts: 31
Default

$ulevel is right... i was @ work talking to an extremely irate cusomter while typing the above on my iphone... =/... sorry about that
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 10:45 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3