mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
d98300b500
12 changed files with 88 additions and 33 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "sc_defines.h"
|
#include "sc_defines.h"
|
||||||
|
|
||||||
#include "../../game/Player.h"
|
#include "../../../game/Player.h"
|
||||||
|
|
||||||
uint32 GetSkillLevel(Player *player,uint32 trskill)
|
uint32 GetSkillLevel(Player *player,uint32 trskill)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11210,12 +11210,12 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
Item *pSrcItem = GetItemByPos( srcbag, srcslot );
|
Item *pSrcItem = GetItemByPos( srcbag, srcslot );
|
||||||
Item *pDstItem = GetItemByPos( dstbag, dstslot );
|
Item *pDstItem = GetItemByPos( dstbag, dstslot );
|
||||||
|
|
||||||
if( !pSrcItem )
|
if (!pSrcItem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sLog.outDebug( "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry());
|
sLog.outDebug( "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry());
|
||||||
|
|
||||||
if(!isAlive() )
|
if (!isAlive())
|
||||||
{
|
{
|
||||||
SendEquipError( EQUIP_ERR_YOU_ARE_DEAD, pSrcItem, pDstItem );
|
SendEquipError( EQUIP_ERR_YOU_ARE_DEAD, pSrcItem, pDstItem );
|
||||||
return;
|
return;
|
||||||
|
|
@ -11223,7 +11223,7 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
|
|
||||||
// SRC checks
|
// SRC checks
|
||||||
|
|
||||||
if(pSrcItem->m_lootGenerated) // prevent swap looting item
|
if (pSrcItem->m_lootGenerated) // prevent swap looting item
|
||||||
{
|
{
|
||||||
//best error message found for attempting to swap while looting
|
//best error message found for attempting to swap while looting
|
||||||
SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL );
|
SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL );
|
||||||
|
|
@ -11231,11 +11231,11 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
}
|
}
|
||||||
|
|
||||||
// check unequip potability for equipped items and bank bags
|
// check unequip potability for equipped items and bank bags
|
||||||
if(IsEquipmentPos ( src ) || IsBagPos ( src ))
|
if (IsEquipmentPos(src) || IsBagPos(src))
|
||||||
{
|
{
|
||||||
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
|
// bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
|
||||||
uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty()));
|
uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty()));
|
||||||
if(msg != EQUIP_ERR_OK)
|
if (msg != EQUIP_ERR_OK)
|
||||||
{
|
{
|
||||||
SendEquipError( msg, pSrcItem, pDstItem );
|
SendEquipError( msg, pSrcItem, pDstItem );
|
||||||
return;
|
return;
|
||||||
|
|
@ -11243,12 +11243,19 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent put equipped/bank bag in self
|
// prevent put equipped/bank bag in self
|
||||||
if( IsBagPos ( src ) && srcslot == dstbag)
|
if (IsBagPos(src) && srcslot == dstbag)
|
||||||
{
|
{
|
||||||
SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem );
|
SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prevent put equipped/bank bag in self
|
||||||
|
if (IsBagPos(dst) && dstslot == srcbag)
|
||||||
|
{
|
||||||
|
SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pDstItem, pSrcItem );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// DST checks
|
// DST checks
|
||||||
|
|
||||||
if (pDstItem)
|
if (pDstItem)
|
||||||
|
|
|
||||||
|
|
@ -2649,4 +2649,11 @@ enum PetTameFailureReason
|
||||||
|
|
||||||
#define EXPECTED_MANGOSD_CLIENT_BUILD {11159, 0}
|
#define EXPECTED_MANGOSD_CLIENT_BUILD {11159, 0}
|
||||||
|
|
||||||
|
// max supported expansion level in mangosd
|
||||||
|
// NOTE: not set it more that supported by targeted client version with all expansions installed
|
||||||
|
// account with expansion > client supported will rejected at connection by client
|
||||||
|
// because if client receive unsupported expansion level it think
|
||||||
|
// that it not have expansion installed and reject
|
||||||
|
#define MAX_EXPANSION 2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -2390,13 +2390,21 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||||
m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_IsTriggeredSpell)
|
// add non-triggered (with cast time and without)
|
||||||
cast(true);
|
if (!m_IsTriggeredSpell)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
// add to cast type slot
|
||||||
m_caster->SetCurrentCastedSpell( this );
|
m_caster->SetCurrentCastedSpell( this );
|
||||||
|
|
||||||
|
// will show cast bar
|
||||||
SendSpellStart();
|
SendSpellStart();
|
||||||
}
|
}
|
||||||
|
// execute triggered without cast time explicitly in call point
|
||||||
|
else if(m_timer == 0)
|
||||||
|
cast(true);
|
||||||
|
// else triggered with cast time will execute execute at next tick or later
|
||||||
|
// without adding to cast type slot
|
||||||
|
// will not show cast bar but will show effects at casting time etc
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::cancel()
|
void Spell::cancel()
|
||||||
|
|
@ -3463,14 +3471,11 @@ void Spell::SendChannelUpdate(uint32 time)
|
||||||
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
|
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
return;
|
|
||||||
|
|
||||||
WorldPacket data( MSG_CHANNEL_UPDATE, 8+4 );
|
WorldPacket data( MSG_CHANNEL_UPDATE, 8+4 );
|
||||||
data.append(m_caster->GetPackGUID());
|
data.append(m_caster->GetPackGUID());
|
||||||
data << uint32(time);
|
data << uint32(time);
|
||||||
|
|
||||||
((Player*)m_caster)->GetSession()->SendPacket( &data );
|
m_caster->SendMessageToSet(&data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::SendChannelStart(uint32 duration)
|
void Spell::SendChannelStart(uint32 duration)
|
||||||
|
|
@ -3501,15 +3506,12 @@ void Spell::SendChannelStart(uint32 duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
WorldPacket data( MSG_CHANNEL_START, (8+4+4) );
|
||||||
{
|
data.append(m_caster->GetPackGUID());
|
||||||
WorldPacket data( MSG_CHANNEL_START, (8+4+4) );
|
data << uint32(m_spellInfo->Id);
|
||||||
data.append(m_caster->GetPackGUID());
|
data << uint32(duration);
|
||||||
data << uint32(m_spellInfo->Id);
|
|
||||||
data << uint32(duration);
|
|
||||||
|
|
||||||
((Player*)m_caster)->GetSession()->SendPacket( &data );
|
m_caster->SendMessageToSet(&data, true);
|
||||||
}
|
|
||||||
|
|
||||||
m_timer = duration;
|
m_timer = duration;
|
||||||
if(target)
|
if(target)
|
||||||
|
|
|
||||||
|
|
@ -1401,6 +1401,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
|
||||||
case 51124: // Killing Machine
|
case 51124: // Killing Machine
|
||||||
case 54741: // Firestarter
|
case 54741: // Firestarter
|
||||||
case 57761: // Fireball!
|
case 57761: // Fireball!
|
||||||
|
case 64823: // Elune's Wrath (Balance druid t8 set
|
||||||
SetAuraCharges(1);
|
SetAuraCharges(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2418,6 +2419,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Living Bomb
|
||||||
|
if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x2000000000000)))
|
||||||
|
{
|
||||||
|
// Zero duration is equal to AURA_REMOVE_BY_DEFAULT. We can't use it directly, as it is set even
|
||||||
|
// when removing aura from one target due to casting Living Bomb at other.
|
||||||
|
if (m_duration == 0 || m_removeMode == AURA_REMOVE_BY_DISPEL)
|
||||||
|
m_target->CastSpell(m_target,m_modifier.m_amount,true,NULL,this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_removeMode == AURA_REMOVE_BY_DEATH)
|
if (m_removeMode == AURA_REMOVE_BY_DEATH)
|
||||||
{
|
{
|
||||||
// Stop caster Arcane Missle chanelling on death
|
// Stop caster Arcane Missle chanelling on death
|
||||||
|
|
@ -3029,16 +3040,17 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!furorChance)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (m_modifier.m_miscvalue == FORM_CAT)
|
if (m_modifier.m_miscvalue == FORM_CAT)
|
||||||
{
|
{
|
||||||
m_target->SetPower(POWER_ENERGY, 0);
|
// Furor chance is now amount allowed to save energy for cat form
|
||||||
// Furor chance is now amount of energy for cat form
|
// without talent it reset to 0
|
||||||
m_target->CastCustomSpell(m_target, 17099, &furorChance, NULL, NULL, this);
|
if (m_target->GetPower(POWER_ENERGY) > furorChance)
|
||||||
|
{
|
||||||
|
m_target->SetPower(POWER_ENERGY, 0);
|
||||||
|
m_target->CastCustomSpell(m_target, 17099, &furorChance, NULL, NULL, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(furorChance) // only if talent known
|
||||||
{
|
{
|
||||||
m_target->SetPower(POWER_RAGE, 0);
|
m_target->SetPower(POWER_RAGE, 0);
|
||||||
if(urand(1,100) <= furorChance)
|
if(urand(1,100) <= furorChance)
|
||||||
|
|
@ -5908,6 +5920,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPELLFAMILY_WARRIOR:
|
case SPELLFAMILY_WARRIOR:
|
||||||
{
|
{
|
||||||
|
|
@ -5931,6 +5944,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELLFAMILY_WARLOCK:
|
case SPELLFAMILY_WARLOCK:
|
||||||
|
{
|
||||||
// Fear (non stacking)
|
// Fear (non stacking)
|
||||||
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000040000000000))
|
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000040000000000))
|
||||||
{
|
{
|
||||||
|
|
@ -5965,6 +5979,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SPELLFAMILY_PRIEST:
|
case SPELLFAMILY_PRIEST:
|
||||||
{
|
{
|
||||||
// Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch
|
// Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch
|
||||||
|
|
|
||||||
|
|
@ -1454,6 +1454,16 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
||||||
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) ||
|
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) ||
|
||||||
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) )
|
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Living Bomb & Ignite (Dots)
|
||||||
|
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000)) ||
|
||||||
|
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000)) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Fireball & Pyroblast (Dots)
|
||||||
|
if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000)) ||
|
||||||
|
(spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000)) )
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// Detect Invisibility and Mana Shield (multi-family check)
|
// Detect Invisibility and Mana Shield (multi-family check)
|
||||||
if( spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968 )
|
if( spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968 )
|
||||||
|
|
|
||||||
|
|
@ -7741,7 +7741,6 @@ void Unit::setPowerType(Powers new_powertype)
|
||||||
break;
|
break;
|
||||||
case POWER_ENERGY:
|
case POWER_ENERGY:
|
||||||
SetMaxPower(POWER_ENERGY,GetCreatePowers(POWER_ENERGY));
|
SetMaxPower(POWER_ENERGY,GetCreatePowers(POWER_ENERGY));
|
||||||
SetPower( POWER_ENERGY,0);
|
|
||||||
break;
|
break;
|
||||||
case POWER_HAPPINESS:
|
case POWER_HAPPINESS:
|
||||||
SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS));
|
SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS));
|
||||||
|
|
|
||||||
|
|
@ -895,12 +895,18 @@ void World::LoadConfigSettings(bool reload)
|
||||||
|
|
||||||
if(reload)
|
if(reload)
|
||||||
{
|
{
|
||||||
uint32 val = sConfig.GetIntDefault("Expansion",1);
|
uint32 val = sConfig.GetIntDefault("Expansion",MAX_EXPANSION);
|
||||||
if(val!=m_configs[CONFIG_EXPANSION])
|
if(val!=m_configs[CONFIG_EXPANSION])
|
||||||
sLog.outError("Expansion option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
|
sLog.outError("Expansion option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1);
|
m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",MAX_EXPANSION);
|
||||||
|
|
||||||
|
if(m_configs[CONFIG_EXPANSION] > MAX_EXPANSION)
|
||||||
|
{
|
||||||
|
sLog.outError("Expansion option can't be greater %u but set to %u, used %u",MAX_EXPANSION,m_configs[CONFIG_EXPANSION],MAX_EXPANSION);
|
||||||
|
m_configs[CONFIG_EXPANSION] = MAX_EXPANSION;
|
||||||
|
}
|
||||||
|
|
||||||
m_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig.GetIntDefault("ChatFlood.MessageCount",10);
|
m_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig.GetIntDefault("ChatFlood.MessageCount",10);
|
||||||
m_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig.GetIntDefault("ChatFlood.MessageDelay",1);
|
m_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig.GetIntDefault("ChatFlood.MessageDelay",1);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9045"
|
#define REVISION_NR "9055"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\src\bindings\universal\ScriptMgr.cpp" />
|
<ClCompile Include="..\..\src\bindings\universal\ScriptMgr.cpp" />
|
||||||
<ClCompile Include="..\..\src\bindings\universal\Scripts\sc_default.cpp" />
|
<ClCompile Include="..\..\src\bindings\universal\Scripts\sc_default.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\bindings\universal\Scripts\sc_defines.cpp" />
|
||||||
<ClCompile Include="..\..\src\bindings\universal\system.cpp" />
|
<ClCompile Include="..\..\src\bindings\universal\system.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -533,6 +533,10 @@
|
||||||
RelativePath="..\..\src\bindings\universal\Scripts\sc_default.cpp"
|
RelativePath="..\..\src\bindings\universal\Scripts\sc_default.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\src\bindings\universal\Scripts\sc_defines.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|
|
||||||
|
|
@ -536,6 +536,10 @@
|
||||||
RelativePath="..\..\src\bindings\universal\Scripts\sc_default.cpp"
|
RelativePath="..\..\src\bindings\universal\Scripts\sc_default.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\src\bindings\universal\Scripts\sc_defines.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue