本文整理汇总了C++中Creature::BuildHeartBeatMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::BuildHeartBeatMsg方法的具体用法?C++ Creature::BuildHeartBeatMsg怎么用?C++ Creature::BuildHeartBeatMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature::BuildHeartBeatMsg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traveller
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
{
CreatureTraveller traveller(owner);
i_destinationHolder.UpdateTraveller(traveller, time_diff);
if (time_diff > i_travel_timer)
{
owner.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
// restore orientation of not moving creature at returning to home
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
{
//sLog->outDebug("Entering HomeMovement::GetDestination(z, y, z)");
owner.SetOrientation(ori);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
owner.ClearUnitState(UNIT_STAT_EVADE);
owner.LoadCreaturesAddon(true);
owner.AI()->JustReachedHome();
return false;
}
i_travel_timer -= time_diff;
return true;
}
示例2: traveller
bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
CreatureTraveller traveller(owner);
i_destinationHolder.UpdateTraveller(traveller, time_diff);
if (time_diff > i_travel_timer)
{
owner.AddUnitMovementFlag(MOVEFLAG_WALK_MODE);
// restore orientation of not moving creature at returning to home
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
{
owner.SetOrientation(ori);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
owner.AI()->JustReachedHome();
return false;
}
i_travel_timer -= time_diff;
return true;
}
示例3: traveller
bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
CreatureTraveller traveller( owner);
if (i_destinationHolder.UpdateTraveller(traveller, time_diff, false))
{
if (!IsActive(owner)) // force stop processing (movement can move out active zone with cleanup movegens list)
return true; // not expire now, but already lost
}
if (time_diff > i_travel_timer)
{
owner.AddSplineFlag(SPLINEFLAG_WALKMODE);
// restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
{
if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
{
owner.SetOrientation(data->orientation);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
}
owner.LoadCreatureAddon(true);
owner.AI()->JustReachedHome();
return false;
}
i_travel_timer -= time_diff;
return true;
}
示例4: traveller
bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
CreatureTraveller traveller( owner);
i_destinationHolder.UpdateTraveller(traveller, time_diff, false);
if (time_diff > i_travel_timer)
{
owner.AddSplineFlag(SPLINEFLAG_WALKMODE);
// restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
{
if(CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
{
owner.SetOrientation(data->orientation);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
}
owner.AI()->JustReachedHome();
return false;
}
i_travel_timer -= time_diff;
return true;
}
示例5: InstallAllAccessories
void Vehicle::InstallAllAccessories()
{
if(!GetMap())
return;
CreatureDataAddon const *cainfo = GetCreatureAddon();
if(!cainfo || !cainfo->passengers)
return;
for (CreatureDataAddonPassengers const* cPassanger = cainfo->passengers; cPassanger->seat_idx != -1; ++cPassanger)
{
// Continue if seat already taken
if(GetPassenger(cPassanger->seat_idx))
continue;
uint32 guid = 0;
bool isVehicle = false;
// Set guid and check whatever it is
if(cPassanger->guid != 0)
guid = cPassanger->guid;
else
{
CreatureDataAddon const* passAddon;
passAddon = ObjectMgr::GetCreatureTemplateAddon(cPassanger->entry);
if(passAddon && passAddon->vehicle_id != 0)
isVehicle = true;
else
guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
}
// Create it
Creature *pPassenger = new Creature;
if(!isVehicle)
{
uint32 entry = cPassanger->entry;
if(entry == 0)
{
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if(!data)
continue;
entry = data->id;
}
if(!pPassenger->Create(guid, GetMap(), GetPhaseMask(), entry, 0))
continue;
pPassenger->LoadFromDB(guid, GetMap());
pPassenger->Relocate(GetPositionX(), GetPositionY(), GetPositionZ());
GetMap()->Add(pPassenger);
pPassenger->AIM_Initialize();
}
else
pPassenger = (Creature*)SummonVehicle(cPassanger->entry, GetPositionX(), GetPositionY(), GetPositionZ(), 0);
// Enter vehicle...
pPassenger->EnterVehicle(this, cPassanger->seat_idx, true);
// ...and send update. Without this, client wont show this new creature/vehicle...
WorldPacket data;
pPassenger->BuildHeartBeatMsg(&data);
pPassenger->SendMessageToSet(&data, false);
}
}
示例6: traveller
bool
HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff)
{
CreatureTraveller traveller(owner);
i_destinationHolder.UpdateTraveller(traveller, time_diff);
if (time_diff > i_travel_timer)
{
float x, y, z;
owner.GetRespawnCoord(x, y, z);
float myx, myy, myz;
owner.GetPosition(myx, myy, myz);
if (x != myx || y != myy || z != myz)
{
Position travelto = owner.GetMap()->getNextPositionOnPathToLocation(myx,myy,myz,x,y,z);
uint32 travel_time = i_destinationHolder.SetDestination(traveller, travelto.m_positionX, travelto.m_positionY, travelto.m_positionZ);
modifyTravelTime(travel_time);
return true;
}
owner.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
// restore orientation of not moving creature at returning to home
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
{
//sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)");
owner.SetOrientation(ori);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
owner.clearUnitState(UNIT_STAT_EVADE);
owner.AI()->JustReachedHome();
return false;
}
i_travel_timer -= time_diff;
return true;
}