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

Development::Bots Forum for bots.

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-22-2007, 09:43 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Here's a helper Bot I started, but have since run out to finish; It actually follows you around and heals, buffs you at your request. I had it working in Gulf of Gunthark, Infact you can test it on the Rathe server;
First, you talk to Cadale Brohat at the vendors in Gunthak;
Code:
#zone: gunthak NPC: Cadale_Brohat (224209)
#Angelox

sub EVENT_SAY { 
if ($text=~/Hail/i){
  quest::emote("smiles widely at you. 'Welcome. You are brave to venture to Broken Skull Rock. Don't mind the others. Everyone is a bit touchy around here. If you are interested in dyes, feel free to peruse what I have to offer. Playing with them has given me hours of entertainment! Just be careful on this rock, and watch your back. Oh, before I forget, I'm looking for someone to help me with some [tasks] that I need to get done. All my time with the dyes has kept me from some of the more important things I need to take care of.'");
  quest::emote("Gets closer and whispers,'Or perhaps you might be interested in hiring some [help]?");
 }
elsif($text=~/help/i){
  quest::emote("chuckles, 'I have some mercenary friends interested in making some plat, they've asked me to handle their [pay]");
}
elsif(($text=~/pay/i)&&($class eq 'Warrior')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Paladin')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Shadowknight')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Ranger')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Monk')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Bard')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Rogue')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif(($text=~/pay/i)&&($class eq 'Berserker')){
  quest::emote("Whispers, 'Not so loud! I'm moonlighting here -  50 plat will get you help tell you leave this world'");
}
elsif($text=~/pay/i){
  quest::says("Sorry, this offer is only for melee-types");
 }
}

sub EVENT_ITEM{
  if ($platinum<=49){
    quest::say("Thank you for your donation $name, it wasn't enough though ...");
}
  elsif (($platinum>=50)&&($sandee==0)){
    quest::emote("summons a mercenary to your side");
    quest::spawn2(224236,1,0,-242.0,1521.1,4.1,108.4);
    quest::say("Here she is, be careful not to wander too far away from her, else she comes back to me");
    quest::delglobal("sandy");
    quest::setglobal("sandy",2,3,"F");
    $sandy=undef;
    $sandee=1;
    quest::delglobal("$name");
    quest::setglobal("$name",3,3,"F");
}
   elsif ($sandy==2){
    quest::say("Sorry, all mercenarys are in use.");
}
   elsif (${$name}==3){
    quest::say("You can only have one at a time.");
}
  elsif (($platinum>=50)&&($sandy==3)){
    quest::emote("summons a mercenary to your side");
    quest::spawn2(224236,1,0,-242.0,1521.1,4.1,108.4);
    quest::say("Here she is, be careful not to wander too far away from her, else she comes back to me");
    quest::delglobal("sandy");
    quest::setglobal("sandy",2,3,"F");
    $sandy=undef;
    quest::delglobal("$name");
    quest::setglobal("$name",3,3,"F");
}else{
    quest::say("Oops! I missed a possibilty!");
 }
}
Then , if you payed the right amount and are the proper class, Brohat will pop you some help - Merc Sandy ( A cool looking female dark elf);
Code:
# Angelox's EQ Bots
#Gunthak healer

sub EVENT_SAY { 
 if($class eq 'Cleric'){quest::say("Sorry, I can't help a cleric");
 }
 elsif($class eq 'Shaman'){
 quest::say("Sorry, I can't help a Shaman");
 }
 elsif($class eq 'Necromancer'){
 quest::say("Sorry, I can't help a Necro");
 }
 elsif($class eq 'Wizard'){
 quest::say("Sorry, I can't help a Wizard");
 }
 elsif($class eq 'Magician'){
 quest::say("Sorry, I can't help a Magician");
 }
 elsif($class eq 'Enchanter'){
 quest::say("Sorry, I can't help a Enchanter");
 }
 elsif($class eq 'Beastlord'){
 quest::say("Sorry, I can't help a Beastlord");
 }
 elsif($text=~/follow/i){
quest::clear_proximity();
quest::say("Following");
quest::follow($userid);
 }
 elsif($text=~/quit/i){
 quest::say("Ok, good-bye!");
 quest::delglobal("sandy");
 quest::setglobal("sandy","3","3","F");
 $sandy=undef;
 quest::delglobal("$name");
 quest::setglobal("$name","2","3","F");
 quest::clear_proximity();
 quest::depop();
}
elsif($text=~/hail/i){
quest::say("I'm ready $name, do you need to know the [commands]?");
}
elsif($text=~/commands/i){
quest::say("If you target and say [follow], then I will follow you,");
quest::say("If you target and say [stop], then I will stop, but don't go to far away, else you'll loose me,");
quest::say("If you target and say [quit], I will go away,");
quest::say("I can [heal] you with celestial healing, and I have [temperance] for buffs,");
quest::say("You have to trarget me for my attention.");
quest::say("Don't forget to tell me to [quit] when you're done.");
}
elsif($text=~/heal/i){
 quest::say("Casting celestial healing ...");
 quest::settimer("cheal1",5);
}
elsif($text=~/temp/i){
quest::say("Casting temperance ...");
quest::settimer("temp1",15);
}
elsif($text=~/stop/i){
 quest::clear_proximity();
 quest::depop();
 my $a = 224236;
 my $x = $npc->GetX();
 my $y = $npc->GetY();
 my $z = $npc->GetZ(); 
quest::spawn2($a,1,0,$x,$y,$z,$h);
quest::say("Ok, don't stray too far!");
 }
}

