diff options
| author | Nay <dnpd.dd@gmail.com> | 2012-12-27 17:53:34 +0000 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-12-27 17:53:34 +0000 |
| commit | 7e196e8e58800c3e0cde80a07f20c4ecccd1a842 (patch) | |
| tree | d77aa80f8e6bd417eb2d8b368006fd3d7fc8fa19 /src/server/game/Spells | |
| parent | 79b1895223bbf16bfd6484e34e067beea457e4cc (diff) | |
| parent | 7fe2d7309ae3b850f3a7c75fc9bb6ec18bea00a1 (diff) | |
Merge remote-tracking branch 'origin/master' into mmaps
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 5 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 64 |
5 files changed, 38 insertions, 37 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 260091c9ed7..745a7baab8f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3199,7 +3199,8 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m if (apply) { - caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); + // correct amount is already calculated adding one more -1 meant calculated amount - 1 + caster->_EnterVehicle(target->GetVehicleKit(), m_amount, aurApp); } else { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index aa0104da57e..8f09dd0c103 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4854,9 +4854,10 @@ SpellCastResult Spell::CheckCast(bool strict) if (!checkMask) checkMask = VEHICLE_SEAT_FLAG_CAN_ATTACK; + // All creatures should be able to cast as passengers freely, restriction and attribute are only for players VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(m_caster); if (!(m_spellInfo->AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED) - && (vehicleSeat->m_flags & checkMask) != checkMask) + && (vehicleSeat->m_flags & checkMask) != checkMask && m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_DONT_REPORT; } @@ -5634,7 +5635,7 @@ SpellCastResult Spell::CheckCasterAuras() const Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i) { - if (!((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1<<MECHANIC_STUN))) + if ((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() && !((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1<<MECHANIC_STUN))) { foundNotStun = true; break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8bf164767e8..926264f899b 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2355,6 +2355,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_TYPE_VEHICLE2: summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; + case SUMMON_TYPE_LIGHTWELL: case SUMMON_TYPE_TOTEM: { summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 61b92ce6f81..dd367212f67 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1546,7 +1546,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to not allow passengers to be implicitly hit by spells, however this target type should be an exception, if this is left it kills spells that award kill credit from vehicle to master (few spells), the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d166c6f9ebf..9714e2bc09b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1836,14 +1836,14 @@ void SpellMgr::LoadSpellProcs() int32 spellId = fields[0].GetInt32(); bool allRanks = false; - if (spellId <=0) + if (spellId < 0) { allRanks = true; spellId = -spellId; } - SpellInfo const* spellEntry = GetSpellInfo(spellId); - if (!spellEntry) + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) { sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId); continue; @@ -1851,9 +1851,9 @@ void SpellMgr::LoadSpellProcs() if (allRanks) { - if (GetFirstSpellInChain(spellId) != uint32(spellId)) + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32()); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId); continue; } } @@ -1876,79 +1876,77 @@ void SpellMgr::LoadSpellProcs() baseProcEntry.cooldown = uint32(cooldown); baseProcEntry.charges = fields[14].GetUInt32(); - while (true) + while (spellInfo) { - if (mSpellProcMap.find(spellId) != mSpellProcMap.end()) + if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id); break; } SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); // take defaults from dbcs if (!procEntry.typeMask) - procEntry.typeMask = spellEntry->ProcFlags; + procEntry.typeMask = spellInfo->ProcFlags; if (!procEntry.charges) - procEntry.charges = spellEntry->ProcCharges; + procEntry.charges = spellInfo->ProcCharges; if (!procEntry.chance && !procEntry.ratePerMinute) - procEntry.chance = float(spellEntry->ProcChance); + procEntry.chance = float(spellInfo->ProcChance); // validate data if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->Id, procEntry.schoolMask); if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->Id, procEntry.spellFamilyName); if (procEntry.chance < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->Id); procEntry.chance = 0; } if (procEntry.ratePerMinute < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->Id); procEntry.ratePerMinute = 0; } if (cooldown < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->Id); procEntry.cooldown = 0; } if (procEntry.chance == 0 && procEntry.ratePerMinute == 0) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->Id); if (procEntry.charges > 99) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->Id); procEntry.charges = 99; } if (!procEntry.typeMask) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId); - if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->Id); + if (procEntry.spellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL) + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->Id, procEntry.spellTypeMask); if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->Id); if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->Id, procEntry.spellPhaseMask); if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (procEntry.hitMask & ~PROC_HIT_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->Id, procEntry.hitMask); if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->Id); - mSpellProcMap[spellId] = procEntry; + mSpellProcMap[spellInfo->Id] = procEntry; if (allRanks) - { - spellId = GetNextSpellInChain(spellId); - spellEntry = GetSpellInfo(spellId); - } + spellInfo = spellInfo->GetNextRankSpell(); else break; } ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } |
