diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2019-07-01 21:36:32 +0200 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2019-07-01 21:36:32 +0200 |
| commit | 401777d024785c58f90947cfdadd9b1b7d8fbd3b (patch) | |
| tree | 6a04418719d5fdaa519258a601a91ce073d1444b /src/server/scripts/Spells | |
| parent | e9004f9c905247f2240c3ca6e168bf9b858bf380 (diff) | |
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 20 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_holiday.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 22 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_pet.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 2 |
10 files changed, 41 insertions, 41 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index d1f3527442c..4c80eb38327 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -223,7 +223,7 @@ public: { if (Unit* caster = eventInfo.GetActor()) { - if (caster->GetTypeId() != TYPEID_PLAYER || caster->getClass() != CLASS_DEATH_KNIGHT) + if (caster->GetTypeId() != TYPEID_PLAYER || caster->GetClass() != CLASS_DEATH_KNIGHT) return false; for (uint8 i = 0; i < MAX_RUNES; ++i) @@ -431,7 +431,7 @@ class spell_dk_blade_barrier : public SpellScriptLoader { if (eventInfo.GetSpellInfo() != nullptr) if (Player* player = eventInfo.GetActor()->ToPlayer()) - if (player->getClass() == CLASS_DEATH_KNIGHT && player->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) + if (player->GetClass() == CLASS_DEATH_KNIGHT && player->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) return true; return false; @@ -473,7 +473,7 @@ class spell_dk_blood_boil : public SpellScriptLoader bool Load() override { - return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT; + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->GetClass() == CLASS_DEATH_KNIGHT; } void HandleAfterHit() @@ -908,7 +908,7 @@ class spell_dk_death_gate : public SpellScriptLoader SpellCastResult CheckClass() { - if (GetCaster()->getClass() != CLASS_DEATH_KNIGHT) + if (GetCaster()->GetClass() != CLASS_DEATH_KNIGHT) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT); return SPELL_FAILED_CUSTOM_ERROR; @@ -1037,7 +1037,7 @@ class spell_dk_death_rune : public SpellScriptLoader bool Load() override { - return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER && GetUnitOwner()->ToPlayer()->getClass() == CLASS_DEATH_KNIGHT; + return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER && GetUnitOwner()->ToPlayer()->GetClass() == CLASS_DEATH_KNIGHT; } bool CheckProc(ProcEventInfo& eventInfo) @@ -1048,7 +1048,7 @@ class spell_dk_death_rune : public SpellScriptLoader return false; Player* player = caster->ToPlayer(); - if (player->getClass() != CLASS_DEATH_KNIGHT) + if (player->GetClass() != CLASS_DEATH_KNIGHT) return false; return true; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9b8fdb625d0..24b244d69e4 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -414,7 +414,7 @@ class spell_gen_aura_service_uniform : public AuraScript Unit* target = GetTarget(); if (target->GetTypeId() == TYPEID_PLAYER) { - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) target->SetDisplayId(MODEL_GOBLIN_MALE); else target->SetDisplayId(MODEL_GOBLIN_FEMALE); @@ -1222,7 +1222,7 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader { if (Player* player = GetHitPlayer()) { - uint8 gender = player->getGender(); + uint8 gender = player->GetGender(); uint32 spellId = GetSpellInfo()->Id; @@ -1676,7 +1676,7 @@ class spell_ethereal_pet_aura : public AuraScript bool CheckProc(ProcEventInfo& eventInfo) { - uint32 levelDiff = std::abs(GetTarget()->getLevel() - eventInfo.GetProcTarget()->getLevel()); + uint32 levelDiff = std::abs(GetTarget()->GetLevel() - eventInfo.GetProcTarget()->GetLevel()); return levelDiff <= 9; } @@ -1988,14 +1988,14 @@ class spell_gen_magic_rooster : public SpellScript target->RemoveAurasByType(SPELL_AURA_MOUNTED); uint32 spellId = SPELL_MAGIC_ROOSTER_NORMAL; - switch (target->getRace()) + switch (target->GetRace()) { case RACE_DRAENEI: - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) spellId = SPELL_MAGIC_ROOSTER_DRAENEI_MALE; break; case RACE_TAUREN: - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) spellId = SPELL_MAGIC_ROOSTER_TAUREN_MALE; break; default: @@ -2638,7 +2638,7 @@ class spell_gen_orc_disguise : public SpellScript Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); if (!gender) caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true); else @@ -2788,7 +2788,7 @@ class spell_gen_pet_summoned : public SpellScript Player* player = GetCaster()->ToPlayer(); if (player->GetLastPetNumber()) { - PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; + PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; Pet* newPet = new Pet(player, newPetType); if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true)) { @@ -3737,7 +3737,7 @@ class spell_gen_gm_freeze : public AuraScript player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // if player class = hunter || warlock remove pet if alive - if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK)) + if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK)) { if (Pet* pet = player->GetPet()) { @@ -3756,7 +3756,7 @@ class spell_gen_gm_freeze : public AuraScript if (Player* player = GetTarget()->ToPlayer()) { // Reset player faction + allow combat + allow duels - player->setFactionForRace(player->getRace()); + player->setFactionForRace(player->GetRace()); player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // save player player->SaveToDB(); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 542408f367a..4067846281c 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -187,13 +187,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()->GetGender() == 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()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE; GetTarget()->RemoveAurasDueToSpell(spell); } @@ -256,7 +256,7 @@ class spell_hallow_end_trick : public SpellScriptLoader Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); uint32 spellId = SPELL_TRICK_BUFF; switch (urand(0, 5)) { @@ -424,7 +424,7 @@ public: Unit* target = GetHitUnit(); uint32 spellId = 0; - uint8 gender = target->getGender(); + uint8 gender = target->GetGender(); switch (GetSpellInfo()->Id) { diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 402797e161a..bb4f38ce06d 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1418,7 +1418,7 @@ class spell_hun_tame_beast : public SpellScriptLoader if (Creature* target = GetExplTargetUnit()->ToCreature()) { - if (target->getLevel() > caster->getLevel()) + if (target->GetLevel() > caster->GetLevel()) return SPELL_FAILED_HIGHLEVEL; // use SMSG_PET_TAME_FAILURE? diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 7864dd84586..0302db3c9bd 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -282,7 +282,7 @@ class spell_item_arcane_shroud : public AuraScript void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - int32 diff = GetUnitOwner()->getLevel() - 60; + int32 diff = GetUnitOwner()->GetLevel() - 60; if (diff > 0) amount += 2 * diff; } @@ -365,7 +365,7 @@ class spell_item_aura_of_madness : public AuraScript PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]); + uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->GetClass()]); caster->CastSpell(caster, spellId, aurEff); if (roll_chance_i(10)) @@ -593,7 +593,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - std::vector<uint32> const& randomSpells = triggeredSpells[caster->getClass()]; + std::vector<uint32> const& randomSpells = triggeredSpells[caster->GetClass()]; if (randomSpells.empty()) return; @@ -930,7 +930,7 @@ class spell_item_flask_of_the_north : public SpellScript { Unit* caster = GetCaster(); std::vector<uint32> possibleSpells; - switch (caster->getClass()) + switch (caster->GetClass()) { case CLASS_WARLOCK: case CLASS_MAGE: @@ -1646,9 +1646,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->GetGender() == 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->GetGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break; } caster->CastSpell(caster, spellId, true); } @@ -1700,7 +1700,7 @@ class spell_item_scroll_of_recall : public SpellScript break; } - if (caster->getLevel() > maxSafeLevel) + if (caster->GetLevel() > maxSafeLevel) { caster->CastSpell(caster, SPELL_LOST, true); @@ -2195,7 +2195,7 @@ class spell_item_the_eye_of_diminution : public AuraScript void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { - int32 diff = GetUnitOwner()->getLevel() - 60; + int32 diff = GetUnitOwner()->GetLevel() - 60; if (diff > 0) amount += diff; } @@ -3280,7 +3280,7 @@ class spell_item_refocus : public SpellScript { Player* caster = GetCaster()->ToPlayer(); - if (!caster || caster->getClass() != CLASS_HUNTER) + if (!caster || caster->GetClass() != CLASS_HUNTER) return; if (caster->GetSpellHistory()->HasCooldown(SPELL_AIMED_SHOT)) @@ -3424,7 +3424,7 @@ class spell_item_soul_preserver : public AuraScript Unit* caster = eventInfo.GetActor(); - switch (caster->getClass()) + switch (caster->GetClass()) { case CLASS_DRUID: caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, aurEff); @@ -3539,7 +3539,7 @@ class spell_item_toy_train_set_pulse : public SpellScript if (Player* target = GetHitUnit()->ToPlayer()) { target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN); - if (EmotesTextSoundEntry const* soundEntry = FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->getRace(), target->getGender())) + if (EmotesTextSoundEntry const* soundEntry = FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetGender())) target->PlayDistanceSound(soundEntry->SoundId); } } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index f0b443955e1..f4155c9a209 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -393,7 +393,7 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader if (Unit* unitTarget = GetHitUnit()) { uint32 spell_id = 0; - switch (unitTarget->getClass()) + switch (unitTarget->GetClass()) { case CLASS_DRUID: spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID; @@ -2319,7 +2319,7 @@ class spell_pal_t3_6p_bonus : public SpellScriptLoader Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - switch (target->getClass()) + switch (target->GetClass()) { case CLASS_PALADIN: case CLASS_PRIEST: diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index c41e6d717b3..8a4bb75a0d1 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -262,7 +262,7 @@ public: if (Unit* pet = GetUnitOwner()) if (_tempBonus) { - PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel()); uint32 healthMod = 0; uint32 baseHealth = pInfo->health; switch (pet->GetEntry()) @@ -294,7 +294,7 @@ public: if (Unit* pet = GetUnitOwner()) if (pet->IsPet()) { - PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel()); pet->ToPet()->SetCreateHealth(pInfo->health); } } @@ -408,7 +408,7 @@ public: if (Unit* pet = GetUnitOwner()) if (_tempBonus) { - PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel()); uint32 manaMod = 0; uint32 baseMana = pInfo->mana; switch (pet->GetEntry()) @@ -436,7 +436,7 @@ public: if (Unit* pet = GetUnitOwner()) if (pet->IsPet()) { - PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel()); + PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel()); pet->ToPet()->SetCreateMana(pInfo->mana); } } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index c2454d5b9e1..1d871b7615d 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -352,7 +352,7 @@ class spell_pri_divine_aegis : public SpellScriptLoader if (AuraEffect const* aegis = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PRIEST_DIVINE_AEGIS, EFFECT_0)) absorb += aegis->GetAmount(); - absorb = std::min(absorb, eventInfo.GetProcTarget()->getLevel() * 125); + absorb = std::min(absorb, eventInfo.GetProcTarget()->GetLevel() * 125); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(absorb); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index faba3d88f0d..54cd59685b8 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -823,7 +823,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->GetGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); } } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index e765b12e932..886a18fc6cf 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -2037,7 +2037,7 @@ class spell_sha_t3_6p_bonus : public SpellScriptLoader Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - switch (target->getClass()) + switch (target->GetClass()) { case CLASS_PALADIN: case CLASS_PRIEST: |
