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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2015, 12:38 PM
zhangshen147
Fire Beetle
 
Join Date: Nov 2009
Posts: 17
Default bot command change

Set #bot spawn command Character using the level limit.

add common/ruletypes.h
Code:
#ifdef BOTS
RULE_CATEGORY(Bots)
RULE_REAL(Bots, BotManaRegen, 2.0) // Adjust mana regen for bots, 1 is fast and higher numbers slow it down 3 is about the same as players.
RULE_BOOL(Bots, BotFinishBuffing, false) // Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat.
RULE_INT(Bots, CreateBotCount, 150) // Number of bots that each account can create
RULE_INT(Bots, SpawnBotCount, 71) // Number of bots a character can have spawned at one time, You + 71 bots is a 12 group raid
RULE_BOOL(Bots, BotQuest, false) // Optional quest method to manage bot spawn limits using the quest_globals name bot_spawn_limit, see: /bazaar/Aediles_Thrall.pl
RULE_BOOL(Bots, BotGroupBuffing, false) // Bots will cast single target buffs as group buffs, default is false for single. Does not make single target buffs work for MGB.
RULE_BOOL(Bots, BotSpellQuest, false) // Anita Thrall's (Anita_Thrall.pl) Bot Spell Scriber quests.
RULE_INT(Bots, BotAAExpansion, 8) // Bots get AAs through this expansion
RULE_BOOL(Bots, BotGroupXP, false) // Determines whether client gets xp for bots outside their group.
RULE_BOOL(Bots, BotBardUseOutOfCombatSongs, true) // Determines whether bard bots use additional out of combat songs.
RULE_BOOL(Bots, BotLevelsWithOwner, false) // Auto-updates spawned bots as owner levels/de-levels (false is original behavior)
RULE_INT ( Bots, BotSpawnCharacterLevel, 45 ) // add custom rules to bot spawn commands to limit via character level.
RULE_CATEGORY_END()
#endif
add zone/bot.cpp
line 9403
Code:
void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
	// All bot command processing occurs here now instead of in command.cpp

	// TODO: Log any possible error messages as most of these will be MySQL error messages.
	std::string TempErrorMessage;
	int16 charlevel = (RuleI(Bots, BotSpawnCharacterLevel)); // Character level limit order bot spawn

	if(sep->arg[1][0] == '\0') {
		c->Message(13, "Bad argument, type #bot help");
		return;
and line 9767
Code:
	if(!strcasecmp(sep->arg[1], "spawn") ) {
		if(c->GetLevel() > charlevel) {
			c->Message(0, "Sorry, your level is too high to use this command.");
			return;
		}
		
		uint32 botId = GetBotIDByBotName(std::string(sep->arg[2]));
add to you mysql database
Quote:
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Bots:BotSpawnCharacterLevel', '45', 'add custom rules to bot spawn commands to limit via character level.');
over~
Reply With Quote
  #2  
Old 07-04-2015, 01:48 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

The way you did this, upon merging people will have to add this rule to their database manually, having a RULE_BOOL with a default value of false to check if the rule is enabled and if their level is greater than the RULE_INT value.
Reply With Quote
  #3  
Old 07-04-2015, 02:06 PM
zhangshen147
Fire Beetle
 
Join Date: Nov 2009
Posts: 17
Default

Quote:
Originally Posted by Kingly_Krab View Post
The way you did this, upon merging people will have to add this rule to their database manually, having a RULE_BOOL with a default value of false to check if the rule is enabled and if their level is greater than the RULE_INT value.
sorry ~ Forgot to amend the database, has been corrected.
Reply With Quote
  #4  
Old 07-05-2015, 09:16 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

I will be adding this in my next pull request with it turned off by default. Once I get it merged I'll make another post here. Cool idea, I don't see why it can't be done, that's what rules are for, optional functionality.
Reply With Quote
  #5  
Old 07-06-2015, 09:23 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

Here's my pull request. I added the ability to optionally enable it as well as a default value of 0 on the level required.
Reply With Quote
  #6  
Old 07-06-2015, 02:58 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

Implemented as of this commit.
Reply With Quote
  #7  
Old 07-07-2015, 11:58 PM
zhangshen147
Fire Beetle
 
Join Date: Nov 2009
Posts: 17
Default

Quote:
Originally Posted by Kingly_Krab View Post
Implemented as of this commit.
,its a good job~
But you seem to have forgotten database SQL settings.

Quote:
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Bots:BotSpawnCharacterLevel', '45', 'add custom rules to bot spawn commands to limit via character level.');
Reply With Quote
  #8  
Old 07-08-2015, 12:12 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

It's not necessary to have those since it has a default value, but you can add them to the database if you want to change them.
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 06:43 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