本文整理汇总了C++中SetRun函数的典型用法代码示例。如果您正苦于以下问题:C++ SetRun函数的具体用法?C++ SetRun怎么用?C++ SetRun使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetRun函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WaypointReached
void WaypointReached(uint32 waypointId)
{
if (!instance)
return;
switch (waypointId)
{
case 8:
SetRun(false);
me->SummonCreature(18764, 2181.87f, 112.46f, 89.45f, 0.26f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 9:
Talk(SAY_TH_ARMORY);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_ITEM);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_ITEM);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
break;
case 10:
me->SetDisplayId(THRALL_MODEL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
me->SummonCreature(MOB_ENTRY_RIFLE, 2200.28f, 137.37f, 87.93f, 5.07f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_WARDEN, 2197.44f, 131.83f, 87.93f, 0.78f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2203.62f, 135.40f, 87.93f, 3.70f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2200.75f, 130.13f, 87.93f, 1.48f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 21:
me->SummonCreature(MOB_ENTRY_RIFLE, 2135.80f, 154.01f, 67.45f, 4.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_WARDEN, 2144.36f, 151.87f, 67.74f, 4.46f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2142.12f, 154.41f, 67.12f, 4.56f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2138.08f, 155.38f, 67.24f, 4.60f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 25:
me->SummonCreature(MOB_ENTRY_RIFLE, 2102.98f, 192.17f, 65.24f, 6.02f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_WARDEN, 2108.48f, 198.75f, 65.18f, 5.15f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2106.11f, 197.29f, 65.18f, 5.63f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_VETERAN, 2104.18f, 194.82f, 65.18f, 5.75f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 29:
Talk(SAY_TH_SKARLOC_MEET);
me->SummonCreature(ENTRY_SCARLOC, 2036.48f, 271.22f, 63.43f, 5.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
//temporary, skarloc should rather be triggered to walk up to thrall
break;
case 30:
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
Talk(SAY_TH_MOUNTS_UP);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
me->SummonCreature(MOB_ENTRY_WATCHMAN, 2124.26f, 522.16f, 56.87f, 3.99f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_WATCHMAN, 2121.69f, 525.37f, 57.11f, 4.01f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_SENTRY, 2124.65f, 524.55f, 56.63f, 3.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 59:
me->SummonCreature(SKARLOC_MOUNT, 2488.64f, 625.77f, 58.26f, 4.71f, TEMPSUMMON_TIMED_DESPAWN, 10000);
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
instance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
SetRun(false);
break;
case 68:
me->SummonCreature(MOB_ENTRY_BARN_PROTECTOR, 2500.22f, 692.60f, 55.50f, 2.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_BARN_LOOKOUT, 2500.13f, 696.55f, 55.51f, 3.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN, 2500.55f, 693.64f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN, 2500.94f, 695.81f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 71:
SetRun();
break;
case 81:
SetRun(false);
break;
case 83:
me->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR, 2627.33f, 646.82f, 56.03f, 4.28f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
me->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT, 2624.14f, 648.03f, 56.03f, 4.50f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN, 2625.32f, 649.60f, 56.03f, 4.38f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN, 2627.22f, 649.00f, 56.03f, 4.34f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
break;
//.........这里部分代码省略.........
示例2: WaypointReached
void WaypointReached(uint32 uiPointId) override
{
switch (uiPointId)
{
case 2:
SetRun();
DoScriptText(m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER ? SAY_ALLIANCE_SQUAD_RUN : SAY_HORDE_SQUAD_RUN, m_creature);
break;
case 4:
// first horde attack
if (m_creature->GetEntry() == NPC_KORKRON_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7433.193f, 1838.199f, 402.43f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7441.071f, 1848.997f, 401.03f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7451.976f, 1850.776f, 402.96f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 6:
// first alliance attack
if (m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7217.792f, 1602.024f, 378.86f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7235.733f, 1597.831f, 381.08f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 9:
// second horde attack
if (m_creature->GetEntry() == NPC_KORKRON_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7420.511f, 1813.180f, 425.14f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7411.768f, 1784.054f, 427.84f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7418.514f, 1805.596f, 425.50f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 13:
if (m_creature->GetEntry() == NPC_KORKRON_SQUAD_LEADER)
{
DoScriptText(SAY_HORDE_SQUAD_BREAK, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
}
break;
case 14:
if (m_creature->GetEntry() == NPC_KORKRON_SQUAD_LEADER)
{
DoScriptText(SAY_HORDE_SQUAD_BREAK_DONE, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
}
break;
case 15:
// second alliance attack
if (m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7328.375f, 1631.935f, 416.06f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7334.475f, 1618.401f, 412.93f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7341.556f, 1632.023f, 423.01f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 20:
if (m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER)
{
DoScriptText(SAY_ALLIANCE_SQUAD_BREAK, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
}
break;
case 21:
if (m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER)
{
DoScriptText(SAY_ALLIANCE_SQUAD_BREAK_DONE, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
}
break;
case 22:
// horde gate attack
if (m_creature->GetEntry() == NPC_KORKRON_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7280.229f, 1725.829f, 471.37f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7272.390f, 1732.530f, 472.43f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7285.863f, 1690.997f, 483.35f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7334.487f, 1690.376f, 443.32f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7371.765f, 1699.052f, 442.50f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 25:
// alliance gate attack
if (m_creature->GetEntry() == NPC_SKYBREAKER_SQUAD_LEADER)
{
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7205.636f, 1648.500f, 453.59f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7224.602f, 1677.164f, 454.65f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7220.114f, 1667.603f, 451.01f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7220.528f, 1634.114f, 434.81f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
m_creature->SummonCreature(NPC_YMIRHEIM_DEFENDER, 7237.092f, 1687.461f, 459.81f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
break;
case 26:
{
// event complete
if (Player* pPlayer = GetPlayerForEscort())
m_creature->SetFacingToObject(pPlayer);
DoScriptText(SAY_EVENT_COMPLETE, m_creature);
//.........这里部分代码省略.........
示例3: UpdateAI
//.........这里部分代码省略.........
naralex->AI()->Talk(EMOTE_TROUBLED_SLEEP);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943f, 199.701f, -103.529f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08f, 221.13f, -103.609f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007f, 227.428f, -97.421f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 4)
{
++eventProgress;
eventTimer = 30000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
naralex->AI()->Talk(EMOTE_WRITHE_IN_AGONY);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413f, 207.188f, -102.469f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857f, 218.645f, -102.905f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102f, 227.211f, -102.752f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372f, 235.149f, -102.826f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524f, 251.113f, -102.558f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208f, 266.466f, -102.977f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167f, 274.759f, -102.962f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 5)
{
++eventProgress;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
naralex->AI()->Talk(EMOTE_HORRENDOUS_VISION);
me->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872f, 262.905f, -103.503f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
Talk(SAY_MUTANUS_THE_DEVOURER);
instance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS);
}
else
if (eventProgress == 6 && instance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE)
{
++eventProgress;
eventTimer = 3000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
{
if (me->HasAura(SPELL_NARALEXS_AWAKENING))
me->RemoveAura(SPELL_NARALEXS_AWAKENING);
naralex->SetStandState(UNIT_STAND_STATE_STAND);
naralex->AI()->Talk(SAY_I_AM_AWAKE);
}
Talk(SAY_NARALEX_AWAKES);
}
else
if (eventProgress == 7)
{
++eventProgress;
eventTimer = 6000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
naralex->AI()->Talk(SAY_THANK_YOU);
}
else
if (eventProgress == 8)
{
++eventProgress;
eventTimer = 8000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
{
naralex->AI()->Talk(SAY_FAREWELL);
naralex->AddAura(SPELL_FLIGHT_FORM, naralex);
}
SetRun();
me->SetStandState(UNIT_STAND_STATE_STAND);
me->AddAura(SPELL_FLIGHT_FORM, me);
}
else
if (eventProgress == 9)
{
++eventProgress;
eventTimer = 1500;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ());
}
else
if (eventProgress == 10)
{
++eventProgress;
eventTimer = 2500;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
{
naralex->GetMotionMaster()->MovePoint(0, 117.095512f, 247.107971f, -96.167870f);
naralex->GetMotionMaster()->MovePoint(1, 90.388809f, 276.135406f, -83.389801f);
}
me->GetMotionMaster()->MovePoint(26, 117.095512f, 247.107971f, -96.167870f);
me->GetMotionMaster()->MovePoint(27, 144.375443f, 281.045837f, -82.477135f);
}
else
if (eventProgress == 11)
{
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
naralex->SetVisible(false);
me->SetVisible(false);
instance->SetData(TYPE_NARALEX_PART3, DONE);
}
break;
}
}
} else eventTimer -= diff;
}
示例4: UpdateEscortAI
void UpdateEscortAI(const uint32 uiDiff) override
{
if (uiPhaseTimer <= uiDiff)
{
switch (uiStep)
{
case 1:
if (instance->GetBossState(DATA_TRIBUNAL_OF_AGES) != NOT_STARTED)
return;
bIsBattle = false;
Talk(SAY_ESCORT_START);
SetRun(true);
JumpToNextStep(0);
break;
case 3:
SetEscortPaused(false);
JumpToNextStep(0);
break;
case 5:
if (Creature* temp = (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ABEDNEUM))))
temp->AI()->Talk(SAY_EVENT_INTRO_3_ABED);
JumpToNextStep(8500);
break;
case 6:
Talk(SAY_EVENT_A_1);
JumpToNextStep(6500);
break;
case 7:
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_KADDRAK)))
temp->AI()->Talk(SAY_EVENT_A_2_KADD);
JumpToNextStep(12500);
break;
case 8:
Talk(SAY_EVENT_A_3);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_KADDRAK), true);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiControllerGUID))
ENSURE_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bKaddrakActivated = true;
JumpToNextStep(5000);
break;
case 9:
me->SetReactState(REACT_PASSIVE);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 10:
Talk(SAY_EVENT_B_1);
JumpToNextStep(6000);
break;
case 11:
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MARNAK)))
temp->AI()->Talk(SAY_EVENT_B_2_MARN);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 12:
Talk(SAY_EVENT_B_3);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_MARNAK), true);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiControllerGUID))
ENSURE_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bMarnakActivated = true;
JumpToNextStep(10000);
break;
case 13:
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 14:
SpawnDwarf(2);
JumpToNextStep(20000);
break;
case 15:
Talk(SAY_EVENT_C_1);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 16:
SpawnDwarf(2);
JumpToNextStep(20000);
break;
case 17:
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ABEDNEUM)))
temp->AI()->Talk(SAY_EVENT_C_2_ABED);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 18:
Talk(SAY_EVENT_C_3);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_ABEDNEUM), true);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiControllerGUID))
ENSURE_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bAbedneumActivated = true;
JumpToNextStep(5000);
break;
case 19:
SpawnDwarf(2);
JumpToNextStep(10000);
break;
case 20:
SpawnDwarf(1);
JumpToNextStep(15000);
break;
case 21:
//.........这里部分代码省略.........
示例5: SetRun
void SmartAI::Reset()
{
if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
SetRun(mRun);
GetScript()->OnReset();
}
示例6: WaypointReached
void WaypointReached(uint32 i)
{
if (!m_pInstance)
return;
switch(i)
{
case 8:
SetRun(false);
m_creature->SummonCreature(ENTRY_ARMORER, 2181.87f, 112.46f, 89.45f, 0.26f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, m_creature);
SetEquipmentSlots(false, EQUIP_ID_WEAPON, EQUIP_ID_SHIELD, EQUIP_NO_CHANGE);
break;
case 10:
m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
m_creature->SummonCreature(MOB_ENTRY_RIFLE, 2200.28f, 137.37f, 87.93f, 5.07f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN, 2197.44f, 131.83f, 87.93f, 0.78f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2203.62f, 135.40f, 87.93f, 3.70f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2200.75f, 130.13f, 87.93f, 1.48f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 21:
m_creature->SummonCreature(MOB_ENTRY_RIFLE, 2135.80f, 154.01f, 67.45f, 4.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN, 2144.36f, 151.87f, 67.74f, 4.46f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2142.12f, 154.41f, 67.12f, 4.56f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2138.08f, 155.38f, 67.24f, 4.60f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 25:
m_creature->SummonCreature(MOB_ENTRY_RIFLE, 2102.98f, 192.17f, 65.24f, 6.02f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN, 2108.48f, 198.75f, 65.18f, 5.15f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2106.11f, 197.29f, 65.18f, 5.63f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN, 2104.18f, 194.82f, 65.18f, 5.75f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, m_creature);
m_creature->SummonCreature(ENTRY_SCARLOC, 2036.48f, 271.22f, 63.43f, 5.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
break;
case 30:
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
m_creature->SummonCreature(MOB_ENTRY_WATCHMAN, 2124.26f, 522.16f, 56.87f, 3.99f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WATCHMAN, 2121.69f, 525.37f, 57.11f, 4.01f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_SENTRY, 2124.65f, 524.55f, 56.63f, 3.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 59:
m_creature->SummonCreature(SKARLOC_MOUNT, 2488.64f, 625.77f, 58.26f, 4.71f, TEMPSUMMON_TIMED_DESPAWN,10000);
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
SetRun(false);
break;
case 68:
m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR, 2500.22f, 692.60f, 55.50f, 2.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT, 2500.13f, 696.55f, 55.51f, 3.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN, 2500.55f, 693.64f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN, 2500.94f, 695.81f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
SetRun();
break;
case 81:
SetRun(false);
break;
case 83:
m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR, 2627.33f, 646.82f, 56.03f, 4.28f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT, 2624.14f, 648.03f, 56.03f, 4.50f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN, 2625.32f, 649.60f, 56.03f, 4.38f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN, 2627.22f, 649.00f, 56.03f, 4.34f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, m_creature);
SetRun();
break;
case 91:
SetRun(false);
//.........这里部分代码省略.........
示例7: WaypointReached
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
{
case 0:
DoScriptText(SAY_DR_START, me);
SetRun();
break;
case 1:
DoScriptText(SAY_DR_1, me);
break;
case 5:
DoScriptText(SAY_DR_2, me);
break;
case 7:
SetEscortPaused(true);
Destroy = true;
SummonImp = true;
break;
case 8:
me->SummonGameObject(GO_SMOKE, 3049.354f, 2726.431f, 113.922f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 215);
DoScriptText(SAY_DR_4, me);
break;
case 12:
SetEscortPaused(true);
Destroy = true;
SummonTrooper = true;
break;
case 13:
me->SummonGameObject(GO_SMOKE, 3020.842f, 2697.501f, 113.368f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 140);
DoScriptText(SAY_DR_5, me);
break;
case 17:
SetEscortPaused(true);
Destroy = true;
SummonDestroyer = true;
break;
case 18:
DoScriptText(SAY_DR_6, me);
if (Creature* pTrigger = me->FindNearestCreature(NPC_EXPLODE_TRIGGER, 20.0f))
{
pTrigger->CastSpell(pTrigger, SPELL_BOOM , false);
}
me->SummonGameObject(GO_SMOKE, 3008.503f, 2729.432f, 114.350f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 60);
me->SummonGameObject(GO_FIRE, 3026.163f, 2723.538f, 113.681f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 60);
me->SummonGameObject(GO_BIG_FIRE, 3021.556f, 2718.887f, 115.055f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 60);
break;
case 19:
DoScriptText(SAY_DR_7, me);
break;
case 22:
SetRun(false);
break;
case 26:
if (Player* pPlayer = GetPlayerForEscort())
{
DoScriptText(SAY_DR_COMPLETE, me, pPlayer);
pPlayer->GroupEventHappens(QUEST_WARP_GATE, me);
}
break;
}
}
示例8: UpdateEscortAI
//.........这里部分代码省略.........
case 3:
DoScriptText(SAY_OGR_TELL_FIRE, m_creature);
if (Creature* pReethe = GetCreature(NPC_REETHE))
DoScriptText(SAY_OGR_RET_NOCLOSER, pReethe);
break;
case 4:
if (Creature* pReethe = GetCreature(NPC_REETHE))
DoScriptText(SAY_OGR_RET_NOFIRE, pReethe);
break;
case 5:
if (Creature* pReethe = GetCreature(NPC_REETHE))
DoScriptText(SAY_OGR_RET_HEAR, pReethe);
m_creature->SummonCreature(NPC_CALDWELL, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 300000);
m_creature->SummonCreature(NPC_HALLAN, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 300000);
m_creature->SummonCreature(NPC_SKIRMISHER, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 300000);
m_creature->SummonCreature(NPC_SKIRMISHER, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 300000);
m_uiPhase = PHASE_GUESTS;
break;
}
break;
}
case PHASE_GUESTS:
{
switch (m_uiPhaseCounter)
{
case 6:
if (Creature* pCaldwell = GetCreature(NPC_CALDWELL))
DoScriptText(SAY_OGR_CAL_FOUND, pCaldwell);
break;
case 7:
if (Creature* pCaldwell = GetCreature(NPC_CALDWELL))
DoScriptText(SAY_OGR_CAL_MERCY, pCaldwell);
break;
case 8:
if (Creature* pHallan = GetCreature(NPC_HALLAN))
{
DoScriptText(SAY_OGR_HALL_GLAD, pHallan);
if (Creature* pReethe = GetCreature(NPC_REETHE))
pHallan->CastSpell(pReethe, SPELL_FAKE_SHOT, TRIGGERED_NONE);
}
break;
case 9:
if (Creature* pReethe = GetCreature(NPC_REETHE))
{
DoScriptText(EMOTE_OGR_RET_ARROW, pReethe);
DoScriptText(SAY_OGR_RET_ARROW, pReethe);
}
break;
case 10:
if (Creature* pCaldwell = GetCreature(NPC_CALDWELL))
DoScriptText(SAY_OGR_CAL_CLEANUP, pCaldwell);
DoScriptText(SAY_OGR_NODIE, m_creature);
break;
case 11:
DoStartAttackMe();
m_uiPhase = PHASE_FIGHT;
break;
}
break;
}
case PHASE_COMPLETE:
{
switch (m_uiPhaseCounter)
{
case 12:
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_QUESTIONING, m_creature);
DoScriptText(SAY_OGR_SURVIVE, m_creature);
break;
case 13:
if (Creature* pReethe = GetCreature(NPC_REETHE))
DoScriptText(SAY_OGR_RET_LUCKY, pReethe);
break;
case 14:
DoScriptText(SAY_OGR_THANKS, m_creature);
SetRun();
SetEscortPaused(false);
break;
}
break;
}
}
if (m_uiPhase != PHASE_FIGHT)
++m_uiPhaseCounter;
}
else
m_uiGlobalTimer -= uiDiff;
}
return;
}
DoMeleeAttackIfReady();
}
示例9: SetRun
void SmartAI::ResumePath()
{
SetRun(mRun);
if (mLastWP)
me->GetMotionMaster()->MovePoint(mLastWP->id, mLastWP->x, mLastWP->y, mLastWP->z);
}
示例10: WaypointReached
void WaypointReached(uint32 uiPointId) override
{
switch (uiPointId)
{
case 7:
DoScriptText(SAY_HARRISON_CHAMBER_1, m_creature);
break;
case 8:
DoScriptText(SAY_HARRISON_CHAMBER_2, m_creature);
break;
case 10:
m_creature->HandleEmote(EMOTE_ONESHOT_USESTANDING);
break;
case 11:
DoScriptText(SAY_HARRISON_CHAMBER_RELEASE, m_creature);
if (GameObject* pCage = GetClosestGameObjectWithEntry(m_creature, GO_ADARRAH_CAGE, 5.0f))
pCage->Use(m_creature);
break;
case 12:
if (Creature* pAdarrah = GetClosestCreatureWithEntry(m_creature, NPC_ADARRAH, 5.0f))
{
DoScriptText(SAY_ADARRAH_THANK_YOU, pAdarrah);
m_adarrahGuid = pAdarrah->GetObjectGuid();
}
break;
case 13:
if (Creature* pAdarrah = m_creature->GetMap()->GetCreature(m_adarrahGuid))
{
pAdarrah->SetWalk(false);
pAdarrah->GetMotionMaster()->MovePoint(0, 4878.416f, -4793.893f, 32.549f);
pAdarrah->ForcedDespawn(5000);
}
break;
case 15:
m_creature->SetFacingTo(0.2f);
m_creature->HandleEmote(EMOTE_ONESHOT_KNEEL);
break;
case 16:
{
// set mummies in fire
std::list<Creature*> lBunniesInRange;
GetCreatureListWithEntryInGrid(lBunniesInRange, m_creature, NPC_MUMMY_EFFECT_BUNNY, 50.0f);
for (std::list<Creature*>::const_iterator itr = lBunniesInRange.begin(); itr != lBunniesInRange.end(); ++itr)
(*itr)->CastSpell((*itr), SPELL_BUNNY_IMMOLATION, TRIGGERED_OLD_TRIGGERED);
m_creature->SetFacingTo(5.0f);
DoCastSpellIfCan(m_creature, SPELL_GONG_EFFECT);
break;
}
case 17:
DoScriptText(SAY_HARRISON_CHAMBER_3, m_creature);
break;
case 18:
DoScriptText(SAY_HARRISON_CHAMBER_4, m_creature);
break;
case 21:
// close door
if (GameObject* pDoor = GetClosestGameObjectWithEntry(m_creature, GO_FIRE_DOOR, 10.0f))
pDoor->Use(m_creature);
break;
case 22:
DoScriptText(SAY_HARRISON_CHAMBER_5, m_creature);
SetRun();
// summon snake
m_creature->SummonCreature(NPC_TECAHUNA, 4907.077f, -4819.035f, 32.55f, 2.32f, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
break;
case 23:
DoScriptText(SAY_HARRISON_CHAMBER_6, m_creature);
break;
case 24:
DoScriptText(SAY_HARRISON_CHAMBER_7, m_creature);
break;
case 25:
// attack snake
if (Creature* pTecahuna = m_creature->GetMap()->GetCreature(m_tecahunaGuid))
AttackStart(pTecahuna);
SetEscortPaused(true);
m_uiActivateMummiesTimer = 10000;
break;
case 53:
DoScriptText(SAY_HARRISON_ESCORT_COMPELTE, m_creature);
if (Player* pPlayer = GetPlayerForEscort())
{
pPlayer->GroupEventHappens(QUEST_ID_DUN_DA_DUN_TAH, m_creature);
m_creature->SetFacingToObject(pPlayer);
}
break;
}
}
示例11: UpdateAI
//.........这里部分代码省略.........
}
else
if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE)
{
++eventProgress;
eventTimer = 3000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
{
if (me->HasAura(SPELL_NARALEXS_AWAKENING, 0))
me->RemoveAurasDueToSpell(SPELL_NARALEXS_AWAKENING);
naralex->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_I_AM_AWAKE, naralex);
}
DoScriptText(SAY_NARALEX_AWAKES, me);
}
else
if (eventProgress == 7)
{
++eventProgress;
eventTimer = 6000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(SAY_THANK_YOU, naralex);
}
else
if (eventProgress == 8)
{
++eventProgress;
eventTimer = 8000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
{
DoScriptText(SAY_FAREWELL, naralex);
naralex->AddAura(SPELL_FLIGHT_FORM, naralex);
}
SetRun();
me->SetStandState(UNIT_STAND_STATE_STAND);
me->AddAura(SPELL_FLIGHT_FORM, me);
}
else
if (eventProgress == 9)
{
++eventProgress;
eventTimer = 1500;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ());
}
else
if (eventProgress == 10)
{
++eventProgress;
eventTimer = 2500;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
{
naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870);
naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801);
}
me->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870);
me->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135);
}
else
if (eventProgress == 11)
{
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
naralex->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
pInstance->SetData(TYPE_NARALEX_PART3, DONE);
}
示例12: WaypointReached
void WaypointReached(uint32 uiPoint)
{
if (!m_pInstance)
return;
switch(uiPoint)
{
case 8:
SetRun(false);
m_creature->SummonCreature(NPC_ARMORER, 2181.87f, 112.46f, 89.45f, 0.26f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, m_creature);
SetEquipmentSlots(false, EQUIP_ID_WEAPON, EQUIP_ID_SHIELD, EQUIP_NO_CHANGE);
break;
case 10:
m_creature->SetDisplayId(MODEL_THRALL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
m_creature->SummonCreature(NPC_RIFLE, 2200.28f, 137.37f, 87.93f, 5.07f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_WARDEN, 2197.44f, 131.83f, 87.93f, 0.78f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2203.62f, 135.40f, 87.93f, 3.70f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2200.75f, 130.13f, 87.93f, 1.48f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 21:
m_creature->SummonCreature(NPC_RIFLE, 2135.80f, 154.01f, 67.45f, 4.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_WARDEN, 2144.36f, 151.87f, 67.74f, 4.46f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2142.12f, 154.41f, 67.12f, 4.56f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2138.08f, 155.38f, 67.24f, 4.60f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 25:
m_creature->SummonCreature(NPC_RIFLE, 2102.98f, 192.17f, 65.24f, 6.02f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_WARDEN, 2108.48f, 198.75f, 65.18f, 5.15f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2106.11f, 197.29f, 65.18f, 5.63f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_VETERAN, 2104.18f, 194.82f, 65.18f, 5.75f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, m_creature);
m_creature->SummonCreature(NPC_SCARLOC, 2036.48f, 271.22f, 63.43f, 5.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 30:
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
DoMount();
SetRun();
break;
case 37:
// possibly regular patrollers? If so, remove this and let database handle them
m_creature->SummonCreature(NPC_WATCHMAN, 2124.26f, 522.16f, 56.87f, 3.99f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_WATCHMAN, 2121.69f, 525.37f, 57.11f, 4.01f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_SENTRY, 2124.65f, 524.55f, 56.63f, 3.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 59:
m_creature->SummonCreature(NPC_SKARLOC_MOUNT, 2488.64f, 625.77f, 58.26f, 4.71f, TEMPSUMMON_TIMED_DESPAWN, 10000);
DoUnmount();
m_bHadMount = false;
SetRun(false);
break;
case 60:
m_creature->HandleEmote(EMOTE_ONESHOT_EXCLAMATION);
// make horsie run off
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
SetRun(false);
break;
case 68:
m_creature->SummonCreature(NPC_BARN_PROTECTOR, 2500.22f, 692.60f, 55.50f, 2.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_BARN_LOOKOUT, 2500.13f, 696.55f, 55.51f, 3.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_BARN_GUARDSMAN, 2500.55f, 693.64f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
m_creature->SummonCreature(NPC_BARN_GUARDSMAN, 2500.94f, 695.81f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 71:
SetRun();
break;
case 81:
SetRun(false);
break;
case 83:
m_creature->SummonCreature(NPC_CHURCH_PROTECTOR, 2627.33f, 646.82f, 56.03f, 4.28f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
m_creature->SummonCreature(NPC_CHURCH_LOOKOUT, 2624.14f, 648.03f, 56.03f, 4.50f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
m_creature->SummonCreature(NPC_CHURCH_GUARDSMAN, 2625.32f, 649.60f, 56.03f, 4.38f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
m_creature->SummonCreature(NPC_CHURCH_GUARDSMAN, 2627.22f, 649.00f, 56.03f, 4.34f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000);
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, m_creature);
SetRun();
break;
case 91:
SetRun(false);
//.........这里部分代码省略.........
示例13: WaypointReached
void WaypointReached(uint32 uiPointId) override
{
switch (uiPointId)
{
// spawn citizens - ground floor
case 1:
if (Creature* pCitizen = m_creature->SummonCreature(NPC_TOWNHALL_CITIZEN, 2401.265f, 1202.789f, 134.103f, 1.466f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000))
m_firstCitizenGuid = pCitizen->GetObjectGuid();
if (Creature* pCitizen = m_creature->SummonCreature(NPC_TOWNHALL_RESIDENT, 2402.654f, 1205.786f, 134.122f, 2.89f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000))
m_secondCitizenGuid = pCitizen->GetObjectGuid();
if (Creature* pCitizen = m_creature->SummonCreature(NPC_TOWNHALL_CITIZEN, 2398.715f, 1207.334f, 134.122f, 5.27f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000))
m_thirdCitizenGuid = pCitizen->GetObjectGuid();
break;
case 3:
StartNextDialogueText(NPC_TOWNHALL_CITIZEN);
break;
case 4:
DoScriptText(SAY_ARTHAS_BEFORE_PLAGUE, m_creature);
SetRun(false);
break;
case 5:
SetEscortPaused(true);
StartNextDialogueText(SPELL_CRUSADER_STRIKE);
break;
case 6:
m_creature->SetFacingTo(0.30f);
break;
case 7:
DoScriptText(SAY_ARTHAS_MORE_SCOURGE, m_creature);
SetRun();
break;
// spawn second wave - on the first floor
case 13:
DoScriptText(SAY_ARTHAS_MORE_SORCERY, m_creature);
SetRun(false);
m_creature->SummonCreature(NPC_TIME_RIFT, 2433.357f, 1192.168f, 148.159f, 3.00f, TEMPSPAWN_TIMED_DESPAWN, 5000);
break;
case 14:
m_creature->SummonCreature(NPC_INFINITE_AGENT, 2433.041f, 1191.158f, 148.128f, 4.99f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_HUNTER, 2433.176f, 1193.429f, 148.114f, 1.21f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_AGENT, 2433.396f, 1192.912f, 148.123f, 0.04f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_ADVERSARY, 2433.626f, 1192.069f, 148.117f, 5.48f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
SetEscortPaused(true);
break;
case 15:
m_creature->SetFacingTo(2.94f);
break;
case 16:
DoScriptText(SAY_ARTHAS_MOVE_ON, m_creature);
SetRun();
break;
// spawn third wave - ambush
case 21:
DoScriptText(SAY_ARTHAS_WATCH_BACK, m_creature);
m_creature->SummonCreature(NPC_INFINITE_HUNTER, 2404.375f, 1179.395f, 148.138f, 5.14f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_AGENT, 2403.785f, 1179.004f, 148.138f, 4.58f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_HUNTER, 2413.933f, 1136.93f, 148.111f, 2.40f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_ADVERSARY, 2414.964f, 1136.857f, 148.088f, 0.90f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_TIME_RIFT, 2404.311f, 1178.306f, 148.158f, 1.60f, TEMPSPAWN_TIMED_DESPAWN, 5000);
m_creature->SummonCreature(NPC_TIME_RIFT, 2414.041f, 1136.068f, 148.159f, 2.23f, TEMPSPAWN_TIMED_DESPAWN, 5000);
SetEscortPaused(true);
break;
case 22:
m_creature->SetFacingTo(1.85f);
break;
case 23:
DoScriptText(SAY_ARTHAS_NOT_EASY, m_creature);
break;
// spawn forth wave - main hall
case 26:
DoScriptText(SAY_ARTHAS_PERSISTENT, m_creature);
m_creature->SummonCreature(NPC_INFINITE_HUNTER, 2431.417f, 1105.167f, 148.075f, 1.26f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_AGENT, 2438.808f, 1113.769f, 148.075f, 3.11f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_ADVERSARY, 2440.917f, 1116.085f, 148.080f, 2.18f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_INFINITE_ADVERSARY, 2428.905f, 1102.929f, 148.125f, 1.97f, TEMPSPAWN_TIMED_OOC_OR_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(NPC_TIME_RIFT, 2429.296f, 1102.007f, 148.159f, 6.21f, TEMPSPAWN_TIMED_DESPAWN, 5000);
m_creature->SummonCreature(NPC_TIME_RIFT, 2440.057f, 1114.226f, 148.159f, 6.10f, TEMPSPAWN_TIMED_DESPAWN, 5000);
SetEscortPaused(true);
break;
case 27:
m_creature->SetFacingTo(5.98f);
break;
case 28:
StartNextDialogueText(SAY_ARTHAS_WHAT_ELSE);
SetEscortPaused(true);
break;
// open passage
case 32:
StartNextDialogueText(SAY_ARTHAS_TAKE_A_MOMENT);
break;
case 33:
DoScriptText(SAY_ARTHAS_PASSAGE, m_creature);
break;
//.........这里部分代码省略.........
示例14: UpdateEscortAI
//.........这里部分代码省略.........
++m_uiSubeventPhase;
break;
case 7:
// Awaken Naralex after mutanus is defeated
if (Creature* pNaralex = m_pInstance->GetSingleCreatureFromStorage(NPC_NARALEX))
{
pNaralex->SetStandState(UNIT_STAND_STATE_SIT);
DoScriptText(SAY_NARALEX_AWAKE, pNaralex);
}
m_creature->InterruptNonMeleeSpells(false, SPELL_AWAKENING);
m_creature->RemoveAurasDueToSpell(SPELL_AWAKENING);
m_pInstance->SetData(TYPE_DISCIPLE, DONE);
++m_uiSubeventPhase;
m_uiEventTimer = 2000;
break;
case 8:
DoScriptText(SAY_AWAKE, m_creature);
m_uiEventTimer = 5000;
++m_uiSubeventPhase;
break;
case 9:
if (Creature* pNaralex = m_pInstance->GetSingleCreatureFromStorage(NPC_NARALEX))
{
DoScriptText(SAY_NARALEX_THANKYOU, pNaralex);
pNaralex->SetStandState(UNIT_STAND_STATE_STAND);
}
m_uiEventTimer = 10000;
++m_uiSubeventPhase;
break;
case 10:
// Shapeshift into a bird
if (Creature* pNaralex = m_pInstance->GetSingleCreatureFromStorage(NPC_NARALEX))
{
DoScriptText(SAY_FAREWELL, pNaralex);
pNaralex->CastSpell(pNaralex, SPELL_SHAPESHIFT, false);
}
DoCastSpellIfCan(m_creature, SPELL_SHAPESHIFT);
m_uiEventTimer = 10000;
++m_uiSubeventPhase;
break;
case 11:
SetEscortPaused(false);
m_creature->SetLevitate(true);
SetRun();
// Send them flying somewhere outside of the room
if (Creature* pNaralex = m_pInstance->GetSingleCreatureFromStorage(NPC_NARALEX))
{
// ToDo: Make Naralex fly
// sort of a hack, compare to boss_onyxia
pNaralex->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2);
// Set to flying
pNaralex->SetLevitate(true);
pNaralex->SetWalk(false);
// Set following
pNaralex->GetMotionMaster()->MoveFollow(m_creature, 5.0f, 0);
// Despawn after some time
pNaralex->ForcedDespawn(30000);
}
m_uiEventTimer = 0;
break;
}
break;
}
}
else
m_uiEventTimer -= uiDiff;
}
if (m_uiPotionTimer < uiDiff)
{
// if health lower than 80%, cast heal
if (m_creature->GetHealthPercent() < 80.0f)
{
if (DoCastSpellIfCan(m_creature, SPELL_POTION) == CAST_OK)
m_uiPotionTimer = 45000;
}
else
m_uiPotionTimer = 5000;
}
else
m_uiPotionTimer -= uiDiff;
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiSleepTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1))
{
if (DoCastSpellIfCan(pTarget, SPELL_SLEEP) == CAST_OK)
m_uiSleepTimer = 30000;
}
}
else
m_uiSleepTimer -= uiDiff;
DoMeleeAttackIfReady();
}
示例15: StopPath
void SmartAI::UpdatePath(const uint32 diff)
{
if (!HasEscortState(SMART_ESCORT_ESCORTING))
return;
if (mEscortInvokerCheckTimer < diff)
{
if (!IsEscortInvokerInRange())
{
StopPath(mDespawnTime, mEscortQuestID, true);
}
mEscortInvokerCheckTimer = 1000;
} else mEscortInvokerCheckTimer -= diff;
// handle pause
if (HasEscortState(SMART_ESCORT_PAUSED))
{
if (mWPPauseTimer < diff)
{
if (!me->isInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mLastWPIDReached == SMART_ESCORT_LAST_OOC_POINT || mForcedPaused))
{
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, NULL, mLastWP->id, GetScript()->GetPathId());
RemoveEscortState(SMART_ESCORT_PAUSED);
if (mForcedPaused)// if paused between 2 wps resend movement
{
ResumePath();
mWPReached = false;
mForcedPaused = false;
}
if (mLastWPIDReached == SMART_ESCORT_LAST_OOC_POINT)
mWPReached = true;
}
mWPPauseTimer = 0;
} else {
mWPPauseTimer -= diff;
}
}
if (HasEscortState(SMART_ESCORT_RETURNING))
{
if (mWPReached)//reached OOC WP
{
RemoveEscortState(SMART_ESCORT_RETURNING);
if (!HasEscortState(SMART_ESCORT_PAUSED))
ResumePath();
mWPReached = false;
}
}
if (me->isInCombat() || HasEscortState(SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING))
return;
// handle next wp
if (mWPReached)//reached WP
{
mWPReached = false;
if (mCurrentWPID == GetWPCount())
{
EndPath();
} else {
WayPoint* wp = GetNextWayPoint();
if (wp)
{
SetRun(mRun);
me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
}
}
}
}