Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2009, 06:49 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default Bot Management Update

With SVN 328 I've made some updates to Angelox's BotCount code.

You need the required sql /utils/sql/svn/328_bot_management.sql
This adds a new rule EQOffline:BotCreateCount which allows admins to limit the number of bots a player can create.
I've changed the EQOffline:BotCount rule for readability to EQOffline:BotSpawnCount which controls how many bots a player can have spawned at one time. Additionally, i've added code using these rules to reduce the 'Orphaned Bot' issue. There initially will still be orphaned bots, but the player will be unable to spawn already spawned bots in other zones and a list of all spawned bots and the zone they are in will be displayed. Players will now have to make sure and group thier spawned bots so they don't get orphaned in static zones.

I've included an optional way of managing bots using the perl quest system with /utils/sql/svn/328_optional_bot_management.sql and it works along with the two new rules above.
This adds a new rule EQOffline:BotQuest that when set to true will use a new npc Aediles Thrall in the Bazaar. With this npc, you can make use of a new global variable in the database table quest_globals called bot_spawn_limit. Here's the perl for using this system. It has many changeable global values that can be used to customize the script for your preferences. It is initially set up to allow 0 bots to start and then a new bot at level 10, 15, 20, 25, 30 and 35 for the players group, and then at level 45 the player can begin creating additional raid groups. I have it set up to include trade skills as requirements to gain additional bots plus a platinum cost, but you can customize the script however you like.

Code:
############################################
# ZONE: Bazaar
# DATABASE: PEQ PoP-LoY
# LAST EDIT DATE: January 26, 2009
# VERSION: 1.0
# DEVELOPER: Congdar
#
# *** NPC INFORMATION ***
#
# NAME: Aediles Thrall
# TYPE: NPC
# RACE: Dwarf
# LEVEL: 71
#
# *** ITEMS GIVEN OR TAKEN ***
#
# Fish Rolls ID-13475
# Gnomish Spirits ID-13037
# Small Bowl ID-16939
# Studded Tunics ID-2204
# Banded Bracer ID-3061
# Class 4 Ceramic Hooked Arrows ID-8689
# Flag updates for quest global bot_spawn_limit
#
#
# *** QUESTS INVOLVED IN ***
#
# 1 - Custom Quest - Buying Slaves(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  = 10;
my $firstbotcost   = 100;
my $secondbotlevel = 15;
my $secondbotcost  = 200;
my $thirdbotlevel  = 20;
my $thirdbotcost   = 300;
my $fourthbotlevel = 25;
my $fourthbotcost  = 400;
my $fifthbotlevel  = 30;
my $fifthbotcost   = 500;

# 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    = 1000;
my $nextextracost  = 1500;

sub EVENT_SAY {
   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("Hey der youngster.  Lookin' fer a bit o' [help] with yer adventurin'?");
         }
         if($text=~/Help/i) {
            quest::emote("looks around the room and pauses a few seconds");
            quest::say("Well, I kin sell ye a [product] ye can't find no place else.");
         }
         if($text=~/Product/i) {
            quest::emote("looks around the room again");
            quest::say("Shhh, i'm involved in wut I like ta call A.I.D., I kin [AID] ye in yer adventurin'");
         }
         if($text=~/AID/i) {
            quest::emote("looks around the room again");
            quest::say("It be 'Acquired Individuals Delivery' and it means I kin supply ye with [Individuals].");
         }
         if($text=~/Individuals/i) {
            quest::emote("looks around the room again");
            quest::say("Shhh, not too loud... I kin deliver ye an Individual if yer [interested]?");
         }
         if($text=~/Interested/i) {
            quest::say("Let me tell ye, keepin' up a supply o' Individuals can be a costly endeavor and so's I kin feed 'em I need ye ta be collectin' up sum [supplies] fer me.");
         }
         if($text=~/Supplies/i) {
            quest::say("The Individual will cost ye $firstbotcost platinum pieces an' 4 o' dem Fish Rolls.");
         }
      }
      elsif(($ulevel >= $secondbotlevel) && ($qglobals{bot_spawn_limit} <= 1)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $secondbotcost platinum an' 4 o' dem Gnomish Spirits... heh, dey gets thirsty ya knows.");
         }
      }
      elsif(($ulevel >= $thirdbotlevel) && ($qglobals{bot_spawn_limit} <= 2)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $thirdbotcost platinum an' 4 o' dem Small Bowls... heh, dey needs ta eat outta sumtin' ya knows.");
         }
      }
      elsif(($ulevel >= $fourthbotlevel) && ($qglobals{bot_spawn_limit} <= 3)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $fourthbotcost platinum an' 4 o' dem Studded Tunics ta keeps da Individuals warm.");
         }
      }
      elsif(($ulevel >= $fifthbotlevel) && ($qglobals{bot_spawn_limit} <= 4)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $fifthbotcost platinum an' 4 o' dem Banded Bracers ta keeps da Individuals protected.");
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} <= 5)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $nextbotcost platinum an' 4 o' dem Small Nock Class 4 Ceramic Hooked Arrows for shootin' at dem runaway Individuals.");
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} >= 6)) {
         if($text=~/Hail/i) {
            quest::say("Ahh, a returnin' customer. Are ye [interested] in another Individual?");
         }
         if($text=~/Interested/i) {
            quest::emote("looks around the room");
            quest::say("Shhh, I kin deliver ye another Individual for $nextbotcost platinum an' 4 o' dem Small Nock Class 4 Ceramic Hooked Arrows for shootin' at dem runaway Individuals.");
            quest::say("If ye dun have dem arrows, ye can just pay me $nextextracost platinum.");
         }
      }
      else {
         if($text=~/Hail/i) {
            quest::say("eh? Mind yer own business, go away.");
            quest::settimer("face", 5);
         }
      }
   }
   else {
      if($text=~/Hail/i) {
         quest::say("eh? Mind yer own business, go away!");
         quest::settimer("face", 5);
      }
   }
}

