PDA

View Full Version : New Character Items, Default Status, and Rule Sets


Lighted Shadows
11-08-2013, 05:58 PM
Thanks in advance to anyone who reads this and helps with these Issues.

Server is running and able to login via eqemulator login server I would like to change a few things and can't seam to find where to do it and search didn't seam to find my exact answer. Although Forum search did get my up and running with almost no posting.

Issue 1:
NEW "account" created on my server when people log in via EQEmulato login server are set to a default "status" in the "account" table of 20. I would like new characters to not have access commands like #level #goto etc..
I could just set the "access" in the "commads" table but I would like to have new accounts have a Default "status" of 0

Issue 2:
What file or Table do I edit to make it so that new characters are created with different items. I would like new characters to be created with more bags. I am sure I can handle the fine details editing the database, file, or source and recompiling.

Issue 3:
all #bot commands when status is set are available to the player. Is it possible to restrict some of the commands and allows other
Example
Player can #bot spawn <bot name>
But not
#bot Create <botname> <Class> <Race> <Gender>
Reason is latter I will be creating an NPC/quest that will allow player to create 2 bots but in the mean time I am ok with manually making them for my friends in the "bots" table.

Issue 4:
In peq database I see table "rule_values" has 2 rows called
Character:RestRegenPercent
Character:RestRegenTimeToActivate

I notice the note reads
Time in seconds for rest state regen to kick in.
but rule set 1(default) is defaulted to 30000
While rule set 10(EQEmu_Default) is wet to 30
is this a typo
When setting Character:RestRegenPercent to 10 and Character:RestRegenTimeToActivate to 30(seconds) or 30000(miliseconds) I tried it a few differant ways just in case 30000 was a typo.
Never the less my issue is no matter what Character:RestRegenTimeToActivate I set the regen starts as soon as the character sits down instead of waiting the value.

Related Issue: How do I change what ruleset is loaded when I boot server would like to have a custom rule set for double exp ir free mana days stuff like that but I can't seam to find where to change what ruleset is loaded when booting server.





I managed to get my server up and running by useing
http://www.eqemulator.net/wiki/wikka.php?wakka=WindowsServerSetupGuide

I omitted the outdated Build Database section and used the the database from
http://www.peqtgc.com/releases/

I then patched in some old SQL files from this guide to get bots working
http://www.eqemulator.org/forums/showthread.php?t=37295&highlight=bots

I then ran the old drop_system.sql to address a zone start and stop issue.

Kingly_Krab
11-08-2013, 06:20 PM
1. Find this in your eqemu_config.xml in your server folder:
<defaultstatus>20</defaultstatus>
Change '20' to '0'.

2. Starting_items is the table that you want to edit to change what items players start with.

3. I assume you could add a command entry for the command in the commands table.

4. I haven't looked at the different rulesets, as I only use ruleset 1.

I apologize for not being very helpful, I just thought I would answer what I could.

Lighted Shadows
11-08-2013, 06:41 PM
I apologize for not being very helpful, I just thought I would answer what I could.

Thank you got 1/2 my issues solved I would call that helpfull.

Just need to figure out the regen thing and if its possible to restrict specific bot commands.

rencro
11-08-2013, 09:41 PM
There are always many ways to accomplish things with code, here is my solution for bots:

Note, dont use this diff, I have edited it just to give you an idea, as I have actually removed much more than just create...


diff --git a/zone/bot.cpp b/zone/bot.cpp
index 87f9151..a117a5a 100644
--- a/zone/bot.cpp
+++ b/zone/bot.cpp
@@ -11655,36 +11655,14 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
if(!strcasecmp( sep->arg[1], "help") && !strcasecmp( sep->arg[2], "\0")){
c->Message(0, "List of commands availables for bots :");
c->Message(0, "#bot help - show this");
- c->Message(0, "#bot create [name] [class (id)] [race (id)] [model (male/female)] - create a permanent bot. See #bot help create.");
- c->Message(0, "#bot help create - show all the race/class id. (make it easier to create bots)");
- c->Message(0, "#bot delete - completely destroy forever the targeted bot and all its items.");
c->Message(0, "#bot list [all/class(1-16)] - list your bots all or by class. Classes: 1(Warrior), 2(Cleric), 3(Paladin), 4(Ranger), 5(Sk), 6(Druid), 7(Monk), 8(Bard), 9(Rogue), 10(Shaman), 11(Necro), 12(Wiz), 13(Mag), 14(Ench), 15(Beast), 16(Bersek)");
c->Message(0, "#bot spawn [bot name] - spawn a bot from it's name (use list to see all the bots). ");
c->Message(0, "#bot inventory list - show the inventory (and the slots IDs) of the targetted bot.");
c->Message(0, "#bot inventory remove [slotid] - remove the item at the given slot in the inventory of the targetted bot.");
c->Message(0, "#bot update - you must type that command once you gain a level.");
c->Message(0, "#bot summon - It will summon your targeted bot to you.");
- c->Message(0, "#bot ai mez - If you're grouped with an enchanter, he will mez your target.");
- c->Message(0, "#bot picklock - You must have a targeted rogue bot in your group and be right on the door.");
c->Message(0, "#bot cure [poison|disease|curse|blindness] Cleric has most options");
- c->Message(0, "#bot bindme - You must have a Cleric in your group to get Bind Affinity cast on you.");
- c->Message(0, "#bot track - look at mobs in the zone (ranger has options)");
- c->Message(0, "#bot target calm - attempts to pacify your target mob.");
- c->Message(0, "#bot evac - transports your pc group to safe location in the current zone. bots are lost");
- c->Message(0, "#bot resurrectme - Your bot Cleric will rez you.");
- c->Message(0, "#bot corpse summon - Necromancers summon corpse.");
- c->Message(0, "#bot lore - cast Identify on the item on your mouse pointer.");
- c->Message(0, "#bot sow - Bot sow on you (Druid has options)");
- c->Message(0, "#bot invis - Bot invisiblity (must have proper class in group)");
- c->Message(0, "#bot levitate - Bot levitation (must have proper class in group)");
- c->Message(0, "#bot resist - Bot resist buffs (must have proper class in group)");
- c->Message(0, "#bot runeme - Enchanter Bot cast Rune spell on you");
- c->Message(0, "#bot shrink - Shaman or Beastlord will shrink target");
- c->Message(0, "#bot endureb - Bot enduring breath (must have proper class in group)");
- c->Message(0, "#bot charm - (must have proper class in group)");
- c->Message(0, "#bot dire charm - (must have proper class in group)");
- c->Message(0, "#bot pet remove - (remove pet before charm)");
- c->Message(0, "#bot gate - you need a Druid or Wizard in your group)");
+ //c->Message(0, "#bot runeme - Enchanter Bot cast Rune spell on you");
c->Message(0, "#bot archery - Toggle Archery Skilled bots between using a Bow or using Melee weapons.");
c->Message(0, "#bot magepet [earth|water|air|fire|monster] - Select the pet type you want your Mage bot to use.");
c->Message(0, "#bot giveitem - Gives your targetted bot the item you have on your cursor.");

@@ -11847,117 +11776,6 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
return;
}

