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


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

本文整理汇总了C++中Creature::DespawnOrUnsummon方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::DespawnOrUnsummon方法的具体用法?C++ Creature::DespawnOrUnsummon怎么用?C++ Creature::DespawnOrUnsummon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Creature的用法示例。


在下文中一共展示了Creature::DespawnOrUnsummon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateAI

        void UpdateAI(const uint32 diff)
        {
            if (Phase != INTRO)
                return;

            if (uiIntroTimer <= diff)
            {
                Creature* pArthas = Unit::GetCreature(*me, uiArthasGUID);
                if (!pArthas)
                    return;

                switch (uiIntroPhase)
                {
                    case 0:
                        DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me);
                        ++uiIntroPhase;
                        uiIntroTimer = 3500;
                        break;
                    case 1:
                        DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas);
                        ++uiIntroPhase;
                        uiIntroTimer = 3500;
                        break;
                    case 2:
                        DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me);
                        ++uiIntroPhase;
                        uiIntroTimer = 3500;
                        break;
                    case 3:
                        DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas);
                        ++uiIntroPhase;
                        uiIntroTimer = 3500;
                        break;
                    case 4:
                        DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me);
                        DoCast(me, SPELL_SVALA_TRANSFORMING1);
                        ++uiIntroPhase;
                        uiIntroTimer = 2800;
                        break;
                    case 5:
                        DoCast(me, SPELL_SVALA_TRANSFORMING2);
                        ++uiIntroPhase;
                        uiIntroTimer = 200;
                        break;
                    case 6:
                        if (me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILLISECONDS))
                        {
                            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                            me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
                            pArthas->DespawnOrUnsummon();
                            uiArthasGUID = 0;
                            Phase = FINISHED;
                        }
                        else
                            Reset();
                        break;
                }
            } else uiIntroTimer -= diff;
        }
开发者ID:AdrElecTro,项目名称:TrinityCore,代码行数:59,代码来源:boss_svala.cpp

示例2: Reset

            void Reset()
            {
                instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ABILITATE_BALANCE_BAR);
                events.Reset();
                if (leftfoot)
                    leftfoot->DespawnOrUnsummon();
                if (rightfoot)
                    rightfoot->DespawnOrUnsummon();
                summons.DespawnAll();
                me->LowerPlayerDamageReq(me->GetMaxHealth());
                killtimer =0;

                if (instance)
                {
                    instance->SetData(DATA_RHYOLITH_EVENT, NOT_STARTED);
                }
            }
开发者ID:AtVirus,项目名称:Forgotten-Lands-Source,代码行数:17,代码来源:boss_rhyolith.cpp

示例3: JustDied

		void JustDied(Unit * /*victim*/)
		{
			DespawnCreatures(NPC_ANGERED_EARTH);
			me->MonsterYell("Boss Cho'gall not gonna be happy 'bout dis!", LANG_UNIVERSAL, NULL);

			if(chainsOfWoe != NULL)
				chainsOfWoe->DespawnOrUnsummon();

			chainsOfWoe = NULL;
		}
开发者ID:814077430,项目名称:ArkCORE,代码行数:10,代码来源:boss_romogg_bonecrusher.cpp

示例4: HandleDummy

        void HandleDummy(SpellEffIndex /*effIndex*/)
        {
            Creature* lothalor = GetHitCreature();
            if (!lothalor || lothalor->GetEntry() != NPC_LOTHALOR)
                return;

            lothalor->AI()->Talk(SAY_LOTHALOR);
            lothalor->RemoveAura(SPELL_CONFUSED);
            lothalor->DespawnOrUnsummon(4000);
        }
开发者ID:heros,项目名称:LasCore,代码行数:10,代码来源:dragonblight.cpp

示例5: DespawnAll

void SummonList::DespawnAll()
{
    while (!storage_.empty())
    {
        Creature* summon = Unit::GetCreature(*me, storage_.front());
        storage_.pop_front();
        if (summon)
            summon->DespawnOrUnsummon();
    }
}
开发者ID:Ayik0,项目名称:DeathCore_5.4.8,代码行数:10,代码来源:ScriptedCreature.cpp

