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


C++ Battleground::AddPlayerToResurrectQueue方法代码示例

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


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

示例1: HandleAreaSpiritHealerQueueOpcode

void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");

    Battleground* bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
    else
    {  // Wintergrasp Hack till 3.3.5 and it's implemented as BG
        if (GetPlayer()->GetZoneId() == 4197)
        {
            OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
            if (pvpWG && pvpWG->isWarTime())
                pvpWG->AddPlayerToResurrectQueue(guid, _player->GetGUID());
        }
    }
}
开发者ID:kmN666,项目名称:Leroy,代码行数:28,代码来源:BattleGroundHandler.cpp

示例2: HandleAreaSpiritHealerQueueOpcode

void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
{
    sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");

    Battleground *bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
    else
    {
        // Wintergrasp Hack till 3.2 and it's implemented as BG
        if (GetPlayer()->GetZoneId() == 4197)
        {
            OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
            if (pvpWG && pvpWG != 0)
                if (QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE value= '%u' AND entry = '%u'", 1, 31001))
                    pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid);
        }
    }
}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:30,代码来源:BattleGroundHandler.cpp

示例3: HandleGossipHelloOpcode

void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData)
{
    ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO");

    uint64 guid;
    recvData >> guid;

    Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
    if (!unit)
    {
        ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
        return;
    }

    // xinef: check if we have ANY npc flags
    if (unit->GetUInt32Value(UNIT_NPC_FLAGS) == UNIT_NPC_FLAG_NONE)
        return;

    // xinef: do not allow to open gossip when npc is in combat
    if (unit->GetUInt32Value(UNIT_NPC_FLAGS) == UNIT_NPC_FLAG_GOSSIP && unit->IsInCombat()) // should work on all flags?
        return;

    // set faction visible if needed
    if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
        _player->GetReputationMgr().SetVisible(factionTemplateEntry);

    GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
    // remove fake death
    //if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
    //    GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);

    // xinef: and if he has pure gossip or is banker and moves or is tabard designer?
    //if (unit->IsArmorer() || unit->IsCivilian() || unit->IsQuestGiver() || unit->IsServiceProvider() || unit->IsGuard())
    {
        //if (!unit->GetTransport()) // pussywizard: reverted with new spline (old: without this check, npc would stay in place and the transport would continue moving, so the npc falls off. NPCs on transports don't have waypoints, so stopmoving is not needed)
            unit->StopMoving();
    }

    // If spiritguide, no need for gossip menu, just put player into resurrect queue
    if (unit->IsSpiritGuide())
    {
        Battleground* bg = _player->GetBattleground();
        if (bg)
        {
            bg->AddPlayerToResurrectQueue(unit->GetGUID(), _player->GetGUID());
            sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, unit->GetGUID());
            return;
        }
    }

    if (!sScriptMgr->OnGossipHello(_player, unit))
    {
//        _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID());
        _player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true);
        _player->SendPreparedGossip(unit);
    }
    unit->AI()->sGossipHello(_player);
}
开发者ID:boom8866,项目名称:azerothcore-wotlk,代码行数:58,代码来源:NPCHandler.cpp

示例4: HandleGossipHelloOpcode

void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
{
    TC_LOG_DEBUG("network", "WORLD: Received CMSG_GOSSIP_HELLO");

    ObjectGuid guid;

    recvData.ReadGuidMask(guid, 2, 4, 0, 3, 6, 7, 5, 1);

    recvData.ReadGuidBytes(guid, 4, 7, 1, 0, 5, 3, 6, 2);

    Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
    if (!unit)
    {
        TC_LOG_DEBUG("network", "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
        return;
    }

    // set faction visible if needed
    if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
        _player->GetReputationMgr().SetVisible(factionTemplateEntry);

    GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
    // remove fake death
    //if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
    //    GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);

    if (unit->IsArmorer() || unit->IsCivilian() || unit->IsQuestGiver() || unit->IsServiceProvider() || unit->IsGuard())
        unit->StopMoving();

    // If spiritguide, no need for gossip menu, just put player into resurrect queue
    if (unit->IsSpiritGuide())
    {
        Battleground* bg = _player->GetBattleground();
        if (bg)
        {
            bg->AddPlayerToResurrectQueue(unit->GetGUID(), _player->GetGUID());
            sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, unit->GetGUID());
            return;
        }
    }

    if (!sScriptMgr->OnGossipHello(_player, unit))
    {
//        _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID());
        _player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true);
        _player->SendPreparedGossip(unit);
    }
    unit->AI()->sGossipHello(_player);
}
开发者ID:Caydan,项目名称:WoWSCore548,代码行数:49,代码来源:NPCHandler.cpp

示例5: HandleGossipHelloOpcode

void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) {
	sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO");

	uint64 guid;
	recv_data >> guid;

	Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,
			UNIT_NPC_FLAG_NONE);
	if (!unit) {
		sLog->outDebug(
				LOG_FILTER_NETWORKIO,
				"WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.",
				uint32(GUID_LOPART(guid)));
		return;
	}

	GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
	// remove fake death
	//if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
	//    GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);

	if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver()
			|| unit->isServiceProvider() || unit->isGuard()) {
		unit->StopMoving();
	}

	// If spiritguide, no need for gossip menu, just put player into resurrect queue
	if (unit->isSpiritGuide()) {
		Battleground *bg = _player->GetBattleground();
		if (bg) {
			bg->AddPlayerToResurrectQueue(unit->GetGUID(), _player->GetGUID());
			sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg,
					unit->GetGUID());
			return;
		}
	}

	if (!sScriptMgr->OnGossipHello(_player, unit)) {
//        _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID());
		_player->PrepareGossipMenu(unit, unit->GetCreatureInfo()->GossipMenuId,
				true);
		_player->SendPreparedGossip(unit);
	}
	unit->AI()->sGossipHello(_player);
}
开发者ID:Bootz,项目名称:DeepshjirRepack,代码行数:45,代码来源:NPCHandler.cpp

示例6: HandleAreaSpiritHealerQueueOpcode

void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE");

    Battleground *bg = _player->GetBattleground();

    uint64 guid;
    recv_data >> guid;

    Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
    if (!unit)
        return;

    if (!unit->isSpiritService())                            // it's not spirit service
        return;

    if (bg)
        bg->AddPlayerToResurrectQueue(guid, _player->GetGUID());
}
开发者ID:Bootz,项目名称:SkyFireEMU_420,代码行数:19,代码来源:BattleGroundHandler.cpp


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