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


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

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


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

示例1: OnDummyApply

    bool OnDummyApply(const Aura* pAura, bool bApply) override
    {
        if (pAura->GetId() != SPELL_TAG_MURLOC || pAura->GetEffIndex() != EFFECT_INDEX_0)
        {
            return true;
        }

        Creature* pCreature = (Creature*)pAura->GetTarget();

        if (bApply)
        {
            if (pCreature->GetEntry() == NPC_BLACKSILT_MURLOC)
            {
                if (Unit* pCaster = pAura->GetCaster())
                {
                    pCaster->CastSpell(pCreature, SPELL_TAG_MURLOC_PROC, true);
                }
            }
        }
        else
        {
            if (pCreature->GetEntry() == NPC_TAGGED_MURLOC)
            {
                pCreature->ForcedDespawn();
            }
        }

        return true;
    }
开发者ID:Chuck5ta,项目名称:ScriptDev3,代码行数:29,代码来源:spell_scripts.cpp

示例2: EffectAuraDummy_npc_beryl_sorcerer

bool EffectAuraDummy_npc_beryl_sorcerer(const Aura* pAura, bool bApply)
{
    if (pAura->GetId() == SPELL_ARCANE_CHAINS)
    {
        if (pAura->GetEffIndex() != EFFECT_INDEX_0 || !bApply)
            return false;

        Creature* pCreature = (Creature*)pAura->GetTarget();
        Unit* pCaster = pAura->GetCaster();
        if (!pCreature || !pCaster || pCaster->GetTypeId() != TYPEID_PLAYER || pCreature->GetEntry() != NPC_BERYL_SORCERER)
            return false;

        // only for wounded creatures
        if (pCreature->GetHealthPercent() > 30.0f)
            return false;

        // spawn the captured sorcerer, apply dummy aura on the summoned and despawn
        pCaster->CastSpell(pCreature, SPELL_SUMMON_CHAINS_CHARACTER, true);
        pCaster->CastSpell(pCaster, SPELL_ARCANE_CHAINS_CHANNEL, true);
        pCreature->ForcedDespawn();
        return true;
    }

    return false;
}
开发者ID:Celtus,项目名称:custom-scriptdev2,代码行数:25,代码来源:borean_tundra.cpp

示例3: HandleDismissControlledVehicle

void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
{
    DEBUG_LOG("WORLD: Received CMSG_DISMISS_CONTROLLED_VEHICLE");
    recv_data.hexlike();

    MovementInfo movementInfo;
    recv_data >> movementInfo;

    if (!GetPlayer()->GetVehicle())
        return;

    bool dismiss = true;

    Creature* vehicle = GetPlayer()->GetMap()->GetAnyTypeCreature(movementInfo.GetGuid());

    if (!vehicle || !vehicle->IsVehicle() || !vehicle->GetVehicleKit() || !vehicle->GetEntry())
        return;

    if (vehicle->GetVehicleKit()->GetEntry()->m_flags & (VEHICLE_FLAG_NOT_DISMISS | VEHICLE_FLAG_ACCESSORY))
        dismiss = false;

    // Client freezes...
    if (vehicle->GetEntry() == 34812 || vehicle->GetEntry() == 34819 || vehicle->GetEntry() == 34822 ||
        vehicle->GetEntry() == 34823 || vehicle->GetEntry() == 34824)
        dismiss = false;

    GetPlayer()->m_movementInfo = movementInfo;
    GetPlayer()->ExitVehicle();

    if (dismiss)
        vehicle->ForcedDespawn();
}
开发者ID:jobba,项目名称:mangos3,代码行数:32,代码来源:VehicleHandler.cpp

示例4: OnCreatureDeath

void instance_pit_of_saron::OnCreatureDeath(Creature* pCreature)
{
    switch (pCreature->GetEntry())
    {
        case NPC_YMIRJAR_DEATHBRINGER:
        case NPC_YMIRJAR_WRATHBRINGER:
        case NPC_YMIRJAR_FLAMEBEARER:
        case NPC_FALLEN_WARRIOR:
        case NPC_COLDWRAITH:
            // Check for tunnel event end - these mobs are not summoned
            if (pCreature->IsTemporarySummon())
            {
                m_lAmbushNpcsGuidList.remove(pCreature->GetObjectGuid());

                // If empty start tunnel event
                if (m_lAmbushNpcsGuidList.empty())
                {
                    Creature* pTyrannus = GetSingleCreatureFromStorage(NPC_TYRANNUS_INTRO);
                    if (!pTyrannus)
                        return;

                    DoScriptText(SAY_GAUNTLET, pTyrannus);
                    pTyrannus->SetWalk(false);
                    pTyrannus->GetMotionMaster()->MovePoint(0, afTyrannusMovePos[0][0], afTyrannusMovePos[0][1], afTyrannusMovePos[0][2]);
                    pTyrannus->ForcedDespawn(20000);

                    m_uiIciclesTimer = urand(3000, 5000);
                    SetSpecialAchievementCriteria(TYPE_ACHIEV_DONT_LOOK_UP, true);
                }
            }
            break;
    }
}
开发者ID:dvdvideo1234,项目名称:mangos-wotlk,代码行数:33,代码来源:instance_pit_of_saron.cpp

