aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp2
-rw-r--r--src/game/BattleGround.cpp4
-rw-r--r--src/game/BattleGround.h2
-rw-r--r--src/game/SpellAuras.cpp16
-rw-r--r--src/game/SpellEffects.cpp45
-rw-r--r--src/game/Unit.cpp42
6 files changed, 68 insertions, 43 deletions
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
index 98d5c352d3f..6e301d339c8 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
@@ -54,7 +54,7 @@ CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature)
ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
ai->Spell[1].SpellId = SPELL_PYROBLAST;
- ai->Spell[1].Cooldown = 2000 + rand()%7000;
+ ai->Spell[1].Cooldown = 5500 + rand()%4000;
ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 3c73fab012c..8733fd86497 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -971,7 +971,9 @@ void BattleGround::AddPlayer(Player *plr)
if(GetStatus() == STATUS_WAIT_JOIN) // not started yet
{
- plr->CastSpell(plr, SPELL_ARENA_PREPARATION, true);
+ if(GetStatus() == STATUS_IN_PROGRESS)
+ plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
+ else plr->CastSpell(plr, SPELL_ARENA_PREPARATION, true);
plr->SetHealth(plr->GetMaxHealth());
plr->SetPower(POWER_MANA, plr->GetMaxPower(POWER_MANA));
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index bc3af58041e..c0019c4a147 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -74,7 +74,7 @@ enum BattleGroundSpells
SPELL_SPIRIT_HEAL_CHANNEL = 22011, // Spirit Heal Channel
SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
- SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
+ SPELL_ARENA_PREPARATION = 32728, // use this one, 32727 has an invisibility aura which is wrong
SPELL_ALLIANCE_GOLD_FLAG = 32724,
SPELL_ALLIANCE_GREEN_FLAG = 32725,
SPELL_HORDE_GOLD_FLAG = 35774,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 219fa7dcb47..3dcf984086e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5698,14 +5698,14 @@ void Aura::PeriodicTick()
int32 drain_amount = m_target->GetPower(power) > pdamage ? pdamage : m_target->GetPower(power);
//Viper sting and Drain Life take mana % amount from target, but not bigger than amount*2 of caster mana
- if ((m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[0]&0x10)
- || (m_spellProto->SpellFamilyName==SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags[1]&0x80))
- {
- uint32 drain = m_target->GetMaxPower(power) * drain_amount /100;
- if(drain > pCaster->GetMaxPower(power) * drain_amount / 50)
- drain_amount = pCaster->GetMaxPower(power) * drain_amount / 50;
- else
- drain_amount = drain;
+ if ((m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[0]&0x10)
+ || (m_spellProto->SpellFamilyName==SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags[1]&0x80))
+ {
+ uint32 drain = m_target->GetMaxPower(power) * drain_amount /100;
+ if(drain > pCaster->GetMaxPower(power) * drain_amount / 50)
+ drain_amount = pCaster->GetMaxPower(power) * drain_amount / 50;
+ else
+ drain_amount = drain;
}
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 967b3407326..d1355ea505d 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -347,14 +347,6 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
break;
}
- case 43648: //Electrical Storm
- {
- if(unitTarget && unitTarget->HasAura(44007, 0)) // Immune Aura
- {
- damage = 0;
- }
- break;
- }
// percent from health with min
case 25599: // Thundercrash
{
@@ -1230,7 +1222,7 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 30452, true, NULL);
return;
- }
+ }
case 53341:
case 53343:
{
@@ -2525,13 +2517,6 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
sLog.outError("Target(GUID:" I64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID());
return;
}
- int idx = 0;
- while(idx < 3)
- {
- if(targetAura->GetSpellProto()->EffectApplyAuraName[idx] == SPELL_AURA_PERIODIC_HEAL)
- break;
- idx++;
- }
int32 tickheal = targetAura->GetModifier()->m_amount;
if(Unit* auraCaster = targetAura->GetCaster())
@@ -2539,7 +2524,15 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
//int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1;
//It is said that talent bonus should not be included
- int32 tickcount = GetSpellDuration(targetAura->GetSpellProto()) / targetAura->GetSpellProto()->EffectAmplitude[idx];
+ int32 tickcount = 0;
+ if(targetAura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID)
+ {
+ switch(targetAura->GetSpellProto()->SpellFamilyFlags)//TODO: proper spellfamily for 3.0.x
+ {
+ case 0x10: tickcount = 4; break; // Rejuvenation
+ case 0x40: tickcount = 6; break; // Regrowth
+ }
+ }
addhealth += tickheal * tickcount;
unitTarget->RemoveAurasByCasterSpell(targetAura->GetId(), targetAura->GetCasterGUID());
@@ -2971,6 +2964,10 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
if(uint32 trapEntry = gameObjTarget->GetGOInfo()->goober.linkedTrapId)
gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster);
+ // activate GO scripts
+ Script->GOHello(player, gameObjTarget);
+ sWorld.ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget);
+
return;
case GAMEOBJECT_TYPE_CHEST:
@@ -4766,13 +4763,13 @@ void Spell::EffectScriptEffect(uint32 effIndex)
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
break;
}
- // Escape artist
- case 20589:
- {
- if(!unitTarget)
- return;
- // It is said that removing effects by script should include dispel resist mods
- unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_ROOT, this);
+ // Escape artist
+ case 20589:
+ {
+ if(!unitTarget)
+ return;
+ // It is said that removing effects by script should include dispel resist mods
+ unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_ROOT, this);
unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this);
}
// Mirren's Drinking Hat
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d0bd170b931..69884279379 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5485,14 +5485,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 56160;
break;
}
- // Glyph of Dispel Magic
- case 55677:
- {
- if(!target->IsFriendlyTo(this))
- return false;
-
- basepoints0 = int32(target->GetMaxHealth() * triggerAmount / 100);
- triggered_spell_id = 56131;
+ // Glyph of Dispel Magic
+ case 55677:
+ {
+ if(!target->IsFriendlyTo(this))
+ return false;
+
+ basepoints0 = int32(target->GetMaxHealth() * triggerAmount / 100);
+ triggered_spell_id = 56131;
break;
}
// Oracle Healing Bonus ("Garments of the Oracle" set)
@@ -6330,6 +6330,30 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
break;
}
+ case SPELLFAMILY_POTION:
+ {
+ if (dummySpell->Id == 17619)
+ {
+ if (procSpell->SpellFamilyName == SPELLFAMILY_POTION)
+ {
+ for (uint8 i=0;i<3;i++)
+ {
+ if (procSpell->Effect[i]==SPELL_EFFECT_HEAL)
+ {
+ triggered_spell_id = 21399;
+ }
+ else if (procSpell->Effect[i]==SPELL_EFFECT_ENERGIZE)
+ {
+ triggered_spell_id = 21400;
+ }
+ else continue;
+ basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f;
+ CastCustomSpell(this,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ }
+ return true;
+ }
+ }
+ }
default:
break;
}
@@ -12302,6 +12326,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
// FORM_SPIRITOFREDEMPTION and related auras
pVictim->CastSpell(pVictim,27827,true,NULL,*itr);
+ pVictim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // should not be attackable
SpiritOfRedemption = true;
break;
}
@@ -12312,6 +12337,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
{
DEBUG_LOG("SET JUST_DIED");
pVictim->setDeathState(JUST_DIED);
+ pVictim->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // reactive attackable flag
}
// 10% durability loss on death