I finally got around to updating this script as well as my permanent de-leveling script. They still could be written in a much cleaner way, but since they do what I want them to do, I probably won't bother with them any further unless issues pop up.
I will post the exact scripts I run on Storm Haven below, but before them, I just want to post a generic De-Leveling script that any server can use if they wish. Note that for these updated scripts to work, you must be running at least R803 of the google SVN source code or later.
Some notable changes and updates for these scripts:
1. They make full use of Saylinks. All Saylinks are currently set to be Silent.
2. Players can now De-Level at any time from any level to any level as long as the level they want to go to is below the highest level they have ever reached.
3. Messages are now only sent to the client and are color coded in Tan to be easy to read, but still easy to tell that that they aren't seen by other players.
4. Spacer added between each text message to make them easier to read since the saylinks are silent.
5. Because of note 3 and 4, these quests are 100% spam free not counting the initial hail!
Generic Temporary De-Leveling Script:
Code:
#Quest to de-level a character temporarily
sub EVENT_SAY {
#Get the Maximum Level this character has ever reached
my $MaxLevel = quest::getlevel(4);
#Max Level Cap of the server should be set here
my $LevelCap = 75;
#Don't let players restore Levels to higher than the Level Cap of the server
if ($MaxLevel > $LevelCap)
{
$MaxLevel = $LevelCap;
}
#Create Silent Saylinks so this NPC can be interacted with and not show spam for other players
my $level_link = quest::saylink("level", 1);
my $restore = quest::saylink("restore", 1);
my $issues = quest::saylink("issues", 1);
#Spacer between all Text messages to make them easier to read
$client->Message(7, "-");
#get the clean NPC name for the message texts
$NPCName = $npc->GetCleanName();
if($text=~/hail/i && $ulevel < $MaxLevel)
{
$client->Message(315, "$NPCName whispers to you, 'Hello again, $name. Perhaps you are here to [$restore] your previous level? Or, if you like, you can change your level to any other you wish and still return to your maximum level at any time.'");
}
if($text=~/hail/i && $ulevel >= $MaxLevel)
{
$client->Message(315, "$NPCName whispers to you, 'Hello, $name, I can lower your [$level_link] temporarily if you would like. It is useful if you have friends that are lower level and would like to group with them, but don't want to make a new character and start over. If your friends are level 51+, you can group with them and work on AAs that will carry over when you return to normal Level.'");
}
if($text=~/level/i)
{
$client->Message(315, "$NPCName whispers to you, 'The way it works is you simply tell me the level you would like to become and as long as it is lower than the highest level you have reached so far, I will set it for you. Then just speak with me again when you are ready to return to your previous level. I can also tell you about some [$issues] you may encounter when you lower your level.'");
}
if($text >= 1 && $text <= $LevelCap && $text < $MaxLevel)
{
$client->Message(315, "$NPCName whispers to you, 'Simply return to me when you wish to restore your previous level.'");
$client->Message(6, "$NPCName casts a spell and before you know it, you feel young and vibrant again. The world suddenly seems much larger and more intimidating!");
#Change the Character's level to the level requested
quest::level($text);
#Use a few techiques to ensure that the player isn't trying to exploit by casting a high level pet before De-Leveling, and remove any existing pets
quest::selfcast(1285);
quest::selfcast(331);
$client->Duck();
$client->Stand();
}
if($text =~/restore/i || $text == $MaxLevel)
{
$client->Message(315, "$NPCName whispers to you, 'You are now restored to your previous maximum level reached so far.'");
$client->Message(6, "$NPCName casts a spell and you instantly feel more powerful! The rush makes you feel like you could take on anything in battle!");
quest::level($MaxLevel);
}
if($text=~/issues/i)
{
$client->Message(315, "$NPCName whispers to you, 'The main issue is that any item above your level will show you as giving the proper stats, but they are lying. You gain no stats from items above your level and monsters are invulnerable to all attacks by weapons above your level. So, you will want to use a set of equipment and weapons that are useable at the level you currently are.'");
}
}
I haven't tried that exact version of the script, but it should work just fine. If there are any issues with it, please let me know and I will correct them.
In order for the ones from Storm Haven below to work properly, they must be used together. You can adjust where needed for max level or whatever, though.
Storm Haven Temporary De-Leveling Script:
Code:
#Rayna Levya - Nexus
#Quest to de-level a character temporarily in exchange for an item
#that can be turned in to return to level 70
sub EVENT_SAY {
my $MaxLevel = quest::getlevel(4);
if ($MaxLevel > 75)
{
$MaxLevel = 75;
}
my $level_link = quest::saylink("level", 1);
my $restore = quest::saylink("restore", 1);
my $dragons = quest::saylink("dragons", 1);
my $banish = quest::saylink("banish", 1);
my $dungeons = quest::saylink("dungeons", 1);
my $issues = quest::saylink("issues", 1);
my $fire = quest::saylink("fire", 1);
my $ice = quest::saylink("ice", 1);
my $fiftytwo = quest::saylink("52");
#Spacer between Text messages to make them easier to read
$client->Message(7, "-");
if($text=~/colors/i && $status > 20)
{
quest::echo(257, "Echoing Color 257"); #slightly brighter than /tell purple
quest::echo(281, "Echoing Color 281"); #/tell purple
quest::echo(18, "Echoing Color 18"); #/tell purple
quest::echo(263, "Echoing Color 263"); #Blue Grey
quest::echo(315, "Echoing Color 315"); #Chat Channel Tan
quest::echo(341, "Echoing Color 341"); #Light Pink
}
if($qglobals{temp_level} == 3 && $ulevel < 70)
{
$client->Message(315, "Rayna Levya whispers to you, 'Hello again, $name. Unfortunately, there is nothing I can do for you until you reach level 70 again.'");
}
if($text=~/hail/i && $ulevel < $MaxLevel && ($qglobals{temp_level} != 3 || $ulevel >= 70))
{
$client->Message(315, "Rayna Levya whispers to you, 'Hello again, $name. Perhaps you are here to [$restore] your previous level? Or, if you like, you can change your level to any other you wish and still return to your maximum level at any time.'");
}
if($text=~/hail/i && $ulevel == $MaxLevel)
{
$client->Message(315, "Rayna Levya whispers to you, 'Hello, $name, I can lower your [$level_link] temporarily if you would like. It is useful if you have friends that are lower level and would like to group with them, but don't want to make a new character and start over. If your friends are level 51+, you can group with them and work on AAs that will carry over when you return to level 70.'");
}
if($text=~/level/i && $ulevel >= 70)
{
$client->Message(315, "Rayna Levya whispers to you, 'The way it works is you simply tell me the level you would like to become and as long as it is lower than the highest level you have reached so far, I will set it for you. Then just speak with me again when you are ready to return to your previous level. I can also tell you about some [$issues] you may encounter when you lower your level.'");
}
if($text >= 1 && $text <= 75 && $text < $MaxLevel && ($qglobals{temp_level} != 3 || $ulevel >= 70))
{
$client->Message(315, "Rayna Levya whispers to you, 'Simply return to me when you wish to restore your previous level.'");
$client->Message(6, "Rayna Levya casts a spell and before you know it, you feel young and vibrant again. The world suddenly seems much larger and more intimidating!");
quest::level($text);
quest::selfcast(1285);
quest::selfcast(331);
$client->Duck();
quest::setglobal("temp_level", 1, 5, "F");
$client->Stand();
}
if($text >= 1 && $text <= 75 && $text == $MaxLevel && ($qglobals{temp_level} != 3 || $ulevel >= 70))
{
$client->Message(315, "Rayna Levya whispers to you, 'You are now restored to your previous maximum level reached so far.'");
$client->Message(6, "Rayna Levya casts a spell and you instantly feel more powerful! The rush makes you feel like you could take on anything in battle!");
quest::level($MaxLevel);
quest::setglobal("temp_level", 2, 5, "F");
}
if ($text =~/restore/i && ($qglobals{temp_level} != 3 || $ulevel >= 70))
{
$client->Message(315, "Rayna Levya whispers to you, 'You are now restored to your previous maximum level reached so far.'");
$client->Message(6, "Rayna Levya casts a spell and you instantly feel more powerful! The rush makes you feel like you could take on anything in battle!");
quest::level($MaxLevel);
quest::setglobal("temp_level", 2, 5, "F");
}
if($text=~/dragons/i && $ulevel >= 53)
{
$client->Message(315, "Rayna Levya whispers to you, 'Oh, so it is the great dragons you seek? Well, you can't likely fight them like that! They refuse to fight anyone who is too much of a threat and will [$banish] you if you try.'");
}
if($text=~/banish/i)
{
$client->Message(315, "Rayna Levya whispers to you, 'If you absolutely must battle the dragons, I can assist you by stealing your experience and returning you to level [$fiftytwo]. You can get the experience back from me whenever you like by returning the item I give you. Ask about the dragons again when you are the right level.'");
}
if($text=~/dragons/i && $ulevel <= 52)
{
$client->Message(315, "Rayna Levya whispers to you, 'There! Now you are ready to travel to their [$dungeons] whenever you wish. I can also tell you more about some [$issues] with your new level as well.'");
}
if($text=~/dungeons/i && $ulevel <= 52)
{
$client->Message(315, "Rayna Levya whispers to you, 'There are 2 great dragons that you should seek in this epic quest, and when you are ready, just ask to be sent to either the dungeon of [$fire] or the dungeon of [$ice].'");
}
if($text=~/issues/i)
{
$client->Message(315, "Rayna Levya whispers to you, 'The main issue is that any item above your level will show you as giving the proper stats, but they are lying. You gain no stats from items above your level and monsters are invulnerable to all attacks by weapons above your level. So, you will want to use a set of equipment and weapons that are useable at the level you currently are.'");
}
if ($text =~/fire/i && $ulevel <= 52)
{
$client->Message(315, "Rayna Levya whispers to you, 'Good luck on your fight!'");
$client->Message(6, "Rayna Levya creates a small ball of fire in her hands and you can feel your temperature rise as everything fades to black.");
quest::movepc(32, -824.1,-1273.2,86.2);
}
if ($text =~/ice/i && $ulevel <= 52)
{
$client->Message(315, "Rayna Levya whispers to you, 'Off ya go!'");
$client->Message(6, "Rayna Levya starts breathing heavily and you begin to see the frost of her breath and then only darkness.");
quest::movepc(73, -32.1,1019,3.1);
}
}
Storm Haven Permanent De-Leveling Script:
Code:
#Hena Levya - Nexus
#Permanent De-level Quest for access to PoTimeA
sub EVENT_SAY {
$timestamp = localtime(time);
my $price = quest::saylink("price", 1);
my $more = quest::saylink("more", 1);
my $why = quest::saylink("why", 1);
my $another = quest::saylink("another", 1);
my $sacrifice = quest::saylink("sacrifice", 1);
my $sacrificeagain = quest::saylink("sacrifice again", 1);
my $time = quest::saylink("time", 1, "Plane of Time A");
#Spacer between Text messages to make them easier to read
$client->Message(7, "-");
if ($text=~/hail/i && $ulevel <= 69 && $qglobals{level_quest} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'Hello, $name, if you are here to give me a Golden Ticket, please do. Otherwise scram and don't come back until you reach level 70.'");
}
if ($text=~/hail/i && $ulevel >= 70 && $qglobals{level_quest} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'Hello, $name, I have a type of quest for you that you have most likely never heard of before. Let's just say it doesn't come without a heavy [$price].'");
}
if ($text=~/hail/i && $qglobals{level_quest} == 1)
{
$client->Message(315, "Hena Levya whispers to you, 'Hello again, $name! Anytime you wish to travel to the [$time], I will send you straight there. If you want to know [$more] about this part of Time, just ask. If you wish to make [$another] sacrifice, I can tell you what the rewards are for doing it again.'");
}
if ($text=~/price/i && $ulevel >= 70 && $qglobals{level_quest} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'If you are willing to give up your seasoned level 70+ experience to me and return to level 1 permanently, I can give you access to a place that normal adventures are unable to get to. There are treasures to be found there that cannot be found anywhere else. Would you like to hear [$more]?'");
}
if ($text=~/more/i && $ulevel >= 70 && $qglobals{level_quest} == undef && $qglobals{max_level} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'If you are ready to make this great [$sacrifice], just say the word and I will take your experience right now! If you would like to know more reasons of [$why] you might want to de-level, I can tell you. Be warned that this [$sacrifice] is permanent and you will have to gain all of your experience again on your own. You will also get a Golden Ticket that will allow you to bring 1 person of any level with you.'");
}
if ($text=~/more/i && $ulevel >= 70 && $qglobals{level_quest} == undef && $qglobals{max_level} >= 71)
{
$client->Message(315, "Hena Levya whispers to you, 'If you are ready to make this great [$sacrifice], just say the word and I will take your experience right now! If you would like to know more reasons of [$why] you might want to de-level, I can tell you. Be warned that this [$sacrifice] is permanent and you will have to gain all of your experience again on your own. You will also get a Golden Ticket that will allow you to bring 1 person of any level with you.'");
$client->Message(315, "Hena Levya whispers to you, 'If you are over level 70, you can return to your max level again by speaking to my sister, Rayna, once you have leveled back up to 70 again.'");
}
if ($text=~/more/i && $qglobals{level_quest} == 1)
{
$client->Message(315, "Hena Levya whispers to you, 'This part of time has 5 different sections to it. Each section is a different level of challenge. The Timekeepers in front of the bridges will tell you how hard each section is.'");
}
if ($text=~/why/i && $ulevel >= 70 && $qglobals{level_quest} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'De-leveling is mainly for players who like to solo often, or who prefer to level instead of raiding. If you find yourself getting bored here, you may want to give it a try. You won't be able to gain items that are the quality of raid items, but you can get fun things that may make you more efficient at soloing. Also, if you are planning to help level a friend or alt, de-leveling is a great way to do so, as it allows you to bring 1 friend with you.'");
}
if ($text=~/another/i && $qglobals{level_quest} == 1 && $qglobals{max_level} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'If you are willing to make the [$sacrificeagain], I am always willing to take your experience for myself right now when you say the words. After the first initial sacrifice, the reward is 2 Golden Tickets to Time for any further sacrifices. This will allow you to bring 2 extra adventurers with you if you wish.'");
}
if ($text=~/another/i && $qglobals{level_quest} == 1 && $qglobals{max_level} >= 71)
{
$client->Message(315, "Hena Levya whispers to you, 'If you are willing to make the [$sacrificeagain], I am always willing to take your experience for myself right now when you say the words. After the first initial sacrifice, the reward is 2 Golden Tickets to Time for any further sacrifices. This will allow you to bring 2 extra adventurers with you if you wish.'");
$client->Message(315, "Hena Levya whispers to you, 'If you are over level 70, you can return to your max level again by speaking to my sister, Rayna, once you have leveled back up to 70 again.'");
}
if ($text=~/sacrifice/i && $ulevel <= 69)
{
$client->Message(315, "Hena Levya whispers to you, 'You must reach level 70 before your experience is worth the sacrifice to me.'");
}
if ($text=~/sacrifice/i && $ulevel >= 70 && $qglobals{temp_level} == 1)
{
$client->Message(315, "Hena Levya whispers to you, 'You must speak with my sister, Rayna, to restore your level before I can allow you to make any sacrifices.'");
}
if ($text=~/sacrifice/i && $ulevel >= 70 && $qglobals{level_quest} == undef && $qglobals{temp_level} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'You have made a great sacrifice! Hopefully the rewards prove to be well worth it.'");
$client->Message(15, "You have received a flag to access the Plane of Time A");
quest::write("text_files/sacrifice.txt","[$timestamp]:$name, the $class, sacrificed for the first time.");
quest::setglobal("level_quest", 1, 5, "F");
quest::setglobal("temp_level", 3, 5, "F");
quest::summonitem(2422);
quest::selfcast(1285);
quest::selfcast(331);
quest::movepc(152, 28,350,-44);
quest::level(1);
}
if ($text=~/sacrifice/i && $ulevel >= 70 && $qglobals{level_quest} == undef && $qglobals{temp_level} == 2)
{
$client->Message(315, "Hena Levya whispers to you, 'You have made a great sacrifice! Hopefully the rewards prove to be well worth it.'");
$client->Message(15, "You have received a flag to access the Plane of Time A");
quest::write("text_files/sacrifice.txt","[$timestamp]:$name, the $class, sacrificed for the first time.");
quest::setglobal("level_quest", 1, 5, "F");
quest::setglobal("temp_level", 3, 5, "F");
quest::summonitem(2422);
quest::selfcast(1285);
quest::selfcast(331);
quest::movepc(152, 28,350,-44);
quest::level(1);
}
if ($text=~/sacrifice again/i && $ulevel >= 70 && $qglobals{level_quest} == 1 && $qglobals{temp_level} == undef)
{
$client->Message(315, "Hena Levya whispers to you, 'You have made another great sacrifice! I grow more in power with each one!'");
quest::write("text_files/sacrifice.txt","[$timestamp]:$name, the $class, sacrificed again!~~~");
quest::setglobal("temp_level", 3, 5, "F");
quest::summonitem(2422);
quest::summonitem(2422);
quest::selfcast(1285);
quest::selfcast(331);
quest::movepc(152, 28,350,-44);
quest::level(1);
}
if ($text=~/sacrifice again/i && $ulevel >= 70 && $qglobals{level_quest} == 1 && $qglobals{temp_level} == 2)
{
$client->Message(315, "Hena Levya whispers to you, 'You have made another great sacrifice! I grow more in power with each one!'");
quest::write("text_files/sacrifice.txt","[$timestamp]:$name, the $class, sacrificed again!~~~");
quest::setglobal("temp_level", 3, 5, "F");
quest::summonitem(2422);
quest::summonitem(2422);
quest::selfcast(1285);
quest::selfcast(331);
quest::movepc(152, 28,350,-44);
quest::level(1);
}
if ($text =~/time/i && $qglobals{level_quest} == 1)
{
$client->Message(315, "Hena Levya whispers to you, 'Few journey to the Plane of Time, but even fewer return. So be careful!'");
$client->Message(6, "A beam of light surrounds your body, and particle by particle your entire being is relocated.");
quest::movepc(219, 300,-150,8.3);
}
}
sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount, 2422 => 1) && ($qglobals{level_quest} == undef))
{
quest::say("The person who gave this to you has made a great sacrifice to get this item for you.");
$client->Message(15, "You have received a flag to access the Plane of Time A");
quest::setglobal("level_quest", 1, 5, "F");
}
else
{
plugin::return_items(\%itemcount);
quest::say("I have no use for this item from you, $name. Take it back.");
}
}
Enjoy 
Last edited by trevius; 07-22-2009 at 06:08 PM..
|