Skip to content

Commit

Permalink
[Core/Text] Replace old Object::MonsterYell with Unit:: Yell (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
leelf00 authored Aug 25, 2024
1 parent 3fad432 commit ad74b26
Show file tree
Hide file tree
Showing 10 changed files with 560 additions and 1,052 deletions.
484 changes: 484 additions & 0 deletions sql/updates/world/2024_08_24_01_world.sql

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions src/server/game/Entities/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2549,34 +2549,6 @@ namespace Trinity
};
} // namespace Trinity

void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());

Cell cell(p);
cell.SetNoCreate();

Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}

void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());

Cell cell(p);
cell.SetNoCreate();

Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}

void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
{
if (IsInWorld())
Expand Down
3 changes: 0 additions & 3 deletions src/server/game/Entities/Object/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,6 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation

virtual uint8 GetLevelForTarget(WorldObject const* /*target*/) const { return 1; }

void MonsterYell(const char* text, uint32 language, WorldObject const* target);
void MonsterYell(int32 textId, uint32 language, WorldObject const* target);

void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
void PlayDirectMusic(uint32 music_id, Player* target = NULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,28 @@ enum Texts

enum Spells
{
SPELL_DENOUEMENT_WISP = 32124,
SPELL_ANCIENT_SPARK = 39349,
SPELL_PROTECTION_OF_ELUNE = 38528,

SPELL_DRAIN_WORLD_TREE = 39140,
SPELL_DRAIN_WORLD_TREE_2 = 39141,

SPELL_FINGER_OF_DEATH = 31984,
SPELL_HAND_OF_DEATH = 35354,
SPELL_AIR_BURST = 32014,
SPELL_GRIP_OF_THE_LEGION = 31972,
SPELL_DOOMFIRE_STRIKE = 31903, //summons two creatures
SPELL_DOOMFIRE_SPAWN = 32074,
SPELL_DOOMFIRE = 31945,
SPELL_SOUL_CHARGE_YELLOW = 32045,
SPELL_SOUL_CHARGE_GREEN = 32051,
SPELL_SOUL_CHARGE_RED = 32052,
SPELL_UNLEASH_SOUL_YELLOW = 32054,
SPELL_UNLEASH_SOUL_GREEN = 32057,
SPELL_UNLEASH_SOUL_RED = 32053,
SPELL_FEAR = 31970,
SPELL_DENOUEMENT_WISP = 32124,
SPELL_ANCIENT_SPARK = 39349,
SPELL_PROTECTION_OF_ELUNE = 38528,

SPELL_DRAIN_WORLD_TREE = 39140,
SPELL_DRAIN_WORLD_TREE_2 = 39141,

SPELL_FINGER_OF_DEATH = 31984,
SPELL_FINGER_OF_DEATH_LAST_PHASE = 32111,
SPELL_HAND_OF_DEATH = 35354,
SPELL_AIR_BURST = 32014,
SPELL_GRIP_OF_THE_LEGION = 31972,
SPELL_DOOMFIRE_STRIKE = 31903, //summons two creatures
SPELL_DOOMFIRE_SPAWN = 32074,
SPELL_DOOMFIRE = 31945,
SPELL_SOUL_CHARGE_YELLOW = 32045,
SPELL_SOUL_CHARGE_GREEN = 32051,
SPELL_SOUL_CHARGE_RED = 32052,
SPELL_UNLEASH_SOUL_YELLOW = 32054,
SPELL_UNLEASH_SOUL_GREEN = 32057,
SPELL_UNLEASH_SOUL_RED = 32053,
SPELL_FEAR = 31970,
};

enum Summons
Expand Down Expand Up @@ -640,10 +641,49 @@ class boss_archimonde : public CreatureScript
};
};

// Protection of Elune 38528
class spell_protection_of_elune : public AuraScript
{
PrepareAuraScript(spell_protection_of_elune);

bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PROTECTION_OF_ELUNE
});
}

void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->ApplySpellImmune(SPELL_HAND_OF_DEATH, IMMUNITY_ID, SPELL_HAND_OF_DEATH, true);
target->ApplySpellImmune(SPELL_FINGER_OF_DEATH, IMMUNITY_ID, SPELL_FINGER_OF_DEATH, true);
target->ApplySpellImmune(SPELL_FINGER_OF_DEATH_LAST_PHASE, IMMUNITY_ID, SPELL_FINGER_OF_DEATH_LAST_PHASE, true);
target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FINGER_OF_DEATH_LAST_PHASE, true);
}

void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->ApplySpellImmune(SPELL_HAND_OF_DEATH, IMMUNITY_ID, SPELL_HAND_OF_DEATH, false);
target->ApplySpellImmune(SPELL_FINGER_OF_DEATH, IMMUNITY_ID, SPELL_FINGER_OF_DEATH, false);
target->ApplySpellImmune(SPELL_FINGER_OF_DEATH_LAST_PHASE, IMMUNITY_ID, SPELL_FINGER_OF_DEATH_LAST_PHASE, false);
target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FINGER_OF_DEATH_LAST_PHASE, false);
}

void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_protection_of_elune::HandleEffectApply, EFFECT_0, SPELL_AURA_SCHOOL_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_protection_of_elune::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
}
};

void AddSC_boss_archimonde()
{
new boss_archimonde();
new npc_doomfire();
new npc_doomfire_targetting();
new npc_ancient_wisp();
new spell_protection_of_elune();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file is part of the Pandaria 5.4.8 Project. See THANKS file for Copyright information
* This file is part of the Legends of Azeroth Pandaria Project. See THANKS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -39,7 +39,10 @@ enum Spawns
SPAWN_NEAR_TOWER = 2,
};

#define YELL_HURRY "Hurry, we don't have much time"
enum NPCTEXTS
{
JAINA_RETREAT_HORDE_BASE = 7
};

// Locations for summoning gargoyls and frost wyrms in special cases
float SpawnPointSpecial[3][3]=
Expand Down Expand Up @@ -959,7 +962,6 @@ void hyjalAI::WaypointReached(uint32 waypointId)
{
if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
{
me->MonsterYell(YELL_HURRY, 0, 0);
WaitForTeleport = true;
TeleportTimer = 20000;
if (me->GetEntry() == JAINA)
Expand All @@ -969,6 +971,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
if (Creature* creature = Unit::GetCreature(*me, DummyGuid))
{
hyjalAI* ai = CAST_AI(hyjalAI, creature->AI());
ai->Talk(JAINA_RETREAT_HORDE_BASE);
ai->DoMassTeleport = true;
ai->MassTeleportTimer = 20000;
creature->CastSpell(me, SPELL_MASS_TELEPORT, false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file is part of the Pandaria 5.4.8 Project. See THANKS file for Copyright information
* This file is part of the Legends of Azeroth Pandaria Project. See THANKS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -243,7 +243,6 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature* pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
//me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
Position thisPos;
thisPos.Relocate(me);
Position otherPos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file is part of the Pandaria 5.4.8 Project. See THANKS file for Copyright information
* This file is part of the Legends of Azeroth Pandaria Project. See THANKS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -526,7 +526,7 @@ class boss_grand_champion_toc5 : public CreatureScript
break;
case 3:
_phase = 4;
me->MonsterYell("Excellent work!", LANG_UNIVERSAL, 0); // SAY_START_1
me->Yell("Excellent work!", LANG_UNIVERSAL); // SAY_START_1
me->InterruptNonMeleeSpells(true);
me->RemoveAurasDueToSpell(SPELL_BLADESTORM);
DoCast(me, SPELL_KNEEL, true);
Expand Down
Loading

0 comments on commit ad74b26

Please sign in to comment.