Merge branch 'master' into Playerbot
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "DBCFileLoader.h"
|
||||
#include "Errors.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
DBCFileLoader::DBCFileLoader() : recordSize(0), recordCount(0), fieldCount(0), stringSize(0), fieldsOffset(nullptr), data(nullptr), stringTable(nullptr) { }
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "Dynamic/TypeList.h"
|
||||
#include "GridRefMgr.h"
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define APPENDERFILE_H
|
||||
|
||||
#include "Appender.h"
|
||||
#include <atomic>
|
||||
#include <atomic> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
#include <vector>
|
||||
|
||||
class AppenderFile : public Appender
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "Duration.h"
|
||||
#include "MPSCQueue.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <memory> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define MPSCQueue_h__
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
namespace Acore::Impl
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "Define.h"
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace ByteConverter
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef IteratorPair_h__
|
||||
#define IteratorPair_h__
|
||||
|
||||
#include <utility>
|
||||
#include <vector> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
|
||||
namespace Acore
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include "SFMTRand.h"
|
||||
#include "Timer.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <random>
|
||||
|
||||
#if defined(__aarch64__)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define AC_SMARTENUM_H
|
||||
|
||||
#include "IteratorPair.h"
|
||||
#include <iterator>
|
||||
|
||||
struct EnumText
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "Log.h"
|
||||
#include "StartProcess.h"
|
||||
#include "UpdateFetcher.h"
|
||||
#include "QueryResult.h"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@@ -7772,7 +7772,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
{
|
||||
if (!victim || !victim->IsAlive() || victim->HasSpellCooldown(20267))
|
||||
return false;
|
||||
// 2% of base mana
|
||||
|
||||
auto* caster = triggeredByAura->GetBase()->GetCaster();
|
||||
if (!caster || !victim->IsFriendlyTo(caster))
|
||||
return false;
|
||||
|
||||
// 2% of base health
|
||||
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
||||
victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
|
||||
victim->AddSpellCooldown(20267, 0, 4 * IN_MILLISECONDS);
|
||||
@@ -7784,6 +7789,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
if (!victim || !victim->IsAlive() || !victim->HasActivePowerType(POWER_MANA) || victim->HasSpellCooldown(20268))
|
||||
return false;
|
||||
|
||||
auto* caster = triggeredByAura->GetBase()->GetCaster();
|
||||
if (!caster || !victim->IsFriendlyTo(caster))
|
||||
return false;
|
||||
|
||||
// 2% of base mana
|
||||
basepoints0 = int32(CalculatePct(victim->GetCreateMana(), 2));
|
||||
victim->CastCustomSpell(victim, 20268, &basepoints0, nullptr, nullptr, true, 0, triggeredByAura);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define ACORE_GRIDNOTIFIERSIMPL_H
|
||||
|
||||
#include "Corpse.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Object.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -29,15 +29,14 @@
|
||||
template<class T>
|
||||
RandomMovementGenerator<T>::~RandomMovementGenerator() { }
|
||||
|
||||
template<>
|
||||
RandomMovementGenerator<Creature>::~RandomMovementGenerator()
|
||||
{
|
||||
delete _pathGenerator;
|
||||
}
|
||||
template RandomMovementGenerator<Creature>::~RandomMovementGenerator();
|
||||
|
||||
template<>
|
||||
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
|
||||
{
|
||||
if (!creature)
|
||||
return;
|
||||
|
||||
if (creature->_moveState != MAP_OBJECT_CELL_MOVE_NONE)
|
||||
return;
|
||||
|
||||
@@ -135,7 +134,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
|
||||
else // ground
|
||||
{
|
||||
if (!_pathGenerator)
|
||||
_pathGenerator = new PathGenerator(creature);
|
||||
_pathGenerator = std::make_unique<PathGenerator>(creature);
|
||||
else
|
||||
_pathGenerator->Clear();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
TimeTrackerSmall _nextMoveTime;
|
||||
uint8 _moveCount;
|
||||
float _wanderDistance;
|
||||
PathGenerator* _pathGenerator;
|
||||
std::unique_ptr<PathGenerator> _pathGenerator;
|
||||
std::vector<G3D::Vector3> _destinationPoints;
|
||||
std::vector<uint8> _validPointsVector[RANDOM_POINTS_NUMBER + 1];
|
||||
uint8 _currentPoint;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "AllScriptsObjects.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "LFGScripts.h"
|
||||
#include "ScriptObject.h"
|
||||
#include "ScriptSystem.h"
|
||||
#include "SmartAI.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
@@ -1276,7 +1276,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
{
|
||||
// some auras remove at aura remove
|
||||
if (!itr->second->IsFitToRequirements(target->ToPlayer(), zone, area))
|
||||
if (!itr->second->IsFitToRequirements(target->ToPlayer(), zone, area) && !apply)
|
||||
target->RemoveAurasDueToSpell(itr->second->spellId);
|
||||
// some auras applied at aura apply
|
||||
else if (itr->second->autocast)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "BattlegroundIC.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "BattlegroundSA.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
|
||||
@@ -4000,12 +4000,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
|
||||
});
|
||||
|
||||
// Luffa
|
||||
ApplySpellFix({ 23595 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].BasePoints = 1; // Remove only 1 bleed effect
|
||||
});
|
||||
|
||||
// Eye of Kilrogg Passive (DND)
|
||||
ApplySpellFix({ 2585 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
@@ -4856,6 +4850,18 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
|
||||
});
|
||||
|
||||
// Fury
|
||||
ApplySpellFix({ 40601 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
|
||||
});
|
||||
|
||||
// Black Qiraji Battle Tank
|
||||
ApplySpellFix({ 26655, 26656 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AuraInterruptFlags &= ~(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_TELEPORTED);
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
@@ -25,7 +25,7 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
if (!Validate(entry))
|
||||
{
|
||||
LOG_ERROR("scripts.spells", "_SpellScript::_Validate: Spell `{}` did not pass Validate() function of script `{}` - script will not be added to the spell", entry->Id, m_scriptName->c_str());
|
||||
LOG_ERROR("spells.scripts", "_SpellScript::_Validate: Spell `{}` did not pass Validate() function of script `{}` - script will not be added to the spell", entry->Id, m_scriptName->c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -35,7 +35,7 @@ bool _SpellScript::_ValidateSpellInfo(uint32 spellId)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell {} does not exist.", spellId);
|
||||
LOG_ERROR("spells.scripts", "_SpellScript::ValidateSpellInfo: Spell {} does not exist.", spellId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "ObjectGuid.h"
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
enum DumpTableType
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "ARC4.h"
|
||||
#include "AuthDefines.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "WardenPayloadMgr.h"
|
||||
#include <array>
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "Channel.h"
|
||||
#include "Chat.h"
|
||||
#include "CommandScript.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Language.h"
|
||||
|
||||
@@ -153,30 +153,19 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_gnomeregan_radiation_bolt : public SpellScriptLoader
|
||||
class spell_gnomeregan_radiation_bolt : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_gnomeregan_radiation_bolt() : SpellScriptLoader("spell_gnomeregan_radiation_bolt") { }
|
||||
PrepareSpellScript(spell_gnomeregan_radiation_bolt);
|
||||
|
||||
class spell_gnomeregan_radiation_bolt_SpellScript : public SpellScript
|
||||
void HandleTriggerSpell(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_gnomeregan_radiation_bolt_SpellScript);
|
||||
if (roll_chance_i(80))
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void HandleTriggerSpell(SpellEffIndex effIndex)
|
||||
{
|
||||
if (roll_chance_i(80))
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_gnomeregan_radiation_bolt_SpellScript;
|
||||
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -184,5 +173,5 @@ void AddSC_instance_gnomeregan()
|
||||
{
|
||||
new instance_gnomeregan();
|
||||
new npc_kernobee();
|
||||
new spell_gnomeregan_radiation_bolt();
|
||||
RegisterSpellScript(spell_gnomeregan_radiation_bolt);
|
||||
}
|
||||
|
||||
@@ -157,31 +157,30 @@ private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScriptLoader
|
||||
enum DeathComesFromOnHigh
|
||||
{
|
||||
public:
|
||||
spell_q12641_death_comes_from_on_high_summon_ghouls() : SpellScriptLoader("spell_q12641_death_comes_from_on_high_summon_ghouls") { }
|
||||
SUMMON_GHOULS_ON_SCARLET_CRUSADE = 54522
|
||||
};
|
||||
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript : public SpellScript
|
||||
class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript);
|
||||
return ValidateSpellInfo({ SUMMON_GHOULS_ON_SCARLET_CRUSADE });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 54522, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
return new spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript();
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SUMMON_GHOULS_ON_SCARLET_CRUSADE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_summon_ghouls::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -406,64 +405,47 @@ enum GiftOfTheHarvester
|
||||
SAY_GOTHIK_PIT = 0
|
||||
};
|
||||
|
||||
class spell_item_gift_of_the_harvester : public SpellScriptLoader
|
||||
class spell_item_gift_of_the_harvester : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_item_gift_of_the_harvester() : SpellScriptLoader("spell_item_gift_of_the_harvester") { }
|
||||
PrepareSpellScript(spell_item_gift_of_the_harvester);
|
||||
|
||||
class spell_item_gift_of_the_harvester_SpellScript : public SpellScript
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
PrepareSpellScript(spell_item_gift_of_the_harvester_SpellScript);
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
std::list<Creature*> ghouls;
|
||||
GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL);
|
||||
if (ghouls.size() >= MAX_GHOULS)
|
||||
{
|
||||
std::list<Creature*> ghouls;
|
||||
GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL);
|
||||
if (ghouls.size() >= MAX_GHOULS)
|
||||
{
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_item_gift_of_the_harvester_SpellScript();
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q12698_the_gift_that_keeps_on_giving : public SpellScriptLoader
|
||||
class spell_q12698_the_gift_that_keeps_on_giving : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_q12698_the_gift_that_keeps_on_giving() : SpellScriptLoader("spell_q12698_the_gift_that_keeps_on_giving") { }
|
||||
PrepareSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
|
||||
|
||||
class spell_q12698_the_gift_that_keeps_on_giving_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_q12698_the_gift_that_keeps_on_giving_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_SCARLET_GHOST });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetOriginalCaster() && GetHitUnit())
|
||||
GetOriginalCaster()->CastSpell(GetHitUnit(), urand(0, 1) ? GetEffectValue() : SPELL_SUMMON_SCARLET_GHOST, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12698_the_gift_that_keeps_on_giving_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_q12698_the_gift_that_keeps_on_giving_SpellScript();
|
||||
if (GetOriginalCaster() && GetHitUnit())
|
||||
GetOriginalCaster()->CastSpell(GetHitUnit(), urand(0, 1) ? GetEffectValue() : SPELL_SUMMON_SCARLET_GHOST, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12698_the_gift_that_keeps_on_giving::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1237,10 +1219,10 @@ void AddSC_the_scarlet_enclave_c1()
|
||||
{
|
||||
// Ours
|
||||
RegisterCreatureAI(npc_eye_of_acherus);
|
||||
new spell_q12641_death_comes_from_on_high_summon_ghouls();
|
||||
RegisterSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls);
|
||||
new npc_death_knight_initiate();
|
||||
new spell_item_gift_of_the_harvester();
|
||||
new spell_q12698_the_gift_that_keeps_on_giving();
|
||||
RegisterSpellScript(spell_item_gift_of_the_harvester);
|
||||
RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
|
||||
new npc_scarlet_ghoul();
|
||||
new npc_dkc1_gothik();
|
||||
new npc_scarlet_cannon();
|
||||
|
||||
@@ -1177,75 +1177,53 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_chapter5_light_of_dawn_aura : public SpellScriptLoader
|
||||
class spell_chapter5_light_of_dawn_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_chapter5_light_of_dawn_aura() : SpellScriptLoader("spell_chapter5_light_of_dawn_aura") { }
|
||||
PrepareAuraScript(spell_chapter5_light_of_dawn_aura);
|
||||
|
||||
class spell_chapter5_light_of_dawn_aura_AuraScript : public AuraScript
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_chapter5_light_of_dawn_aura_AuraScript);
|
||||
GetUnitOwner()->Dismount();
|
||||
GetUnitOwner()->SetCanFly(true);
|
||||
GetUnitOwner()->SetDisableGravity(true);
|
||||
GetUnitOwner()->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->Dismount();
|
||||
GetUnitOwner()->SetCanFly(true);
|
||||
GetUnitOwner()->SetDisableGravity(true);
|
||||
GetUnitOwner()->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetCanFly(false);
|
||||
GetUnitOwner()->SetDisableGravity(false);
|
||||
GetUnitOwner()->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
GetUnitOwner()->GetMotionMaster()->MoveFall();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_chapter5_light_of_dawn_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_chapter5_light_of_dawn_aura_AuraScript();
|
||||
GetUnitOwner()->SetCanFly(false);
|
||||
GetUnitOwner()->SetDisableGravity(false);
|
||||
GetUnitOwner()->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
GetUnitOwner()->GetMotionMaster()->MoveFall();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_chapter5_light_of_dawn_aura::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_chapter5_light_of_dawn_aura::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_chapter5_rebuke : public SpellScriptLoader
|
||||
class spell_chapter5_rebuke : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_chapter5_rebuke() : SpellScriptLoader("spell_chapter5_rebuke") { }
|
||||
PrepareSpellScript(spell_chapter5_rebuke);
|
||||
|
||||
class spell_chapter5_rebuke_SpellScript : public SpellScript
|
||||
void HandleLeapBack(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_chapter5_rebuke_SpellScript);
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
unitTarget->KnockbackFrom(2282.86f, -5263.45f, 40.0f, 8.0f);
|
||||
}
|
||||
|
||||
void HandleLeapBack(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
unitTarget->KnockbackFrom(2282.86f, -5263.45f, 40.0f, 8.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_chapter5_rebuke_SpellScript::HandleLeapBack, EFFECT_0, SPELL_EFFECT_LEAP_BACK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_chapter5_rebuke_SpellScript();
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_chapter5_rebuke::HandleLeapBack, EFFECT_0, SPELL_EFFECT_LEAP_BACK);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_the_scarlet_enclave_c5()
|
||||
{
|
||||
new npc_highlord_darion_mograine();
|
||||
new spell_chapter5_light_of_dawn_aura();
|
||||
new spell_chapter5_rebuke();
|
||||
RegisterSpellScript(spell_chapter5_light_of_dawn_aura);
|
||||
RegisterSpellScript(spell_chapter5_rebuke);
|
||||
}
|
||||
|
||||
@@ -246,86 +246,64 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_scholomance_fixate : public SpellScriptLoader
|
||||
class spell_scholomance_fixate_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_scholomance_fixate() : SpellScriptLoader("spell_scholomance_fixate") { }
|
||||
PrepareAuraScript(spell_scholomance_fixate_aura);
|
||||
|
||||
class spell_scholomance_fixate_AuraScript : public AuraScript
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_fixate_AuraScript);
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_scholomance_fixate_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_scholomance_fixate_AuraScript();
|
||||
Unit* target = GetTarget();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->TauntFadeOut(target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_scholomance_fixate_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_fixate_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_scholomance_boon_of_life : public SpellScriptLoader
|
||||
class spell_scholomance_boon_of_life_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_scholomance_boon_of_life() : SpellScriptLoader("spell_scholomance_boon_of_life") { }
|
||||
PrepareAuraScript(spell_scholomance_boon_of_life_aura);
|
||||
|
||||
class spell_scholomance_boon_of_life_AuraScript : public AuraScript
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_scholomance_boon_of_life_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
creature->AI()->AttackStart(caster);
|
||||
creature->AddThreat(caster, 10000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
|
||||
{
|
||||
creature->AI()->Talk(TALK_RAS_HUMAN);
|
||||
creature->SetDisplayId(MODEL_RAS_HUMAN);
|
||||
creature->SetHealth(target->GetMaxHealth());
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
instance->SetData(DATA_RAS_HUMAN, 1);
|
||||
}
|
||||
}
|
||||
{
|
||||
creature->AI()->AttackStart(caster);
|
||||
creature->AddThreat(caster, 10000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_boon_of_life_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_scholomance_boon_of_life_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_scholomance_boon_of_life_AuraScript();
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
|
||||
{
|
||||
creature->AI()->Talk(TALK_RAS_HUMAN);
|
||||
creature->SetDisplayId(MODEL_RAS_HUMAN);
|
||||
creature->SetHealth(target->GetMaxHealth());
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
instance->SetData(DATA_RAS_HUMAN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_scholomance_boon_of_life_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_scholomance_boon_of_life_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -460,7 +438,7 @@ public:
|
||||
void AddSC_instance_scholomance()
|
||||
{
|
||||
new instance_scholomance();
|
||||
new spell_scholomance_fixate();
|
||||
new spell_scholomance_boon_of_life();
|
||||
RegisterSpellScript(spell_scholomance_fixate_aura);
|
||||
RegisterSpellScript(spell_scholomance_boon_of_life_aura);
|
||||
new npc_scholomance_occultist();
|
||||
}
|
||||
|
||||
@@ -137,42 +137,31 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader
|
||||
class spell_shadowfang_keep_haunting_spirits_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { }
|
||||
PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_aura);
|
||||
|
||||
class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript);
|
||||
isPeriodic = true;
|
||||
amplitude = irand(30 * IN_MILLISECONDS, 90 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = irand(30 * IN_MILLISECONDS, 90 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)nullptr, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
void HandleUpdatePeriodic(AuraEffect* aurEff)
|
||||
{
|
||||
aurEff->CalculatePeriodic(GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleDummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_shadowfang_keep_haunting_spirits_AuraScript();
|
||||
GetTarget()->CastSpell((Unit*)nullptr, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
void HandleUpdatePeriodic(AuraEffect* aurEff)
|
||||
{
|
||||
aurEff->CalculatePeriodic(GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_aura::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_aura::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_aura::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -182,58 +171,70 @@ enum ForsakenSpells
|
||||
SPELL_FORSAKEN_SKILL_SHADOW = 7053
|
||||
};
|
||||
|
||||
class spell_shadowfang_keep_forsaken_skills : public SpellScriptLoader
|
||||
class spell_shadowfang_keep_forsaken_skills_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_shadowfang_keep_forsaken_skills() : SpellScriptLoader("spell_shadowfang_keep_forsaken_skills") { }
|
||||
PrepareAuraScript(spell_shadowfang_keep_forsaken_skills_aura);
|
||||
|
||||
class spell_shadowfang_keep_forsaken_skills_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_shadowfang_keep_forsaken_skills_AuraScript);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_forsakenSpell = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_forsakenSpell);
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_shadowfang_keep_forsaken_skills_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_forsaken_skills_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _forsakenSpell;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_shadowfang_keep_forsaken_skills_AuraScript();
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_FORSAKEN_SKILL_SWORD,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+1,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+2,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+3,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+4,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+5,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+6,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+7,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+8,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+9,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+10,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+11,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+12,
|
||||
SPELL_FORSAKEN_SKILL_SWORD+13,
|
||||
// SPELL_FORSAKEN_SKILL_SHADOW-1, // not used
|
||||
SPELL_FORSAKEN_SKILL_SHADOW,
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_forsakenSpell = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_forsakenSpell);
|
||||
_forsakenSpell = urand(SPELL_FORSAKEN_SKILL_SWORD, SPELL_FORSAKEN_SKILL_SHADOW);
|
||||
if (_forsakenSpell == SPELL_FORSAKEN_SKILL_SHADOW - 1)
|
||||
++_forsakenSpell;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _forsakenSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_shadowfang_keep_forsaken_skills_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_forsaken_skills_aura::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _forsakenSpell;
|
||||
};
|
||||
|
||||
void AddSC_instance_shadowfang_keep()
|
||||
{
|
||||
new instance_shadowfang_keep();
|
||||
new spell_shadowfang_keep_haunting_spirits();
|
||||
new spell_shadowfang_keep_forsaken_skills();
|
||||
RegisterSpellScript(spell_shadowfang_keep_haunting_spirits_aura);
|
||||
RegisterSpellScript(spell_shadowfang_keep_forsaken_skills_aura);
|
||||
}
|
||||
|
||||
@@ -227,71 +227,54 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_temple_of_atal_hakkar_hex_of_jammal_an : public SpellScriptLoader
|
||||
class spell_temple_of_atal_hakkar_hex_of_jammal_an_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_temple_of_atal_hakkar_hex_of_jammal_an() : SpellScriptLoader("spell_temple_of_atal_hakkar_hex_of_jammal_an") { }
|
||||
PrepareAuraScript(spell_temple_of_atal_hakkar_hex_of_jammal_an_aura);
|
||||
|
||||
class spell_temple_of_atal_hakkar_hex_of_jammal_an_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_temple_of_atal_hakkar_hex_of_jammal_an_AuraScript);
|
||||
return ValidateSpellInfo({ HEX_OF_JAMMAL_AN, HEX_OF_JAMMAL_AN_CHARM });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->IsAlive() && caster->IsInCombat())
|
||||
{
|
||||
caster->CastSpell(GetTarget(), HEX_OF_JAMMAL_AN, true);
|
||||
caster->CastSpell(GetTarget(), HEX_OF_JAMMAL_AN_CHARM, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_temple_of_atal_hakkar_hex_of_jammal_an_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_temple_of_atal_hakkar_hex_of_jammal_an_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->IsAlive() && caster->IsInCombat())
|
||||
{
|
||||
caster->CastSpell(GetTarget(), HEX_OF_JAMMAL_AN, true);
|
||||
caster->CastSpell(GetTarget(), HEX_OF_JAMMAL_AN_CHARM, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_temple_of_atal_hakkar_hex_of_jammal_an_aura::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_temple_of_atal_hakkar_awaken_the_soulflayer : public SpellScriptLoader
|
||||
class spell_temple_of_atal_hakkar_awaken_the_soulflayer : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_temple_of_atal_hakkar_awaken_the_soulflayer() : SpellScriptLoader("spell_temple_of_atal_hakkar_awaken_the_soulflayer") { }
|
||||
PrepareSpellScript(spell_temple_of_atal_hakkar_awaken_the_soulflayer);
|
||||
|
||||
class spell_temple_of_atal_hakkar_awaken_the_soulflayer_SpellScript : public SpellScript
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_temple_of_atal_hakkar_awaken_the_soulflayer_SpellScript);
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
InstanceScript* instanceScript = GetCaster()->GetInstanceScript();
|
||||
Map* map = GetCaster()->FindMap();
|
||||
if (!map || !instanceScript || instanceScript->GetData(TYPE_HAKKAR_EVENT) != NOT_STARTED)
|
||||
return;
|
||||
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
Position pos = {-466.795f, 272.863f, -90.447f, 1.57f};
|
||||
if (TempSummon* summon = map->SummonCreature(NPC_SHADE_OF_HAKKAR, pos))
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
InstanceScript* instanceScript = GetCaster()->GetInstanceScript();
|
||||
Map* map = GetCaster()->FindMap();
|
||||
if (!map || !instanceScript || instanceScript->GetData(TYPE_HAKKAR_EVENT) != NOT_STARTED)
|
||||
return;
|
||||
|
||||
Position pos = {-466.795f, 272.863f, -90.447f, 1.57f};
|
||||
if (TempSummon* summon = map->SummonCreature(NPC_SHADE_OF_HAKKAR, pos))
|
||||
{
|
||||
summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
instanceScript->SetData(TYPE_HAKKAR_EVENT, IN_PROGRESS);
|
||||
}
|
||||
summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
|
||||
instanceScript->SetData(TYPE_HAKKAR_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_temple_of_atal_hakkar_awaken_the_soulflayer_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_temple_of_atal_hakkar_awaken_the_soulflayer_SpellScript();
|
||||
OnEffectHit += SpellEffectFn(spell_temple_of_atal_hakkar_awaken_the_soulflayer::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -299,6 +282,6 @@ void AddSC_instance_sunken_temple()
|
||||
{
|
||||
new instance_sunken_temple();
|
||||
new at_malfurion_stormrage();
|
||||
new spell_temple_of_atal_hakkar_hex_of_jammal_an();
|
||||
new spell_temple_of_atal_hakkar_awaken_the_soulflayer();
|
||||
RegisterSpellScript(spell_temple_of_atal_hakkar_hex_of_jammal_an_aura);
|
||||
RegisterSpellScript(spell_temple_of_atal_hakkar_awaken_the_soulflayer);
|
||||
}
|
||||
|
||||
@@ -140,30 +140,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_uldaman_sub_boss_agro_keepers : public SpellScriptLoader
|
||||
class spell_uldaman_sub_boss_agro_keepers : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_uldaman_sub_boss_agro_keepers() : SpellScriptLoader("spell_uldaman_sub_boss_agro_keepers") { }
|
||||
PrepareSpellScript(spell_uldaman_sub_boss_agro_keepers);
|
||||
|
||||
class spell_uldaman_sub_boss_agro_keepers_SpellScript : public SpellScript
|
||||
void HandleSendEvent(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_uldaman_sub_boss_agro_keepers_SpellScript);
|
||||
if (Creature* keeper = GetCaster()->FindNearestCreature(NPC_STONE_KEEPER, 100.0f, true))
|
||||
keeper->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
void HandleSendEvent(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Creature* keeper = GetCaster()->FindNearestCreature(NPC_STONE_KEEPER, 100.0f, true))
|
||||
keeper->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_uldaman_sub_boss_agro_keepers_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_uldaman_sub_boss_agro_keepers_SpellScript();
|
||||
OnEffectLaunch += SpellEffectFn(spell_uldaman_sub_boss_agro_keepers::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -172,84 +161,62 @@ enum UldamanStonedEnum
|
||||
MAP_ULDAMAN = 70
|
||||
};
|
||||
|
||||
class spell_uldaman_stoned : public SpellScriptLoader
|
||||
class spell_uldaman_stoned_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_uldaman_stoned() : SpellScriptLoader("spell_uldaman_stoned") { }
|
||||
PrepareAuraScript(spell_uldaman_stoned_aura);
|
||||
|
||||
class spell_uldaman_stoned_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_uldaman_stoned_AuraScript);
|
||||
return GetUnitOwner()->IsCreature() && GetUnitOwner()->GetMapId() == MAP_ULDAMAN;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->IsCreature() && GetUnitOwner()->GetMapId() == MAP_ULDAMAN;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Creature* target = GetUnitOwner()->ToCreature();
|
||||
target->SetReactState(REACT_PASSIVE);
|
||||
target->SetImmuneToAll(true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Creature* target = GetUnitOwner()->ToCreature();
|
||||
target->SetReactState(REACT_AGGRESSIVE);
|
||||
target->SetImmuneToAll(false);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_uldaman_stoned_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_uldaman_stoned_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_uldaman_stoned_AuraScript();
|
||||
Creature* target = GetUnitOwner()->ToCreature();
|
||||
target->SetReactState(REACT_PASSIVE);
|
||||
target->SetImmuneToAll(true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Creature* target = GetUnitOwner()->ToCreature();
|
||||
target->SetReactState(REACT_AGGRESSIVE);
|
||||
target->SetImmuneToAll(false);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_uldaman_stoned_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_uldaman_stoned_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_uldaman_boss_agro_archaedas : public SpellScriptLoader
|
||||
class spell_uldaman_boss_agro_archaedas : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_uldaman_boss_agro_archaedas() : SpellScriptLoader("spell_uldaman_boss_agro_archaedas") { }
|
||||
PrepareSpellScript(spell_uldaman_boss_agro_archaedas);
|
||||
|
||||
class spell_uldaman_boss_agro_archaedas_SpellScript : public SpellScript
|
||||
void HandleSendEvent(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_uldaman_boss_agro_archaedas_SpellScript);
|
||||
InstanceScript* instance = GetCaster()->GetInstanceScript();
|
||||
|
||||
void HandleSendEvent(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
InstanceScript* instance = GetCaster()->GetInstanceScript();
|
||||
if (!instance || instance->GetData(DATA_ARCHAEDAS) == IN_PROGRESS || instance->GetData(DATA_ARCHAEDAS) == DONE)
|
||||
return;
|
||||
|
||||
if (!instance || instance->GetData(DATA_ARCHAEDAS) == IN_PROGRESS || instance->GetData(DATA_ARCHAEDAS) == DONE)
|
||||
return;
|
||||
instance->SetData(DATA_ARCHAEDAS, IN_PROGRESS);
|
||||
if (Creature* archaedas = GetCaster()->FindNearestCreature(NPC_ARCHAEDAS, 100.0f, true))
|
||||
archaedas->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
instance->SetData(DATA_ARCHAEDAS, IN_PROGRESS);
|
||||
if (Creature* archaedas = GetCaster()->FindNearestCreature(NPC_ARCHAEDAS, 100.0f, true))
|
||||
archaedas->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_uldaman_boss_agro_archaedas_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_uldaman_boss_agro_archaedas_SpellScript();
|
||||
OnEffectLaunch += SpellEffectFn(spell_uldaman_boss_agro_archaedas::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_uldaman()
|
||||
{
|
||||
new instance_uldaman();
|
||||
new spell_uldaman_sub_boss_agro_keepers();
|
||||
new spell_uldaman_stoned();
|
||||
new spell_uldaman_boss_agro_archaedas();
|
||||
RegisterSpellScript(spell_uldaman_sub_boss_agro_keepers);
|
||||
RegisterSpellScript(spell_uldaman_stoned_aura);
|
||||
RegisterSpellScript(spell_uldaman_boss_agro_archaedas);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
struct boss_akilzonAI : public BossAI
|
||||
{
|
||||
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZONEVENT)
|
||||
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZON)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -103,9 +103,6 @@ public:
|
||||
StormCount = 0;
|
||||
isRaining = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
}
|
||||
|
||||
@@ -120,17 +117,12 @@ public:
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
//DoZoneInCombat();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
|
||||
@@ -76,7 +76,7 @@ enum Groups
|
||||
|
||||
struct boss_halazzi : public BossAI
|
||||
{
|
||||
boss_halazzi(Creature* creature) : BossAI(creature, DATA_HALAZZIEVENT)
|
||||
boss_halazzi(Creature* creature) : BossAI(creature, DATA_HALAZZI)
|
||||
{
|
||||
scheduler.SetValidator([this]
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "zulaman.h"
|
||||
/* ScriptData
|
||||
@@ -40,7 +41,16 @@ enum Says
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_TEMP_TRIGGER = 23920
|
||||
NPC_TEMP_TRIGGER = 23920,
|
||||
NPC_ALYSON_ANTILLE = 24240,
|
||||
NPC_THURG = 24241,
|
||||
NPC_GAZAKROTH = 24244,
|
||||
NPC_LORD_RADAAN = 24243,
|
||||
NPC_DARKHEART = 24246,
|
||||
NPC_SLITHER = 24242,
|
||||
NPC_FENSTALKER = 24245,
|
||||
NPC_KORAGG = 24247
|
||||
|
||||
};
|
||||
|
||||
enum Spells
|
||||
@@ -49,6 +59,11 @@ enum Spells
|
||||
SPELL_DRAIN_POWER = 44131,
|
||||
SPELL_SIPHON_SOUL = 43501,
|
||||
|
||||
// Alyson Antille
|
||||
SPELL_ARCANE_TORRENT = 33390,
|
||||
SPELL_DISPEL_MAGIC = 43577,
|
||||
SPELL_FLASH_HEAL = 43575,
|
||||
|
||||
// Druid
|
||||
SPELL_DR_THORNS = 43420,
|
||||
SPELL_DR_LIFEBLOOM = 43421,
|
||||
@@ -99,51 +114,33 @@ enum Spells
|
||||
SPELL_WR_WHIRLWIND = 43442,
|
||||
SPELL_WR_SPELL_REFLECT = 43443,
|
||||
|
||||
// Thurg
|
||||
SPELL_BLOODLUST = 43578,
|
||||
SPELL_CLEAVE = 15496,
|
||||
|
||||
// Gazakroth
|
||||
SPELL_FIREBOLT = 43584,
|
||||
|
||||
// Alyson Antille
|
||||
SPELL_FLASH_HEAL = 43575,
|
||||
SPELL_DISPEL_MAGIC = 43577,
|
||||
|
||||
// Lord Raadan
|
||||
SPELL_FLAME_BREATH = 43582,
|
||||
SPELL_THUNDERCLAP = 43583,
|
||||
|
||||
// Darkheart
|
||||
SPELL_PSYCHIC_WAIL = 43590,
|
||||
|
||||
// Slither
|
||||
SPELL_VENOM_SPIT = 43579,
|
||||
|
||||
// Fenstalker
|
||||
SPELL_VOLATILE_INFECTION = 43586,
|
||||
|
||||
// Koragg
|
||||
SPELL_COLD_STARE = 43593,
|
||||
SPELL_MIGHTY_BLOW = 43592
|
||||
// Death Knight
|
||||
SPELL_DK_PLAGUE_STRIKE = 57599,
|
||||
SPELL_DK_DEATH_AND_DECAY = 43265,
|
||||
SPELL_DK_BLOOD_WORMS = 97630,
|
||||
};
|
||||
|
||||
#define ORIENT 1.5696f
|
||||
#define POS_Y 921.2795f
|
||||
#define POS_Z 33.8883f
|
||||
|
||||
static float Pos_X[4] = {112.8827f, 107.8827f, 122.8827f, 127.8827f};
|
||||
|
||||
static uint32 AddEntryList[8] =
|
||||
const Position addPosition[4] =
|
||||
{
|
||||
24240, //Alyson Antille
|
||||
24241, //Thurg
|
||||
24242, //Slither
|
||||
24243, //Lord Raadan
|
||||
24244, //Gazakroth
|
||||
24245, //Fenstalker
|
||||
24246, //Darkheart
|
||||
24247 //Koragg
|
||||
{112.8827f, 921.2795f, 33.8883f, 1.5696f},
|
||||
{107.8827f, 921.2795f, 33.8883f, 1.5696f},
|
||||
{122.8827f, 921.2795f, 33.8883f, 1.5696f},
|
||||
{127.8827f, 921.2795f, 33.8883f, 1.5696f}
|
||||
};
|
||||
|
||||
static uint32 addEntrySets[4][2] =
|
||||
{
|
||||
{NPC_THURG, NPC_ALYSON_ANTILLE },
|
||||
{NPC_LORD_RADAAN, NPC_SLITHER },
|
||||
{NPC_GAZAKROTH, NPC_FENSTALKER },
|
||||
{NPC_DARKHEART, NPC_KORAGG }
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ADD_COUNT = 4,
|
||||
ADDITIONAL_CLASS_SPRIEST = 11,
|
||||
AURA_SHADOW_FORM = 15473
|
||||
};
|
||||
|
||||
enum AbilityTarget
|
||||
@@ -160,455 +157,273 @@ struct PlayerAbilityStruct
|
||||
{
|
||||
uint32 spell;
|
||||
AbilityTarget target;
|
||||
uint32 cooldown; //FIXME - it's never used
|
||||
std::chrono::milliseconds cooldown;
|
||||
};
|
||||
|
||||
static PlayerAbilityStruct PlayerAbility[][3] =
|
||||
static PlayerAbilityStruct PlayerAbility[12][3] =
|
||||
{
|
||||
// 1 warrior
|
||||
{ {SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000}
|
||||
{ {SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000ms}
|
||||
},
|
||||
// 2 paladin
|
||||
{ {SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000},
|
||||
{SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000}
|
||||
{ {SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000ms},
|
||||
{SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000ms}
|
||||
},
|
||||
// 3 hunter
|
||||
{ {SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000}
|
||||
{ {SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000ms}
|
||||
},
|
||||
// 4 rogue
|
||||
{ {SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000},
|
||||
{SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000}
|
||||
{ {SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000ms},
|
||||
{SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000ms}
|
||||
},
|
||||
// 5 priest
|
||||
{ {SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000},
|
||||
{SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000},
|
||||
{SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000}
|
||||
{ {SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000ms},
|
||||
{SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000ms},
|
||||
{SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000ms}
|
||||
},
|
||||
// 5* shadow priest
|
||||
{ {SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000},
|
||||
{SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000},
|
||||
{SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000}
|
||||
// 6 death knight
|
||||
{
|
||||
{SPELL_DK_PLAGUE_STRIKE, ABILITY_TARGET_ENEMY, 2000ms},
|
||||
{SPELL_DK_DEATH_AND_DECAY, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_DK_BLOOD_WORMS, ABILITY_TARGET_ENEMY, 5000ms}
|
||||
},
|
||||
// 7 shaman
|
||||
{ {SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000},
|
||||
{SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000}
|
||||
{ {SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000ms},
|
||||
{SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000ms}
|
||||
},
|
||||
// 8 mage
|
||||
{ {SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000},
|
||||
{SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000},
|
||||
{SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000}
|
||||
{ {SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000ms},
|
||||
{SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000ms},
|
||||
{SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000ms}
|
||||
},
|
||||
// 9 warlock
|
||||
{ {SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000},
|
||||
{SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000},
|
||||
{SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000}
|
||||
{ {SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000ms},
|
||||
{SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000ms},
|
||||
{SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000ms}
|
||||
},
|
||||
// 10 UNK class (should never be set)
|
||||
{
|
||||
{0, ABILITY_TARGET_SELF, 0ms},
|
||||
{0, ABILITY_TARGET_SELF, 0ms},
|
||||
{0, ABILITY_TARGET_SELF, 0ms}
|
||||
},
|
||||
// 11 druid
|
||||
{ {SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000},
|
||||
{SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000},
|
||||
{SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000}
|
||||
{ {SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000ms},
|
||||
{SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000ms},
|
||||
{SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000ms}
|
||||
},
|
||||
// MISC shadow priest
|
||||
{ {SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000ms},
|
||||
{SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000ms},
|
||||
{SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000ms}
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_hexlord_addAI : public ScriptedAI
|
||||
struct boss_hexlord_malacrass : public BossAI
|
||||
{
|
||||
InstanceScript* instance;
|
||||
boss_hexlord_malacrass(Creature* creature) : BossAI(creature, DATA_HEXLORD) { }
|
||||
|
||||
boss_hexlord_addAI(Creature* creature) : ScriptedAI(creature)
|
||||
void Reset() override
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
BossAI::Reset();
|
||||
_currentClass = CLASS_NONE;
|
||||
_classAbilityTimer = 10000ms;
|
||||
SpawnAdds();
|
||||
}
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
void SpawnAdds()
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
if (instance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
|
||||
for (uint8 i = 0; i < MAX_ADD_COUNT; ++i)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
uint8 flip = urand(0, 1);
|
||||
me->SummonCreature(addEntrySets[i][flip], addPosition[i], TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
summons.DoForAllSummons([&](WorldObject* summon)
|
||||
{
|
||||
if (Creature* add = summon->ToCreature())
|
||||
add->SetInCombatWithZone();
|
||||
});
|
||||
|
||||
ScheduleTimedEvent(60s, [&]{
|
||||
DoCastSelf(SPELL_DRAIN_POWER, true);
|
||||
Talk(SAY_DRAIN_POWER);
|
||||
}, 40s, 55s);
|
||||
ScheduleTimedEvent(30s, [&]{
|
||||
DoCastSelf(SPELL_SPIRIT_BOLTS);
|
||||
scheduler.Schedule(10s, [this](TaskContext)
|
||||
{
|
||||
if (Creature* siphonTrigger = me->SummonCreature(NPC_TEMP_TRIGGER, me->GetPosition(), TEMPSUMMON_TIMED_DESPAWN, 30000))
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 70, true))
|
||||
{
|
||||
siphonTrigger->SetDisplayId(11686);
|
||||
siphonTrigger->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
siphonTrigger->AI()->DoCast(target, SPELL_SIPHON_SOUL, true);
|
||||
siphonTrigger->GetMotionMaster()->MoveChase(me);
|
||||
if (Player* player = target->ToPlayer())
|
||||
{
|
||||
if (player->HasAura(AURA_SHADOW_FORM))
|
||||
_currentClass = ADDITIONAL_CLASS_SPRIEST;
|
||||
else
|
||||
_currentClass = player->getClass() - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 40s);
|
||||
ScheduleTimedEvent(_classAbilityTimer, [&]{
|
||||
if (_currentClass)
|
||||
{
|
||||
UseAbility();
|
||||
}
|
||||
}, _classAbilityTimer);
|
||||
}
|
||||
|
||||
void UseAbility()
|
||||
{
|
||||
uint8 random = urand(0, 2);
|
||||
Unit* target = nullptr;
|
||||
switch (PlayerAbility[_currentClass][random].target)
|
||||
{
|
||||
case ABILITY_TARGET_SELF:
|
||||
target = me;
|
||||
break;
|
||||
case ABILITY_TARGET_VICTIM:
|
||||
target = me->GetVictim();
|
||||
break;
|
||||
case ABILITY_TARGET_ENEMY:
|
||||
default:
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0, 100, true);
|
||||
break;
|
||||
case ABILITY_TARGET_HEAL:
|
||||
target = DoSelectLowestHpFriendly(50, 0);
|
||||
break;
|
||||
case ABILITY_TARGET_BUFF:
|
||||
{
|
||||
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, PlayerAbility[_currentClass][random].spell);
|
||||
if (!templist.empty())
|
||||
target = *(templist.begin());
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (target)
|
||||
DoCast(target, PlayerAbility[_currentClass][random].spell, false);
|
||||
_classAbilityTimer = PlayerAbility[_currentClass][random].cooldown;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
BossAI::KilledUnit(victim);
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_KILL_ONE);
|
||||
else
|
||||
Talk(SAY_KILL_TWO);
|
||||
}
|
||||
private:
|
||||
uint8 _currentClass;
|
||||
std::chrono::milliseconds _classAbilityTimer;
|
||||
};
|
||||
|
||||
struct boss_alyson_antille : public ScriptedAI
|
||||
{
|
||||
boss_alyson_antille(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
_friendlyList.clear();
|
||||
ScriptedAI::Reset();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
ScriptedAI::JustEngagedWith(who);
|
||||
//populate list of friendly adds and malacrass
|
||||
GetNearbyFriendlies();
|
||||
ScheduleTimedEvent(10s, [&]{
|
||||
bool friendlyCast = false;
|
||||
RandomReverseFriendlyList();
|
||||
for (Creature* friendly : _friendlyList)
|
||||
{
|
||||
if (friendly->IsAlive() && friendly->IsWithinDist2d(me, 40.0f))
|
||||
{
|
||||
DoCast(friendly, SPELL_DISPEL_MAGIC);
|
||||
friendlyCast = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!friendlyCast)
|
||||
{
|
||||
if (Map* map = me->GetMap())
|
||||
{
|
||||
map->DoForAllPlayers([&](Player* player)
|
||||
{
|
||||
if (player->IsWithinDist2d(me, 40.0f))
|
||||
{
|
||||
DoCast(player, SPELL_DISPEL_MAGIC);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, 10s);
|
||||
ScheduleTimedEvent(2500ms, [&]{
|
||||
RandomReverseFriendlyList();
|
||||
for (Creature* friendly : _friendlyList)
|
||||
{
|
||||
if (friendly->IsAlive() && friendly->IsWithinDist2d(me, 40.0f) && !friendly->IsFullHealth())
|
||||
{
|
||||
DoCast(friendly, SPELL_FLASH_HEAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, 2500ms);
|
||||
ScheduleTimedEvent(30s, [&]{
|
||||
DoCastSelf(SPELL_ARCANE_TORRENT); // timer not checked
|
||||
}, 30s);
|
||||
}
|
||||
|
||||
void RandomReverseFriendlyList()
|
||||
{
|
||||
if (urand(0, 1))
|
||||
_friendlyList.reverse();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
class boss_hexlord_malacrass : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_hexlord_malacrass()
|
||||
: CreatureScript("boss_hexlord_malacrass")
|
||||
void GetNearbyFriendlies()
|
||||
{
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_HEXLORD);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_GAZAKROTH);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_LORD_RADAAN);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_DARKHEART);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_SLITHER);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_FENSTALKER);
|
||||
me->GetCreaturesWithEntryInRange(_friendlyList, 100.0f, NPC_KORAGG);
|
||||
}
|
||||
|
||||
struct boss_hex_lord_malacrassAI : public ScriptedAI
|
||||
{
|
||||
boss_hex_lord_malacrassAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
SelectAddEntry();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
ObjectGuid AddGUID[4];
|
||||
uint32 AddEntry[4];
|
||||
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
uint32 SpiritBolts_Timer;
|
||||
uint32 DrainPower_Timer;
|
||||
uint32 SiphonSoul_Timer;
|
||||
uint32 PlayerAbility_Timer;
|
||||
uint32 CheckAddState_Timer;
|
||||
uint32 ResetTimer;
|
||||
|
||||
uint32 PlayerClass;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
instance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
|
||||
|
||||
SpiritBolts_Timer = 20000;
|
||||
DrainPower_Timer = 60000;
|
||||
SiphonSoul_Timer = 100000;
|
||||
PlayerAbility_Timer = 99999;
|
||||
CheckAddState_Timer = 5000;
|
||||
ResetTimer = 5000;
|
||||
|
||||
SpawnAdds();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
instance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* creature = ObjectAccessor::GetCreature(*me, AddGUID[i]);
|
||||
if (creature && creature->IsAlive())
|
||||
creature->AI()->AttackStart(me->GetVictim());
|
||||
else
|
||||
{
|
||||
EnterEvadeMode();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_KILL_ONE);
|
||||
break;
|
||||
case 1:
|
||||
Talk(SAY_KILL_TWO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
instance->SetData(DATA_HEXLORDEVENT, DONE);
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Unit* Temp = ObjectAccessor::GetUnit(*me, AddGUID[i]);
|
||||
if (Temp && Temp->IsAlive())
|
||||
Unit::DealDamage(Temp, Temp, Temp->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||
}
|
||||
}
|
||||
|
||||
void SelectAddEntry()
|
||||
{
|
||||
std::vector<uint32> AddList;
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
AddList.push_back(AddEntryList[i]);
|
||||
|
||||
while (AddList.size() > 4)
|
||||
AddList.erase(AddList.begin() + rand() % AddList.size());
|
||||
|
||||
uint8 i = 0;
|
||||
for (std::vector<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr, ++i)
|
||||
AddEntry[i] = *itr;
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* creature = (ObjectAccessor::GetCreature((*me), AddGUID[i]));
|
||||
if (!creature || !creature->IsAlive())
|
||||
{
|
||||
if (creature) creature->setDeathState(DeathState::Dead);
|
||||
creature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (creature) AddGUID[i] = creature->GetGUID();
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->AI()->EnterEvadeMode();
|
||||
creature->SetPosition(Pos_X[i], POS_Y, POS_Z, ORIENT);
|
||||
creature->StopMovingOnCurrentPos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ResetTimer <= diff)
|
||||
{
|
||||
if (me->IsWithinDist3d(119.223f, 1035.45f, 29.4481f, 10))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
ResetTimer = 5000;
|
||||
}
|
||||
else ResetTimer -= diff;
|
||||
|
||||
if (CheckAddState_Timer <= diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, AddGUID[i]))
|
||||
if (temp->IsAlive() && !temp->GetVictim())
|
||||
temp->AI()->AttackStart(me->GetVictim());
|
||||
|
||||
CheckAddState_Timer = 5000;
|
||||
}
|
||||
else CheckAddState_Timer -= diff;
|
||||
|
||||
if (DrainPower_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DRAIN_POWER, true);
|
||||
Talk(SAY_DRAIN_POWER);
|
||||
DrainPower_Timer = urand(40000, 55000); // must cast in 60 sec, or buff/debuff will disappear
|
||||
}
|
||||
else DrainPower_Timer -= diff;
|
||||
|
||||
if (SpiritBolts_Timer <= diff)
|
||||
{
|
||||
if (DrainPower_Timer < 12000) // channel 10 sec
|
||||
SpiritBolts_Timer = 13000; // cast drain power first
|
||||
else
|
||||
{
|
||||
DoCast(me, SPELL_SPIRIT_BOLTS, false);
|
||||
Talk(SAY_SPIRIT_BOLTS);
|
||||
SpiritBolts_Timer = 40000;
|
||||
SiphonSoul_Timer = 10000; // ready to drain
|
||||
PlayerAbility_Timer = 99999;
|
||||
}
|
||||
}
|
||||
else SpiritBolts_Timer -= diff;
|
||||
|
||||
if (SiphonSoul_Timer <= diff)
|
||||
{
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 70, true);
|
||||
Unit* trigger = DoSpawnCreature(NPC_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
if (!target || !trigger)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger->SetDisplayId(11686);
|
||||
trigger->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
|
||||
trigger->GetMotionMaster()->MoveChase(me);
|
||||
|
||||
//DoCast(target, SPELL_SIPHON_SOUL, true);
|
||||
//me->SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
|
||||
//me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
|
||||
|
||||
PlayerGUID = target->GetGUID();
|
||||
PlayerAbility_Timer = urand(8000, 10000);
|
||||
PlayerClass = target->getClass() - 1;
|
||||
|
||||
if (target->IsClass(CLASS_DRUID))
|
||||
PlayerClass = CLASS_DRUID;
|
||||
else if (target->IsClass(CLASS_PRIEST) && target->HasSpell(15473))
|
||||
PlayerClass = CLASS_PRIEST; // shadow priest
|
||||
|
||||
SiphonSoul_Timer = 99999; // buff lasts 30 sec
|
||||
}
|
||||
}
|
||||
else SiphonSoul_Timer -= diff;
|
||||
|
||||
if (PlayerAbility_Timer <= diff)
|
||||
{
|
||||
//Unit* target = ObjectAccessor::GetUnit(*me, PlayerGUID);
|
||||
//if (target && target->IsAlive())
|
||||
//{
|
||||
UseAbility();
|
||||
PlayerAbility_Timer = urand(8000, 10000);
|
||||
//}
|
||||
}
|
||||
else PlayerAbility_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void UseAbility()
|
||||
{
|
||||
uint8 random = urand(0, 2);
|
||||
Unit* target = nullptr;
|
||||
switch (PlayerAbility[PlayerClass][random].target)
|
||||
{
|
||||
case ABILITY_TARGET_SELF:
|
||||
target = me;
|
||||
break;
|
||||
case ABILITY_TARGET_VICTIM:
|
||||
target = me->GetVictim();
|
||||
break;
|
||||
case ABILITY_TARGET_ENEMY:
|
||||
default:
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0, 100, true);
|
||||
break;
|
||||
case ABILITY_TARGET_HEAL:
|
||||
target = DoSelectLowestHpFriendly(50, 0);
|
||||
break;
|
||||
case ABILITY_TARGET_BUFF:
|
||||
{
|
||||
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell);
|
||||
if (!templist.empty())
|
||||
target = *(templist.begin());
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (target)
|
||||
DoCast(target, PlayerAbility[PlayerClass][random].spell, false);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_hex_lord_malacrassAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_alyson_antille : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_alyson_antille()
|
||||
: CreatureScript("boss_alyson_antille")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_alyson_antilleAI : public boss_hexlord_addAI
|
||||
{
|
||||
//Holy Priest
|
||||
boss_alyson_antilleAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 flashheal_timer;
|
||||
uint32 dispelmagic_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
flashheal_timer = 2500;
|
||||
dispelmagic_timer = 10000;
|
||||
|
||||
//AcquireGUID();
|
||||
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack())
|
||||
{
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, 20);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (flashheal_timer <= diff)
|
||||
{
|
||||
Unit* target = DoSelectLowestHpFriendly(99, 30000);
|
||||
if (target)
|
||||
{
|
||||
if (target->IsWithinDistInMap(me, 50))
|
||||
DoCast(target, SPELL_FLASH_HEAL, false);
|
||||
else
|
||||
{
|
||||
/**
|
||||
* @bug
|
||||
* Bugged
|
||||
* //me->GetMotionMaster()->Clear();
|
||||
* //me->GetMotionMaster()->MoveChase(target, 20);
|
||||
*/
|
||||
//me->GetMotionMaster()->Clear();
|
||||
//me->GetMotionMaster()->MoveChase(target, 20);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (urand(0, 1))
|
||||
target = DoSelectLowestHpFriendly(50, 0);
|
||||
else
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_DISPEL_MAGIC, false);
|
||||
}
|
||||
flashheal_timer = 2500;
|
||||
}
|
||||
else flashheal_timer -= diff;
|
||||
|
||||
/*if (dispelmagic_timer <= diff)
|
||||
{
|
||||
if (urand(0, 1))
|
||||
{
|
||||
Unit* target = SelectTarget();
|
||||
|
||||
DoCast(target, SPELL_DISPEL_MAGIC, false);
|
||||
}
|
||||
else
|
||||
me->CastSpell(SelectUnit(SelectTargetMethod::Random, 0), SPELL_DISPEL_MAGIC, false);
|
||||
|
||||
dispelmagic_timer = 12000;
|
||||
} else dispelmagic_timer -= diff;*/
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_alyson_antilleAI>(creature);
|
||||
}
|
||||
private:
|
||||
std::list<Creature* > _friendlyList;
|
||||
};
|
||||
|
||||
class spell_hexlord_unstable_affliction : public AuraScript
|
||||
@@ -634,7 +449,7 @@ class spell_hexlord_unstable_affliction : public AuraScript
|
||||
|
||||
void AddSC_boss_hex_lord_malacrass()
|
||||
{
|
||||
new boss_hexlord_malacrass();
|
||||
new boss_alyson_antille();
|
||||
RegisterZulAmanCreatureAI(boss_hexlord_malacrass);
|
||||
RegisterZulAmanCreatureAI(boss_alyson_antille);
|
||||
RegisterSpellScript(spell_hexlord_unstable_affliction);
|
||||
}
|
||||
|
||||
@@ -125,12 +125,11 @@ enum Misc
|
||||
|
||||
struct boss_janalai : public BossAI
|
||||
{
|
||||
boss_janalai(Creature* creature) : BossAI(creature, DATA_JANALAIEVENT) { }
|
||||
boss_janalai(Creature* creature) : BossAI(creature, DATA_JANALAI) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
instance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
|
||||
HatchAllEggs(HATCH_RESET);
|
||||
_isBombing = false;
|
||||
_isFlameBreathing = false;
|
||||
@@ -153,7 +152,6 @@ struct boss_janalai : public BossAI
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
instance->SetData(DATA_JANALAIEVENT, DONE);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
@@ -169,7 +167,6 @@ struct boss_janalai : public BossAI
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
instance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
|
||||
Talk(SAY_AGGRO);
|
||||
//schedule abilities
|
||||
ScheduleTimedEvent(30s, [&]{
|
||||
|
||||
@@ -87,7 +87,7 @@ enum NalorakkGroups
|
||||
|
||||
struct boss_nalorakk : public BossAI
|
||||
{
|
||||
boss_nalorakk(Creature* creature) : BossAI(creature, DATA_NALORAKKEVENT)
|
||||
boss_nalorakk(Creature* creature) : BossAI(creature, DATA_NALORAKK)
|
||||
{
|
||||
_phase = PHASE_SEND_GUARDS_1;
|
||||
_ranIntro = false;
|
||||
@@ -351,7 +351,6 @@ struct boss_nalorakk : public BossAI
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
instance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -167,8 +167,6 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
|
||||
|
||||
Phase = 0;
|
||||
|
||||
health_20 = me->CountPctFromMaxHealth(20);
|
||||
@@ -203,8 +201,6 @@ public:
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
|
||||
Talk(YELL_INTRO);
|
||||
@@ -222,7 +218,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
instance->SetData(DATA_ZULJINEVENT, DONE);
|
||||
instance->SetData(DATA_ZULJIN, DONE);
|
||||
|
||||
Talk(YELL_DEATH);
|
||||
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
|
||||
|
||||
@@ -30,7 +30,6 @@ EndScriptData */
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ENCOUNTER = 7,
|
||||
RAND_VENDOR = 2,
|
||||
WORLDSTATE_SHOW_TIMER = 3104,
|
||||
WORLDSTATE_TIME_TO_SACRIFICE = 3106
|
||||
@@ -66,6 +65,11 @@ ObjectData const gameObjectData[] =
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
BossBoundaryData const boundaries =
|
||||
{
|
||||
{ DATA_HEXLORD, new RectangleBoundary(80.50557f, 920.9858f, 155.88986f, 1015.27563f)}
|
||||
};
|
||||
|
||||
class instance_zulaman : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
@@ -105,6 +109,8 @@ public:
|
||||
SetHeaders(DataHeader);
|
||||
LoadObjectData(creatureData, gameObjectData);
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
LoadBossBoundaries(boundaries);
|
||||
|
||||
QuestTimer = 0;
|
||||
QuestMinute = 0;
|
||||
@@ -216,10 +222,10 @@ public:
|
||||
|
||||
void CheckInstanceStatus()
|
||||
{
|
||||
if (BossKilled >= DATA_HALAZZIEVENT)
|
||||
if (BossKilled >= DATA_HALAZZI)
|
||||
HandleGameObject(HexLordGateGUID, true);
|
||||
|
||||
if (BossKilled >= DATA_HEXLORDEVENT)
|
||||
if (BossKilled >= DATA_HEXLORD)
|
||||
HandleGameObject(ZulJinGateGUID, true);
|
||||
}
|
||||
|
||||
@@ -267,8 +273,8 @@ public:
|
||||
else if (data == DONE)
|
||||
QuestMinute = 21;
|
||||
break;
|
||||
case DATA_NALORAKKEVENT:
|
||||
m_auiEncounter[DATA_NALORAKKEVENT] = data;
|
||||
case DATA_NALORAKK:
|
||||
m_auiEncounter[DATA_NALORAKK] = data;
|
||||
if (data == DONE)
|
||||
{
|
||||
if (QuestMinute)
|
||||
@@ -280,8 +286,8 @@ public:
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AKILZONEVENT:
|
||||
m_auiEncounter[DATA_AKILZONEVENT] = data;
|
||||
case DATA_AKILZON:
|
||||
m_auiEncounter[DATA_AKILZON] = data;
|
||||
HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE)
|
||||
{
|
||||
@@ -294,28 +300,28 @@ public:
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_JANALAIEVENT:
|
||||
m_auiEncounter[DATA_JANALAIEVENT] = data;
|
||||
case DATA_JANALAI:
|
||||
m_auiEncounter[DATA_JANALAI] = data;
|
||||
if (data == DONE)
|
||||
SummonHostage(2);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HALAZZIEVENT:
|
||||
m_auiEncounter[DATA_HALAZZIEVENT] = data;
|
||||
case DATA_HALAZZI:
|
||||
m_auiEncounter[DATA_HALAZZI] = data;
|
||||
HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS);
|
||||
if (data == DONE) SummonHostage(3);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_HEXLORDEVENT:
|
||||
m_auiEncounter[DATA_HEXLORDEVENT] = data;
|
||||
case DATA_HEXLORD:
|
||||
m_auiEncounter[DATA_HEXLORD] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
HandleGameObject(HexLordGateGUID, false);
|
||||
else if (data == NOT_STARTED)
|
||||
CheckInstanceStatus();
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_ZULJINEVENT:
|
||||
m_auiEncounter[DATA_ZULJINEVENT] = data;
|
||||
case DATA_ZULJIN:
|
||||
m_auiEncounter[DATA_ZULJIN] = data;
|
||||
HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS);
|
||||
SaveToDB();
|
||||
break;
|
||||
@@ -334,7 +340,7 @@ public:
|
||||
if (data == DONE)
|
||||
{
|
||||
++BossKilled;
|
||||
if (QuestMinute && BossKilled >= DATA_HALAZZIEVENT)
|
||||
if (QuestMinute && BossKilled >= DATA_HALAZZI)
|
||||
{
|
||||
QuestMinute = 0;
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
@@ -350,18 +356,18 @@ public:
|
||||
{
|
||||
case DATA_GONGEVENT:
|
||||
return m_auiEncounter[DATA_GONGEVENT];
|
||||
case DATA_NALORAKKEVENT:
|
||||
return m_auiEncounter[DATA_NALORAKKEVENT];
|
||||
case DATA_AKILZONEVENT:
|
||||
return m_auiEncounter[DATA_AKILZONEVENT];
|
||||
case DATA_JANALAIEVENT:
|
||||
return m_auiEncounter[DATA_JANALAIEVENT];
|
||||
case DATA_HALAZZIEVENT:
|
||||
return m_auiEncounter[DATA_HALAZZIEVENT];
|
||||
case DATA_HEXLORDEVENT:
|
||||
return m_auiEncounter[DATA_HEXLORDEVENT];
|
||||
case DATA_ZULJINEVENT:
|
||||
return m_auiEncounter[DATA_ZULJINEVENT];
|
||||
case DATA_NALORAKK:
|
||||
return m_auiEncounter[DATA_NALORAKK];
|
||||
case DATA_AKILZON:
|
||||
return m_auiEncounter[DATA_AKILZON];
|
||||
case DATA_JANALAI:
|
||||
return m_auiEncounter[DATA_JANALAI];
|
||||
case DATA_HALAZZI:
|
||||
return m_auiEncounter[DATA_HALAZZI];
|
||||
case DATA_HEXLORD:
|
||||
return m_auiEncounter[DATA_HEXLORD];
|
||||
case DATA_ZULJIN:
|
||||
return m_auiEncounter[DATA_ZULJIN];
|
||||
case DATA_CHESTLOOTED:
|
||||
return ChestLooted;
|
||||
case TYPE_RAND_VENDOR_1:
|
||||
|
||||
@@ -26,16 +26,17 @@
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GONGEVENT = 0,
|
||||
DATA_NALORAKKEVENT = 1,
|
||||
DATA_AKILZONEVENT = 2,
|
||||
DATA_JANALAIEVENT = 3,
|
||||
DATA_HALAZZIEVENT = 4,
|
||||
DATA_HEXLORDEVENT = 5,
|
||||
DATA_ZULJINEVENT = 6,
|
||||
DATA_SPIRIT_LYNX = 7,
|
||||
DATA_CHESTLOOTED = 8,
|
||||
TYPE_RAND_VENDOR_1 = 9,
|
||||
TYPE_RAND_VENDOR_2 = 10
|
||||
DATA_NALORAKK = 1,
|
||||
DATA_AKILZON = 2,
|
||||
DATA_JANALAI = 3,
|
||||
DATA_HALAZZI = 4,
|
||||
DATA_HEXLORD = 5,
|
||||
DATA_ZULJIN = 6,
|
||||
MAX_ENCOUNTER = 7,
|
||||
DATA_SPIRIT_LYNX = 8,
|
||||
DATA_CHESTLOOTED = 9,
|
||||
TYPE_RAND_VENDOR_1 = 10,
|
||||
TYPE_RAND_VENDOR_2 = 11
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
|
||||
@@ -349,6 +349,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 24324 - Blood Siphon (channel)
|
||||
class spell_blood_siphon : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_blood_siphon);
|
||||
@@ -385,6 +386,32 @@ class spell_blood_siphon : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 24323 - Blood Siphon (aura) | Effects changed in SpellInfoCorrections
|
||||
class spell_blood_siphon_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_blood_siphon_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_POISONOUS_BLOOD });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (target->HasAura(SPELL_POISONOUS_BLOOD))
|
||||
target->RemoveAurasDueToSpell(SPELL_POISONOUS_BLOOD);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_blood_siphon_aura::OnRemove, EFFECT_1, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 24693 - Serverside - Hakkar Power Down
|
||||
class spell_hakkar_power_down : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hakkar_power_down);
|
||||
@@ -411,5 +438,6 @@ void AddSC_boss_hakkar()
|
||||
new at_zulgurub_bloodfire_pit_speech();
|
||||
new at_zulgurub_edge_of_madness_speech();
|
||||
RegisterSpellScript(spell_blood_siphon);
|
||||
RegisterSpellScript(spell_blood_siphon_aura);
|
||||
RegisterSpellScript(spell_hakkar_power_down);
|
||||
}
|
||||
|
||||
@@ -710,44 +710,33 @@ private:
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
class spell_threatening_gaze : public SpellScriptLoader
|
||||
class spell_threatening_gaze_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_threatening_gaze() : SpellScriptLoader("spell_threatening_gaze") { }
|
||||
PrepareAuraScript(spell_threatening_gaze_aura);
|
||||
|
||||
class spell_threatening_gaze_AuraScript : public AuraScript
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_threatening_gaze_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* cCaster = caster->ToCreature())
|
||||
{
|
||||
if (Creature* cCaster = caster->ToCreature())
|
||||
if (cCaster->IsAIEnabled)
|
||||
{
|
||||
if (cCaster->IsAIEnabled)
|
||||
{
|
||||
cCaster->AI()->SetGUID(target->GetGUID(), ACTION_CHARGE);
|
||||
}
|
||||
cCaster->AI()->SetGUID(target->GetGUID(), ACTION_CHARGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_threatening_gaze_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_threatening_gaze_AuraScript();
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_threatening_gaze_aura::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -798,7 +787,7 @@ void AddSC_boss_mandokir()
|
||||
new npc_ohgan();
|
||||
RegisterZulGurubCreatureAI(npc_chained_spirit);
|
||||
RegisterZulGurubCreatureAI(npc_vilebranch_speaker);
|
||||
new spell_threatening_gaze();
|
||||
RegisterSpellScript(spell_threatening_gaze_aura);
|
||||
RegisterSpellScript(spell_mandokir_charge);
|
||||
RegisterSpellScript(spell_threatening_gaze_charge);
|
||||
}
|
||||
|
||||
@@ -1091,6 +1091,8 @@ struct boss_headless_horseman : public ScriptedAI
|
||||
me->ReplaceAllUnitFlags(UNIT_FLAG_NONE);
|
||||
me->StopMoving();
|
||||
|
||||
me->SetDisableGravity(false);
|
||||
|
||||
me->SetInCombatWithZone();
|
||||
inFight = true;
|
||||
events.ScheduleEvent(EVENT_HORSEMAN_FOLLOW, 500ms);
|
||||
@@ -1187,6 +1189,7 @@ struct boss_headless_horseman : public ScriptedAI
|
||||
trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
|
||||
break;
|
||||
case 3:
|
||||
me->SetDisableGravity(true);
|
||||
me->GetMotionMaster()->MovePath(236820, false);
|
||||
me->CastSpell(me, SPELL_SHAKE_CAMERA_SMALL, true);
|
||||
player->Say(TALK_PLAYER_FELT_DEATH);
|
||||
|
||||
@@ -133,9 +133,9 @@ class spell_rajaxx_thundercrash : public SpellScript
|
||||
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetHitUnit()->GetHealth() / 2;
|
||||
if (damage < 200)
|
||||
if (damage < 100)
|
||||
{
|
||||
damage = 200;
|
||||
damage = 100;
|
||||
}
|
||||
|
||||
SetHitDamage(damage);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CellImpl.h" // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
#include "CreatureScript.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "temple_of_ahnqiraj.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
|
||||
@@ -25,22 +25,6 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
/* ScriptData
|
||||
SDName: Azuremyst_Isle
|
||||
SD%Complete: 75
|
||||
SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582.
|
||||
SDCategory: Azuremyst Isle
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_draenei_survivor
|
||||
npc_injured_draenei
|
||||
npc_magwin
|
||||
npc_geezle
|
||||
go_ravager_cage
|
||||
npc_death_ravager
|
||||
EndContentData */
|
||||
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
/*######
|
||||
@@ -475,7 +459,7 @@ public:
|
||||
return;
|
||||
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
|
||||
player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
|
||||
player->RewardPlayerAndGroupAtEvent(me->GetEntry(), player);
|
||||
|
||||
_movementComplete = true;
|
||||
_events.ScheduleEvent(EVENT_DESPAWN, 3500ms);
|
||||
|
||||
@@ -242,16 +242,28 @@ public:
|
||||
break;
|
||||
case 24:
|
||||
Talk(WHISPER_CUSTODIAN_14, player);
|
||||
DoCast(player, 34883);
|
||||
// below here is temporary workaround, to be removed when spell works properly
|
||||
player->AreaExploredOrEventHappens(10277);
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
|
||||
// for any leave or dead (with not released body) group member at appropriate distance
|
||||
if (player && player->IsAtGroupRewardDistance(me) && !player->GetCorpse())
|
||||
DoCast(player, 34883); // QID 10277
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DoCast(player, 34883); // QID 10277
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
+59
-82
@@ -829,41 +829,35 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_pursuing_spikes : public SpellScriptLoader
|
||||
class spell_pursuing_spikes_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_pursuing_spikes() : SpellScriptLoader("spell_pursuing_spikes") { }
|
||||
PrepareAuraScript(spell_pursuing_spikes_aura);
|
||||
|
||||
class spell_pursuing_spikesAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_pursuing_spikesAuraScript)
|
||||
return ValidateSpellInfo({ SPELL_SPIKE_FAIL, SPELL_IMPALE });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true))
|
||||
{
|
||||
if (Creature* c = target->FindNearestCreature(NPC_FROST_SPHERE, 8.0f, true))
|
||||
{
|
||||
target->UpdatePosition(*c, false);
|
||||
target->CastCustomSpell(SPELL_SPIKE_FAIL, SPELLVALUE_MAX_TARGETS, 1);
|
||||
if (target->IsCreature())
|
||||
target->ToCreature()->AI()->DoAction(-1);
|
||||
Remove();
|
||||
return;
|
||||
}
|
||||
target->CastSpell((Unit*)nullptr, SPELL_IMPALE, true);
|
||||
target->UpdatePosition(*c, false);
|
||||
target->CastCustomSpell(SPELL_SPIKE_FAIL, SPELLVALUE_MAX_TARGETS, 1);
|
||||
if (target->IsCreature())
|
||||
target->ToCreature()->AI()->DoAction(-1);
|
||||
Remove();
|
||||
return;
|
||||
}
|
||||
target->CastSpell((Unit*)nullptr, SPELL_IMPALE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pursuing_spikesAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_pursuing_spikesAuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pursuing_spikes_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -874,73 +868,56 @@ enum eLeechingSwarmSpells
|
||||
SPELL_LEECHING_SWARM_HEAL = 66125,
|
||||
};
|
||||
|
||||
class spell_gen_leeching_swarm : public SpellScriptLoader
|
||||
class spell_gen_leeching_swarm_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_gen_leeching_swarm() : SpellScriptLoader("spell_gen_leeching_swarm") { }
|
||||
PrepareAuraScript(spell_gen_leeching_swarm_aura);
|
||||
|
||||
class spell_gen_leeching_swarm_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_gen_leeching_swarm_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_LEECHING_SWARM_DMG, SPELL_LEECHING_SWARM_HEAL });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_LEECHING_SWARM_DMG, SPELL_LEECHING_SWARM_HEAL });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 lifeLeeched = GetTarget()->CountPctFromCurHealth(aurEff->GetAmount());
|
||||
if (lifeLeeched < 250)
|
||||
lifeLeeched = 250;
|
||||
// Damage
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, true);
|
||||
// Heal is handled in damage spell. It has to heal the same amount, but some of the dmg can be resisted.
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_gen_leeching_swarm_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 lifeLeeched = GetTarget()->CountPctFromCurHealth(aurEff->GetAmount());
|
||||
if (lifeLeeched < 250)
|
||||
lifeLeeched = 250;
|
||||
// Damage
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, true);
|
||||
// Heal is handled in damage spell. It has to heal the same amount, but some of the dmg can be resisted.
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_leeching_swarm_dmg : public SpellScriptLoader
|
||||
class spell_gen_leeching_swarm_dmg : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_gen_leeching_swarm_dmg() : SpellScriptLoader("spell_gen_leeching_swarm_dmg") {}
|
||||
PrepareSpellScript(spell_gen_leeching_swarm_dmg);
|
||||
|
||||
class spell_gen_leeching_swarm_dmg_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_gen_leeching_swarm_dmg_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_LEECHING_SWARM_HEAL });
|
||||
}
|
||||
|
||||
void HandleAfterHit()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetHitDamage() > 0)
|
||||
{
|
||||
int32 damage = GetHitDamage();
|
||||
caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_gen_leeching_swarm_dmg_SpellScript::HandleAfterHit);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleAfterHit()
|
||||
{
|
||||
return new spell_gen_leeching_swarm_dmg_SpellScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetHitDamage() > 0)
|
||||
{
|
||||
int32 damage = GetHitDamage();
|
||||
caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_gen_leeching_swarm_dmg::HandleAfterHit);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -951,7 +928,7 @@ void AddSC_boss_anubarak_trial()
|
||||
new npc_frost_sphere();
|
||||
new npc_nerubian_burrower();
|
||||
new npc_anubarak_spike();
|
||||
new spell_pursuing_spikes();
|
||||
new spell_gen_leeching_swarm();
|
||||
new spell_gen_leeching_swarm_dmg();
|
||||
RegisterSpellScript(spell_pursuing_spikes_aura);
|
||||
RegisterSpellScript(spell_gen_leeching_swarm_aura);
|
||||
RegisterSpellScript(spell_gen_leeching_swarm_dmg);
|
||||
}
|
||||
|
||||
+14
-25
@@ -2444,35 +2444,24 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
|
||||
class spell_faction_champion_warl_unstable_affliction_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_faction_champion_warl_unstable_affliction() : SpellScriptLoader("spell_faction_champion_warl_unstable_affliction") { }
|
||||
PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_aura);
|
||||
|
||||
class spell_faction_champion_warl_unstable_affliction_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_UNSTABLE_AFFLICTION_DISPEL });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_UNSTABLE_AFFLICTION_DISPEL });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
return new spell_faction_champion_warl_unstable_affliction_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_aura::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2494,5 +2483,5 @@ void AddSC_boss_faction_champions()
|
||||
new npc_toc_retro_paladin();
|
||||
new npc_toc_pet_warlock();
|
||||
new npc_toc_pet_hunter();
|
||||
new spell_faction_champion_warl_unstable_affliction();
|
||||
RegisterSpellScript(spell_faction_champion_warl_unstable_affliction_aura);
|
||||
}
|
||||
|
||||
+40
-57
@@ -444,75 +444,58 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_toc25_mistress_kiss : public SpellScriptLoader
|
||||
class spell_toc25_mistress_kiss_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_toc25_mistress_kiss() : SpellScriptLoader("spell_toc25_mistress_kiss") { }
|
||||
PrepareAuraScript(spell_toc25_mistress_kiss_aura);
|
||||
|
||||
class spell_toc25_mistress_kiss_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_toc25_mistress_kiss_AuraScript)
|
||||
return ValidateSpellInfo({ 66359 });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
caster->CastSpell(target, 66359, true);
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_toc25_mistress_kiss_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_toc25_mistress_kiss_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
caster->CastSpell(target, 66359, true);
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_toc25_mistress_kiss_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mistress_kiss_area : public SpellScriptLoader
|
||||
class spell_mistress_kiss_area : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_mistress_kiss_area() : SpellScriptLoader("spell_mistress_kiss_area") {}
|
||||
PrepareSpellScript(spell_mistress_kiss_area);
|
||||
|
||||
class spell_mistress_kiss_area_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_mistress_kiss_area_SpellScript)
|
||||
// get a list of players with mana
|
||||
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(Acore::PowerCheck(POWER_MANA, false));
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// get a list of players with mana
|
||||
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(Acore::PowerCheck(POWER_MANA, false));
|
||||
if (targets.empty())
|
||||
return;
|
||||
WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mistress_kiss_area_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mistress_kiss_area_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_mistress_kiss_area_SpellScript();
|
||||
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mistress_kiss_area::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mistress_kiss_area::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -521,6 +504,6 @@ void AddSC_boss_jaraxxus()
|
||||
new boss_jaraxxus();
|
||||
new npc_fel_infernal();
|
||||
new npc_mistress_of_pain();
|
||||
new spell_toc25_mistress_kiss();
|
||||
new spell_mistress_kiss_area();
|
||||
RegisterSpellScript(spell_toc25_mistress_kiss_aura);
|
||||
RegisterSpellScript(spell_mistress_kiss_area);
|
||||
}
|
||||
|
||||
+141
-164
@@ -730,190 +730,167 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_valkyr_essence : public SpellScriptLoader
|
||||
class spell_valkyr_essence_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_valkyr_essence() : SpellScriptLoader("spell_valkyr_essence") { }
|
||||
PrepareAuraScript(spell_valkyr_essence_aura);
|
||||
|
||||
class spell_valkyr_essence_auraAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_valkyr_essence_auraAuraScript)
|
||||
return ValidateSpellInfo({ SPELL_POWERING_UP, SPELL_SURGE_OF_SPEED });
|
||||
}
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
||||
{
|
||||
uint16 count = absorbAmount / 1000;
|
||||
if (!count || !GetOwner())
|
||||
return;
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
||||
{
|
||||
uint16 count = absorbAmount / 1000;
|
||||
if (!count || !GetOwner())
|
||||
return;
|
||||
|
||||
if (SpellInfo const* se = GetAura()->GetSpellInfo())
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
if (SpellInfo const* se = GetAura()->GetSpellInfo())
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
{
|
||||
uint32 auraId = 0;
|
||||
uint32 empoweredId = 0;
|
||||
switch (se->Id)
|
||||
{
|
||||
uint32 auraId = 0;
|
||||
uint32 empoweredId = 0;
|
||||
switch (se->Id)
|
||||
case 65686:
|
||||
auraId = 67590;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 65684:
|
||||
auraId = 67590;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67222:
|
||||
auraId = 67602;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67176:
|
||||
auraId = 67602;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67223:
|
||||
auraId = 67603;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67177:
|
||||
auraId = 67603;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67224:
|
||||
auraId = 67604;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67178:
|
||||
auraId = 67604;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
}
|
||||
if (!owner->HasAura(auraId))
|
||||
{
|
||||
owner->CastSpell(owner, SPELL_POWERING_UP, true);
|
||||
if (--count == 0)
|
||||
return;
|
||||
}
|
||||
if (Aura* aur = owner->GetAura(auraId))
|
||||
{
|
||||
if (aur->GetStackAmount() + count < 100 )
|
||||
{
|
||||
case 65686:
|
||||
auraId = 67590;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 65684:
|
||||
auraId = 67590;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67222:
|
||||
auraId = 67602;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67176:
|
||||
auraId = 67602;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67223:
|
||||
auraId = 67603;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67177:
|
||||
auraId = 67603;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
case 67224:
|
||||
auraId = 67604;
|
||||
empoweredId = 65748;
|
||||
break;
|
||||
case 67178:
|
||||
auraId = 67604;
|
||||
empoweredId = 65724;
|
||||
break;
|
||||
}
|
||||
if (!owner->HasAura(auraId))
|
||||
{
|
||||
owner->CastSpell(owner, SPELL_POWERING_UP, true);
|
||||
if (--count == 0)
|
||||
return;
|
||||
}
|
||||
if (Aura* aur = owner->GetAura(auraId))
|
||||
{
|
||||
if (aur->GetStackAmount() + count < 100 )
|
||||
{
|
||||
aur->ModStackAmount(count);
|
||||
aur->ModStackAmount(count);
|
||||
|
||||
if (roll_chance_i(30)) // 30% chance to gain extra speed for collecting
|
||||
owner->CastSpell(owner, SPELL_SURGE_OF_SPEED, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
owner->CastSpell(owner, empoweredId, true);
|
||||
aur->Remove();
|
||||
}
|
||||
if (roll_chance_i(30)) // 30% chance to gain extra speed for collecting
|
||||
owner->CastSpell(owner, SPELL_SURGE_OF_SPEED, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
owner->CastSpell(owner, empoweredId, true);
|
||||
aur->Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_valkyr_essence_auraAuraScript::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_valkyr_essence_auraAuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_valkyr_touch : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_valkyr_touch() : SpellScriptLoader("spell_valkyr_touch") { }
|
||||
|
||||
class spell_valkyr_touchAuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_valkyr_touchAuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
if (caster->GetMap()->GetId() == 649 )
|
||||
{
|
||||
uint32 excludedID = GetSpellInfo()->ExcludeTargetAuraSpell;
|
||||
Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
{
|
||||
uint32 absorb = 0;
|
||||
uint32 resist = 0;
|
||||
CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
|
||||
uint32 damage = dmg;
|
||||
int32 resilienceReduction = damage;
|
||||
if (caster->CanApplyResilience())
|
||||
Unit::ApplyResilience(plr, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
|
||||
resilienceReduction = damage - resilienceReduction;
|
||||
damage -= resilienceReduction;
|
||||
uint32 mitigated_damage = resilienceReduction;
|
||||
DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
|
||||
Unit::CalcAbsorbResist(dmgInfo);
|
||||
Unit::DealDamageMods(plr, damage, &absorb);
|
||||
int32 overkill = damage - plr->GetHealth();
|
||||
if (overkill < 0)
|
||||
overkill = 0;
|
||||
SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
|
||||
plr->SendPeriodicAuraLog(&pInfo);
|
||||
Unit::DealDamage(caster, plr, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_touchAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_valkyr_touchAuraScript();
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_valkyr_essence_aura::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_valkyr_ball_periodic_dummy : public SpellScriptLoader
|
||||
class spell_valkyr_touch_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_valkyr_ball_periodic_dummy() : SpellScriptLoader("spell_valkyr_ball_periodic_dummy") { }
|
||||
PrepareAuraScript(spell_valkyr_touch_aura);
|
||||
|
||||
class spell_valkyr_ball_periodic_dummyAuraScript : public AuraScript
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_valkyr_ball_periodic_dummyAuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
PreventDefaultAction();
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
if (caster->GetMap()->GetId() == 649 )
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetDisplayId() != 11686)
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (Player* player = creature->SelectNearestPlayer(2.75f))
|
||||
if (creature->GetExactDist2d(player) <= 2.75f)
|
||||
{
|
||||
creature->AI()->DoAction(1); // despawning = true;
|
||||
creature->GetMotionMaster()->MoveIdle();
|
||||
creature->CastSpell((Unit*)nullptr, creature->GetEntry() == NPC_CONCENTRATED_LIGHT ? SPELL_UNLEASHED_LIGHT : SPELL_UNLEASHED_DARK, false);
|
||||
creature->SetDisplayId(11686);
|
||||
creature->DespawnOrUnsummon(1500);
|
||||
}
|
||||
uint32 excludedID = GetSpellInfo()->ExcludeTargetAuraSpell;
|
||||
Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
{
|
||||
uint32 absorb = 0;
|
||||
uint32 resist = 0;
|
||||
CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
|
||||
uint32 damage = dmg;
|
||||
int32 resilienceReduction = damage;
|
||||
if (caster->CanApplyResilience())
|
||||
Unit::ApplyResilience(plr, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
|
||||
resilienceReduction = damage - resilienceReduction;
|
||||
damage -= resilienceReduction;
|
||||
uint32 mitigated_damage = resilienceReduction;
|
||||
DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
|
||||
Unit::CalcAbsorbResist(dmgInfo);
|
||||
Unit::DealDamageMods(plr, damage, &absorb);
|
||||
int32 overkill = damage - plr->GetHealth();
|
||||
if (overkill < 0)
|
||||
overkill = 0;
|
||||
SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
|
||||
plr->SendPeriodicAuraLog(&pInfo);
|
||||
Unit::DealDamage(caster, plr, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_ball_periodic_dummyAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_valkyr_ball_periodic_dummyAuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_touch_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_valkyr_ball_periodic_dummy_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_valkyr_ball_periodic_dummy_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_UNLEASHED_LIGHT, SPELL_UNLEASHED_DARK });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetDisplayId() != 11686)
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (Player* player = creature->SelectNearestPlayer(2.75f))
|
||||
if (creature->GetExactDist2d(player) <= 2.75f)
|
||||
{
|
||||
creature->AI()->DoAction(1); // despawning = true;
|
||||
creature->GetMotionMaster()->MoveIdle();
|
||||
creature->CastSpell((Unit*)nullptr, creature->GetEntry() == NPC_CONCENTRATED_LIGHT ? SPELL_UNLEASHED_LIGHT : SPELL_UNLEASHED_DARK, false);
|
||||
creature->SetDisplayId(11686);
|
||||
creature->DespawnOrUnsummon(1500);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_ball_periodic_dummy_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -923,7 +900,7 @@ void AddSC_boss_twin_valkyr()
|
||||
new boss_eydis();
|
||||
new npc_essence_of_twin();
|
||||
new npc_concentrated_ball();
|
||||
new spell_valkyr_essence();
|
||||
new spell_valkyr_touch();
|
||||
new spell_valkyr_ball_periodic_dummy();
|
||||
RegisterSpellScript(spell_valkyr_essence_aura);
|
||||
RegisterSpellScript(spell_valkyr_touch_aura);
|
||||
RegisterSpellScript(spell_valkyr_ball_periodic_dummy_aura);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
enum ScriptTexts
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "TransportMgr.h"
|
||||
#include "Vehicle.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "Vehicle.h"
|
||||
#include "Weather.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
|
||||
@@ -21,14 +21,9 @@
|
||||
#include "Chat.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureScript.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
|
||||
#define DataHeader "IC"
|
||||
|
||||
|
||||
@@ -254,39 +254,28 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_loken_pulsing_shockwave : public SpellScriptLoader
|
||||
class spell_loken_pulsing_shockwave : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
|
||||
PrepareSpellScript(spell_loken_pulsing_shockwave);
|
||||
|
||||
class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
|
||||
void CalculateDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
void CalculateDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * distance));
|
||||
}
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * distance));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_loken_pulsing_shockwave_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_loken()
|
||||
{
|
||||
new boss_loken();
|
||||
new spell_loken_pulsing_shockwave();
|
||||
RegisterSpellScript(spell_loken_pulsing_shockwave);
|
||||
}
|
||||
|
||||
@@ -180,74 +180,57 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_krystallus_shatter : public SpellScriptLoader
|
||||
class spell_krystallus_shatter : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
|
||||
PrepareSpellScript(spell_krystallus_shatter);
|
||||
|
||||
class spell_krystallus_shatter_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SHATTER_EFFECT });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(GROUND_SLAM_STONED_EFFECT);
|
||||
target->CastSpell((Unit*)nullptr, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_krystallus_shatter_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(GROUND_SLAM_STONED_EFFECT);
|
||||
target->CastSpell((Unit*)nullptr, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_krystallus_shatter_effect : public SpellScriptLoader
|
||||
class spell_krystallus_shatter_effect : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
|
||||
PrepareSpellScript(spell_krystallus_shatter_effect);
|
||||
|
||||
class spell_krystallus_shatter_effect_SpellScript : public SpellScript
|
||||
void CalculateDamage()
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
return;
|
||||
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
return;
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_krystallus_shatter_effect_SpellScript();
|
||||
OnHit += SpellHitFn(spell_krystallus_shatter_effect::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_krystallus()
|
||||
{
|
||||
new boss_krystallus();
|
||||
new spell_krystallus_shatter();
|
||||
new spell_krystallus_shatter_effect();
|
||||
RegisterSpellScript(spell_krystallus_shatter);
|
||||
RegisterSpellScript(spell_krystallus_shatter_effect);
|
||||
}
|
||||
|
||||
@@ -864,30 +864,24 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_hos_dark_matter : public SpellScriptLoader
|
||||
class spell_hos_dark_matter_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_hos_dark_matter() : SpellScriptLoader("spell_hos_dark_matter") { }
|
||||
PrepareAuraScript(spell_hos_dark_matter_aura);
|
||||
|
||||
class spell_hos_dark_matter_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hos_dark_matter_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_DARK_MATTER_H, SPELL_DARK_MATTER });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, caster->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_hos_dark_matter_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, caster->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -897,5 +891,5 @@ void AddSC_brann_bronzebeard()
|
||||
new dark_rune_protectors();
|
||||
new dark_rune_stormcaller();
|
||||
new iron_golem_custodian();
|
||||
new spell_hos_dark_matter();
|
||||
RegisterSpellScript(spell_hos_dark_matter_aura);
|
||||
}
|
||||
|
||||
@@ -184,54 +184,48 @@ class boss_archavon : public CreatureScript
|
||||
};
|
||||
|
||||
// 58941 - Rock Shards
|
||||
class spell_archavon_rock_shards : public SpellScriptLoader
|
||||
class spell_archavon_rock_shards : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_archavon_rock_shards() : SpellScriptLoader("spell_archavon_rock_shards") { }
|
||||
PrepareSpellScript(spell_archavon_rock_shards);
|
||||
|
||||
class spell_archavon_rock_shards_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_ROCK_SHARDS_LEFT_HAND_VISUAL, SPELL_ROCK_SHARDS_RIGHT_HAND_VISUAL });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_archavon_rock_shards_SpellScript);
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (!caster || !target)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (!caster || !target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Map* map = caster->GetMap();
|
||||
if (!map)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
caster->CastSpell(target, SPELL_ROCK_SHARDS_LEFT_HAND_VISUAL, true);
|
||||
caster->CastSpell(target, SPELL_ROCK_SHARDS_RIGHT_HAND_VISUAL, true);
|
||||
|
||||
uint32 spellId = map->Is25ManRaid() ? SPELL_ROCK_SHARDS_DAMAGE_25 : SPELL_ROCK_SHARDS_DAMAGE_10;
|
||||
caster->CastSpell(target, spellId, true);
|
||||
return;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
Map* map = caster->GetMap();
|
||||
if (!map)
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_archavon_rock_shards_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_archavon_rock_shards_SpellScript();
|
||||
caster->CastSpell(target, SPELL_ROCK_SHARDS_LEFT_HAND_VISUAL, true);
|
||||
caster->CastSpell(target, SPELL_ROCK_SHARDS_RIGHT_HAND_VISUAL, true);
|
||||
|
||||
uint32 spellId = map->Is25ManRaid() ? SPELL_ROCK_SHARDS_DAMAGE_25 : SPELL_ROCK_SHARDS_DAMAGE_10;
|
||||
caster->CastSpell(target, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_archavon_rock_shards::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_archavon()
|
||||
{
|
||||
new boss_archavon();
|
||||
new spell_archavon_rock_shards();
|
||||
RegisterSpellScript(spell_archavon_rock_shards);
|
||||
}
|
||||
|
||||
@@ -205,69 +205,52 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_voa_overcharge : public SpellScriptLoader
|
||||
class spell_voa_overcharge_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_voa_overcharge() : SpellScriptLoader("spell_voa_overcharge") { }
|
||||
PrepareAuraScript(spell_voa_overcharge_aura);
|
||||
|
||||
class spell_voa_overcharge_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_voa_overcharge_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_OVERCHARGED_BLAST });
|
||||
}
|
||||
|
||||
void HandlePeriodicDummy(AuraEffect const* /*aurEff*/)
|
||||
void HandlePeriodicDummy(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (target->IsCreature() && GetAura()->GetStackAmount() >= 10)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (target->IsCreature() && GetAura()->GetStackAmount() >= 10)
|
||||
{
|
||||
target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true);
|
||||
Unit::Kill(target, target, false);
|
||||
}
|
||||
|
||||
PreventDefaultAction();
|
||||
target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true);
|
||||
Unit::Kill(target, target, false);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_voa_overcharge_AuraScript::HandlePeriodicDummy, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_voa_overcharge_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_voa_overcharge_aura::HandlePeriodicDummy, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_voa_lightning_nova : public SpellScriptLoader
|
||||
class spell_voa_lightning_nova : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_voa_lightning_nova() : SpellScriptLoader("spell_voa_lightning_nova") { }
|
||||
PrepareSpellScript(spell_voa_lightning_nova);
|
||||
|
||||
class spell_voa_lightning_nova_SpellScript : public SpellScript
|
||||
void HandleOnHit()
|
||||
{
|
||||
PrepareSpellScript(spell_voa_lightning_nova_SpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
int32 damage = 0;
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
int32 damage = 0;
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
float dist = target->GetDistance(GetCaster());
|
||||
damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f);
|
||||
}
|
||||
|
||||
SetHitDamage(damage);
|
||||
float dist = target->GetDistance(GetCaster());
|
||||
damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_voa_lightning_nova_SpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
SetHitDamage(damage);
|
||||
}
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_voa_lightning_nova_SpellScript();
|
||||
OnHit += SpellHitFn(spell_voa_lightning_nova::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -275,6 +258,6 @@ void AddSC_boss_emalon()
|
||||
{
|
||||
new boss_emalon();
|
||||
|
||||
new spell_voa_overcharge();
|
||||
new spell_voa_lightning_nova();
|
||||
RegisterSpellScript(spell_voa_overcharge_aura);
|
||||
RegisterSpellScript(spell_voa_lightning_nova);
|
||||
}
|
||||
|
||||
@@ -165,101 +165,73 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_voa_flaming_cinder : public SpellScriptLoader
|
||||
class spell_voa_flaming_cinder : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_voa_flaming_cinder() : SpellScriptLoader("spell_voa_flaming_cinder") { }
|
||||
PrepareSpellScript(spell_voa_flaming_cinder);
|
||||
|
||||
class spell_voa_flaming_cinder_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_voa_flaming_cinder_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_FLAMING_CINDER_MISSILE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_FLAMING_CINDER_MISSILE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voa_flaming_cinder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_voa_flaming_cinder_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_FLAMING_CINDER_MISSILE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_voa_flaming_cinder::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_koralon_meteor_fists : public SpellScriptLoader
|
||||
class spell_koralon_meteor_fists_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_koralon_meteor_fists() : SpellScriptLoader("spell_koralon_meteor_fists") { }
|
||||
PrepareAuraScript(spell_koralon_meteor_fists_aura);
|
||||
|
||||
class spell_koralon_meteor_fists_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_koralon_meteor_fists_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_METEOR_FISTS_DAMAGE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_METEOR_FISTS_DAMAGE });
|
||||
}
|
||||
|
||||
void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_koralon_meteor_fists_AuraScript::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
return new spell_koralon_meteor_fists_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_koralon_meteor_fists_aura::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_flame_warder_meteor_fists : public SpellScriptLoader
|
||||
class spell_flame_warder_meteor_fists_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_flame_warder_meteor_fists() : SpellScriptLoader("spell_flame_warder_meteor_fists") { }
|
||||
PrepareAuraScript(spell_flame_warder_meteor_fists_aura);
|
||||
|
||||
class spell_flame_warder_meteor_fists_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_flame_warder_meteor_fists_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_FW_METEOR_FISTS_DAMAGE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FW_METEOR_FISTS_DAMAGE });
|
||||
}
|
||||
|
||||
void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_FW_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_flame_warder_meteor_fists_AuraScript::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void TriggerFists(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
return new spell_flame_warder_meteor_fists_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_FW_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_flame_warder_meteor_fists_aura::TriggerFists, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_koralon()
|
||||
{
|
||||
new boss_koralon();
|
||||
new spell_voa_flaming_cinder();
|
||||
new spell_koralon_meteor_fists();
|
||||
new spell_flame_warder_meteor_fists();
|
||||
RegisterSpellScript(spell_voa_flaming_cinder);
|
||||
RegisterSpellScript(spell_koralon_meteor_fists_aura);
|
||||
RegisterSpellScript(spell_flame_warder_meteor_fists_aura);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "OutdoorPvPScript.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -1233,7 +1233,7 @@ struct npc_parasitic_shadowfiend : public ScriptedAI
|
||||
|
||||
bool CanAIAttack(Unit const* who) const override
|
||||
{
|
||||
return !who->HasAura(SPELL_PARASITIC_SHADOWFIEND) && !who->HasAura(SPELL_PARASITIC_SHADOWFIEND_TRIGGER);
|
||||
return !who->HasAura(SPELL_PARASITIC_SHADOWFIEND) && !who->HasAura(SPELL_PARASITIC_SHADOWFIEND_TRIGGER) && who->IsPlayer();
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
@@ -731,7 +731,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case 36: //return and quest_complete
|
||||
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
|
||||
player->GroupEventHappens(QUEST_MARK_V_IS_ALIVE, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1863,7 +1863,6 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
{
|
||||
dragonmaw_race_npc(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_player = nullptr;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@@ -1873,14 +1872,17 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
me->SetWalk(true);
|
||||
me->SetDisableGravity(false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
_playerGUID.Clear();
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* /*quest*/) override
|
||||
{
|
||||
_player = player;
|
||||
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
|
||||
if (_player)
|
||||
Talk(SAY_START, _player);
|
||||
if (player)
|
||||
{
|
||||
_playerGUID = player->GetGUID();
|
||||
Talk(SAY_START, player);
|
||||
}
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
@@ -1915,38 +1917,38 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
void StartRace()
|
||||
{
|
||||
me->SetWalk(false);
|
||||
|
||||
ScheduleTimedEvent(5s, [&]
|
||||
{
|
||||
if (!_player)
|
||||
FailQuest();
|
||||
else if (!me->IsWithinDist(_player, 100.f))
|
||||
FailQuest();
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player || !me->IsWithinDist(player, 100.f))
|
||||
FailQuest(player);
|
||||
}, 5s);
|
||||
}
|
||||
|
||||
void FailQuest()
|
||||
void FailQuest(Player *player)
|
||||
{
|
||||
if (_player)
|
||||
if (player)
|
||||
{
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MUCKJAW:
|
||||
_player->FailQuest(QUEST_MUCKJAW);
|
||||
player->FailQuest(QUEST_MUCKJAW);
|
||||
break;
|
||||
case NPC_TROPE:
|
||||
_player->FailQuest(QUEST_TROPE);
|
||||
player->FailQuest(QUEST_TROPE);
|
||||
break;
|
||||
case NPC_CORLOK:
|
||||
_player->FailQuest(QUEST_CORLOK);
|
||||
player->FailQuest(QUEST_CORLOK);
|
||||
break;
|
||||
case NPC_ICHMAN:
|
||||
_player->FailQuest(QUEST_ICHMAN);
|
||||
player->FailQuest(QUEST_ICHMAN);
|
||||
break;
|
||||
case NPC_MULVERICK:
|
||||
_player->FailQuest(QUEST_MULVERICK);
|
||||
player->FailQuest(QUEST_MULVERICK);
|
||||
break;
|
||||
case NPC_SKYSHATTER:
|
||||
_player->FailQuest(QUEST_SKYSHATTER);
|
||||
player->FailQuest(QUEST_SKYSHATTER);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1962,7 +1964,11 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
* Timers are placeholders
|
||||
* After spawned, the rest is done via SmartAI
|
||||
*/
|
||||
if (!_player)
|
||||
if (_playerGUID.IsEmpty())
|
||||
return;
|
||||
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (me->GetEntry())
|
||||
@@ -1970,85 +1976,79 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
case NPC_MUCKJAW:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 15.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ(); // So they don't spawn at ground height
|
||||
me->SummonCreature(NPC_TARGET_MUCKJAW, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 15.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ(); // So they don't spawn at ground height
|
||||
me->SummonCreature(NPC_TARGET_MUCKJAW, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 4s, 8s);
|
||||
break;
|
||||
case NPC_TROPE:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_TROPE, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
return;
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_TROPE, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 1s, 3s);
|
||||
break;
|
||||
case NPC_CORLOK:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_CORLOK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
return;
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_CORLOK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 1s, 3s);
|
||||
break;
|
||||
case NPC_ICHMAN:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_ICHMAN, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
return;
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_ICHMAN, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 1s, 3s);
|
||||
break;
|
||||
case NPC_MULVERICK:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_MULVERICK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
return;
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 10.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ();
|
||||
me->SummonCreature(NPC_TARGET_MULVERICK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 1s, 3s);
|
||||
break;
|
||||
case NPC_SKYSHATTER:
|
||||
ScheduleTimedEvent(4s, [&]
|
||||
{
|
||||
if (_player)
|
||||
{
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(_player->GetPosition(), 7.f);
|
||||
summonPos.m_positionZ = _player->GetPositionZ(); // So they don't spawn at ground height
|
||||
me->SummonCreature(NPC_TARGET_SKYSHATTER, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
else
|
||||
return;
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Position summonPos;
|
||||
summonPos = me->GetRandomPoint(player->GetPosition(), 7.f);
|
||||
summonPos.m_positionZ = player->GetPositionZ(); // So they don't spawn at ground height
|
||||
me->SummonCreature(NPC_TARGET_SKYSHATTER, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
}, 1s, 3s);
|
||||
break;
|
||||
default:
|
||||
@@ -2063,32 +2063,33 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
me->SetDisableGravity(false);
|
||||
me->SetWalk(true);
|
||||
|
||||
if (_player)
|
||||
Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Talk(SAY_COMPLETE, player);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
Talk(SAY_COMPLETE, _player);
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_MUCKJAW:
|
||||
_player->AreaExploredOrEventHappens(QUEST_MUCKJAW);
|
||||
break;
|
||||
case NPC_TROPE:
|
||||
_player->AreaExploredOrEventHappens(QUEST_TROPE);
|
||||
break;
|
||||
case NPC_CORLOK:
|
||||
_player->AreaExploredOrEventHappens(QUEST_CORLOK);
|
||||
break;
|
||||
case NPC_ICHMAN:
|
||||
_player->AreaExploredOrEventHappens(QUEST_ICHMAN);
|
||||
break;
|
||||
case NPC_MULVERICK:
|
||||
_player->AreaExploredOrEventHappens(QUEST_MULVERICK);
|
||||
break;
|
||||
case NPC_SKYSHATTER:
|
||||
_player->AreaExploredOrEventHappens(QUEST_SKYSHATTER);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case NPC_MUCKJAW:
|
||||
player->AreaExploredOrEventHappens(QUEST_MUCKJAW);
|
||||
break;
|
||||
case NPC_TROPE:
|
||||
player->AreaExploredOrEventHappens(QUEST_TROPE);
|
||||
break;
|
||||
case NPC_CORLOK:
|
||||
player->AreaExploredOrEventHappens(QUEST_CORLOK);
|
||||
break;
|
||||
case NPC_ICHMAN:
|
||||
player->AreaExploredOrEventHappens(QUEST_ICHMAN);
|
||||
break;
|
||||
case NPC_MULVERICK:
|
||||
player->AreaExploredOrEventHappens(QUEST_MULVERICK);
|
||||
break;
|
||||
case NPC_SKYSHATTER:
|
||||
player->AreaExploredOrEventHappens(QUEST_SKYSHATTER);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2202,8 +2203,8 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
break;
|
||||
case 7:
|
||||
StartRace();
|
||||
if (_player)
|
||||
Talk(SAY_SKYSHATTER_SPECIAL, _player);
|
||||
if (Player *player = ObjectAccessor::GetPlayer(me->GetMap(), _playerGUID))
|
||||
Talk(SAY_SKYSHATTER_SPECIAL, player);
|
||||
break;
|
||||
case 10:
|
||||
StartRaceAttacks();
|
||||
@@ -2232,7 +2233,7 @@ struct dragonmaw_race_npc : public ScriptedAI
|
||||
}
|
||||
|
||||
private:
|
||||
Player* _player;
|
||||
ObjectGuid _playerGUID;
|
||||
};
|
||||
|
||||
void AddSC_shadowmoon_valley()
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "TaskScheduler.h"
|
||||
|
||||
/*
|
||||
##################################################
|
||||
|
||||
@@ -1210,6 +1210,7 @@ private:
|
||||
uint32 _limit;
|
||||
};
|
||||
|
||||
// 28764 - Adaptive Warding (Frostfire Regalia Set)
|
||||
enum AdaptiveWarding
|
||||
{
|
||||
SPELL_GEN_ADAPTIVE_WARDING_FIRE = 28765,
|
||||
@@ -1219,7 +1220,6 @@ enum AdaptiveWarding
|
||||
SPELL_GEN_ADAPTIVE_WARDING_ARCANE = 28770
|
||||
};
|
||||
|
||||
// 28764 - Adaptive Warding (Frostfire Regalia Set)
|
||||
class spell_gen_adaptive_warding : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_adaptive_warding);
|
||||
@@ -1245,7 +1245,7 @@ class spell_gen_adaptive_warding : public AuraScript
|
||||
if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, 0x10000000, 0x0, 0x0))
|
||||
return false;
|
||||
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSpellInfo()->GetSchoolMask()))
|
||||
{
|
||||
case SPELL_SCHOOL_NORMAL:
|
||||
case SPELL_SCHOOL_HOLY:
|
||||
@@ -1253,6 +1253,7 @@ class spell_gen_adaptive_warding : public AuraScript
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1261,27 +1262,31 @@ class spell_gen_adaptive_warding : public AuraScript
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 spellId = 0;
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
|
||||
if (Player* player = eventInfo.GetActionTarget()->ToPlayer())
|
||||
{
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_FIRE;
|
||||
break;
|
||||
case SPELL_SCHOOL_NATURE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_NATURE;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_FROST;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_SHADOW;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_ARCANE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSpellInfo()->GetSchoolMask()))
|
||||
{
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_FIRE;
|
||||
break;
|
||||
case SPELL_SCHOOL_NATURE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_NATURE;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_FROST;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_SHADOW;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
spellId = SPELL_GEN_ADAPTIVE_WARDING_ARCANE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
player->CastSpell(player, spellId, true, nullptr, aurEff);
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1564,6 +1569,7 @@ class spell_gen_nightmare_vine : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 27539 - Obsidian Armor
|
||||
enum ObsidianArmor
|
||||
{
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_HOLY = 27536,
|
||||
@@ -1574,7 +1580,6 @@ enum ObsidianArmor
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_ARCANE = 27540
|
||||
};
|
||||
|
||||
// 27539 - Obsidian Armor
|
||||
class spell_gen_obsidian_armor : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_obsidian_armor);
|
||||
@@ -1594,52 +1599,54 @@ class spell_gen_obsidian_armor : public AuraScript
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetSpellInfo())
|
||||
{
|
||||
if (!eventInfo.GetSpellInfo())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL)
|
||||
if (GetFirstSchoolInMask(eventInfo.GetSpellInfo()->GetSchoolMask()) == SPELL_SCHOOL_NORMAL)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 spellId = 0;
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
|
||||
if (Player* player = eventInfo.GetActionTarget()->ToPlayer())
|
||||
{
|
||||
case SPELL_SCHOOL_HOLY:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_HOLY;
|
||||
break;
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_FIRE;
|
||||
break;
|
||||
case SPELL_SCHOOL_NATURE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_NATURE;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_FROST;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_SHADOW;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_ARCANE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
uint32 spellId = 0;
|
||||
switch (GetFirstSchoolInMask(eventInfo.GetSpellInfo()->GetSchoolMask()))
|
||||
{
|
||||
case SPELL_SCHOOL_HOLY:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_HOLY;
|
||||
break;
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_FIRE;
|
||||
break;
|
||||
case SPELL_SCHOOL_NATURE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_NATURE;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_FROST;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_SHADOW;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
spellId = SPELL_GEN_OBSIDIAN_ARMOR_ARCANE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
player->CastSpell(player, spellId, true, nullptr, aurEff);
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_gen_obsidian_armor::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_gen_obsidian_armor::OnProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_gen_obsidian_armor::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4092,6 +4092,55 @@ class spell_item_skyguard_blasting_charges : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 23595 - Luffa
|
||||
class spell_item_luffa : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_luffa);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (GetCaster())
|
||||
{
|
||||
Unit::AuraApplicationMap const& auras = GetCaster()->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
Aura const* aura = itr->second->GetBase();
|
||||
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
||||
continue;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return SPELL_FAILED_NOTHING_TO_DISPEL;
|
||||
}
|
||||
|
||||
void HandleEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
if (Player* player = GetCaster()->ToPlayer())
|
||||
{
|
||||
Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
Aura const* aura = itr->second->GetBase();
|
||||
if (!(aura->GetSpellInfo()->GetAllEffectsMechanicMask() & (1 << MECHANIC_BLEED)) || aura->GetCasterLevel() > 60 || aura->GetSpellInfo()->IsPositive())
|
||||
continue;
|
||||
|
||||
player->RemoveAurasDueToSpell(aura->GetId(), aura->GetCasterGUID());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_luffa::CheckCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_luffa::HandleEffect, EFFECT_0, SPELL_EFFECT_DISPEL_MECHANIC);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_item_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_item_massive_seaforium_charge);
|
||||
@@ -4217,4 +4266,5 @@ void AddSC_item_spell_scripts()
|
||||
RegisterSpellScript(spell_item_fel_mana_potion);
|
||||
RegisterSpellScript(spell_item_gor_dreks_ointment);
|
||||
RegisterSpellScript(spell_item_skyguard_blasting_charges);
|
||||
RegisterSpellScript(spell_item_luffa);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "AccountScript.h"
|
||||
#include "Channel.h"
|
||||
#include "CreatureScript.h"
|
||||
#include "Group.h"
|
||||
#include "Guild.h"
|
||||
#include "PlayerScript.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Realm.h"
|
||||
#include "IpNetwork.h"
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <memory> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
|
||||
boost::asio::ip::tcp_endpoint Realm::GetAddressForClient(boost::asio::ip::address const& clientAddr) const
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "AsioHacksFwd.h"
|
||||
#include "Common.h"
|
||||
#include <memory>
|
||||
#include <memory> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
|
||||
enum RealmFlags
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "RealmList.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DeadlineTimer.h"
|
||||
#include "IoContext.h"
|
||||
#include "Log.h"
|
||||
#include "Resolver.h"
|
||||
#include "QueryResult.h"
|
||||
#include "Util.h"
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <memory>
|
||||
|
||||
RealmList::RealmList() : _updateInterval(0) { }
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "Realm.h"
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <memory> // NOTE: this import is NEEDED (even though some IDEs report it as unused)
|
||||
#include <vector>
|
||||
|
||||
struct RealmBuildInfo
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "Define.h"
|
||||
#include "SmartEnum.h"
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace Acore::Impl::EnumUtilsImpl
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user