本文整理汇总了C++中Creature::CombatStop方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::CombatStop方法的具体用法?C++ Creature::CombatStop怎么用?C++ Creature::CombatStop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature::CombatStop方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JustDied
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
for(int i=0; i<5; ++i)
{
if (GuardiansOfIcecrown[i])
{
Creature* pGuardian = (Creature*)Unit::GetUnit(*m_creature, GuardiansOfIcecrown[i]);
if (!pGuardian || !pGuardian->isAlive())
continue;
pGuardian->CombatStop();
float Walk_Pos_X = 0.0f;
float Walk_Pos_Y = 0.0f;
float Walk_Pos_Z = 0.0f;
switch(urand(0, 5))
{
case 0:
Walk_Pos_X = ADDX_LEFT_FAR;
Walk_Pos_Y = ADDY_LEFT_FAR;
Walk_Pos_Z = ADDZ_LEFT_FAR;
break;
case 1:
Walk_Pos_X = ADDX_LEFT_MIDDLE;
Walk_Pos_Y = ADDY_LEFT_MIDDLE;
Walk_Pos_Z = ADDZ_LEFT_MIDDLE;
break;
case 2:
Walk_Pos_X = ADDX_LEFT_NEAR;
Walk_Pos_Y = ADDY_LEFT_NEAR;
Walk_Pos_Z = ADDZ_LEFT_NEAR;
break;
case 3:
Walk_Pos_X = ADDX_RIGHT_FAR;
Walk_Pos_Y = ADDY_RIGHT_FAR;
Walk_Pos_Z = ADDZ_RIGHT_FAR;
break;
case 4:
Walk_Pos_X = ADDX_RIGHT_MIDDLE;
Walk_Pos_Y = ADDY_RIGHT_MIDDLE;
Walk_Pos_Z = ADDZ_RIGHT_MIDDLE;
break;
case 5:
Walk_Pos_X = ADDX_RIGHT_NEAR;
Walk_Pos_Y = ADDY_RIGHT_NEAR;
Walk_Pos_Z = ADDZ_RIGHT_NEAR;
break;
}
pGuardian->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z);
}
}
if (m_pInstance)
m_pInstance->SetData(TYPE_KELTHUZAD, DONE);
}
示例2: EffectDummy
bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override
{
if (pCaster->GetTypeId() != TYPEID_PLAYER)
return true;
Creature* pCreatureTarget = pTarget->ToCreature();
if (pCaster->HasAura(SPELL_DRAKE_HATCHLING_SUBDUED) || pCreatureTarget->HasAura(SPELL_SUBDUED))
return true;
Player* pPlayer = (Player*)pCaster;
if (!pPlayer)
return true;
// check the quest
if (pPlayer->GetQuestStatus(QUEST_DRAKE_HUNT) != QUEST_STATUS_INCOMPLETE && pPlayer->GetQuestStatus(QUEST_DRAKE_HUNT_DAILY) != QUEST_STATUS_INCOMPLETE)
return true;
// evade and set friendly and start following @TODO move to creature script
pCreatureTarget->SetFactionTemporary(FACTION_FRIENDLY, TEMPFACTION_RESTORE_REACH_HOME | TEMPFACTION_RESTORE_RESPAWN);
pCreatureTarget->DeleteThreatList();
pCreatureTarget->CombatStop(true);
pCreatureTarget->AI()->SendAIEvent(AI_EVENT_START_EVENT, pCaster, pCreatureTarget);
// cast visual spells
pCreatureTarget->CastSpell(pCreatureTarget, SPELL_DRAKE_VOMIT_PERIODIC, true);
pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUBDUED, true);
pCreatureTarget->CastSpell(pCaster, SPELL_DRAKE_HATCHLING_SUBDUED, true);
return true;
}
示例3: JustDied
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
for(int i=0; i<5; i++)
{
if (GuardiansOfIcecrown[i])
{
Creature* pUnit = (Creature*)Unit::GetUnit(*m_creature, GuardiansOfIcecrown[i]);
if (!pUnit || !pUnit->isAlive())
continue;
pUnit->CombatStop();
float Walk_Pos_X = 0.0f;
float Walk_Pos_Y = 0.0f;
float Walk_Pos_Z = 0.0f;
switch(rand()%6)
{
case 0:
Walk_Pos_X = ADDX_LEFT_FAR;
Walk_Pos_Y = ADDY_LEFT_FAR;
Walk_Pos_Z = ADDZ_LEFT_FAR;
break;
case 1:
Walk_Pos_X = ADDX_LEFT_MIDDLE;
Walk_Pos_Y = ADDY_LEFT_MIDDLE;
Walk_Pos_Z = ADDZ_LEFT_MIDDLE;
break;
case 2:
Walk_Pos_X = ADDX_LEFT_NEAR;
Walk_Pos_Y = ADDY_LEFT_NEAR;
Walk_Pos_Z = ADDZ_LEFT_NEAR;
break;
case 3:
Walk_Pos_X = ADDX_RIGHT_FAR;
Walk_Pos_Y = ADDY_RIGHT_FAR;
Walk_Pos_Z = ADDZ_RIGHT_FAR;
break;
case 4:
Walk_Pos_X = ADDX_RIGHT_MIDDLE;
Walk_Pos_Y = ADDY_RIGHT_MIDDLE;
Walk_Pos_Z = ADDZ_RIGHT_MIDDLE;
break;
case 5:
Walk_Pos_X = ADDX_RIGHT_NEAR;
Walk_Pos_Y = ADDY_RIGHT_NEAR;
Walk_Pos_Z = ADDZ_RIGHT_NEAR;
break;
}
pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z);
}
}
}
示例4: HandleNpcBotDeleteCommand
static bool HandleNpcBotDeleteCommand(ChatHandler* handler, const char* /*args*/)
{
Player* chr = handler->GetSession()->GetPlayer();
Unit* ubot = chr->GetSelectedUnit();
if (!ubot)
{
handler->SendSysMessage(".npcbot delete");
handler->SendSysMessage("Deletes selected npcbot spawn from world and DB");
handler->SetSentErrorMessage(true);
return false;
}
Creature* bot = ubot->ToCreature();
if (!bot || !bot->IsNPCBot())
{
handler->SendSysMessage("No npcbot selected");
handler->SetSentErrorMessage(true);
return false;
}
if (Player* botowner = bot->GetBotOwner()->ToPlayer())
botowner->GetBotMgr()->RemoveBot(bot->GetGUID(), BOT_REMOVE_DISMISS);
uint32 id = bot->GetEntry();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_NPCBOT_EQUIP);
//"SELECT equipMhEx, equipOhEx, equipRhEx, equipHead, equipShoulders, equipChest, equipWaist, equipLegs, equipFeet, equipWrist, equipHands, equipBack, equipBody, equipFinger1, equipFinger2, equipTrinket1, equipTrinket2, equipNeck
//FROM characters_npcbot WHERE entry = ?", CONNECTION_SYNCH
stmt->setUInt32(0, id);
PreparedQueryResult res = CharacterDatabase.Query(stmt);
ASSERT(res);
Field* fields = res->Fetch();
for (uint8 i = 0; i != BOT_INVENTORY_SIZE; ++i)
{
if (fields[i].GetUInt32())
{
handler->PSendSysMessage("%s still has eqipment assigned. Please remove equips before deleting bot!", bot->GetName().c_str());
handler->SetSentErrorMessage(true);
return false;
}
}
bot->CombatStop();
bot->DeleteFromDB();
bot->AddObjectToRemoveList();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NPCBOT);
//"DELETE FROM characters_npcbot WHERE entry = ?", CONNECTION_ASYNC
stmt->setUInt32(0, id);
CharacterDatabase.Execute(stmt);
handler->SendSysMessage("Npcbot successfully deleted.");
return true;
}
示例5: HandleNpcDeleteCommand
static bool HandleNpcDeleteCommand(ChatHandler* handler, const char* args) {
Creature* unit = NULL;
if (*args) {
// number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*) args, "Hcreature");
if (!cId)
return false;
uint32 lowguid = atoi(cId);
if (!lowguid)
return false;
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
unit =
handler->GetSession()->GetPlayer()->GetMap()->GetCreature(
MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
} else
unit = handler->getSelectedCreature();
if (!unit || unit->isPet() || unit->isTotem()) {
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
QueryResult result;
result = WorldDatabase.PQuery("SELECT * FROM creature_spawn WHERE guid='%u' AND account='%u'", unit->GetGUIDLow(), handler->GetSession()->GetAccountId());
if (!result)
{
handler->PSendSysMessage(LANG_CREATURE_ACCOUNT);
handler->SetSentErrorMessage(true);
return false;
}
// Delete the creature
unit->CombatStop();
unit->DeleteFromDB();
unit->AddObjectToRemoveList();
handler->SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
sLog->outSQLDev("DELETE FROM creature WHERE guid = %u;", unit->GetGUIDLow());
return true;
}
示例6: GameEventUnspawn
void GameEvent::GameEventUnspawn(int16 event_id)
{
if(max_event_id + event_id >= mGameEventCreatureGuids.size())
{
sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %u (size: %u)",max_event_id + event_id,mGameEventCreatureGuids.size());
return;
}
for (GuidList::iterator itr = mGameEventCreatureGuids[max_event_id + event_id].begin();itr != mGameEventCreatureGuids[event_id + max_event_id].end();++itr)
{
// Remove the creature from grid
CreatureData const* data = objmgr.GetCreatureData(*itr);
objmgr.RemoveCreatureFromGrid(*itr, data);
Creature* pCreature;
pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_GUID(*itr, HIGHGUID_UNIT), (Creature*)NULL);
//sLog.outDebug("Un-spawning creature %u",*itr);
if (pCreature)
{
pCreature->CombatStop(true);
ObjectAccessor::Instance().AddObjectToRemoveList(pCreature);
}
}
if(max_event_id + event_id >= mGameEventGameobjectGuids.size())
{
sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %u (size: %u)",max_event_id + event_id,mGameEventGameobjectGuids.size());
return;
}
for (GuidList::iterator itr = mGameEventGameobjectGuids[max_event_id + event_id].begin();itr != mGameEventGameobjectGuids[max_event_id + event_id].end();++itr)
{
// Remove the gameobject from grid
GameObjectData const* data = objmgr.GetGOData(*itr);
objmgr.RemoveGameobjectFromGrid(*itr, data);
GameObject* pGameobject;
pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_GUID(*itr, HIGHGUID_GAMEOBJECT), (GameObject*)NULL);
//sLog.outDebug("Un-spawning gameobject %u",*itr);
if (pGameobject)
{
ObjectAccessor::Instance().AddObjectToRemoveList(pGameobject);
}
}
}
示例7: HandleDeleteCommand
bool ChatHandler::HandleDeleteCommand(const char* args)
{
Creature *unit = getSelectedCreature();
if(!unit)
{
SendSysMessage(LANG_SELECT_CREATURE);
return true;
}
unit->CombatStop();
unit->DeleteFromDB();
ObjectAccessor::Instance().AddObjectToRemoveList(unit);
SendSysMessage("Creature Removed");
return true;
}
示例8: HandleNpcDeleteCommand
static bool HandleNpcDeleteCommand(ChatHandler* handler, const char* args)
{
Creature* unit = NULL;
if (*args)
{
// number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*)args,"Hcreature");
if (!cId)
return false;
uint32 lowguid = atoi(cId);
if (!lowguid)
return false;
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
}
else
unit = handler->getSelectedCreature();
if (!unit || unit->isPet() || unit->isTotem())
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
// Delete the creature
unit->CombatStop();
unit->DeleteFromDB();
unit->AddObjectToRemoveList();
handler->SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
return true;
}
示例9: HandleWpShowCommand
//.........这里部分代码省略.........
{
handler->SendSysMessage("|cffff33ffPath no found.|r");
handler->SetSentErrorMessage(true);
return false;
}
handler->PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid);
// Delete all visuals for this NPC
QueryResult result2 = WorldDatabase.PQuery("SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid);
if (result2)
{
bool hasError = false;
do
{
Field* fields = result2->Fetch();
uint32 wpguid = fields[0].GetUInt32();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpguid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
if (!creature)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpguid);
hasError = true;
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
stmt->setUInt32(0, wpguid);
WorldDatabase.Execute(stmt);
}
else
{
creature->CombatStop();
creature->DeleteFromDB();
creature->AddObjectToRemoveList();
}
}
while (result2->NextRow());
if (hasError)
{
handler->PSendSysMessage(LANG_WAYPOINT_TOOFAR1);
handler->PSendSysMessage(LANG_WAYPOINT_TOOFAR2);
handler->PSendSysMessage(LANG_WAYPOINT_TOOFAR3);
}
}
do
{
Field* fields = result->Fetch();
uint32 point = fields[0].GetUInt32();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
float z = fields[3].GetFloat();
uint32 id = VISUAL_WAYPOINT;
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
float o = chr->GetOrientation();
Creature* wpCreature = new Creature;
if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
示例10: HandleWpModifyCommand
static bool HandleWpModifyCommand(ChatHandler* handler, const char* args)
{
if (!*args)
return false;
// first arg: add del text emote spell waittime move
char* show_str = strtok((char*)args, " ");
if (!show_str)
{
return false;
}
std::string show = show_str;
// Check
// Remember: "show" must also be the name of a column!
if ((show != "delay") && (show != "action") && (show != "action_chance")
&& (show != "move_flag") && (show != "del") && (show != "move") && (show != "wpadd")
)
{
return false;
}
// Next arg is: <PATHID> <WPNUM> <ARGUMENT>
char* arg_str = NULL;
// Did user provide a GUID
// or did the user select a creature?
// -> variable lowguid is filled with the GUID of the NPC
uint32 pathid = 0;
uint32 point = 0;
uint32 wpGuid = 0;
Creature* target = handler->getSelectedCreature();
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
{
handler->SendSysMessage("|cffff33ffERROR: You must select a waypoint.|r");
return false;
}
// The visual waypoint
wpGuid = target->GetGUIDLow();
// User did select a visual waypoint?
// Check the creature
QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow());
// Select waypoint number from database
// Since we compare float values, we have to deal with
// some difficulties.
// Here we search for all waypoints that only differ in one from 1 thousand
// (0.001) - There is no other way to compare C++ floats with mySQL floats
// See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
const char* maxDIFF = "0.01";
result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s) and (abs(position_y - %f) <= %s) and (abs(position_z - %f) <= %s)",
target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF);
if (!result)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid);
return true;
}
}
do
{
Field* fields = result->Fetch();
pathid = fields[0].GetUInt32();
point = fields[1].GetUInt32();
}
while (result->NextRow());
// We have the waypoint number and the GUID of the "master npc"
// Text is enclosed in "<>", all other arguments not
arg_str = strtok((char*)NULL, " ");
// Check for argument
if (show != "del" && show != "move" && arg_str == NULL)
{
handler->PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str);
return false;
}
if (show == "del" && target)
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
// wpCreature
Creature* wpCreature = NULL;
if (wpGuid != 0)
{
wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
wpCreature->AddObjectToRemoveList();
}
//.........这里部分代码省略.........
示例11: DoIntro
//.........这里部分代码省略.........
++IntroPhase;
break;
case 9:
me->GetMotionMaster()->MoveIdle();
me->AttackStop();
pMadrigosa->setHover(false);
pMadrigosa->SetLevitate(false);
pMadrigosa->SetWalk(true);
pMadrigosa->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
pMadrigosa->SendHeartBeat();
IntroPhaseTimer = 1000;
++IntroPhase;
break;
case 10:
pMadrigosa->GetMotionMaster()->MoveIdle();
IntroPhaseTimer = 2500;
++IntroPhase;
break;
case 11:
pMadrigosa->GetMap()->CreatureRelocation((Creature*)pMadrigosa, MADRI_FLY_X, MADRI_FLY_Y, MADRI_FLY_Z, me->GetOrientation());
pMadrigosa->GetMotionMaster()->MoveIdle();
IntroPhaseTimer = 2000;
++IntroPhase;
break;
case 12:
me->GetMotionMaster()->MoveIdle();
pMadrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE, false);
DoScriptText(YELL_MADR_TRAP, pMadrigosa);
IntroPhaseTimer = 1000;
++IntroPhase;
break;
case 13:
me->GetPosition(x, y, z);
me->GetMotionMaster()->MovePoint(1, x-6, y-15, z+10);
me->SetInFront(pMadrigosa);
IntroPhaseTimer = 8000;
++IntroPhase;
break;
case 14:
me->RemoveAurasDueToSpell(44883);
pMadrigosa->InterruptNonMeleeSpells(false);
pMadrigosa->GetMotionMaster()->MoveIdle();
DoScriptText(YELL_INTRO_CHARGE, me);
me->SetInFront(pMadrigosa);
me->GetPosition(x, y, z);
me->GetMotionMaster()->MoveFall();
IntroPhaseTimer = 3500;
++IntroPhase;
break;
case 15:
for(uint8 i = 0; i < 8; ++i)
me->SetSpeed(UnitMoveType(i), 10.0);
me->GetMotionMaster()->MoveCharge(MADRI_FLY_X-5, MADRI_FLY_Y-15, MADRI_FLY_Z);
AddSpellToCast((Unit*)NULL, SPELL_INTRO_CHARGE);
IntroPhaseTimer = 1000;
++IntroPhase;
break;
case 16:
DoScriptText(YELL_MADR_DEATH, pMadrigosa);
pMadrigosa->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
pMadrigosa->SetFlag(UNIT_DYNAMIC_FLAGS, (UNIT_DYNFLAG_DEAD | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED));
pMadrigosa->CombatStop();
pMadrigosa->DeleteThreatList();
pMadrigosa->setFaction(35);
me->CombatStop();
me->RemoveFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_PVP_ATTACKABLE));
IntroPhaseTimer = 4000;
++IntroPhase;
break;
case 17:
if(pInstance)
me->SetFacingToObject(GameObject::GetGameObject(*me, pInstance->GetData64(DATA_BRUTALLUS_TRIGGER)));
for(uint8 i = 0; i < 8; ++i)
me->SetSpeed(UnitMoveType(i), 2.0);
IntroPhaseTimer = 6000;
++IntroPhase;
break;
case 18:
DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me);
IntroPhaseTimer = 8000;
++IntroPhase;
break;
case 19:
DoScriptText(YELL_INTRO_TAUNT, me);
AddSpellToCast(me, SPELL_INTRO_BREAK_ICE);
if(pInstance)
pInstance->SetData(DATA_BRUTALLUS_INTRO_EVENT, DONE);
else
return;
if(Unit *pTrigger = me->GetUnit(pInstance->GetData64(DATA_BRUTALLUS_TRIGGER)))
pTrigger->CastSpell((Unit*)NULL, SPELL_INTRO_BREAK_ICE_KNOCKBACK, false);
IntroPhaseTimer = 2000;
++IntroPhase;
break;
case 20:
EnterEvadeMode();
++IntroPhase;
break;
}
}
示例12: GordokTributeEvent
/*
Tribute Event
*/
void instance_dire_maul::GordokTributeEvent(uint32 diff)
{
if(1<2)return;
Creature* pChoRush = instance->GetCreature(m_uiChoRushGUID);
Creature* pMizzle = instance->GetCreature(m_uiMizzleGUID);
Creature* pTrigger = instance->GetCreature(m_uiTributeTriggerGUID);
Map* pMap;
pMap = pChoRush->GetMap();
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if ((GetData(TYPE_KING_GORDOK) == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isAlive() && !pChoRushHome)
{
pChoRush->SetFlag(UNIT_NPC_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PASSIVE);
pChoRush->setFaction(35);
pChoRush->DeleteThreatList();
pChoRush->CombatStop();
pChoRush->SetCanAttackPlayer(false);
pChoRush->AI()->EnterEvadeMode();
pChoRushHome = true;
GossipStepGordok = 1;
Text_Timer_Event = 1000;
}
else if ((TYPE_KING_GORDOK == DONE) && pMap->GetCreature(m_uiChoRushGUID)->isDead())
{
for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
Player* pPlayer = itr->getSource();
if (pPlayer->IsWithinDistInMap(pTrigger, 30.0f))
pTrigger->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
}
}
if(pChoRushHome)
{
if (Text_Timer_Event<diff)
{
switch (GossipStepGordok)
{
case 1:
DoScriptText(ChoRush_SAY_1, pChoRush);
pChoRush->HandleEmote(EMOTE_STATE_TALK);
pChoRush->SummonCreature(NPC_MIZZLE_THE_CRAFTY, 817.666f, 478.371f, 37.3182f, 3.07057f, TEMPSUMMON_TIMED_DESPAWN, 9000000);
Text_Timer_Event = 5000;
break;
case 2:
pChoRush->HandleEmote(EMOTE_STATE_SIT);
DoScriptText(Mizzle_SAY_1, pMizzle);
pMizzle->HandleEmote(EMOTE_STATE_TALK);
Text_Timer_Event = 5000;
break;
case 3:
DoScriptText(Mizzle_SAY_2, pMizzle);
pMizzle->HandleEmote(EMOTE_STATE_TALK);
Text_Timer_Event = 8000;
break;
case 4:
for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
Player* pPlayer = itr->getSource();
if (pPlayer->IsWithinDistInMap(pMizzle, 50.0f))
pMizzle->CastSpell(pPlayer, SPELL_KING_OF_GORDOK, false);
}
if (pMap->GetCreature(m_uiMoldarGUID)->isAlive() && pMap->GetCreature(m_uiMizzleGUID)->isAlive() && pMap->GetCreature(m_uiFengusGUID)->isAlive())
{
pMizzle->SummonObject(pMap, GO_GORDOK_TRIBUTE, 809.899719f, 482.306366f, 37.318359f, 0.212846f);
pMizzle->HandleEmote(EMOTE_ONESHOT_APPLAUD);
}
pChoRushHome = false;
break;
}
}
else Text_Timer_Event -= diff;
}
}