EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   delevel quest (https://www.eqemulator.org/forums/showthread.php?t=33580)

rdurbin 05-18-2011 05:24 AM

delevel quest
 
here is a deleveler quest i made that I put on on my server, thought I would share it incase people wanted it. It saves your exact xp so when you return to your old level, you be right where you were, instead of at start of that level. it also records the xp you start at when you delevel so as you gain xp the difference is recorded and than when you go back to your original level, that difference will be added to your real exp

the npc doesnt exactly tell you what to say but its pretty obvious, when she asks a question just say yes, than when she asks for a level, type the level # for example 10, if you want to delevel to 10.

I have also included delay variables that delete themselves, this is incase you hailed but didnt want to delevel, if you dont answer yes or a level # in a certain period of time you have to hail her again, there is no limit to how long you can stay deleveled tho

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();
                        #$client->Message(13,$client->GetEXP());
                        quest::setglobal("oldexp",$client->GetEXP(),4,"F");
                        quest::selfcast(1285);
                        quest::selfcast(331);
                        quest::selfcast(1792);
                        quest::level($text);
                        quest::setglobal("earnedexp",$client->GetEXP(),4,"F");
                        $client->Stand();
                }
                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});
                        $addedexp=$client->GetEXP()-$qglobals{earnedexp};
                        $client->SetEXP($qglobals{oldexp},0,0);
                        $originallevel=$qglobals{oldlevel};
                        $client->Message(15,"You earned $addedexp XP while deleveled, I will add this to your real level");
                        $client->AddEXP($addedexp);
                        quest::delglobal("oldlevel");
                        quest::delglobal("oldexp");
                }
                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.");
        }
}


Baruuk 10-07-2011 11:56 AM

Is the point of a de-level NPC to allow you to "mentor" those you're grouping with of low level? What happens to attuned armor that has a recc lvl on it?

rdurbin 10-07-2011 03:20 PM

Quote:

Originally Posted by Baruuk (Post 203786)
Is the point of a de-level NPC to allow you to "mentor" those you're grouping with of low level? What happens to attuned armor that has a recc lvl on it?

yes its basically used to group with lower levels, but you could just use it for yourself so you can fight weaker enemies, the xp you earn is added to your real xp when you return to your real level without any penalties, for example in EverQuest 2, which i based this "mentor" script you will earn xp at your mentored level but only a % of it depending of how far you lower your level, since its easier to fight weaker enemies than stronger ones, even if your level is lowered. I made this quite a while ago and have not really made any changed to it but I am thinking of adding a % penalty like they do in everquest 2

I am not sure what happens to armor or weapons that have recommended/required level on them, havent really tested it with those types of items

BooPlumb 10-07-2011 03:46 PM

Ty for this. I like the idea behind it and will probably be using it :D

ChaosSlayerZ 10-07-2011 05:05 PM

when your lev goes down, item with req level from above, simply stop contributing to your char. In case of weapons, you will start receiving message like "you unable to hit your target", until you unequip that weapon

bodi 10-11-2011 11:29 AM

I am testing this guy on my server, if you say "yes" immediately, he still says I took too long to decide.

bodi 10-12-2011 10:43 AM

I dont see a time element in there anywhere? Anyone?

sorvani 10-12-2011 10:57 AM

when you do the initial hail and he asks you if you want to delevel is sets a a variable for 10 seconds

quest::setglobal("oldlevel","hailed",4,"S10");

did you remember to turn on qglobals for the NPC?

bodi 10-12-2011 11:14 AM

how do you do that?

revloc02c 10-12-2011 04:49 PM

It is in the npc_types table, set the qglobal column to 1 for the NPC running the Perl script.


All times are GMT -4. The time now is 09:01 AM.

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