本文整理汇总了C++中LPCHARACTER::GetRaceNum方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetRaceNum方法的具体用法?C++ LPCHARACTER::GetRaceNum怎么用?C++ LPCHARACTER::GetRaceNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetRaceNum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ani_attack_speed
DWORD ani_attack_speed(LPCHARACTER ch)
{
DWORD speed = 1000;
if (NULL == ch)
return speed;
LPITEM item = ch->GetWear(WEAR_WEAPON);
if (NULL == item)
return speed;
if (ITEM_WEAPON != item->GetType())
return speed;
int race = ch->GetRaceNum();
int weapon = item->GetSubType();
/*
dev_log(LOG_DEB0, "%s : (race,weapon) = (%s,%s) POINT_ATT_SPEED = %d",
ch->GetName(),
FN_race_name(race),
FN_weapon_type(weapon),
ch->GetPoint(POINT_ATT_SPEED));
*/
/* ЕхЗЪµрµе јТµеАЗ °жїм »пї¬Вь°ш°Э°ъ ЅВё¶ЅГ */
/* їА·щ°Ў ё№ѕЖ ЗСјХ°Л јУµµ·О »э°ўЗПАЪ */
if (weapon == WEAPON_TWO_HANDED)
weapon = WEAPON_SWORD;
return s_ANI.attack_speed(race, weapon);
}
示例2: ani_combo_speed
DWORD ani_combo_speed(LPCHARACTER ch, BYTE combo)
{
LPITEM item = ch->GetWear(WEAR_WEAPON);
if (NULL == item || combo > 8)
return 1000;
return s_ANI.attack_speed(ch->GetRaceNum(), item->GetSubType(), combo, ch->IsRiding());
}
示例3: 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;
}