本文整理汇总了C++中LPCHARACTER类的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER类的具体用法?C++ LPCHARACTER怎么用?C++ LPCHARACTER使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LPCHARACTER类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: marriage_join_wedding
int marriage_join_wedding(lua_State* L)
{
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2))
{
sys_err("invalid player id for wedding map");
return 0;
}
DWORD pid1 = (DWORD) lua_tonumber(L, 1);
DWORD pid2 = (DWORD) lua_tonumber(L, 2);
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
marriage::TMarriage* pMarriage = marriage::CManager::instance().Get(pid1);
if (!pMarriage)
{
sys_err("pid[%d:%s] is not exist couple", ch->GetPlayerID(), ch->GetName());
return 0;
}
if (pMarriage->GetOther(pid1) != pid2)
{
sys_err("not married %u %u", pid1, pid2);
return 0;
}
//PREVENT_HACK
if ( ch->IsHack() )
return 0;
//END_PREVENT_HACK
pMarriage->WarpToWeddingMap(ch->GetPlayerID());
return 0;
}
示例2: operator
void operator() (LPCHARACTER ch)
{
if (ch->IsPC())
{
ch->ExitToSavedLocation();
}
}
示例3: while
void SECTREE::DecreasePC()
{
LPSECTREE_LIST::iterator it_tree = m_neighbor_list.begin();
while (it_tree != m_neighbor_list.end())
{
LPSECTREE tree = *it_tree++;
if (--tree->m_iPCCount <= 0)
{
if (tree->m_iPCCount < 0)
{
sys_err("tree pc count lower than zero (value %d coord %d %d)", tree->m_iPCCount, tree->m_id.coord.x, tree->m_id.coord.y);
tree->m_iPCCount = 0;
}
ENTITY_SET::iterator it_entity = tree->m_set_entity.begin();
while (it_entity != tree->m_set_entity.end())
{
LPENTITY pkEnt = *(it_entity++);
if (pkEnt->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = (LPCHARACTER) pkEnt;
ch->StopStateMachine();
}
}
}
}
}
示例4: marriage_wedding_music
int marriage_wedding_music(lua_State* L)
{
if (!lua_isboolean(L, 1))
{
sys_err("invalid argument 1 : must be boolean");
return 0;
}
if (!lua_isstring(L, 2))
{
sys_err("invalid argument 2 : must be string");
return 0;
}
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
marriage::TMarriage* pMarriage = marriage::CManager::instance().Get(ch->GetPlayerID());
if (!pMarriage)
{
sys_err("pid[%d:%s] is not exist couple", ch->GetPlayerID(), ch->GetName());
return 0;
}
if (pMarriage->pWeddingInfo)
{
marriage::WeddingMap* pWedding = marriage::WeddingManager::instance().Find(pMarriage->pWeddingInfo->dwMapIndex);
pWedding->SetMusic(
lua_toboolean(L, 1),
lua_tostring(L, 2)
);
}
return 0;
}
示例5: 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;
}
示例6: Enter
bool COXEventManager::Enter(LPCHARACTER pkChar)
{
if (GetStatus() == OXEVENT_FINISH)
{
sys_log(0, "OXEVENT : map finished. but char enter. %s", pkChar->GetName());
return false;
}
PIXEL_POSITION pos = pkChar->GetXYZ();
if (pos.x == 896500 && pos.y == 24600)
{
return EnterAttender(pkChar);
}
else if (pos.x == 896300 && pos.y == 28900)
{
return EnterAudience(pkChar);
}
else
{
sys_log(0, "OXEVENT : wrong pos enter %d %d", pos.x, pos.y);
return false;
}
return false;
}
示例7: SendPartyInfoAllToOne
void CParty::SendPartyInfoAllToOne(LPCHARACTER ch)
{
TMemberMap::iterator it;
TPacketGCPartyUpdate p;
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
if (!it->second.pCharacter)
{
DWORD pid = it->first;
memset(&p, 0, sizeof(p));
p.header = HEADER_GC_PARTY_UPDATE;
p.pid = pid;
p.percent_hp = 255;
p.role = it->second.bRole;
ch->GetDesc()->Packet(&p, sizeof(p));
continue;
}
it->second.pCharacter->BuildUpdatePartyPacket(p);
sys_log(2, "PARTY send info %s[%d] to %s[%d]", it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID(), ch->GetName(), (DWORD)ch->GetVID());
ch->GetDesc()->Packet(&p, sizeof(p));
}
}
示例8: GET_ATTACK_SPEED
DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
{
if (NULL == ch)
return 1000;
LPITEM item = ch->GetWear(WEAR_WEAPON);
DWORD default_bonus = SPEEDHACK_LIMIT_BONUS; // АЇµОё® °шјУ(±вє» 80)
DWORD riding_bonus = 0;
if (ch->IsRiding())
{
// №є°Ўё¦ ЕААёёй ГЯ°Ў°шјУ 50
riding_bonus = 50;
}
DWORD ani_speed = ani_attack_speed(ch);
DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
// ґЬ°ЛАЗ °жїм °шјУ 2№и
if (item && item->GetSubType() == WEAPON_DAGGER)
real_speed /= 2;
return real_speed;
}
示例9: pet_summon
// syntax in LUA: pet.summon(mob_vnum, pet's name, (bool)run to me from far away)
int pet_summon(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
LPITEM pItem = CQuestManager::instance().GetCurrentItem();
if (!ch || !petSystem || !pItem)
{
lua_pushnumber (L, 0);
return 1;
}
if (0 == petSystem)
{
lua_pushnumber (L, 0);
return 1;
}
// 소환수의 vnum
DWORD mobVnum= lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
// 소환수의 이름
const char* petName = lua_isstring(L, 2) ? lua_tostring(L, 2) : 0;
// 소환하면 멀리서부터 달려오는지 여부
bool bFromFar = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : false;
CPetActor* pet = petSystem->Summon(mobVnum, pItem, petName, bFromFar);
if (pet != NULL)
lua_pushnumber (L, pet->GetVID());
else
lua_pushnumber (L, 0);
return 1;
}
示例10: __proc_login_notice
static void __proc_login_notice(char *login, int on_time, int off_time)
{
//{ check player's name
LPDESC desc = DESC_MANAGER::instance().FindByLoginName(login);
if (NULL==desc) return;
LPCHARACTER ch = desc->GetCharacter();
if (NULL==ch) return;
//} check player's name
char on_time_string[64];
char off_time_string[64];
__sec_to_timestring(on_time, on_time_string, sizeof(on_time_string));
__sec_to_timestring(off_time, off_time_string, sizeof(off_time_string));
if (0==on_time)
{
ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("당신의 누적 오프라인 시간은 %s입니다."), off_time_string);
ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("당신의 누적 온라인 시간은 0이 되었습니다. 100% 효과를 얻으실 수 있습니다."));
return;
}
else
{
ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("당신의 누적 오프라인 시간은 %s이며, 누적 온라인 시간은 %s입니다."),
off_time_string, on_time_string);
}
}
示例11: GET_ATTACK_SPEED
DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
{
if (NULL == ch)
return 1000;
LPITEM item = ch->GetWear(WEAR_WEAPON);
DWORD default_bonus = SPEEDHACK_LIMIT_BONUS; // 유두리 공속(기본 80)
DWORD riding_bonus = 0;
if (ch->IsRiding())
{
// 뭔가를 탔으면 추가공속 50
riding_bonus = 50;
}
DWORD ani_speed = ani_attack_speed(ch);
DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
// 단검의 경우 공속 2배
if (item && item->GetSubType() == WEAPON_DAGGER)
real_speed /= 2;
return real_speed;
}
示例12: GetOwner
void CItem::AccessorySocketDegrade()
{
if (GetAccessorySocketGrade() > 0)
{
LPCHARACTER ch = GetOwner();
if (ch)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s¿¡ ¹ÚÇôÀÖ´ø º¸¼®ÀÌ »ç¶óÁý´Ï´Ù."), GetName());
}
ModifyPoints(false);
SetAccessorySocketGrade(GetAccessorySocketGrade()-1);
ModifyPoints(true);
int iDownTime = aiAccessorySocketDegradeTime[GetAccessorySocketGrade()];
if (test_server)
iDownTime /= 60;
SetAccessorySocketDownGradeTime(iDownTime);
if (iDownTime)
StartAccessorySocketExpireEvent();
}
}
示例13: GetLeaderCharacter
int CParty::ComputePartyBonusExpPercent()
{
if (GetNearMemberCount() <= 1)
return 0;
LPCHARACTER leader = GetLeaderCharacter();
int iBonusPartyExpFromItem = 0;
// UPGRADE_PARTY_BONUS
int iMemberCount=MIN(8, GetNearMemberCount());
if (leader && (leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP) || leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP_MALL)
|| leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP_GIFT) || leader->IsEquipUniqueGroup(10010)))
{
// 중국측 육도 적용을 확인해야한다.
if (g_iUseLocale)
{
iBonusPartyExpFromItem = 30;
}
else
{
iBonusPartyExpFromItem = KOR_aiUniqueItemPartyBonusExpPercentByMemberCount[iMemberCount];
}
}
if (g_iUseLocale)
return iBonusPartyExpFromItem + CHN_aiPartyBonusExpPercentByMemberCount[iMemberCount];
else
return iBonusPartyExpFromItem + KOR_aiPartyBonusExpPercentByMemberCount[iMemberCount];
// END_OF_UPGRADE_PARTY_BONUS
}
示例14: AddToCharacter
bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
{
assert(GetSectree() == NULL);
assert(m_pOwner == NULL);
WORD pos = Cell.cell;
BYTE window_type = Cell.window_type;
if (INVENTORY == window_type)
{
if (m_wCell >= INVENTORY_MAX_NUM && BELT_INVENTORY_SLOT_START > m_wCell)
{
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell);
return false;
}
}
else if (DRAGON_SOUL_INVENTORY == window_type)
{
if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
{
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell);
return false;
}
}
if (ch->GetDesc())
m_dwLastOwnerPID = ch->GetPlayerID();
event_cancel(&m_pkDestroyEvent);
ch->SetItem(TItemPos(window_type, pos), this);
m_pOwner = ch;
Save();
return true;
}
示例15: ActivateDragonSoul
bool DSManager::ActivateDragonSoul(LPITEM pItem)
{
if (NULL == pItem)
return false;
LPCHARACTER pOwner = pItem->GetOwner();
if (NULL == pOwner)
return false;
int deck_idx = pOwner->DragonSoul_GetActiveDeck();
if (deck_idx < 0)
return false;
if (INVENTORY_MAX_NUM + WEAR_MAX_NUM + DS_SLOT_MAX * deck_idx <= pItem->GetCell() &&
pItem->GetCell() < INVENTORY_MAX_NUM + WEAR_MAX_NUM + DS_SLOT_MAX * (deck_idx + 1))
{
if (IsTimeLeftDragonSoul(pItem) && !IsActiveDragonSoul(pItem))
{
char buf[128];
sprintf (buf, "LEFT TIME(%d)", LeftTime(pItem));
LogManager::instance().ItemLog(pOwner, pItem, "DS_ACTIVATE", buf);
pItem->ModifyPoints(true);
pItem->SetSocket(ITEM_SOCKET_DRAGON_SOUL_ACTIVE_IDX, 1);
pItem->StartTimerBasedOnWearExpireEvent();
}
return true;
}
else
return false;
}