aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp35
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h4
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp4
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp32
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp10
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp25
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp29
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.h4
9 files changed, 102 insertions, 44 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 445488d7d82..21dc29ec3f3 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3616,13 +3616,13 @@ void Unit::RemoveAuraFromStack(uint32 spellId, uint64 caster, AuraRemoveMode rem
}
}
-inline void Unit::RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode)
+inline void Unit::RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode, uint8 chargesRemoved/*= 1*/)
{
- if (iter->second->ModStackAmount(-1))
+ if (iter->second->ModStackAmount(-chargesRemoved))
RemoveOwnedAura(iter, removeMode);
}
-void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller)
+void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller, uint8 chargesRemoved/*= 1*/)
{
for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
{
@@ -3630,14 +3630,35 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
if (aura->GetCasterGUID() == casterGUID)
{
if (aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES)
- aura->DropCharge();
+ {
+ for (uint8 i = 0; i < chargesRemoved; i++)
+ aura->DropCharge();
+ }
else
- RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
-
+ RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL, chargesRemoved);
+
+ //Lifebloom
+ if (aura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x10))
+ {
+ if (Unit * caster = aura->GetCaster())
+ {
+ if (AuraEffect const * aurEff = aura->GetEffect(EFFECT_1))
+ {
+ // final heal
+ int32 healAmount = aurEff->GetAmount();
+ int32 stack = chargesRemoved;
+ CastCustomSpell(this, 33778, &healAmount, &stack, NULL, true, NULL, NULL, aura->GetCasterGUID());
+
+ // mana
+ int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellProto()->ManaCostPercentage) * chargesRemoved / 2;
+ caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
+ }
+ }
+ }
// Unstable Affliction (crash if before removeaura?)
if (aura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aura->GetSpellProto()->SpellFamilyFlags[1] & 0x0100))
{
- if (AuraEffect const * aurEff = aura->GetEffect(0))
+ if (AuraEffect const * aurEff = aura->GetEffect(EFFECT_0))
{
int32 damage = aurEff->GetAmount()*9;
// backfire damage and silence
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 1d1b34e1520..6502203a83a 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1647,8 +1647,8 @@ class Unit : public WorldObject
void RemoveAurasDueToSpell(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, uint64 caster = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- inline void RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode);
- void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller);
+ inline void RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode, uint8 chargesRemoved = 1);
+ void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller, uint8 chargesRemoved = 1);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except = NULL, bool negative = true, bool positive = true);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 8fd24da80a8..1246815aaaa 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -5950,8 +5950,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
// Lifebloom
if (GetSpellProto()->SpellFamilyFlags[1] & 0x10)
{
- // Final heal only on dispelled or duration end
- if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && aurApp->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
+ // Final heal only on duration end
+ if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
// final heal
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index fb78807d15f..6c9bfba4953 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1363,7 +1363,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
//Any effect which causes you to lose control of your character will supress the starfall effect.
- if (m_caster->HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
+ if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED))
return;
m_caster->CastSpell(unitTarget, damage, true);
@@ -3224,7 +3224,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
// Ok if exist some buffs for dispel try dispel it
uint32 failCount = 0;
- DispelList success_list;
+ DispelChargesList success_list;
WorldPacket dataFail(SMSG_DISPEL_FAILED, 8+8+4+4+damage*4);
// dispel N = damage buffs (or while exist buffs for dispel)
for (int32 count = 0; count < damage && !dispel_list.empty();)
@@ -3244,7 +3244,17 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
{
if (success)
{
- success_list.push_back(std::make_pair(itr->first->GetId(), itr->first->GetCasterGUID()));
+ bool alreadyListed = false;
+ for (DispelChargesList::iterator successItr = success_list.begin(); successItr != success_list.end(); ++successItr)
+ {
+ if (successItr->first->GetId() == itr->first->GetId())
+ {
+ ++successItr->second;
+ alreadyListed = true;
+ }
+ }
+ if (!alreadyListed)
+ success_list.push_back(std::make_pair(itr->first, 1));
--itr->second;
if (itr->second <= 0)
dispel_list.erase(itr);
@@ -3271,19 +3281,19 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
if (success_list.empty())
return;
- WorldPacket dataSuccess(SMSG_SPELLDISPELLOG, 8+8+4+1+4+damage*5);
+ WorldPacket dataSuccess(SMSG_SPELLDISPELLOG, 8+8+4+1+4+success_list.size()*5);
// Send packet header
dataSuccess.append(unitTarget->GetPackGUID()); // Victim GUID
dataSuccess.append(m_caster->GetPackGUID()); // Caster GUID
dataSuccess << uint32(m_spellInfo->Id); // dispel spell id
dataSuccess << uint8(0); // not used
dataSuccess << uint32(success_list.size()); // count
- for (DispelList::iterator itr = success_list.begin(); itr != success_list.end(); ++itr)
+ for (DispelChargesList::iterator itr = success_list.begin(); itr != success_list.end(); ++itr)
{
// Send dispelled spell info
- dataSuccess << uint32(itr->first); // Spell Id
+ dataSuccess << uint32(itr->first->GetId()); // Spell Id
dataSuccess << uint8(0); // 0 - dispelled !=0 cleansed
- unitTarget->RemoveAurasDueToSpellByDispel(itr->first, itr->second, m_caster);
+ unitTarget->RemoveAurasDueToSpellByDispel(itr->first->GetId(), itr->first->GetCasterGUID(), m_caster, itr->second);
}
m_caster->SendMessageToSet(&dataSuccess, true);
@@ -6064,10 +6074,6 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
if (!unitTarget)
return;
- // Instantly interrupt non melee spells being casted
- if (unitTarget->IsNonMeleeSpellCasted(true))
- unitTarget->InterruptNonMeleeSpells(true);
-
// Typhoon
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x01000000)
{
@@ -6084,6 +6090,10 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
return;
}
+ // Instantly interrupt non melee spells being casted
+ if (unitTarget->IsNonMeleeSpellCasted(true))
+ unitTarget->InterruptNonMeleeSpells(true);
+
float ratio = m_caster->GetCombatReach() / std::max(unitTarget->GetCombatReach(), 1.0f);
if (ratio < 1.0f)
ratio = ratio * ratio * ratio * 0.1f; // volume = length^3
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 347a527bead..e9746611818 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -148,9 +148,13 @@ public:
return true;
uint32 family = clsEntry->spellfamily;
- for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
+ for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(i);
+ SkillLineAbilityEntry const *entry = sSkillLineAbilityStore.LookupEntry(i);
+ if (!entry)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(entry->spellId);
if (!spellInfo)
continue;
@@ -175,7 +179,7 @@ public:
if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer(), false))
continue;
- handler->GetSession()->GetPlayer()->learnSpell(i, false);
+ handler->GetSession()->GetPlayer()->learnSpell(spellInfo->Id, false);
}
handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 697129f2135..9e3851ccc8a 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -676,7 +676,7 @@ public:
return true;
}
- //Edit Player Scale
+ //Edit Player or Creature Scale
static bool HandleModifyScaleCommand(ChatHandler* handler, const char* args)
{
if (!*args)
@@ -690,21 +690,24 @@ public:
return false;
}
- Player* target = handler->getSelectedPlayer();
+ Unit* target = handler->getSelectedUnit();
if (!target)
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
-
- // check online security
- if (handler->HasLowerSecurity(target, 0))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(target).c_str());
- if (handler->needReportToTarget(target))
- (ChatHandler(target)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
+
+ if (target->GetTypeId()==TYPEID_PLAYER)
+ {
+ // check online security
+ if (handler->HasLowerSecurity((Player*)target, 0))
+ return false;
+
+ handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink((Player*)target).c_str());
+ if (handler->needReportToTarget((Player*)target))
+ (ChatHandler((Player*)target)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
+ }
target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
index d7f20de04d9..bc24f70f702 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
@@ -157,7 +157,10 @@ class boss_garfrost : public CreatureScript
if (events.GetPhaseMask() & PHASE_TWO_MASK)
DoCast(me, SPELL_FORGE_BLADE);
if (events.GetPhaseMask() & PHASE_THREE_MASK)
+ {
+ me->RemoveAurasDueToSpell(SPELL_FORGE_BLADE);
DoCast(me, SPELL_FORGE_MACE);
+ }
events.ScheduleEvent(EVENT_RESUME_ATTACK, 5000);
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index 41aa988583d..412a30abb3b 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
@@ -52,6 +52,8 @@ public:
platformUrom = 0;
centrifugueConstructCounter = 0;
+ eregosCacheGUID = 0;
+
azureDragonsList.clear();
gameObjectList.clear();
}
@@ -124,14 +126,21 @@ public:
void OnGameObjectCreate(GameObject* go)
{
- if (go->GetEntry() == GO_DRAGON_CAGE_DOOR)
+ switch (go->GetEntry())
{
- if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
- go->SetGoState(GO_STATE_ACTIVE);
- else
- go->SetGoState(GO_STATE_READY);
-
- gameObjectList.push_back(go->GetGUID());
+ case GO_DRAGON_CAGE_DOOR:
+ if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
+ go->SetGoState(GO_STATE_ACTIVE);
+ else
+ go->SetGoState(GO_STATE_READY);
+ gameObjectList.push_back(go->GetGUID());
+ break;
+ case GO_EREGOS_CACHE_N:
+ case GO_EREGOS_CACHE_H:
+ eregosCacheGUID = go->GetGUID();
+ break;
+ default:
+ break;
}
}
@@ -154,6 +163,10 @@ public:
if (state == DONE)
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
break;
+ case DATA_EREGOS_EVENT:
+ if (state == DONE)
+ DoRespawnGameObject(eregosCacheGUID, 7*DAY);
+ break;
}
return true;
@@ -257,6 +270,8 @@ public:
uint8 platformUrom;
uint8 centrifugueConstructCounter;
+ uint64 eregosCacheGUID;
+
std::string str_data;
std::list<uint64> gameObjectList;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
index 8c669b91917..e04f2c8aab9 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
@@ -48,7 +48,9 @@ enum Bosses
enum GameObjects
{
- GO_DRAGON_CAGE_DOOR = 193995
+ GO_DRAGON_CAGE_DOOR = 193995,
+ GO_EREGOS_CACHE_N = 191349,
+ GO_EREGOS_CACHE_H = 193603
};
enum SpellEvents