示例6: NextStep

        uint32 NextStep(uint8 Step)
        {
            Creature* Spark = ObjectAccessor::GetCreature(*me, SparkGUID);
            if (!Spark)
            {
                me->DespawnOrUnsummon(1);
                return 5000;
            }

            switch (Step)
            {
                case 0:
                    Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
                    me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
                    return 9000;
                case 1:
                    DespawnNagaFlag(true);
                    Spark->AI()->Talk(EMOTE_SPARK);
                    return 1000;
                case 2:
                    Talk(GEEZLE_SAY_1, Spark);
                    Spark->SetInFront(me);
                    me->SetInFront(Spark);
                    return 5000;
                case 3:
                    Spark->AI()->Talk(SPARK_SAY_2);
                    return 7000;
                case 4:
                    Spark->AI()->Talk(SPARK_SAY_3);
                    return 8000;
                case 5:
                    Talk(GEEZLE_SAY_4, Spark);
                    return 8000;
                case 6:
                    Spark->AI()->Talk(SPARK_SAY_5);
                    return 9000;
                case 7:
                    Spark->AI()->Talk(SPARK_SAY_6);
                    return 8000;
                case 8:
                    Talk(GEEZLE_SAY_7, Spark);
                    return 2000;
                case 9:
                    me->GetMotionMaster()->MoveTargetedHome();
                    Spark->GetMotionMaster()->MovePoint(0, SparkPos);
                    CompleteQuest();
                    return 9000;
                case 10:
                    Spark->DespawnOrUnsummon(1);
                    DespawnNagaFlag(false);
                    me->DespawnOrUnsummon(1);
                    return 5000;
                default: return 99999999;
            }
        }
开发者ID:Matt-One,项目名称:azerothcore-wotlk,代码行数:55,代码来源:zone_azuremyst_isle.cpp

示例7: MoveInLineOfSight

        void MoveInLineOfSight(Unit* who)
        {
            if (!who || !drakeGUID)
                return;

            Creature* drake = Unit::GetCreature(*me, drakeGUID);
            if (!drake)
            {
                drakeGUID = 0;
                return;
            }

            if (!me->IsOnVehicle(drake) && !me->HasAura(SPELL_ICE_PRISON))
            {
                if (who->IsVehicle() && me->IsWithinDist(who, 25.0f, true) && who->ToCreature() && who->ToCreature()->GetEntry() == 29709)
                {
                    uint8 seat = who->GetVehicleKit()->GetNextEmptySeat(0, true);
                    if (seat <= 0)
                        return;

                    me->EnterVehicle(who, seat);
                    me->SendMovementFlagUpdate();
                    hasEmptySeats = false;
                }
            }

            if (who->ToCreature() && me->IsOnVehicle(drake))
            {
                if (who->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(who, 15.0f, false))
                {
                    Unit* rider = drake->GetVehicleKit()->GetPassenger(0);
                    if (!rider)
                        return;

                    rider->CastSpell(rider, SPELL_KILL_CREDIT_PRISONER, true);

                    me->ExitVehicle();
                    me->CastSpell(me, SPELL_SUMMON_LIBERATED, true);
                    me->DespawnOrUnsummon(500);

                    // drake is empty now, deliver credit for drake and despawn him
                    if (drake->GetVehicleKit()->HasEmptySeat(1) &&
                        drake->GetVehicleKit()->HasEmptySeat(2) &&
                        drake->GetVehicleKit()->HasEmptySeat(3))
                    {
                        // not working rider->CastSpell(rider, SPELL_KILL_CREDIT_DRAKE, true);
                        if (rider->ToPlayer())
                            rider->ToPlayer()->KilledMonsterCredit(29709, 0);

                        drake->DespawnOrUnsummon(0);
                    }
                }
            }
        }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:54,代码来源:storm_peaks.cpp

