PDA

View Full Version : Question for Congdar on mage pets.


provocating
05-24-2009, 11:13 AM
On my server all of the players pretty well only want the Mage Bots to cast two possible pets (water and air). I played with the code last night and found this.


case SpellType_Pet: {
if (!IsPet() && !GetPetID() && !IsBotCharmer()) {
if(botClass == MAGICIAN) {
int randpets;
randpets = 2;
}
i = MakeRandomInt(i-randpets, i);
}
AIDoSpellCast(i, tar, mana_cost);
return true;
}
break;
}
}

Sorry I think the spacing from Visual Studio throws it off. This is not the original I modified it some and took out the comments before posting it.

Okay so I can reduce the number of pets case by changing the randpets number but I think it cast the first two, like fire and water pets. Where are these kept, my C++ is very basic. I may be able to do it in the database but not sure where to look.

provocating
05-24-2009, 11:41 AM
This is the original case statement before I butchered it. Copying from VS and pasting here does not work that well.

case SpellType_Pet: {
//keep mobs from recasting pets when they have them.
if (!IsPet() && !GetPetID() && !IsBotCharmer()) {
if(botClass == MAGICIAN) {
// have the magician bot randomly summon
// the air, earth, fire or water pet
// include monster summoning after they
// become level 30 magicians
int randpets;
if(botLevel >= 30) {
randpets = 4;
}
else {
randpets = 3;
}
i = MakeRandomInt(i-randpets, i);
}
AIDoSpellCast(i, tar, mana_cost);
return true;
}
break;

Congdar
05-24-2009, 03:24 PM
It's currently set to randomly spawn one of the 4 pets before they get monster summoning and then random one of the 5 pets. The code says 3 and 4 cuz it's 0-3 and 0-4. This matches up with the Bot Spell Lists (http://www.cerebus.net:8080/files/downloads/botspells.zip) for Mages. Level 2-4 have a little difficulty, but they figure it out pretty quick.

It you want to customize your server for a specific pet, theres a few ways you could go.

No c++ changes.
You could change the pet entries in the sql file so there are four or five water or air pets or a mix of the two types to random from. This would require you to edit the sql file to match those selections.

C++ changes.
You could change the random number to 1 (0-1) and then delete from the sql all the non air and water, and monster summoning pets.

No changes by you.
This sounds like a feature request. I'm thinking if you don't like the pet they summoned randomly, you target your mage bot and type the command #bot magepet [earth|water|air|fire|monster]

provocating
05-24-2009, 04:25 PM
What I did temporarily was remove the npc_spell entries for the bot earth, MS, fire pets. Then I changed the C++ code to 1 instead of 4.

Congdar
05-25-2009, 12:07 AM
svn r573 - Added new command #bot magepet [earth|water|air|fire|monster] - Select the pet type you want your Mage bot to use.

provocating
05-25-2009, 08:37 AM
yay !!!

That is awesome.

Congdar
05-25-2009, 02:57 PM
don't forget to put the spells back in. You can just source in the sql from this zip Bot Spell Lists (http://www.cerebus.net:8080/files/downloads/botspells.zip)

provocating
05-25-2009, 03:23 PM
I will, I probably will wait till a few more releases.

provocating
05-25-2009, 03:32 PM
Also I thought I read a thread a while back about a possibility of using a client newer than Titanium. Any chances of that happening this year ?

Congdar
05-26-2009, 10:34 AM
I think the Secrets of Faydwer client is 98% working.

Snoopdog
05-26-2009, 10:39 AM
I picked it up from Newegg. I think since they ship free it normally arrives snail-mail. I should have it in a few weeks. I cannot wait though. The Titanium client seems to crash readily on higher resolutions, I pray that the new client is more stable.

So_1337
05-26-2009, 10:43 AM
The SoF client has better support for multi-core processors as well.

Snoopdog
05-28-2009, 03:15 PM
Okay, I just compiled from source today to try the new bot commands.

Here is what it does for me. I am trying these at level 65, since I just dinged.

Monster pet - gives me monster pet.
Air pet - gives me water.
Fire pet - gives me water.
Earth pet - constantly cast fire and ice protection or other random spell until mage runs out of mana, then keeps casting as he gets mana.
Fire pet - did not try.

Congdar
05-28-2009, 03:18 PM
re-source in the bot spells from the link a couple of posts up... I didn't specifically try level 65, but they should be the same 30+

provocating
05-28-2009, 03:35 PM
Okay I did and restarted the server, trying the Earth Pet he keeps casting fire and ice protection repeatedly.

Ideas ?

I also tried fire and he keeps casting a spell over and over, not sure what it is though.

Congdar
05-28-2009, 03:38 PM
i tried the levels where the mage goes from zero then one then two then three then four and then five available pets. they all worked fine for me. It might be you found a bug in the sql that i'll have to look for past level 30 (where they get their fifth pet).

provocating
05-28-2009, 03:40 PM
I also tried air five times in a row, got water every single time.

Congdar
05-28-2009, 03:41 PM
must be a spell out of alignment somewhere after level 30. i'll find it

provocating
05-28-2009, 03:42 PM
Originally where I had deleted the 58-63 monster, earth and fire pets.....that has now been replaced when I sourced in that SQL so that should not be a factor correct ?

provocating
05-28-2009, 03:56 PM
It could be on my part, a really stupid thing on my part. I will report back in 10 minutes. I would not worry about it till then.

provocating
05-28-2009, 04:15 PM
Okay now that my retarded moment is out of the way. I blame it on lack of caffeine.

Monster = perfect
Earth = perfect
air = fire
fire = water
water = air

This is after the latest svn and sourcing the npc spells back in. I tried each pet 4 times to be sure.

Do no ask what I was doing before, it was a blond moment.

gaeorn
05-28-2009, 05:15 PM
Inquiring minds want to know! :D

provocating
05-28-2009, 05:18 PM
Okay fine.

While messing with the instance database earlier in the week I copied my EqEmulator virtual machine within ESXi to another copy, ran that copy with a different IP address, you know for test. My Heidi was still connected to that database, I did not notice since the address was just one number off. So essentially every SQL update I ran for the past 30 minutes was on that test database.

gaeorn
05-28-2009, 05:25 PM
I've had times like that... "dammit, why is it still saying I haven't made those changes I just did..."

About the worst thing I did was one time doing a disk to disk backup and did the minor mistake of copying the backup on top of the original... right after having wiped clean the backup. :shock: I was proud of myself that day, I'll tell ya! ;)

provocating
05-28-2009, 05:34 PM
I have always been overly cautious of copying backups or clients backups. I think it is part of my OCPD personality. I remember back when I used to do people upgrades using laplink. With laplink 3 you basically had the source on one side, the destination on the other. It was not overly obvious which was which. One of the guys I worked with copied a machine the wrong way, the big deal was it was an accountants laptop. You know one the the suitcase sized Compaq laptops, the kind where the keyboard snapped into the side of it. Well that just proved to me it was easy to do and working with someone else's data is begging lawsuit when you screw it up. I am vigilant on backups now, even my EqEmulator virtual machine gets a complete backup 7 days a week and another archive in a different place in case that machine catches fire or something crazy. I am not talking about the directory but the entire virtual machine.

gaeorn
05-28-2009, 06:06 PM
Yeah, I have nightly backups for my servers as well. And I also work with customer's data so I am also very careful. The one time I did that, it was with my own data after entirely too little sleep, and it was a long time ago (> 20 years). Experience is what causes one to double and triple check things before letting it fly...

provocating
05-28-2009, 07:03 PM
Yeah but you try to tell these young whippersnappers that.

Congdar
05-28-2009, 10:40 PM
ok, i think i've got it working correctly now. you'll need svn r591 and my latest Bot Spell Lists (http://www.cerebus.net:8080/files/downloads/botspells.zip) sourced in.