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

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-12-2015, 03:26 PM
skyy's Avatar
skyy
Fire Beetle
 
Join Date: Sep 2015
Posts: 15
Default BotOwner by AccountID instead of CharacterID

I am currently looking for a way to get bots to spawn if the accountID matches instead of the characterID and came to a bit of a pit regarding my meager knowledge of the source.

What i tried was looking into bots.cpp:

1) at the spawn command I disabled the check for owned bot:
Code:
if(!strcasecmp(sep->arg[1], "spawn") ) {
		if (RuleB(Bots, BotCharacterLevelEnabled)) {
			if (c->GetLevel() < RuleI(Bots, BotCharacterLevel)) {
				c->Message(0, "You are only level %d, you must be level %d to spawn a bot!", c->GetLevel(), RuleI(Bots, BotCharacterLevel));
				return;
			}
		}

		uint32 botId = GetBotIDByBotName(std::string(sep->arg[2]));
		int xy = c->AccountID();
		int yz = GetBotOwnerCharacterID(botId, &TempErrorMessage);
		int yzz = database.GetAccountIDByChar(yz);
			if (xy != yzz)//(GetBotOwnerCharacterID(botId, &TempErrorMessage) != c->CharacterID()) godrage
			{
				c->Message(0, "You can't spawn a bot that you don't own.");

			}
2) disabling the same check at the Bot::Spawn
Code:
void Bot::Spawn(Client* botCharacterOwner, std::string* errorMessage) {
	if(GetBotID() > 0 && _botOwnerCharacterID > 0 && botCharacterOwner )//&& botCharacterOwner->CharacterID() == _botOwnerCharacterID)
3) redoing the casttoclient to the actual client
Code:
if(this->Save())
			botCharacterOwner->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
			//this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
		else
			botCharacterOwner->CastToClient()->Message(13, "%s save failed!", this->GetCleanName());
			//this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName());
4) now the bot spawns and immediately despawns and I am stuck as to where the despawn is triggered


can anyone see this endeavour as totally fruitless ?

The main idea for my solo server project is to not have to create bots for every character you create over and over again.

thanks in advance!
Reply With Quote
 


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:39 AM.


 

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