Attempt to fix quests. Some other fixes.

This commit is contained in:
tomrus88 2009-05-07 02:04:43 +04:00
parent 2d61cc1e76
commit 908f41b031
13 changed files with 158 additions and 138 deletions

View file

@ -1366,11 +1366,38 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1); CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1);
uint8 dstbag, dstslot; uint8 srcbag, srcslot;
recv_data >> dstbag >> dstslot; recv_data >> srcbag >> srcslot;
// so we have itemGuid, bag and slot here... sLog.outDebug("Item " I64FMT ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot);
// if guid == 1, unequip item?
Item *item = _player->GetItemByGuid(itemGuid);
uint16 dstpos = i | (INVENTORY_SLOT_BAG_0 << 8);
if(!item)
{
Item *uItem = _player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if(!uItem)
continue;
ItemPosCountVec sDest;
uint8 msg = _player->CanStoreItem( NULL_BAG, NULL_SLOT, sDest, uItem, false );
if(msg == EQUIP_ERR_OK)
{
_player->RemoveItem(INVENTORY_SLOT_BAG_0, i, true);
_player->StoreItem( sDest, uItem, true );
}
else
_player->SendEquipError(msg, uItem, NULL);
continue;
}
if(item->GetPos() == dstpos)
continue;
_player->SwapItem(item->GetPos(), dstpos);
} }
WorldPacket data(SMSG_EQUIPMENT_SET_USE_RESULT, 1); WorldPacket data(SMSG_EQUIPMENT_SET_USE_RESULT, 1);

View file

@ -30,8 +30,8 @@ Corpse::Corpse(CorpseType type) : WorldObject()
{ {
m_objectType |= TYPEMASK_CORPSE; m_objectType |= TYPEMASK_CORPSE;
m_objectTypeId = TYPEID_CORPSE; m_objectTypeId = TYPEID_CORPSE;
// 3.1.0 - 0x148
m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_UNK1); m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION);
m_valuesCount = CORPSE_END; m_valuesCount = CORPSE_END;

View file

@ -30,8 +30,8 @@ DynamicObject::DynamicObject() : WorldObject()
{ {
m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectType |= TYPEMASK_DYNAMICOBJECT;
m_objectTypeId = TYPEID_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT;
// 3.1.0 - 0x48
m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HAS_POSITION); m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION);
m_valuesCount = DYNAMICOBJECT_END; m_valuesCount = DYNAMICOBJECT_END;
} }

View file

@ -40,8 +40,8 @@ GameObject::GameObject() : WorldObject()
{ {
m_objectType |= TYPEMASK_GAMEOBJECT; m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT;
// 3.1.0 - 0x348
m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_UNK1 | UPDATEFLAG_UNK2); m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION);
m_valuesCount = GAMEOBJECT_END; m_valuesCount = GAMEOBJECT_END;
m_respawnTime = 0; m_respawnTime = 0;

View file