示例5: HandleDismissControlledVehicle

void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
{
    DEBUG_LOG("WORLD: Received CMSG_DISMISS_CONTROLLED_VEHICLE");
    recv_data.hexlike();

    ObjectGuid guid;
    MovementInfo mi;

    recv_data >> guid.ReadAsPacked();
    recv_data >> mi;

    if(!GetPlayer()->GetVehicle())
        return;

    bool dismiss = true;

    Creature* vehicle = GetPlayer()->GetMap()->GetAnyTypeCreature(guid);

    if (!vehicle || !vehicle->GetVehicleInfo())
        return;

    if (vehicle->GetVehicleInfo()->GetEntry()->m_flags & (VEHICLE_FLAG_NOT_DISMISS | VEHICLE_FLAG_ACCESSORY))
        dismiss = false;

    GetPlayer()->m_movementInfo = mi;

    if (!vehicle->RemoveSpellsCausingAuraByCaster(SPELL_AURA_CONTROL_VEHICLE, GetPlayer()->GetObjectGuid()))
        GetPlayer()->ExitVehicle();

    if (dismiss)
        vehicle->ForcedDespawn();

}
开发者ID:Hennesei,项目名称:mangos,代码行数:33,代码来源:VehicleHandler.cpp

示例6: OnPlayerDeath

void instance_zulfarrak::OnPlayerDeath(Player * /*pPlayer*/)
{
	//Wipe during pyramide event: reset!
	if (GetData(TYPE_PYRAMIDE) != IN_PROGRESS && GetData(TYPE_PYRAMIDE) != SPECIAL)
		return;
	Map::PlayerList const& L = instance->GetPlayers();
	uint32 i = 0;
	for (Map::PlayerList::const_iterator itr = L.begin(); itr != L.end(); ++itr) {
		Player* P = itr->getSource();
		if (!P || P->isDead() || !P->isAlive())
			i++;
	}
	if (i < L.getSize()-1)
		return;
    //Reset Event
	SetData(TYPE_PYRAMIDE, NOT_STARTED);
	//despawn summons
    if (!m_uiPyramideTrash.empty())
    {
        for(GUIDList::iterator itr = m_uiPyramideTrash.begin(); itr != m_uiPyramideTrash.end(); ++itr)
        {
			if (Creature* pTroll = instance->GetCreature(*itr))
            {
				pTroll->ForcedDespawn();
				pTroll->RemoveFromWorld();
            }
        }
    }
	m_uiPyramideTrash.clear();
	m_uiPyramideTrashTemp.clear();
	m_uiWave = 0;
	m_uiCheckPyramideTrash_Timer = 15000;
	//Reset troll cages and prisoners so event can be restarted
	for (int i = 0; i < 5; i++)
    {
		m_uiPyramideNPCs[i].clear();
		DoUseDoorOrButton(m_mGoEntryGuidStore[GO_TROLL_CAGE1+i],0,false);
		Creature* C = GetSingleCreatureFromStorage(NPC_SERGEANT_BLY+i);
		C->SetDeathState(JUST_DIED);
		C->Respawn();
		C->setFaction(FACTION_FRIENDLY);
    }
	//Set respawn time of executioner
	Creature* C = GetSingleCreatureFromStorage(NPC_SANDFURY_EXECUTIONER);
	if (C && C->IsInWorld() && !C->isAlive())
    {
        C->RemoveCorpse();
        C->SetRespawnTime(35);
        C->SaveRespawnTime();
        C->SetRespawnDelay(10 * 24 * 3600);
    }
	//Despawn Nekrum aswell
	C = GetSingleCreatureFromStorage(NPC_NEKRUM_GUTCHEWER);
	if (C && C->IsInWorld())
    {
		C->ForcedDespawn();
		C->RemoveFromWorld();
    }
}
开发者ID:Phatcat,项目名称:mangos,代码行数:59,代码来源:instance_zulfarrak.cpp

示例7: EffectDummy

 bool EffectDummy(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Object* pTarget, ObjectGuid /*originalCasterGuid*/) override
 {
     Creature* pCreatureTarget = pTarget->ToCreature();
     pCreatureTarget->CastSpell(pCreatureTarget, SPELL_COMPLETE_IMMOLATION, true);
     pCreatureTarget->SetStandState(UNIT_STAND_STATE_DEAD);
     pCreatureTarget->ForcedDespawn(10000);
     return true;
 }
