Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender

Port From (https://github.com/TrinityCore/TrinityCore/commit/27886c7f5d6cfc221ea67aab210f96859d725e05)
This commit is contained in:
hondacrx
2021-12-26 19:51:26 -05:00
parent 39dd51370f
commit 6d73a59f63
23 changed files with 69 additions and 64 deletions
+3 -3
View File
@@ -1739,9 +1739,9 @@ namespace Scripts.Spells.Items
switch (RandomHelper.URand(1, 2))
{
// Flip Out - ninja
case 1: spellId = (caster.GetGender() == Gender.Male ? SpellIds.FlipOutMale : SpellIds.FlipOutFemale); break;
case 1: spellId = (caster.GetNativeGender() == Gender.Male ? SpellIds.FlipOutMale : SpellIds.FlipOutFemale); break;
// Yaaarrrr - pirate
case 2: spellId = (caster.GetGender() == Gender.Male ? SpellIds.YaaarrrrMale : SpellIds.YaaarrrrFemale); break;
case 2: spellId = (caster.GetNativeGender() == Gender.Male ? SpellIds.YaaarrrrMale : SpellIds.YaaarrrrFemale); break;
}
caster.CastSpell(caster, spellId, true);
}
@@ -3186,7 +3186,7 @@ namespace Scripts.Spells.Items
if (target)
{
target.HandleEmoteCommand(Emote.OneshotTrain);
EmotesTextSoundRecord soundEntry = Global.DB2Mgr.GetTextSoundEmoteFor((uint)TextEmotes.Train, target.GetRace(), target.GetGender(), target.GetClass());
EmotesTextSoundRecord soundEntry = Global.DB2Mgr.GetTextSoundEmoteFor((uint)TextEmotes.Train, target.GetRace(), target.GetNativeGender(), target.GetClass());
if (soundEntry != null)
target.PlayDistanceSound(soundEntry.SoundId);
}