diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index e9d765919..20540701f 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1059,8 +1059,17 @@ void WorldSession::HandleAlterAppearanceOpcode( WorldPacket & recv_data ) { DEBUG_LOG("CMSG_ALTER_APPEARANCE"); - uint32 Hair, Color, FacialHair; - recv_data >> Hair >> Color >> FacialHair; + uint32 Hair, Color, FacialHair, skinTone; + recv_data >> Hair >> Color >> FacialHair >> skinTone; + + uint32 skinTone_id = -1; + if (_player->getRace() == RACE_TAUREN) + { + BarberShopStyleEntry const* bs_skinTone = sBarberShopStyleStore.LookupEntry(skinTone); + if (!bs_skinTone || bs_skinTone->type != 3 || bs_skinTone->race != _player->getRace() || bs_skinTone->gender != _player->getGender()) + return; + skinTone_id = bs_skinTone->hair_id; + } BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); @@ -1072,7 +1081,7 @@ void WorldSession::HandleAlterAppearanceOpcode( WorldPacket & recv_data ) if(!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender()) return; - uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id); + uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, skinTone_id); // 0 - ok // 1,3 - not enough money @@ -1097,6 +1106,8 @@ void WorldSession::HandleAlterAppearanceOpcode( WorldPacket & recv_data ) _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id)); _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color)); _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->hair_id)); + if (_player->getRace() == RACE_TAUREN) + _player->SetByteValue(PLAYER_BYTES, 0, uint8(skinTone_id)); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a89b3de63..1b8903039 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21502,36 +21502,41 @@ bool Player::CanCaptureTowerPoint() ); } -uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair) +uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint32 newskintone) { uint32 level = getLevel(); - if(level > GT_MAX_LEVEL) + if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; // max level in this dbc uint8 hairstyle = GetByteValue(PLAYER_BYTES, 2); uint8 haircolor = GetByteValue(PLAYER_BYTES, 3); uint8 facialhair = GetByteValue(PLAYER_BYTES_2, 0); + uint8 skintone = GetByteValue(PLAYER_BYTES, 0); - if((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair)) + if (hairstyle == newhairstyle && haircolor == newhaircolor && facialhair == newfacialhair && + (skintone == newskintone || newskintone == -1)) return 0; - GtBarberShopCostBaseEntry const *bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); + GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); - if(!bsc) // shouldn't happen + if (!bsc) // shouldn't happen return 0xFFFFFFFF; float cost = 0; - if(hairstyle != newhairstyle) + if (hairstyle != newhairstyle) cost += bsc->cost; // full price - if((haircolor != newhaircolor) && (hairstyle == newhairstyle)) + if (haircolor != newhaircolor && hairstyle == newhairstyle) cost += bsc->cost * 0.5f; // +1/2 of price - if(facialhair != newfacialhair) + if (facialhair != newfacialhair) cost += bsc->cost * 0.75f; // +3/4 of price + if (skintone != newskintone && newskintone != -1) + cost += bsc->cost * 0.5f; // +1/2 of price + return uint32(cost); } diff --git a/src/game/Player.h b/src/game/Player.h index 515b2fac5..6001082db 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1067,7 +1067,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint8 chatTag() const; std::string autoReplyMsg; - uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair); + uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint32 newskintone); PlayerSocial *GetSocial() { return m_social; } diff --git a/src/game/Spell.h b/src/game/Spell.h index 80997dc6d..a5411153e 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -393,7 +393,7 @@ class Spell void setState(uint32 state) { m_spellState = state; } void DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype); - void DoSummon(SpellEffectIndex eff_idx); + void DoSummonPet(SpellEffectIndex eff_idx); void DoSummonWild(SpellEffectIndex eff_idx, uint32 forceFaction = 0); void DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction = 0); void DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc = 0); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a32bd9b43..6d1b4a95e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4846,7 +4846,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx) if(prop_id == 1562) // 3 uncontrolable instead of one controllable :/ DoSummonGuardian(eff_idx, summon_prop->FactionId); else - DoSummon(eff_idx); + DoSummonPet(eff_idx); break; } case SUMMON_PROP_GROUP_CONTROLLABLE: @@ -4869,7 +4869,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx) } } -void Spell::DoSummon(SpellEffectIndex eff_idx) +void Spell::DoSummonPet(SpellEffectIndex eff_idx) { if (m_caster->GetPetGuid()) return; @@ -4884,7 +4884,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx) CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(pet_entry); if (!cInfo) { - sLog.outErrorDb("Spell::DoSummon: creature entry %u not found for spell %u.", pet_entry, m_spellInfo->Id); + sLog.outErrorDb("Spell::DoSummonPet: creature entry %u not found for spell %u.", pet_entry, m_spellInfo->Id); return; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d3b11c3a8..1f494c0dd 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 "12035" + #define REVISION_NR "12036" #endif // __REVISION_NR_H__