EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   deleveler npc question (https://www.eqemulator.org/forums/showthread.php?t=33517)

rdurbin 05-11-2011 06:42 PM

deleveler npc question
 
here is a script i made for deleveling, but is there a way to get your current xp before deleveling? there two reasons I want this

1)if your halfway to say 20 and you delevel to 5, than go back you will start at the start of level 19...
2)I would like a way to add the xp you earned while deleveling and add it to your current real level when you go back to your level (probably with a penalty like they do in eq2)

Code:

sub EVENT_SAY
{
        if($status>=0)
        {
                if($text=~/yes/i && defined($qglobals{oldlevel}) && $qglobals{oldlevel} eq "hailed")
                {
                        quest::setglobal("oldlevel","Said Yes",4,"S30");
                        $client->Message(13,"ok please note that any pets or buffs you currently have will be
                        removed but you can recast them after your level goes down");
                        $client->Message(5,"you can change your mind if you want, if your ready to proceed just
                        tell me what level you want to be set to");
                }
                elsif($text>0 && $text<$ulevel && $qglobals{oldlevel} eq "Said Yes")
                {
                        quest::setglobal("oldlevel",$ulevel,4,"F");
                        $client->Duck();
                        quest::selfcast(1285);
                        quest::selfcast(331);
                        quest::selfcast(1792);
                        quest::level($text);
                        $client->Stack();
                }
                elsif($qglobals{oldlevel} eq "Said Yes" && ($text<1 || $text>$ulevel) && !($text=~/hail/i))
                {
                        $client->Message(13,"sorry that is not possible");
                        quest::delglobal("oldlevel");
                }
                elsif(defined($qglobals{oldlevel}) && $ulevel<$qglobals{oldlevel} && $text=~/hail/i)
                {
                        $originallevel=$qglobals{oldlevel};
                        $client->Message(5,"Do you wish to restore your level back to $originallevel ?");
                }
                elsif(defined($qglobals{oldlevel}) && $ulevel<$qglobals{oldlevel} && $text=~/yes/i)
                {
                        quest::level($qglobals{oldlevel});
                        $originallevel=$qglobals{oldlevel};
                        $client->Message(5,"Ok you are now restored to your old level of $originallevel");
                        quest::delglobal("oldlevel");
                }
                elsif($text=~/hail/i)
                {
                        $client->Message(5,"Greetings $name, would you like to de-level yourself so you can
                        play with your friends that may be a lower level than you?  You can return
                        to your original level at any time");
                        quest::setglobal("oldlevel","hailed",4,"S10");
                }
                elsif(!defined($qglobals{oldlevel}))
                {
                        $client->Message(13,"if you where talking to me, You took to long to decide");
                        $client->Message(13,"You will need to hail me again if you want to delevel");
                }
        }
        else
        {
                $client->Message(10,"currently this function is in testing, you must be a GM to use it.");
        }
}



All times are GMT -4. The time now is 02:21 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.