开发者ID:Chuck5ta,项目名称:ScriptDev3,代码行数:8,代码来源:borean_tundra.cpp

示例8: JustDied

    void JustDied(Unit* pKiller)
    {
        DoScriptText(SAY_DEATH, m_creature);

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_THADDIUS, DONE);

            // Force Despawn of Adds
            Creature* pFeugen  = m_pInstance->GetSingleCreatureFromStorage(NPC_FEUGEN);
            Creature* pStalagg = m_pInstance->GetSingleCreatureFromStorage(NPC_STALAGG);

            if (pFeugen)
                pFeugen->ForcedDespawn();
            if (pStalagg)
                pStalagg->ForcedDespawn();
        }
    }
开发者ID:Agustin1010,项目名称:Scriptdev2-Agustin,代码行数:18,代码来源:boss_thaddius.cpp

示例9: SetData

void instance_uldaman::SetData(uint32 uiType, uint32 uiData)
{
    switch (uiType)
    {
        case TYPE_ALTAR_EVENT:
            if (uiData == DONE)
            {
                DoUseDoorOrButton(GO_TEMPLE_DOOR_UPPER);
                DoUseDoorOrButton(GO_TEMPLE_DOOR_LOWER);

                m_auiEncounter[0] = uiData;
            }
            break;

        case TYPE_ARCHAEDAS:
            if (uiData == FAIL)
            {
                for (GuidList::const_iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr)
                {
                    if (Creature* pWarden = instance->GetCreature(*itr))
                    {
                        pWarden->SetDeathState(JUST_DIED);
                        pWarden->Respawn();
                        pWarden->SetNoCallAssistance(true);
                    }
                }
            }
            else if (uiData == DONE)
            {
                for (GuidList::const_iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr)
                {
                    Creature* pWarden = instance->GetCreature(*itr);
                    if (pWarden && pWarden->isAlive())
                        pWarden->ForcedDespawn();
                }
                DoUseDoorOrButton(GO_ANCIENT_VAULT);
            }
            m_auiEncounter[1] = uiData;
            break;
    }

    if (uiData == DONE)
    {
        OUT_SAVE_INST_DATA;

        std::ostringstream saveStream;

        saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1];

        m_strInstData = saveStream.str();
        SaveToDB();
        OUT_SAVE_INST_DATA_COMPLETE;
    }
}
开发者ID:Donniedarkoz,项目名称:mangos-scriptdev2,代码行数:54,代码来源:instance_uldaman.cpp

示例10: PhaseChange

    void PhaseChange()
    {
        if (m_uiPhase == PHASE_SINGLE)
        {
            if (m_creature->GetHealthPercent() <= float(25*m_uiPhaseCounter))
            {
                if (!m_uiPhaseCounter)
                {
                    // final phase
                    m_uiPhase = PHASE_FINAL;
                    m_uiFrenzyTimer = 16*IN_MILLISECONDS;
                    m_uiSaberLashTimer = 20*IN_MILLISECONDS;
                }
                else
                {
                    m_uiPhase = PHASE_TOTEM;
                    m_uiShockTimer = 10*IN_MILLISECONDS;
                    m_uiTotemTimer = 12*IN_MILLISECONDS;

                    DoScriptText(SAY_SPLIT, m_creature);
                    m_creature->CastSpell(m_creature, SPELL_TRANSFIGURE_TO_TROLL, false);
                }
            }
        }
        else
        {
            Creature* pSpiritLynx = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SPIRIT_LYNX));

            if (m_creature->GetHealthPercent() < 10.0f ||
                (pSpiritLynx && pSpiritLynx->GetHealthPercent() < 10.0f))
            {
                m_uiPhase = PHASE_SINGLE;

                DoScriptText(SAY_MERGE, m_creature);

                uint32 uiSpellId;

                switch(m_uiPhaseCounter)
                {
                    case 3: uiSpellId = SPELL_TRANSFORM_TO_LYNX_75; break;
                    case 2: uiSpellId = SPELL_TRANSFORM_TO_LYNX_50; break;
                    case 1: uiSpellId = SPELL_TRANSFORM_TO_LYNX_25; break;
                }

                m_creature->CastSpell(m_creature, uiSpellId, false);

                if (pSpiritLynx)
                    pSpiritLynx->ForcedDespawn();

                m_uiFrenzyTimer = 16*IN_MILLISECONDS;
                m_uiSaberLashTimer = 20*IN_MILLISECONDS;
            }
        }
    }
开发者ID:eviljared,项目名称:diamondcore,代码行数:54,代码来源:boss_halazzi.cpp

