示例#1
0
uint32 Bag::GetFreeSlots() const
{
    uint32 slots = 0;
    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (!m_bagslot[i])
            ++slots;

    return slots;
}
示例#2
0
uint8 Bag::GetSlotByItemGUID(ObjectGuid guid) const
{
    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i] != 0)
            if (m_bagslot[i]->GetObjectGuid() == guid)
                return i;

    return NULL_SLOT;
}
示例#3
0
uint32 Bag::GetItemCount(uint32 item, Item* eItem) const {
	Item *pItem;
	uint32 count = 0;
	for (uint32 i = 0; i < GetBagSize(); ++i) {
		pItem = m_bagslot[i];
		if (pItem && pItem != eItem && pItem->GetEntry() == item)
			count += pItem->GetCount();
	}

	if (eItem && eItem->GetProto()->GemProperties) {
		for (uint32 i = 0; i < GetBagSize(); ++i) {
			pItem = m_bagslot[i];
			if (pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color)
				count += pItem->GetGemCountWithID(item);
		}
	}

	return count;
}
示例#4
0
文件: Bag.cpp 项目: Archives/try
uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory) const
{
    uint32 count = 0;
    for(uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i])
            if (m_bagslot[i]->GetProto()->ItemLimitCategory == limitCategory )
                count += m_bagslot[i]->GetCount();

    return count;
}
示例#5
0
void Bag::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
{
    data->m_map = target->GetMapId();

    Item::BuildCreateUpdateBlockForPlayer(data, target);

    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i])
            m_bagslot[i]->BuildCreateUpdateBlockForPlayer(data, target);
}
示例#6
0
uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
{
    uint32 count = 0;

    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (m_bagslot[i])
            if (m_bagslot[i] != eItem && m_bagslot[i]->GetEntry() == item)
                count += m_bagslot[i]->GetCount();

    return count;
}
示例#7
0
void Bag::AddToWorld()
{
    Item::AddToWorld();

    for(uint32 i = 0;  i < GetBagSize(); ++i)
        if(m_bagslot[i])
            if(m_bagslot[i] != this )
                m_bagslot[i]->AddToWorld();
            else
                sLog.outString("Detector: WPE cheat - bug in bug");
}
示例#8
0
void Bag::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const
{
    Item::BuildCreateUpdateBlockForPlayer( data, target );

    for (uint32 i = 0; i < GetBagSize(); ++i)
        if(m_bagslot[i])
            if (!m_bagslot[i]->IsBag())
                m_bagslot[i]->BuildCreateUpdateBlockForPlayer( data, target );
            else
                sLog.outString("Detector: WPE cheat - bug in bug");
}
示例#9
0
uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) const
{
    uint32 count = 0;
    for (uint32 i = 0; i < GetBagSize(); ++i)
        if (Item* pItem = m_bagslot[i])
            if (pItem != skipItem)
                if (ItemTemplate const* pProto = pItem->GetTemplate())
                    if (pProto->ItemLimitCategory == limitCategory)
                        count += m_bagslot[i]->GetCount();

    return count;
}
示例#10
0
文件: Bag.cpp 项目: FoOtY/ClassyWoW
uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
{
    Item *pItem;
    uint32 count = 0;
    for(uint32 i=0; i < GetBagSize(); ++i)
    {
        pItem = m_bagslot[i];
        if( pItem && pItem != eItem && pItem->GetEntry() == item )
            count += pItem->GetCount();
    }

    return count;
}
示例#11
0
Item* Bag::GetItemByPos(uint8 slot) const {
	if (slot < GetBagSize())
		return m_bagslot[slot];

	return NULL;
}