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 08-20-2012, 10:53 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default Help with player.pl

I am having a huge issue with player.pl quests. I'm trying to limit the level globally by using a quest. It seems to only work randomly. I don't know if it is how it is written, but some people are basically immune to it; however, it works properly with other people. I honestly cannot figure it out.
Here is the script..
Code:
sub EVENT_LEVEL_UP{
  if (!defined($qglobals{maxlevel}) || $ulevel>=$qglobals{maxlevel}) {
   quest::setglobal("maxlevel", $ulevel, 5, "F");
 }
 elsif (($ulevel == 51) && (!defined($qglobals{kunarkflag}))){
  $client->Message(5,"Congratulations on reaching level 51! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock Kunark. This will avoid any possible bugs resulting from you trying to level beyond 51.");
 }
 elsif (($ulevel== 60) && (!defined($qglobals{powerflag}))){
  $client->Message(5,"Congratulations on reaching level 60! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock The Planes of Power. This will avoid any possible bugs resulting from you trying to level beyond 60.");
 }
elsif (($ulevel>51 && $ulevel<60) && (!defined($qglobals{kunarkflag}))){
  quest::settimer("delevela", 1);
  $client->Message(5,"You can not yet go past level 51");
  }
elsif (($ulevel >60) && (!defined($qglobals{powerflag}))){
  quest::settimer("delevelb", 1);
  $client->Message(5,"You can not yet go past level 60");
 }
 else{}
}
 sub EVENT_TIMER{
  if ($timer eq "delevela"){
   $client->SetLevel(51);
   quest::stoptimer("delevela");
  }
  elsif ($timer eq "delevelb"){
   $client->SetLevel(60);
   quest::stoptimer("delevelb");
  }
  else{}
}
Ok now, I have that script copied into every single player.pl in each zone. I have also tried putting it in the global_player.pl in templates, player.pl in templates, both at the same time, using one and not the other, and any combination. No matter what, I cannot get this to affect every character on the server. Also, should I have player and global_player in the templates folder at the same time?
Reply With Quote
  #2  
Old 08-21-2012, 12:49 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

looking in the source code, this is the order of precedence for player.pl:

1. /quests/zone/player_v#.pl
2. /quests/zone/player.pl
3. /quests/templates/player.pl

and global_player.pl is only read from /quests/templates/
Reply With Quote
  #3  
Old 08-21-2012, 11:39 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I have confirmed that it is in all of the zone folders and templates under player.pl. Can anyone think of any reason at all that this quest just does not affect many people? Like it works on all of my characters and several others, but some people just are not affected by it.
Reply With Quote
  #4  
Old 08-21-2012, 11:44 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I modified the script slightly to make people not have max experience and therefore not level up every time they killed something.

Code:
sub EVENT_LEVEL_UP{
  if (!defined($qglobals{maxlevel}) || $ulevel>=$qglobals{maxlevel}) {
   quest::setglobal("maxlevel", $ulevel, 5, "F");
 }
 elsif (!defined($qglobals{kunarkflag}) && $ulevel==51){
  $client->Message(5,"Congratulations on reaching level 51! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock Kunark. This will avoid any possible bugs resulting from you trying to level beyond 51.");
 }
 elsif (!defined($qglobals{powerflag}) && $ulevel==60){
  $client->Message(5,"Congratulations on reaching level 60! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock The Planes of Power. This will avoid any possible bugs resulting from you trying to level beyond 60.");
 }
elsif (!defined($qglobals{kunarkflag}) && $ulevel>=52 && $ulevel<=60){
  quest::settimer("delevela", 1);
  $client->Message(5,"You can not yet go past level 51");
  }
elsif (!defined($qglobals{powerflag}) && $ulevel>=61){
  $client->Message(5,"You can not yet go past level 60");
  quest::settimer("delevelb", 1);
 }
 else{}
}
 sub EVENT_TIMER{
  if ($timer eq "delevela"){
   $client->SetEXP(180000000, 0, false);
   $client->SetLevel(51);
   quest::stoptimer("delevela");
  }
  elsif ($timer eq "delevelb"){
   $client->SetEXP(620000000, 0, false);
   $client->SetLevel(60);
   quest::stoptimer("delevelb");
  }
  else{}
}
I'm really having a hard time figuring out and sort of reason why this only works on some characters. I can confirm the people do not have the necessary flags.
Reply With Quote
  #5  
Old 08-22-2012, 12:36 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

always start with the simple things first. are you 1000000000% certain the logic is the same and present in every zone's folder? what about bothunder, for example? i know that zone already had an existing player.pl file due to the fact it is required for access to the towers. are you just as certain that you have a zone folder for every zone players can access? i don't know off the top of my head if every zone has one.

also, it's best to cut down on possibility for error where possible. you don't need a player.pl file in templates if you have one in every zone's folder, as the one in the zone's folder takes precedence. you don't need the empty else{} blocks in the scripts either.
Reply With Quote
  #6  
Old 08-22-2012, 12:54 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Well, I meant that I have the script in every zone that had a pre-existing player.pl. The player.pl in the templates is meant to cover the zones that did not already have pre-existing ones. Now what I mean by some players are exempt to this script are there can be two players side by side. Both of them can be level 55 and neither of them have the required Kunark flag. I will do #level 50 on both of them. Then, I will do #level 51 which levels them up to the max level. Although both of them have the exact same flags, one of them will get the you have reached the max level message, and the other person will not. On doing #level 52, the person who got the message will go back to 51, and the other person will stay at 52. I have tested it on around 15 different players now on my server, and it really is almost random which players are affected and which aren't.
Reply With Quote
  #7  
Old 08-22-2012, 01:51 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i'm wondering if it's not a wonky issue with the timers. i'd try testing it by removing them from the equation and de-leveling directly in EVENT_LEVEL_UP and then move on from there after ruling that out as the issue.
Reply With Quote
  #8  
Old 08-22-2012, 01:57 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

That was my first idea, but it didn't work on level ups. I tried this, and it seems to be working a little more consistently, actually.
Code:
sub EVENT_LEVEL_UP{
  quest::settimer("flagcheck", 1);
}
 sub EVENT_TIMER{
  if ($timer eq "flagcheck"){
  quest::stoptimer("flagcheck");
    if (!defined($qglobals{maxlevel}) || $ulevel>=$qglobals{maxlevel}) {
   quest::setglobal("maxlevel", $ulevel, 5, "F");
 }
    elsif (!defined($qglobals{kunarkflag}) && $ulevel==51){
  $client->Message(5,"Congratulations on reaching level 51! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock Kunark. This will avoid any possible bugs resulting from you trying to level beyond 51.");
 }
    elsif (!defined($qglobals{powerflag}) && $ulevel==60){
  $client->Message(5,"Congratulations on reaching level 60! This is the maximum level for the current expansion. It is HIGHLY recommended that you set AA experience to 100 percent until you unlock The Planes of Power. This will avoid any possible bugs resulting from you trying to level beyond 60.");
 }
   elsif (!defined($qglobals{kunarkflag}) && $ulevel>=52 && $ulevel<=60){
  quest::settimer("delevela", 1);
  $client->Message(5,"You can not yet go past level 51");
  }
   elsif (!defined($qglobals{powerflag}) && $ulevel>=61){
  $client->Message(5,"You can not yet go past level 60");
  quest::settimer("delevelb", 1);
 }
 }
  elsif ($timer eq "delevela"){
   $client->SetEXP(180000000, 0, false);
   $client->SetLevel(51);
   quest::stoptimer("delevela");
  }
  elsif ($timer eq "delevelb"){
   $client->SetEXP(620000000, 0, false);
   $client->SetLevel(60);
   quest::stoptimer("delevelb");
  }
}
Reply With Quote
  #9  
Old 08-22-2012, 01:59 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i overlooked the part where you clearly stated one person doesn't even get the message they have obtained the max level. apologies... i need sleep.
Reply With Quote
  #10  
Old 08-22-2012, 02:05 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Haha it's ok. I appreciate any feedback or anything that is at least different than what I am doing
Reply With Quote
  #11  
Old 08-22-2012, 09:25 AM
Caryatis2
Banned
 
Join Date: May 2009
Location: earth
Posts: 13
Default

I did the same thing on one of my servers and experienced the same problems. I was able to fix it, however I was editting the source code(Perl is never going to be a good option for this).
Reply With Quote
  #12  
Old 08-22-2012, 01:23 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

How did you do it in the source code?
Reply With Quote
  #13  
Old 08-22-2012, 07:34 PM
Caryatis2
Banned
 
Join Date: May 2009
Location: earth
Posts: 13
Default

I can't remember and I don't have any copies of the source anymore but I did PM it to a few people so when my main account is back from vacation I can let you know and you can ask them to send it to you.
Reply With Quote
  #14  
Old 08-22-2012, 07:39 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Alright, I'd appreciate it
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 07:24 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3