(RoF+) Added herosforgemodel field to the npc_types table. Not fully functional yet for NPCs (currently only displays helm correctly).

(RoF2) Updated item links from #npcstat command output.
This commit is contained in:
Trevius
2014-12-24 02:31:37 -06:00
parent f6dc138dc8
commit c48d2d9888
10 changed files with 116 additions and 86 deletions
+13 -3
View File
@@ -978,7 +978,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName));
for (i = 0; i < _MaterialCount; i++)
//for (i = 0; i < _MaterialCount; i++)
for (i = 0; i < 9; i++)
{
// Only Player Races Wear Armor
if (Mob::IsPlayerRace(race) || i > 6)
@@ -2733,7 +2734,6 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
int32 Mob::GetHerosForgeModel(uint8 material_slot) const
{
uint32 HeroModel = 0;
if (material_slot >= 0 && material_slot < MaterialPrimary)
{
@@ -2744,7 +2744,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
if (item != 0 && invslot != INVALID_INDEX)
{
if (this->IsClient())
if (IsClient())
{
const ItemInst* inst = CastToClient()->m_inv[invslot];
if (inst)
@@ -2766,6 +2766,16 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
HeroModel = item->HerosForgeModel;
}
}
if (IsNPC())
{
HeroModel = CastToNPC()->GetHeroForgeModel();
// Robes require full model number, and should only be sent to chest slot
if (HeroModel > 1000 && material_slot != 1)
{
HeroModel = 0;
}
}
}
// Auto-Convert Hero Model to match the slot