本文整理汇总了C++中CItem::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CItem::GetName方法的具体用法?C++ CItem::GetName怎么用?C++ CItem::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItem
的用法示例。
在下文中一共展示了CItem::GetName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPC_StablePetRetrieve
bool CChar::NPC_StablePetRetrieve( CChar * pCharPlayer )
{
ADDTOCALLSTACK("CChar::NPC_StablePetRetrieve");
// Get pets for this person from my inventory.
// May want to put up a menu ???
if ( !m_pNPC || m_pNPC->m_Brain != NPCBRAIN_STABLE )
return false;
int iCount = 0;
CItem *pItemNext = NULL;
for ( CItem *pItem = GetBank()->GetContentHead(); pItem != NULL; pItem = pItemNext )
{
pItemNext = pItem->GetNext();
if ( pItem->IsType(IT_FIGURINE) && pItem->m_uidLink == pCharPlayer->GetUID() )
{
if ( !pCharPlayer->Use_Figurine(pItem) )
{
tchar *pszTemp = Str_GetTemp();
sprintf(pszTemp, g_Cfg.GetDefaultMsg(DEFMSG_NPC_STABLEMASTER_CLAIM_FOLLOWER), pItem->GetName());
Speak(pszTemp);
return true;
}
pItem->Delete();
iCount++;
}
}
Speak(g_Cfg.GetDefaultMsg((iCount > 0) ? DEFMSG_NPC_STABLEMASTER_CLAIM : DEFMSG_NPC_STABLEMASTER_CLAIM_NOPETS));
return true;
}
示例2: AddItem
void CInventory::AddItem(CItem _item)
{
bool active = true;
for (int i = 0; i < sizeOfInventory; i++)
{
if (strcmp(GetInventory()[i].GetName(), _item.GetName()) == 0)
{
GetInventory()[i].IncreaseCount();
active = false;
}
}
if(active)
{
AddElement(inventory, sizeOfInventory, sizeOfInventory - 1, _item);
}
}
示例3: RemoveItem
void CInventory::RemoveItem(CItem _item)
{
int position;
for (int i = 0; i < sizeOfInventory; i++)
{
if (strcmp(GetInventory()[i].GetName(), _item.GetName()) == 0)
{
position = i;
if (GetInventory()[i].GetCount() == 1)
{
RemoveElement(inventory, sizeOfInventory, position);
}
else
{
GetInventory()[i].DecreaseCount();
}
}
}
}
示例4: Cmd_EditItem
void CClient::Cmd_EditItem( CObjBase *pObj, int iSelect )
{
ADDTOCALLSTACK("CClient::Cmd_EditItem");
// ARGS:
// iSelect == -1 = setup.
// m_Targ_Text = what are we doing to it ?
//
if ( !pObj )
return;
CContainer *pContainer = dynamic_cast<CContainer *>(pObj);
if ( !pContainer )
{
addGumpDialogProps(pObj->GetUID());
return;
}
if ( iSelect == 0 ) // cancelled
return;
if ( iSelect > 0 ) // we selected an item
{
if ( static_cast<size_t>(iSelect) >= COUNTOF(m_tmMenu.m_Item) )
return;
if ( m_Targ_Text.IsEmpty() )
addGumpDialogProps(m_tmMenu.m_Item[static_cast<size_t>(iSelect)]);
else
OnTarg_Obj_Set(CGrayUID(m_tmMenu.m_Item[static_cast<size_t>(iSelect)]).ObjFind());
return;
}
CMenuItem item[minimum(COUNTOF(m_tmMenu.m_Item), MAX_MENU_ITEMS)]; // Most as we want to display at one time.
item[0].m_sText.Format("Contents of %s", pObj->GetName());
size_t count = 0;
for ( CItem *pItem = pContainer->GetContentHead(); pItem != NULL; pItem = pItem->GetNext() )
{
count++;
m_tmMenu.m_Item[count] = pItem->GetUID();
item[count].m_sText = pItem->GetName();
ITEMID_TYPE idi = pItem->GetDispID();
item[count].m_id = static_cast<WORD>(idi);
item[count].m_color = 0;
if ( !pItem->IsType(IT_EQ_MEMORY_OBJ) )
{
HUE_TYPE wHue = pItem->GetHue();
if ( wHue != 0 )
{
wHue = (wHue == 1 ? 0x7FF : wHue - 1);
item[count].m_color = wHue;
}
}
if ( count >= (COUNTOF(item) - 1) )
break;
}
ASSERT(count < COUNTOF(item));
addItemMenu(CLIMODE_MENU_EDIT, item, count, pObj);
}
示例5: OnTick
//.........这里部分代码省略.........
// regen all creatures and do AI
ProfileTask charactersTask(PROFILE_CHARS);
//pChar = STATIC_CAST <CChar*>( m_Chars_Active.GetHead());
CChar * pCharNext = NULL;
CChar * pChar = dynamic_cast <CChar*>( m_Chars_Active.GetHead());
for ( ; pChar != NULL; pChar = pCharNext )
{
EXC_TRYSUB("TickChar");
pCharNext = pChar->GetNext();
if (( fEnvironChange ) && ( IsTrigUsed(TRIGGER_ENVIRONCHANGE) ))
pChar->OnTrigger(CTRIG_EnvironChange, pChar);
if ( pChar->IsClient())
{
CClient * pClient = pChar->GetClient();
ASSERT( pClient );
if ( sound )
pClient->addSound(sound, pChar);
if ( fLightChange && ! pChar->IsStatFlag( STATF_DEAD | STATF_NightSight ))
pClient->addLight();
if ( fWeatherChange )
pClient->addWeather(GetWeather());
if ( iRegionPeriodic && pChar->m_pArea )
{
if (( iRegionPeriodic == 2 )&&( IsTrigUsed(TRIGGER_REGPERIODIC) ))
{
pChar->m_pArea->OnRegionTrigger( pChar, RTRIG_REGPERIODIC );
iRegionPeriodic--;
}
if ( IsTrigUsed(TRIGGER_CLIPERIODIC) )
pChar->m_pArea->OnRegionTrigger( pChar, RTRIG_CLIPERIODIC );
}
}
// Can only die on your own tick.
if ( !pChar->OnTick() )
pChar->Delete();
EXC_CATCHSUB("Sector");
EXC_DEBUGSUB_START;
CPointMap pt = GetBasePoint();
g_Log.EventDebug("char 0%lx '%s'\n", static_cast<DWORD>(pChar->GetUID()), pChar->GetName());
g_Log.EventDebug("sector #%d [%d,%d,%d,%d]\n", GetIndex(), pt.m_x, pt.m_y, pt.m_z, pt.m_map);
EXC_DEBUGSUB_END;
}
// decay items on ground = time out spells / gates etc.. etc..
// No need to check these so often !
ProfileTask itemsTask(PROFILE_ITEMS);
CItem * pItemNext = NULL;
CItem * pItem = dynamic_cast <CItem*>( m_Items_Timer.GetHead());
for ( ; pItem != NULL; pItem = pItemNext )
{
EXC_TRYSUB("TickItem");
pItemNext = pItem->GetNext();
EXC_SETSUB("TimerExpired");
if ( pItem->IsTimerExpired() )
{
EXC_SETSUB("ItemTick");
if ( !pItem->OnTick() )
{
EXC_SETSUB("ItemDelete");
pItem->Delete();
}
else
{
EXC_SETSUB("TimerExpired2");
if ( pItem->IsTimerExpired() ) // forgot to clear the timer.? strange.
{
EXC_SETSUB("SetTimeout");
pItem->SetTimeout(-1);
}
}
}
EXC_SETSUB("UpdateFlags");
pItem->OnTickStatusUpdate();
#ifdef _WIN32
EXC_CATCHSUB("Sector");
EXC_DEBUGSUB_START;
CPointMap pt = GetBasePoint();
g_Log.EventError("item 0%lx '%s' [timer=%lld, type=%lld]\n", static_cast<DWORD>(pItem->GetUID()), pItem->GetName(), pItem->GetTimerAdjusted(), static_cast<int>(pItem->GetType()));
g_Log.EventError("sector #%d [%d,%d,%d,%d]\n", GetIndex(), pt.m_x, pt.m_y, pt.m_z, pt.m_map);
EXC_DEBUGSUB_END;
#else
}
#ifndef _DEBUG
catch ( const CGrayError& e )
示例6: StrengthenItemByJewelOfHarmony
BOOL CJewelOfHarmonySystem::StrengthenItemByJewelOfHarmony(LPOBJ lpObj, int source, int target)
{
if ( this->m_bSystemStrengthenItem == FALSE )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 52)), lpObj->m_Index, 1);
return FALSE;
}
if ( source < 0 || source > MAIN_INVENTORY_SIZE-1 )
return FALSE;
if ( target < 0 || target > MAIN_INVENTORY_SIZE-1 )
return FALSE;
if ( lpObj->pInventory[source].IsItem() == FALSE )
return FALSE;
if ( lpObj->pInventory[target].IsItem() == FALSE )
return FALSE;
CItem * pSource = &lpObj->pInventory[source];
CItem * pTarget = &lpObj->pInventory[target];
if ( this->IsStrengthenByJewelOfHarmony(pTarget) == TRUE )
{
CLog.LogAdd("[JewelOfHarmony][Strengten Item] Already Strengtened [%s][%s]",
lpObj->AccountID, lpObj->Name);
return FALSE;
}
if (pTarget->IsSetItem() == TRUE )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 44)), lpObj->m_Index, 1);
CLog.LogAdd("[JewelOfHarmony][Strengten Item] SetItem not enable to Strengtened [%s][%s]",
lpObj->AccountID, lpObj->Name);
return FALSE;
}
int iItemType = this->_GetItemType(pTarget);
if ( iItemType == JEWELOFHARMONY_ITEM_TYPE_NULL )
{
CLog.LogAdd("[JewelOfHarmony][Strengten Item] Strenghten Fail [%s][%s] Name[%s] Type[%d] Serial[%d] Invalid ItemType[%d]",
lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iItemType);
return FALSE;
}
int iItemOption = this->_GetSelectRandomOption(pTarget, iItemType);
if ( iItemOption == AT_JEWELOFHARMONY_NOT_STRENGTHEN_ITEM )
{
CLog.LogAdd("[JewelOfHarmony][Strengten Item] Strenghten Fail - NOT OPTION [%s][%s] Name[%s] Type[%d] Serial[%d] ItemType[%d]",
lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iItemType);
return FALSE;
}
int iItemOptionLevel = this->m_itemOption[iItemType][iItemOption].iRequireLevel;
int iSuccessRate = rand() % 100;
if ( iSuccessRate >= this->m_iRateStrengthenSuccess )
{
CLog.LogAdd("[JewelOfHarmony][Strengten Item] Strenghten Fail [%s][%s] Name[%s] Type[%d] Serial[%d] Rate (%d/%d)",
lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iSuccessRate, this->m_iRateStrengthenSuccess);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 45)), lpObj->m_Index, 1);
return TRUE;
}
this->_MakeOption(pTarget, iItemOption, iItemOptionLevel);
CLog.LogAdd("[JewelOfHarmony][Strengten Item] Strenghten Success [%s][%s] Name[%s] Type[%d] Serial[%d] Rate (%d/%d) Option %d OptionLevel %d",
lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iSuccessRate, this->m_iRateStrengthenSuccess,
iItemOption, iItemOptionLevel);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 46)), lpObj->m_Index, 1);
gObjMakePreviewCharSet(lpObj->m_Index);
float levelitemdur = (float)ItemGetDurability(lpObj->pInventory[target].m_Type,
lpObj->pInventory[target].m_Level, lpObj->pInventory[target].IsExtItem(),
lpObj->pInventory[target].IsSetItem());
lpObj->pInventory[target].m_Durability = levelitemdur * lpObj->pInventory[target].m_Durability / lpObj->pInventory[target].m_BaseDurability;
lpObj->pInventory[target].Convert(lpObj->pInventory[target].m_Type,
lpObj->pInventory[target].m_Option1, lpObj->pInventory[target].m_Option2,
lpObj->pInventory[target].m_Option3, lpObj->pInventory[target].m_NewOption,
lpObj->pInventory[target].m_SetOption, lpObj->pInventory[target].m_ItemOptionEx,lpObj->pInventory[target].m_ItemSocket);
return TRUE;
}
示例7: RestoreStrengthenItem
BOOL CJewelOfHarmonySystem::RestoreStrengthenItem(LPOBJ lpObj)
{
if ( this->m_bSystemRestoreStrengthen != TRUE )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13,54)), lpObj->m_Index, 1);
return TRUE;
}
lpObj->ChaosLock = TRUE;
PMSG_CHAOSMIXRESULT pMsg;
C1HeadSet((LPBYTE)&pMsg, 0x86, sizeof(pMsg));
pMsg.Result = 0;
int iStrengtenItemCount = 0;
int iInvalidItemCount = 0;
CItem * pItem = NULL;
for ( int n=0;n<CHAOS_BOX_SIZE;n++)
{
if ( lpObj->pChaosBox[n].IsItem() == TRUE )
{
if ( this->IsStrengthenByJewelOfHarmony(&lpObj->pChaosBox[n]) == TRUE )
{
iStrengtenItemCount++;
pItem = &lpObj->pChaosBox[n];
}
}
}
if ( iStrengtenItemCount != 1 )
{
gSendProto.DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
lpObj->ChaosLock = FALSE;
return FALSE;
}
int iItemOption = this->GetItemStrengthenOption(pItem);
int iItemOptionLevel = this->_GetItemOptionLevel(pItem);
int JEWEL_OF_HARMONY_RETORE_NEEDZEN = this->_GetZenForRestoreItem(pItem);
if ( JEWEL_OF_HARMONY_RETORE_NEEDZEN < 0 )
{
gSendProto.DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
lpObj->ChaosLock = FALSE;
return FALSE;
}
int iChaosTaxMoney = JEWEL_OF_HARMONY_RETORE_NEEDZEN * g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index) / 100;
if ( iChaosTaxMoney < 0 )
iChaosTaxMoney = 0;
JEWEL_OF_HARMONY_RETORE_NEEDZEN += iChaosTaxMoney;
if ( JEWEL_OF_HARMONY_RETORE_NEEDZEN < 0 )
JEWEL_OF_HARMONY_RETORE_NEEDZEN = 0;
if ( lpObj->Money < JEWEL_OF_HARMONY_RETORE_NEEDZEN )
{
pMsg.Result = 2;
gSendProto.DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
lpObj->ChaosLock = FALSE;
return FALSE;
}
lpObj->Money -= JEWEL_OF_HARMONY_RETORE_NEEDZEN;
g_CastleSiegeSync.AddTributeMoney(iChaosTaxMoney);
GCMoneySend(lpObj->m_Index, lpObj->Money);
LogChaosItem(lpObj, "JewelOfHarmony][Restore Item");
CLog.LogAdd("[JewelOfHarmony][Restore Item] - Restore Start");
CLog.LogAdd("[JewelOfHarmony][Restore Item] Restore Strengtened Item [%s][%s] Name[%s] ItemType[%d] Serial[%d] OptionType[%d] OptionLevel [%d] Money %d-%d",
lpObj->AccountID, lpObj->Name, pItem->GetName(), pItem->m_Type,
pItem->m_Number, iItemOption, iItemOptionLevel,
lpObj->Money, JEWEL_OF_HARMONY_RETORE_NEEDZEN);
pItem->m_JewelOfHarmonyOption = 0;
GCUserChaosBoxSend(lpObj, 0);
this->ShowStrengthenOption(pItem);
lpObj->ChaosLock = FALSE;
return TRUE;
}
示例8: SmeltItemBySmeltingStone
BOOL CJewelOfHarmonySystem::SmeltItemBySmeltingStone(LPOBJ lpObj, int source, int target)
{
if ( this->m_bSystemSmeltingItem == FALSE )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13,51)), lpObj->m_Index, 1);
return FALSE;
}
if ( source < 0 || source > MAIN_INVENTORY_SIZE-1 )
return FALSE;
if ( target < 0 || target > MAIN_INVENTORY_SIZE-1 )
return FALSE;
if ( lpObj->pInventory[source].IsItem() == FALSE )
return FALSE;
if ( lpObj->pInventory[target].IsItem() == FALSE )
return FALSE;
CItem * pSource = &lpObj->pInventory[source];
CItem * pTarget = &lpObj->pInventory[target];
if ( !this->IsStrengthenByJewelOfHarmony(pTarget) )
{
CLog.LogAdd("[JewelOfHarmony][Smelt Item] Not Strengten Item [%s][%s]",
lpObj->AccountID, lpObj->Name);
return FALSE;
}
int iItemOptionLevel = this->_GetItemOptionLevel(pTarget);
if ( iItemOptionLevel >= pTarget->m_Level )
{
if ( iItemOptionLevel == 13 )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13,41)), lpObj->m_Index, 1);
}
else
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13,40)), lpObj->m_Index, 1);
}
CLog.LogAdd("[JewelOfHarmony][Smelt Item] Already Have Max OptionLevel [%s][%s] OptionLevel [%d] ItemLevel [%d]",
lpObj->AccountID, lpObj->Name, iItemOptionLevel, pTarget->m_Level);
return FALSE;
}
if ( this->_GetItemType(pTarget) == JEWELOFHARMONY_ITEM_TYPE_WEAPON )
{
if ( this->GetItemStrengthenOption(pTarget) == AT_JEWELOFHARMONY_WEAPON_IMPROVE_MINATTACKDAMAGE )
{
int iNextLevel = this->_GetItemOptionLevel(pTarget)+1;
BYTE iValue = this->m_itemOption[JEWELOFHARMONY_ITEM_TYPE_WEAPON][AT_JEWELOFHARMONY_WEAPON_IMPROVE_MINATTACKDAMAGE].iItemEffectValue[iNextLevel];
if ( (pTarget->m_DamageMin+iValue) > (pTarget->m_DamageMax-1) )
{
GCServerMsgStringSend(lMsg.Get(MSGGET(13,41)), lpObj->m_Index, 1);
return FALSE;
}
}
}
int iSuccessRate = rand() % 100;
int iRateSmeltingSuccess = 0;
BOOL bIsNormalSmeltingStone = this->_IsJewelOfHarmonySmeltingItemNor(pSource->m_Type);
if ( bIsNormalSmeltingStone == TRUE )
iRateSmeltingSuccess = this->m_iRateSmeltingSuccessNor;
else
iRateSmeltingSuccess = this->m_iRateSmeltingSuccessExt;
if ( iSuccessRate >= iRateSmeltingSuccess )
{
int iItemOptionNewLevel = _GetItemOptionRequireLevel(pTarget);
pTarget->m_JewelOfHarmonyOption = pTarget->m_JewelOfHarmonyOption & 0xF0;
pTarget->m_JewelOfHarmonyOption |= iItemOptionNewLevel & 0x0F;
this->ShowStrengthenOption(pTarget);
CLog.LogAdd("[JewelOfHarmony][Smelt Item] Smelt Item Fail by Normal[%d] [%s][%s] Name[%s] Type [%d] Serial [%d] Rate(%d/%d) Level(%d->%d)",
bIsNormalSmeltingStone, lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iSuccessRate, iRateSmeltingSuccess, iItemOptionLevel, iItemOptionNewLevel);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 47)), lpObj->m_Index, 1);
}
else
{
int iItemOptionNewLevel = iItemOptionLevel+1;
pTarget->m_JewelOfHarmonyOption = pTarget->m_JewelOfHarmonyOption & 0xF0;
pTarget->m_JewelOfHarmonyOption |= iItemOptionNewLevel & 0x0F;
this->ShowStrengthenOption(pTarget);
CLog.LogAdd("[JewelOfHarmony][Smelt Item] Smelt Item Success by Normal[%d] [%s][%s] Name[%s] Type [%d] Serial [%d] Rate(%d/%d) Level(%d->%d)",
bIsNormalSmeltingStone, lpObj->AccountID, lpObj->Name, pTarget->GetName(), pTarget->m_Type,
pTarget->m_Number, iSuccessRate, iRateSmeltingSuccess, iItemOptionLevel, iItemOptionNewLevel & 0x0F);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 48)), lpObj->m_Index, 1);
}
return TRUE;
//.........这里部分代码省略.........
示例9: Use_CarveCorpse
void CChar::Use_CarveCorpse( CItemCorpse * pCorpse )
{
ADDTOCALLSTACK("CChar::Use_CarveCorpse");
CREID_TYPE CorpseID = pCorpse->m_itCorpse.m_BaseID;
CCharBase *pCorpseDef = CCharBase::FindCharBase(CorpseID);
if ( !pCorpseDef || pCorpse->m_itCorpse.m_carved )
{
SysMessageDefault(DEFMSG_CARVE_CORPSE_NOTHING);
return;
}
CChar *pChar = pCorpse->m_uidLink.CharFind();
CPointMap pnt = pCorpse->GetTopLevelObj()->GetTopPoint();
UpdateAnimate(ANIM_BOW);
if ( pCorpse->m_TagDefs.GetKeyNum("BLOOD", true) )
{
CItem *pBlood = CItem::CreateBase(ITEMID_BLOOD4);
ASSERT(pBlood);
pBlood->SetHue(pCorpseDef->m_wBloodHue);
pBlood->MoveToDecay(pnt, 5 * TICK_PER_SEC);
}
size_t iItems = 0;
for ( size_t i = 0; i < pCorpseDef->m_BaseResources.GetCount(); i++ )
{
long long iQty = pCorpseDef->m_BaseResources[i].GetResQty();
RESOURCE_ID rid = pCorpseDef->m_BaseResources[i].GetResourceID();
if ( rid.GetResType() != RES_ITEMDEF )
continue;
ITEMID_TYPE id = static_cast<ITEMID_TYPE>(rid.GetResIndex());
if ( id == ITEMID_NOTHING )
break;
iItems++;
CItem *pPart = CItem::CreateTemplate(id, NULL, this);
ASSERT(pPart);
switch ( pPart->GetType() )
{
case IT_FOOD:
case IT_FOOD_RAW:
case IT_MEAT_RAW:
SysMessageDefault(DEFMSG_CARVE_CORPSE_MEAT);
//pPart->m_itFood.m_MeatType = CorpseID;
break;
case IT_HIDE:
SysMessageDefault(DEFMSG_CARVE_CORPSE_HIDES);
//pPart->m_itSkin.m_creid = CorpseID;
if ( (g_Cfg.m_iRacialFlags & RACIALF_HUMAN_WORKHORSE) && IsHuman() ) // humans always find 10% bonus when gathering hides, ores and logs (Workhorse racial trait)
iQty = iQty * 110 / 100;
break;
case IT_FEATHER:
SysMessageDefault(DEFMSG_CARVE_CORPSE_FEATHERS);
//pPart->m_itSkin.m_creid = CorpseID;
break;
case IT_WOOL:
SysMessageDefault(DEFMSG_CARVE_CORPSE_WOOL);
//pPart->m_itSkin.m_creid = CorpseID;
break;
/*case IT_DRAGON_SCALE: // TO-DO (typedef IT_DRAGON_SCALE doesn't exist yet)
SysMessageDefault(DEFMSG_CARVE_CORPSE_SCALES);
//pPart->m_itSkin.m_creid = CorpseID;
break;*/
default:
break;
}
if ( iQty > 1 )
pPart->SetAmount(static_cast<unsigned int>(iQty));
if ( pChar && pChar->m_pPlayer )
{
TCHAR *pszMsg = Str_GetTemp();
sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_CORPSE_NAME), pPart->GetName(), pChar->GetName());
pPart->SetName(pszMsg);
pPart->m_uidLink = pChar->GetUID();
pPart->MoveToDecay(pnt, pPart->GetDecayTime());
continue;
}
pCorpse->ContentAdd(pPart);
}
if ( iItems < 1 )
SysMessageDefault(DEFMSG_CARVE_CORPSE_NOTHING);
CheckCorpseCrime(pCorpse, false, false);
pCorpse->m_itCorpse.m_carved = 1; // mark as been carved
pCorpse->m_itCorpse.m_uidKiller = GetUID(); // by you
if ( pChar && pChar->m_pPlayer )
pCorpse->SetTimeout(0); // reset corpse timer to make it turn bones
}
示例10: ProcUpgrade
//.........这里部分代码省略.........
if( rand()%2 )
{
ItemTarget->m_NewOption |= 0x10;
}
}
}
if( ItemTarget->m_Option3 >= 7 )
{
return false;
}
if( rand() % 10000 < Rate )
{
ItemTarget->m_Option3++;
}
else
{
ItemTarget->m_Option3 = 0;
}
}
else if( JewelCode == ITEMGET(14, 42) )
{
if( g_kJewelOfHarmonySystem.m_bSystemSmeltingItem == false )
{
return false;
}
if( g_kJewelOfHarmonySystem.IsStrengthenByJewelOfHarmony(ItemTarget) )
{
LogAddTD("[JewelOfHarmony][Strengten Item] Already Strengtened [%s][%s]",
lpUser->AccountID, lpUser->Name);
return false;
}
int iItemType = g_kJewelOfHarmonySystem._GetItemType(ItemTarget);
if( iItemType == JEWELOFHARMONY_ITEM_TYPE_NULL )
{
LogAddTD("[JewelOfHarmony][Strengten Item] Strenghten Fail [%s][%s] Name[%s] Type[%d] Serial[%d] Invalid ItemType[%d]",
lpUser->AccountID, lpUser->Name, ItemTarget->GetName(), ItemTarget->m_Type,
ItemTarget->m_Number, iItemType);
return false;
}
int iItemOption = g_kJewelOfHarmonySystem._GetSelectRandomOption(ItemTarget, iItemType);
if( iItemOption == AT_JEWELOFHARMONY_NOT_STRENGTHEN_ITEM )
{
LogAddTD("[JewelOfHarmony][Strengten Item] Strenghten Fail - NOT OPTION [%s][%s] Name[%s] Type[%d] Serial[%d] ItemType[%d]",
lpUser->AccountID, lpUser->Name, ItemTarget->GetName(), ItemTarget->m_Type,
ItemTarget->m_Number, iItemType);
return false;
}
int iItemOptionLevel = g_kJewelOfHarmonySystem.m_itemOption[iItemType][iItemOption].iRequireLevel;
if( rand() % 10000 < Rate )
{
g_kJewelOfHarmonySystem._MakeOption(ItemTarget, iItemOption, iItemOptionLevel);
LogAddTD("[JewelOfHarmony][Strengten Item] Strenghten Success [%s][%s] Name[%s] Type[%d] Serial[%d] Rate (%d/%d) Option %d OptionLevel %d",
lpUser->AccountID, lpUser->Name, ItemTarget->GetName(), ItemTarget->m_Type,
ItemTarget->m_Number, Rate, Rate,
iItemOption, iItemOptionLevel);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 46)), lpUser->m_Index, 1);
}
else
{
LogAddTD("[JewelOfHarmony][Strengten Item] Strenghten Fail [%s][%s] Name[%s] Type[%d] Serial[%d] Rate (%d/%d)",
lpUser->AccountID, lpUser->Name, ItemTarget->GetName(), ItemTarget->m_Type,
ItemTarget->m_Number, Rate, Rate);
GCServerMsgStringSend(lMsg.Get(MSGGET(13, 45)), lpUser->m_Index, 1);
}
}
gObjMakePreviewCharSet(lpUser->m_Index);
float levelitemdur = (float)ItemGetDurability(lpUser->pInventory[TargetPos].m_Type,
lpUser->pInventory[TargetPos].m_Level,
lpUser->pInventory[TargetPos].IsExtItem(),
lpUser->pInventory[TargetPos].IsSetItem());
lpUser->pInventory[TargetPos].m_Durability = levelitemdur * lpUser->pInventory[TargetPos].m_Durability / lpUser->pInventory[TargetPos].m_BaseDurability;
lpUser->pInventory[TargetPos].Convert(
lpUser->pInventory[TargetPos].m_Type,
lpUser->pInventory[TargetPos].m_Option1,
lpUser->pInventory[TargetPos].m_Option2,
lpUser->pInventory[TargetPos].m_Option3,
lpUser->pInventory[TargetPos].m_NewOption,
lpUser->pInventory[TargetPos].m_SetOption,
lpUser->pInventory[TargetPos].m_ItemOptionEx,0,-1,
CURRENT_DB_VERSION);
LogAddTD(lMsg.Get(557),lpUser->AccountID,lpUser->Name,lpUser->pInventory[JewelPos].m_Number,
lpUser->pInventory[TargetPos].GetName(),lpUser->pInventory[TargetPos].m_Number,
lpUser->pInventory[TargetPos].m_Level);
return true;
}