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 02-12-2013, 08:26 PM
Dabloon
Sarnak
 
Join Date: Oct 2007
Posts: 78
Default Deleveling npc

Is it possible to have an npc reset your level to one and keep track of how many times it delevels you so a limit can be set for how many times you can use the npc? I have seen many deleveling scripts on here but they all seem to allow the player to choose what level to go back to. I would like to find one that only sets your level to one and limits the amount of times you can do it or a tutorial so i can make my own
Reply With Quote
  #2  
Old 02-12-2013, 08:33 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

... an oddity thusfar
Reply With Quote
  #3  
Old 02-12-2013, 08:35 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

The language of scripting, is Perl.
Reply With Quote
  #4  
Old 02-12-2013, 08:35 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

yes. you can use quest globals to store persistent information for characters.

there is information here (towards the bottom of the page), and there are hundreds of examples you can use as a reference in your quests directory.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #5  
Old 02-12-2013, 08:40 PM
Dabloon
Sarnak
 
Join Date: Oct 2007
Posts: 78
Default

Thanks c0ncrete that was excellent info. Things will deffinatly go much quicker. Thank you so much
Reply With Quote
  #6  
Old 02-12-2013, 08:58 PM
Dunge0nMastr
Hill Giant
 
Join Date: Oct 2002
Location: Rockville, MD
Posts: 124
Default

i would use quest globals.

Code:
sub EVENT_SAY {
my $globalname = "delvl"; #w/e you want

if (!defined $qglobals{$globalname}) {
	quest::level(1); #or w/e level you want here
	quest::setglobal("$globalname",1,5,'F');
	}
}
#this would prevent the player from doing it more than 1 time by using a quest global, obviously you can spruce up the script but this is the basics for what your looking for, ill let ya play with it form there :P
__________________
Bront -Server Admin/Owner and Lead Quest Dev for Kildrukaun's Prophecy
http://kpemu.com/
Reply With Quote
  #7  
Old 02-12-2013, 09:09 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

Something like this maybe? This limits you to two resets.

Code:
sub EVENT_SAY
{
	if($text=~/Hail/i && !defined $qglobals{Resets} && $ulevel == 70)
	{
		quest::level(1);
		quest::setglobal("Resets", "1", "5", "F");
		plugin::Whisper("You are now 1st Rebirth!");
	}
	elsif($text=~/Hail/i && $ulevel == 70 && defined $qglobals{Resets} == 1)
	{
		quest::level(1);
		quest::setglobal("Resets", "2", "5", "F");
		plugin::Whisper("You are now 2nd Rebirth!");
	}
	elsif($text=~/Hail/i && $ulevel == 70 && defined $qglobals{Resets} == 2)
	{
		plugin::Whisper("You are the highest rebirth allowed, 2.");
	}
}
Reply With Quote
  #8  
Old 02-12-2013, 09:36 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

defined $qglobals{Resets} == 2 will always return false.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #9  
Old 02-12-2013, 09:58 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

How do you come to that conclusion?
Reply With Quote
  #10  
Old 02-12-2013, 10:13 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

because defined will only return 1 (true) or nothing (false)

Quote:
Returns a Boolean value telling whether EXPR has a value other than the undefined value undef. If EXPR is not present, $_ is checked.
http://perldoc.perl.org/functions/defined.html
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #11  
Old 02-12-2013, 10:41 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

Thank you kind sir.
Reply With Quote
  #12  
Old 02-14-2013, 08:58 PM
Dabloon
Sarnak
 
Join Date: Oct 2007
Posts: 78
Default

Quote:
Originally Posted by Dunge0nMastr View Post
i would use quest globals.

Code:
sub EVENT_SAY {
my $globalname = "delvl"; #w/e you want

if (!defined $qglobals{$globalname}) {
	quest::level(1); #or w/e level you want here
	quest::setglobal("$globalname",1,5,'F');
	}
}
#this would prevent the player from doing it more than 1 time by using a quest global, obviously you can spruce up the script but this is the basics for what your looking for, ill let ya play with it form there :P
That worked great. Thank you for the excellent start. Now let the tinkering begin
Reply With Quote
  #13  
Old 02-17-2013, 11:12 AM
Dabloon
Sarnak
 
Join Date: Oct 2007
Posts: 78
Default

I have successfully written a deleveling script with a level requirement. Will post it here later if anyone is interested. It works great. Thanks to all who helped especially c0ncrete for the link to the perl lessons
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 12:56 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3