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


C++ OutdoorPvP类代码示例

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


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

示例1: InitOutdoorPvP

void OutdoorPvPMgr::InitOutdoorPvP()
{
    // create new opvp

     OutdoorPvP * pOP = new OutdoorPvPSI;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : SI init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.push_back(pOP);
        sLog.outDebug("OutdoorPvP : SI successfully initiated.");
    }

    pOP = new OutdoorPvPEP;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : EP init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.push_back(pOP);
        sLog.outDebug("OutdoorPvP : EP successfully initiated.");
    }
}
开发者ID:mynew,项目名称:TrinityCore-1,代码行数:30,代码来源:OutdoorPvPMgr.cpp

示例2: switch

void OutdoorPvPMgr::CreateOutdoorPvP(uint32 typeId)
{
    OutdoorPvP * pOP = NULL;
    switch (typeId)
    {
        case OUTDOOR_PVP_HP: pOP = new OutdoorPvPHP; break;
        case OUTDOOR_PVP_NA: pOP = new OutdoorPvPNA; break;
        case OUTDOOR_PVP_TF: pOP = new OutdoorPvPTF; break;
        case OUTDOOR_PVP_ZM: pOP = new OutdoorPvPZM; break;
        case OUTDOOR_PVP_SI: pOP = new OutdoorPvPSI; break;
        case OUTDOOR_PVP_EP: pOP = new OutdoorPvPEP; break;
        case OUTDOOR_PVP_LA: pOP = new OutdoorPvPLA; break;
        default: break;
    }
    if(!pOP)
    {
        sLog.outDebug("OutdoorPvPMgr: init failed for %i.", typeId);
        return;
    }
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvPMgr: SetupOutdoorPvP failed for %i.", typeId);
        delete pOP;
        return;
    }
    pOP->SetTypeId(typeId);
    m_OutdoorPvPSet.insert(pOP);
    sLog.outDebug("OutdoorPvPMgr: init successfull for %i.", typeId);

}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例3: switch

/**
   Function which loads the world pvp scripts
 */
void OutdoorPvPMgr::InitOutdoorPvP()
{
    uint8 count = 0;
    for (uint8 id = 0; id < 6; ++id)
    {
        OutdoorPvP* outdoorPvP = NULL;
        switch (id)
        {
            case 0: outdoorPvP = new OutdoorPvPEP; break;
            case 1: outdoorPvP = new OutdoorPvPSI; break;
            case 2: outdoorPvP = new OutdoorPvPHP; break;
            case 3: outdoorPvP = new OutdoorPvPNA; break;
            case 4: outdoorPvP = new OutdoorPvPTF; break;
            case 5: outdoorPvP = new OutdoorPvPZM; break;
        }

        if (outdoorPvP->InitOutdoorPvPArea())
        {
            m_OutdoorPvPSet.push_back(outdoorPvP);
            ++count;
        }
        else
        {
            sLog.outDebug("OutdoorPvP: Outdoor PvP id %u loading failed.", id);
            delete outdoorPvP;
        }
    }

    sLog.outString();
    sLog.outString(">> Loaded %u World PvP zones", count);
}
开发者ID:kramnik,项目名称:server,代码行数:34,代码来源:OutdoorPvPMgr.cpp

示例4: GetScript

/**
   Function that handles the players which enters a specific zone

   @param   player to be handled in the event
   @param   zone id used for the current outdoor pvp script
 */
void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneId)
{
    OutdoorPvP* script = GetScript(zoneId);
    if (script)
        { script->HandlePlayerEnterZone(player, true); }
    else
    {
        script = GetScriptOfAffectedZone(zoneId);
        if (script)
            { script->HandlePlayerEnterZone(player, false); }
    }
}
开发者ID:Chuck5ta,项目名称:server,代码行数:18,代码来源:OutdoorPvPMgr.cpp

示例5: getMSTime

void OutdoorPvPMgr::InitOutdoorPvP()
{
    uint32 oldMSTime = getMSTime();

    //                                                       0       1
    QueryResult result = WorldDatabase.Query("SELECT TypeId, ScriptName FROM outdoorpvp_template");

    if(!result)
    {
        sLog->outErrorDb(">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
        sLog->outString();
        return;
    }

    uint32 count = 0;
    uint32 typeId = 0;

    do
    {
        Field* fields = result->Fetch();

        typeId = fields[0].GetUInt32();

        if(sDisableMgr->IsDisabledFor(DISABLE_TYPE_OUTDOORPVP, typeId, NULL))
            continue;

        if(typeId >= MAX_OUTDOORPVP_TYPES)
        {
            sLog->outErrorDb("Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
            continue;
        }

        OutdoorPvPData* data = new OutdoorPvPData();
        OutdoorPvPTypes realTypeId = OutdoorPvPTypes(typeId);
        data->TypeId = realTypeId;
        data->ScriptId = sObjectMgr->GetScriptId(fields[1].GetCString());
        m_OutdoorPvPDatas[realTypeId] = data;

        ++count;
    }
    while(result->NextRow());

    OutdoorPvP* pvp;
    for(uint8 i = 1; i < MAX_OUTDOORPVP_TYPES; ++i)
    {
        OutdoorPvPDataMap::iterator iter = m_OutdoorPvPDatas.find(OutdoorPvPTypes(i));
        if(iter == m_OutdoorPvPDatas.end())
        {
            sLog->outErrorDb("Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
            continue;
        }

        pvp = sScriptMgr->CreateOutdoorPvP(iter->second);
        if(!pvp)
        {
            sLog->outError("Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
            continue;
        }

        if(!pvp->SetupOutdoorPvP())
        {
            sLog->outError("Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
            delete pvp;
            continue;
        }

        m_OutdoorPvPSet.push_back(pvp);
    }

    sLog->outString(">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
    sLog->outString();
}
开发者ID:Darkelmo,项目名称:MythCore,代码行数:72,代码来源:OutdoorPvPMgr.cpp

示例6: InitOutdoorPvP

void OutdoorPvPMgr::InitOutdoorPvP()
{
    // create new opvp
    OutdoorPvP * pOP = new OutdoorPvPHP;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : HP init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : HP successfully initiated.");
    }


    pOP = new OutdoorPvPNA;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : NA init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : NA successfully initiated.");
    }


    pOP = new OutdoorPvPTF;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : TF init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : TF successfully initiated.");
    }

    pOP = new OutdoorPvPZM;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : ZM init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : ZM successfully initiated.");
    }

    pOP = new OutdoorPvPSI;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : SI init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : SI successfully initiated.");
    }

    pOP = new OutdoorPvPEP;
    // respawn, init variables
    if(!pOP->SetupOutdoorPvP())
    {
        sLog.outDebug("OutdoorPvP : EP init failed.");
        delete pOP;
    }
    else
    {
        m_OutdoorPvPSet.insert(pOP);
        sLog.outDebug("OutdoorPvP : EP successfully initiated.");
    }
}
开发者ID:,项目名称:,代码行数:83,代码来源:


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