From 0dc7ea6cc2d32f35f6524cfa1a80e9d154354f26 Mon Sep 17 00:00:00 2001 From: ApoC Date: Sat, 11 Jul 2009 20:38:34 +0200 Subject: [PATCH] [8162] Fixed applying random enchantments to quest rewarded items. Signed-off-by: ApoC --- src/game/Player.cpp | 16 ++++++++-------- src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2230147e6..afe746755 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1642,7 +1642,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati m_teleport_dest = WorldLocation(mapid, x, y, z, orientation); SetFallInformation(0, z); - // code for finish transfer called in WorldSession::HandleMovementOpcodes() + // code for finish transfer called in WorldSession::HandleMovementOpcodes() // at client packet MSG_MOVE_TELEPORT_ACK SetSemaphoreTeleportNear(true); // near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing @@ -5569,7 +5569,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type) } - // it create new button (NEW state) if need or return existed + // it create new button (NEW state) if need or return existed ActionButton& ab = m_actionButtons[button]; // set data and update to CHANGED if not NEW @@ -12540,12 +12540,12 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver if (pQuest->GetRewChoiceItemsCount() > 0) { - if (pQuest->RewChoiceItemId[reward]) + if (uint32 itemId = pQuest->RewChoiceItemId[reward]) { ItemPosCountVec dest; - if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, pQuest->RewChoiceItemId[reward], pQuest->RewChoiceItemCount[reward] ) == EQUIP_ERR_OK) + if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewChoiceItemCount[reward] ) == EQUIP_ERR_OK) { - Item* item = StoreNewItem( dest, pQuest->RewChoiceItemId[reward], true); + Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); SendNewItem(item, pQuest->RewChoiceItemCount[reward], true, false); } } @@ -12555,12 +12555,12 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver { for (uint32 i=0; i < pQuest->GetRewItemsCount(); ++i) { - if (pQuest->RewItemId[i]) + if (uint32 itemId = pQuest->RewItemId[i]) { ItemPosCountVec dest; - if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, pQuest->RewItemId[i], pQuest->RewItemCount[i] ) == EQUIP_ERR_OK) + if (CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewItemCount[i] ) == EQUIP_ERR_OK) { - Item* item = StoreNewItem( dest, pQuest->RewItemId[i], true); + Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); SendNewItem(item, pQuest->RewItemCount[i], true, false); } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 839956c12..e9a958e72 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8161" + #define REVISION_NR "8162" #endif // __REVISION_NR_H__