sub EVENT_TIMER {
  if($timer eq "face") {
     my $facemob = $entity_list->GetMobByNpcTypeID(151071);
     $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) && plugin::check_handin(\%itemcount, 13475 => 4)) { #baking
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $secondbotlevel) && ($qglobals{bot_spawn_limit} <= 1)) {
         if(($platinum == $secondbotcost) && plugin::check_handin(\%itemcount, 13037 => 4)) { #brewing
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $thirdbotlevel) && ($qglobals{bot_spawn_limit} <= 2)) {
         if(($platinum == $thirdbotcost) && plugin::check_handin(\%itemcount, 16939 => 4)) { #pottery
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $fourthbotlevel) && ($qglobals{bot_spawn_limit} <= 3)) {
         if(($platinum == $fourthbotcost) && plugin::check_handin(\%itemcount, 2204 => 4)) { #tailoring/smithing
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $fifthbotlevel) && ($qglobals{bot_spawn_limit} <= 4)) {
         if(($platinum == $fifthbotcost) && plugin::check_handin(\%itemcount, 3061 => 4)) { #smithing
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} <= 5)) {
         if(($platinum == $nextbotcost) && plugin::check_handin(\%itemcount, 8689 => 4)) { #fletching
            $success = $qglobals{bot_spawn_limit}+1;
         }
      }
      elsif(($ulevel >= $nextbotlevel) && ($qglobals{bot_spawn_limit} >= 6)) {
         if(($platinum == $nextextracost) || (($platinum == $nextbotcost) && plugin::check_handin(\%itemcount, 8689 => 4))) {
            $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 an Individual! See: '#bot help create' and '#bot spawn' commands.");
         $client->Message(6,"You have $qglobals{bot_spawn_limit} out of quest::spawnbotcount() possible Individuals.");
         $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_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_SIGNAL {
   if($signal == 1) {
      if((defined $qglobals{bot_spawn_limit}) && ($qglobals{bot_spawn_limit} > 0)) {
         quest::say("Hey! No talkin' to da merchandise!");
      }
   }
}
# END of FILE Zone:bazaar -- Aediles_Thrall.pl
Code:
############################################
# ZONE: Bazaar
# DATABASE: PEQ PoP-LoY
# LAST EDIT DATE: January 26, 2009
# VERSION: 1.0
# DEVELOPER: Congdar
#
# *** NPC INFORMATION ***
#
# NAME: Aspen
# TYPE: NPC
# RACE: Wood Elf
# LEVEL: 10
#
# *** QUESTS INVOLVED IN ***
#
# 1 - Custom Quest - Buying Slaves(bots)
#
#
# *** QUESTS AVAILABLE TO ***
#
# 1 - Anyone meeting level requirements
#
#
############################################

sub EVENT_SAY {
   if($text=~/Hail/i) {
      quest::signalwith(151070, 1, 1);
      my $facemob = $entity_list->GetMobByNpcTypeID(151070);
      $npc->FaceTarget($facemob);
   }
}
# END of FILE Zone:bazaar -- Aspen.pl
I have done some limited testing of this code, but I welcome any bug reports.
Reply With Quote
  #2  
Old 02-16-2009, 01:15 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

After I implemented this on my server any characters that previously had bots are unable to spawn them. They show up in #bot list but when they try to summon a previously created bot they get this:

"You cannot spawn any bots."

How can this be resolved so they can still use their old equipped bots yet any future bots must be made through the quest giver?

Would a visit to the quest giver and running through the quests up to their level give them access to their old bots? Or will this just allow them to create new ones?
Reply With Quote
  #3  
Old 02-16-2009, 01:17 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Quote:
Originally Posted by cubber View Post
After I implemented this on my server any characters that previously had bots are unable to spawn them. They show up in #bot list but when they try to summon a previously created bot they get this:

"You cannot spawn any bots."

How can this be resolved so they can still use their old equipped bots yet any future bots must be made through the quest giver?
Did you make the Sql updates too?
I updated here, and my old bots still work fine.
Reply With Quote
  #4  
Old 02-16-2009, 01:30 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

I ran the update in the peq/updates folder after I pulled down peq rev 330. It looked like it combined both 328 bot updates that were in the utils/sql/svn folder.

Looks like the quest gives a character flag whenever you earn a bot. That may be the problem I am seeing. May have to manually flag my old characters.

Code:
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 an Individual! See: '#bot help create' and '#bot spawn' commands.");
         $success = 0;
      }
      else {
         quest::say("I don't need this.");
         plugin::return_items(\%itemcount);
Reply With Quote
  #5  
Old 02-16-2009, 01:36 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Existing bot armies will still be there, but if you use the EQOffline:BotQuest=true then the players will need to go through the quests to get their spawn count up. If you set it to false it will be as it was or you can manually set their bot_spawn_limit value to 71 for a full raid in the quest_globals table.
Reply With Quote
  #6  
Old 02-16-2009, 01:38 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

oops!

I was gonna say, set EQOffline:BotQuest to false , but you beat me to it

They must be defaulted to false, and the optional Sql activates it.
Reply With Quote
  #7  
Old 02-16-2009, 01:42 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

I have it set to true because I would like to use the quest system. I figured there was something like this that was causing the issue. So I basically need to run them through the quests to aquire the proper "character flags" required for them to spawn the bots they currently have.

So this quest does not actually spawn bots for the users dynamically, it just allows them the ability to create an additional bot using the bot commands each time they complete a stage.

I take it this does not affect the change made a while back where any character on the same account can use the same bots? This seems to be all about a spawn limit cap.
Reply With Quote
  #8  
Old 02-16-2009, 01:43 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Correct, this only adds management to the number of bots createable, spawnable and optionally a questable spawn count.
Reply With Quote
  #9  
Old 02-16-2009, 01:44 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

Thank you sir for the clarity!
Reply With Quote
  #10  
Old 02-16-2009, 02:25 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

It seems that Dark Rum cannot be made due to the only place you can get Sugarcane is from Crescent Reach so I've changed the rum to Gnomish Spirits.
Reply With Quote
  #11  
Old 02-16-2009, 11:32 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

Updated Aediles with a fix to the turn in for extra or with arrows and added text identifying small nock type
Reply With Quote
  #12  
Old 02-18-2009, 09:42 AM
laxative
Hill Giant
 
Join Date: Aug 2008
Location: NorthEast
Posts: 115
Default

Greetings,

I was having this exact same issue, thank you for posting the fix. I don't have a userbase for my server yet so I was pretty ticked off to see the "you cannot create any bots" message.

haha, onwards and upwards!

lax.
Reply With Quote
  #13  
Old 02-18-2009, 10:51 AM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

I guess this is getting to the point where it can become live like:

check out http://everquest.allakhazam.com/wiki/EQ:Mercenaries

if you haven't already.
Reply With Quote
  #14  
Old 02-19-2009, 01:34 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default

One thing I noticed with Aediles Thrall is that if you give him the items and the required money in platnium he will give you the flag just fine. But if you give him the items and give him some of the money in plat and the rest in say gold he will eat all the items and the money and give you nothing.

I just tried to hand him 4 gnomish spirits 180 plat and 200 gold to get a flag.

If I remember correctly 200 gold = 20 plat.
Reply With Quote
  #15  
Old 02-19-2009, 02:55 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

it shouldn't eat it if you give him the wrong stuff. make sure you have your perl in the plugins folder up to date. The deal is, he doesn't like anything but plat since that is what he asked for. remember that bootstrutter guy only wanted gold and wouldn't accept plat.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:48 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3