Итем спустя 7 дней пропадает, но новый не появляется.
Должно работать так. Покупаем
Таинственное яйцо, через 7 дней оно превращается в
Треснутое яйцо у которого есть интересный лут.
Патч реализует работу данного итема.
PHP код:
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index e94bdf3..b5a7655 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -282,6 +282,19 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
+ if (GetEntry() == 39878)
+ {
+ owner->DestroyItem(GetBagSlot(), GetSlot(), true);
+ uint32 itemId = 39883;
+ uint8 count = 1;
+ ItemPosCountVec dest;
+ if(owner->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count) == EQUIP_ERR_OK)
+ {
+ Item* item = owner->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
+ owner->SendNewItem(item, count, true, false);
+ }
+ return;
+ }
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
return;
}
Спасибо
LordJZ за подсказку по коду!