EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   LDoN point exchanger (https://www.eqemulator.org/forums/showthread.php?t=35478)

Xiao 06-29-2012 10:32 PM

LDoN point exchanger
 
I got this script 95% done before I found out the client already has this functionality built in after you get max points in a camp. But if your server doesn't hand out LDoN points like candy at a parade, this might come in handy. And it would be really easy to change this to give plat or anything for LDoN points, or to charge plat or whatever to get/convert points. It just takes x amount of points from one theme and puts x amount into another. It's set up to take a tax.

I'm almost positive it would work as is, but it might need some minor tweaking. I was just about to clean it up a little and change some of the text to look prettier when I found out that I didn't need to make the script at all, so it might be a little ugly, too. Feel free to post if you find something I messed up, I'm still learning.

Code:

##########
#LDoN Point Exchanger
#BY XIAO
##########

sub EVENT_SAY
        {
#DEFINE SAYLINKS AND VARIABLES
my $deduct=quest::saylink("deduct");
my $addpoints=quest::saylink("add");
my $gukrem=quest::saylink("Remove from Deepest Guk");
my $mirarem=quest::saylink("Remove from Miragul's Menagerie");
my $mmcatrem=quest::saylink("Remove from Mistmoore Catacombs");
my $rujarkrem=quest::saylink("Remove from Rujarkian Hills");
my $takishrem=quest::saylink("Remove from Takish-Hiz");
my $gukadd=quest::saylink("Add to Deepest Guk");
my $miraadd=quest::saylink("Add to Miragul's Menagerie");
my $mmcatadd=quest::saylink("Add to Mistmoore Catacombs");
my $rujarkradd=quest::saylink("Add to Rujarkian Hills");
my $takishadd=quest::saylink("Add to Takish-Hiz");
my $themenum=0;
my $checkpoints=$client->GetLDoNPointsTheme($themenum);
                if($text=~/hail/i)
                        {
                                $client->Message(15,"Hello there! Would you like to $deduct your LDoN points from one theme, or $addpoints to another? I will deduct this in 1000 point increments. I will have to take a 35% tax, as well. This means that 1000 points will be deducted from the theme of your choice, and 650 will be added to another theme of your choice.");
                        }
                if($text=~/exchange/i)
                        {
                                $client->Message(15,"Very well! First, I must know which theme you wish to remove points from. Would you like to remove points from $gukrem, $mirarem, $mmcatrem, $rujarkrem, or $takishrem? Remember, I am going to take a 35% tax!");
                                if(!defined $qglobal{ldonexchanges})
                                        {
                                                quest::setglobal("ldonexchanges",0,5,"F")
                                        }
                        }
                if($text=~/Remove from Deepest Guk/i)
                        {
                        $themenum=1;
                                if(defined $qglobal{ldonexchanges} && $checkpoints >= 1000)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}+650,5,"F");
                                                $client->UpdateLDoNPoints($checkpoints-1000, $themenum);
                                                $client->Message(15,"You have selected Deepest Guk. I have taken 1000 points from this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $checkpoints < 1000)
                                        {
                                                $client->Message(15,"You do not have enough points in this theme! You need to earn more. You currently have $checkpoints points in this theme, and $qglobal{ldonexchanges} points.");
                                        }
                        }
                if($text=~/Remove from Miragul's Menagerie/i)
                        {
                        $themenum=2;
                                if(defined $qglobal{ldonexchanges} && $checkpoints >= 1000)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}+650,5,"F");
                                                $client->UpdateLDoNPoints($checkpoints-1000, $themenum);
                                                $client->Message(15,"You have selected Miragul's Menagerie. I have taken 1000 points from this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $checkpoints < 1000)
                                        {
                                                $client->Message(15,"You do not have enough points in this theme! You need to earn more. You currently have $checkpoints points in this theme, and $qglobal{ldonexchanges} points.");
                                        }
                        }
                if($text=~/Remove from Mistmoore Catacombs/i)
                        {
                        $themenum=3;
                                if(defined $qglobal{ldonexchanges} && $checkpoints >= 1000)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}+650,5,"F");
                                                $client->UpdateLDoNPoints($checkpoints-1000, $themenum);
                                                $client->Message(15,"You have selected Mistmoore Catacombs. I have taken 1000 points from this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $checkpoints < 1000)
                                        {
                                                $client->Message(15,"You do not have enough points in this theme! You need to earn more. You currently have $checkpoints points in this theme, and $qglobal{ldonexchanges} points.");
                                        }
                        }
                if($text=~/Remove from Rujarkian Hills/i)
                        {
                        $themenum=4;
                                if(defined $qglobal{ldonexchanges} && $checkpoints >= 1000)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}+650,5,"F");
                                                $client->UpdateLDoNPoints($checkpoints-1000, $themenum);
                                                $client->Message(15,"You have selected Rujarkian Hills. I have taken 1000 points from this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $checkpoints < 1000)
                                        {
                                                $client->Message(15,"You do not have enough points in this theme! You need to earn more. You currently have $checkpoints points in this theme, and $qglobal{ldonexchanges} points.");
                                        }
                        }
                if($text=~/Remove from Takish-Hiz/i)
                        {
                        $themenum=5;
                                if(defined $qglobal{ldonexchanges} && $checkpoints >= 1000)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}+650,5,"F");
                                                $client->UpdateLDoNPoints($checkpoints-1000, $themenum);
                                                $client->Message(15,"You have selected Takish-Hiz. I have taken 1000 points from this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $checkpoints < 1000)
                                        {
                                                $client->Message(15,"You do not have enough points in this theme! You need to earn more. You currently have $checkpoints points in this theme, and $qglobal{ldonexchanges} points.");
                                        }
                        }
                if($text=~/add/i)
                        {
                                $client->Message(15,"Which theme would you like to add 650 points to?");
                                $client->Message(15,"$gukadd");
                                $client->Message(15,"$miraadd");
                                $client->Message(15,"$mmcatadd");
                                $client->Message(15,"$rujarkkadd");
                                $client->Message(15,"$takishadd");
                        }
                if($text=~/Add to Deepest Guk/i)
                        {
                        $themenum=1;
                                if(defined $qglobal{ldonexchanges} && $qglobal{ldonexchanges} >= 650)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}-650,5,"F");
                                                quest::addldonpoints(650,$themenum);
                                                $client->Message(15,"You have selected Deepest Guk. I have added 650 points to this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $qglobal{ldonexchanges} < 650)
                                        {
                                                $client->Message(15,"You do not have enough points stored, you will need to $deduct some from a theme.You currently have $qglobal{ldonexchanges} points stored.");
                                        }
                        }
                if($text=~/Add to Miragul's Menagerie/i)
                        {
                        $themenum=2;
                                if(defined $qglobal{ldonexchanges} && $qglobal{ldonexchanges} >= 650)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}-650,5,"F");
                                                quest::addldonpoints(650,$themenum);
                                                $client->Message(15,"You have selected Miragul's Menagerie. I have added 650 points to this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $qglobal{ldonexchanges} < 650)
                                        {
                                                $client->Message(15,"You do not have enough points stored, you will need to $deduct some from a theme.You currently have $qglobal{ldonexchanges} points stored.");
                                        }
                        }
                if($text=~/Add to Mistmoore Catacombs/i)
                        {
                        $themenum=3;
                                if(defined $qglobal{ldonexchanges} && $qglobal{ldonexchanges} >= 650)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}-650,5,"F");
                                                quest::addldonpoints(650,$themenum);
                                                $client->Message(15,"You have selected Mistmoore Catacombs. I have added 650 points to this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $qglobal{ldonexchanges} < 650)
                                        {
                                                $client->Message(15,"You do not have enough points stored, you will need to $deduct some from a theme.You currently have $qglobal{ldonexchanges} points stored.");
                                        }
                        }
                if($text=~/Add to Rujarkian Hills/i)
                        {
                        $themenum=4;
                                if(defined $qglobal{ldonexchanges} && $qglobal{ldonexchanges} >= 650)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}-650,5,"F");
                                                quest::addldonpoints(650,$themenum);
                                                $client->Message(15,"You have selected Rujarkian Hills. I have added 650 points to this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $qglobal{ldonexchanges} < 650)
                                        {
                                                $client->Message(15,"You do not have enough points stored, you will need to $deduct some from a theme.You currently have $qglobal{ldonexchanges} points stored.");
                                        }
                        }
                if($text=~/Add to Takish-Hiz/i)
                        {
                        $themenum=5;
                                if(defined $qglobal{ldonexchanges} && $qglobal{ldonexchanges} >= 650)
                                        {
                                                quest::setglobal("ldonexchanges",$qglobal{ldonexchanges}-650,5,"F");
                                                quest::addldonpoints(650,$themenum);
                                                $client->Message(15,"You have selected Takish-Hiz. I have added 650 points to this theme. You now have $checkpoints points in this theme, and $qglobal{ldonexchanges} points stored. Would you like to $addpoints these points to another theme now?");
                                        }
                                elsif(!defined $qglobal{ldonexchanges} || $qglobal{ldonexchanges} < 650)
                                        {
                                                $client->Message(15,"You do not have enough points stored, you will need to $deduct some from a theme.You currently have $qglobal{ldonexchanges} points stored.");
                                        }
                        }
        }



All times are GMT -4. The time now is 02:20 PM.

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