Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
Vincent-Michael
2013-07-19 22:33:35 +02:00
18 changed files with 395 additions and 55 deletions

View File

@@ -55,7 +55,9 @@ endif()
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
if(MSVC_VERSION LESS 1800) # MSVC2012 and below
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
endif()
# Enable and treat as errors the following warnings to easily detect virtual function signature failures:
# 'function' : member function does not override any base class virtual member function

View File

@@ -1424,7 +1424,7 @@ CREATE TABLE `corpse` (
`posZ` float NOT NULL DEFAULT '0',
`orientation` float NOT NULL DEFAULT '0',
`mapId` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier',
`phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1',
`phaseMask` int(10) unsigned NOT NULL DEFAULT '1',
`displayId` int(10) unsigned NOT NULL DEFAULT '0',
`itemCache` text NOT NULL,
`bytes1` int(10) unsigned NOT NULL DEFAULT '0',

View File

@@ -0,0 +1 @@
ALTER TABLE `corpse` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';

View File

@@ -0,0 +1,5 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (69051,69023,69048);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(69051, 'spell_devourer_of_souls_mirrored_soul'),
(69023, 'spell_devourer_of_souls_mirrored_soul_proc'),
(69048, 'spell_devourer_of_souls_mirrored_soul_target_selector');

View File

@@ -0,0 +1,26 @@
-- TEXT INSERTS
DELETE FROM `creature_text` WHERE `entry` IN (31301, 31428, 31306);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(31301, 0, 0, "You dare to think you have thwarted my will? That you have broken my plans?", 12, 0, 100, 25, 0, 0, "LK SAY 1"),
(31301, 1, 0, "You have accomplished nothing!", 12, 0, 100, 22, 0, 0, "LK SAY 2"),
(31301, 2, 0, "Your feeble resistance has only hastened your doom.", 12, 0, 100, 25, 0, 0, "LK SAY 3"),
(31301, 3, 0, "So spout your platitudes and flail until you are spent. In the end, you will be mine, and Morbidus will be the harbinger of your death!", 12, 0, 100, 22, 0, 0, "LK SAY 4"),
(31301, 4, 0, "Morbidus, show them what happens to those who defy the will of their king!", 12, 0, 100, 25, 0, 0, "LK SAY 5"),
(31428, 0, 0, "You will pay for what you've done! For the Argent Crusade!", 12, 0, 100, 0, 0, 0, "OLAKIN SAY 1"),
(31306, 0, 0, "Knights of the Ebon Blade, prepare for battle!", 12, 0, 100, 1, 0, 0, 'DHAKAR SAY 1');
-- ScriptName Updates
UPDATE `creature_template` SET `ScriptName`='npc_margrave_dhakar' WHERE `entry`=31306;
UPDATE `creature_template` SET `ScriptName`='npc_morbidus' WHERE `entry`=30698;
-- Template updates
UPDATE `creature_template` SET `faction_A`=2102, `faction_H`=2102, `exp`=2, `minlevel`=80, `maxlevel`=80, `unit_flags`=`unit_flags`|832, `speed_run`=0.99206, `VehicleId`=271 WHERE `entry`=30698; -- Morbidus
UPDATE `creature_template` SET `faction_A`=1770, `faction_H`=1770, `npcflag`=`npcflag`|1, `gossip_menu_id`=10060 WHERE `entry`=31306; -- Margrave Dhakar
UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=7.5,`gender`=0 WHERE `modelid`=31176; -- Morbidus
UPDATE `creature_model_info` SET `bounding_radius`=0.3825,`combat_reach`=1.875,`gender`=0 WHERE `modelid`=27558; -- Margrave Dhakar
DELETE FROM `creature_template_addon` WHERE `entry` IN (30698, 31306);
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(30698,0,0,1,0, NULL), -- Morbidus
(31306,0,0,1,0, NULL); -- Margrave Dhakar

View File

@@ -0,0 +1,4 @@
-- equipment for Margrave Dhakar
DELETE FROM `creature_equip_template` WHERE `entry` = 31306;
INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`) VALUES
(31306, 1, 41371, 0, 0);

