diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/Makefile.am | 3 | ||||
-rw-r--r-- | src/bindings/scripts/ScriptMgr.cpp | 10 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp | 239 | ||||
-rw-r--r-- | src/game/DBCStores.cpp | 6 | ||||
-rw-r--r-- | src/game/Pet.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 7 |
7 files changed, 203 insertions, 66 deletions
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am index 764843f3714..5e98755a8b4 100644 --- a/src/bindings/scripts/Makefile.am +++ b/src/bindings/scripts/Makefile.am @@ -85,6 +85,9 @@ scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp \ scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp \ scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h \ scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp \ +scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp \ +scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp \ +scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h \ scripts/zone/azshara/azshara.cpp \ scripts/zone/azshara/boss_azuregos.cpp \ scripts/zone/azuremyst_isle/azuremyst_isle.cpp \ diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index a87322e33bf..2ae7072dee1 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -113,6 +113,11 @@ extern void AddSC_boss_grandmaster_vorpil(); extern void AddSC_boss_murmur(); extern void AddSC_instance_shadow_labyrinth(); +//Azjol-Nerub +//--Ahn'kahet +extern void AddSC_instance_ahnkahet(); +extern void AddSC_boss_elder_nadox(); + //Azshara extern void AddSC_boss_azuregos(); extern void AddSC_azshara(); @@ -1037,6 +1042,11 @@ void ScriptsInit() AddSC_boss_murmur(); AddSC_instance_shadow_labyrinth(); + //Azjol-Nerub + //--Ahn'kahet + AddSC_instance_ahnkahet(); + AddSC_boss_elder_nadox(); + //Azshara AddSC_boss_azuregos(); AddSC_azshara(); diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp index 468aa8e10a7..a911d9a0c17 100644 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp @@ -18,35 +18,14 @@ /* ScriptData SDName: boss_elder_nadox -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: +SD%Complete: 100 +SDComment: SDCategory: Ahn'kahet EndScriptData */ -/*** SQL START *** -update creature_template set scriptname = 'boss_nadox' where entry = ''; -*** SQL END ***/ - #include "precompiled.h" #include "def_ahnkahet.h" -#define SPELL_BROOD_PLAGUE 56130 -#define H_SPELL_BROOD_PLAGUE 59467 -#define SPELL_BROOD_RAGE 59465 //--> Heroic -- Enrages a Swarmer, increasing size and damage done. - -#define MOB_AHNKAHAR_SWARMER 30178 -#define SPELL_SUMMON_SWARMERS 56119//2x 30178 - -#define MOB_AHNKAHAR_SWARMER 30178 -#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -#define SPELL_DEADLY_POISON 56145// Proc trigger -#define H_SPELL_DEADLY_POISON 59479// Proc trigger -#define SPELL_GUARDIAN_AURA 56151 - -//randomly summons NPC 30178 and 30176 they can cast Sprint (56354) - -//Yell #define SAY_AGGRO -1619014 #define SAY_SLAY_1 -1619015 #define SAY_SLAY_2 -1619016 @@ -55,63 +34,211 @@ update creature_template set scriptname = 'boss_nadox' where entry = ''; #define SAY_EGG_SAC_1 -1619019 #define SAY_EGG_SAC_2 -1619020 -struct TRINITY_DLL_DECL boss_nadoxAI : public ScriptedAI +#define SPELL_BROOD_PLAGUE 56130 +#define H_SPELL_BROOD_PLAGUE 59467 +#define H_SPELL_BROOD_RAGE 59465 +#define SPELL_ENRAGE 26662// Enraged if too far away from home + +#define MOB_AHNKAHAR_SWARMER 30178 +#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs + +#define MOB_AHNKAHAR_SWARM_GUARD 30176 +#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs +#define SPELL_GUARDIAN_AURA 56151 + +struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI { - boss_nadoxAI(Creature *c) : ScriptedAI(c) {} - - uint32 plague, - summon; - - void Reset() {} - - void Aggro(Unit* who) + boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 plague_Timer; + uint32 rage_Timer; + + uint32 swarmer_spawn_Timer; + uint32 guard_spawn_Timer; + uint32 enrage_Timer; + + + ScriptedInstance *pInstance; + + void Reset() { - DoScriptText(SAY_AGGRO, m_creature); + plague_Timer = 13000; + rage_Timer = 20000; + + swarmer_spawn_Timer = 10000; + guard_spawn_Timer = 25000; + + enrage_Timer = 5000; + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) + + void Aggro(Unit *who) { - //Return since we have no target - if(!UpdateVictim()) + DoScriptText(SAY_DEATH,m_creature); + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if(victim == m_creature) return; - - DoMeleeAttackIfReady(); + 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; + } } - + void JustDied(Unit* killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_SLAY_3,m_creature); + + if(pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); } - void KilledUnit(Unit *victim) + void UpdateAI(const uint32 diff) { - if (victim == m_creature) + if(!UpdateVictim()) return; - switch(rand()%3) + if(plague_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); + plague_Timer = 15000; + }else plague_Timer -= diff; + + if(HeroicMode) + if(rage_Timer < diff) + { + Unit* Swarmer = FindCreature(MOB_AHNKAHAR_SWARMER,35,m_creature); + + if(Swarmer) + { + DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); + rage_Timer = 15000; + } + }else rage_Timer -= diff; + + if(swarmer_spawn_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); + DoCast(m_creature,SPELL_SUMMON_SWARMERS); + if(rand()%3 == 0) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; + case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; + } + } + swarmer_spawn_Timer = 10000; + }else swarmer_spawn_Timer -= diff; + + if(guard_spawn_Timer < diff) + { + m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); + DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); + guard_spawn_Timer = 25000; + }else guard_spawn_Timer -= diff; + + if(enrage_Timer < diff) { - 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; + if(m_creature->HasAura(SPELL_ENRAGE,0)) + return; + + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if(z < 24 ) + { + if(!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature,SPELL_ENRAGE,true); + } + } + enrage_Timer = 5000; + }else enrage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_elder_nadox(Creature *_Creature) +{ + return new boss_elder_nadoxAI(_Creature); +} +#define SPELL_SPRINT 56354 +struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI +{ + mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance *pInstance; + uint32 sprint_Timer; + + void Reset() + { + if(m_creature->GetEntry() == 30176) + DoCast(m_creature,SPELL_GUARDIAN_AURA,true); + sprint_Timer = 10000; + } + void Aggro(Unit *who){} + void UpdateAI(const uint32 diff) + { + if(m_creature->GetEntry() == 30176) + m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); + + if(pInstance) + { + if(pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + } } + + if(!UpdateVictim()) + return; + + if(sprint_Timer < diff) + { + DoCast(m_creature,SPELL_SPRINT); + sprint_Timer = 25000; + }else sprint_Timer -= diff; + + DoMeleeAttackIfReady(); } - - void summon_swarmer(){} - void summon_guardian(){} }; -CreatureAI* GetAI_boss_nadox(Creature *_Creature) +CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature *_Creature) { - return new boss_nadoxAI (_Creature); + return new mob_ahnkahar_nerubianAI(_Creature); } -void AddSC_boss_nadox() +void AddSC_boss_elder_nadox() { Script *newscript; newscript = new Script; - newscript->Name="boss_nadox"; - newscript->GetAI = GetAI_boss_nadox; + newscript->Name="boss_elder_nadox"; + newscript->GetAI = &GetAI_boss_elder_nadox; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ahnkahar_nerubian"; + newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; newscript->RegisterSelf(); } diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index e1fe1eba5e7..c643dc4613a 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -334,10 +334,12 @@ void LoadDBCStores(const std::string& dataPath) if(skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) continue; + if(spellInfo->spellLevel) + continue; // Passive spell has to have spellfamilyflags if name present (need to not apply 20782) - if (spellInfo->Attributes & SPELL_ATTR_UNK18 && spellInfo->SpellFamilyName && !spellInfo->SpellFamilyFlags) - continue; + //if (spellInfo->Attributes & SPELL_ATTR_UNK18 && spellInfo->SpellFamilyName && !spellInfo->SpellFamilyFlags) + // continue; sPetFamilySpellsStore[i].insert(spellInfo->Id); } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index df4ed5f46d4..9c8835b8ded 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1089,8 +1089,6 @@ void Pet::_SaveSpells() void Pet::_LoadAuras(uint32 timediff) { sLog.outDebug("Loading auras for pet %u",GetGUIDLow()); - for (int i = 0; i < TOTAL_AURAS; i++) - m_modAuras[i].clear(); QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber()); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5ce396bfa69..71936933a8b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14633,8 +14633,6 @@ void Player::_LoadActions(QueryResult *result) void Player::_LoadAuras(QueryResult *result, uint32 timediff) { sLog.outDebug("Loading auras for player %u",GetGUIDLow()); - for (int i = 0; i < TOTAL_AURAS; i++) - m_modAuras[i].clear(); //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0,amount1,amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow()); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 57da4116275..df5fa14541b 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2533,11 +2533,10 @@ void SpellMgr::LoadPetLevelupSpellMap() if (creatureFamily->skillLine[j]!=skillLine->skillId) continue; SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId); - // not exist or passive (passives are handled elsewhere) - if(!spell || IsPassiveSpell(spell->Id)) + // not exist or triggered or talent + if(!spell || !spell->spellLevel || GetTalentSpellPos(spell->Id)) continue; - // Make sure that triggered spells aren't learned - if (!spell->SpellFamilyName && !spell->StartRecoveryCategory) + if (!spell->SpellFamilyFlags && spell->SpellIconID!=2310 && (!spell->RecoveryTime || !spell->StartRecoveryCategory)) continue; mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id ))); count++; |