mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core: Some cosmetic changes and minor optimizations
This commit is contained in:
@@ -26,4 +26,4 @@ int GameObjectAI::Permissible(const GameObject* go)
|
||||
return PERMIT_BASE_NO;
|
||||
}
|
||||
|
||||
NullGameObjectAI::NullGameObjectAI(GameObject* g) : GameObjectAI(g) {}
|
||||
NullGameObjectAI::NullGameObjectAI(GameObject* g) : GameObjectAI(g) {}
|
||||
|
||||
@@ -126,13 +126,17 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
i_victimGuid = me->getVictim()->GetGUID();
|
||||
Unit* const victim = me->getVictim();
|
||||
if (!victim)
|
||||
return;
|
||||
|
||||
i_victimGuid = victim->GetGUID();
|
||||
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
if (me->IsWithinMeleeRange(victim))
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim());
|
||||
me->AttackerStateUpdate(victim);
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13293,7 +13293,8 @@ float Unit::GetSpellMaxRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
|
||||
return spellInfo->GetMaxRange();
|
||||
return spellInfo->GetMaxRange(!IsHostileTo(target));
|
||||
};
|
||||
}
|
||||
|
||||
float Unit::GetSpellMinRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
{
|
||||
if (!spellInfo->RangeEntry)
|
||||
@@ -13301,7 +13302,7 @@ float Unit::GetSpellMinRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
|
||||
return spellInfo->GetMinRange();
|
||||
return spellInfo->GetMinRange(!IsHostileTo(target));
|
||||
};
|
||||
}
|
||||
|
||||
Unit* Unit::GetUnit(WorldObject& object, uint64 guid)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#define __TRINITY_VEHICLEDEFINES_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
struct VehicleSeatEntry;
|
||||
|
||||
enum PowerType
|
||||
|
||||
@@ -1035,25 +1035,6 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data)
|
||||
void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
sLog->outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
|
||||
/*
|
||||
uint32 FactionID;
|
||||
uint32 Standing;
|
||||
|
||||
recv_data >> FactionID;
|
||||
recv_data >> Standing;
|
||||
|
||||
std::list<struct Factions>::iterator itr;
|
||||
|
||||
for (itr = GetPlayer()->factions.begin(); itr != GetPlayer()->factions.end(); ++itr)
|
||||
{
|
||||
if (itr->ReputationListID == FactionID)
|
||||
{
|
||||
itr->Standing += Standing;
|
||||
itr->Flags = (itr->Flags | 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
GetPlayer()->GetReputationMgr().SendStates();
|
||||
}
|
||||
|
||||
|
||||
@@ -987,7 +987,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
SpellFamilyFlags = spellEntry->SpellFamilyFlags;
|
||||
DmgClass = spellEntry->DmgClass;
|
||||
PreventionType = spellEntry->PreventionType;
|
||||
AreaGroupId = spellEntry->AreaGroupId;
|
||||
AreaGroupId = spellEntry->AreaGroupId;
|
||||
SchoolMask = spellEntry->SchoolMask;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
Effects[i] = SpellEffectInfo(spellEntry, this, i);
|
||||
|
||||
@@ -1299,7 +1299,7 @@ void SpellMgr::LoadSpellLearnSkills()
|
||||
|
||||
// search auto-learned skills and add its to map also for use in unlearn spells/talents
|
||||
uint32 dbc_count = 0;
|
||||
for (uint32 spell = 0; spell < sSpellMgr->GetSpellInfoStoreSize(); ++spell)
|
||||
for (uint32 spell = 0; spell < GetSpellInfoStoreSize(); ++spell)
|
||||
{
|
||||
SpellInfo const* entry = GetSpellInfo(spell);
|
||||
|
||||
@@ -2635,6 +2635,7 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (spellInfo->Effects[j].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
@@ -2670,7 +2671,7 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
|
||||
continue;
|
||||
|
||||
SpellInfo* procInfo = (SpellInfo*)sSpellMgr->GetSpellInfo(enchant->spellid[s]);
|
||||
SpellInfo* procInfo = (SpellInfo*)GetSpellInfo(enchant->spellid[s]);
|
||||
if (!procInfo)
|
||||
continue;
|
||||
|
||||
@@ -2813,8 +2814,6 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
case 67860: // Impale
|
||||
case 69293: // Wing Buffet
|
||||
case 74439: // Machine Gun
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;
|
||||
break;
|
||||
case 63278: // Mark of the Faceless (General Vezax)
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;
|
||||
break;
|
||||
@@ -2822,6 +2821,8 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_SHARE_DAMAGE;
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (spellInfo->SpellFamilyName)
|
||||
@@ -2915,8 +2916,6 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
case 62136: // Energize Cores
|
||||
case 54069: // Energize Cores
|
||||
case 56251: // Energize Cores
|
||||
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENTRY;
|
||||
break;
|
||||
case 50785: // Energize Cores
|
||||
case 59372: // Energize Cores
|
||||
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENEMY;
|
||||
@@ -3085,6 +3084,7 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
break;
|
||||
case 16834: // Natural shapeshifter
|
||||
case 16835:
|
||||
case 71159: // Awaken Plagued Zombies
|
||||
spellInfo->DurationIndex = 21;
|
||||
break;
|
||||
case 51735: // Ebon Plague
|
||||
@@ -3249,9 +3249,6 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
case 71414: // Orange Ooze Summon (Professor Putricide)
|
||||
spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST;
|
||||
break;
|
||||
case 71159: // Awaken Plagued Zombies
|
||||
spellInfo->DurationIndex = 21;
|
||||
break;
|
||||
// THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED
|
||||
case 71604: // Mutated Strength (Professor Putricide)
|
||||
case 72673: // Mutated Strength (Professor Putricide)
|
||||
@@ -3322,15 +3319,11 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
// Starfall Target Selection
|
||||
if (spellInfo->SpellFamilyFlags[2] & 0x100)
|
||||
spellInfo->MaxAffectedTargets = 2;
|
||||
else
|
||||
break;
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Seals of the Pure should affect Seal of Righteousness
|
||||
if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
|
||||
spellInfo->EffectSpellClassMask[0][1] |= 0x20000000;
|
||||
else
|
||||
break;
|
||||
break;
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
// Icy Touch - extend FamilyFlags (unused value) for Sigil of the Frozen Conscience to use
|
||||
|
||||
Reference in New Issue
Block a user