本文整理匯總了C++中AIM_Initialize函數的典型用法代碼示例。如果您正苦於以下問題:C++ AIM_Initialize函數的具體用法?C++ AIM_Initialize怎麽用?C++ AIM_Initialize使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AIM_Initialize函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: SetInstanceId
void Totem::Summon(Unit* owner)
{
sLog.outDebug("AddObject at Totem.cpp line 49");
SetInstanceId(owner->GetInstanceId());
owner->GetMap()->Add((Creature*)this);
// select totem model in dependent from owner team
CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId()==TYPEID_PLAYER && cinfo)
{
uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(),cinfo);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
SetDisplayId(display_id);
}
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetGUID();
SendMessageToSet(&data,true);
AIM_Initialize();
switch(m_type)
{
case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break;
case TOTEM_STATUE: CastSpell(GetOwner(), GetSpell(), true); break;
default: break;
}
}
示例2: setPowerType
void Vehicle::AddToWorld()
{
if(!IsInWorld())
{
if(m_zoneScript)
m_zoneScript->OnCreatureCreate(this, true);
ObjectAccessor::Instance().AddObject(this);
for(uint32 i = 0; i < MAX_SPELL_VEHICLE; ++i)
{
if(!m_spells[i])
continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]);
if(!spellInfo)
continue;
if(spellInfo->powerType == POWER_MANA)
break;
if(spellInfo->powerType == POWER_ENERGY)
{
setPowerType(POWER_ENERGY);
SetMaxPower(POWER_ENERGY, 100);
break;
}
}
Unit::AddToWorld();
InstallAllAccessories();
AIM_Initialize();
}
}
示例3: AIM_Initialize
void Totem::Summon(Unit* owner)
{
AIM_Initialize();
owner->GetMap()->Add((Creature*)this);
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch(m_type)
{
case TOTEM_PASSIVE:
for (int i=0; i<MAX_CREATURE_SPELL_DATA_SLOT; ++i)
if (m_spells[i])
CastSpell(this, m_spells[i], true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default:
break;
}
}
示例4: AIM_Initialize
void Totem::Summon(Unit* owner)
{
AIM_Initialize();
owner->GetMap()->Add((Creature*)this);
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
#ifdef ENABLE_ELUNA
sEluna->OnSummoned(this, owner);
#endif /* ENABLE_ELUNA */
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch (m_type)
{
case TOTEM_PASSIVE:
CastSpell(this, GetSpell(), true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break;
}
}
示例5: AIM_Initialize
void Totem::Summon(Unit* owner)
{
AIM_Initialize();
owner->GetMap()->Add((Creature*)this);
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch(m_type)
{
case TOTEM_PASSIVE:
CastSpell(this, GetSpell(), true);
// Totem of Wrath, Area Aura Enemies: Mod Crit % Taken
if (m_spells[1] == 30708)
CastSpell(this, m_spells[1], true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break;
}
}
示例6: SetMaxHealth
void Totem::Summon(Unit* owner)
{
if(!owner)
return;
// Mana Tide Totem should have 10% of caster's health
if(GetSpell() == 16191)
{
SetMaxHealth(owner->GetMaxHealth()*10/100);
SetHealth(GetMaxHealth());
}
owner->GetMap()->Add((Creature*)this);
AIM_Initialize();
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch(m_type)
{
case TOTEM_PASSIVE:
CastSpell(this, GetSpell(), true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break;
}
}
示例7: AIM_Initialize
void Totem::Summon(Unit* owner)
{
AIM_Initialize();
owner->GetMap()->Add((Creature*)this);
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetObjectGuid();
SendMessageToSet(&data,true);
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch(m_type)
{
case TOTEM_PASSIVE:
CastSpell(this, GetSpell(), true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break;
}
}
示例8: GetCreatureInfo
void Totem::Summon(Unit* owner)
{
owner->GetMap()->Add((Creature*)this);
// select totem model in dependent from owner team
CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId() == TYPEID_PLAYER && cinfo)
{
uint32 display_id = sObjectMgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
SetDisplayId(display_id);
}
AIM_Initialize();
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
switch(m_type)
{
case TOTEM_PASSIVE:
CastSpell(this, GetSpell(), true);
break;
case TOTEM_STATUE:
CastSpell(GetOwner(), GetSpell(), true);
break;
default: break;
}
}
示例9: AIM_Initialize
void Totem::Summon(Unit* owner)
{
AIM_Initialize();
owner->GetMap()->Add((Creature*)this);
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
switch(m_type)
{
case TOTEM_PASSIVE:
{
for (uint32 i = 0; i <= GetSpellMaxIndex(); ++i)
{
if (uint32 spellId = GetSpell(i))
CastSpell(this, spellId, true);
}
break;
}
case TOTEM_STATUE:
{
if (GetSpell(0))
CastSpell(GetOwner(), GetSpell(0), true);
break;
}
default:
break;
}
}
示例10: SetMapId
bool Vehicle::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, uint32 team)
{
SetMapId(map->GetId());
SetInstanceId(map->GetInstanceId());
Object::_Create(guidlow, Entry, HIGHGUID_VEHICLE);
if(!InitEntry(Entry, team))
return false;
m_defaultMovementType = IDLE_MOTION_TYPE;
AIM_Initialize();
SetVehicleId(vehicleId);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
CreatureInfo const *ci = GetCreatureInfo();
setFaction(team == ALLIANCE ? ci->faction_A : ci->faction_H);
SetMaxHealth(ci->maxhealth);
SelectLevel(ci);
SetHealth(GetMaxHealth());
return true;
}
示例11: SetSummonProperties
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
SetSummonProperties(type, lifetime);
GetMap()->Add((Creature*)this);
AIM_Initialize();
}
示例12: AIM_Initialize
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
m_type = type;
m_timer = lifetime;
m_lifetime = lifetime;
AIM_Initialize();
GetMap()->Add((Creature*)this);
}
示例13: AIM_Initialize
void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
{
m_type = type;
m_timer = lifetime;
m_lifetime = lifetime;
MapManager::Instance().GetMap(GetMapId(), this)->Add((Creature*)this);
AIM_Initialize();
}
示例14: UpdateNPCPositions
void Transport::Update(uint32 p_diff)
{
UpdateNPCPositions();
if (!AI())
{
if (!AIM_Initialize())
sLog->outError("Could not initialize GameObjectAI for Transport");
}
else
AI()->UpdateAI(p_diff);
if (m_WayPoints.size() <= 1)
return;
m_timer = getMSTime() % m_period;
while (((m_timer - m_curr->first) % m_pathTime)
> ((m_next->first - m_curr->first) % m_pathTime))
{
DoEventIfAny(*m_curr, true);
m_curr = GetNextWayPoint();
m_next = GetNextWayPoint();
DoEventIfAny(*m_curr, false);
// first check help in case client-server transport coordinates de-synchronization
if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport)
{
TeleportTransport(m_curr->second.mapid, m_curr->second.x,
m_curr->second.y, m_curr->second.z);
}
else
{
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
}
sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid,
m_curr->second.x, m_curr->second.y, m_curr->second.z);
m_nextNodeTime = m_curr->first;
if (m_curr == m_WayPoints.begin())
sLog->outDebug(LOG_FILTER_TRANSPORTS,
" ************ BEGIN ************** %s", m_name.c_str());
sLog->outDebug(LOG_FILTER_TRANSPORTS, "%s moved to %d %f %f %f %d",
m_name.c_str(), m_curr->second.id, m_curr->second.x,
m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
}
sScriptMgr->OnTransportUpdate(this, p_diff);
}
示例15: Update
void Transport::Update(uint32 p_diff)
{
if (!AI())
{
if (!AIM_Initialize())
TC_LOG_ERROR("entities.transport", "Could not initialize GameObjectAI for Transport");
}
else
AI()->UpdateAI(p_diff);
if (m_WayPoints.size() <= 1)
return;
if (!m_period)
return;
m_timer = getMSTime() % m_period;
while (((m_timer - m_curr->first) % m_pathTime) > ((m_next->first - m_curr->first) % m_pathTime))
{
DoEventIfAny(*m_curr, true);
m_curr = GetNextWayPoint();
m_next = GetNextWayPoint();
DoEventIfAny(*m_curr, false);
// first check help in case client-server transport coordinates de-synchronization
if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport)
{
TeleportTransport(m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);
}
else
{
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
UpdateNPCPositions(); // COME BACK MARKER
// This forces the server to update positions in transportation for players -- gunship
UpdatePlayerPositions();
}
sScriptMgr->OnRelocate(this, m_curr->first, m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);
m_nextNodeTime = m_curr->first;
if (m_curr == m_WayPoints.begin())
TC_LOG_DEBUG("entities.transport", " ************ BEGIN ************** %s", m_name.c_str());
TC_LOG_DEBUG("entities.transport", "%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
}
sScriptMgr->OnTransportUpdate(this, p_diff);
}