*Prevent item trade exploit - by Iskander.
*Do not set cooldown for triggered spells. *Do not allow to kill unit twice. --HG-- branch : trunk
This commit is contained in:
+1
-2
@@ -9547,7 +9547,7 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
|||||||
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++)
|
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++)
|
||||||
{
|
{
|
||||||
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
|
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
|
||||||
if( pBag )
|
if( pBag && ItemCanGoIntoBag(pItem->GetProto(), pBag->GetProto()))
|
||||||
{
|
{
|
||||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||||
{
|
{
|
||||||
@@ -14418,7 +14418,6 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||||||
|
|
||||||
_LoadAuras(holder->GetResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff);
|
_LoadAuras(holder->GetResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff);
|
||||||
_LoadGlyphAuras();
|
_LoadGlyphAuras();
|
||||||
|
|
||||||
// add ghost flag (must be after aura load: PLAYER_FLAGS_GHOST set in aura)
|
// add ghost flag (must be after aura load: PLAYER_FLAGS_GHOST set in aura)
|
||||||
if( HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) )
|
if( HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) )
|
||||||
m_deathState = DEAD;
|
m_deathState = DEAD;
|
||||||
|
|||||||
+2
-2
@@ -2583,8 +2583,8 @@ void Spell::SendSpellCooldown()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// have infinity cooldown but set at aura apply
|
// have infinity cooldown but set at aura apply // do not set cooldown for triggered spells (needed by reincarnation)
|
||||||
if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE || m_IsTriggeredSpell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
|
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
|
||||||
|
|||||||
+8
-3
@@ -5206,7 +5206,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
if (dummySpell->SpellIconID == 2999)
|
if (dummySpell->SpellIconID == 2999)
|
||||||
{
|
{
|
||||||
if (effIndex!=0)
|
if (effIndex!=0)
|
||||||
return true;
|
return false;
|
||||||
AuraEffect *counter = GetAuraEffect(triggeredByAura->GetId(), 1);
|
AuraEffect *counter = GetAuraEffect(triggeredByAura->GetId(), 1);
|
||||||
if (!counter)
|
if (!counter)
|
||||||
return true;
|
return true;
|
||||||
@@ -5708,7 +5708,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
return false;
|
return false;
|
||||||
// Only 0 aura can proc
|
// Only 0 aura can proc
|
||||||
if (effIndex!=0)
|
if (effIndex!=0)
|
||||||
return true;
|
return false;
|
||||||
// Wrath crit
|
// Wrath crit
|
||||||
if (procSpell->SpellFamilyFlags[0] & 0x1)
|
if (procSpell->SpellFamilyFlags[0] & 0x1)
|
||||||
{
|
{
|
||||||
@@ -5836,8 +5836,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
case SPELLFAMILY_PALADIN:
|
case SPELLFAMILY_PALADIN:
|
||||||
{
|
{
|
||||||
// Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
|
// Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
|
||||||
if (dummySpell->SpellFamilyFlags[0]&0x8000000 && effIndex==0)
|
if (dummySpell->SpellFamilyFlags[0]&0x8000000)
|
||||||
{
|
{
|
||||||
|
if (effIndex!=0)
|
||||||
|
return false;
|
||||||
triggered_spell_id = 25742;
|
triggered_spell_id = 25742;
|
||||||
float ap = GetTotalAttackPowerValue(BASE_ATTACK);
|
float ap = GetTotalAttackPowerValue(BASE_ATTACK);
|
||||||
int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
|
int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
|
||||||
@@ -12523,6 +12525,9 @@ void Unit::SetToNotify()
|
|||||||
|
|
||||||
void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||||
{
|
{
|
||||||
|
// Prevent killing unit twice (and giving reward from kill twice)
|
||||||
|
if (!pVictim->isAlive())
|
||||||
|
return;
|
||||||
pVictim->SetHealth(0);
|
pVictim->SetHealth(0);
|
||||||
|
|
||||||
// find player: owner of controlled `this` or `this` itself maybe
|
// find player: owner of controlled `this` or `this` itself maybe
|
||||||
|
|||||||
Reference in New Issue
Block a user