|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
02-12-2013, 08:26 PM
|
Sarnak
|
|
Join Date: Oct 2007
Posts: 78
|
|
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
|
02-12-2013, 08:33 PM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
... an oddity thusfar
|
02-12-2013, 08:35 PM
|
Discordant
|
|
Join Date: Jan 2013
Posts: 284
|
|
The language of scripting, is Perl.
|
02-12-2013, 08:35 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
02-12-2013, 08:40 PM
|
Sarnak
|
|
Join Date: Oct 2007
Posts: 78
|
|
Thanks c0ncrete that was excellent info. Things will deffinatly go much quicker. Thank you so much
|
02-12-2013, 08:58 PM
|
Hill Giant
|
|
Join Date: Oct 2002
Location: Rockville, MD
Posts: 124
|
|
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/
|
02-12-2013, 09:09 PM
|
Discordant
|
|
Join Date: Jan 2013
Posts: 284
|
|
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.");
}
}
|
02-12-2013, 09:36 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
02-12-2013, 09:58 PM
|
Discordant
|
|
Join Date: Jan 2013
Posts: 284
|
|
How do you come to that conclusion?
|
02-12-2013, 10:13 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
02-12-2013, 10:41 PM
|
Discordant
|
|
Join Date: Jan 2013
Posts: 284
|
|
Thank you kind sir.
|
02-14-2013, 08:58 PM
|
Sarnak
|
|
Join Date: Oct 2007
Posts: 78
|
|
Quote:
Originally Posted by Dunge0nMastr
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
|
02-17-2013, 11:12 AM
|
Sarnak
|
|
Join Date: Oct 2007
Posts: 78
|
|
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
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:56 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|