Пример #1
0
FakeResult Item::SetFakeDisplay(uint32 iEntry)
{
    if (!iEntry)
    {
        RemoveFakeDisplay();
        return FAKE_ERR_OK;
    }

    ItemTemplate const* myTmpl    = GetTemplate();
    ItemTemplate const* otherTmpl = sObjectMgr->GetItemTemplate(iEntry);

    if (!otherTmpl)
        return FAKE_ERR_CANT_FIND_ITEM;

    if (myTmpl->InventoryType != otherTmpl->InventoryType)
        return FAKE_ERR_DIFF_SLOTS;

    if (myTmpl->AllowableClass != otherTmpl->AllowableClass)
        return FAKE_ERR_DIFF_CLASS;

    if (myTmpl->AllowableRace != otherTmpl->AllowableRace)
        return FAKE_ERR_DIFF_RACE;

    if (otherTmpl->Quality == ITEM_QUALITY_LEGENDARY || otherTmpl->Quality == ITEM_QUALITY_POOR)
        return FAKE_ERR_WRONG_QUALITY;

    if (m_fakeDisplayEntry != iEntry)
    {
        (!m_fakeDisplayEntry) ? CharacterDatabase.PExecute("INSERT INTO fake_items VALUES (%u, %u)", GetGUIDLow(), iEntry) :
                                CharacterDatabase.PExecute("UPDATE fake_items SET fakeEntry = %u WHERE guid = %u", iEntry, GetGUIDLow());
        m_fakeDisplayEntry = iEntry;
    }

    return FAKE_ERR_OK;
}
Пример #2
0
FakeResult Item::SetFakeDisplay(uint32 iEntry)
{
    if (!iEntry)
    {
        RemoveFakeDisplay();
        return FAKE_ERR_OK;
    }

    ItemPrototype const* myTmpl    = GetProto();
    ItemPrototype const* otherTmpl = sObjectMgr->GetItemPrototype(iEntry);

    if (!otherTmpl)
        return FAKE_ERR_CANT_FIND_ITEM;

    if (myTmpl->InventoryType != otherTmpl->InventoryType)
        return FAKE_ERR_DIFF_SLOTS;

    /*if(myTmpl->SubClass != otherTmpl->SubClass)
        return FAKE_ERR_SUBCLASS;

    if (otherTmpl->Quality == ITEM_QUALITY_LEGENDARY || otherTmpl->Quality == ITEM_QUALITY_POOR)
        return FAKE_ERR_WRONG_QUALITY;*/

    if (m_fakeDisplayEntry != iEntry)
    {
        sObjectMgr->SetFekeItem(GetGUIDLow(), iEntry);

        (!m_fakeDisplayEntry) ? CharacterDatabase.PExecute("REPLACE INTO fake_items VALUES (%u, %u)", GetGUIDLow(), iEntry) :
                                CharacterDatabase.PExecute("UPDATE fake_items SET fakeEntry = %u WHERE guid = %u", iEntry, GetGUIDLow());
        m_fakeDisplayEntry = iEntry;
    }

    return FAKE_ERR_OK;
}
Пример #3
0
FakeResult Item::SetFakeDisplay(uint32 iEntry)
{
    if (!iEntry)
    {
        RemoveFakeDisplay();
        return FAKE_ERR_OK;
    }

    ItemPrototype const* myTmpl    = GetProto();
    ItemPrototype const* otherTmpl = sObjectMgr->GetItemPrototype(iEntry);

    if (!otherTmpl)
        return FAKE_ERR_CANT_FIND_ITEM;

    if (myTmpl->InventoryType != otherTmpl->InventoryType)
        return FAKE_ERR_DIFF_SLOTS;

    if (m_fakeDisplayEntry != iEntry)
    {
        sObjectMgr->SetFekeItem(GetGUIDLow(), iEntry);

        (!m_fakeDisplayEntry) ? CharacterDatabase.PExecute("INSERT INTO fake_items VALUES (%u, %u)", GetGUIDLow(), iEntry) :
                                CharacterDatabase.PExecute("UPDATE fake_items SET fakeEntry = %u WHERE guid = %u", iEntry, GetGUIDLow());
        m_fakeDisplayEntry = iEntry;
    }

    return FAKE_ERR_OK;
}
Пример #4
0
void Item::DeleteFromDB(SQLTransaction& trans)
{
	RemoveFakeDisplay();
    DeleteFromDB(trans, GetGUIDLow());

    // Delete the items if this is a container
    if (!loot.isLooted())
        ItemContainerDeleteLootMoneyAndLootItemsFromDB();
}
Пример #5
0
void Item::DeleteFromDB(SQLTransaction& trans)
{
    RemoveFakeDisplay();
    DeleteFromDB(trans, GetGUIDLow());
}