@ -748,8 +748,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
} }
} }
// We may wish a better check, perhaps checking the real quest requirements if (!pQuest->GetReqItemsCount() && Completable)
if (RequestItemsText.empty())
{ {
SendQuestGiverOfferReward(pQuest, npcGUID, true); SendQuestGiverOfferReward(pQuest, npcGUID, true);
return; return;

View file

@ -233,7 +233,7 @@ Item::Item( )
{ {
m_objectType |= TYPEMASK_ITEM; m_objectType |= TYPEMASK_ITEM;
m_objectTypeId = TYPEID_ITEM; m_objectTypeId = TYPEID_ITEM;
// 3.1.0 - 0x08 // 3.1.2 - 0x10
m_updateFlag = UPDATEFLAG_HIGHGUID; m_updateFlag = UPDATEFLAG_HIGHGUID;
m_valuesCount = ITEM_END; m_valuesCount = ITEM_END;

View file

@ -163,7 +163,7 @@ enum EnchantmentSlot
MAX_ENCHANTMENT_SLOT = 12 MAX_ENCHANTMENT_SLOT = 12
}; };
#define MAX_VISIBLE_ITEM_OFFSET 18 // 18 fields per visible item (creator(2) + enchantments(13) + properties(1) + seed(1) + pad(1)) #define MAX_VISIBLE_ITEM_OFFSET 2 // 2 fields per visible item (entry+enchantment)
#define MAX_GEM_SOCKETS MAX_ITEM_PROTO_SOCKETS// (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT) and item proto size, equal value expected #define MAX_GEM_SOCKETS MAX_ITEM_PROTO_SOCKETS// (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT) and item proto size, equal value expected

View file

@ -453,7 +453,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2
} }
else else
{ {
if(flags & UPDATEFLAG_UNK1) if(flags & UPDATEFLAG_POSITION)
{ {
*data << uint8(0); // unk PGUID! *data << uint8(0); // unk PGUID!
*data << ((WorldObject*)this)->GetPositionX(); *data << ((WorldObject*)this)->GetPositionX();
@ -572,7 +572,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2
} }
// 0x200 // 0x200
if(flags & UPDATEFLAG_UNK2) if(flags & UPDATEFLAG_ROTATION)
{ {
*data << uint64(((GameObject*)this)->GetRotation()); *data << uint64(((GameObject*)this)->GetRotation());
} }

View file

@ -1478,9 +1478,9 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
const ItemPrototype * proto = objmgr.GetItemPrototype(item_id); const ItemPrototype * proto = objmgr.GetItemPrototype(item_id);
SpellItemEnchantmentEntry const *enchant = NULL; SpellItemEnchantmentEntry const *enchant = NULL;
for(uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot<=TEMP_ENCHANTMENT_SLOT; enchantSlot++) for(uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot)
{ {
uint32 enchantId = GetUInt32Value(visualbase+1+enchantSlot); uint32 enchantId = GetUInt16Value(visualbase + 1, enchantSlot);
if(enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)) if(enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId))
break; break;
} }
@ -9262,7 +9262,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
} }
// check free space for all items // check free space for all items
for (int k=0;k<count;k++) for (int k = 0; k < count; ++k)
{ {
Item *pItem = pItems[k]; Item *pItem = pItems[k];
@ -9293,7 +9293,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
{ {
bool b_found = false; bool b_found = false;
for(int t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; t++) for(int t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t)
{ {
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
@ -9305,7 +9305,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
} }
if (b_found) continue; if (b_found) continue;
for(int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; t++) for(int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t)
{ {
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
@ -9317,7 +9317,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
} }
if (b_found) continue; if (b_found) continue;
for(int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; t++) for(int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t)
{ {
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
@ -9329,7 +9329,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
} }
if (b_found) continue; if (b_found) continue;
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++) for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
{ {
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pBag ) if( pBag )
@ -9384,7 +9384,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
if (b_found) continue; if (b_found) continue;
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++) for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
{ {
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pBag ) if( pBag )
@ -9412,7 +9412,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
// search free slot // search free slot
bool b_found = false; bool b_found = false;
for(int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; t++) for(int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t)
{ {
if( inv_slot_items[t-INVENTORY_SLOT_ITEM_START] == 0 ) if( inv_slot_items[t-INVENTORY_SLOT_ITEM_START] == 0 )
{ {
@ -9424,7 +9424,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
if (b_found) continue; if (b_found) continue;
// search free slot in bags // search free slot in bags
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++) for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
{ {
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t ); pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
if( pBag ) if( pBag )
@ -10027,7 +10027,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
if (bag == INVENTORY_SLOT_BAG_0) if (bag == INVENTORY_SLOT_BAG_0)
{ {
m_items[slot] = pItem; m_items[slot] = pItem;
SetUInt64Value( (uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2) ), pItem->GetGUID() ); SetUInt64Value( PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID() );
pItem->SetUInt64Value( ITEM_FIELD_CONTAINED, GetGUID() ); pItem->SetUInt64Value( ITEM_FIELD_CONTAINED, GetGUID() );
pItem->SetUInt64Value( ITEM_FIELD_OWNER, GetGUID() ); pItem->SetUInt64Value( ITEM_FIELD_OWNER, GetGUID() );
@ -10225,19 +10225,11 @@ void Player::QuickEquipItem( uint16 pos, Item *pItem)
void Player::SetVisibleItemSlot(uint8 slot, Item *pItem) void Player::SetVisibleItemSlot(uint8 slot, Item *pItem)
{ {
// PLAYER_VISIBLE_ITEM_i_CREATOR // Size: 2
// PLAYER_VISIBLE_ITEM_i_0 // Size: 12
// entry // Size: 1
// inspected enchantments // Size: 6
// ? // Size: 5
// PLAYER_VISIBLE_ITEM_i_PROPERTIES // Size: 1 (property,suffix factor)
// PLAYER_VISIBLE_ITEM_i_PAD // Size: 1
// // = 16
if(pItem) if(pItem)
{ {
SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry());
SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), pItem->GetEnchantmentId(EnchantmentSlot(0))); SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT));
SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT));
} }
else else
{ {
@ -10258,7 +10250,7 @@ void Player::VisualizeItem( uint8 slot, Item *pItem)
sLog.outDebug( "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); sLog.outDebug( "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry());
m_items[slot] = pItem; m_items[slot] = pItem;
SetUInt64Value( (uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2) ), pItem->GetGUID() ); SetUInt64Value( PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID() );
pItem->SetUInt64Value( ITEM_FIELD_CONTAINED, GetGUID() ); pItem->SetUInt64Value( ITEM_FIELD_CONTAINED, GetGUID() );
pItem->SetUInt64Value( ITEM_FIELD_OWNER, GetGUID() ); pItem->SetUInt64Value( ITEM_FIELD_OWNER, GetGUID() );
pItem->SetSlot( slot ); pItem->SetSlot( slot );
@ -10327,7 +10319,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
UpdateKnownCurrencies(pItem->GetEntry(), false); UpdateKnownCurrencies(pItem->GetEntry(), false);
m_items[slot] = NULL; m_items[slot] = NULL;
SetUInt64Value((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot*2)), 0); SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0);
if ( slot < EQUIPMENT_SLOT_END ) if ( slot < EQUIPMENT_SLOT_END )
SetVisibleItemSlot(slot, NULL); SetVisibleItemSlot(slot, NULL);
@ -10408,7 +10400,7 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
if( bag == INVENTORY_SLOT_BAG_0 ) if( bag == INVENTORY_SLOT_BAG_0 )
{ {
SetUInt64Value((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot*2)), 0); SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0);
// equipment and equipped bags can have applied bonuses // equipment and equipped bags can have applied bonuses
if ( slot < INVENTORY_SLOT_BAG_END ) if ( slot < INVENTORY_SLOT_BAG_END )
@ -11022,7 +11014,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
ItemPrototype const* bagItemProto = bagItem->GetProto(); ItemPrototype const* bagItemProto = bagItem->GetProto();
if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emotyProto)) if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emotyProto))
{ {
// one from items not go to empry target bag // one from items not go to empty target bag
SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem ); SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem );
return; return;
} }
@ -11119,7 +11111,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
uint32 etime = uint32(base - m_logintime + (30 * 3600)); uint32 etime = uint32(base - m_logintime + (30 * 3600));
uint32 eslot = slot - BUYBACK_SLOT_START; uint32 eslot = slot - BUYBACK_SLOT_START;
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + eslot * 2, pItem->GetGUID() ); SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
ItemPrototype const *pProto = pItem->GetProto(); ItemPrototype const *pProto = pItem->GetProto();
if( pProto ) if( pProto )
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() ); SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
@ -11156,7 +11148,7 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
m_items[slot] = NULL; m_items[slot] = NULL;
uint32 eslot = slot - BUYBACK_SLOT_START; uint32 eslot = slot - BUYBACK_SLOT_START;
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + eslot * 2, 0 ); SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), 0 );
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 ); SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0 ); SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0 );
@ -11418,7 +11410,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
if (!item->IsBroken()) if (!item->IsBroken())
{ {
for (int s=0; s<3; s++) for (int s = 0; s < 3; ++s)
{ {
uint32 enchant_display_type = pEnchant->type[s]; uint32 enchant_display_type = pEnchant->type[s];
uint32 enchant_amount = pEnchant->amount[s]; uint32 enchant_amount = pEnchant->amount[s];
@ -11452,7 +11444,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
if (item_rand) if (item_rand)
{ {
// Search enchant_amount // Search enchant_amount
for (int k=0; k<3; k++) for (int k = 0; k < 3; ++k)
{ {
if(item_rand->enchant_id[k] == enchant_id) if(item_rand->enchant_id[k] == enchant_id)
{ {
@ -11478,7 +11470,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
if(item_rand) if(item_rand)
{ {
for (int k=0; k<3; k++) for (int k = 0; k < 3; ++k)
{ {
if(item_rand->enchant_id[k] == enchant_id) if(item_rand->enchant_id[k] == enchant_id)
{ {
@ -11498,7 +11490,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
if(item_rand_suffix) if(item_rand_suffix)
{ {
for (int k=0; k<3; k++) for (int k = 0; k < 3; ++k)
{ {
if(item_rand_suffix->enchant_id[k] == enchant_id) if(item_rand_suffix->enchant_id[k] == enchant_id)
{ {
@ -11717,9 +11709,11 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
// visualize enchantment at player and equipped items // visualize enchantment at player and equipped items
if(slot == PERM_ENCHANTMENT_SLOT) if(slot == PERM_ENCHANTMENT_SLOT)
{ SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (item->GetSlot() * 2), 0, apply ? item->GetEnchantmentId(slot) : 0);
SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (item->GetSlot() * 2), apply ? item->GetEnchantmentId(slot) : 0);
} if(slot == TEMP_ENCHANTMENT_SLOT)
SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (item->GetSlot() * 2), 1, apply ? item->GetEnchantmentId(slot) : 0);
if(apply_dur) if(apply_dur)
{ {
@ -11761,18 +11755,18 @@ void Player::SendNewItem(Item *item, uint32 count, bool received, bool created,
// last check 2.0.10 // last check 2.0.10
WorldPacket data( SMSG_ITEM_PUSH_RESULT, (8+4+4+4+1+4+4+4+4+4) ); WorldPacket data( SMSG_ITEM_PUSH_RESULT, (8+4+4+4+1+4+4+4+4+4) );
data << GetGUID(); // player GUID data << uint64(GetGUID()); // player GUID
data << uint32(received); // 0=looted, 1=from npc data << uint32(received); // 0=looted, 1=from npc
data << uint32(created); // 0=received, 1=created data << uint32(created); // 0=received, 1=created
data << uint32(1); // always 0x01 (probably meant to be count of listed items) data << uint32(1); // always 0x01 (probably meant to be count of listed items)
data << (uint8)item->GetBagSlot(); // bagslot data << uint8(item->GetBagSlot()); // bagslot
// item slot, but when added to stack: 0xFFFFFFFF // item slot, but when added to stack: 0xFFFFFFFF
data << (uint32) ((item->GetCount()==count) ? item->GetSlot() : -1); data << uint32((item->GetCount() == count) ? item->GetSlot() : -1);
data << uint32(item->GetEntry()); // item id data << uint32(item->GetEntry()); // item id
data << uint32(item->GetItemSuffixFactor()); // SuffixFactor data << uint32(item->GetItemSuffixFactor()); // SuffixFactor
data << uint32(item->GetItemRandomPropertyId()); // random item property id data << uint32(item->GetItemRandomPropertyId()); // random item property id
data << uint32(count); // count of items data << uint32(count); // count of items
data << GetItemCount(item->GetEntry()); // count of items in inventory data << uint32(GetItemCount(item->GetEntry())); // count of items in inventory
if (broadcast && GetGroup()) if (broadcast && GetGroup())
GetGroup()->BroadcastPacket(&data, true); GetGroup()->BroadcastPacket(&data, true);
@ -11857,12 +11851,13 @@ void Player::SendPreparedQuest( uint64 guid )
// Auto open -- maybe also should verify there is no greeting // Auto open -- maybe also should verify there is no greeting
uint32 quest_id = qmi0.m_qId; uint32 quest_id = qmi0.m_qId;
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id); Quest const* pQuest = objmgr.GetQuestTemplate(quest_id);
if ( pQuest ) if ( pQuest )
{ {
if( status == DIALOG_STATUS_REWARD_REP && !GetQuestRewardStatus( quest_id ) ) if( status == DIALOG_STATUS_UNK2 && !GetQuestRewardStatus( quest_id ) )
PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanRewardQuest(pQuest, false), true );
else if( status == DIALOG_STATUS_UNK2 )
PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanRewardQuest(pQuest, false), true ); PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanRewardQuest(pQuest, false), true );
else if( status == DIALOG_STATUS_INCOMPLETE )
PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, false, true );
// Send completable on repeatable quest if player don't have quest // Send completable on repeatable quest if player don't have quest
else if( pQuest->IsRepeatable() && !pQuest->IsDaily() ) else if( pQuest->IsRepeatable() && !pQuest->IsDaily() )
PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanCompleteRepeatableQuest(pQuest), true ); PlayerTalkClass->SendQuestGiverRequestItems( pQuest, guid, CanCompleteRepeatableQuest(pQuest), true );
@ -13807,7 +13802,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// cleanup inventory related item value fields (its will be filled correctly in _LoadInventory) // cleanup inventory related item value fields (its will be filled correctly in _LoadInventory)
for(uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) for(uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{ {
SetUInt64Value( (uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2) ), 0 ); SetUInt64Value( PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0 );
SetVisibleItemSlot(slot, NULL); SetVisibleItemSlot(slot, NULL);
if (m_items[slot]) if (m_items[slot])

View file

@ -132,8 +132,7 @@ void MapManager::LoadTransports()
Transport::Transport() : GameObject() Transport::Transport() : GameObject()
{ {
// 3.1.0 - 0x34A m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION);
m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_UNK2);
} }
bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags) bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)

View file

@ -74,7 +74,7 @@ Unit::Unit()
{ {
m_objectType |= TYPEMASK_UNIT; m_objectType |= TYPEMASK_UNIT;
m_objectTypeId = TYPEID_UNIT; m_objectTypeId = TYPEID_UNIT;
// 3.1.0 - 0x60
m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION); m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION);
m_attackTimer[BASE_ATTACK] = 0; m_attackTimer[BASE_ATTACK] = 0;
@ -289,7 +289,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty
data << uint32(MovementFlags); data << uint32(MovementFlags);
if(MovementFlags & MONSTER_MOVE_WALK) if(MovementFlags & MONSTER_MOVE_WALK)
moveTime *= 1.4f; moveTime *= 1.05f;
data << uint32(moveTime); // Time in between points data << uint32(moveTime); // Time in between points
data << uint32(1); // 1 single waypoint data << uint32(1); // 1 single waypoint

View file

@ -42,8 +42,8 @@ enum OBJECT_UPDATE_FLAGS
UPDATEFLAG_LIVING = 0x0020, UPDATEFLAG_LIVING = 0x0020,
UPDATEFLAG_HAS_POSITION = 0x0040, UPDATEFLAG_HAS_POSITION = 0x0040,
UPDATEFLAG_VEHICLE = 0x0080, UPDATEFLAG_VEHICLE = 0x0080,
UPDATEFLAG_UNK1 = 0x0100, UPDATEFLAG_POSITION = 0x0100,
UPDATEFLAG_UNK2 = 0x0200 UPDATEFLAG_ROTATION = 0x0200
}; };
class UpdateData class UpdateData

View file

@ -345,10 +345,10 @@ void WorldSession::LogoutPlayer(bool Save)
if(Save) if(Save)
{ {
uint32 eslot; uint32 eslot;
for(int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; j++) for(int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; ++j)
{ {
eslot = j - BUYBACK_SLOT_START; eslot = j - BUYBACK_SLOT_START;
_player->SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1+eslot*2,0); _player->SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), 0);
_player->SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); _player->SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0);
_player->SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0); _player->SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0);
} }