本文整理汇总了C++中CItemContainer::GetTimerAdjusted方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemContainer::GetTimerAdjusted方法的具体用法?C++ CItemContainer::GetTimerAdjusted怎么用?C++ CItemContainer::GetTimerAdjusted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemContainer
的用法示例。
在下文中一共展示了CItemContainer::GetTimerAdjusted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPC_OnHearPetCmd
//.........这里部分代码省略.........
case PC_SPEAK:
NPC_OnPetCommand(true, pSrc);
return true;
case PC_EQUIP:
ItemEquipWeapon(false);
ItemEquipArmor(false);
break;
case PC_STATUS:
{
if ( !NPC_CanSpeak() )
break;
unsigned int iWage = pCharDef->GetHireDayWage();
CItemContainer *pBank = GetBank();
TCHAR *pszMsg = Str_GetTemp();
if ( NPC_IsVendor() )
{
CItemContainer *pCont = GetBank(LAYER_VENDOR_STOCK);
TCHAR *pszTemp1 = Str_GetTemp();
TCHAR *pszTemp2 = Str_GetTemp();
TCHAR *pszTemp3 = Str_GetTemp();
if ( iWage )
{
sprintf(pszTemp1, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_1), pBank->m_itEqBankBox.m_Check_Amount);
sprintf(pszTemp2, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_2), pBank->m_itEqBankBox.m_Check_Amount / iWage);
sprintf(pszTemp3, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_3), static_cast<int>(pCont->GetCount()));
}
else
{
sprintf(pszTemp1, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_1), pBank->m_itEqBankBox.m_Check_Amount);
sprintf(pszTemp2, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_4), pBank->m_itEqBankBox.m_Check_Restock, pBank->GetTimerAdjusted() / 60);
sprintf(pszTemp3, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_3), static_cast<int>(pCont->GetCount()));
}
sprintf(pszMsg, "%s %s %s", pszTemp1, pszTemp2, pszTemp3);
}
else if ( iWage )
{
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_DAYS_LEFT), pBank->m_itEqBankBox.m_Check_Amount / iWage);
}
Speak(pszMsg);
return true;
}
case PC_CASH:
{
// Give up my cash total.
if ( !NPC_IsVendor() )
return false;
CItemContainer *pBank = GetBank();
if ( pBank )
{
unsigned int iWage = pCharDef->GetHireDayWage();
TCHAR *pszMsg = Str_GetTemp();
if ( pBank->m_itEqBankBox.m_Check_Amount > iWage )
{
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_GETGOLD_1), pBank->m_itEqBankBox.m_Check_Amount - iWage);
pSrc->AddGoldToPack(pBank->m_itEqBankBox.m_Check_Amount - iWage);
pBank->m_itEqBankBox.m_Check_Amount = iWage;
}
else
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_GETGOLD_2), pBank->m_itEqBankBox.m_Check_Amount);
Speak(pszMsg);
示例2: NPC_OnHearPetCmd
//.........这里部分代码省略.........
break;
case PC_SPEAK:
NPC_PetConfirmCommand(true, pSrc);
return true;
case PC_EQUIP:
ItemEquipWeapon(false);
ItemEquipArmor(false);
break;
case PC_STATUS:
{
if ( !NPC_CanSpeak() )
break;
CItemContainer *pBank = GetContainerCreate(LAYER_BANKBOX);
TCHAR *pszMsg = Str_GetTemp();
if ( NPC_IsVendor() )
{
CItemContainer *pCont = GetContainerCreate(LAYER_VENDOR_STOCK);
TCHAR *pszTemp1 = Str_GetTemp();
TCHAR *pszTemp2 = Str_GetTemp();
TCHAR *pszTemp3 = Str_GetTemp();
if ( pCharDef->m_iHireDayWage )
{
sprintf(pszTemp1, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_1), pBank->m_itEqBankBox.m_Check_Amount);
sprintf(pszTemp2, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_2), pBank->m_itEqBankBox.m_Check_Amount / pCharDef->m_iHireDayWage);
sprintf(pszTemp3, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_3), static_cast<int>(pCont->GetCount()));
}
else
{
sprintf(pszTemp1, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_1), pBank->m_itEqBankBox.m_Check_Amount);
sprintf(pszTemp2, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_4), pBank->m_itEqBankBox.m_Check_Restock, pBank->GetTimerAdjusted() / 60);
sprintf(pszTemp3, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_STAT_GOLD_3), static_cast<int>(pCont->GetCount()));
}
sprintf(pszMsg, "%s %s %s", pszTemp1, pszTemp2, pszTemp3);
}
else if ( pCharDef->m_iHireDayWage )
{
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_DAYS_LEFT), pBank->m_itEqBankBox.m_Check_Amount / pCharDef->m_iHireDayWage);
}
Speak(pszMsg);
return true;
}
case PC_CASH:
{
// Give up my cash total.
if ( !NPC_IsVendor() )
return false;
CItemContainer *pBank = GetContainerCreate(LAYER_BANKBOX);
if ( pBank )
{
TCHAR *pszMsg = Str_GetTemp();
if ( pBank->m_itEqBankBox.m_Check_Amount > pCharDef->m_iHireDayWage )
{
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_GETGOLD_1), pBank->m_itEqBankBox.m_Check_Amount - pCharDef->m_iHireDayWage);
pSrc->AddGoldToPack(pBank->m_itEqBankBox.m_Check_Amount - pCharDef->m_iHireDayWage);
pBank->m_itEqBankBox.m_Check_Amount = pCharDef->m_iHireDayWage;
}
else
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_GETGOLD_2), pBank->m_itEqBankBox.m_Check_Amount);
Speak(pszMsg);
}