sub EVENT_SPAWN{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 120, $x + 120, $y - 120, $y + 120);
}

sub EVENT_EXIT{
	quest::depop();
	quest::delglobal("sandy");
	quest::setglobal("sandy","3","3","F");
	$sandy=undef;
	quest::delglobal("$name");
	quest::setglobal("$name","2","3","F");
}

sub EVENT_TIMER
{
    if ($timer eq "cheal1"){
        quest::stoptimer("cheal1");
        $npc->CastSpell(1444,$userid);
    }
    elsif ($timer eq "temp1"){
        quest::stoptimer("temp1");
        $npc->CastSpell(3692,$userid);
 }
}

sub EVENT_DEATH{
	quest::delglobal("sandy");
	quest::setglobal("sandy","3","3","F");
	$sandy=undef;
	quest::delglobal("$name");
	quest::setglobal("$name","2","3","F");
 }
Like I said, this little puppy works - I just need to finish it or maybe you can - right now I'm having a hell of a time recuperating some lost data from my server death, also am working, and my little bit of spare time goes to database work (Cavedude: Hatesfury is on its way!) .
I also had plans for this npc to cross into other zones with its owner via quest_globals
  #2  
Old 04-22-2007, 04:03 PM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Hello angelox,

thanks for the idea.

Perl is surely the easiest way to command your bot. But the limitation of it is that you have to target one bot in order to make it doing an action. I'd prefer to have a bot that know what he can do depending of its class and in most situations..

Let's say you're grouped with 5 bots:
1 war, 1 rogue, 1 enchanter, 1 cleric, 1 shaman and you, 1 ranger

You're pulling.
- Once you or one of your bot has the aggro the war will taunt the mob (wich will become the main target of the group).
- The rogue(bot) will go behind it and start the dps.
- The enchanter(bot) will wait to see if any other mob aggro you or one of your bot. If so, he will mez it and keep it mezzed till the first mob dies. While the add is mezzed, he will cast some DD on the main target.
- The cleric(bot) will check the HPs of the group.
- The shaman(bot) will debuff the mob (debuff+dots), will check the buffs of the groups in fight.
- and you... you do what you want to

In the actual state, Perl doesn't permit me to automatize all theses tasks. But I could use it to start a particular AI on a given bot. For example, if I have 2 healers in group, I could set the main and the second healer or 1 bot will be healing and the second one will make dps...

Good day,
Mag
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots
  #3  
Old 04-22-2007, 08:56 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

There are at least two client programs that I know of that will do that. One is Xylobot - I used it before and worked very well.
  #4  
Old 04-22-2007, 10:30 PM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Yes Xylo and MQ probably do the thing but client wise...

I will try to code that so it's server wise and only for the bots (mobs). As I've mentionned earlier the bots are mobs, not clients.

And that will make the work harder
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots

Last edited by Magoth78; 04-23-2007 at 06:35 AM..
  #5  
Old 04-22-2007, 11:16 PM
mattmeck
Guest
 
Posts: n/a
Default

This would be useful for a lot of different things, a quest for a perma body guard, a quest where you have to help an NPC with a kill... etc etc.

I could see uses for this even on the legit servers.
  #6  
Old 04-23-2007, 08:53 AM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Ok, I've added a bot inventory.

Each bot has 21 slots in their inventory just like a Client.

Once an item is added to their inventory, their stats are updated immediatly. (The client will have to zone in order to see the stats changes on his bot with #showstats but it's just a visual issue.)

Now, let's take an example:
- You loot on a mob a helm. The stats on the helm are +10ac +5str ...
- You give the item to the bot and the stats will be actual_ac=actual_ac+10, actual_str=str+5, etc...

For the moment, there is no check on the slot that can wear the item but I'm planning to add it.
__________________
User's projects:
-- Original EMPIRE I/II and Factions! servers
-- Web GM Portal
-- EQoffline/bots
  #7  
Old 04-25-2007, 12:47 AM
tornar
Fire Beetle
 
Join Date: Apr 2006
Posts: 1
Default nice idea!!

Hi magoth78, i have to say that it looks a nice idea, it would be great to have bots available for hire.
Closed Thread

Thread Tools
Display Modes

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:21 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3