PDA

View Full Version : [C++] Bob the Battle Bot (Not your average Bot)



EzMaN
12-01-10, 10:13 PM
Bob The Battle Bot

What does he do?

Bob is an all-purpose, all-in-one vendor/mall bot, intended for Funservers.

He sells all normally obtainable items, organized in convenient lists, and also has a search function for any item that might not be in the lists.

He has two forms:
-A stationary form (This is gotten using .npc spawn) which anyone can talk to.
-A Pet Form (Obtained by using the "Battle Bot" item that is supplied with the script), which will follow its owner around, and which can only be talked to by the bot's owner.

The Basic function of the bot (present in both forms):

When talked to, Bob presents a list of types of items:

http://img22.imageshack.us/img22/3516/picture2elv.png (http://img22.imageshack.us/img22/3516/picture2elv.png)
Note: In this picture, the bot's has been enabled to fight and is on the blue team.

Just for an example, here's the menu that pops up if you click "Armor":
http://img9.imageshack.us/img9/2853/picture1no.png (http://img9.imageshack.us/img9/2853/picture1no.png)
Note: For the armor menus, the bot is programmed so that only armor usable by your class appears. Thus, a priest will not see any plate armor.

Each of these can be clicked to present a list of all items normally available to the player using the vendor (if an item is unobtainable in-game, i.e. GM items, it will not appear).

The search function (which can be disabled) allows a player to search for their item by name, and shows a list of all items matching that name.

A screenshot of the search function:
http://img513.imageshack.us/img513/4992/picture4c.png (http://img513.imageshack.us/img513/4992/picture4c.png)
Note: This is the stationary, non-pet version of the bot. These were the results shown when "Claymore" is entered.


Battle Bot Mode:
The Pet (portable) version of the mall bot can be seen by using the "Mall Vendor" item supplied with the SQL (Item ID 99499).

The Portable bot:
-Is a portable mall
-Follows his owner around
-Can fight other portable bots


To put the portable bot into fighting mode, all the owner must do is talk to the bot and click "LET ME FIGHT!"


The bot will then randomly be assigned a team, Red or Blue (themed fire and ice), and will attack any bots it sees who are of opposite color.

A screenshot of what happens when combat is enabled:
http://img257.imageshack.us/img257/6383/picture3cz.png (http://img257.imageshack.us/img257/6383/picture3cz.png)
This is what happens when you click "Let Me Fight!". This bot has been assigned to the red team. If you look in the 1st screenshot, up at the top, you can see that once your bot has been assigned a team, you can change it's team by talking to it again and clicking "Switch Fuels!"

About Bot Combat:
-Once combat has been enabled, the bot will have the same functionality as before, however if he comes within 20 yards of a bot of the opposite color as him, he will immediately attack that bot.
-The bots yell random phrases when aggroed, so you should know when your bot has found an opponent.
-A bot cannot attack another bot that is already in combat.
-A bot cannot be spoken to if it is in combat.

Blue bots cast frost shock and have mage's ice armor.
Red bots cast flame shock and have mage's molten armor.

Once one bot dies, the losing bot disappears and the winner is restored to full health (and he shoots out fireworks).

The bot summoning item has a 1 minute cooldown that starts once your bot is defeated in battle, to prevent abuse (spam in malls).


The inter-bot fighting has been tested extensively on Aspire and is nearly perfectly balanced 50-50 between red and blue.

Download:
The Script (http://pastebin.com/f1b132bb3)
The SQL (http://pastebin.com/f7c102b25)

A note about configuration:
BEFORE YOU COMPILE YOUR SCRIPT, read and configure it!

There is a brief configuration section at the head of the script which allows you to set several settings, including whether you want it to work for Arcemu or Aspire (if you set it for the wrong one, the script will not work).



This script is tested and working on the latest ArcEmu servers.


CREDITS to : Jotox