本文整理汇总了C++中CUser::CheckExistEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::CheckExistEvent方法的具体用法?C++ CUser::CheckExistEvent怎么用?C++ CUser::CheckExistEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::CheckExistEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDeathProcess
/**
* @brief Executes the death process.
*
* @param pKiller The killer.
*/
void CNpc::OnDeathProcess(Unit *pKiller)
{
CUser * pUser = TO_USER(pKiller);
if (TO_NPC(this) != nullptr && pUser != nullptr)
{
if (pUser->isPlayer())
{
if (!m_bMonster)
{
switch (m_tNpcType)
{
case NPC_BIFROST_MONUMENT:
pUser->BifrostProcess(pUser);
break;
case NPC_PVP_MONUMENT:
PVPMonumentProcess(pUser);
break;
case NPC_BATTLE_MONUMENT:
BattleMonumentProcess(pUser);
break;
case NPC_HUMAN_MONUMENT:
NationMonumentProcess(pUser);
break;
case NPC_KARUS_MONUMENT:
NationMonumentProcess(pUser);
break;
case NPC_CHAOS_STONE:
{
if (pUser == nullptr)
return ;
if (pUser->isInPKZone())
ChaosStoneProcess(pUser,5);
}
break;
}
}
}
else if (m_bMonster)
{
if (m_sSid == 700 || m_sSid == 750)
{
if (pUser->CheckExistEvent(STARTER_SEED_QUEST, 1))
pUser->SaveEvent(STARTER_SEED_QUEST, 2);
}
else if (g_pMain->m_MonsterRespawnListArray.GetData(m_sSid) != nullptr) {
if (pUser->isInPKZone() || GetZoneID() == ZONE_JURAD_MOUNTAIN)
g_pMain->SpawnEventNpc(g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sSid, true, GetZoneID(), GetX(), GetY(), GetZ(), g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sCount);
} else if (m_tNpcType == NPC_CHAOS_STONE && pUser->isInPKZone()) {
ChaosStoneProcess(pUser,5);
}
}
DateTime time;
g_pMain->WriteDeathUserLogFile(string_format("[ %s - %d:%d:%d ] Killer=%s,SID=%d,Target=%s,Zone=%d,X=%d,Z=%d\n",m_bMonster ? "MONSTER" : "NPC",time.GetHour(),time.GetMinute(),time.GetSecond(),pKiller->GetName().c_str(),m_sSid,GetName().c_str(),GetZoneID(),uint16(GetX()),uint16(GetZ())));
}
}
示例2: OnDeath
/**
* @brief Executes the death action.
*
* @param pKiller The killer.
*/
void CNpc::OnDeath(Unit *pKiller)
{
if (m_NpcState == NPC_DEAD)
return;
ASSERT(GetMap() != nullptr);
ASSERT(GetRegion() != nullptr);
m_NpcState = NPC_DEAD;
if (m_byObjectType == SPECIAL_OBJECT)
{
_OBJECT_EVENT *pEvent = GetMap()->GetObjectEvent(GetProtoID());
if (pEvent != nullptr)
pEvent->byLife = 0;
}
Unit::OnDeath(pKiller);
CNpc * pNpc = TO_NPC(this);
CUser * pUser = TO_USER(pKiller);
if (pNpc != nullptr && pUser != nullptr)
{
if (pNpc->isMonster() && pUser->isPlayer())
{
if (pNpc->m_sSid == 700 || pNpc->m_sSid == 750)
{
if (pUser->CheckExistEvent(STARTER_SEED_QUEST, 0) || pUser->CheckExistEvent(STARTER_SEED_QUEST, 1))
pUser->SaveEvent(STARTER_SEED_QUEST, 2);
}
}
}
GetRegion()->Remove(TO_NPC(this));
SetRegion();
}
示例3: OnDeathProcess
/**
* @brief Executes the death process.
*
* @param pKiller The killer.
*/
void CNpc::OnDeathProcess(Unit *pKiller)
{
CUser * pUser = TO_USER(pKiller);
if (TO_NPC(this) != nullptr && pUser != nullptr)
{
if (pUser->isPlayer())
{
if (!m_bMonster)
{
switch (m_tNpcType)
{
case NPC_BIFROST_MONUMENT:
pUser->BifrostProcess(pUser);
break;
case NPC_PVP_MONUMENT:
PVPMonumentProcess(pUser);
break;
case NPC_BATTLE_MONUMENT:
BattleMonumentProcess(pUser);
break;
case NPC_HUMAN_MONUMENT:
NationMonumentProcess(pUser);
break;
case NPC_KARUS_MONUMENT:
NationMonumentProcess(pUser);
break;
}
}
else if (m_bMonster)
{
if (m_sSid == 700 || m_sSid == 750)
{
if (pUser->CheckExistEvent(STARTER_SEED_QUEST, 1))
pUser->SaveEvent(STARTER_SEED_QUEST, 2);
}
else if (g_pMain->m_MonsterRespawnListArray.GetData(m_sSid) != nullptr) {
if (pUser->isInPKZone() || GetZoneID() == ZONE_JURAD_MOUNTAIN)
g_pMain->SpawnEventNpc(g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sSid, true, GetZoneID(), GetX(), GetY(), GetZ(), g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sCount);
} else if (m_tNpcType == NPC_CHAOS_STONE && pUser->isInPKZone()) {
ChaosStoneProcess(pUser,5);
}
}
}
}
}