本文整理汇总了C++中LPCHARACTER::IsPC方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::IsPC方法的具体用法?C++ LPCHARACTER::IsPC怎么用?C++ LPCHARACTER::IsPC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::IsPC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Link
void CParty::Link(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
// 플레이어 파티일 경우 업데이트 이벤트 생성
if (m_bPCParty && !m_eventUpdate)
{
party_update_event_info* info = AllocEventInfo<party_update_event_info>();
info->pid = m_dwLeaderPID;
m_eventUpdate = event_create(party_update_event, info, PASSES_PER_SEC(3));
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = pkChr;
sys_log(2, "PARTY[%d] %s linked to party", GetLeaderPID(), pkChr->GetName());
it->second.pCharacter = pkChr;
pkChr->SetParty(this);
if (pkChr->IsPC())
{
if (it->second.strName.empty())
{
it->second.strName = pkChr->GetName();
}
SendPartyJoinOneToAll(pkChr->GetPlayerID());
SendPartyJoinAllToOne(pkChr);
SendPartyLinkOneToAll(pkChr);
SendPartyLinkAllToOne(pkChr);
SendPartyInfoAllToOne(pkChr);
SendPartyInfoOneToAll(pkChr);
SendParameter(pkChr);
//sys_log(0, "PARTY-DUNGEON connect %p %p", this, GetDungeon());
if (GetDungeon() && GetDungeon()->GetMapIndex() == pkChr->GetMapIndex())
{
pkChr->SetDungeon(GetDungeon());
}
RequestSetMemberLevel(pkChr->GetPlayerID(), pkChr->GetLevel());
}
}
示例2: NormalAttackAffect
void NormalAttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
{
// 독 공격은 특이하므로 특수 처리
if (pkAttacker->GetPoint(POINT_POISON_PCT) && !pkVictim->IsAffectFlag(AFF_POISON))
{
if (number(1, 100) <= pkAttacker->GetPoint(POINT_POISON_PCT))
pkVictim->AttackedByPoison(pkAttacker);
}
int iStunDuration = 2;
if (pkAttacker->IsPC() && !pkVictim->IsPC())
iStunDuration = 4;
AttackAffect(pkAttacker, pkVictim, POINT_STUN_PCT, IMMUNE_STUN, AFFECT_STUN, POINT_NONE, 0, AFF_STUN, iStunDuration, "STUN");
AttackAffect(pkAttacker, pkVictim, POINT_SLOW_PCT, IMMUNE_SLOW, AFFECT_SLOW, POINT_MOV_SPEED, -30, AFF_SLOW, 20, "SLOW");
}
示例3: operator
void operator() (LPCHARACTER ch)
{
if (ch->IsPC())
{
ch->ExitToSavedLocation();
}
}
示例4: CreateParty
LPPARTY CPartyManager::CreateParty(LPCHARACTER pLeader)
{
if (pLeader->GetParty())
return pLeader->GetParty();
LPPARTY pParty = M2_NEW CParty;
if (pLeader->IsPC())
{
//TPacketGGParty p;
//p.header = HEADER_GG_PARTY;
//p.subheader = PARTY_SUBHEADER_GG_CREATE;
//p.pid = pLeader->GetPlayerID();
//P2P_MANAGER::instance().Send(&p, sizeof(p));
TPacketPartyCreate p;
p.dwLeaderPID = pLeader->GetPlayerID();
db_clientdesc->DBPacket(HEADER_GD_PARTY_CREATE, 0, &p, sizeof(TPacketPartyCreate));
sys_log(0, "PARTY: Create %s pid %u", pLeader->GetName(), pLeader->GetPlayerID());
pParty->SetPCParty(true);
pParty->Join(pLeader->GetPlayerID());
m_set_pkPCParty.insert(pParty);
}
else
{
pParty->SetPCParty(false);
pParty->Join(pLeader->GetVID());
}
pParty->Link(pLeader);
return (pParty);
}
示例5: 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);
}
示例6: battle_is_attackable
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
// 상대방이 죽었으면 중단한다.
if (victim->IsDead())
return false;
// 안전지대면 중단
{
SECTREE *sectree = NULL;
sectree = ch->GetSectree();
if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK))
return false;
sectree = victim->GetSectree();
if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
return false;
}
// 내가 죽었으면 중단한다.
if (ch->IsStun() || ch->IsDead())
return false;
if (ch->IsPC() && victim->IsPC())
{
CGuild* g1 = ch->GetGuild();
CGuild* g2 = victim->GetGuild();
if (g1 && g2)
{
if (g1->UnderWar(g2->GetID()))
return true;
}
}
if (IS_CASTLE_MAP(ch->GetMapIndex()) && false==castle_can_attack(ch, victim))
return false;
if (CArenaManager::instance().CanAttack(ch, victim) == true)
return true;
return CPVPManager::instance().CanAttack(ch, victim);
}
示例7: SET_ATTACKED_TIME
void SET_ATTACKED_TIME(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{
if (NULL == ch || NULL == victim)
return;
if (!ch->IsPC())
return;
victim->m_AttackedLog.dwPID = ch->GetPlayerID();
victim->m_AttackedLog.dwAttackedTime= current_time;
}
示例8: SET_ATTACK_TIME
void SET_ATTACK_TIME(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{
if (NULL == ch || NULL == victim)
return;
if (!ch->IsPC())
return;
ch->m_kAttackLog.dwVID = victim->GetVID();
ch->m_kAttackLog.dwTime = current_time;
}
示例9: operator
void operator () (LPENTITY ent)
{
// 오브젝트가 아닌 것은 거리를 계산하여 거리가 멀면 추가하지 않는다.
if (!ent->IsType(ENTITY_OBJECT))
if (DISTANCE_APPROX(ent->GetX() - m_me->GetX(), ent->GetY() - m_me->GetY()) > dwViewRange)
return;
// 나를 대상에 추가
m_me->ViewInsert(ent);
// 둘다 캐릭터면
if (ent->IsType(ENTITY_CHARACTER) && m_me->IsType(ENTITY_CHARACTER))
{
LPCHARACTER chMe = (LPCHARACTER) m_me;
LPCHARACTER chEnt = (LPCHARACTER) ent;
// 대상이 NPC면 StateMachine을 킨다.
if (chMe->IsPC() && !chEnt->IsPC() && !chEnt->IsWarp() && !chEnt->IsGoto())
chEnt->StartStateMachine();
}
}
示例10: operator
void operator() (LPENTITY ent)
{
if (true == ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = static_cast<LPCHARACTER>(ent);
if (false == ch->IsPC())
{
ch->Dead();
}
}
}
示例11: 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);
}
示例12: Unlink
void CParty::Unlink(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
if (pkChr->IsPC())
{
SendPartyUnlinkOneToAll(pkChr);
//SendPartyUnlinkAllToOne(pkChr); // 끊기는 것이므로 구지 Unlink 패킷을 보낼 필요 없다.
if (it->second.bRole == PARTY_ROLE_LEADER)
{
RemoveBonus();
if (it->second.pCharacter->GetDungeon())
{
// TODO: 던젼에 있으면 나머지도 나간다
FExitDungeon f;
ForEachNearMember(f);
}
}
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = NULL;
it->second.pCharacter = NULL;
pkChr->SetParty(NULL);
}
示例13: operator
void operator() (LPENTITY ent)
{
if (NULL != ent)
{
LPCHARACTER pChar = static_cast<LPCHARACTER>(ent);
if (NULL != pChar)
{
if (true == pChar->IsPC())
{
pChar->GoHome();
}
}
}
}
示例14: StartShopping
// 상점 거래를 시작
bool CShopManager::StartShopping(LPCHARACTER pkChr, LPCHARACTER pkChrShopKeeper, int iShopVnum)
{
if (pkChr->GetShopOwner() == pkChrShopKeeper)
return false;
// this method is only for NPC
if (pkChrShopKeeper->IsPC())
return false;
//PREVENT_TRADE_WINDOW
if (pkChr->IsOpenSafebox() || pkChr->GetExchange() || pkChr->GetMyShop() || pkChr->IsCubeOpen())
{
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열린상태에서는 상점거래를 할수 가 없습니다."));
return false;
}
//END_PREVENT_TRADE_WINDOW
long distance = DISTANCE_APPROX(pkChr->GetX() - pkChrShopKeeper->GetX(), pkChr->GetY() - pkChrShopKeeper->GetY());
if (distance >= SHOP_MAX_DISTANCE)
{
sys_log(1, "SHOP: TOO_FAR: %s distance %d", pkChr->GetName(), distance);
return false;
}
LPSHOP pkShop;
if (iShopVnum)
pkShop = Get(iShopVnum);
else
pkShop = GetByNPCVnum(pkChrShopKeeper->GetRaceNum());
if (!pkShop)
{
sys_log(1, "SHOP: NO SHOP");
return false;
}
bool bOtherEmpire = false;
if (pkChr->GetEmpire() != pkChrShopKeeper->GetEmpire())
bOtherEmpire = true;
pkShop->AddGuest(pkChr, pkChrShopKeeper->GetVID(), bOtherEmpire);
pkChr->SetShopOwner(pkChrShopKeeper);
sys_log(0, "SHOP: START: %s", pkChr->GetName());
return true;
}
示例15: GetPoisonDamageRate
int GetPoisonDamageRate(LPCHARACTER ch)
{
int iRate;
if (ch->IsPC())
{
if (LC_IsYMIR())
iRate = 40;
else
iRate = 50;
}
else
iRate = poison_damage_rate[ch->GetMobRank()];
iRate = MAX(0, iRate - ch->GetPoint(POINT_POISON_REDUCE));
return iRate;
}