Показать сообщение отдельно
Старый 15.05.2011, 00:36   #11
xex
Пользователь
 
Регистрация: 08.03.2010
Сообщений: 47
Сказал(а) спасибо: 45
Поблагодарили 29 раз(а) в 13 сообщениях
xex На верном пути
По умолчанию

Цитата:
Сообщение от NeatElves Посмотреть сообщение
Вот вам еще цепочки по году в реале.))

44623-44625-44627
44632-44626-44629
Спасибо, пофиксено:
PHP код:
--- Item.cpp
+++ Item.cpp
@@ -275,15 +275,20 @@
 {
     if (!
GetUInt32Value(ITEM_FIELD_DURATION))
         return;

     
//DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);

-    if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
+    if (
GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
     {
-        
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
+        
uint32 itemId GetEntry();
+        
uint8 bagSlot GetBagSlot();
+        
uint8 slot GetSlot();
+        
uint16 pos GetPos();
+        
owner->DestroyItem(bagSlotslottrue);
+        
owner->HandleDestroyItemReplace(itemIdbagSlotslotpos);
         return;
     }

     
SetUInt32Value(ITEM_FIELD_DURATIONGetUInt32Value(ITEM_FIELD_DURATION) - diff);
     
SetState(ITEM_CHANGEDowner);                          // save new time in database
 
}

--- 
Player.cpp
+++ Player.cpp
@@ -11539,12 +11539,69 @@
         
pItem->SetGuidValue(ITEM_FIELD_CONTAINEDObjectGuid());
         
pItem->SetSlotNULL_SLOT );
         
pItem->SetState(ITEM_REMOVEDthis);
     }
 }

+
void Player::HandleDestroyItemReplace(uint32 itemIduint8 baguint8 slotuint16 pos)
+{
+    if (!
itemId || !bag || !slot)
+        return;
+
+    
uint32 newItemId;
+    switch(
itemId)
+    {
+        case 
39878:             // Mysterious Unhatched Egg
+            newItemId 39883;  // Cracked Egg
+            break;
+        case 
44623:             // Bottle of Dalaran Red
+            newItemId 44625;
+            break;
+        case 
44625:             // Bottle of Aged Dalaran Red
+            newItemId 44627;  // Bottle of Peaked Dalaran Red
+            break;
+        case 
44626:             // Cask of Aged Dalaran Red
+            newItemId 44629;  // Cask of Peaked Dalaran Red
+            break;
+        case 
44632:             // Cask of Dalaran Red
+            newItemId 44626;
+            break;
+        case 
44717:             // Disgusting Jar
+            newItemId 44718;  // Ripe Disgusting Jar
+            break;
+        default:
+            return;
+    }
+
+    
ItemPosCountVec dest;
+    if (
IsInventoryPos(pos))
+    {
+        
uint8 msg CanStoreNewItem(bagslotdestnewItemId1);
+        if (
msg == EQUIP_ERR_OK)
+        {
+            
StoreNewItem(destnewItemId1true);
+            return;
+        }
+    }
+    else if (
IsBankPos(pos))
+    {
+        
ItempNewItem Item::CreateItem(newItemId1this);
+        if (!
pNewItem)
+            return;
+
+        
uint8 msg CanBankItem(bagslotdestpNewItemtrue);
+        if (
msg == EQUIP_ERR_OK)
+        {
+            
BankItem(destpNewItemtrue);
+            return;
+        }
+        else
+            
delete pNewItem;
+    }
+}
+
 
void Player::DestroyItemCountuint32 itemuint32 countbool updatebool unequip_check)
 {
     
DEBUG_LOG"STORAGE: DestroyItemCount item = %u, count = %u"itemcount);
     
uint32 remcount 0;

     
// in inventory

--- Player.h
+++ Player.h
@@ -1258,12 +1258,13 @@
         
void MoveItemFromInventory(uint8 baguint8 slotbool update);
                                                             
// in trade, auction, guild bank, mail....
         
void MoveItemToInventory(ItemPosCountVec const& destItempItembool updatebool in_characterInventoryDB false);
                                                             
// in trade, guild bank, mail....
         
void RemoveItemDependentAurasAndCastsItem pItem );
         
void DestroyItemuint8 baguint8 slotbool update );
+        
void HandleDestroyItemReplace(uint32 itemIduint8 baguint8 slotuint16 pos);
         
void DestroyItemCountuint32 itemuint32 countbool updatebool unequip_check false);
         
void DestroyItemCountItemitemuint32countbool update );
         
void DestroyConjuredItemsbool update );
         
void DestroyZoneLimitedItembool updateuint32 new_zone );
         
void SplitItemuint16 srcuint16 dstuint32 count );
         
void SwapItemuint16 srcuint16 dst ); 
xex вне форума   Ответить с цитированием