*Merge.
--HG-- branch : trunk
This commit is contained in:
+1
-5
@@ -159,11 +159,7 @@ void Bag::RemoveItem( uint8 slot, bool /*update*/ )
|
||||
|
||||
void Bag::StoreItem( uint8 slot, Item *pItem, bool /*update*/ )
|
||||
{
|
||||
if(slot > MAX_BAG_SIZE)
|
||||
{
|
||||
sLog.outError("Player GUID " I64FMTD " tried to manipulate packets and crash the server.", GetOwnerGUID());
|
||||
return;
|
||||
}
|
||||
assert(slot < MAX_BAG_SIZE);
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
|
||||
+5
-8
@@ -66,12 +66,9 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(target_guid);
|
||||
std::string mutereasonstr;
|
||||
char *mutereason = strtok(NULL, " ");
|
||||
if(!mutereason)
|
||||
mutereasonstr = "No reason.";
|
||||
else
|
||||
mutereasonstr = mutereason;
|
||||
|
||||
strcpy(mutereason, "No reason.");
|
||||
|
||||
// find only player from same account if any
|
||||
if(!target)
|
||||
@@ -94,11 +91,11 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
|
||||
|
||||
if(target)
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
|
||||
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereason);
|
||||
|
||||
std::string nameLink = playerLink(target_name);
|
||||
|
||||
PSendSysMessage(LANG_YOU_DISABLE_CHAT, nameLink, notspeaktime, mutereasonstr.c_str());
|
||||
PSendSysMessage(LANG_YOU_DISABLE_CHAT, nameLink, notspeaktime, mutereason);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+7
-2
@@ -17670,7 +17670,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
{
|
||||
// cheating attempt
|
||||
if(count < 1) count = 1;
|
||||
|
||||
|
||||
// cheating attempt
|
||||
if(slot > MAX_BAG_SIZE && slot !=NULL_SLOT)
|
||||
return false;
|
||||
@@ -17794,7 +17794,12 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
{
|
||||
if( bagguid == pBag->GetGUID() )
|
||||
{
|
||||
if(slot < pBag->GetBagSlot() && !pBag->GetItemByPos(slot))
|
||||
// slot is counted from 0 but BagSize from 1
|
||||
if(slot+1 > pBag->GetBagSize())
|
||||
{
|
||||
sLog.outDebug("CHEATING ATTEMPT slot > bagSize in BuyItemFromVendor playerGUID: "I64FMT" name: %s slot: %u", GetGUID(), GetName(), slot);
|
||||
return false;
|
||||
}
|
||||
bag = i;
|
||||
break;
|
||||
}
|
||||
|
||||
+4
-5
@@ -1108,19 +1108,18 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
procEx |= createProcExtendMask(&damageInfo, missInfo);
|
||||
procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE;
|
||||
|
||||
|
||||
caster->DealSpellDamage(&damageInfo, true);
|
||||
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
|
||||
if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
{
|
||||
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_canTrigger, m_triggeredByAuraSpell);
|
||||
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell);
|
||||
if(caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) == 0 &&
|
||||
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
|
||||
((Player *)caster)->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
|
||||
}
|
||||
caster->DealSpellDamage(&damageInfo, true);
|
||||
|
||||
if (m_spellAura)
|
||||
m_spellAura->SetProcDamage(damageInfo.damage);
|
||||
caster->DealSpellDamage(&damageInfo, true);
|
||||
|
||||
// Judgement of Blood
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[1] & 0x00000008 && m_spellInfo->SpellIconID==153)
|
||||
@@ -4095,7 +4094,7 @@ void Spell::TriggerSpell()
|
||||
SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// check cooldowns to prevent cheating
|
||||
if(!m_IsTriggeredSpell && m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||
if(m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||
{
|
||||
//can cast triggered (by aura only?) spells while have this flag
|
||||
if (!m_IsTriggeredSpell && ((Player*)m_caster)->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
|
||||
|
||||
@@ -5930,8 +5930,8 @@ void Spell::EffectAddExtraAttacks(uint32 /*i*/)
|
||||
if(!unitTarget || !unitTarget->isAlive())
|
||||
return;
|
||||
|
||||
//if( unitTarget->m_extraAttacks )
|
||||
// return;
|
||||
if( unitTarget->m_extraAttacks )
|
||||
return;
|
||||
|
||||
Unit *victim = unitTarget->getVictim();
|
||||
|
||||
|
||||
+50
-6
@@ -2308,7 +2308,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||
|
||||
void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool extra )
|
||||
{
|
||||
if(!extra && hasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) )
|
||||
if(hasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) )
|
||||
return;
|
||||
|
||||
if (!pVictim->isAlive())
|
||||
@@ -2340,8 +2340,9 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
|
||||
// Send log damage message to client
|
||||
DealDamageMods(pVictim,damageInfo.damage,&damageInfo.absorb);
|
||||
SendAttackStateUpdate(&damageInfo);
|
||||
DealMeleeDamage(&damageInfo,true);
|
||||
|
||||
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType);
|
||||
DealMeleeDamage(&damageInfo,true);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
DEBUG_LOG("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
@@ -6848,6 +6849,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
// check if shown in spell book
|
||||
if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
|
||||
continue;
|
||||
|
||||
SpellEntry const *spellProto = sSpellStore.LookupEntry(itr->first);
|
||||
if (!spellProto)
|
||||
continue;
|
||||
@@ -6959,8 +6961,10 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect*
|
||||
SpellEntry const *dummySpell = triggeredByAura->GetSpellProto ();
|
||||
uint32 effIndex = triggeredByAura->GetEffIndex();
|
||||
int32 triggerAmount = triggeredByAura->GetAmount();
|
||||
|
||||
Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
|
||||
|
||||
uint32 triggered_spell_id = 0;
|
||||
Unit* target = pVictim;
|
||||
int32 basepoints0 = 0;
|
||||
@@ -6984,21 +6988,26 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect*
|
||||
// processed charge only counting case
|
||||
if(!triggered_spell_id)
|
||||
return true;
|
||||
|
||||
SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
|
||||
|
||||
if(!triggerEntry)
|
||||
{
|
||||
sLog.outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
return false;
|
||||
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
|
||||
return false;
|
||||
if(basepoints0)
|
||||
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
|
||||
else
|
||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER )
|
||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||
return true;
|
||||
@@ -7008,6 +7017,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff
|
||||
SpellEntry const *dummySpell = triggeredByAura->GetSpellProto ();
|
||||
uint32 effIndex = triggeredByAura->GetEffIndex();
|
||||
int32 triggerAmount = triggeredByAura->GetAmount();
|
||||
|
||||
Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
|
||||
|
||||
@@ -7025,11 +7035,42 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff
|
||||
switch (getPowerType())
|
||||
{
|
||||
case POWER_MANA: triggered_spell_id = 57319; break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// processed charge only counting case
|
||||
if(!triggered_spell_id)
|
||||
return true;
|
||||
|
||||
SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
|
||||
|
||||
if(!triggerEntry)
|
||||
{
|
||||
sLog.outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
return false;
|
||||
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
|
||||
return false;
|
||||
|
||||
if(basepoints0)
|
||||
CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
|
||||
else
|
||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER )
|
||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Used in case when access to whole aura is needed
|
||||
// All procs should be handled like this...
|
||||
@@ -7597,6 +7638,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
}
|
||||
*/
|
||||
|
||||
// not allow proc extra attack spell at extra attack
|
||||
if( m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
|
||||
return false;
|
||||
|
||||
// Custom requirements (not listed in procEx) Warning! damage dealing after this
|
||||
// Custom triggered spells
|
||||
switch (auraSpellInfo->Id)
|
||||
@@ -7854,15 +7899,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
return false;
|
||||
|
||||
// apply spell cooldown before casting to prevent triggering spells with SPELL_EFFECT_ADD_EXTRA_ATTACKS if spell has hidden cooldown
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER )
|
||||
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown);
|
||||
|
||||
if(basepoints0)
|
||||
CastCustomSpell(target,trigger_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
|
||||
else
|
||||
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
|
||||
|
||||
if( cooldown && GetTypeId()==TYPEID_PLAYER )
|
||||
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user