aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorForesterDev <11771800+ForesterDev@users.noreply.github.com>2019-07-02 12:17:03 +0400
committerShauren <shauren.trinity@gmail.com>2021-12-13 00:42:20 +0100
commit27886c7f5d6cfc221ea67aab210f96859d725e05 (patch)
tree6502c70a3ac0b2d3cc5b80f00001e0db37f9bf2b /src/server/scripts/Spells
parent4e6c59dca78ce563c327ea3106d0ff6786b1e127 (diff)
Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender (#23520)
* Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender and fix some cases, where we should get player gender, instead of modified by display gender * fix merge * Add virtual methods for Unit class (cherry picked from commit b47bb59e2a3e42aff3793517ef94f51678b54905)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp6
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp8
-rw-r--r--src/server/scripts/Spells/spell_item.cpp6
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 68bdcfe8696..f3945a64a43 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -415,7 +415,7 @@ class spell_gen_aura_service_uniform : public AuraScript
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
{
- if (target->GetGender() == GENDER_MALE)
+ if (target->GetNativeGender() == GENDER_MALE)
target->SetDisplayId(MODEL_GOBLIN_MALE);
else
target->SetDisplayId(MODEL_GOBLIN_FEMALE);
@@ -1154,7 +1154,7 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
{
if (Player* player = GetHitPlayer())
{
- uint8 gender = player->GetGender();
+ uint8 gender = player->GetNativeGender();
uint32 spellId = GetSpellInfo()->Id;
@@ -2382,7 +2382,7 @@ class spell_gen_orc_disguise : public SpellScript
Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
- uint8 gender = target->GetGender();
+ uint8 gender = target->GetNativeGender();
if (!gender)
caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
else
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 1cc0abe6b46..061b93c10ef 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -189,13 +189,13 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
+ uint32 spell = GetTarget()->GetNativeGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
GetTarget()->CastSpell(GetTarget(), spell, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
+ uint32 spell = GetTarget()->GetNativeGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
GetTarget()->RemoveAurasDueToSpell(spell);
}
@@ -258,7 +258,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
- uint8 gender = target->GetGender();
+ uint8 gender = target->GetNativeGender();
uint32 spellId = SPELL_TRICK_BUFF;
switch (urand(0, 5))
{
@@ -426,7 +426,7 @@ public:
Unit* target = GetHitUnit();
uint32 spellId = 0;
- uint8 gender = target->GetGender();
+ uint8 gender = target->GetNativeGender();
switch (GetSpellInfo()->Id)
{
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 2e7f034eefd..8d1f9e37fdf 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -1636,9 +1636,9 @@ class spell_item_savory_deviate_delight : public SpellScript
switch (urand(1, 2))
{
// Flip Out - ninja
- case 1: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
+ case 1: spellId = (caster->GetNativeGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
// Yaaarrrr - pirate
- case 2: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
+ case 2: spellId = (caster->GetNativeGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
}
caster->CastSpell(caster, spellId, true);
}
@@ -3516,7 +3516,7 @@ class spell_item_toy_train_set_pulse : public SpellScript
if (Player* target = GetHitUnit()->ToPlayer())
{
target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN);
- if (EmotesTextSoundEntry const* soundEntry = sDB2Manager.GetTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetGender(), target->GetClass()))
+ if (EmotesTextSoundEntry const* soundEntry = sDB2Manager.GetTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetNativeGender(), target->GetClass()))
target->PlayDistanceSound(soundEntry->SoundID);
}
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index b0c62f349f0..e4551d33bb6 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -829,7 +829,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader
PreventHitDefaultEffect(effIndex);
if (Player* target = GetHitPlayer())
{
- target->CastSpell(target, target->GetGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
+ target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
target->CastSpell(target, SPELL_GENERIC_DISGUISE, true);
}
}