mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Applied coding style.
This commit is contained in:
parent
d6782d067b
commit
c802504304
5 changed files with 477 additions and 506 deletions
|
|
@ -422,6 +422,9 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||
|
||||
m_lastPotionId = 0;
|
||||
|
||||
m_activeSpec = 0;
|
||||
m_speakCount = 0;
|
||||
|
||||
for (int i = 0; i < BASEMOD_END; ++i)
|
||||
{
|
||||
m_auraBaseMod[i][FLAT_MOD] = 0.0f;
|
||||
|
|
@ -2740,7 +2743,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
|||
if(next_active_spell_id)
|
||||
{
|
||||
// update spell ranks in spellbook and action bar
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
|
||||
data << uint32(spell_id);
|
||||
data << uint32(next_active_spell_id);
|
||||
GetSession()->SendPacket( &data );
|
||||
|
|
@ -2839,7 +2842,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
|||
{
|
||||
if(IsInWorld()) // not send spell (re-/over-)learn packets at loading
|
||||
{
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
|
||||
data << uint32(itr2->first);
|
||||
data << uint32(spell_id);
|
||||
GetSession()->SendPacket( &data );
|
||||
|
|
@ -2855,7 +2858,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
|||
{
|
||||
if(IsInWorld()) // not send spell (re-/over-)learn packets at loading
|
||||
{
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
|
||||
data << uint32(spell_id);
|
||||
data << uint32(itr2->first);
|
||||
GetSession()->SendPacket( &data );
|
||||
|
|
@ -3003,7 +3006,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
|
|||
|
||||
switch(spellInfo->Id)
|
||||
{
|
||||
// some spells not have stance data expacted cast at form change or present
|
||||
// some spells not have stance data expected cast at form change or present
|
||||
case 5420: need_cast = (m_form == FORM_TREE); break;
|
||||
case 5419: need_cast = (m_form == FORM_TRAVEL); break;
|
||||
case 7376: need_cast = (m_form == FORM_DEFENSIVESTANCE); break;
|
||||
|
|
@ -3213,7 +3216,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_
|
|||
if(update_action_bar_for_low_rank)
|
||||
{
|
||||
// downgrade spell ranks in spellbook and action bar
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
|
||||
data << uint32(spell_id);
|
||||
data << uint32(prev_id);
|
||||
GetSession()->SendPacket( &data );
|
||||
|
|
@ -3241,7 +3244,7 @@ void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
|
|||
|
||||
if(update)
|
||||
{
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(spell_id);
|
||||
data << uint64(GetGUID());
|
||||
SendDirectMessage(&data);
|
||||
|
|
@ -3264,7 +3267,7 @@ void Player::RemoveArenaSpellCooldowns()
|
|||
entry->CategoryRecoveryTime <= 15 * MINUTE * IN_MILISECONDS )
|
||||
{
|
||||
// notify player
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(itr->first);
|
||||
data << uint64(GetGUID());
|
||||
GetSession()->SendPacket(&data);
|
||||
|
|
@ -3280,7 +3283,7 @@ void Player::RemoveAllSpellCooldown()
|
|||
{
|
||||
for(SpellCooldowns::const_iterator itr = m_spellCooldowns.begin();itr != m_spellCooldowns.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(itr->first);
|
||||
data << uint64(GetGUID());
|
||||
GetSession()->SendPacket(&data);
|
||||
|
|
@ -16962,8 +16965,8 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
|||
|
||||
if((idSchoolMask & GetSpellSchoolMask(spellInfo)) && GetSpellCooldownDelay(unSpellId) < unTimeMs )
|
||||
{
|
||||
data << unSpellId;
|
||||
data << unTimeMs; // in m.secs
|
||||
data << uint32(unSpellId);
|
||||
data << uint32(unTimeMs); // in m.secs
|
||||
AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/IN_MILISECONDS);
|
||||
}
|
||||
}
|
||||
|
|
@ -17954,7 +17957,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
|||
|
||||
SendEquipmentSetList();
|
||||
|
||||
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 8);
|
||||
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
|
||||
data << uint32(secsToTimeBitFields(sWorld.GetGameTime()));
|
||||
data << (float)0.01666667f; // game speed
|
||||
data << uint32(0); // added in 3.1.2
|
||||
|
|
@ -20281,3 +20284,11 @@ void Player::DeleteEquipmentSet(uint64 setGuid)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::ActivateSpec(uint32 specNum)
|
||||
{
|
||||
if(GetActiveSpec() == specNum)
|
||||
return;
|
||||
|
||||
resetTalents(true);
|
||||
}
|
||||
|
|
@ -1402,6 +1402,13 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
|
||||
uint32 CalculateTalentsPoints() const;
|
||||
|
||||
// Dual Spec
|
||||
uint32 GetActiveSpec() { return m_activeSpec; }
|
||||
void SetActiveSpec(uint32 spec) { m_activeSpec = spec; }
|
||||
uint32 GetSpecsCount() { return m_specsCount; }
|
||||
void SetSpecsCount(uint32 count) { m_specsCount = count; }
|
||||
void ActivateSpec(uint32 specNum);
|
||||
|
||||
void InitGlyphsForLevel();
|
||||
void SetGlyphSlot(uint8 slot, uint32 slottype) { SetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot, slottype); }
|
||||
uint32 GetGlyphSlot(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot); }
|
||||
|
|
@ -2209,6 +2216,9 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
SpellCooldowns m_spellCooldowns;
|
||||
uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use
|
||||
|
||||
uint32 m_activeSpec;
|
||||
uint32 m_specsCount;
|
||||
|
||||
ActionButtonList m_actionButtons;
|
||||
|
||||
float m_auraBaseMod[BASEMOD_END][MOD_END];
|
||||
|
|
|
|||
|
|
@ -390,12 +390,12 @@ m_isRemovedOnShapeLost(true), m_updated(false), m_in_use(false)
|
|||
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
|
||||
if(item_rand_suffix)
|
||||
{
|
||||
for (int k=0; k<3; k++)
|
||||
for (int k = 0; k < 3; ++k)
|
||||
{
|
||||
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
|
||||
if(pEnchant)
|
||||
{
|
||||
for (int t=0; t<3; t++)
|
||||
for (int t = 0; t < 3; ++t)
|
||||
if(pEnchant->spellid[t] == m_spellProto->Id)
|
||||
{
|
||||
damage = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 );
|
||||
|
|
@ -907,7 +907,7 @@ void Aura::_AddAura()
|
|||
// Try find slot for aura
|
||||
uint8 slot = NULL_AURA_SLOT;
|
||||
// Lookup for some spell auras (and get slot from it)
|
||||
for(uint8 i = 0; i < m_effIndex; i++)
|
||||
for(uint8 i = 0; i < m_effIndex; ++i)
|
||||
{
|
||||
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
|
||||
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
|
||||
|
|
@ -1043,7 +1043,7 @@ void Aura::_RemoveAura()
|
|||
bool lastaura = true;
|
||||
|
||||
// find other aura in same slot (current already removed from list)
|
||||
for(uint8 i = 0; i < 3; i++)
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
|
||||
for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
|
||||
|
|
@ -2519,7 +2519,7 @@ void Aura::HandleAuraFeatherFall(bool apply, bool Real)
|
|||
else
|
||||
data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4);
|
||||
data.append(m_target->GetPackGUID());
|
||||
data << (uint32)0;
|
||||
data << uint32(0);
|
||||
m_target->SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
|
|
@ -3414,7 +3414,6 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
|
|||
((Player*)m_target)->m_movementInfo.flags = 0; //Clear movement flags
|
||||
|
||||
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8);
|
||||
|
||||
data.append(m_target->GetPackGUID());
|
||||
data << uint32(0);
|
||||
m_target->SendMessageToSet(&data, true);
|
||||
|
|
@ -5131,7 +5130,7 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
|
|||
{
|
||||
if(m_positive)
|
||||
{
|
||||
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
|
||||
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
{
|
||||
if((m_modifier.m_miscvalue & (1<<i)) != 0)
|
||||
m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, m_modifier.m_amount, apply);
|
||||
|
|
@ -5139,7 +5138,7 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
|
|||
}
|
||||
else
|
||||
{
|
||||
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
|
||||
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
{
|
||||
if((m_modifier.m_miscvalue & (1<<i)) != 0)
|
||||
m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, m_modifier.m_amount, apply);
|
||||
|
|
@ -5265,7 +5264,7 @@ void Aura::HandleNoReagentUseAura(bool /*Apply*/, bool Real)
|
|||
mask[2] |= ptr[2];
|
||||
}
|
||||
|
||||
m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]);
|
||||
m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+0, mask[0]);
|
||||
m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+1, mask[1]);
|
||||
m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+2, mask[2]);
|
||||
}
|
||||
|
|
@ -5362,7 +5361,8 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
|||
if(itr->second->state == PLAYERSPELL_REMOVED) continue;
|
||||
if(itr->first==spellId || itr->first==spellId2) continue;
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | (1<<7)))) continue;
|
||||
if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | (1<<7))))
|
||||
continue;
|
||||
if (spellInfo->Stances & (1<<form))
|
||||
m_target->CastSpell(m_target, itr->first, true, NULL, this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
if(m_originalCaster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
|
||||
data << unitTarget->GetGUID();
|
||||
data << uint64(unitTarget->GetGUID());
|
||||
((Player*)m_originalCaster)->GetSession()->SendPacket( &data );
|
||||
}
|
||||
return;
|
||||
|
|
@ -3117,15 +3117,15 @@ void Spell::EffectProficiency(uint32 /*i*/)
|
|||
Player *p_target = (Player*)unitTarget;
|
||||
|
||||
uint32 subClassMask = m_spellInfo->EquippedItemSubClassMask;
|
||||
if(m_spellInfo->EquippedItemClass == 2 && !(p_target->GetWeaponProficiency() & subClassMask))
|
||||
if(m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && !(p_target->GetWeaponProficiency() & subClassMask))
|
||||
{
|
||||
p_target->AddWeaponProficiency(subClassMask);
|
||||
p_target->SendProficiency(uint8(0x02),p_target->GetWeaponProficiency());
|
||||
p_target->SendProficiency(ITEM_CLASS_WEAPON, p_target->GetWeaponProficiency());
|
||||
}
|
||||
if(m_spellInfo->EquippedItemClass == 4 && !(p_target->GetArmorProficiency() & subClassMask))
|
||||
if(m_spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && !(p_target->GetArmorProficiency() & subClassMask))
|
||||
{
|
||||
p_target->AddArmorProficiency(subClassMask);
|
||||
p_target->SendProficiency(uint8(0x04),p_target->GetArmorProficiency());
|
||||
p_target->SendProficiency(ITEM_CLASS_ARMOR, p_target->GetArmorProficiency());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4271,7 +4271,7 @@ void Spell::EffectWeaponDmg(uint32 i)
|
|||
// multiple weapon dmg effect workaround
|
||||
// execute only the last weapon damage
|
||||
// and handle all effects at once
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
switch(m_spellInfo->Effect[j])
|
||||
{
|
||||
|
|
@ -4385,7 +4385,7 @@ void Spell::EffectWeaponDmg(uint32 i)
|
|||
}
|
||||
|
||||
int32 fixed_bonus = 0;
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
switch(m_spellInfo->Effect[j])
|
||||
{
|
||||
|
|
@ -4765,9 +4765,12 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
uint32 item = 0;
|
||||
switch ( urand(1, 6) )
|
||||
{
|
||||
case 1:case 2:case 3:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
item = 23584; break; // Loch Modan Lager
|
||||
case 4:case 5:
|
||||
case 4:
|
||||
case 5:
|
||||
item = 23585; break; // Stouthammer Lite
|
||||
case 6:
|
||||
item = 23586; break; // Aerie Peak Pale Ale
|
||||
|
|
@ -5182,7 +5185,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
|||
const uint32 spellid = 28703;
|
||||
|
||||
// don't overwrite an existing aura
|
||||
for(uint8 i=0; i<5; i++)
|
||||
for(uint8 i = 0; i < 5; ++i)
|
||||
if(unitTarget->HasAura(spellid + i, 0))
|
||||
return;
|
||||
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
|
||||
|
|
@ -5305,9 +5308,9 @@ void Spell::EffectDuel(uint32 i)
|
|||
//END
|
||||
|
||||
// Send request
|
||||
WorldPacket data(SMSG_DUEL_REQUESTED, 16);
|
||||
data << pGameObj->GetGUID();
|
||||
data << caster->GetGUID();
|
||||
WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8);
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
data << uint64(caster->GetGUID());
|
||||
caster->GetSession()->SendPacket(&data);
|
||||
target->GetSession()->SendPacket(&data);
|
||||
|
||||
|
|
@ -5692,7 +5695,7 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
|
||||
map->Add(pGameObj);
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << pGameObj->GetGUID();
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
|
||||
m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID();
|
||||
|
|
@ -6003,7 +6006,7 @@ void Spell::EffectKnockBack(uint32 i)
|
|||
float vsin = sin(m_caster->GetAngle(unitTarget));
|
||||
float vcos = cos(m_caster->GetAngle(unitTarget));
|
||||
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, 8+4+4+4+4+4);
|
||||
data.append(unitTarget->GetPackGUID());
|
||||
data << uint32(0); // Sequence
|
||||
data << float(vcos); // x direction
|
||||
|
|
@ -6034,7 +6037,7 @@ void Spell::EffectPlayerPull(uint32 i)
|
|||
float vsin = sin(unitTarget->GetAngle(m_caster));
|
||||
float vcos = cos(unitTarget->GetAngle(m_caster));
|
||||
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
|
||||
WorldPacket data(SMSG_MOVE_KNOCK_BACK, 8+4+4+4+4+4);
|
||||
data.append(unitTarget->GetPackGUID());
|
||||
data << uint32(0); // Sequence
|
||||
data << float(vcos); // x direction
|
||||
|
|
|
|||
|
|
@ -551,7 +551,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)pVictim)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health);
|
||||
|
||||
|
||||
// find player: owner of controlled `this` or `this` itself maybe
|
||||
Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
|
|
@ -1154,7 +1153,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
|||
if(pVictim != this && GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
|
||||
if(area && area->flags & 0x800) //sanctuary
|
||||
if(area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1429,11 +1428,11 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
|||
if(pVictim != this && GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
const AreaTableEntry *area = GetAreaEntryByAreaID(pVictim->GetAreaId());
|
||||
if(area && area->flags & 0x800) //sanctuary
|
||||
if(area && area->flags & AREA_FLAG_SANCTUARY) // sanctuary
|
||||
return;
|
||||
}
|
||||
|
||||
// Hmmmm dont like this emotes cloent must by self do all animations
|
||||
// Hmmmm dont like this emotes client must by self do all animations
|
||||
if (damageInfo->HitInfo&HITINFO_CRITICALHIT)
|
||||
pVictim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL);
|
||||
if(damageInfo->blocked_amount && damageInfo->TargetState!=VICTIMSTATE_BLOCKS)
|
||||
|
|
@ -1558,7 +1557,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
|||
|
||||
void Unit::HandleEmoteCommand(uint32 anim_id)
|
||||
{
|
||||
WorldPacket data( SMSG_EMOTE, 12 );
|
||||
WorldPacket data( SMSG_EMOTE, 4 + 8 );
|
||||
data << uint32(anim_id);
|
||||
data << uint64(GetGUID());
|
||||
SendMessageToSet(&data, true);
|
||||
|
|
@ -2326,7 +2325,7 @@ float Unit::CalculateLevelPenalty(SpellEntry const* spellProto) const
|
|||
|
||||
void Unit::SendAttackStart(Unit* pVictim)
|
||||
{
|
||||
WorldPacket data( SMSG_ATTACKSTART, 16 );
|
||||
WorldPacket data( SMSG_ATTACKSTART, 8 + 8 );
|
||||
data << uint64(GetGUID());
|
||||
data << uint64(pVictim->GetGUID());
|
||||
|
||||
|
|
@ -4234,7 +4233,7 @@ void Unit::RemoveAllGameObjects()
|
|||
|
||||
void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
|
||||
{
|
||||
WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16+4+4+1+4+4+1+1+4+4+1)); // we guess size
|
||||
WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16+4+4+4+1+4+4+1+1+4+4+1)); // we guess size
|
||||
data.append(log->target->GetPackGUID());
|
||||
data.append(log->attacker->GetPackGUID());
|
||||
data << uint32(log->SpellID);
|
||||
|
|
@ -4292,41 +4291,42 @@ void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
|
|||
|
||||
void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo)
|
||||
{
|
||||
uint32 count = 1;
|
||||
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
|
||||
data << (uint32)damageInfo->HitInfo;
|
||||
data.append(GetPackGUID());
|
||||
data.append(damageInfo->target->GetPackGUID());
|
||||
data << (uint32)(damageInfo->damage); // Full damage
|
||||
data << uint32(0); // overkill value
|
||||
sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
|
||||
|
||||
data << (uint8)count; // Sub damage count
|
||||
uint32 count = 1;
|
||||
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, 16 + 45); // we guess size
|
||||
data << uint32(damageInfo->HitInfo);
|
||||
data.append(damageInfo->attacker->GetPackGUID());
|
||||
data.append(damageInfo->target->GetPackGUID());
|
||||
data << uint32(damageInfo->damage); // Full damage
|
||||
data << uint32(0); // overkill value
|
||||
data << uint8(count); // Sub damage count
|
||||
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
data << (uint32)(damageInfo->damageSchoolMask); // School of sub damage
|
||||
data << (float)damageInfo->damage; // sub damage
|
||||
data << (uint32)damageInfo->damage; // Sub Damage
|
||||
data << uint32(damageInfo->damageSchoolMask); // School of sub damage
|
||||
data << float(damageInfo->damage); // sub damage
|
||||
data << uint32(damageInfo->damage); // Sub Damage
|
||||
}
|
||||
|
||||
if(damageInfo->HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2))
|
||||
{
|
||||
for(int i = 0; i < count; ++i)
|
||||
data << (uint32)damageInfo->absorb; // Absorb
|
||||
data << uint32(damageInfo->absorb); // Absorb
|
||||
}
|
||||
|
||||
if(damageInfo->HitInfo & (HITINFO_RESIST | HITINFO_RESIST2))
|
||||
{
|
||||
for(int i = 0; i < count; ++i)
|
||||
data << (uint32)damageInfo->resist; // Resist
|
||||
data << uint32(damageInfo->resist); // Resist
|
||||
}
|
||||
|
||||
data << (uint8)damageInfo->TargetState;
|
||||
data << (uint32)0;
|
||||
data << (uint32)0;
|
||||
data << uint8(damageInfo->TargetState);
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
|
||||
if(damageInfo->HitInfo & HITINFO_BLOCK)
|
||||
data << (uint32)damageInfo->blocked_amount;
|
||||
data << uint32(damageInfo->blocked_amount);
|
||||
|
||||
if(damageInfo->HitInfo & HITINFO_UNK3)
|
||||
data << uint32(0);
|
||||
|
|
@ -4355,71 +4355,17 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo)
|
|||
|
||||
void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
|
||||
{
|
||||
sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
|
||||
|
||||
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
|
||||
data << uint32(HitInfo); // flags
|
||||
data.append(GetPackGUID());
|
||||
data.append(target->GetPackGUID());
|
||||
data << uint32(Damage-AbsorbDamage-Resist-BlockedAmount);// damage
|
||||
data << uint32(0); // overkill value
|
||||
|
||||
data << (uint8)SwingType; // count?
|
||||
|
||||
// for(i = 0; i < SwingType; ++i)
|
||||
data << (uint32)damageSchoolMask;
|
||||
data << (float)(Damage-AbsorbDamage-Resist-BlockedAmount);
|
||||
data << (uint32)(Damage-AbsorbDamage-Resist-BlockedAmount);
|
||||
// end loop
|
||||
|
||||
if(HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2))
|
||||
{
|
||||
// for(i = 0; i < SwingType; ++i)
|
||||
data << uint32(AbsorbDamage);
|
||||
// end loop
|
||||
}
|
||||
|
||||
if(HitInfo & (HITINFO_RESIST | HITINFO_RESIST2))
|
||||
{
|
||||
// for(i = 0; i < SwingType; ++i)
|
||||
data << uint32(Resist);
|
||||
// end loop
|
||||
}
|
||||
|
||||
data << (uint8)TargetState;
|
||||
data << (uint32)0;
|
||||
data << (uint32)0;
|
||||
|
||||
if(HitInfo & HITINFO_BLOCK)
|
||||
{
|
||||
data << uint32(BlockedAmount);
|
||||
}
|
||||
|
||||
if(HitInfo & HITINFO_UNK3)
|
||||
{
|
||||
data << uint32(0);
|
||||
}
|
||||
|
||||
if(HitInfo & HITINFO_UNK1)
|
||||
{
|
||||
data << uint32(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
for(uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
data << float(0);
|
||||
data << float(0);
|
||||
}
|
||||
data << uint32(0);
|
||||
}
|
||||
|
||||
SendMessageToSet( &data, true );
|
||||
CalcDamageInfo dmgInfo;
|
||||
dmgInfo.HitInfo = HitInfo;
|
||||
dmgInfo.attacker = this;
|
||||
dmgInfo.target = target;
|
||||
dmgInfo.damage = Damage - AbsorbDamage - Resist - BlockedAmount;
|
||||
dmgInfo.damageSchoolMask = damageSchoolMask;
|
||||
dmgInfo.absorb = AbsorbDamage;
|
||||
dmgInfo.resist = Resist;
|
||||
dmgInfo.TargetState = TargetState;
|
||||
dmgInfo.blocked_amount = BlockedAmount;
|
||||
SendAttackStateUpdate(&dmgInfo);
|
||||
}
|
||||
|
||||
bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown)
|
||||
|
|
@ -6595,7 +6541,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
|||
if( m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
|
||||
return false;
|
||||
|
||||
// Costum requirements (not listed in procEx) Warning! damage dealing after this
|
||||
// Custom requirements (not listed in procEx) Warning! damage dealing after this
|
||||
// Custom triggered spells
|
||||
switch (auraSpellInfo->Id)
|
||||
{
|
||||
|
|
@ -6629,7 +6575,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
|||
// Greater Heal Refund (Avatar Raiment set)
|
||||
case 37594:
|
||||
{
|
||||
// Not give if target alredy have full health
|
||||
// Not give if target already have full health
|
||||
if (pVictim->GetHealth() == pVictim->GetMaxHealth())
|
||||
return false;
|
||||
// If your Greater Heal brings the target to full health, you gain $37595s1 mana.
|
||||
|
|
@ -6664,7 +6610,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
|||
}
|
||||
}
|
||||
|
||||
// Costum basepoints/target for exist spell
|
||||
// Custom basepoints/target for exist spell
|
||||
// dummy basepoints or other customs
|
||||
switch(trigger_spell_id)
|
||||
{
|
||||
|
|
@ -6677,7 +6623,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
|
|||
target = pVictim;
|
||||
break;
|
||||
}
|
||||
// Combo points add triggers (need add combopoint only for main tatget, and after possible combopoints reset)
|
||||
// Combo points add triggers (need add combopoint only for main target, and after possible combopoints reset)
|
||||
case 15250: // Rogue Setup
|
||||
{
|
||||
if(!pVictim || pVictim != getVictim()) // applied only for main target
|
||||
|
|
@ -10834,7 +10780,7 @@ void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg)
|
|||
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_PET_CAST_FAILED, (4+1));
|
||||
WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1);
|
||||
data << uint8(0); // cast count?
|
||||
data << uint32(spellid);
|
||||
data << uint8(msg);
|
||||
|
|
@ -10887,7 +10833,7 @@ void Unit::SendPetClearCooldown (uint32 spellid)
|
|||
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, 4+8);
|
||||
data << uint32(spellid);
|
||||
data << uint64(GetGUID());
|
||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||
|
|
@ -10899,8 +10845,9 @@ void Unit::SendPetAIReaction(uint64 guid)
|
|||
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_AI_REACTION, 12);
|
||||
data << uint64(guid) << uint32(00000002);
|
||||
WorldPacket data(SMSG_AI_REACTION, 8 + 4);
|
||||
data << uint64(guid);
|
||||
data << uint32(AI_REACTION_AGGRO);
|
||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue