Instead of having a hardcoded list of which IDs are valid as mounts, and which IDs to create in the user's backpack when mounting them, move it all out to creatures.dfn so UOX3 users can more easily implement custom mounts etc. without having to edit the UOX3 source themselves.
For instance, we could add another tag to the creatures.dfn file named simply "MOUNT", as well as some tag to identify the corresponding item-ID.
Example:
In
void MountCreature() in uox3.cpp, we have
Code: Select all
case 0x7A: c->SetID( 0x3EB4 ); break; // Unicorn
which could be moved into creatures.dfn like this:
Code: Select all
[CREATURE 0x7a]
{ Unicorn
ICON=0x25ce
SOUND_STARTATTACK=0x4bc
SOUND_IDLE=0x4bd
SOUND_ATTACK=0x4be
SOUND_DEFEND=0x4bf
SOUND_DIE=0x4c0
MOVEMENT=LAND
ANIMAL
[color=yellow]MOUNT[/color]
[color=yellow]MOUNTITEM=0x3EB4[/color]
}
That would also (I think) remove the need for the IsValidMount function in cChar.cpp, or at least the hardcoded list of body IDs there (could generate a list based MOUNT tags in creatures.dfn on startup or something?.
Thoughts?