View File

@@ -0,0 +1,2 @@
ALTER TABLE `gameobject` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';
ALTER TABLE `creature` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';

View File

@@ -121,7 +121,7 @@ void Corpse::SaveToDB()
stmt->setUInt32(index++, uint32(m_time)); // time
stmt->setUInt8 (index++, GetType()); // corpseType
stmt->setUInt32(index++, GetInstanceId()); // instanceId
stmt->setUInt16(index++, GetPhaseMask()); // phaseMask
stmt->setUInt32(index++, GetPhaseMask()); // phaseMask
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
@@ -184,7 +184,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
m_time = time_t(fields[11].GetUInt32());
uint32 instanceId = fields[13].GetUInt32();
uint32 phaseMask = fields[14].GetUInt16();
uint32 phaseMask = fields[14].GetUInt32();
// place
SetLocationInstanceId(instanceId);

View File

@@ -997,7 +997,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
stmt->setUInt32(index++, GetEntry());
stmt->setUInt16(index++, uint16(mapid));
stmt->setUInt8(index++, spawnMask);
stmt->setUInt16(index++, uint16(GetPhaseMask()));
stmt->setUInt32(index++, GetPhaseMask());
stmt->setUInt32(index++, displayId);
stmt->setInt32(index++, int32(GetCurrentEquipmentId()));
stmt->setFloat(index++, GetPositionX());

View File

@@ -247,7 +247,7 @@ struct CreatureData
CreatureData() : dbData(true) {}
uint32 id; // entry in creature_template
uint16 mapid;
uint16 phaseMask;
uint32 phaseMask;
uint32 displayid;
int8 equipmentId;
float posX;

View File

@@ -713,7 +713,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
stmt->setUInt32(index++, GetEntry());
stmt->setUInt16(index++, uint16(mapid));
stmt->setUInt8(index++, spawnMask);
stmt->setUInt16(index++, uint16(GetPhaseMask()));
stmt->setUInt32(index++, GetPhaseMask());
stmt->setFloat(index++, GetPositionX());
stmt->setFloat(index++, GetPositionY());
stmt->setFloat(index++, GetPositionZ());

View File

@@ -583,7 +583,7 @@ struct GameObjectData
explicit GameObjectData() : dbData(true) {}
uint32 id; // entry in gamobject_template
uint16 mapid;
uint16 phaseMask;
uint32 phaseMask;
float posX;
float posY;
float posZ;

View File

@@ -1394,6 +1394,7 @@ class Unit : public WorldObject
int32 GetPower(Powers power) const;
int32 GetMinPower(Powers power) const { return power == POWER_ECLIPSE ? -100 : 0; }
int32 GetMaxPower(Powers power) const;
int32 CountPctFromMaxPower(Powers power, int32 pct) const { return CalculatePct(GetMaxPower(power), pct); }
void SetPower(Powers power, int32 val);
void SetMaxPower(Powers power, int32 val);
// returns the change in power

View File

