mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Merge branch 'master' into 310
Conflicts: src/game/Level2.cpp src/game/PetHandler.cpp src/game/Player.cpp src/game/Player.h src/game/SkillHandler.cpp
This commit is contained in:
commit
31b3ee95ad
163 changed files with 5278 additions and 3233 deletions
|
|
@ -17,10 +17,8 @@
|
|||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Log.h"
|
||||
#include "UpdateMask.h"
|
||||
|
|
@ -30,7 +28,6 @@
|
|||
#include "Player.h"
|
||||
#include "SkillExtraItems.h"
|
||||
#include "Unit.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Spell.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "SpellAuras.h"
|
||||
|
|
@ -56,6 +53,7 @@
|
|||
#include "TemporarySummon.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "Formulas.h"
|
||||
|
||||
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||
{
|
||||
|
|
@ -375,7 +373,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100);
|
||||
}
|
||||
// Shield Slam
|
||||
else if(m_spellInfo->SpellFamilyFlags & 0x100000000LL)
|
||||
else if(m_spellInfo->SpellFamilyFlags & 0x0000020000000000LL)
|
||||
damage += int32(m_caster->GetShieldBlockValue());
|
||||
// Victory Rush
|
||||
else if(m_spellInfo->SpellFamilyFlags & 0x10000000000LL)
|
||||
|
|
@ -595,6 +593,11 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
|
|||
int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
|
||||
damage += count * int32(averange * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
|
||||
}
|
||||
// Shield of Righteousness
|
||||
else if(m_spellInfo->SpellFamilyFlags&0x0010000000000000LL)
|
||||
{
|
||||
damage+=int32(m_caster->GetShieldBlockValue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -808,7 +811,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
creatureTarget->RemoveCorpse();
|
||||
creatureTarget->SetHealth(0); // just for nice GM-mode view
|
||||
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy\n");
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy");
|
||||
map->Add(pGameObj);
|
||||
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
|
|
@ -1261,7 +1264,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
if (m_spellInfo->SpellFamilyFlags & 0x0000000000040000LL)
|
||||
{
|
||||
// In 303 exist spirit depend
|
||||
uint32 spirit = m_caster->GetStat(STAT_SPIRIT);
|
||||
uint32 spirit = uint32(m_caster->GetStat(STAT_SPIRIT));
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 1454: damage+=spirit; break;
|
||||
|
|
@ -1659,7 +1662,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
|
||||
if(!spellInfo)
|
||||
{
|
||||
sLog.outError("WORLD: unknown spell id %i\n", spell_id);
|
||||
sLog.outError("WORLD: unknown spell id %i", spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1758,7 +1761,7 @@ void Spell::EffectTriggerSpellWithValue(uint32 i)
|
|||
|
||||
if(!spellInfo)
|
||||
{
|
||||
sLog.outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id,triggered_spell_id);
|
||||
sLog.outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2021,7 +2024,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
|||
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
|
||||
if(!st)
|
||||
{
|
||||
sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u\n", m_spellInfo->Id );
|
||||
sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u", m_spellInfo->Id );
|
||||
return;
|
||||
}
|
||||
((Player*)unitTarget)->TeleportTo(st->target_mapId,st->target_X,st->target_Y,st->target_Z,st->target_Orientation,unitTarget==m_caster ? TELE_TO_SPELL : 0);
|
||||
|
|
@ -2061,7 +2064,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
|||
// If not exist data for dest location - return
|
||||
if(!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
{
|
||||
sLog.outError( "Spell::EffectTeleportUnits - unknown EffectImplicitTargetB[%u] = %u for spell ID %u\n", i, m_spellInfo->EffectImplicitTargetB[i], m_spellInfo->Id );
|
||||
sLog.outError( "Spell::EffectTeleportUnits - unknown EffectImplicitTargetB[%u] = %u for spell ID %u", i, m_spellInfo->EffectImplicitTargetB[i], m_spellInfo->Id );
|
||||
return;
|
||||
}
|
||||
// Init dest coordinates
|
||||
|
|
@ -2922,7 +2925,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
|
|||
if( goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
|
||||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK )
|
||||
{
|
||||
//isAllowUseBattleGroundObject() already called in CanCast()
|
||||
//CanUseBattleGroundObject() already called in CanCast()
|
||||
// in battleground check
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
|
|
@ -2934,7 +2937,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
|
|||
}
|
||||
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
|
||||
{
|
||||
//isAllowUseBattleGroundObject() already called in CanCast()
|
||||
//CanUseBattleGroundObject() already called in CanCast()
|
||||
// in battleground check
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
|
|
@ -3770,13 +3773,18 @@ void Spell::EffectAddHonor(uint32 /*i*/)
|
|||
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
sLog.outDebug("SpellEffect::AddHonor called for spell_id %u , that rewards %d honor points to player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow());
|
||||
uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage);
|
||||
sLog.outDebug("SpellEffect::AddHonor called for spell_id %u, that rewards %u honor points to player: %u", m_spellInfo->Id, honor_reward, ((Player*)unitTarget)->GetGUIDLow());
|
||||
|
||||
// TODO: find formula for honor reward based on player's level!
|
||||
|
||||
// now fixed only for level 70 players:
|
||||
if (((Player*)unitTarget)->getLevel() == 70)
|
||||
// do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80
|
||||
if( damage <= 50 )
|
||||
((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward);
|
||||
else
|
||||
{
|
||||
//maybe we have correct honor_gain in damage already
|
||||
((Player*)unitTarget)->RewardHonor(NULL, 1, damage);
|
||||
sLog.outError("SpellEffect::AddHonor called for spell_id %u, that rewards %d * honor for one honorable kill and it is too much (%u of honor) for player: %u", m_spellInfo->Id, damage, honor_reward, ((Player*)unitTarget)->GetGUIDLow());
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectTradeSkill(uint32 /*i*/)
|
||||
|
|
@ -4774,7 +4782,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
unitTarget->CastSpell(unitTarget, 25863, false);
|
||||
else
|
||||
unitTarget->CastSpell(unitTarget, 26655, false);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
// Piccolo of the Flaming Fire
|
||||
case 17512:
|
||||
|
|
@ -4782,7 +4790,14 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
// Escape artist
|
||||
case 20589:
|
||||
{
|
||||
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
|
||||
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
return;
|
||||
}
|
||||
// Mirren's Drinking Hat
|
||||
case 29830:
|
||||
|
|
@ -6297,7 +6312,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted\n");
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted");
|
||||
//m_caster->AddGameObject(pGameObj);
|
||||
//m_ObjToDel.push_back(pGameObj);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue