本文整理汇总了C++中Creature::DisappearAndDie方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::DisappearAndDie方法的具体用法?C++ Creature::DisappearAndDie怎么用?C++ Creature::DisappearAndDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature::DisappearAndDie方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnsummonAdds
void UnsummonAdds()
{
if (summoned)
{
Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
if (!Nazan)
Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000);
if (Nazan)
{
Nazan->DisappearAndDie();
NazanGUID = 0;
}
Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
if (!Vazruden)
Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000);
if (Vazruden)
{
Vazruden->DisappearAndDie();
VazrudenGUID = 0;
}
summoned = false;
me->ClearUnitState(UNIT_STAT_ROOT);
me->SetVisible(true);
}
}
示例2: EnterEvadeMode
void EnterEvadeMode()
{
if(Trigger1)
{
Trigger1->DisappearAndDie();
}
if(Trigger2)
{
Trigger2->DisappearAndDie();
}
ScriptedAI::EnterEvadeMode();
}
示例3: JustDied
void JustDied(Unit*)
{
if(!pInstance)
return;
if(Trigger1)
{
Trigger1->DisappearAndDie();
}
if(Trigger2)
{
Trigger2->DisappearAndDie();
}
DoScriptText(SAY_DEATH, me);
pInstance->SetData(DATA_ZARITHRIAN_EVENT, DONE);
}
示例4: EnterEvadeMode
void EnterEvadeMode()
{
m_creature->DisappearAndDie();
if (pMarzon && pMarzon->isAlive())
pMarzon->DisappearAndDie();
}
示例5: OnGossipHello
bool OnGossipHello(Player* player, GameObject* go)
{
Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
if (!pPrisoner)
{
pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
if (!pPrisoner)
{
pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
if (!pPrisoner)
pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
}
}
if (!pPrisoner || !pPrisoner->isAlive())
return false;
pPrisoner->DisappearAndDie();
player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
switch (pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
break;
}
return true;
}
示例6: GetPlayer
void TowerDefenseInstanceScript::TowerDefenseMapInstanceScript::SellGuard(uint64 guid)
{
if(!guid)
return;
Player* player = GetPlayer();
if(!player)
return;
Creature* creature = player->GetMap()->GetCreature(guid);
if(!creature)
return;
uint32 entry = GUID_ENPART(guid);
if (Guards.find(guid) != Guards.end())
{
GuardInfo* guard = Guards[guid];
if(QueryResult queryResult = CharacterDatabase.PQuery("SELECT creatureName, creatureEntry, creatureCost FROM custom_td_base_stats WHERE creatureEntry = '%u'", entry))
{
creature->CastSpell(creature, GetSpellIdByUniqueId(5),true);
uint32 SellPrice = guard->GetSellPrice(guard->GetLevel());
switch(GetEventMode())
{
case TD_EVENT_MODE_HARD:
SellPrice = SellPrice - (SellPrice/4);
break;
case TD_EVENT_MODE_EXTREME:
SellPrice = SellPrice - (SellPrice/2);
break;
}
UpdateResources(TD_EVENT_INC,SellPrice);
SendMessageToPlayer(TD_SYSTEM_MSG_SOLD_TOWER_FOR, creature->GetName(),SellPrice);
creature->DisappearAndDie();
Guards.erase(guid);
}
}
}
示例7: UpdateAI
void UpdateAI(const uint32 diff)
{
if (currentPhase != PHASE_GORTOK_PALEHOOF)
return;
//Return since we have no target
if (!UpdateVictim())
return;
Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_MOB_ORB) : 0);
if (temp && temp->isAlive())
temp->DisappearAndDie();
if (uiArcingSmashTimer <= diff)
{
DoCast(me, SPELL_ARCING_SMASH);
uiArcingSmashTimer = urand(13000, 17000);
} else uiArcingSmashTimer -= diff;
if (uiImpaleTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_IMPALE);
uiImpaleTimer = urand(8000, 12000);
} else uiImpaleTimer -= diff;
if (uiWhiteringRoarTimer <= diff)
{
DoCast(me, SPELL_WITHERING_ROAR);
uiWhiteringRoarTimer = urand(8000, 12000);
} else uiWhiteringRoarTimer -= diff;
DoMeleeAttackIfReady();
}
示例8: GOHello_go_jotunheim_cage
bool GOHello_go_jotunheim_cage(Player* pPlayer, GameObject* pGO)
{
Creature* pPrisoner;
pPrisoner = NULL;
if ((pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true)))
{
if (pPrisoner && pPrisoner->isAlive())
{
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
switch(pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
break;
}
}
}
return true;
}
示例9: GOHello_go_dragonflayer_cage
bool GOHello_go_dragonflayer_cage(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
return true;
Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
if (!pPrisoner)
{
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
if (!pPrisoner)
{
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
if (!pPrisoner)
pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
}
}
if (!pPrisoner || !pPrisoner->isAlive())
return true;
Quest const* qInfo = objmgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
if (qInfo)
{
//TODO: prisoner should help player for a short period of time
pPlayer->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0],0);
pPrisoner->DisappearAndDie();
}
return true;
}
示例10: JustDied
void JustDied(Unit* /*killer*/)
{
if (instance)
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_MOB_ORB) : 0);
if (temp && temp->isAlive())
temp->DisappearAndDie();
}
示例11: FinishPointReached
void FinishPointReached()
{
me->CastSpell(me, SABOTEUR_SHIELD_DISRUPTION, false);
me->DisappearAndDie();
Creature* pSaboPort = Unit::GetCreature((*me), instance->GetData64(DATA_SABOTEUR_PORTAL));
if (pSaboPort)
pSaboPort->DisappearAndDie();
instance->SetData(DATA_START_BOSS_ENCOUNTER, 1);
}
示例12: NextStep
uint32 NextStep(uint32 Step)
{
Creature* Spark = Unit::GetCreature(*me, SparkGUID);
switch(Step)
{
case 0:
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
return 9000; // NPCs are walking up to fire
case 1:
DespawnNagaFlag(true);
DoScriptText(EMOTE_SPARK, Spark);
return 1000;
case 2:
DoScriptText(GEEZLE_SAY_1, me, Spark);
if (Spark)
{
Spark->SetInFront(me);
me->SetInFront(Spark);
}
return 5000;
case 3:
DoScriptText(SPARK_SAY_2, Spark);
return 7000;
case 4:
DoScriptText(SPARK_SAY_3, Spark);
return 8000;
case 5:
DoScriptText(GEEZLE_SAY_4, me, Spark);
return 8000;
case 6:
DoScriptText(SPARK_SAY_5, Spark);
return 9000;
case 7:
DoScriptText(SPARK_SAY_6, Spark);
return 8000;
case 8:
DoScriptText(GEEZLE_SAY_7, me, Spark);
return 2000;
case 9:
me->GetMotionMaster()->MoveTargetedHome();
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]);
CompleteQuest();
return 9000;
case 10:
if (Spark)
Spark->DisappearAndDie();
DespawnNagaFlag(false);
me->DisappearAndDie();
default:
return 99999999;
}
}
示例13: DeSpawnAdds
void DeSpawnAdds() {
for (uint8 i = 0; i < 4; ++i) {
Creature* Temp = NULL;
if (AddGUID[i]) {
Temp = Creature::GetCreature((*me), AddGUID[i]);
if (Temp && Temp->isAlive())
Temp->DisappearAndDie();
}
}
}
示例14: JustReachedHome
void JustReachedHome()
{
// Data for visual
if (timeRift)
timeRift->DisappearAndDie();
timeRift = me->SummonCreature(NPC_TIME_RIFT, me->GetPositionX() - 10.0f, me->GetPositionY(), me->GetPositionZ());
// Visual Channeling
if(timeRift)
me->CastSpell(timeRift, SPELL_CHANNEL_VISUAL, true);
}
示例15: UnsummonAdds
void UnsummonAdds()
{
if (summoned)
{
Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000)))
{
Nazan->DisappearAndDie();
NazanGUID = 0;
}
if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000)))
{
Vazruden->DisappearAndDie();
VazrudenGUID = 0;
}
summoned = false;
m_creature->clearUnitState(UNIT_STAT_ROOT);
m_creature->SetVisibility(VISIBILITY_ON);
}
}