diff options
-rw-r--r-- | sql/FULL/world_scripts_full.sql | 1 | ||||
-rw-r--r-- | sql/updates/5714_world_scripts.sql | 2 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp | 74 | ||||
-rw-r--r-- | src/bindings/scripts/system/ScriptLoader.cpp | 2 | ||||
-rw-r--r-- | src/game/UnitAI.cpp | 4 | ||||
-rw-r--r-- | src/game/Wintergrasp.cpp | 3 |
6 files changed, 57 insertions, 29 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 10a3a56a3c4..3eab0b779b6 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -179,6 +179,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_ahnkahar_nerubian' WHERE `entry UPDATE `creature_template` SET `ScriptName`='boss_taldaram' WHERE `entry`=29308; UPDATE `creature_template` SET `ScriptName`='mob_taldaram_flamesphere' WHERE `entry` IN (30106,31686,31687); UPDATE `gameobject_template` SET `ScriptName`='prince_taldaram_sphere' WHERE `entry` IN (193093,193094); +UPDATE `creature_template` SET `ScriptName`='boss_volazj' WHERE `entry`=29311; /* AZSHARA */ UPDATE `creature_template` SET `ScriptName`='mobs_spitelashes' WHERE `entry` IN (6190,6193,6194,6195,6196,7885,7886,12204,12205); diff --git a/sql/updates/5714_world_scripts.sql b/sql/updates/5714_world_scripts.sql new file mode 100644 index 00000000000..32a672c2ced --- /dev/null +++ b/sql/updates/5714_world_scripts.sql @@ -0,0 +1,2 @@ + +UPDATE `creature_template` SET `ScriptName`='boss_volazj' WHERE `entry`=29311; diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp index d289fed0670..19b0daf0dff 100644 --- a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp @@ -18,28 +18,24 @@ /* ScriptData SDName: boss_herald_volazj -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: +SDAuthor: Tartalo +SD%Complete: 20 +SDComment: Coded all but Insanity SDCategory: Ahn'kahet EndScriptData */ -/*** SQL START *** -update creature_template set scriptname = 'boss_volazj' where entry = ''; -*** SQL END ***/ - #include "precompiled.h" #include "def_ahnkahet.h" //Spells #define SPELL_INSANITY 57496 //Dummy #define INSANITY_VISUAL 57561 -#define SPELL_MIND_FLAY_N 57941 -#define SPELL_MIND_FLAY_H 59974 -#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 -#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 -#define SPELL_SHIVER_N 57949 -#define SPELL_SHIVER_H 59978 +#define SPELL_MIND_FLAY 57941 +#define H_SPELL_MIND_FLAY 59974 +#define SPELL_SHADOW_BOLT_VOLLEY 57942 +#define H_SPELL_SHADOW_BOLT_VOLLEY 59975 +#define SPELL_SHIVER 57949 +#define H_SPELL_SHIVER 59978 //not in db //Yell @@ -55,31 +51,60 @@ struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI { boss_volazjAI(Creature *c) : ScriptedAI(c) {} - uint32 phase; + uint32 uiMindFlayTimer; + uint32 uiShadowBoltVolleyTimer; + uint32 uiShiverTimer; - void Reset() {} + void Reset() + { + uiMindFlayTimer = 8000; + uiShadowBoltVolleyTimer = 5000; + uiShiverTimer = 15000; + + if (pInstance) + pInstance->SetData(DATA_HERALD_VOLAZJ, NOT_STARTED); + } + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HERALD_VOLAZJ, IN_PROGRESS); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; - phase =1; + if (uiMindFlayTimer < diff) + { + DoCast(m_creature->GetVictim(), HeroicMode ? H_SPELL_MIND_FLAY : SPELL_MIND_FLAY); + uiMindFlayTimer = 20000; + } else uiMindFlayTimer -= diff; + + if (uiShadowBoltVolleyTimer < diff) + { + DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY); + uiShadowBoltVolleyTimer = 5000; + } else uiShadowBoltVolleyTimer -= diff; + + if (uiShiverTimer < diff) + { + DoCast(m_creature, HeroicMode ? H_SPELL_SHIVER : SPELL_SHIVER); + uiShiverTimer = 15000; + } else uiShiverTimer -= diff; DoMeleeAttackIfReady(); } void JustDied(Unit* killer) { - if (phase == 1) DoScriptText(SAY_DEATH_1, m_creature); - else - DoScriptText(SAY_DEATH_2, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HERALD_VOLAZJ, DONE); } void KilledUnit(Unit *victim) @@ -87,12 +112,7 @@ struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI if (victim == m_creature) return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY3), m_creature); } }; diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 420019563a6..0144a5e3068 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -264,6 +264,7 @@ extern void AddSC_winterspring(); extern void AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet extern void AddSC_boss_taldaram(); extern void AddSC_boss_elder_nadox(); +extern void AddSC_boss_volazj(); extern void AddSC_boss_anubrekhan(); //Naxxramas extern void AddSC_boss_maexxna(); extern void AddSC_boss_patchwerk(); @@ -665,6 +666,7 @@ void AddScripts() AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet AddSC_boss_taldaram(); AddSC_boss_elder_nadox(); + AddSC_boss_volazj(); AddSC_boss_anubrekhan(); //Naxxramas AddSC_boss_maexxna(); AddSC_boss_patchwerk(); diff --git a/src/game/UnitAI.cpp b/src/game/UnitAI.cpp index d0a013393ba..728e6f36916 100644 --- a/src/game/UnitAI.cpp +++ b/src/game/UnitAI.cpp @@ -83,10 +83,10 @@ bool UnitAI::DoSpellAttackIfReady(uint32 spell) inline bool SelectTargetHelper(const Unit * me, const Unit * target, const bool &playerOnly, const float &dist, const int32 &aura) { - if(playerOnly && target->GetTypeId() != TYPEID_PLAYER) + if(playerOnly && (!target || target->GetTypeId() != TYPEID_PLAYER)) return false; - if(dist && !me->IsWithinCombatRange(target, dist)) + if(dist && (!me || !target || !me->IsWithinCombatRange(target, dist))) return false; if(aura) diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index e56bd36fc19..0d9e3238c31 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -296,6 +296,9 @@ bool OPvPWintergrasp::SetupOutdoorPvP() for(int i = 0; i < WG_REWARD_EVENT_MAX; ++i) m_customHonorReward[i] = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_CUSTOM_HONOR_0 + i); + // if server crashed while in battle there could be players with rank aura from last battle + CharacterDatabase.PExecute("DELETE FROM character_aura WHERE spell IN (%u,%u,%u)", SPELL_RECRUIT, SPELL_CORPORAL, SPELL_LIEUTENANT); + RegisterZone(ZONE_WINTERGRASP); return true; } |