mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
[12069] Cleanup comment style
This commit is contained in:
parent
5efb3867f5
commit
835d1c7479
205 changed files with 2835 additions and 2835 deletions
|
|
@ -365,7 +365,7 @@ Spell::Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid or
|
|||
m_TriggerSpells.clear();
|
||||
m_preCastSpells.clear();
|
||||
m_IsTriggeredSpell = triggered;
|
||||
//m_AreaAura = false;
|
||||
// m_AreaAura = false;
|
||||
m_CastItem = NULL;
|
||||
|
||||
unitTarget = NULL;
|
||||
|
|
@ -376,7 +376,7 @@ Spell::Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid or
|
|||
m_glyphIndex = 0;
|
||||
m_triggeredByAuraSpell = NULL;
|
||||
|
||||
//Auto Shot & Shoot (wand)
|
||||
// Auto Shot & Shoot (wand)
|
||||
m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo);
|
||||
|
||||
m_runesState = 0;
|
||||
|
|
@ -506,12 +506,12 @@ void Spell::FillTargetMap()
|
|||
case TARGET_EFFECT_SELECT:
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact
|
||||
case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact
|
||||
if ((m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) == 0)
|
||||
m_targets.setDestination(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ());
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact
|
||||
case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -604,7 +604,7 @@ void Spell::FillTargetMap()
|
|||
// need some target for processing
|
||||
SetTargetMap(SpellEffectIndex(i), TARGET_EFFECT_SELECT, tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
case TARGET_AREAEFFECT_INSTANT: // All 17/7 pairs used for dest teleportation, A processed in effect code
|
||||
case TARGET_AREAEFFECT_INSTANT: // All 17/7 pairs used for dest teleportation, A processed in effect code
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -655,7 +655,7 @@ void Spell::FillTargetMap()
|
|||
case TARGET_EFFECT_SELECT:
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
case TARGET_SCRIPT_COORDINATES: // B case filled in CheckCast but we need fill unit list base at A case
|
||||
case TARGET_SCRIPT_COORDINATES: // B case filled in CheckCast but we need fill unit list base at A case
|
||||
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -784,7 +784,7 @@ void Spell::prepareDataForTriggerSystem()
|
|||
}
|
||||
break;
|
||||
default:
|
||||
if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
|
||||
if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
|
||||
{
|
||||
m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL;
|
||||
m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL;
|
||||
|
|
@ -1901,7 +1901,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
|
||||
tempTargetUnitMap.sort(TargetDistanceOrderNear(m_caster));
|
||||
|
||||
//Now to get us a random target that's in the initial range of the spell
|
||||
// Now to get us a random target that's in the initial range of the spell
|
||||
uint32 t = 0;
|
||||
UnitList::iterator itr = tempTargetUnitMap.begin();
|
||||
while (itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius))
|
||||
|
|
@ -1961,7 +1961,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
|
||||
tempTargetUnitMap.sort(TargetDistanceOrderNear(m_caster));
|
||||
|
||||
//Now to get us a random target that's in the initial range of the spell
|
||||
// Now to get us a random target that's in the initial range of the spell
|
||||
uint32 t = 0;
|
||||
UnitList::iterator itr = tempTargetUnitMap.begin();
|
||||
while (itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius))
|
||||
|
|
@ -2033,7 +2033,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE)
|
||||
max_range = radius;
|
||||
else
|
||||
//FIXME: This very like horrible hack and wrong for most spells
|
||||
// FIXME: This very like horrible hack and wrong for most spells
|
||||
max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
|
||||
|
||||
UnitList tempTargetUnitMap;
|
||||
|
|
@ -2980,7 +2980,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
break;
|
||||
}
|
||||
default:
|
||||
//sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id );
|
||||
// sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -3077,7 +3077,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
|||
SpellEvent* Event = new SpellEvent(this);
|
||||
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));
|
||||
|
||||
//Prevent casting at cast another spell (ServerSide check)
|
||||
// Prevent casting at cast another spell (ServerSide check)
|
||||
if (m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count)
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS);
|
||||
|
|
@ -3089,7 +3089,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
|||
m_powerCost = CalculatePowerCost(m_spellInfo, m_caster, this, m_CastItem);
|
||||
|
||||
SpellCastResult result = CheckCast(true);
|
||||
if (result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
|
||||
if (result != SPELL_CAST_OK && !IsAutoRepeat()) // always cast autorepeat dummy for triggering
|
||||
{
|
||||
if (triggeredByAura)
|
||||
{
|
||||
|
|
@ -3399,7 +3399,7 @@ void Spell::cast(bool skipCheck)
|
|||
{
|
||||
// only for self cast
|
||||
if (m_caster == m_targets.getUnitTarget())
|
||||
AddPrecastSpell(25771); // Forbearance
|
||||
AddPrecastSpell(25771); // Forbearance
|
||||
}
|
||||
// Avenging Wrath
|
||||
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000200000000000))
|
||||
|
|
@ -3998,7 +3998,7 @@ void Spell::SendSpellStart()
|
|||
|
||||
if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes
|
||||
{
|
||||
uint8 v1 = 0;//m_runesState;
|
||||
uint8 v1 = 0;// m_runesState;
|
||||
uint8 v2 = 0;//((Player*)m_caster)->GetRunesState();
|
||||
data << uint8(v1); // runes state before
|
||||
data << uint8(v2); // runes state after
|
||||
|
|
@ -4101,7 +4101,7 @@ void Spell::SendSpellGo()
|
|||
{
|
||||
data << uint32(0); // count
|
||||
|
||||
//for(int = 0; i < count; ++i)
|
||||
// for(int = 0; i < count; ++i)
|
||||
//{
|
||||
// // position and guid?
|
||||
// data << float(0) << float(0) << float(0) << uint64(0);
|
||||
|
|
@ -4607,13 +4607,13 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
|
|||
|
||||
if (runeCostMod > 0)
|
||||
{
|
||||
int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death
|
||||
int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death
|
||||
|
||||
// init cost data and apply mods
|
||||
for (uint32 i = 0; i < RUNE_DEATH; ++i)
|
||||
runeCost[i] = runeCostMod > 0 ? src->RuneCost[i] : 0;
|
||||
|
||||
runeCost[RUNE_DEATH] = 0; // calculated later
|
||||
runeCost[RUNE_DEATH] = 0; // calculated later
|
||||
|
||||
// scan non-death runes (death rune not used explicitly in rune costs)
|
||||
for (uint32 i = 0; i < MAX_RUNES; ++i)
|
||||
|
|
@ -4627,7 +4627,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
|
|||
continue;
|
||||
|
||||
if (take)
|
||||
plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec
|
||||
plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec
|
||||
|
||||
--runeCost[rune];
|
||||
}
|
||||
|
|
@ -4661,7 +4661,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take)
|
|||
}
|
||||
|
||||
if (!take && runeCost[RUNE_DEATH] > 0)
|
||||
return SPELL_FAILED_NO_POWER; // not sure if result code is correct
|
||||
return SPELL_FAILED_NO_POWER; // not sure if result code is correct
|
||||
}
|
||||
|
||||
if (take)
|
||||
|
|
@ -5066,8 +5066,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
}
|
||||
|
||||
//check creature type
|
||||
//ignore self casts (including area casts when caster selected as target)
|
||||
// check creature type
|
||||
// ignore self casts (including area casts when caster selected as target)
|
||||
if (non_caster_target)
|
||||
{
|
||||
if (!CheckTargetCreatureType(target))
|
||||
|
|
@ -5147,7 +5147,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (target->IsImmuneToSpell(m_spellInfo))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
//Must be behind the target.
|
||||
// Must be behind the target.
|
||||
if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK9) && target->HasInArc(M_PI_F, m_caster))
|
||||
{
|
||||
// Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
|
||||
|
|
@ -5162,7 +5162,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
}
|
||||
|
||||
//Target must be facing you.
|
||||
// Target must be facing you.
|
||||
if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(M_PI_F, m_caster))
|
||||
{
|
||||
SendInterrupted(2);
|
||||
|
|
@ -5357,7 +5357,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
AddGOTarget(goScriptTarget, SpellEffectIndex(j));
|
||||
}
|
||||
}
|
||||
//Missing DB Entry or targets for this spellEffect.
|
||||
// Missing DB Entry or targets for this spellEffect.
|
||||
else
|
||||
{
|
||||
/* For TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT makes DB targets optional not required for now
|
||||
|
|
@ -5643,7 +5643,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
case SPELL_EFFECT_OPEN_LOCK:
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER) // only players can open locks, gather etc.
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER) // only players can open locks, gather etc.
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// we need a go target in case of TARGET_GAMEOBJECT (for other targets acceptable GO and items)
|
||||
|
|
@ -5739,7 +5739,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
|
||||
{
|
||||
if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
if (strict) // Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetObjectGuid());
|
||||
}
|
||||
else
|
||||
|
|
@ -5814,7 +5814,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
{
|
||||
case SPELL_AURA_DUMMY:
|
||||
{
|
||||
//custom check
|
||||
// custom check
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 34026: // Kill Command
|
||||
|
|
@ -6018,14 +6018,14 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
|||
if (!m_caster->isAlive())
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
if (m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interruption by another spellcast
|
||||
if (m_caster->IsNonMeleeSpellCasted(false)) // prevent spellcast interruption by another spellcast
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && (((Creature*)m_caster)->IsPet() || m_caster->isCharmed()))
|
||||
{
|
||||
//dead owner (pets still alive when owners ressed?)
|
||||
// dead owner (pets still alive when owners ressed?)
|
||||
if (m_caster->GetCharmerOrOwner() && !m_caster->GetCharmerOrOwner()->isAlive())
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
|
|
@ -6053,7 +6053,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
|||
|
||||
Unit* _target = m_targets.getUnitTarget();
|
||||
|
||||
if (_target) //for target dead/target not valid
|
||||
if (_target) // for target dead/target not valid
|
||||
{
|
||||
if (!_target->isTargetableForAttack())
|
||||
return SPELL_FAILED_BAD_TARGETS; // guessed error
|
||||
|
|
@ -6068,7 +6068,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
|||
bool duelvsplayertar = false;
|
||||
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
{
|
||||
//TARGET_DUELVSPLAYER is positive AND negative
|
||||
// TARGET_DUELVSPLAYER is positive AND negative
|
||||
duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER);
|
||||
}
|
||||
if (m_caster->IsFriendlyTo(target) && !duelvsplayertar)
|
||||
|
|
@ -6077,7 +6077,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
|||
}
|
||||
}
|
||||
}
|
||||
//cooldown
|
||||
// cooldown
|
||||
if (((Creature*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||
return SPELL_FAILED_NOT_READY;
|
||||
}
|
||||
|
|
@ -6091,8 +6091,8 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
// FIXME: find more nice check for all totally immuned spells
|
||||
// HasAttribute(SPELL_ATTR_EX3_UNK28) ?
|
||||
if (m_spellInfo->Id == 23336 || // Alliance Flag Drop
|
||||
m_spellInfo->Id == 23334 || // Horde Flag Drop
|
||||
m_spellInfo->Id == 34991) // Summon Netherstorm Flag
|
||||
m_spellInfo->Id == 23334 || // Horde Flag Drop
|
||||
m_spellInfo->Id == 34991) // Summon Netherstorm Flag
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
uint8 school_immune = 0;
|
||||
|
|
@ -6178,7 +6178,7 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
{
|
||||
if (school_immune || mechanic_immune || dispel_immune)
|
||||
{
|
||||
//Checking auras is needed now, because you are prevented by some state but the spell grants immunity.
|
||||
// Checking auras is needed now, because you are prevented by some state but the spell grants immunity.
|
||||
Unit::SpellAuraHolderMap const& auras = m_caster->GetSpellAuraHolderMap();
|
||||
for (Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
|
|
@ -6266,12 +6266,12 @@ bool Spell::CanAutoCast(Unit* target)
|
|||
if (result == SPELL_CAST_OK || result == SPELL_FAILED_UNIT_NOT_INFRONT)
|
||||
{
|
||||
FillTargetMap();
|
||||
//check if among target units, our WANTED target is as well (->only self cast spells return false)
|
||||
// check if among target units, our WANTED target is as well (->only self cast spells return false)
|
||||
for (TargetList::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
|
||||
if (ihit->targetGUID == targetguid)
|
||||
return true;
|
||||
}
|
||||
return false; //target invalid
|
||||
return false; // target invalid
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckRange(bool strict)
|
||||
|
|
@ -6306,7 +6306,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
|||
}
|
||||
}
|
||||
|
||||
//add radius of caster and ~5 yds "give" for non stricred (landing) check
|
||||
// add radius of caster and ~5 yds "give" for non stricred (landing) check
|
||||
float range_mod = strict ? 1.25f : 6.25;
|
||||
|
||||
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
|
||||
|
|
@ -6442,7 +6442,7 @@ SpellCastResult Spell::CheckPower()
|
|||
return SPELL_FAILED_UNKNOWN;
|
||||
}
|
||||
|
||||
//check rune cost only if a spell has PowerType == POWER_RUNE
|
||||
// check rune cost only if a spell has PowerType == POWER_RUNE
|
||||
if (m_spellInfo->powerType == POWER_RUNE)
|
||||
{
|
||||
SpellCastResult failReason = CheckOrTakeRunePower(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue