EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Beastlord Pet NPC question (https://www.eqemulator.org/forums/showthread.php?t=40139)

jpyou127 10-29-2015 11:44 AM

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


Celestial

Shendare 10-29-2015 11:51 AM

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

Shendare 10-29-2015 11:55 AM

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

jpyou127 10-29-2015 12:00 PM

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

jpyou127 10-29-2015 12:03 PM

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

Shendare 10-29-2015 12:06 PM

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


Shendare 10-29-2015 12:07 PM

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.

Kingly_Krab 10-29-2015 01:17 PM

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.

jpyou127 10-29-2015 01:34 PM

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

Shendare 10-29-2015 01:42 PM

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.

Kingly_Krab 10-29-2015 01:43 PM

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.

jpyou127 10-29-2015 02:10 PM

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

Shendare 10-29-2015 02:14 PM

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.

jpyou127 10-29-2015 02:40 PM

Watches intently as Shendare pretend strokes his beard...


Celestial

Kingly_Krab 10-29-2015 02:49 PM

Quote:

Originally Posted by Shendare (Post 244733)
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.

jpyou127 10-29-2015 02:49 PM

Just as another thought, the pets.cpp list wolf, alligator, tiger, bear. Where is this referenced and could other NPC Types be used? I may not have looked too closely yet and that might be in that file.

Celestial

Kingly_Krab 10-29-2015 02:53 PM

Referenced in races.h in common/races.h, line 25 to line 58:
Code:

#define HUMAN            1
#define BARBARIAN        2
#define ERUDITE            3
#define WOOD_ELF        4
#define HIGH_ELF        5
#define DARK_ELF        6
#define HALF_ELF        7
#define DWARF            8
#define TROLL            9
#define OGRE            10
#define HALFLING        11
#define GNOME            12
#define WEREWOLF        14
#define WOLF            42
#define BEAR            43
#define SKELETON        60
#define TIGER            63
#define ELEMENTAL        75
#define ALLIGATOR        91
#define EYE_OF_ZOMM        108
#define WOLF_ELEMENTAL    120
#define INVISIBLE_MAN    127
#define IKSAR            128
#define VAHSHIR            130
#define CONTROLLED_BOAT 141
#define MINOR_ILL_OBJ    142
#define TREE            143
#define IKSAR_SKELETON    161
#define FROGLOK            330
#define FROGLOK2        74    // Not sure why /who all reports race as 74 for frogloks
#define DRAKKIN            522 // 32768
#define EMU_RACE_NPC    131069 // was 65533
#define EMU_RACE_PET    131070 // was 65534
#define EMU_RACE_UNKNOWN 131071 // was 65535


Shendare 10-29-2015 02:58 PM

The whole point is that beastlord pets use the same npc_type, but display a different race depending on the owner.

The alternative would be to have a different npc_type for each race for each level of beastlord pets, which would be... extremely cumbersome.

The current hard-coded values work, but a database table would make customization easier.

Kingly_Krab 10-29-2015 03:15 PM

You could also just do a rule-based pet system so like RuleI(Character, OgreBeastlordPet) or something like that with a race ID, as well as the texture, gender, and size as separate rules.

Shendare 10-29-2015 03:22 PM

Hmm... true. Could have one for each player race, with defaults for any pet race, texture, gender, and size not specified.

jpyou127 10-29-2015 03:30 PM

Can the Chokidai 356 be used for Iksar beastlords? Or is it limited to that value range?

Celestial

EDIT: So I should be able to insert into races.h #define CHOKIDAI 356 since its referenced within the $races_table = Array(

This would allow the IKSAR bst to have the correct pet. Can this list be added to in order to enable Underfoot models?

Kingly_Krab 10-29-2015 04:16 PM

Do you mean be added to the source by you yourself, or are you asking for someone to make an actual commit to the main branch?

jpyou127 10-29-2015 04:23 PM

For myself, although if its accurate would that qualify for addition as a commit to the source? I am referencing the Iksar pet model.


Celestial

jpyou127 10-30-2015 08:29 AM

Update:

Woodelf worked great, just need to increase the size of the pet.

I also added the above to the races.h for Chokadai as the Iksar BST pet and recompiled. but on pet summon it defaulted to a human model. Will try to test again.

Celestial

Shendare 10-30-2015 10:39 AM

That means that either the model is not in your GlobalLoad, or it is not set to the correct gender. Most NPC races are gender 2, neuter. If a race has male and female versions, though, then it'll use those genders instead (0 male, 1 female).

jpyou127 10-30-2015 12:00 PM

To reference as I work on this, GlobalLoad is located where?


Celestial

Shendare 10-30-2015 12:05 PM

Resources\GlobalLoad.txt in your EverQuest directory. The latest clients also have a GlobalLoad_chr.txt for loading individual race models from zone package files.

jpyou127 10-30-2015 01:29 PM

Roger that, I am able to #race myself for that particular model.

Shendare 10-30-2015 01:39 PM

Cool. Sounds like the gender was off, then.

jpyou127 10-30-2015 05:06 PM

That was it, I recompiled and now the Iksar BST has the correct race of pet. I want to look to see if there are different models of that race as I think the one that is spot on is orangish in color. Once I get it set, would this be a submission for commit to source?

Is there a tool that I could use that will tell me if gender or other options are available for a particular race?


Celestial

Shendare 10-30-2015 05:29 PM

Race models often have different textures defined that can be set to display different appearances. Chokidai may be one of them. Bears use the same 3d model, but different textures for black, brown, and white (polar) bear NPCs, for example.

Not sure about the change submission. If it's a bug fix that makes EQEmu behave more like EQ Live, then it gets added to the master source. If it's a customization, it does not get added to the master, you simply keep it in your own code, generally as a branch forked from the master.

jpyou127 11-02-2015 09:35 AM

As far as being like live currrently the source is set as wolf for the Iksar BST. On live it has always been the Chodakai. Would I submit a change to someone for evaluation or testing?


Celestial

Shendare 11-02-2015 12:36 PM

It's also technically possible that the wolf race has a specific texture for the chokidai.

If that's not the case, though, it sounds like a good candidate for a post in Development::Server Code Submissions or Development::Bug Reports.

jpyou127 11-02-2015 12:39 PM

Is there are way to view these different textures outside of just spawning and changing them in game?

Celestial

Shendare 11-02-2015 12:42 PM

I think there are a couple of places that have race graphics in the server dev wikis and threads. There's an old EQEmu Quest Manual pdf that had a bunch of them. Akka's EOC has been incorporating graphics and videos where it can, so it may have race graphics as well.

Really, though, hopping in-game and using the #spawn, #race, #gender, and #texture commands is gonna be the most effective!

jpyou127 11-02-2015 12:44 PM

Roger that Shendare! thanks for your help!


Celestial


All times are GMT -4. The time now is 08:04 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.