本文整理汇总了C++中LPCHARACTER::GetParty方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetParty方法的具体用法?C++ LPCHARACTER::GetParty怎么用?C++ LPCHARACTER::GetParty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetParty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例3: party_set_flag
int party_set_flag(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty() && lua_isstring(L, 1) && lua_isnumber(L, 2))
ch->GetParty()->SetFlag(lua_tostring(L, 1), (int)lua_tonumber(L, 2));
return 0;
}
示例4: party_get_max_level
int party_get_max_level(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty())
lua_pushnumber(L,ch->GetParty()->GetMemberMaxLevel());
else
lua_pushnumber(L, 1);
return 1;
}
示例5: party_get_flag
int party_get_flag(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (!ch->GetParty() || !lua_isstring(L, 1))
lua_pushnumber(L, 0);
else
lua_pushnumber(L, ch->GetParty()->GetFlag(lua_tostring(L, 1)));
return 1;
}
示例6: party_is_leader
int party_is_leader(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty() && ch->GetParty()->GetLeaderPID() == ch->GetPlayerID())
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
示例7: party_clear_ready
//
// "party" Lua functions
//
int party_clear_ready(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty())
{
FPartyClearReady f;
ch->GetParty()->ForEachNearMember(f);
}
return 0;
}
示例8: party_get_near_count
int party_get_near_count(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty())
lua_pushnumber(L, ch->GetParty()->GetNearMemberCount());
else
lua_pushnumber(L, 0);
return 1;
}
示例9: party_get_leader_pid
int party_get_leader_pid(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty())
{
lua_pushnumber(L, ch->GetParty()->GetLeaderPID());
}
else
{
lua_pushnumber(L, -1);
}
return 1;
}
示例10: party_show_cinematic
int party_show_cinematic(lua_State* L)
{
if (!lua_isstring(L, 1))
return 0;
sys_log(0, "CINEMA %s", lua_tostring(L, 1));
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (ch->GetParty())
{
FCinematicSender f(lua_tostring(L, 1));
ch->GetParty()->Update();
ch->GetParty()->ForEachNearMember(f);
}
return 0;
}
示例11: party_set_quest_flag
int party_set_quest_flag(lua_State* L)
{
CQuestManager & q = CQuestManager::instance();
FSetQuestFlag f;
f.flagname = q.GetCurrentPC()->GetCurrentQuestName() + "." + lua_tostring(L, 1);
f.value = (int) rint(lua_tonumber(L, 2));
LPCHARACTER ch = q.GetCurrentCharacterPtr();
if (ch->GetParty())
ch->GetParty()->ForEachOnlineMember(f);
else
f(ch);
return 0;
}
示例12: party_is_in_dungeon
int party_is_in_dungeon (lua_State* L)
{
CQuestManager & q = CQuestManager::instance();
LPCHARACTER ch = q.GetCurrentCharacterPtr();
LPPARTY pParty = ch->GetParty();
if (pParty != NULL){
lua_pushboolean (L, pParty->GetDungeon() ? true : false);
return 1;
}
lua_pushboolean (L, false);
return 1;
}
示例13: 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();
}
示例14: SendMessage
void CParty::SendMessage(LPCHARACTER ch, BYTE bMsg, DWORD dwArg1, DWORD dwArg2)
{
if (ch->GetParty() != this)
{
sys_err("%s is not member of this party %p", ch->GetName(), this);
return;
}
switch (bMsg)
{
case PM_ATTACK:
break;
case PM_RETURN:
{
TMemberMap::iterator it = m_memberMap.begin();
while (it != m_memberMap.end())
{
TMember & rMember = it->second;
++it;
LPCHARACTER pkChr;
if ((pkChr = rMember.pCharacter) && ch != pkChr)
{
DWORD x = dwArg1 + number(-500, 500);
DWORD y = dwArg2 + number(-500, 500);
pkChr->SetVictim(NULL);
pkChr->SetRotationToXY(x, y);
if (pkChr->Goto(x, y))
{
LPCHARACTER victim = pkChr->GetVictim();
sys_log(0, "%s %p RETURN victim %p", pkChr->GetName(), get_pointer(pkChr), get_pointer(victim));
pkChr->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
}
}
}
}
break;
case PM_ATTACKED_BY: // 공격 받았음, 리더에게 도움을 요청
{
// 리더가 없을 때
LPCHARACTER pkChrVictim = ch->GetVictim();
if (!pkChrVictim)
return;
TMemberMap::iterator it = m_memberMap.begin();
while (it != m_memberMap.end())
{
TMember & rMember = it->second;
++it;
LPCHARACTER pkChr;
if ((pkChr = rMember.pCharacter) && ch != pkChr)
{
if (pkChr->CanBeginFight())
pkChr->BeginFight(pkChrVictim);
}
}
}
break;
case PM_AGGRO_INCREASE:
{
LPCHARACTER victim = CHARACTER_MANAGER::instance().Find(dwArg2);
if (!victim)
return;
TMemberMap::iterator it = m_memberMap.begin();
while (it != m_memberMap.end())
{
TMember & rMember = it->second;
++it;
LPCHARACTER pkChr;
if ((pkChr = rMember.pCharacter) && ch != pkChr)
{
pkChr->UpdateAggrPoint(victim, DAMAGE_TYPE_SPECIAL, dwArg1);
}
}
}
break;
}
}
示例15: party_is_party
int party_is_party(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
lua_pushboolean(L, ch->GetParty() ? 1 : 0);
return 1;
}