aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Groups/Group.cpp6
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp9
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp48
4 files changed, 21 insertions, 46 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 26faa7e6ae8..f9d609150ef 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1283,7 +1283,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
ItemPosCountVec dest;
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
if (msg == EQUIP_ERR_OK)
{
@@ -1332,7 +1332,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
{
player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
if (rollvote == GREED)
{
@@ -1369,7 +1369,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
SendLootAllPassed(*roll);
// remove is_blocked so that the item is lootable by all players
- LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
+ LootItem* item = &(roll->itemSlot >= roll->getLoot()->items.size() ? roll->getLoot()->quest_items[roll->itemSlot - roll->getLoot()->items.size()] : roll->getLoot()->items[roll->itemSlot]);
if (item)
item->is_blocked = false;
}
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 72e0b63f5b6..8259d0c4e9b 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -472,13 +472,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (!loot)
return;
- if (slotid > loot->items.size() + loot->quest_items.size())
+ if (slotid >= loot->items.size() + loot->quest_items.size())
{
sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size());
return;
}
- LootItem& item = slotid > loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid];
+ LootItem& item = slotid >= loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid];
ItemPosCountVec dest;
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
index d091a87dbfe..367240cd2df 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -1296,7 +1296,7 @@ class npc_dark_nucleus : public CreatureScript
void Reset()
{
- me->SetReactState(REACT_PASSIVE);
+ me->SetReactState(REACT_DEFENSIVE);
me->CastSpell(me, SPELL_SHADOW_RESONANCE_AURA, true);
}
@@ -1315,15 +1315,12 @@ class npc_dark_nucleus : public CreatureScript
void MoveInLineOfSight(Unit* who)
{
- if (me->GetDistance(who) >= 15.0f)
- return;
-
ScriptedAI::MoveInLineOfSight(who);
}
void DamageTaken(Unit* attacker, uint32& /*damage*/)
{
- if (attacker == me || attacker == me->getVictim())
+ if (attacker == me)
return;
me->DeleteThreatList();
@@ -1345,6 +1342,8 @@ class npc_dark_nucleus : public CreatureScript
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
me->ClearUnitState(UNIT_STATE_CASTING);
}
+ else
+ MoveInLineOfSight(me->getVictim());
}
else
_targetAuraCheck -= diff;
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 0454274401c..5b5c3ff2326 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -26,6 +26,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "the_eye.h"
@@ -501,9 +502,9 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
public:
spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { }
- class spell_astromancer_wrath_of_the_astromancer_SpellScript : public SpellScript
+ class spell_astromancer_wrath_of_the_astromancer_AuraScript : public AuraScript
{
- PrepareSpellScript(spell_astromancer_wrath_of_the_astromancer_SpellScript);
+ PrepareAuraScript(spell_astromancer_wrath_of_the_astromancer_AuraScript);
bool Validate(SpellInfo const* /*SpellEntry*/)
{
@@ -512,50 +513,25 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
return true;
}
- bool Load()
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- _targetCount = 0;
- return true;
- }
-
- void CountTargets(std::list<WorldObject*>& targetList)
- {
- _targetCount = targetList.size();
- }
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- if (Unit* caster = GetOriginalCaster())
- if (Unit* target = GetHitUnit())
- {
- if (!target->isAlive() || !_targetCount)
- return;
-
- int32 damage = 10000 / _targetCount;
-
- SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
- damageInfo.damage = damage;
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
- caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo());
- caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb);
- caster->SendSpellNonMeleeDamageLog(&damageInfo);
- caster->DealSpellDamage(&damageInfo, false);
- }
+ Unit* target = GetUnitOwner();
+ target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(),false);
}
- private:
- int32 _targetCount;
-
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_astromancer_wrath_of_the_astromancer_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
- SpellScript* GetSpellScript() const
+ AuraScript* GetAuraScript() const
{
- return new spell_astromancer_wrath_of_the_astromancer_SpellScript();
+ return new spell_astromancer_wrath_of_the_astromancer_AuraScript();
}
};