示例11: DespawnAdds

    void DespawnAdds()
    {
        if (m_pInstance->lGothikDeathAdds.empty())
            return;

        for(std::list<uint64>::iterator itr = m_pInstance->lGothikDeathAdds.begin(); itr != m_pInstance->lGothikDeathAdds.end(); ++itr) 
        {
            Creature* pDeathAdds = m_pInstance->instance->GetCreature((*itr));
            if (pDeathAdds && pDeathAdds->isAlive())
                pDeathAdds->ForcedDespawn(20000);
        }
        m_pInstance->lGothikDeathAdds.clear();
        
        for(std::list<uint64>::iterator itr = m_pInstance->lGothikLiveAdds.begin(); itr != m_pInstance->lGothikLiveAdds.end(); ++itr) 
        {
            Creature* pLiveAdds = m_pInstance->instance->GetCreature((*itr));
            if (pLiveAdds && pLiveAdds->isAlive())
                pLiveAdds->ForcedDespawn(20000);
        }
        m_pInstance->lGothikLiveAdds.clear();
    }
开发者ID:Omeprazol,项目名称:mangos,代码行数:21,代码来源:boss_gothik.cpp

示例12: JustReachedHome

    void JustReachedHome()
    {
        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_THADDIUS, FAIL);

            // Respawn Adds:
            Creature* pFeugen  = m_pInstance->GetSingleCreatureFromStorage(NPC_FEUGEN);
            Creature* pStalagg = m_pInstance->GetSingleCreatureFromStorage(NPC_STALAGG);
            if (pFeugen)
            {
                pFeugen->ForcedDespawn();
                pFeugen->Respawn();
            }
            if (pStalagg)
            {
                pStalagg->ForcedDespawn();
                pStalagg->Respawn();
            }
        }
    }
开发者ID:Agustin1010,项目名称:Scriptdev2-Agustin,代码行数:21,代码来源:boss_thaddius.cpp

示例13: DespawnDwarf

 void DespawnDwarf()
 {
     if (lDwarfGUIDList.empty())
         return;
     for (std::list<uint64>::iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
     {
         Creature* pTemp = Unit::GetCreature(*m_creature, pInstance ? (*itr) : 0);
         if (pTemp && pTemp->isAlive())
             pTemp->ForcedDespawn();
     }
     lDwarfGUIDList.clear();
 }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:12,代码来源:halls_of_stone.cpp

示例14: NextStep

    int32 NextStep(uint32 Steps)
    {       
        if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
        {
            Creature* Taretha = (Unit::GetCreature(*me, TarethaGUID));
            Creature* Image = me->GetMap()->GetCreature(ImageGUID);

            switch (Steps)
            {
                case 1:
                    return 15000;
                case 2:
                    DoScriptText(SAY_TR_GLAD_SAFE, me);
                    return 10000;
                case 3:
                    DoScriptText(SAY_TA_NEVER_MET, Taretha);
                    return 10000;
                case 4:
                    DoScriptText(SAY_TR_THEN_WHO, me);
                    return 5000;
                case 5:
                    me->SummonCreature(NPC_EROZION, 2648.47f, 684.43f, 55.713f, 3.86f, TEMPSUMMON_TIMED_DESPAWN, 300000);
                    return 5000;
                case 6:
                    Image->CastSpell(Image, SPELL_MEMORY_WIPE, false);
                    return 5000;
                case 7:
                    DoScriptText(SAY_WIPE_MEMORY, Image);
                    return 10000;
                case 8:
                    DoScriptText(SAY_ABOUT_TARETHA, Image);
                    return 5000;
                case 9:
                    Image->CastSpell(Image, SPELL_MEMORY_WP_RESUME, false);
                    DoScriptText(SAY_TH_EVENT_COMPLETE, me);
                    return 6000;
                case 10:
                    Taretha->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
                    DoScriptText(SAY_TA_FAREWELL, Taretha);
                    SetEscortPaused(false);
                    QuestCredit();
                    return 3000;
                case 11:
                    Taretha->SetWalk(true);
                    Taretha->GetMotionMaster()->MovePoint(0, 2639.96f, 703.66f, 56.056f);
                    Taretha->ForcedDespawn(11000);
                default:
                    return 0;
            }
        }
        return true;
    }
开发者ID:Dolmero,项目名称:L4G_Core,代码行数:52,代码来源:old_hillsbrad.cpp

示例15: DespawnZombies

    void DespawnZombies()
    {
        if (lZombies.empty())
            return;

        for (GUIDList::iterator itr = lZombies.begin(); itr != lZombies.end(); ++itr)
        {
            Creature* pZombie = m_creature->GetMap()->GetCreature(*itr);
            if (pZombie && pZombie->isAlive())
                pZombie->ForcedDespawn();
        }
        lZombies.clear();
    }
开发者ID:Bearq,项目名称:scriptdev2,代码行数:13,代码来源:boss_gluth.cpp


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