本文整理汇总了C++中Item::AddToWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::AddToWorld方法的具体用法?C++ Item::AddToWorld怎么用?C++ Item::AddToWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::AddToWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: item
bool Guild::BankTab::LoadItemFromDB(Field* fields)
{
uint8 slotId = fields[13].GetUInt8();
uint32 itemGuid = fields[14].GetUInt32();
uint32 itemEntry = fields[15].GetUInt32();
if (slotId >= GUILD_BANK_MAX_SLOTS)
{
TC_LOG_ERROR(LOG_FILTER_GUILD, "Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry);
if (!proto)
{
TC_LOG_ERROR(LOG_FILTER_GUILD, "Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
Item* pItem = NewItemOrBag(proto);
if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry))
{
TC_LOG_ERROR(LOG_FILTER_GUILD, "Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_tabId);
stmt->setUInt8 (2, slotId);
CharacterDatabase.Execute(stmt);
delete pItem;
return false;
}
pItem->AddToWorld();
m_items[slotId] = pItem;
return true;
}
示例2: OnGossipSelect
//.........这里部分代码省略.........
{
case CLASS_DEATH_KNIGHT:
if (player->getLevel() >= 55)
{
player->learnSpell(48778, false);
player->learnSpell(53428, false);
player->learnSpell(50977, false);
player->learnSpell(48743, false);
}
if (player->getLevel() >= 61)
{
player->learnSpell(3714, false);
}
if (player->getLevel() >= 65)
{
player->learnSpell(57330, false);
}
if (player->getLevel() >= 67)
{
player->learnSpell(56815, false);
}
break;
case CLASS_WARLOCK:
if (player->getLevel() >= 20)
{
player->learnSpell(5784, false);
}
if (player->getLevel() >= 40)
{
player->learnSpell(23161, false);
}
break;
case CLASS_PALADIN:
if (player->getFaction() == ALLIANCE)
{
if (player->getLevel() >= 20)
{
player->learnSpell(13819, false);
}
if (player->getLevel() >= 40)
{
player->learnSpell(23214, false);
}
}
if (player->getFaction() == HORDE)
{
if (player->getLevel() >= 20)
{
player->learnSpell(34769, false);
}
if (player->getLevel() >= 40)
{
player->learnSpell(34767, false);
}
}
break;
case CLASS_DRUID:
if(player->getLevel() >= 60)
{
player->learnSpell(33943, false);
}
if(player->getLevel() >= 71)
{
player->learnSpell(40120, false);
}
break;
default:
break;
}
player->GetSession()->SendTrainerList(pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->SendTalentWipeConfirm(pCreature->GetGUID());
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->GetSession()->SendListInventory(pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+15:
player->TeleportTo(0, -7634.04f, -4565.26f, 131.41f, 3.21f);
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF+16:
Item * item;
item->AddToWorld();
break;
default:
break;
}
return true;
}