示例8: DespawnDwarf

 void DespawnDwarf()
 {
     if (lDwarfGUIDList.empty())
         return;
     for (GuidList::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
     {
         Creature* temp = ObjectAccessor::GetCreature(*me, instance ? (*itr) : ObjectGuid::Empty);
         if (temp && temp->IsAlive())
             temp->DespawnOrUnsummon();
     }
     lDwarfGUIDList.clear();
 }
开发者ID:mynew,项目名称:Core,代码行数:12,代码来源:halls_of_stone.cpp

示例9: DespawnDwarf

 void DespawnDwarf()
 {
     if (lDwarfGUIDList.empty())
         return;
     for (std::list<uint64>::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
     {
         Creature* temp = Unit::GetCreature(*me, instance ? (*itr) : 0);
         if (temp && temp->isAlive())
             temp->DespawnOrUnsummon();
     }
     lDwarfGUIDList.clear();
 }
开发者ID:Asido,项目名称:TrinityCore,代码行数:12,代码来源:halls_of_stone.cpp

示例10: Reset

		void Reset()
		{
			me->GetMotionMaster()->MoveTargetedHome();
			castSkullCracker = false;

			if(chainsOfWoe != NULL)
				chainsOfWoe->DespawnOrUnsummon();

			chainsOfWoe = NULL;

			DespawnCreatures(NPC_ANGERED_EARTH);
		}
开发者ID:814077430,项目名称:ArkCORE,代码行数:12,代码来源:boss_romogg_bonecrusher.cpp

示例11: HandleScript

            void HandleScript(SpellEffIndex /*eff*/)
            {
                Creature* caster = GetCaster()->ToCreature();
                if (!caster)
                    return;

                caster->CastSpell(caster, SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE);

                for (uint8 i = 0; i < 10; ++i)
                    caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON);

                caster->DespawnOrUnsummon(4000);
            }
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:13,代码来源:zone_howling_fjord.cpp

示例12: DespawnAll

void SummonList::DespawnAll()
{
    while (!empty())
    {
        Creature* summon = Unit::GetCreature(*me, *begin());
        if (!summon)
            erase(begin());
        else
        {
            erase(begin());
            summon->DespawnOrUnsummon();
        }
    }
}
开发者ID:Reann,项目名称:TrinityCore,代码行数:14,代码来源:ScriptedCreature.cpp

示例13: OnGossipHello

 bool OnGossipHello(Player* player, GameObject* go) override
 {
     go->UseDoorOrButton();
     if (player->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE)
     {
         Creature* gymerDummy = go->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f);
         if (gymerDummy)
         {
             player->KilledMonsterCredit(gymerDummy->GetEntry(), gymerDummy->GetGUID());
             gymerDummy->CastSpell(gymerDummy, SPELL_GYMER_LOCK_EXPLOSION, true);
             gymerDummy->DespawnOrUnsummon(4 * IN_MILLISECONDS);
         }
     }
     return true;
 }
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:15,代码来源:zone_zuldrak.cpp

示例14: DespawnAll

void SummonList::DespawnAll(uint32 msTimeToDespawn) {
    while (!empty()) {
        Creature* summon = Unit::GetCreature(*me, *begin());
        if (!summon)
            erase(begin());
        else {
            erase(begin());
            if (TempSummon* summ = summon->ToTempSummon()) {
                summon->DestroyForNearbyPlayers();
                summ->UnSummon(msTimeToDespawn);
            } else
                summon->DespawnOrUnsummon(msTimeToDespawn);
        }
    }
}
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:15,代码来源:ScriptedCreature.cpp

示例15: SummonChannelers

            void SummonChannelers()
            {
                for (uint8 i = 0; i < 5; ++i)
                {
                    Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
					if (channeler && channeler->isDead())
					{
						channeler->DespawnOrUnsummon(1);
						channeler = NULL;
					}
                    if (!channeler)
                        channeler = me->SummonCreature(NPC_CHANNELER, ShadowmoonChannelers[i][0], ShadowmoonChannelers[i][1], ShadowmoonChannelers[i][2], ShadowmoonChannelers[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);

					channelers[i] = channeler ? channeler->GetGUID() : 0;
                }
            }
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:16,代码来源:boss_kelidan_the_breaker.cpp


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