[7870] Implement creature ranged ammo show at ranged weapon use. Author: VladimirMangos
* Use BDC data (creature weapon not alwas listed in item_template) --HG-- branch : trunk
This commit is contained in:
@@ -964,7 +964,7 @@ struct ItemEntry
|
|||||||
{
|
{
|
||||||
uint32 ID; // 0
|
uint32 ID; // 0
|
||||||
uint32 Class; // 1
|
uint32 Class; // 1
|
||||||
//uint32 SubClass; // 2 some items have strnage subclasses
|
uint32 SubClass; // 2 some items have strnage subclasses
|
||||||
int32 Unk0; // 3
|
int32 Unk0; // 3
|
||||||
int32 Material; // 4
|
int32 Material; // 4
|
||||||
uint32 DisplayId; // 5
|
uint32 DisplayId; // 5
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ const char GtOCTRegenHPfmt[]="f";
|
|||||||
const char GtRegenHPPerSptfmt[]="f";
|
const char GtRegenHPPerSptfmt[]="f";
|
||||||
const char GtRegenMPPerSptfmt[]="f";
|
const char GtRegenMPPerSptfmt[]="f";
|
||||||
const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||||
const char Itemfmt[]="nixiiiii";
|
const char Itemfmt[]="niiiiiii";
|
||||||
const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx";
|
const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||||
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
||||||
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
||||||
|
|||||||
@@ -866,8 +866,8 @@ void ObjectMgr::LoadEquipmentTemplates()
|
|||||||
sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount );
|
sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount );
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
|
|
||||||
// This DBC is currently only used for item templates and creature equipments checks.
|
// Creature items can be not listed in item_template
|
||||||
sItemStore.Clear();
|
//sItemStore.Clear(); -- so used in spell casting
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid)
|
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid)
|
||||||
|
|||||||
+34
-1
@@ -3241,7 +3241,40 @@ void Spell::WriteAmmoToPacket( WorldPacket * data )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: implement selection ammo data based at ranged weapon stored in equipmodel/equipinfo/equipslot fields
|
else
|
||||||
|
{
|
||||||
|
for (uint8 i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
if(uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
|
||||||
|
{
|
||||||
|
if(ItemEntry const * itemEntry = sItemStore.LookupEntry(item_id))
|
||||||
|
{
|
||||||
|
if(itemEntry->Class==ITEM_CLASS_WEAPON)
|
||||||
|
{
|
||||||
|
switch(itemEntry->SubClass)
|
||||||
|
{
|
||||||
|
case ITEM_SUBCLASS_WEAPON_THROWN:
|
||||||
|
ammoDisplayID = itemEntry->DisplayId;
|
||||||
|
ammoInventoryType = itemEntry->InventoryType;
|
||||||
|
break;
|
||||||
|
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||||
|
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||||
|
ammoDisplayID = 5996; // is this need fixing?
|
||||||
|
ammoInventoryType = INVTYPE_AMMO;
|
||||||
|
break;
|
||||||
|
case ITEM_SUBCLASS_WEAPON_GUN:
|
||||||
|
ammoDisplayID = 5998; // is this need fixing?
|
||||||
|
ammoInventoryType = INVTYPE_AMMO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ammoDisplayID)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*data << uint32(ammoDisplayID);
|
*data << uint32(ammoDisplayID);
|
||||||
*data << uint32(ammoInventoryType);
|
*data << uint32(ammoInventoryType);
|
||||||
|
|||||||
Reference in New Issue
Block a user