本文整理汇总了C++中LPCHARACTER::SetQuestFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::SetQuestFlag方法的具体用法?C++ LPCHARACTER::SetQuestFlag怎么用?C++ LPCHARACTER::SetQuestFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::SetQuestFlag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IncMember
void CWarMap::IncMember(LPCHARACTER ch)
{
if (!ch->IsPC())
return;
sys_log(0, "WarMap::IncMember");
DWORD gid = 0;
if (ch->GetGuild())
gid = ch->GetGuild()->GetID();
bool isWarMember = ch->GetQuestFlag("war.is_war_member") > 0 ? true : false;
if (isWarMember && gid != m_TeamData[0].dwID && gid != m_TeamData[1].dwID)
{
ch->SetQuestFlag("war.is_war_member", 0);
isWarMember = false;
}
if (isWarMember)
{
if (gid == m_TeamData[0].dwID)
{
m_TeamData[0].AppendMember(ch);
}
else if (gid == m_TeamData[1].dwID)
{
m_TeamData[1].AppendMember(ch);
}
event_cancel(&m_pkTimeoutEvent);
sys_log(0, "WarMap +m %u(cur:%d, acc:%d) vs %u(cur:%d, acc:%d)",
m_TeamData[0].dwID, m_TeamData[0].GetCurJointerCount(), m_TeamData[0].GetAccumulatedJoinerCount(),
m_TeamData[1].dwID, m_TeamData[1].GetCurJointerCount(), m_TeamData[1].GetAccumulatedJoinerCount());
}
else
{
++m_iObserverCount;
sys_log(0, "WarMap +o %d", m_iObserverCount);
ch->SetObserverMode(true);
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("관전 모드로 길드전에 참가하셨습니다."));
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("자신을 선택하시면 밖으로 나갈 수 있는 <관람 종료> 버튼이 나옵니다."));
}
UpdateUserCount();
m_set_pkChr.insert(ch);
LPDESC d = ch->GetDesc();
SendWarPacket(d);
SendScorePacket(0, d);
SendScorePacket(1, d);
}
示例2: DecMember
void CWarMap::DecMember(LPCHARACTER ch)
{
if (!ch->IsPC())
return;
sys_log(0, "WarMap::DecMember");
DWORD gid = 0;
if (ch->GetGuild())
gid = ch->GetGuild()->GetID();
if (!ch->IsObserverMode())
{
if (gid == m_TeamData[0].dwID)
m_TeamData[0].RemoveMember(ch);
else if (gid == m_TeamData[1].dwID)
m_TeamData[1].RemoveMember(ch);
if (m_kMapInfo.bType == WAR_MAP_TYPE_FLAG)
{
CAffect * pkAff = ch->FindAffect(AFFECT_WAR_FLAG);
if (pkAff)
{
BYTE idx;
if (GetTeamIndex(pkAff->lApplyValue, idx))
AddFlag(idx, ch->GetX(), ch->GetY());
ch->RemoveAffect(AFFECT_WAR_FLAG);
}
}
sys_log(0, "WarMap -m %u(cur:%d, acc:%d) vs %u(cur:%d, acc:%d)",
m_TeamData[0].dwID, m_TeamData[0].GetCurJointerCount(), m_TeamData[0].GetAccumulatedJoinerCount(),
m_TeamData[1].dwID, m_TeamData[1].GetCurJointerCount(), m_TeamData[1].GetAccumulatedJoinerCount());
CheckWarEnd();
ch->SetQuestFlag("war.is_war_member", 0);
}
else
{
--m_iObserverCount;
sys_log(0, "WarMap -o %d", m_iObserverCount);
ch->SetObserverMode(false);
}
UpdateUserCount();
m_set_pkChr.erase(ch);
}
示例3: horse_set_name
int horse_set_name(lua_State* L)
{
// 리턴값
// 0 : 소유한 말이 없다
// 1 : 잘못된 이름이다
// 2 : 이름 바꾸기 성공
if ( lua_isstring(L, -1) != true ) return 0;
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if ( ch->GetHorseLevel() > 0 )
{
const char* pHorseName = lua_tostring(L, -1);
if ( pHorseName == NULL || check_name(pHorseName) == 0 )
{
lua_pushnumber(L, 1);
}
else
{
int nHorseNameDuration = test_server == true ? 60*5 : 60*60*24*30;
ch->SetQuestFlag("horse_name.valid_till", get_global_time() + nHorseNameDuration);
ch->AddAffect(AFFECT_HORSE_NAME, 0, 0, 0, PASSES_PER_SEC(nHorseNameDuration), 0, true);
CHorseNameManager::instance().UpdateHorseName(ch->GetPlayerID(), lua_tostring(L, -1), true);
ch->HorseSummon(false, true);
ch->HorseSummon(true, true);
lua_pushnumber(L, 2);
}
}
else
{
lua_pushnumber(L, 0);
}
return 1;
}