mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge commit 'origin/master' into 310
This commit is contained in:
commit
f72a8bc6dc
21 changed files with 161 additions and 62 deletions
|
|
@ -1737,6 +1737,33 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
TagUnitMap.push_back(pet);
|
||||
}
|
||||
}
|
||||
if (m_spellInfo->Id==52759) //Ancestral Awakening (special target selection)
|
||||
{
|
||||
float lowestPerc = (float)m_caster->GetHealth() / (float)m_caster->GetMaxHealth();
|
||||
Unit* lowestTarget = m_caster;
|
||||
|
||||
if (pGroup)
|
||||
{
|
||||
Group::MemberSlotList const& members = pGroup->GetMemberSlots();
|
||||
Group::MemberSlotList::const_iterator itr = members.begin();
|
||||
for(; itr != members.end(); ++itr)
|
||||
{
|
||||
if (Unit* member = ObjectAccessor::GetPlayer(*m_caster, (*itr).guid))
|
||||
{
|
||||
if (member == m_caster || member->isDead() || m_caster->IsHostileTo(member) || !m_caster->IsWithinDistInMap(member, radius))
|
||||
continue;
|
||||
|
||||
float perc = (float)member->GetHealth() / (float)member->GetMaxHealth();
|
||||
if (perc <= lowestPerc)
|
||||
{
|
||||
lowestPerc = perc;
|
||||
lowestTarget = member;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TagUnitMap.push_back(lowestTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pGroup)
|
||||
|
|
@ -3048,7 +3075,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(ammoInventoryType);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue