mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 05:11:55 +01: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) )
|
||||
|
||||
@@ -184,6 +184,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
|
||||
|
||||
//Checks if you can cast the specified spell
|
||||
bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false);
|
||||
|
||||
void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
|
||||
|
||||
void SetSheathState(SheathState newState);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
|
||||
|
||||
Reference in New Issue
Block a user