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); } } |
Something like this should work
Code:
sub EVENT_SAY { |
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.
|
Quote:
should work fine after a reboot |
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.
|
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"); } } } |
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?
|
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. |
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. |
$ulevel is right... i was @ work talking to an extremely irate cusomter while typing the above on my iphone... =/... sorry about that
|
All times are GMT -4. The time now is 08:13 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.