diff options
| author | kaelima <kaelima@live.se> | 2012-12-21 00:00:16 +0100 |
|---|---|---|
| committer | kaelima <kaelima@live.se> | 2012-12-21 00:00:16 +0100 |
| commit | 0a88787dfc747437b6278a044a425b6483e61b37 (patch) | |
| tree | 65942c84524890446a79ef67fd1ea2ce622a8544 /src/server/game/Spells/SpellEffects.cpp | |
| parent | 8f27dfda627903997b67cab9ebb4c5b365da201e (diff) | |
| parent | 4116ba75e3bef999c3111943c3b389ffc195b686 (diff) | |
Merge git://github.com/TrinityCore/TrinityCore into mmaps
Conflicts:
src/server/game/Entities/Vehicle/Vehicle.cpp
src/server/game/Movement/MovementGenerator.h
src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
src/server/game/Movement/Spline/MoveSpline.h
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r--[-rwxr-xr-x] | src/server/game/Spells/SpellEffects.cpp | 76 |
1 files changed, 28 insertions, 48 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 622f3e1517b..8bf164767e8 100755..100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4983,25 +4983,17 @@ void Spell::EffectReputation(SpellEffIndex effIndex) Player* player = unitTarget->ToPlayer(); - int32 rep_change = damage; + int32 repChange = damage; - uint32 faction_id = m_spellInfo->Effects[effIndex].MiscValue; - - FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id); + uint32 factionId = m_spellInfo->Effects[effIndex].MiscValue; + FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); if (!factionEntry) return; - if (RepRewardRate const* repData = sObjectMgr->GetRepRewardRate(faction_id)) - { - rep_change = int32((float)rep_change * repData->spell_rate); - } + repChange = player->CalculateReputationGain(REPUTATION_SOURCE_SPELL, 0, repChange, factionId); - // Bonus from spells that increase reputation gain - float bonus = rep_change * player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10% - rep_change += (int32)bonus; - - player->GetReputationMgr().ModifyReputation(factionEntry, rep_change); + player->GetReputationMgr().ModifyReputation(factionEntry, repChange); } void Spell::EffectQuestComplete(SpellEffIndex effIndex) @@ -5400,11 +5392,11 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) int32 slot = m_spellInfo->Effects[effIndex].MiscValue; - // FIXME: some spells effects have value -1/-2 - // Possibly its mean -1 all player equipped items and -2 all items + // -1 means all player equipped items and -2 all items if (slot < 0) { unitTarget->ToPlayer()->DurabilityPointsLossAll(damage, (slot < -1)); + ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, -1, -1); return; } @@ -5413,9 +5405,10 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) return; if (Item* item = unitTarget->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + { unitTarget->ToPlayer()->DurabilityPointsLoss(item, damage); - - ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, slot, damage); + ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, item->GetEntry(), slot); + } } void Spell::EffectDurabilityDamagePCT(SpellEffIndex effIndex) @@ -6271,51 +6264,38 @@ void Spell::EffectBind(SpellEffIndex effIndex) Player* player = unitTarget->ToPlayer(); - uint32 area_id; - WorldLocation loc; - if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_DEST_DB || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DB) - { - SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id); - if (!st) - { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id); - return; - } + WorldLocation homeLoc; + uint32 areaId = player->GetAreaId(); - loc.m_mapId = st->target_mapId; - loc.m_positionX = st->target_X; - loc.m_positionY = st->target_Y; - loc.m_positionZ = st->target_Z; - loc.m_orientation = st->target_Orientation; - area_id = player->GetAreaId(); - } + if (m_spellInfo->Effects[effIndex].MiscValue) + areaId = m_spellInfo->Effects[effIndex].MiscValue; + + if (m_targets.HasDst()) + homeLoc.WorldRelocate(*destTarget); else { - player->GetPosition(&loc); - area_id = player->GetAreaId(); + player->GetPosition(&homeLoc); + homeLoc.m_mapId = player->GetMapId(); } - player->SetHomebind(loc, area_id); + player->SetHomebind(homeLoc, areaId); // binding WorldPacket data(SMSG_BINDPOINTUPDATE, (4+4+4+4+4)); - data << float(loc.m_positionX); - data << float(loc.m_positionY); - data << float(loc.m_positionZ); - data << uint32(loc.m_mapId); - data << uint32(area_id); + data << float(homeLoc.GetPositionX()); + data << float(homeLoc.GetPositionY()); + data << float(homeLoc.GetPositionZ()); + data << uint32(homeLoc.GetMapId()); + data << uint32(areaId); player->SendDirectMessage(&data); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind X : %f", loc.m_positionX); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Y : %f", loc.m_positionY); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Z : %f", loc.m_positionZ); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind MapId : %u", loc.m_mapId); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind AreaId : %u", area_id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", + homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); // zone update data.Initialize(SMSG_PLAYERBOUND, 8+4); data << uint64(player->GetGUID()); - data << uint32(area_id); + data << uint32(areaId); player->SendDirectMessage(&data); } |
