Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-27-2015, 02:15 AM
Midgett
Fire Beetle
 
Join Date: May 2009
Location: AL
Posts: 29
Default Bot Pet Buffs

I've been working on this for awhile and can't seem to figure it out.

When my bots zone, they keep their buffs but their pets lose theirs. They are in the process of rebuffing them when I zone in.
I checked the botpetbuffs table and nothing is getting saved. I've tried drop_bots and load_bots in case I missed a table.

Also, I used to be able to see my bots buffs, now I can't...that happened after I dropped my bots tables and resourced.

Does anyone have any suggestions?

EmuServer - (Last changelog entry 7/22/2015)
Database - 9086
Client - Underfoot

Thanks!
Reply With Quote
  #2  
Old 08-28-2015, 01:24 PM
Nightrider84's Avatar
Nightrider84
Discordant
 
Join Date: Aug 2010
Location: Colorado
Posts: 410
Default

Its a missing table that's the issue. I'm not home atm but when I get home I'll look into it for you.
Reply With Quote
  #3  
Old 08-29-2015, 12:45 AM
Midgett
Fire Beetle
 
Join Date: May 2009
Location: AL
Posts: 29
Default

Thanks! Whenever your schedule permits..thx for the help!
Reply With Quote
  #4  
Old 08-30-2015, 07:37 PM
Nightrider84's Avatar
Nightrider84
Discordant
 
Join Date: Aug 2010
Location: Colorado
Posts: 410
Default

Your botpetbuffs should have the following tables (I MIght be missing tables aswell)

BotPetBuffId
BotPetsId
SpellId
CasterLevel
Duration

and check on your gm when you login to your world it will tell you in red text if your bots are missing tables which im assuming they will be.
Reply With Quote
  #5  
Old 08-31-2015, 02:17 AM
Midgett
Fire Beetle
 
Join Date: May 2009
Location: AL
Posts: 29
Default

Thanks for the response!

I have all those fields in my table. Here is a SQL generated by HeidiSQL of my botpetbuffs.

Code:
CREATE TABLE `botpetbuffs` (
	`BotPetBuffId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`BotPetsId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`SpellId` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`CasterLevel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`Duration` INT(11) UNSIGNED NOT NULL DEFAULT '0',
	PRIMARY KEY (`BotPetBuffId`),
	INDEX `FK_botpetbuffs_1` (`BotPetsId`),
	CONSTRAINT `FK_botpetbuffs_1` FOREIGN KEY (`BotPetsId`) REFERENCES `botpets` (`BotPetsId`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
I did encounter a red error on the GM screen when I first added the bot tables but I followed the info contained in the following
threads to fix it:

http://www.eqemulator.org/forums/sho...light=dot_rune

http://www.eqemulator.org/forums/sho...light=dot_rune

I did have more fields missing than what was mentioned in these threads. I was missing: dot_rune, caston_x, caston_y, caston_z and ExtraDIChance.
After I added them, the red error went away.

My botbuffs table populates. My bots keep their buffs when zoning. They also keep their pets. Their pets don't keep their buffs. For some reason, the
botpetbuffs table won't populate.

Does your botpetbuffs table populate when you camp your bots? It feels like it may be server side??
Reply With Quote
  #6  
Old 08-31-2015, 09:41 AM
Nightrider84's Avatar
Nightrider84
Discordant
 
Join Date: Aug 2010
Location: Colorado
Posts: 410
Default

I just took a look and it seems after a recent server compile my bots pets dont keep their buffs now either so we are in the same boat lol. Im 95% sure its server side related and that the table is simply missing columns. Its either that or theres an issue in the bot.cpp file when compiling
Reply With Quote
  #7  
Old 09-01-2015, 02:20 AM
Midgett
Fire Beetle
 
Join Date: May 2009
Location: AL
Posts: 29
Default

Thanks for the sanity check!

Part of my investigation was looking at bots.cpp.

Here is the Load Pet Buffs code block in bots.cpp.

Code:
void Bot::LoadPetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
	if(!petBuffs || botPetSaveId == 0)
        return;

    std::string query = StringFormat("SELECT SpellId, CasterLevel, Duration FROM botpetbuffs WHERE BotPetsId = %u;", botPetSaveId);
    auto results = database.QueryDatabase(query);
	if(!results.Success())
		return;

	int buffIndex = 0;
	for (auto row = results.begin();row != results.end(); ++row) {
		if(buffIndex == BUFF_COUNT)
			break;

		petBuffs[buffIndex].spellid = atoi(row[0]);
		petBuffs[buffIndex].level = atoi(row[1]);
		petBuffs[buffIndex].duration = atoi(row[2]);
		buffIndex++;
	}
	query = StringFormat("DELETE FROM botpetbuffs WHERE BotPetsId = %u;", botPetSaveId);
	results = database.QueryDatabase(query);
}
Here is the Save Pet Buffs code block in bots.cpp.

Code:
void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
	if(!petBuffs || botPetSaveId == 0)
        return;

	int buffIndex = 0;
	while(buffIndex < BUFF_COUNT) {
        if(petBuffs[buffIndex].spellid > 0 && petBuffs[buffIndex].spellid != SPELL_UNKNOWN) {

            std::string query = StringFormat("INSERT INTO botpetbuffs (BotPetsId, SpellId, CasterLevel, Duration) VALUES(%u, %u, %u, %u)", botPetSaveId, petBuffs[buffIndex].spellid, petBuffs[buffIndex].level, petBuffs[buffIndex].duration);
            auto results = database.QueryDatabase(query);
            if(!results.Success())
                break;
        }
        buffIndex++;
    }
If you notice I printed in RED the database queries. All those fields are present in the botpetbuffs table.

If I copy my botpetbuffs from my old server db (same fields) to my new database, the buffs won't load either.
So not only will the bot pet's buffs won't save, they won't load either.
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 10:28 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