@@ -1587,7 +1587,7 @@ void ObjectMgr::LoadCreatures()
data.curmana = fields[13].GetUInt32();
data.movementType = fields[14].GetUInt8();
data.spawnMask = fields[15].GetUInt8();
data.phaseMask = fields[16].GetUInt16();
data.phaseMask = fields[16].GetUInt32();
int16 gameEvent = fields[17].GetInt8();
uint32 PoolId = fields[18].GetUInt32();
data.npcflag = fields[19].GetUInt32();
@@ -1939,9 +1939,9 @@ void ObjectMgr::LoadGameobjects()
if (data.spawnMask & ~spawnMasks[data.mapid])
TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
data.phaseMask = fields[15].GetUInt16();
data.phaseMask = fields[15].GetUInt32();
int16 gameEvent = fields[16].GetInt8();
uint32 PoolId = fields[17].GetUInt32();
uint32 PoolId = fields[17].GetUInt32();
if (data.rotation2 < -1.0f || data.rotation2 > 1.0f)
{
@@ -2542,7 +2542,7 @@ void ObjectMgr::LoadItemTemplates()
itemTemplate.Name1 = fields[4].GetString();
itemTemplate.DisplayInfoID = fields[5].GetUInt32();
itemTemplate.Quality = uint32(fields[6].GetUInt8());
itemTemplate.Flags = uint32(fields[7].GetUInt32());
itemTemplate.Flags = fields[7].GetUInt32();
itemTemplate.Flags2 = fields[8].GetUInt32();
itemTemplate.Unk430_1 = fields[9].GetFloat();
itemTemplate.Unk430_2 = fields[10].GetFloat();

View File

@@ -279,8 +279,8 @@ public:
bool found = false;
float x, y, z, o;
uint32 guidLow, id;
uint16 mapId, phase;
uint32 guidLow, id, phase;
uint16 mapId;
uint32 poolId;
do
@@ -293,7 +293,7 @@ public:
z = fields[4].GetFloat();
o = fields[5].GetFloat();
mapId = fields[6].GetUInt16();
phase = fields[7].GetUInt16();
phase = fields[7].GetUInt32();
poolId = sPoolMgr->IsPartOfAPool<GameObject>(guidLow);
if (!poolId || sPoolMgr->IsSpawnedObject<GameObject>(guidLow))
found = true;

View File

@@ -216,7 +216,7 @@ public:
void SummonedCreatureDespawn(Creature* summon) OVERRIDE
{
uint32 phase= summon->GetPhaseMask();
uint32 phase = summon->GetPhaseMask();
uint32 nextPhase = 0;
Summons.Despawn(summon);

View File

@@ -17,9 +17,11 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "forge_of_souls.h"
#include "Player.h"
#include "SpellInfo.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "forge_of_souls.h"
/*
* @todo
@@ -48,7 +50,10 @@ enum Spells
{
SPELL_PHANTOM_BLAST = 68982,
H_SPELL_PHANTOM_BLAST = 70322,
SPELL_MIRRORED_SOUL = 69051,
SPELL_MIRRORED_SOUL_PROC_AURA = 69023,
SPELL_MIRRORED_SOUL_DAMAGE = 69034,
SPELL_MIRRORED_SOUL_TARGET_SELECTOR = 69048,
SPELL_MIRRORED_SOUL_BUFF = 69051,
SPELL_WELL_OF_SOULS = 68820,
SPELL_UNLEASHED_SOULS = 68939,
SPELL_WAILING_SOULS_STARTING = 68912, // Initial spell cast at begining of wailing souls phase
@@ -145,7 +150,6 @@ class boss_devourer_of_souls : public CreatureScript
summons.DespawnAll();
threeFaced = true;
mirroredSoulTarget = 0;
instance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED);
}
@@ -165,23 +169,6 @@ class boss_devourer_of_souls : public CreatureScript
instance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) OVERRIDE
{
if (mirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
{
if (Player* player = Unit::GetPlayer(*me, mirroredSoulTarget))
{
if (player->GetAura(SPELL_MIRRORED_SOUL))
{
int32 mirrorDamage = (uiDamage* 45)/100;
me->CastCustomSpell(player, 69034, &mirrorDamage, 0, 0, true);
}
else
mirroredSoulTarget = 0;
}
}
}
void KilledUnit(Unit* victim) OVERRIDE
{
if (victim->GetTypeId() != TYPEID_PLAYER)
@@ -270,12 +257,8 @@ class boss_devourer_of_souls : public CreatureScript
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
break;
case EVENT_MIRRORED_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{
mirroredSoulTarget = target->GetGUID();
DoCast(target, SPELL_MIRRORED_SOUL);
Talk(EMOTE_MIRRORED_SOUL);
}
DoCastAOE(SPELL_MIRRORED_SOUL_TARGET_SELECTOR);
Talk(EMOTE_MIRRORED_SOUL);
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000, 30000));
break;
case EVENT_WELL_OF_SOULS:
@@ -358,8 +341,6 @@ class boss_devourer_of_souls : public CreatureScript
float beamAngle;
float beamAngleDiff;
int8 wailingSoulTick;
uint64 mirroredSoulTarget;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
@@ -368,6 +349,139 @@ class boss_devourer_of_souls : public CreatureScript
}
};
// 69051 - Mirrored Soul
class spell_devourer_of_souls_mirrored_soul : public SpellScriptLoader
{
public:
spell_devourer_of_souls_mirrored_soul() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul") { }
class spell_devourer_of_souls_mirrored_soul_SpellScript : public SpellScript
{
PrepareSpellScript(spell_devourer_of_souls_mirrored_soul_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_PROC_AURA))
return false;
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
target->CastSpell(GetCaster(), SPELL_MIRRORED_SOUL_PROC_AURA, true);
}
void Register() OVERRIDE
{
OnEffectHitTarget += SpellEffectFn(spell_devourer_of_souls_mirrored_soul_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_devourer_of_souls_mirrored_soul_SpellScript();
}
};
// 69023 - Mirrored Soul (Proc)
class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader
{
public:
spell_devourer_of_souls_mirrored_soul_proc() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul_proc") { }
class spell_devourer_of_souls_mirrored_soul_proc_AuraScript : public AuraScript
{
PrepareAuraScript(spell_devourer_of_souls_mirrored_soul_proc_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_DAMAGE))
return false;
return true;
}
bool Load() OVERRIDE
{
_procTarget = NULL;
return true;
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
_procTarget = GetCaster();
return _procTarget && _procTarget->IsAlive();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45));
GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, _procTarget, true);
}
void Register() OVERRIDE
{
DoCheckProc += AuraCheckProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
private:
Unit* _procTarget;
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_devourer_of_souls_mirrored_soul_proc_AuraScript();
}
};
// 69048 - Mirrored Soul (Target Selector)
class spell_devourer_of_souls_mirrored_soul_target_selector : public SpellScriptLoader
{
public:
spell_devourer_of_souls_mirrored_soul_target_selector() : SpellScriptLoader("spell_devourer_of_souls_mirrored_soul_target_selector") { }
class spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript : public SpellScript
{
PrepareSpellScript(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_MIRRORED_SOUL_BUFF))
return false;
return true;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
targets.clear();
targets.push_back(target);
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_MIRRORED_SOUL_BUFF, false);
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_devourer_of_souls_mirrored_soul_target_selector_SpellScript();
}
};
class achievement_three_faced : public AchievementCriteriaScript
{
public:
@@ -391,5 +505,8 @@ class achievement_three_faced : public AchievementCriteriaScript
void AddSC_boss_devourer_of_souls()
{
new boss_devourer_of_souls();
new spell_devourer_of_souls_mirrored_soul();
new spell_devourer_of_souls_mirrored_soul_proc();
new spell_devourer_of_souls_mirrored_soul_target_selector();
new achievement_three_faced();
}

View File

@@ -16,17 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Icecrown
SD%Complete: 100
SDComment: Quest support: 12807
SDCategory: Icecrown
EndScriptData */
/* ContentData
npc_arete
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
@@ -966,6 +955,197 @@ class npc_frostbrood_skytalon : public CreatureScript
}
};
/*######
## The Flesh Giant Champion - Id: 13235
######*/
enum FleshGiant
{
QUEST_FLESH_GIANT_CHAMPION = 13235,
NPC_MORBIDUS = 30698,
NPC_LICH_KING = 31301,
NPC_OLAKIN = 31428,
NPC_DHAKAR = 31306,
FACTION_HOSTILE = 14,
FACTION_BASIC = 2102,
EVENT_INTRO = 1,
EVENT_LK_SAY_1 = 2,
EVENT_LK_SAY_2 = 3,
EVENT_LK_SAY_3 = 4,
EVENT_LK_SAY_4 = 5,
EVENT_LK_SAY_5 = 6,
EVENT_OUTRO = 7,
EVENT_START = 8,
SPELL_SIMPLE_TELEPORT = 64195,
SAY_DHAKAR_START = 0,
SAY_LK_1 = 0,
SAY_LK_2 = 1,
SAY_LK_3 = 2,
SAY_LK_4 = 3,
SAY_LK_5 = 4,
SAY_OLAKIN_PAY = 0
};
class npc_margrave_dhakar : public CreatureScript
{
public:
npc_margrave_dhakar() : CreatureScript("npc_margrave_dhakar") { }
struct npc_margrave_dhakarAI : public ScriptedAI
{
npc_margrave_dhakarAI(Creature* creature) : ScriptedAI(creature) , _summons(me), _lichKingGuid(0) { }
void Reset() OVERRIDE
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
_events.Reset();
_summons.DespawnAll();
}
void sGossipSelect(Player* player, uint32 sender, uint32 action) OVERRIDE
{
if (player->GetQuestStatus(QUEST_FLESH_GIANT_CHAMPION) == QUEST_STATUS_INCOMPLETE && !player->IsInCombat())
{
if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
{
_events.ScheduleEvent(EVENT_INTRO, 1000);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
}
}
void UpdateAI(uint32 diff) OVERRIDE
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_INTRO:
{
Talk(SAY_DHAKAR_START);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
{
Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ());
_lichKingGuid = lichKing->GetGUID();
lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ());
lichKing->SetFacingTo(morbidus->GetOrientation());
lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true);
}
_events.ScheduleEvent(EVENT_LK_SAY_1, 5000);
break;
}
case EVENT_LK_SAY_1:
{
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->AI()->Talk(SAY_LK_1);
_events.ScheduleEvent(EVENT_LK_SAY_2, 5000);
break;
}
case EVENT_LK_SAY_2:
{
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->AI()->Talk(SAY_LK_2);
_events.ScheduleEvent(EVENT_LK_SAY_3, 5000);
break;
}
case EVENT_LK_SAY_3:
{
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->AI()->Talk(SAY_LK_3);
_events.ScheduleEvent(EVENT_LK_SAY_4, 5000);
break;
}
case EVENT_LK_SAY_4:
{
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->AI()->Talk(SAY_LK_4);
_events.ScheduleEvent(EVENT_OUTRO, 12000);
break;
}
case EVENT_LK_SAY_5:
{
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->AI()->Talk(SAY_LK_5);
_events.ScheduleEvent(EVENT_OUTRO, 8000);
break;
}
case EVENT_OUTRO:
{
if (Creature* olakin = me->FindNearestCreature(NPC_OLAKIN, 50.0f, true))
olakin->AI()->Talk(SAY_OLAKIN_PAY);
if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
lichKing->DespawnOrUnsummon(0);
_events.ScheduleEvent(EVENT_START, 5000);
break;
}
case EVENT_START:
{
if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
{
morbidus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_DISABLE_MOVE);
morbidus->setFaction(FACTION_HOSTILE);
}
break;
}
}
}
DoMeleeAttackIfReady();
}
private:
EventMap _events;
uint64 _lichKingGuid;
SummonList _summons;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_margrave_dhakarAI(creature);
}
};
class npc_morbidus : public CreatureScript
{
public:
npc_morbidus() : CreatureScript("npc_morbidus") { }
struct npc_morbidusAI : public ScriptedAI
{
npc_morbidusAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() OVERRIDE
{
if (Creature* dhakar = me->FindNearestCreature(NPC_DHAKAR, 50.0f, true))
dhakar->AI()->Reset();
// this will prevent the event to start without morbidus being alive
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
me->setFaction(FACTION_BASIC);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_morbidusAI(creature);
}
};
void AddSC_icecrown()
{
new npc_arete;
@@ -976,4 +1156,6 @@ void AddSC_icecrown()
new npc_tournament_training_dummy;
new npc_blessed_banner();
new npc_frostbrood_skytalon();
new npc_margrave_dhakar();
new npc_morbidus();
}