- if(!strcasecmp(sep->arg[1], "create")) {
- if(sep->arg[2][0] == '\0' || sep->arg[3][0] == '\0' || sep->arg[4][0] == '\0' || sep->arg[5][0] == '\0' || sep->arg[6][0] != '\0') {
- c->Message(0, "Usage: #bot create [name] [class(id)] [race(id)] [gender (male/female)]");
- return;
- }
- else if(strcasecmp(sep->arg[3],"1") && strcasecmp(sep->arg[3],"2") && strcasecmp(sep->arg[3],"3") && strcasecmp(sep->arg[3],"4") && strcasecmp(sep->arg[3],"5") && strcasecmp(sep->arg[3],"6") && strcasecmp(sep->arg[3],"7") && strcasecmp(sep->arg[3],"8") && strcasecmp(sep->arg[3],"9") && strcasecmp(sep->arg[3],"10") && strcasecmp(sep->arg[3],"11") && strcasecmp(sep->arg[3],"12") && strcasecmp(sep->arg[3],"13") && strcasecmp(sep->arg[3],"14") && strcasecmp(sep->arg[3],"15") && strcasecmp(sep->arg[3],"16")) {
- c->Message(0, "Usage: #bot create [name] [class(id)] [race(id)] [gender (male/female)]");
- return;
- }
- else if(strcasecmp(sep->arg[4],"1") && strcasecmp(sep->arg[4],"2") && strcasecmp(sep->arg[4],"3") && strcasecmp(sep->arg[4],"4") && strcasecmp(sep->arg[4],"5") && strcasecmp(sep->arg[4],"6") && strcasecmp(sep->arg[4],"7") && strcasecmp(sep->arg[4],"8") && strcasecmp(sep->arg[4],"9") && strcasecmp(sep->arg[4],"10") && strcasecmp(sep->arg[4],"11") && strcasecmp(sep->arg[4],"12") && strcasecmp(sep->arg[4],"330") && strcasecmp(sep->arg[4],"128") && strcasecmp(sep->arg[4],"130") && strcasecmp(sep->arg[4],"522")) {
- c->Message(0, "Usage: #bot create [name] [class(1-16)] [race(1-12,128,130,330,522)] [gender (male/female)]");
- return;
- }
- else if(strcasecmp(sep->arg[5],"male") && strcasecmp(sep->arg[5],"female")) {
- c->Message(0, "Usage: #bot create [name] [class(1-16)] [race(1-12,128,130,330,522)] [gender (male/female)]");
- return;
- }
-
- uint32 MaxBotCreate = RuleI(Bots, CreateBotCount);
- if(CreatedBotCount(c->CharacterID(), &TempErrorMessage) >= MaxBotCreate) {
- c->Message(0, "You cannot create more than %i bots.", MaxBotCreate);
- return;
- }
-
- if(!TempErrorMessage.empty()) {
- c->Message(13, "Database Error: %s", TempErrorMessage.c_str());
- return;
- }
-
- int gender = 0;
- if(!strcasecmp(sep->arg[5], "female"))
- gender = 1;
-
- NPCType DefaultNPCTypeStruct = CreateDefaultNPCTypeStructForBot(std::string(sep->arg[2]), std::string(), c->GetLevel(), atoi(sep->arg[4]), atoi(sep->arg[3]), gender);
- Bot* NewBot = new Bot(DefaultNPCTypeStruct, c);
-
- if(NewBot) {
- if(!NewBot->IsValidRaceClassCombo()) {
- c->Message(0, "That Race/Class combination cannot be created.");
- return;
- }
-
- if(!NewBot->IsValidName()) {
- c->Message(0, "%s has invalid characters. You can use only the A-Z, a-z and _ characters in a bot name.", NewBot->GetCleanName());
- return;
- }
-
- if(!NewBot->IsBotNameAvailable(&TempErrorMessage)) {
- c->Message(0, "The name %s is already being used. Please choose a different name.", NewBot->GetCleanName());
- return;
- }
-
- if(!TempErrorMessage.empty()) {
- c->Message(13, "Database Error: %s", TempErrorMessage.c_str());
- return;
- }
-
- // Now that all validation is complete, we can save our newly created bot
- if(!NewBot->Save())
- c->Message(0, "Unable to save %s as a bot.", NewBot->GetCleanName());
- else
- c->Message(0, "%s saved as bot %u.", NewBot->GetCleanName(), NewBot->GetBotID());
- }
- else {
- // TODO: Log error message here
- }
-
- // Bot creation is complete
- return;
- }
-
- if(!strcasecmp(sep->arg[1], "help") && !strcasecmp(sep->arg[2], "create") ){
- c->Message(0, "Classes: 1(Warrior), 2(Cleric), 3(Paladin), 4(Ranger), 5(Sk), 6(Druid), 7(Monk), 8(Bard), 9(Rogue), 10(Shaman), 11(Necro), 12(Wiz), 13(Mag), 14(Ench), 15(Beast), 16(Bersek)");
- c->Message(0, "------------------------------------------------------------------");
- c->Message(0, "Races: 1(Human), 2(Barb), 3(Erudit), 4(Wood elf), 5(High elf), 6(Dark elf), 7(Half elf), 8(Dwarf), 9(Troll), 10(Ogre), 11(Halfling), 12(Gnome), 128(Iksar), 130(Vah shir), 330(Froglok), 522(Drakkin)");
- c->Message(0, "------------------------------------------------------------------");
- c->Message(0, "Usage: #bot create [name] [class(1-16)] [race(1-12,128,130,330,522)] [gender(male/female)]");
- c->Message(0, "Example: #bot create Sneaky 9 6 male");
- return;
- }
-
- if(!strcasecmp(sep->arg[1], "delete") ) {
- if((c->GetTarget() == nullptr) || !c->GetTarget()->IsBot())
- {
- c->Message(15, "You must target a bot!");
- return;
- }
- else if(c->GetTarget()->CastToBot()->GetBotOwnerCharacterID() != c->CharacterID())
- {
- c->Message(15, "You can't delete a bot that you don't own.");
- return;
- }
-
- if(c->GetTarget()->IsBot()) {
- Bot* BotTargeted = c->GetTarget()->CastToBot();
-
- if(BotTargeted) {
- BotTargeted->DeleteBot(&TempErrorMessage);
-
- if(!TempErrorMessage.empty()) {
- c->Message(13, "Database Error: %s", TempErrorMessage.c_str());
- return;
- }
-
- BotTargeted->Camp(false);
- }
- }
-
- return;
- }
-
if(!strcasecmp(sep->arg[1], "list")) {
bool listAll = true;
int iClass = atoi(sep->arg[2]);


You can then use a quest to get your bots created, even using qglobals to award them ect, skys the limit


quest::createBot("$name''s Fighter", "Fighter Bot",1,1,1,0);


Definition for createBot:
bool createBot(const char *name, const char *lastname, uint8 level, uint16 race, uint8 botclass, uint8 gender);

Kingly_Krab
11-08-2013, 09:43 PM
I don't think he wanted to delete the commands, I believe he wanted a status on them.

Lighted Shadows
11-08-2013, 10:35 PM
To better clarify my intention for bots is that for the current time being I don't want common users to be able to use ALL bot commands, but I still will need them to work for Say GM/Admins.

can I for example add a row to 'commands' like

command = bot create
access = 255
?

if that will work can I still make quest scripts that till create a bot for the player?

rencro
11-09-2013, 01:03 AM
Sorry bout that, you can use this method that keeps everything but just adds a rule:

in zone/bot.cpp

AT

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;

if(sep->arg[1][0] == '\0') {
c->Message(13, "Bad argument, type #bot help");

ADD

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 BotMinStatus = (RuleI(Bots, BotMinStatus)); // min status to do various bot commands

if(sep->arg[1][0] == '\0') {
c->Message(13, "Bad argument, type #bot help");


Then at whatever commands you want to be subject to new custom rule add"


if(c->Admin() < BotMinStatus) {
c->Message(0, "Sorry, your status is to low to use this command");
return;
}

and be sure to make the if you inserted in front of an else if. Example

in zone/bot.cpp

if(!strcasecmp(sep->arg[1], "create")) {
if(sep->arg[2][0] == '\0' || sep->arg[3][0] == '\0' || sep->arg[4][0] == '\0' || sep->arg[5][0] == '\0' || sep->arg[6][0] != '\0') {
c->Message(0, "Usage: #bot create [name] [class(id)] [race(id)] [gender (male/female)]");
return;
}

CHANGE TO --

if(!strcasecmp(sep->arg[1], "create")) {
if(c->Admin() < BotMinStatus) {
c->Message(0, "Sorry, your status is to low to use this command");
return;
}
else if(sep->arg[2][0] == '\0' || sep->arg[3][0] == '\0' || sep->arg[4][0] == '\0' || sep->arg[5][0] == '\0' || sep->arg[6][0] != '\0') {
c->Message(0, "Usage: #bot create [name] [class(id)] [race(id)] [gender (male/female)]");
return;
}



common/ruletypes.h

AT--

#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_CATEGORY_END()
#endif

CHANGE TO --

#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_INT ( Bots, BotMinStatus, 0 ) // add custom rules to various bot commands to limit via status level
RULE_CATEGORY_END()
#endif



Note I simply added a space to the previous BotBardUseOutOfCombatSongs to keep everything looking similar at the end..

Then just create your sql rule:


INSERT INTO rule_values VALUES ('1', 'Bots:BotMinStatus', '255', 'Min status to access various customized bot commands.');


And the quest still work on status 0 characters..