Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2015, 11:44 AM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default Beastlord Pet NPC question

Anyone know the process to determine the NPC type for a beastlord summoned pet?


Celestial
Reply With Quote
  #2  
Old 10-29-2015, 11:51 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

The spell will have a pet reference in the 'teleport_zone' field. That will match up with a record in the 'pets' table, which has some flags and settings and will point to the npcid in 'npc_types'.
Reply With Quote
  #3  
Old 10-29-2015, 11:55 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Also, because a Beastlord pet's race is determined by the race of the caster, they have special handling in the server code.

It's currently hard-coded which caster race gets which pet race. Customizing this will require changes to the code:

https://github.com/EQEmu/Server/blob.../pets.cpp#L334
Reply With Quote
  #4  
Old 10-29-2015, 12:00 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

Ahh! That is what I was wondering, was the pet race hard-coded. I wanted to add woodelves as beastlords and was looking for the reference for a npc type for the pet. Would your first post be a way to set that?


Celestial
Reply With Quote
  #5  
Old 10-29-2015, 12:03 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

Looks like for Beastlords I would possibly have to make (just like magician pets) another set of Pet Types with corresponding NPCIDs. I think...

Wonder why Iksar is not an alligator in the code?


Celestial
Reply With Quote
  #6  
Old 10-29-2015, 12:06 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Wood Elf Beastlord is a popular customization, I think.

It would use the same pet entry and npc_type as the existing beastlord pets. You'd simply update the spell record and spell scroll to support the Wood Elf race, and add a WOOD_ELF race check to the pets.cpp code linked above:

Code:
...
		case IKSAR:
			npc_type->race = WOLF;
			npc_type->texture = 0;
			npc_type->gender = 1;
			npc_type->size *= 2.0f;
			npc_type->luclinface = 0;
			break;
		case WOOD_ELF:
			npc_type->race = BEAR;
			npc_type->texture = 1;
			npc_type->gender = 2;
			npc_type->size = 0.5f;
			break;
		default:
			npc_type->race = WOLF;
			npc_type->texture = 0;
		}
...
Reply With Quote
  #7  
Old 10-29-2015, 12:07 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

This special code handling saves you from having to make hundreds of pet entries to specify different npc_types for each different race's level 1 pet, level 4 pet, level 8 pet, etc.
Reply With Quote
  #8  
Old 10-29-2015, 01:17 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Well, to allow you to specify race without a source change, you can change the pet spell to a different effect ID, 106 is Beastlord pet which then checks the source code for the aforementioned pet race, but you can use 33 (Normal pet), 71 (Necromancer pet), or 108 (Familiar) to avoid the Beastlord pet race logic.
Reply With Quote
  #9  
Old 10-29-2015, 01:34 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

Thanks guys! The source might not be too bad to do, make the change then recompile. Guess that would be my first foray into a customization.

Celestial
Reply With Quote
  #10  
Old 10-29-2015, 01:42 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

This one is actually not based on the spell effect id, but on the `petnaming` field in the `pets` table.

Code:
	// Pet naming:
	// 0 - `s pet
	// 1 - `s familiar
	// 2 - `s Warder
	// 3 - Random name if client, `s pet for others
	// 4 - Keep DB name

...

	//handle beastlord pet appearance
	if(record.petnaming == 2)
	{
		switch(GetBaseRace())
		{
		case VAHSHIR:
			npc_type->race = TIGER;
			npc_type->size *= 0.8f;
			break;
...
So you could change the pet naming type for the pet reference to something other than 2, and the race coding would be avoided without any source code changes, though the pet wouldn't be named Soandso's Warder anymore, either.
Reply With Quote
  #11  
Old 10-29-2015, 01:43 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Would likely be easier to just do what I suggested, as you wouldn't have to maintain your custom changes when you update your source.

Edit: Haven't messed with pets in a while, doing it my way does nothing, I realize that now. Just change pet naming. I forget what I remembered that was related to the pet effect IDs.
Reply With Quote
  #12  
Old 10-29-2015, 02:10 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

In thinking about it, it might be easier to change the pets.cpp. I would just need to notate to add that change back into that file if that file gets updated from the source. I wonder would it be difficult to somehow integrate this into the source and reference a DB flag to enable or disable wood-elf beast-lords.


Celestial
Reply With Quote
  #13  
Old 10-29-2015, 02:14 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

For customization's sake, it would really be better to have a db table for it.

pet_races
owner_race (int)
pet_race (int)
pet_gender (int)
pet_texture (int)
pet_size (float)

If I had a beard, I'd be stroking it thoughtfully.
Reply With Quote
  #14  
Old 10-29-2015, 02:40 PM
jpyou127's Avatar
jpyou127
Discordant
 
Join Date: Nov 2005
Posts: 270
Default

Watches intently as Shendare pretend strokes his beard...


Celestial
Reply With Quote
  #15  
Old 10-29-2015, 02:49 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Quote:
Originally Posted by Shendare View Post
For customization's sake, it would really be better to have a db table for it.

pet_races
owner_race (int)
pet_race (int)
pet_gender (int)
pet_texture (int)
pet_size (float)

If I had a beard, I'd be stroking it thoughtfully.
Why would that be better? Pets are just an npc_types entry that has all of those fields, except of course owner race.
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:05 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