aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Item/Item.cpp57
-rw-r--r--src/server/game/Guilds/Guild.h2
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp2
-rw-r--r--src/server/game/Maps/PhaseMgr.cpp2
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp2
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp8
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp2
7 files changed, 35 insertions, 40 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 93c16104c44..7da910f1841 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1327,7 +1327,7 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
inventoryType = INVTYPE_CHEST;
float typeFactor = 0.0f;
- uint8 wepType = -1;
+ int8 weapType = -1;
switch (inventoryType)
{
@@ -1349,29 +1349,19 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
{
case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS:
case ITEM_SUBCLASS_ARMOR_CLOTH:
- {
typeFactor = armorPrice->ClothFactor;
break;
- }
case ITEM_SUBCLASS_ARMOR_LEATHER:
- {
- typeFactor = armorPrice->ClothFactor;
+ typeFactor = armorPrice->LeatherFactor;
break;
- }
case ITEM_SUBCLASS_ARMOR_MAIL:
- {
- typeFactor = armorPrice->ClothFactor;
+ typeFactor = armorPrice->MailFactor;
break;
- }
case ITEM_SUBCLASS_ARMOR_PLATE:
- {
- typeFactor = armorPrice->ClothFactor;
+ typeFactor = armorPrice->PlateFactor;
break;
- }
default:
- {
return 0;
- }
}
break;
@@ -1386,32 +1376,37 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
break;
}
case INVTYPE_WEAPONMAINHAND:
- wepType = 0; // unk enum, fall back
+ weapType = 0;
+ break;
case INVTYPE_WEAPONOFFHAND:
- wepType = 1; // unk enum, fall back
+ weapType = 1;
+ break;
case INVTYPE_WEAPON:
- wepType = 2; // unk enum, fall back
+ weapType = 2;
+ break;
case INVTYPE_2HWEAPON:
- wepType = 3; // unk enum, fall back
+ weapType = 3;
+ break;
case INVTYPE_RANGED:
case INVTYPE_RANGEDRIGHT:
case INVTYPE_RELIC:
- {
- wepType = 4; // unk enum
-
- ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(wepType + 1);
- if (!weaponPrice)
- return 0;
-
- typeFactor = weaponPrice->Factor;
+ weapType = 4;
break;
- }
default:
return proto->BuyPrice;
}
+ if (weapType != -1)
+ {
+ ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(weapType + 1);
+ if (!weaponPrice)
+ return 0;
+
+ typeFactor = weaponPrice->Factor;
+ }
+
normalSellPrice = false;
- return (uint32)(qualityFactor * proto->Unk430_2 * proto->Unk430_1 * typeFactor * baseFactor);
+ return uint32(qualityFactor * proto->Unk430_2 * proto->Unk430_1 * typeFactor * baseFactor);
}
}
@@ -1453,7 +1448,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const
{
ItemTemplate const* proto = GetTemplate();
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
- if (proto->ItemStat[i].ItemStatType == statType)
+ if (ItemModType(proto->ItemStat[i].ItemStatType) == statType)
return proto->ItemStat[i].ItemStatValue;
int32 randomPropId = GetItemRandomPropertyId();
@@ -1469,7 +1464,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
- if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType)
+ if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
for (int k = 0; k < 5; ++k)
if (randomSuffix->enchant_id[k] == enchant->ID)
return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000);
@@ -1483,7 +1478,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
- if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType)
+ if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
if (randomProp->enchant_id[k] == enchant->ID)
return int32(enchant->amount[k]);
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index e89be2e8952..0c41cc68a60 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -548,7 +548,7 @@ private:
class LogHolder
{
public:
- LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(GUILD_EVENT_LOG_GUID_UNDEFINED) { }
+ LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { }
~LogHolder();
uint8 GetSize() const { return uint8(m_log.size()); }
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index 08635071ce9..7dfc8b94090 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -727,7 +727,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
uint32 avgTime = 0;
- GroupQueueInfo* ginfo;
+ GroupQueueInfo* ginfo = NULL;
err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, true, arenaslot);
if (!err)
diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp
index 2bb4ed0fb8c..99eee8d7c08 100644
--- a/src/server/game/Maps/PhaseMgr.cpp
+++ b/src/server/game/Maps/PhaseMgr.cpp
@@ -218,7 +218,7 @@ void PhaseMgr::SetCustomPhase(uint32 const phaseMask)
uint32 PhaseData::GetCurrentPhasemask() const
{
if (player->isGameMaster())
- return PHASEMASK_ANYWHERE;
+ return uint32(PHASEMASK_ANYWHERE);
if (_CustomPhasemask)
return _CustomPhasemask;
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp
index 9742aea194b..be024208596 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp
@@ -302,7 +302,7 @@ class npc_alpha_beam : public CreatureScript
{
npc_alpha_beamAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
- void IsSummonedBy(Unit* summoner)
+ void IsSummonedBy(Unit* /*summoner*/)
{
if (Creature* anraphet = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ANRAPHET_GUID)))
anraphet->CastSpell(me, SPELL_ALPHA_BEAMS_BACK_CAST);
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
index 47bab21e215..1ea0ee0a343 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
@@ -76,7 +76,7 @@ class SummonScarab : public BasicEvent
public:
SummonScarab(Unit* owner, InstanceScript* instance) : _owner(owner), _instance(instance) { }
- bool Execute(uint64 execTime, uint32 /*diff*/)
+ bool Execute(uint64 /*execTime*/, uint32 /*diff*/)
{
if (!_instance || _instance->GetBossState(DATA_EARTHRAGER_PTAH) != IN_PROGRESS)
return true; // delete event
@@ -178,7 +178,7 @@ public:
}
}
- void SetData(uint32 index, uint32 value)
+ void SetData(uint32 index, uint32 /*value*/)
{
if (index == DATA_SUMMON_DEATHS)
{
@@ -311,7 +311,7 @@ public:
{
if (Unit* ptah = GetCaster())
{
- ptah->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31);
+ ptah->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31));
ptah->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
}
}
@@ -320,7 +320,7 @@ public:
{
if (Unit* ptah = GetCaster())
{
- ptah->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31);
+ ptah->RemoveFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31));
ptah->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
}
}
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
index 9261575bc82..9a66caf510c 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
@@ -121,7 +121,7 @@ public:
DoCast(me, SPELL_TELEPORT);
DoCast(me, SPELL_SHIELD_OF_LIGHT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_31);
+ me->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_UNK_31));
DoCastAOE(SPELL_ACTIVATE_BEACONS);