View Single Post
  #4  
Old 07-22-2009, 02:17 AM
Krugus
Sarnak
 
Join Date: Dec 2005
Location: the Void
Posts: 40
Default Merc Quest Script

We have bots enabled on my server so I've modified the Bot quest to fit our needs. Removed the item requirements and changed up the level range and coin cost and of course added saylinks

I've also added a Bot Command Quest script to the bots on my server. You can read more on that topic here

Modified Congdar's Aediles_Thrall.pl quest
Code:
############################################
# ZONE: Bazaar
# DATABASE: PEQ PoP-LoY
# LAST EDIT DATE: July 10, 2009
# VERSION: 1.0
# DEVELOPER: Congdar
# Modified by: Krugus on July 20, 2009
# Mod's are: Removed Item requirements, adjusted coin cost and level req
# and added saylinks
#
# *** NPC INFORMATION ***
#
# NAME: Aediles Thrall
# TYPE: NPC
# RACE: Dwarf
# LEVEL: 71
#
# *** ITEMS GIVEN OR TAKEN ***
##
#
# *** QUESTS INVOLVED IN ***
#
# 1 - Custom Quest - Buying Merc's (bots)
#
#
# *** QUESTS AVAILABLE TO ***
#
# 1 - Anyone meeting level requirements
#
#
############################################

# Some global settings for the quest.  Set them to your preferred levels and plat costs
# Level options for when a character can acquire more slaves(bots)
my $firstbotlevel  = 15;
my $firstbotcost   = 10;
my $secondbotlevel = 25;
my $secondbotcost  = 20;
my $thirdbotlevel  = 30;
my $thirdbotcost   = 40;
my $fourthbotlevel = 35;
my $fourthbotcost  = 80;
my $fifthbotlevel  = 40;
my $fifthbotcost   = 100;

# They have enough for one group, now they start creating raid bots up to the quest::spawnbotcount() limit.
# A rule setting EQOffline:SpawnBotCount of 11 is two full groups including you.
my $nextbotlevel   = 45;
my $nextbotcost    = 100;
my $nextextracost  = 200;
my $qglobals = 0;

sub EVENT_SPAWN {
   quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
}

sub EVENT_ENTER {
   if(quest::botquest()) {
      if(!defined $qglobals{bot_spawn_limit}) {
         quest::setglobal("bot_spawn_limit", 0, 5, "F");
      }
   }
}

sub EVENT_SAY {
my $hel = quest::saylink("help");
my $commd = quest::saylink("command");
my $tal = quest::saylink("talents");
my $indi = quest::saylink("individuals");
my $inst = quest::saylink("interested");
my $novi = quest::saylink("Novice");
my $appr = quest::saylink("Apprentice");
my $expt = quest::saylink("Expert");
my $capt = quest::saylink("Captain");
my $mstr = quest::saylink("Master");
my $army = quest::saylink("Army");
my $cause = quest::saylink("cause");

   if(defined $qglobals{bot_spawn_limit} && (quest::spawnbotcount() > $qglobals{bot_spawn_limit})) {
      if(($ulevel >= $firstbotlevel) && ($qglobals{bot_spawn_limit} <= 0)) {
         quest::settimer("face", 25);
         if($text=~/Hail/i) {
            quest::say("Greetings $name!  Lookin' fer a bit o' $hel with yer adventurin'?");
         }
         if($text=~/help/i) {
            quest::say("You look like the sort that was born to $commd others into battle.");
         }
         if($text=~/command/i) {
            quest::say("I belong to a discreet group of mercenaries that sell our $tal to those we deem fit to command.");
         }
         if($text=~/talents/i) {
            quest::say("We have a wide varity of $indi, who vary in skill and talent.");
         }
         if($text=~/individuals/i) {
		quest::say("Need a lockpicked? got ya covered.  Need a special critter tracked down? got ya covered.   Need extra muscle? got ya covered!  Need a healer? got ya covered!  You name it we got it!  So are you $inst?");
         }
         if($text=~/interested/i) {
            quest::say("Good! Now that I got your attention.  Here is how it works:  You start off $novi Level Command and with experince and coin you buy your way up the ladder!  Har Har Har!");
         }
         if($text=~/Novice/i) {
            quest::say("At Novice level command rank, you get only one Merc to command at at time.  It will cost $firstbotcost platinum pieces.");
         }
      }
      elsif(($ulevel >= $secondbotlevel) && ($qglobals{bot_spawn_limit} <= 1)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer.  Reports in from the Filed says you are ready to command another Rank.  Are you read to upgrade to $appr?");
         }
         if($text=~/Apprentice/i) {
		quest::say("At Apprentice level command rank, you get to command two Merc's at a time.  It will cost $secondbotcost platinum for the upgraded rank.");
         }
      }
      elsif(($ulevel >= $thirdbotlevel) && ($qglobals{bot_spawn_limit} <= 2)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer.  Reports in from the Filed says you are ready to command another Rank.  Are you read to upgrade to $expt?");
         }
         if($text=~/Expert/i) {
            quest::emote("looks around the room");
		quest::say("At Expert level command rank, you get to command three Merc's at a time.  It will cost $thirdbotcost platinum for the upgraded rank.");
         }
      }
      elsif(($ulevel >= $fourthbotlevel) && ($qglobals{bot_spawn_limit} <= 3)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer.  Reports in from the Filed says you are ready to command another Rank.  Are you read to upgrade to $capt?");
         }
         if($text=~/Captain/i) {
            quest::say("At Captain level command rank, you get to command four Merc's at a time.  It will cost $fourthbotcost platinum for the upgraded rank.");
         }
      }
      elsif(($ulevel >= $fifthbotlevel) && ($qglobals{bot_spawn_limit} <= 4)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer.  Reports in from the Filed says you are ready to command another Rank.  Are you read to upgrade to $mstr?");
         }
         if($text=~/Master/i) {
            quest::say("At Master level command rank, you get to command five Merc's at a time.  It will cost $fifthbotcost platinum for the upgraded rank.");
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} <= 5)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, Your make'n quite a name for yourself!  I see you ARE fit for command!  I see you are wanting to start your own little privite $army");
         }
         if($text=~/Army/i) {
            quest::emote("looks around the room");
            quest::say("If ya need another warm body for your cause, I can see that you get to command six Merc's at a time for the low price of $nextbotcost platinum.");
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} >= 6)) {
         if($text=~/Hail/i) {
            quest::say("Need another for your $cause?");
         }
         if($text=~/cause/i) {
            quest::say("If ya needings another warm body for your cause.  I can get ya another Merc to join yas for just another mere $nextbotcost platinum.");
         }
      }
      else {
         if($text=~/Hail/i) {
            quest::say("eh? Come back when yer a bit more experinced and coin purse abit heavier. Only then I kin help ye.");
            quest::settimer("face", 5);
         }
      }
   }
   else {
      if($text=~/Hail/i) {
         quest::say("eh? Mind yer own business, go away!");
         quest::settimer("face", 5);
         my $sbcount = quest::spawnbotcount();
         $client->Message(6,"You have $qglobals{bot_spawn_limit} out of $sbcount possible Merc's.");
      }
   }
}

