本文整理汇总了C++中LPCHARACTER::GetMapIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetMapIndex方法的具体用法?C++ LPCHARACTER::GetMapIndex怎么用?C++ LPCHARACTER::GetMapIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetMapIndex方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: party_give_buff
// 파티 단위로 버프 주는 함수.
// 같은 맵에 있는 파티원만 영향을 받는다.
int party_give_buff (lua_State* L)
{
CQuestManager & q = CQuestManager::instance();
LPCHARACTER ch = q.GetCurrentCharacterPtr();
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L, 4) ||
!lua_isnumber(L, 5) || !lua_isnumber(L, 6) || !lua_isboolean(L, 7) || !lua_isboolean(L, 8))
{
lua_pushboolean (L, false);
return 1;
}
DWORD dwType = lua_tonumber(L, 1);
BYTE bApplyOn = lua_tonumber(L, 2);
long lApplyValue = lua_tonumber(L, 3);
DWORD dwFlag = lua_tonumber(L, 4);
long lDuration = lua_tonumber(L, 5);
long lSPCost = lua_tonumber(L, 6);
bool bOverride = lua_toboolean(L, 7);
bool IsCube = lua_toboolean(L, 8);
FGiveBuff f (dwType, bApplyOn, lApplyValue, dwFlag, lDuration, lSPCost, bOverride, IsCube);
if (ch->GetParty())
ch->GetParty()->ForEachOnMapMember(f, ch->GetMapIndex());
else
f(ch);
lua_pushboolean (L, true);
return 1;
}
示例2: party_is_map_member_flag_lt
int party_is_map_member_flag_lt(lua_State* L)
{
if (!lua_isstring(L, 1) || !lua_isnumber(L, 2))
{
lua_pushnumber(L, 0);
return 1;
}
CQuestManager& q = CQuestManager::Instance();
LPPARTY pParty = q.GetCurrentCharacterPtr()->GetParty();
LPCHARACTER ch = q.GetCurrentCharacterPtr();
PC* pPC = q.GetCurrentPC();
const char* sz = lua_tostring(L,1);
if (pParty)
{
FPartyCheckFlagLt f;
f.flagname = pPC->GetCurrentQuestName() + "."+sz;
f.value = (int) rint(lua_tonumber(L, 2));
bool returnBool = pParty->ForEachOnMapMemberBool(f, ch->GetMapIndex());
lua_pushboolean(L, returnBool);
}
return 1;
}
示例3: 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());
}
}
示例4: OnDragonDead
void CDragonLairManager::OnDragonDead(LPCHARACTER pDragon, DWORD KillerGuildID)
{
if (NULL == pDragon)
return;
if (false == pDragon->IsMonster())
return;
boost::unordered_map<DWORD, CDragonLair*>::iterator iter = LairMap_.find( KillerGuildID );
if (LairMap_.end() == iter)
{
return;
}
LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap( pDragon->GetMapIndex() );
if (NULL == iter->second || NULL == pMap)
{
LairMap_.erase( iter );
return;
}
iter->second->OnDragonDead( pDragon );
// ѕЦµй ґЩ БэАё·О єёі»°н ёК ѕшѕЦ±в
tag_DragonLair_Collapse_EventInfo* info;
info = AllocEventInfo<tag_DragonLair_Collapse_EventInfo>();
info->step = 0;
info->pLair = iter->second;
info->InstanceMapIndex = pDragon->GetMapIndex();
event_create(DragonLair_Collapse_Event, info, PASSES_PER_SEC(10));
LairMap_.erase( iter );
}
示例5: marriage_in_my_wedding
int marriage_in_my_wedding(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
marriage::TMarriage* pMarriage = marriage::CManager::instance().Get(ch->GetPlayerID());
if (pMarriage->pWeddingInfo)
{
lua_pushboolean(L, (DWORD)ch->GetMapIndex() == pMarriage->pWeddingInfo->dwMapIndex);
}
else
{
lua_pushboolean(L, 0);
}
return 1;
}
示例6: CheckIpAddress
bool COXEventManager::CheckIpAddress(LPCHARACTER ch)
{
for (itertype(m_map_attender) it = m_map_attender.begin(); it != m_map_attender.end(); ++it)
{
LPCHARACTER tch = CHARACTER_MANAGER::Instance().FindByPID(it->second);
if (!tch || !tch->GetDesc())
continue;
if (!strcmp(ch->GetDesc()->GetHostName(), tch->GetDesc()->GetHostName()) && ch->GetMapIndex() == tch->GetMapIndex())
{
LogManager::Instance().HackLog("MULTI_IP_OX", ch);
ch->GoHome();
return false;
}
}
return true;
}
示例7: party_get_member_pids
int party_get_member_pids(lua_State *L)
{
CQuestManager & q = CQuestManager::instance();
LPCHARACTER ch = q.GetCurrentCharacterPtr();
LPPARTY pParty = ch->GetParty();
if (NULL == pParty)
{
return 0;
}
FPartyPIDCollector f;
pParty->ForEachOnMapMember(f, ch->GetMapIndex());
for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); it++)
{
lua_pushnumber(L, *it);
}
return f.vecPIDs.size();
}
示例8: 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);
}
示例9: PutData
void CLand::PutData(const TLand * data)
{
memcpy(&m_data, data, sizeof(TLand));
if (m_data.dwGuildID)
{
const TMapRegion * r = SECTREE_MANAGER::instance().GetMapRegion(m_data.lMapIndex);
if (r)
{
CharacterVectorInteractor i;
if (CHARACTER_MANAGER::instance().GetCharactersByRaceNum(20040, i))
{
CharacterVectorInteractor::iterator it = i.begin();
while (it != i.end())
{
LPCHARACTER ch = *(it++);
if (ch->GetMapIndex() != m_data.lMapIndex)
continue;
int x = ch->GetX() - r->sx;
int y = ch->GetY() - r->sy;
if (x > m_data.x + m_data.width || x < m_data.x)
continue;
if (y > m_data.y + m_data.height || y < m_data.y)
continue;
M2_DESTROY_CHARACTER(ch);
}
}
}
}
}
示例10: SummonToLeader
void CParty::SummonToLeader(DWORD pid)
{
int xy[12][2] =
{
{ 250, 0 },
{ 216, 125 },
{ 125, 216 },
{ 0, 250 },
{ -125, 216 },
{ -216, 125 },
{ -250, 0 },
{ -216, -125 },
{ -125, -216 },
{ 0, -250 },
{ 125, -216 },
{ 216, -125 },
};
int n = 0;
int x[12], y[12];
SECTREE_MANAGER & s = SECTREE_MANAGER::instance();
LPCHARACTER l = GetLeaderCharacter();
if (m_memberMap.find(pid) == m_memberMap.end())
{
l->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> 소환하려는 대상을 찾을 수 없습니다."));
return;
}
LPCHARACTER ch = m_memberMap[pid].pCharacter;
if (!ch)
{
l->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> 소환하려는 대상을 찾을 수 없습니다."));
return;
}
if (!ch->CanSummon(m_iLeadership))
{
l->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> 대상을 소환할 수 없습니다."));
return;
}
for (int i = 0; i < 12; ++i)
{
PIXEL_POSITION p;
if (s.GetMovablePosition(l->GetMapIndex(), l->GetX() + xy [i][0], l->GetY() + xy[i][1], p))
{
x[n] = p.x;
y[n] = p.y;
n++;
}
}
if (n == 0)
l->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> 파티원을 현재 위치로 소환할 수 없습니다."));
else
{
int i = number(0, n - 1);
ch->Show(l->GetMapIndex(), x[i], y[i]);
ch->Stop();
}
}
示例11: CanAttack
bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)
{
switch (pkVictim->GetCharType())
{
case CHAR_TYPE_NPC:
case CHAR_TYPE_WARP:
case CHAR_TYPE_GOTO:
return false;
}
if (pkChr == pkVictim) // 내가 날 칠라고 하네 -_-
return false;
if (pkVictim->IsNPC() && pkChr->IsNPC() && !pkChr->IsGuardNPC())
return false;
if( true == pkChr->IsHorseRiding() )
{
if( pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade() )
return false;
}
else
{
switch( pkChr->GetMountVnum() )
{
case 0:
case 20030:
case 20110:
case 20111:
case 20112:
case 20113:
case 20114:
case 20115:
case 20116:
case 20117:
case 20118:
//신규 탈것 고급
case 20205:
case 20206:
case 20207:
case 20208:
case 20209:
case 20210:
case 20211:
case 20212:
case 20119: // 라마단 흑마
case 20219: // 라마단 흑마 클론 (할로윈용)
case 20220: // 크리스마스 탈것
case 20221: // 전갑 백웅
case 20222: // 전갑 팬더
case 20120:
case 20121:
case 20122:
case 20123:
case 20124:
case 20125:
case 20214: // 난폭한 전갑순순록
case 20215: // 용맹한 전갑순순록
case 20217: // 난폭한 전갑암순록
case 20218: // 용맹한 전갑암순록
case 20224: // 난폭한 전갑석룡자
case 20225: // 용맹한 전갑석룡자
case 20226: // 유니콘
case 20227:
break;
default:
return false;
}
}
if (pkVictim->IsNPC() || pkChr->IsNPC())
{
return true;
}
if (pkVictim->IsObserverMode() || pkChr->IsObserverMode())
return false;
{
BYTE bMapEmpire = SECTREE_MANAGER::instance().GetEmpireFromMapIndex(pkChr->GetMapIndex());
if ( pkChr->GetPKMode() == PK_MODE_PROTECT && pkChr->GetEmpire() == bMapEmpire ||
pkVictim->GetPKMode() == PK_MODE_PROTECT && pkVictim->GetEmpire() == bMapEmpire )
{
return false;
}
}
if (pkChr->GetEmpire() != pkVictim->GetEmpire())
{
if ( LC_IsYMIR() == true || LC_IsKorea() == true )
{
if ( pkChr->GetPKMode() == PK_MODE_PROTECT || pkVictim->GetPKMode() == PK_MODE_PROTECT )
{
return false;
}
}
return true;
//.........这里部分代码省略.........
示例12: onDead
void CThreeWayWar::onDead(LPCHARACTER pChar, LPCHARACTER pkKiller)
{
if (false == pChar->IsPC())
return;
if (GM_PLAYER != pChar->GetGMLevel() && false == test_server)
return;
if (-1 == GetRegenFlag())
return;
DecreaseReviveTokenForPlayer( pChar->GetPlayerID() );
if (false == IsSungZiMapIndex(pChar->GetMapIndex()))
return;
if (NULL == pkKiller || true != pkKiller->IsPC())
return;
// °°Ає Б¦±№Ає °и»кЗПБц ѕКАЅ
if (pChar->GetEmpire() == pkKiller->GetEmpire())
return;
int nKillScore = GetKillScore(pkKiller->GetEmpire());
// Б¦±№ Еі ЅєДЪѕо°Ў -1АП°жїмґВ Е»¶ф±№°ЎА̱⶧№®їЎ БЎјц ГјЕ©ё¦ ЗПёй ѕИµИґЩ.
if (nKillScore >= 0)
{
nKillScore += GetKillValue(pChar->GetLevel());
SetKillScore(pkKiller->GetEmpire(), nKillScore);
}
if (nKillScore != 0 && (test_server || (nKillScore % 5) == 0))
{
char szBuf[64 + 1];
snprintf(szBuf, sizeof(szBuf), LC_TEXT("ЗцАз ЅєДЪѕо ЅЕјц±№:%d ГµБ¶±№:%d Бшіл±№:%d"),
GetKillScore(1), GetKillScore(2), GetKillScore(3));
SendNoticeMap(szBuf, GetSungziMapIndex(), false);
}
const int nVictoryScore = quest::CQuestManager::instance().GetEventFlag("threeway_war_kill_count");
if (0 == GetRegenFlag())
{
int nEliminatedEmpireCount = 0;
BYTE bLoseEmpire = 0;
for (int n = 1; n < 4; ++n)
{
if (nVictoryScore > GetKillScore(n))
{
++nEliminatedEmpireCount;
bLoseEmpire = n;
}
}
if (1 != nEliminatedEmpireCount)
return;
//----------------------
//Д«їоЖ® ГК±вИ
//----------------------
SetKillScore(1, 0);
SetKillScore(2, 0);
SetKillScore(3, 0);
SetKillScore(bLoseEmpire, -1);
quest::warp_all_to_map_my_empire_event_info * info;
//----------------------
//Е»¶ф±№°Ў ЕрАе ЅГЕ°±в : јєБцїЎј
//----------------------
info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>();
info->m_lMapIndexFrom = GetSungziMapIndex();
info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire);
info->m_x = EMPIRE_START_X(bLoseEmpire);
info->m_y = EMPIRE_START_Y(bLoseEmpire);
info->m_bEmpire = bLoseEmpire;
event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(10));
//----------------------
//Е»¶ф±№°Ў ЕрАе ЅГЕ°±в : Ел·ОїЎј
//----------------------
info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>();
info->m_lMapIndexFrom = GetPassMapIndex(bLoseEmpire);
info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire);
info->m_x = EMPIRE_START_X(bLoseEmpire);
info->m_y = EMPIRE_START_Y(bLoseEmpire);
info->m_bEmpire = bLoseEmpire;
event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(10));
//----------------------
//јєБцїЎ ЖГ±вґВ ±№°ЎїЎ ґлЗС АМѕЯ±вё¦ ё¶їХАМ ЗФ!
//----------------------
//.........这里部分代码省略.........
示例13: CreateTarget
void CTargetManager::CreateTarget(DWORD dwPID,
DWORD dwQuestIndex,
const char * c_pszTargetName,
int iType,
int iArg1,
int iArg2,
int iMapIndex,
const char * c_pszTargetDesc,
int iSendFlag)
{
sys_log(0, "CreateTarget : target pid %u quest %u name %s arg %d %d %d",
dwPID, dwQuestIndex, c_pszTargetName, iType, iArg1, iArg2);
LPCHARACTER pkChr = CHARACTER_MANAGER::instance().FindByPID(dwPID);
if (!pkChr)
{
sys_err("Cannot find character ptr by PID %u", dwPID);
return;
}
if (pkChr->GetMapIndex() != iMapIndex)
return;
itertype(m_map_kListEvent) it = m_map_kListEvent.find(dwPID);
if (it != m_map_kListEvent.end())
{
std::list<LPEVENT>::const_iterator it2 = it->second.begin();
while (it2 != it->second.end())
{
LPEVENT pkEvent = *(it2++);
TargetInfo* existInfo = dynamic_cast<TargetInfo*>(pkEvent->info);
if (NULL == existInfo)
{
sys_err("CreateTarget : event already exist, but have no info");
return;
}
if (existInfo->dwQuestIndex == dwQuestIndex && !strcmp(existInfo->szTargetName, c_pszTargetName))
{
sys_log(0, "CreateTarget : same target will be replaced");
if (existInfo->bSendToClient)
SendTargetDeletePacket(pkChr->GetDesc(), existInfo->iID);
if (c_pszTargetDesc)
{
strlcpy(existInfo->szTargetDesc, c_pszTargetDesc, sizeof(existInfo->szTargetDesc));
}
else
{
*existInfo->szTargetDesc = '\0';
}
existInfo->iID = ++m_iID;
existInfo->iType = iType;
existInfo->iArg1 = iArg1;
existInfo->iArg2 = iArg2;
existInfo->iOldX = 0;
existInfo->iOldY = 0;
existInfo->bSendToClient = iSendFlag ? true : false;
SendTargetCreatePacket(pkChr->GetDesc(), existInfo);
return;
}
}
}
TargetInfo* newInfo = AllocEventInfo<TargetInfo>();
if (c_pszTargetDesc)
{
strlcpy(newInfo->szTargetDesc, c_pszTargetDesc, sizeof(newInfo->szTargetDesc));
}
else
{
*newInfo->szTargetDesc = '\0';
}
newInfo->iID = ++m_iID;
// <Factor> Removed pkChr
//newInfo->pkChr = pkChr;
newInfo->dwPID = dwPID;
newInfo->dwQuestIndex = dwQuestIndex;
strlcpy(newInfo->szTargetName, c_pszTargetName, sizeof(newInfo->szTargetName));
newInfo->iType = iType;
newInfo->iArg1 = iArg1;
newInfo->iArg2 = iArg2;
newInfo->iMapIndex = iMapIndex;
newInfo->iOldX = 0;
newInfo->iOldY = 0;
newInfo->bSendToClient = iSendFlag ? true : false;
LPEVENT event = event_create(target_event, newInfo, PASSES_PER_SEC(1));
if (NULL != event)
{
//.........这里部分代码省略.........