aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp5
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp33
-rw-r--r--src/game/Map.cpp3
-rw-r--r--src/game/MiscHandler.cpp1
-rw-r--r--src/game/Object.cpp6
-rw-r--r--src/game/Spell.cpp20
-rw-r--r--src/game/SpellMgr.cpp4
8 files changed, 35 insertions, 39 deletions
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
index 0c139ddefb2..f18cd81064a 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
@@ -96,8 +96,9 @@ struct TRINITY_DLL_DECL boss_grobbulusAI : public ScriptedAI
return;
case EVENT_INJECT:
if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_MUTATING_INJECTION);
- events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * me->GetHealth() / me->GetMaxHealth());
+ if(!target->HasAura(SPELL_MUTATING_INJECTION))
+ DoCast(target, SPELL_MUTATING_INJECTION);
+ events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth()));
return;
}
}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
index 2d827bd4ff0..5e7bd69e41a 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
@@ -214,7 +214,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
if(Phase == 1)
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- EnterEvadeMode();
+ //EnterEvadeMode();
//SummonWasters_Timer at far positon
if ( SummonWasters_Timer< diff)
{
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index 0e2498dc679..a0cfb77c06c 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -28,8 +28,8 @@ EndScriptData */
#define SPELL_ICEBOLT 28522
#define SPELL_FROST_BREATH 29318
-#define SPELL_FROST_AURA 28531
-#define SPELL_LIFE_DRAIN 28542
+#define SPELL_FROST_AURA HEROIC(28531,55799)
+#define SPELL_LIFE_DRAIN HEROIC(28542,55665)
//#define SPELL_CHILL 28560
#define SPELL_BLIZZARD 28547
#define SPELL_BESERK 26662
@@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
Fly_Timer = 45000;
Icebolt_Timer = 4000;
land_Timer = 0;
- Beserk_Timer = 0;
+ Beserk_Timer = 15*60000;
phase = 1;
Icebolt_Count = 0;
IsInFly = false;
@@ -76,6 +76,8 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
void EnterCombat(Unit *who)
{
+ DoZoneInCombat();
+ me->CastSpell(me, SPELL_FROST_AURA, true);
}
void UpdateAI(const uint32 diff)
@@ -85,19 +87,9 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
if(phase == 1)
{
- if(FrostAura_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_AURA);
- FrostAura_Timer = 5000;
- }else FrostAura_Timer -= diff;
-
if(LifeDrain_Timer < diff)
{
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(target,SPELL_LIFE_DRAIN);
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(target,SPELL_LIFE_DRAIN);
-
+ DoCastAOE(SPELL_LIFE_DRAIN);
LifeDrain_Timer = 24000;
}else LifeDrain_Timer -= diff;
@@ -178,15 +170,12 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
}else land_Timer -= diff;
}
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 10)
+ if (Beserk_Timer < diff)
{
- if (Beserk_Timer < diff)
- {
- DoScriptText(EMOTE_ENRAGE, m_creature);
- DoCast(m_creature,SPELL_BESERK);
- Beserk_Timer = 300000;
- }else Beserk_Timer -= diff;
- }
+ DoScriptText(EMOTE_ENRAGE, m_creature);
+ DoCast(m_creature,SPELL_BESERK);
+ Beserk_Timer = 300000;
+ }else Beserk_Timer -= diff;
if (phase!=2)
DoMeleeAttackIfReady();
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index b6aae4131d5..7f9a24bc484 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -519,7 +519,8 @@ Map::Add(T *obj)
DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
//something, such as vehicle, needs to be update immediately
- if(obj->GetTypeId() != TYPEID_UNIT)
+ //also, trigger needs to cast spell, if not update, cannot see visual
+ //if(obj->GetTypeId() != TYPEID_UNIT)
UpdateObjectVisibility(obj,cell,p);
AddNotifier(obj);
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index f7f533893fe..e41e3211344 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -45,6 +45,7 @@
#include "SocialMgr.h"
#include "CellImpl.h"
#include "Vehicle.h"
+#include "CreatureAI.h"
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
{
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index cec9c50b71e..a0e9ab4a98a 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1652,7 +1652,7 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a
Add((Creature*)summon);
summon->InitSummon(duration);
- ObjectAccessor::UpdateObjectVisibility(summon);
+ //ObjectAccessor::UpdateObjectVisibility(summon);
return summon;
}
@@ -1711,7 +1711,7 @@ Vehicle* WorldObject::SummonVehicle(uint32 entry, float x, float y, float z, flo
map->Add((Creature*)v);
- ObjectAccessor::UpdateObjectVisibility(v);
+ //ObjectAccessor::UpdateObjectVisibility(v);
return v;
}
@@ -1817,7 +1817,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
if(duration > 0)
pet->SetDuration(duration);
- ObjectAccessor::UpdateObjectVisibility(pet);
+ //ObjectAccessor::UpdateObjectVisibility(pet);
return pet;
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index ab48515053d..4c2fe39ee1b 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1983,7 +1983,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
m_damageMultipliers[i] = 1.0f;
m_applyMultiplierMask |= 1 << i;
- float radius;
+ float range;
std::list<Unit*> unitList;
switch(cur)
@@ -1991,17 +1991,17 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
case TARGET_UNIT_NEARBY_ENEMY:
case TARGET_UNIT_TARGET_ENEMY:
case TARGET_UNIT_NEARBY_ENTRY: // fix me
- radius = GetSpellRadius(m_spellInfo, i, false);
- if(modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius, this);
- SearchChainTarget(unitList, radius, maxTargets, SPELL_TARGETS_ENEMY);
+ range = GetSpellMaxRange(m_spellInfo, false);
+ if(modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
+ SearchChainTarget(unitList, range, maxTargets, SPELL_TARGETS_ENEMY);
break;
case TARGET_UNIT_CHAINHEAL:
case TARGET_UNIT_NEARBY_ALLY: // fix me
case TARGET_UNIT_NEARBY_ALLY_UNK:
case TARGET_UNIT_NEARBY_RAID:
- radius = GetSpellRadius(m_spellInfo, i, true);
- if(modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius, this);
- SearchChainTarget(unitList, radius, maxTargets, SPELL_TARGETS_CHAINHEAL);
+ range = GetSpellMaxRange(m_spellInfo, true);
+ if(modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
+ SearchChainTarget(unitList, range, maxTargets, SPELL_TARGETS_CHAINHEAL);
break;
}
@@ -2060,9 +2060,9 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
sLog.outErrorDb("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry());
if(IsPositiveEffect(m_spellInfo->Id, i))
- SearchAreaTarget(unitList, radius, targetType, SPELL_TARGETS_ALLY);
+ SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ALLY);
else
- SearchAreaTarget(unitList, radius, targetType, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENEMY);
}
// let it be done in one check?
else
@@ -2070,7 +2070,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
for(SpellScriptTarget::const_iterator i_spellST = lower; i_spellST != upper; ++i_spellST)
{
if(i_spellST->second.type == SPELL_TARGET_TYPE_CREATURE)
- SearchAreaTarget(unitList, radius, targetType, SPELL_TARGETS_ENTRY, i_spellST->second.targetEntry);
+ SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, i_spellST->second.targetEntry);
}
}
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 31195f67bca..fde5d63631f 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2427,6 +2427,9 @@ void SpellMgr::LoadSpellCustomAttr()
case 41071: // Raise Dead (HACK)
spellInfo->MaxAffectedTargets = 1;
break;
+ case 28542: // Life Drain - Sapphiron
+ spellInfo->MaxAffectedTargets = 1;
+ break;
case 41376: // Spite
case 39992: // Needle Spine
case 29576: //Multi-Shot
@@ -2447,6 +2450,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 46009: //Negative Energy
case 45641: //Fire Bloom
case 54937: //Glyph of Holy Light
+ case 55665: // Life Drain - Sapphiron
spellInfo->MaxAffectedTargets = 5;
break;
case 40827: //Sinful Beam