sub EVENT_TIMER {
  if($timer eq "face") {
     my $facemob = $entity_list->GetMobByNpcTypeID(151071);#NPC: Aspen
     $npc->FaceTarget($facemob);
     quest::stoptimer("face");
  }
}

sub EVENT_ITEM {
   if(defined $qglobals{bot_spawn_limit} && (quest::spawnbotcount() > $qglobals{bot_spawn_limit})) {
      my $success = 0;
      if(($ulevel >= $firstbotlevel) && ($qglobals{bot_spawn_limit} <= 0)) {
         if(($platinum == $firstbotcost)) { 
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $secondbotlevel) && ($qglobals{bot_spawn_limit} <= 1)) {
         if(($platinum == $secondbotcost)) { 
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $thirdbotlevel) && ($qglobals{bot_spawn_limit} <= 2)) {
         if(($platinum == $thirdbotcost)) { 
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $fourthbotlevel) && ($qglobals{bot_spawn_limit} <= 3)) {
         if(($platinum == $fourthbotcost)) {
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $fifthbotlevel) && ($qglobals{bot_spawn_limit} <= 4)) {
         if(($platinum == $fifthbotcost)) {
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} <= 5)) {
         if(($platinum == $nextbotcost)) {
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} >= 6)) {
         if(($platinum == $nextextracost) || ($platinum == $nextbotcost)) {
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      if($success > 0) {
         quest::say("Thanks $name!");
         quest::setglobal("bot_spawn_limit", $success, 5, "F");
         $client->Message(6,"You receive a character flag!");
         $client->Message(6,"You can now create and spawn a Merc! See: '#bot help create' and '#bot spawn' commands.");
         my $sbcount = quest::spawnbotcount();
         $client->Message(6,"You have $success out of $sbcount possible Merc's.");
         $success = 0;
      }
      else {
         quest::say("I don't need this.");
         plugin::return_items(\%itemcount);
         if($platinum != 0 || $gold !=0 || $silver != 0 || $copper != 0) {
            quest::givecash($copper, $silver, $gold, $platinum);
         }
      }
   }
   else {
      quest::say("I don't need this.");
      plugin::return_items(\%itemcount);
      if($platinum != 0 || $gold !=0 || $silver != 0 || $copper != 0) {
         quest::givecash($copper, $silver, $gold, $platinum);
      }
   }
   quest::settimer("face", 45);
}
sub EVENT_SIGNAL {
   if($signal == 1) {
      if((defined $qglobals{bot_spawn_limit}) && ($qglobals{bot_spawn_limit} > 0)) {
         quest::say("Hey! Nothing to see here, Move along!");
      }
   }
}
# END of FILE Zone:bazaar -- Aediles_Thrall.pl
Reply With Quote