aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-11-25 10:23:24 +0100
committerShauren <shauren.trinity@gmail.com>2012-11-25 10:23:24 +0100
commit5de19484ee09deb4ef1bcfd9438e25c8dd645c0d (patch)
tree151c0ee989a4444ec65f97e98d56b1144889652e /src
parentbc01f34ce5acd95553393f1fbf32945708352c75 (diff)
Core/Spells: Removed selecting shapeshift model based on race and skin color for creatures.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp285
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h2
2 files changed, 145 insertions, 142 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 64a47c4bf8b..ab2c07e1925 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16702,178 +16702,181 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c
return CalculatePct(damage, percent);
}
-uint32 Unit::GetModelForForm(ShapeshiftForm form)
+uint32 Unit::GetModelForForm(ShapeshiftForm form) const
{
- switch (form)
+ if (GetTypeId() == TYPEID_PLAYER)
{
- case FORM_CAT:
- // Based on Hair color
- if (getRace() == RACE_NIGHTELF)
- {
- uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
- switch (hairColor)
+ switch (form)
+ {
+ case FORM_CAT:
+ // Based on Hair color
+ if (getRace() == RACE_NIGHTELF)
{
- case 7: // Violet
- case 8:
- return 29405;
- case 3: // Light Blue
- return 29406;
- case 0: // Green
- case 1: // Light Green
- case 2: // Dark Green
- return 29407;
- case 4: // White
- return 29408;
- default: // original - Dark Blue
- return 892;
+ uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+ switch (hairColor)
+ {
+ case 7: // Violet
+ case 8:
+ return 29405;
+ case 3: // Light Blue
+ return 29406;
+ case 0: // Green
+ case 1: // Light Green
+ case 2: // Dark Green
+ return 29407;
+ case 4: // White
+ return 29408;
+ default: // original - Dark Blue
+ return 892;
+ }
}
- }
- // Based on Skin color
- else if (getRace() == RACE_TAUREN)
- {
- uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
- // Male
- if (getGender() == GENDER_MALE)
+ // Based on Skin color
+ else if (getRace() == RACE_TAUREN)
{
- switch (skinColor)
+ uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+ // Male
+ if (getGender() == GENDER_MALE)
+ {
+ switch (skinColor)
+ {
+ case 12: // White
+ case 13:
+ case 14:
+ case 18: // Completly White
+ return 29409;
+ case 9: // Light Brown
+ case 10:
+ case 11:
+ return 29410;
+ case 6: // Brown
+ case 7:
+ case 8:
+ return 29411;
+ case 0: // Dark
+ case 1:
+ case 2:
+ case 3: // Dark Grey
+ case 4:
+ case 5:
+ return 29412;
+ default: // original - Grey
+ return 8571;
+ }
+ }
+ // Female
+ else switch (skinColor)
{
- case 12: // White
- case 13:
- case 14:
- case 18: // Completly White
+ case 10: // White
return 29409;
- case 9: // Light Brown
- case 10:
- case 11:
- return 29410;
- case 6: // Brown
+ case 6: // Light Brown
case 7:
- case 8:
+ return 29410;
+ case 4: // Brown
+ case 5:
return 29411;
case 0: // Dark
case 1:
case 2:
- case 3: // Dark Grey
- case 4:
- case 5:
+ case 3:
return 29412;
default: // original - Grey
return 8571;
}
}
- // Female
- else switch (skinColor)
- {
- case 10: // White
- return 29409;
- case 6: // Light Brown
- case 7:
- return 29410;
- case 4: // Brown
- case 5:
- return 29411;
- case 0: // Dark
- case 1:
- case 2:
- case 3:
- return 29412;
- default: // original - Grey
- return 8571;
- }
- }
- else if (Player::TeamForRace(getRace()) == ALLIANCE)
- return 892;
- else
- return 8571;
- case FORM_DIREBEAR:
- case FORM_BEAR:
- // Based on Hair color
- if (getRace() == RACE_NIGHTELF)
- {
- uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
- switch (hairColor)
+ else if (Player::TeamForRace(getRace()) == ALLIANCE)
+ return 892;
+ else
+ return 8571;
+ case FORM_DIREBEAR:
+ case FORM_BEAR:
+ // Based on Hair color
+ if (getRace() == RACE_NIGHTELF)
{
- case 0: // Green
- case 1: // Light Green
- case 2: // Dark Green
- return 29413; // 29415?
- case 6: // Dark Blue
- return 29414;
- case 4: // White
- return 29416;
- case 3: // Light Blue
- return 29417;
- default: // original - Violet
- return 2281;
+ uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+ switch (hairColor)
+ {
+ case 0: // Green
+ case 1: // Light Green
+ case 2: // Dark Green
+ return 29413; // 29415?
+ case 6: // Dark Blue
+ return 29414;
+ case 4: // White
+ return 29416;
+ case 3: // Light Blue
+ return 29417;
+ default: // original - Violet
+ return 2281;
+ }
}
- }
- // Based on Skin color
- else if (getRace() == RACE_TAUREN)
- {
- uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
- // Male
- if (getGender() == GENDER_MALE)
+ // Based on Skin color
+ else if (getRace() == RACE_TAUREN)
{
- switch (skinColor)
+ uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+ // Male
+ if (getGender() == GENDER_MALE)
+ {
+ switch (skinColor)
+ {
+ case 0: // Dark (Black)
+ case 1:
+ case 2:
+ return 29418;
+ case 3: // White
+ case 4:
+ case 5:
+ case 12:
+ case 13:
+ case 14:
+ return 29419;
+ case 9: // Light Brown/Grey
+ case 10:
+ case 11:
+ case 15:
+ case 16:
+ case 17:
+ return 29420;
+ case 18: // Completly White
+ return 29421;
+ default: // original - Brown
+ return 2289;
+ }
+ }
+ // Female
+ else switch (skinColor)
{
case 0: // Dark (Black)
case 1:
- case 2:
return 29418;
- case 3: // White
- case 4:
- case 5:
- case 12:
- case 13:
- case 14:
+ case 2: // White
+ case 3:
return 29419;
- case 9: // Light Brown/Grey
- case 10:
- case 11:
- case 15:
- case 16:
- case 17:
+ case 6: // Light Brown/Grey
+ case 7:
+ case 8:
+ case 9:
return 29420;
- case 18: // Completly White
+ case 10: // Completly White
return 29421;
default: // original - Brown
return 2289;
}
}
- // Female
- else switch (skinColor)
- {
- case 0: // Dark (Black)
- case 1:
- return 29418;
- case 2: // White
- case 3:
- return 29419;
- case 6: // Light Brown/Grey
- case 7:
- case 8:
- case 9:
- return 29420;
- case 10: // Completly White
- return 29421;
- default: // original - Brown
- return 2289;
- }
- }
- else if (Player::TeamForRace(getRace()) == ALLIANCE)
- return 2281;
- else
- return 2289;
- case FORM_FLIGHT:
- if (Player::TeamForRace(getRace()) == ALLIANCE)
- return 20857;
- return 20872;
- case FORM_FLIGHT_EPIC:
- if (Player::TeamForRace(getRace()) == ALLIANCE)
- return 21243;
- return 21244;
- default:
- break;
+ else if (Player::TeamForRace(getRace()) == ALLIANCE)
+ return 2281;
+ else
+ return 2289;
+ case FORM_FLIGHT:
+ if (Player::TeamForRace(getRace()) == ALLIANCE)
+ return 20857;
+ return 20872;
+ case FORM_FLIGHT_EPIC:
+ if (Player::TeamForRace(getRace()) == ALLIANCE)
+ return 21243;
+ return 21244;
+ default:
+ break;
+ }
}
uint32 modelid = 0;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index b6c0b0059b6..1f999477f9a 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -2137,7 +2137,7 @@ class Unit : public WorldObject
void AddPetAura(PetAura const* petSpell);
void RemovePetAura(PetAura const* petSpell);
- uint32 GetModelForForm(ShapeshiftForm form);
+ uint32 GetModelForForm(ShapeshiftForm form) const;
uint32 GetModelForTotem(PlayerTotemType totemType);
void SetReducedThreatPercent(uint32 pct, uint64 guid)