Jump to content

Scyzor

Members
  • Posts

    32
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Scyzor

  1. You are very right about the low priority thing. I'll try getting some of my friends into the testing so that devs would only have to push it upstream.
  2. 1) The barbershop patch doesn't have anything that's hardcoded and it has been tested once. 2) I think hardcoding is wrong too, but I can't find another way. No one should use the druid cosmetics patch. 3) My attitude doesn't change anything, I'm just helping you know. If you guys don't want it, just give me negative replies, I don't mind. The fact that none of the core developers replied to me in a month's time is really getting on my nerves. 4) I have nobody to talk to, I'm new here, this is my first patch. As for the druid patch, I've said on the first page of this thread that I want it deleted. I got no reply. I keep on updating it just because someone replied, so I thought they might want to test it. Thank you for your feedback.
  3. @DaemonCantor: You won't be using it why ? @UnkleNuke: You have no idea how simple this patch is. Of course it has to be pushed upstream ASAP. If it's tested once, it works, that's it. Take a look at the code. The testing you're talking about is done for patches involving optimization and pointers and stuff. I just replicated code on mine.
  4. I actually I got my barbershop patch tested on another thread. And since that was the problem, I don't think I need more testing. You can enjoy your bug
  5. Thanks a million for the testing. I've gone desperate trying to find one
  6. Patch updated to support [10148]. Can anyone test this ?
  7. Heh no wisdom here. Just tools and code. Could you give my code a shot anyway ? It's updated to [10148] now.
  8. WoWModelViewer displays the filenames. If it had added any pieces of mesh to the model it would have indicated that. And yes, I can rely on it since there's no other proper app to use. MyWarcraftStudio (same developer as WMV) crashes on opening M2, so I could just use it for DBCs. The only DBC file I found relevant was BarberShopStyle.dbc which I knew already. Also, MyWarcraftStudio lists files inside MPQs. Character meshes had cosmetics meshes and skins in the same directory. Druid models didn't. Please look into it before posting again. As for efficiency, WoW meshes are very very low detailed they don't cost a dime on processor time or RAM, so don't count that into the situation. Plus, WoW is already about 9GB, would they do the horns and piercings as separate models just to not create one more tiny horde bear model ?
  9. I've used a model viewer. It showed the character models with customization (facial hair, skin colour, etc). It didn't show any customization for the druid models except the texture (skin colour). So I don't think it's as you say. Try this and you'll understand.
  10. Patch updated to support [10144]. First post updated.
  11. @UnkleNuke: I would have done this on git only if it had been longer and more complex. I don't think it's worth it. However if it would help testers, I'd gladly do that @DaViper: I apologize but I couldn't get your point. I'm redoing the patch for the latest rev as soon as I get along with git
  12. Well, for the models part, I have spotted quite a few differences other than the horns or the fur between alliance and horde. The teeth, the chains. All those couldn't have been helmets or shirts. I don't think it works that way. And even if it did, why would they store basic models anyway ? Plus, World of Warcraft is pretty much the most basic mmorpg out there so try thinking shallower I finished working on the patch quite a while ago. It just needs the testing. I lack the RAM and the time of running both a server and a client. Thanks a billion for volunteering. I haven't been getting any replies in a while. You saved me
  13. Well, it's their decision. They say what's right and what's wrong. I sure hope they look into this the right way. I almost finished mine. The patch just needs testing for now
  14. Well me and thenecromancer definitely searched for a DBC way of doing this before thinking about hardcoding. For myself, I couldn't find anything binding those 5 models together. It's highly unlikely for Blizzard to change the models anytime soon. So why not just hardcode it ?
  15. Heh some hope finally. I do need some feedback, but take your time By the way, I don't think you should test the shapeshift part. The same way has been posted on another thread and has been cancelled because it had hardcoded entries. Just try the barbershop part and tell me.
  16. Does no one care about this anymore ?
  17. I had to make up some value so that the barbershop cost function ignores the skin changing cost. Guess I have to put race hacks there too Try these: From 6c895bcbde2f1e43313c9666d272b2c9bc73be4e Mon Sep 17 00:00:00 2001 From: GS <[email protected]> Date: Mon, 21 Jun 2010 02:59:43 +0300 Subject: [PATCH 1/2] Different druid models introduced in patch 3.2.0 now work --- src/game/SpellAuras.cpp | 84 +++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 263e473..ff07883 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3029,25 +3029,89 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) modelid = ssEntry->modelID_A; else { - // players are a bit difficult since the dbc has seldomly an horde modelid - // so we add hacks here to set the right model - if (Player::TeamForRace(target->getRace()) == ALLIANCE) - modelid = ssEntry->modelID_A; - else // 3.2.3 only the moonkin form has this information - modelid = ssEntry->modelID_H; + Player *player = (Player*)target; + // The following are the different shapeshifting models for cat/bear forms according + // to hair color for druids and skin tone for tauren introduced in patch 3.2 + if (form == FORM_CAT || form == FORM_BEAR || form == FORM_DIREBEAR) + { + if (player->GetTeam() == ALLIANCE) + { + uint8 hairColour = target->GetByteValue(PLAYER_BYTES, 3); + if (form == FORM_CAT) + { + if (hairColour >= 0 && hairColour <= 2) modelid = 29407; + else if (hairColour == 3 || hairColour == 5) modelid = 29405; + else if (hairColour == 6) modelid = 892; + else if (hairColour == 7) modelid = 29406; + else if (hairColour == 4) modelid = 29408; + } + else + { + if (hairColour >= 0 && hairColour <= 2) modelid = 29413; + else if (hairColour == 3 || hairColour == 5) modelid = 29415; + else if (hairColour == 6) modelid = 29414; + else if (hairColour == 7) modelid = 29417; + else if (hairColour == 4) modelid = 29416; + } + } + else if (player->GetTeam() == HORDE) + { + uint8 skinColour = target->GetByteValue(PLAYER_BYTES, 0); + if (target->getGender() == GENDER_MALE) + { + if (form == FORM_CAT) + { + if (skinColour >= 0 && skinColour <= 5) modelid = 29412; + else if (skinColour >= 6 && skinColour <= 8) modelid = 29411; + else if (skinColour >= 9 && skinColour <= 11) modelid = 29410; + else if (skinColour >= 12 && skinColour <= 14 || skinColour == 18) modelid = 29409; + else if (skinColour >= 15 && skinColour <= 17) modelid = 8571; + } + else + { + if (skinColour >= 0 && skinColour <= 2) modelid = 29418; + else if (skinColour >= 3 && skinColour <= 5 || skinColour >= 12 && skinColour <= 14) modelid = 29419; + else if (skinColour >= 9 && skinColour <= 11 || skinColour >= 15 && skinColour <= 17) modelid = 29420; + else if (skinColour >= 6 && skinColour <= 8) modelid = 2289; + else if (skinColour == 18) modelid = 29421; + } + } + else + { + if (form == FORM_CAT) + { + if (skinColour >= 0 && skinColour <= 3) modelid = 29412; + else if (skinColour == 4 || skinColour == 5) modelid = 29411; + else if (skinColour == 6 || skinColour == 7) modelid = 29410; + else if (skinColour == 8 || skinColour == 9) modelid = 8571; + else if (skinColour == 10) modelid = 29409; + } + else + { + if (skinColour == 0 || skinColour == 1) modelid = 29418; + else if (skinColour == 2 || skinColour == 3) modelid = 29419; + else if (skinColour == 4 || skinColour == 5) modelid = 2289; + else if (skinColour >= 6 && skinColour <= 9) modelid = 29420; + else if (skinColour == 10) modelid = 29421; + } + } + } + } + else + { + if (player->GetTeam() == ALLIANCE) modelid = ssEntry->modelID_A; + else modelid = ssEntry->modelID_H; + } // no model found, if player is horde we look here for our hardcoded modelids - if (!modelid && Player::TeamForRace(target->getRace()) == HORDE) + if (!modelid && player->GetTeam() == HORDE) { switch(form) { case FORM_CAT: - modelid = 8571; - break; case FORM_BEAR: case FORM_DIREBEAR: - modelid = 2289; break; case FORM_FLIGHT: modelid = 20872; -- 1.7.0.2.msysgit.0 From f74b77f4b5b3f3753a8be050303b1331dcb1b1f4 Mon Sep 17 00:00:00 2001 From: GS <[email protected]> Date: Mon, 21 Jun 2010 01:41:06 +0300 Subject: [PATCH 2/2] Tauren can change their skintones at the barbershop --- src/game/CharacterHandler.cpp | 15 ++++++++++++--- src/game/Player.cpp | 10 +++++++--- src/game/Player.h | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 5e4e242..3e962e4 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1076,8 +1076,16 @@ void WorldSession::HandleAlterAppearance( WorldPacket & recv_data ) { DEBUG_LOG("CMSG_ALTER_APPEARANCE"); - uint32 Hair, Color, FacialHair; - recv_data >> Hair >> Color >> FacialHair; + uint32 Hair, Color, FacialHair, SkinTone = 0; + if(_player->getRace() != RACE_TAUREN) recv_data >> Hair >> Color >> FacialHair; + else + { + recv_data >> Hair >> Color >> FacialHair >> SkinTone; + 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 = bs_skinTone->hair_id; + } BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); @@ -1089,7 +1097,7 @@ void WorldSession::HandleAlterAppearance( 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); // 0 - ok // 1,3 - not enough money @@ -1114,6 +1122,7 @@ void WorldSession::HandleAlterAppearance( 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)); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index fe43768..5497140 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20607,7 +20607,7 @@ bool Player::CanCaptureTowerPoint() ); } -uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair) +uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone) { uint32 level = getLevel(); @@ -20617,8 +20617,10 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n 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) && + (getRace() != RACE_TAUREN || skintone == newskintone)) return 0; GtBarberShopCostBaseEntry const *bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); @@ -20636,7 +20638,9 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n if(facialhair != newfacialhair) cost += bsc->cost * 0.75f; // +3/4 of price - + + if(skintone != newskintone && getRace() == RACE_TAUREN) // +1/2 of price + cost += bsc->cost * 0.5f; return uint32(cost); } diff --git a/src/game/Player.h b/src/game/Player.h index 548d464..9c75749 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1136,7 +1136,7 @@ class MANGOS_DLL_SPEC Player : public Unit std::string afkMsg; std::string dndMsg; - uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair); + uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone); PlayerSocial *GetSocial() { return m_social; } -- 1.7.0.2.msysgit.0 Untested though I lack time and RAM. Please feel free to report any more bugs, and sorry for taking such a long time to develop such a small patch. I'm a newbie Should work as of [10088]
  18. From 70ec5f0614f30899bb3ec7132f0bdccfece4f431 Mon Sep 17 00:00:00 2001 From: GS <[email protected]> Date: Sat, 19 Jun 2010 14:33:14 +0300 Subject: [PATCH 1/2] Barbershop fixed for tauren and other classes --- src/game/CharacterHandler.cpp | 17 ++++++++++++++--- src/game/Player.cpp | 9 +++++++-- src/game/Player.h | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 5e4e242..0ee3083 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1076,8 +1076,18 @@ void WorldSession::HandleAlterAppearance( WorldPacket & recv_data ) { DEBUG_LOG("CMSG_ALTER_APPEARANCE"); - uint32 Hair, Color, FacialHair; - recv_data >> Hair >> Color >> FacialHair; + uint32 skinTone_id = -1; + + uint32 Hair, Color, FacialHair, SkinTone; + if(_player->getRace() != RACE_TAUREN) recv_data >> Hair >> Color >> FacialHair; + else + { + recv_data >> Hair >> Color >> FacialHair >> SkinTone; + 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); @@ -1089,7 +1099,7 @@ void WorldSession::HandleAlterAppearance( 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 @@ -1114,6 +1124,7 @@ void WorldSession::HandleAlterAppearance( 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 2af1cd7..92c9aa8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20617,7 +20617,7 @@ bool Player::CanCaptureTowerPoint() ); } -uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair) +uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone) { uint32 level = getLevel(); @@ -20627,8 +20627,10 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n 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); @@ -20647,6 +20649,9 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n if(facialhair != newfacialhair) cost += bsc->cost * 0.75f; // +3/4 of price + if(skintone != newskintone && newskintone != -1) // +1/2 of price + cost += bsc->cost * 0.5f; + return uint32(cost); } diff --git a/src/game/Player.h b/src/game/Player.h index 942d68f..bc8bd5c 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1136,7 +1136,7 @@ class MANGOS_DLL_SPEC Player : public Unit std::string afkMsg; std::string dndMsg; - uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair); + uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone); PlayerSocial *GetSocial() { return m_social; } -- 1.7.0.2.msysgit.0 From f6ed46f7a9a122cea1d26f51b131bb94fe138f6c Mon Sep 17 00:00:00 2001 From: GS <[email protected]> Date: Sat, 19 Jun 2010 15:25:23 +0300 Subject: [PATCH 2/2] New druid models implemented and barbershop fixed for all classes. --- src/game/SpellAuras.cpp | 85 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 74 insertions(+), 11 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 533c098..c2aeaf9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3029,25 +3029,88 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) modelid = ssEntry->modelID_A; else { - // players are a bit difficult since the dbc has seldomly an horde modelid - // so we add hacks here to set the right model - if (Player::TeamForRace(target->getRace()) == ALLIANCE) - modelid = ssEntry->modelID_A; - else // 3.2.3 only the moonkin form has this information - modelid = ssEntry->modelID_H; + Player *player = (Player*)target; + // The following are the different shapeshifting models for cat/bear forms according + // to hair color for druids and skin tone for tauren introduced in patch 3.2 + if (form == FORM_CAT || form == FORM_BEAR || form == FORM_DIREBEAR) + { + if (player->GetTeam() == ALLIANCE) + { + uint8 hairColour = target->GetByteValue(PLAYER_BYTES, 3); + if (form == FORM_CAT) + { + if (hairColour >= 0 && hairColour <= 2) modelid = 29407; + else if (hairColour == 3 || hairColour == 5) modelid = 29405; + else if (hairColour == 6) modelid = 892; + else if (hairColour == 7) modelid = 29406; + else if (hairColour == 4) modelid = 29408; + } + else + { + if (hairColour >= 0 && hairColour <= 2) modelid = 29413; + else if (hairColour == 3 || hairColour == 5) modelid = 29415; + else if (hairColour == 6) modelid = 29414; + else if (hairColour == 7) modelid = 29417; + else if (hairColour == 4) modelid = 29416; + } + } + else if (player->GetTeam() == HORDE) + { + uint8 skinColour = target->GetByteValue(PLAYER_BYTES, 0); + if (target->getGender() == GENDER_MALE) + { + if (form == FORM_CAT) + { + if (skinColour >= 0 && skinColour <= 5) modelid = 29412; + else if (skinColour >= 6 && skinColour <= 8) modelid = 29411; + else if (skinColour >= 9 && skinColour <= 11) modelid = 29410; + else if (skinColour >= 12 && skinColour <= 14 || skinColour == 18) modelid = 29409; + else if (skinColour >= 15 && skinColour <= 17) modelid = 8571; + } + else + { + if (skinColour >= 0 && skinColour <= 2) modelid = 29418; + else if (skinColour >= 3 && skinColour <= 5 || skinColour >= 12 && skinColour <= 14) modelid = 29419; + else if (skinColour >= 9 && skinColour <= 11 || skinColour >= 15 && skinColour <= 17) modelid = 29420; + else if (skinColour >= 6 && skinColour <= 8) modelid = 2289; + else if (skinColour == 18) modelid = 29421; + } + } + else + { + if (form == FORM_CAT) + { + if (skinColour >= 0 && skinColour <= 3) modelid = 29412; + else if (skinColour == 4 || skinColour == 5) modelid = 29411; + else if (skinColour == 6 || skinColour == 7) modelid = 29410; + else if (skinColour == 8 || skinColour == 9) modelid = 8571; + else if (skinColour == 10) modelid = 29409; + } + else + { + if (skinColour == 0 || skinColour == 1) modelid = 29418; + else if (skinColour == 2 || skinColour == 3) modelid = 29419; + else if (skinColour == 4 || skinColour == 5) modelid = 2289; + else if (skinColour >= 6 && skinColour <= 9) modelid = 29420; + else if (skinColour == 10) modelid = 29421; + } + } + } + } + else + { + if (player->GetTeam() == ALLIANCE) modelid = ssEntry->modelID_A; + else modelid = ssEntry->modelID_H; + } // no model found, if player is horde we look here for our hardcoded modelids - if (!modelid && Player::TeamForRace(target->getRace()) == HORDE) + if (!modelid && player->GetTeam() == HORDE) { - switch(form) { case FORM_CAT: - modelid = 8571; - break; case FORM_BEAR: case FORM_DIREBEAR: - modelid = 2289; break; case FORM_FLIGHT: modelid = 20872; -- 1.7.0.2.msysgit.0 Try applying both the patches. First applies first. Everything should work. This is for [10078]
  19. Sorry guys, after I had the git problems I had to rewrite the code fast without compiling Does it work well now ?
  20. Yeah sorry for that, I had it fixed before but I screwed up my git repo and had to revert things . It's supposed to be target->getGender() EDIT: Updated the paste2 link too.
  21. this doesn't work anymore right ?
  22. Thanks! I didn't know we could post there lol. EDIT: Fixed bug reported by KAPATEJIb when server waits on receiving the skintone byte on other classes. First post updated.
  23. Taurens could choose their skintone at the barbershop, but when they try to apply the change, nothing gets subtracted from their money and their skin reverts back to the one they were created with. This patch calculates the correct amount of money needed and applies the change to PLAYER_BYTES. From ae2ea7d1ef2a0a70b20c9198b6018f9c033a95aa Mon Sep 17 00:00:00 2001 From: GS <[email protected]> Date: Tue, 15 Jun 2010 13:14:28 +0300 Subject: [PATCH] Tauren can now change their skin tone colour at the barbershop. Signed-off-by: GS <[email protected]> --- src/game/CharacterHandler.cpp | 12 +++++++++--- src/game/Player.cpp | 9 +++++++-- src/game/Player.h | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 8357ede..08c52b3 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1075,8 +1075,8 @@ void WorldSession::HandleAlterAppearance( 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; BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); @@ -1088,7 +1088,12 @@ void WorldSession::HandleAlterAppearance( 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); + BarberShopStyleEntry const* bs_skinTone = sBarberShopStyleStore.LookupEntry(SkinTone); + + if(!bs_skinTone || bs_skinTone->type != 3 || bs_skinTone->race != _player->getRace() || bs_facialHair->gender != _player->getGender()) + return; + + uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinTone->hair_id); // 0 - ok // 1,3 - not enough money @@ -1113,6 +1118,7 @@ void WorldSession::HandleAlterAppearance( 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)); + _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinTone->hair_id)); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6abae6f..e4a03fc 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20615,7 +20615,7 @@ bool Player::CanCaptureTowerPoint() ); } -uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair) +uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone) { uint32 level = getLevel(); @@ -20625,8 +20625,10 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n 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)) return 0; GtBarberShopCostBaseEntry const *bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); @@ -20645,6 +20647,9 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n if(facialhair != newfacialhair) cost += bsc->cost * 0.75f; // +3/4 of price + if(skintone != newskintone) + 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 8d6d64a..dfbb46e 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1136,7 +1136,7 @@ class MANGOS_DLL_SPEC Player : public Unit std::string afkMsg; std::string dndMsg; - uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair); + uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint8 newskintone); PlayerSocial *GetSocial() { return m_social; } -- 1.7.0.2.msysgit.0
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use