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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2009, 11:10 AM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default Interactive Bots

This feature would be to use bots as interactive npcs. For example, we'd need some custom perl commands. Here is an example of what I mean.


Code:
sub EVENT_SAY {
if($text=~/hail/i)
{
quest::say("Hello, $name! I am a traveling adventurer and mercenary for hire. For 5 platinum, I will join your party!")
}}

sub EVENT_ITEM {
if($platinum == 5)
{
quest::botjoin();
##the npc will join the players group and function as a bot.
quest::groupsay("Hello! Glad to be of service."); 
##groupsay would be a means of the bot responding in group chat.
}}

We could even expand on the abilities to control the bot. Group commands such as the following:

/g !stay
/g !protect playername
/g !follow playername
/g !attack
/g !assist playername
/g !stop

I think this would bring in a bag of opportunities to those who enjoy creating ring events and other forms of interactive questing.

From what I understand, you have to remove the check for ownership of the bot to place a bot somewhere and force him to join any players group. Any useful comments or pointers on where to start with this? I've never written perl commands before so I don't know where to start with that.
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #2  
Old 07-23-2009, 08:01 PM
Krugus
Sarnak
 
Join Date: Dec 2005
Location: the Void
Posts: 40
Default ...

That would be cool

I've been working on a quest script just to add the commands via saylinks to the bots, you have find that post here Only problem with it, its only feasible for small servers since you have to create a quest for each bot.

Adding the functions you are talking about would be cool though. You could set up a various bots npc's in Tavern's and Inns that you could go hire! It would give people a reason to go to Inn's and Taverns besides to quickly sell something.....
Reply With Quote
  #3  
Old 07-24-2009, 02:31 AM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

I am working on this feature but considering I am not a well seasoned coder, I've hit a couple road blocks but we'll figure it all out.
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #4  
Old 07-24-2009, 12:12 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Well, I am trying to construct this into a perl command. I found the 'join group' code for the bot.

Code:
bool Bot::AddBotToGroup(Bot* bot, Group* group) {
	bool Result = false;

	int i = 0;

	if(bot && group) {
		//Let's see if the bot is already in the group
		for(i = 0; i < MAX_GROUP_MEMBERS; i++) {
			if(group->members[i] && !strcasecmp(group->members[i]->GetCleanName(), bot->GetCleanName()))
				return false;
		}

		// Put the bot in the group
		for(i = 0; i < MAX_GROUP_MEMBERS; i++) {
			if(group->members[i] == NULL) {
				group->members[i] = bot;
				break;
			}
		}
		
		// We copy the bot name in the group at the slot of the bot
		strcpy(group->membername[i], bot->GetCleanName());
		bot->SetGrouped(true);

		//build the template join packet
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
		GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;	
		strcpy(gj->membername, bot->GetCleanName());
		gj->action = groupActJoin;
	
		int z = 1;
		for(i=0; i < MAX_GROUP_MEMBERS; i++) {
			if(group->members[i] && group->members[i]->IsClient()) {
				if(group->IsLeader(group->members[i])) {
					strcpy(gj->yourname, group->members[i]->GetName());
					strcpy(group->members[i]->CastToClient()->GetPP().groupMembers[0], group->members[i]->GetName());
					group->members[i]->CastToClient()->QueuePacket(outapp);
				}
				else {
					strcpy(group->members[i]->CastToClient()->GetPP().groupMembers[0+z], group->members[i]->GetName());
					group->members[i]->CastToClient()->QueuePacket(outapp);
				}
			}
			z++;
		}

		safe_delete(outapp);

		// Need to send this only once when a group is formed with a bot so the client knows it is also the group leader
		if(group->GroupCount() == 2) {
			Mob *TempLeader = group->GetLeader();
			group->SendUpdate(groupActUpdate, TempLeader);
		}

		Result = true;
	}

	return Result;
}

Before I do this however, I need to find a way to remove ownership checks. It will error out if I try to just put the bot in anyone's group. Im trying to find it but I'm not having the best of luck.
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #5  
Old 08-06-2009, 06:12 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

I'm willing to pay for help with this.
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #6  
Old 08-06-2009, 11:28 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

You know, I probably made what resembled the first eqemu bot ever. I did it in Perl and still have the scripts included with our database package. It worked very well, one setback was, you had to target it to command it, but I think that can be resolved with the new quest code.

You spoke with Bohat at Gunthak Lighthouse, she eventually sold you hired help, and spawned you a "Perl -bot". I could use it around the Gulf pretty well. It was all Alpha and just a start - But enter Magoth78 then Congdar with the greatest yet EQBOTS code, so I forgot about mine. Would be interesting to see how far you could go with it. I even had ideas on how to zone and turn up in the next zone with it.
Reply With Quote
  #7  
Old 08-07-2009, 05:29 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

This project is unfortunately beyond my C++ comprehension skills. I'd gladly donate money for this to get it started. I'm more of a "copy/paste/rewrite what other people have written" kindof guy. lol
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #8  
Old 08-07-2009, 09:29 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

haha so you finally gave up eh? That didn't last long!
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
Reply With Quote
  #9  
Old 08-08-2009, 08:44 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

Quote:
Originally Posted by Yeormom View Post
haha so you finally gave up eh? That didn't last long!
I'm a struggling coder/script kiddy. Cutt me a break :(

You could offer me some advice!
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
Reply With Quote
  #10  
Old 08-08-2009, 10:23 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

Thought you were gonna add commands to control them? Last I heard, you had already found the right places to do all of that.
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
Reply With Quote
  #11  
Old 08-08-2009, 11:35 PM
RichardoX
Hill Giant
 
Join Date: Dec 2004
Location: in your closet....
Posts: 169
Default

I did find it but I've hit some nasty road blocks. :p
__________________
a hill giant slashes YOU for 25 points of damage!
You have been slain!
LOADING, PLEASE WAIT...
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 05:40 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