mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 06:29:50 -04:00
Merge SD2 up to r967
--HG-- branch : trunk
This commit is contained in:
@@ -747,6 +747,31 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s
|
||||
return pList;
|
||||
}
|
||||
|
||||
void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged)
|
||||
{
|
||||
if (bLoadDefault)
|
||||
{
|
||||
if (CreatureInfo const* pInfo = GetCreatureTemplateStore(m_creature->GetEntry()))
|
||||
m_creature->LoadEquipment(pInfo->equipmentId,true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (uiMainHand >= 0)
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
|
||||
|
||||
if (uiOffHand >= 0)
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
|
||||
|
||||
if (uiRanged >= 0)
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
|
||||
}
|
||||
|
||||
void ScriptedAI::SetSheathState(SheathState newState)
|
||||
{
|
||||
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, newState);
|
||||
}
|
||||
|
||||
/*void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
|
||||
Reference in New Issue
Block a user