|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
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. |

10-29-2015, 11:44 AM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
Beastlord Pet NPC question
Anyone know the process to determine the NPC type for a beastlord summoned pet?
Celestial
|

10-29-2015, 11:51 AM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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'.
|

10-29-2015, 11:55 AM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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
|

10-29-2015, 12:00 PM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
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
|

10-29-2015, 12:03 PM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
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
|

10-29-2015, 12:06 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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;
}
...
|

10-29-2015, 12:07 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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.
|

10-29-2015, 01:17 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,603
|
|
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.
|

10-29-2015, 01:34 PM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
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
|

10-29-2015, 01:42 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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.
|

10-29-2015, 01:43 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,603
|
|
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.
|

10-29-2015, 02:10 PM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
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
|

10-29-2015, 02:14 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
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.
|

10-29-2015, 02:40 PM
|
 |
Discordant
|
|
Join Date: Nov 2005
Posts: 270
|
|
Watches intently as Shendare pretend strokes his beard...
Celestial
|

10-29-2015, 02:49 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,603
|
|
Quote:
Originally Posted by Shendare
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:32 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |