aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-01-31 11:49:53 +0100
committerSpp <spp@jorge.gr>2012-01-31 11:49:53 +0100
commit37b66384f3d905fb8de506aae48237900a1b6065 (patch)
treef6c36187e06f76704d7a661179857916b18b6469 /src/server/game/Spells
parentfdbb3e52bcbaa236a26bd2bf8293a5deccb34a01 (diff)
parentd4670a558dd40fc03c9b143dcffa763c834ab966 (diff)
Merge branch 'master' into 4.x
Conflicts: src/server/authserver/Server/AuthSocket.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Handlers/AuctionHouseHandler.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Miscellaneous/SharedDefines.h src/server/game/Spells/Spell.cpp src/server/game/Spells/SpellEffects.cpp
Diffstat (limited to 'src/server/game/Spells')
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp6
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp14
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h3
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp7
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp53
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp19
6 files changed, 46 insertions, 56 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index c1fcfc6d244..2c28eb4216c 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4789,11 +4789,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case 46361: // Reinforced Net
if (caster)
- {
- float currentGroundLevel = target->GetBaseMap()->GetHeight(target->GetPositionX(), target->GetPositionY(), MAX_HEIGHT);
- if (target->GetPositionZ() > currentGroundLevel)
- target->GetMotionMaster()->MoveFall(currentGroundLevel);
- }
+ target->GetMotionMaster()->MoveFall();
break;
case 49028:
if (caster)
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index aac93ad78a3..a577a8678ea 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1978,6 +1978,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
return false;
+ // TODO:
+ // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget()
+ // - add DoCheckProc() AuraScript hook
+ // to allow additional requirements for procs
+ // this is needed because this is the last moment in which you can prevent aura charge drop on proc
+ // and possibly a way to prevent default checks (if there're going to be any)
+
// Check if current equipment meets aura requirements
// do that only for passive spells
// TODO: this needs to be unified for all kinds of auras
@@ -2038,11 +2045,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
- // TODO: script hooks here (allowing prevention of selected effects)
+ // TODO: OnProc hook here
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (aurApp->HasEffect(i))
+ // TODO: OnEffectProc hook here (allowing prevention of selected effects)
GetEffect(i)->HandleProc(aurApp, eventInfo);
- // TODO: script hooks here
+ // TODO: AfterEffectProc hook here
+
+ // TODO: AfterProc hook here
// Remove aura if we've used last charge to proc
if (IsUsingCharges() && !GetCharges())
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 8c9cde37c15..de743eb2991 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -186,6 +186,9 @@ class Aura
bool CanStackWith(Aura const* existingAura) const;
// Proc system
+ // this subsystem is not yet in use - the core of it is functional, but still some research has to be done
+ // and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
+ // currently proc system functionality is implemented in Unit::ProcDamageAndSpell
bool IsProcOnCooldown() const;
void AddProcCooldown(uint32 msec);
bool IsUsingCharges() const { return m_isUsingCharges; }
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index e8872deb152..a36bd7361b4 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3858,6 +3858,9 @@ void Spell::SendSpellGo()
castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START
}
+ if (m_targets.HasTraj())
+ castFlags |= CAST_FLAG_ADJUST_MISSILE;
+
WorldPacket data(SMSG_SPELL_GO, 50); // guess size
if (m_CastItem)
@@ -3897,8 +3900,8 @@ void Spell::SendSpellGo()
if (castFlags & CAST_FLAG_ADJUST_MISSILE)
{
- data << float(0);
- data << uint32(0);
+ data << m_targets.GetElevation();
+ data << uint32(m_delayMoment);
}
if (castFlags & CAST_FLAG_PROJECTILE)
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d932b536a78..cd4f2324d9b 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -346,38 +346,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
switch (m_spellInfo->Id) // better way to check unknown
{
- // Positive/Negative Charge
- case 28062:
- case 28085:
- case 39090:
- case 39093:
- if (!m_triggeredByAuraSpell)
- break;
- if (unitTarget == m_caster)
- {
- uint8 count = 0;
- for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
- if (ihit->targetGUID != m_caster->GetGUID())
- if (Player* target = ObjectAccessor::GetPlayer(*m_caster, ihit->targetGUID))
- if (target->HasAura(m_triggeredByAuraSpell->Id))
- ++count;
- if (count)
- {
- uint32 spellId = 0;
- switch (m_spellInfo->Id)
- {
- case 28062: spellId = 29659; break;
- case 28085: spellId = 29660; break;
- case 39090: spellId = 39089; break;
- case 39093: spellId = 39092; break;
- }
- m_caster->SetAuraStack(spellId, m_caster, count);
- }
- }
-
- if (unitTarget->HasAura(m_triggeredByAuraSpell->Id))
- damage = 0;
- break;
// Consumption
case 28865:
damage = (((InstanceMap*)m_caster->GetMap())->GetDifficulty() == REGULAR_DIFFICULTY ? 2750 : 4250);
@@ -2795,7 +2763,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
{
case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON:
- gameObjTarget->UseDoorOrButton();
+ gameObjTarget->UseDoorOrButton(0, false, player);
player->GetMap()->ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget);
return;
@@ -3408,22 +3376,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
return;
- float angle = unitTarget->GetAngle(m_targets.GetDst());
+ unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst()));
+ unitTarget->ClearUnitState(UNIT_STAT_MOVING);
- if (unitTarget->GetTypeId() == TYPEID_PLAYER)
- {
- // For players just turn them
- unitTarget->ToPlayer()->UpdatePosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false);
- //unitTarget->ToPlayer()->SendTeleportAckPacket(); TODO!
- }
- else
- {
- // Set creature Distracted, Stop it, And turn it
- unitTarget->SetOrientation(angle);
- unitTarget->StopMoving();
+ if (unitTarget->GetTypeId() == TYPEID_UNIT)
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
- unitTarget->SendMovementFlagUpdate();
- }
}
void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/)
@@ -5608,6 +5565,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
duel->opponent = target;
duel->startTime = 0;
duel->startTimer = 0;
+ duel->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel
caster->duel = duel;
DuelInfo* duel2 = new DuelInfo;
@@ -5615,6 +5573,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
duel2->opponent = caster;
duel2->startTime = 0;
duel2->startTimer = 0;
+ duel2->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel
target->duel = duel2;
caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 2e2199db794..a5bea319fee 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2889,6 +2889,22 @@ void SpellMgr::LoadSpellCustomAttr()
case 69293: // Wing Buffet
case 74439: // Machine Gun
case 63278: // Mark of the Faceless (General Vezax)
+ case 62544: // Thrust (Argent Tournament)
+ case 64588: // Thrust (Argent Tournament)
+ case 66479: // Thrust (Argent Tournament)
+ case 68505: // Thrust (Argent Tournament)
+ case 62626: // Break-Shield (Argent Tournament, Player)
+ case 64590: // Break-Shield (Argent Tournament, Player)
+ case 64342: // Break-Shield (Argent Tournament, NPC)
+ case 64686: // Break-Shield (Argent Tournament, NPC)
+ case 65147: // Break-Shield (Argent Tournament, NPC)
+ case 68504: // Break-Shield (Argent Tournament, NPC)
+ case 62874: // Charge (Argent Tournament, Player)
+ case 68498: // Charge (Argent Tournament, Player)
+ case 64591: // Charge (Argent Tournament, Player)
+ case 63003: // Charge (Argent Tournament, NPC)
+ case 63010: // Charge (Argent Tournament, NPC)
+ case 68321: // Charge (Argent Tournament, NPC)
case 72255: // Mark of the Fallen Champion (Deathbringer Saurfang)
case 72444: // Mark of the Fallen Champion (Deathbringer Saurfang)
case 72445: // Mark of the Fallen Champion (Deathbringer Saurfang)
@@ -2972,6 +2988,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY;
spellInfo->EffectImplicitTargetB[0] = 0;
break;
+ case 63665: // Charge (Argent Tournament emote on riders)
case 31447: // Mark of Kaz'rogal (needs target selection script)
case 31298: // Sleep (needs target selection script)
case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed)
@@ -3041,6 +3058,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 42611: // Shoot
case 61588: // Blazing Harpoon
case 52479: // Gift of the Harvester
+ case 48246: // Ball of Flame
spellInfo->MaxAffectedTargets = 1;
break;
case 41376: // Spite
@@ -3383,6 +3401,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
break;
case 70602: // Corruption
+ case 48278: // Paralyze
spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
break;
case 70715: // Column of Frost (visual marker)