当前位置: 首页>>代码示例>>C++>>正文


C++ Creature::DisappearAndDie方法代码示例

本文整理汇总了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);
                }
            }
开发者ID:B3NNY,项目名称:TrinityCore,代码行数:26,代码来源:boss_vazruden_the_herald.cpp

示例2: EnterEvadeMode

	void EnterEvadeMode()
	{
		if(Trigger1)
		{
			Trigger1->DisappearAndDie();
		}
		if(Trigger2)
		{
			Trigger2->DisappearAndDie();
		}
		ScriptedAI::EnterEvadeMode();
	}
开发者ID:VenT,项目名称:wow,代码行数:12,代码来源:boss_zarithian.cpp

示例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);
	}
开发者ID:VenT,项目名称:wow,代码行数:15,代码来源:boss_zarithian.cpp

示例4: EnterEvadeMode

    void EnterEvadeMode()
    {
        m_creature->DisappearAndDie();

        if (pMarzon && pMarzon->isAlive())
            pMarzon->DisappearAndDie();
    }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例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;
    }
开发者ID:FirstCore,项目名称:GaryMoveOut_4.3.4,代码行数:35,代码来源:go_scripts.cpp

示例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);
        }
    } 
}
开发者ID:Adeer,项目名称:Patchs,代码行数:34,代码来源:TowerDefenseInstance.cpp

示例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();
        }
开发者ID:8Infinity8,项目名称:InfinityCore,代码行数:34,代码来源:boss_palehoof.cpp

示例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;
}
开发者ID:Asandru,项目名称:Script-Land,代码行数:33,代码来源:go_scripts.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例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();
 }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例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);
 }
开发者ID:profPlum,项目名称:TrinityCore,代码行数:9,代码来源:violet_hold.cpp

示例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;
            }
        }
开发者ID:,项目名称:,代码行数:56,代码来源:

示例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();
         }
     }
 }
开发者ID:814077430,项目名称:ArkCORE,代码行数:10,代码来源:boss_moroes.cpp

示例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);
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例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);
     }
 }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:21,代码来源:boss_vazruden_the_herald.cpp


注:本文中的Creature::DisappearAndDie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。