本文整理汇总了C++中MovementInform函数的典型用法代码示例。如果您正苦于以下问题:C++ MovementInform函数的具体用法?C++ MovementInform怎么用?C++ MovementInform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MovementInform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Finalize
void PointMovementGenerator<T>:: Finalize(T &unit)
{
unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
if (unit.movespline->Finalized())
MovementInform(unit);
}
示例2: MovementInform
void WaypointMovementGenerator<Creature>::OnArrived(Creature* owner)
{
if (!owner)
return;
if (!i_path || i_path->empty())
return;
if (m_isArrivalDone)
return;
owner->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
m_isArrivalDone = true;
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, owner->GetGUID());
owner->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, owner, NULL);
}
// Inform script
MovementInform(owner);
owner->UpdateWaypointID(i_currentNode);
Stop(i_path->at(i_currentNode)->delay);
}
示例3: Finalize
void PointMovementGenerator<T>:: Finalize(T &unit)
{
if (unit.hasUnitState(UNIT_STAT_CHARGING))
unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
if (arrived) // without this crash!
MovementInform(unit);
}
示例4: Stop
void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
if (!i_path || i_path->nodes.empty())
return;
WaypointNode const &waypoint = i_path->nodes.at(i_currentNode);
if (waypoint.delay)
{
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
Stop(waypoint.delay);
}
if (waypoint.eventId && urand(0, 99) < waypoint.eventChance)
{
TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for %s.", waypoint.eventId, i_currentNode, creature->GetGUID().ToString().c_str());
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
creature->GetMap()->ScriptsStart(sWaypointScripts, waypoint.eventId, creature, nullptr);
}
// Inform script
MovementInform(creature);
creature->UpdateWaypointID(i_currentNode);
creature->SetWalk(waypoint.moveType != WAYPOINT_MOVE_TYPE_RUN);
}
示例5: MovementInform
void EffectMovementGenerator::Finalize(Unit* owner)
{
if (!owner)
return;
MovementInform(owner);
}
示例6: TC_LOG_DEBUG
void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
if (!i_path || i_path->empty())
return;
if (m_isArrivalDone)
return;
m_isArrivalDone = true;
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL);
}
// Inform script
MovementInform(creature);
creature->UpdateWaypointID(i_currentNode);
if (i_path->at(i_currentNode)->delay)
{
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
Stop(i_path->at(i_currentNode)->delay);
}
}
示例7: MovementInform
void PointMovementGenerator<T>::Finalize(T& unit)
{
unit.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_ROAMING_MOVE);
if (i_destinationHolder.HasArrived())
MovementInform(unit);
}
示例8: defined
void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
{
if (!i_path || i_path->empty())
return;
if (m_isArrivalDone)
return;
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
m_isArrivalDone = true;
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
#endif
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL);
}
// Inform script
MovementInform(creature);
creature->UpdateWaypointID(i_currentNode);
if (i_path->at(i_currentNode)->delay)
{
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
Stop(i_path->at(i_currentNode)->delay);
}
}
示例9: traveller
bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
if(!&unit)
return false;
if(unit.hasUnitState(UNIT_STAT_CAN_NOT_MOVE))
{
unit.clearUnitState(UNIT_STAT_ROAMING_MOVE);
return true;
}
unit.addUnitState(UNIT_STAT_ROAMING_MOVE);
Traveller<T> traveller(unit);
if (i_destinationHolder.UpdateTraveller(traveller, diff, false))
{
if (!IsActive(unit)) // force stop processing (movement can move out active zone with cleanup movegens list)
return true; // not expire now, but already lost
}
if(i_destinationHolder.HasArrived())
{
unit.clearUnitState(UNIT_STAT_ROAMING_MOVE);
MovementInform(unit);
return false;
}
return true;
}
示例10: BLIZZLIKE_ASSERT
void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
{
if (!i_path || i_path->empty())
return;
m_lastReachedWaypoint = i_currentNode;
if (m_isArrivalDone)
return;
creature.clearUnitState(UNIT_STAT_ROAMING_MOVE);
m_isArrivalDone = true;
WaypointPath::const_iterator currPoint = i_path->find(i_currentNode);
BLIZZLIKE_ASSERT(currPoint != i_path->end());
WaypointNode const& node = currPoint->second;
if (node.script_id)
{
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature movement start script %u at point %u for %s.", node.script_id, i_currentNode, creature.GetGuidStr().c_str());
creature.GetMap()->ScriptsStart(sCreatureMovementScripts, node.script_id, &creature, &creature);
}
// We have reached the destination and can process behavior
if (WaypointBehavior* behavior = node.behavior)
{
if (behavior->emote != 0)
creature.HandleEmote(behavior->emote);
if (behavior->spell != 0)
creature.CastSpell(&creature, behavior->spell, false);
if (behavior->model1 != 0)
creature.SetDisplayId(behavior->model1);
if (behavior->textid[0])
{
// Not only one text is set
if (behavior->textid[1])
{
// Select one from max 5 texts (0 and 1 already checked)
int i = 2;
for (; i < MAX_WAYPOINT_TEXT; ++i)
{
if (!behavior->textid[i])
break;
}
creature.MonsterSay(behavior->textid[rand() % i], LANG_UNIVERSAL);
}
else
creature.MonsterSay(behavior->textid[0], LANG_UNIVERSAL);
}
}
// Inform script
MovementInform(creature);
Stop(node.delay);
}
示例11: MovementInform
void PointMovementGenerator<T>::DoFinalize(T* unit)
{
if (unit->HasUnitState(UNIT_STATE_CHARGING))
unit->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
if (unit->movespline->Finalized())
MovementInform(unit);
}
示例12: Finalize
void PointMovementGenerator<T>:: Finalize(T& unit)
{
if (unit.HasUnitState(UNIT_STATE_CHARGING))
unit.ClearUnitState(UNIT_STATE_CHARGING | UNIT_STATE_JUMPING);
if (unit.movespline->Finalized())
MovementInform(unit);
}
示例13: MovementInform
void PointMovementGenerator<T>::DoFinalize(T* owner, bool active, bool movementInform)
{
MovementGenerator::AddFlag(MOVEMENTGENERATOR_FLAG_FINALIZED);
if (active)
owner->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
if (movementInform && MovementGenerator::HasFlag(MOVEMENTGENERATOR_FLAG_INFORM_ENABLED))
MovementInform(owner);
}
示例14: MovementInform
void PointMovementGenerator<T>::Finalize(T& unit)
{
unit.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_ROAMING_MOVE);
if (unit.GetTypeId() == TYPEID_UNIT)
unit.UpdateSpeed(MOVE_RUN, true);
if (unit.movespline->Finalized())
MovementInform(unit);
}
示例15: Reset
void Reset()
{
nextMovementTimer = 0;
actualAngle = me->GetAngle(CenterPos.GetPositionX(), CenterPos.GetPositionY());
direction = urand(0, 1);
if (direction)
myPositionZ = 435.0f;
else
myPositionZ = 440.0f;
// Enable Movements
MovementInform(POINT_MOTION_TYPE, POINT_KRIKTHIK_CIRCLE);
me->setActive(true);
}