-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[12736] Allow targets 60 and 110 to use script target whenever required
Also implement target 110 as TARGET_NARROW_FRONTAL_CONE_2 Close cmangos/issues#264
- Loading branch information
Showing
4 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2300,8 +2300,53 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& | |
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_30, SPELL_TARGETS_FRIENDLY); | ||
break; | ||
case TARGET_NARROW_FRONTAL_CONE: | ||
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_15, SPELL_TARGETS_AOE_DAMAGE); | ||
case TARGET_NARROW_FRONTAL_CONE_2: | ||
{ | ||
SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
if (m_spellInfo->Effect[effIndex] == SPELL_EFFECT_SCRIPT_EFFECT) | ||
targetB = SPELL_TARGETS_ALL; | ||
|
||
UnitList tempTargetUnitMap; | ||
SQLMultiStorage::SQLMSIteratorBounds<SpellTargetEntry> bounds = sSpellScriptTargetStorage.getBounds<SpellTargetEntry>(m_spellInfo->Id); | ||
|
||
// fill real target list if no spell script target defined | ||
FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap, | ||
radius, PUSH_IN_FRONT_15, bounds.first != bounds.second ? SPELL_TARGETS_ALL : SPELL_TARGETS_AOE_DAMAGE); | ||
This comment has been minimized.
Sorry, something went wrong.
boxa
Contributor
|
||
|
||
if (!tempTargetUnitMap.empty()) | ||
{ | ||
for (UnitList::const_iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter) | ||
{ | ||
if ((*iter)->GetTypeId() != TYPEID_UNIT) | ||
continue; | ||
|
||
for (SQLMultiStorage::SQLMultiSIterator<SpellTargetEntry> i_spellST = bounds.first; i_spellST != bounds.second; ++i_spellST) | ||
{ | ||
if (i_spellST->CanNotHitWithSpellEffect(effIndex)) | ||
continue; | ||
|
||
// only creature entries supported for this target type | ||
if (i_spellST->type == SPELL_TARGET_TYPE_GAMEOBJECT) | ||
continue; | ||
|
||
if ((*iter)->GetEntry() == i_spellST->targetEntry) | ||
{ | ||
if (i_spellST->type == SPELL_TARGET_TYPE_DEAD && ((Creature*)(*iter))->IsCorpse()) | ||
{ | ||
targetUnitMap.push_back((*iter)); | ||
} | ||
else if (i_spellST->type == SPELL_TARGET_TYPE_CREATURE && (*iter)->isAlive()) | ||
{ | ||
targetUnitMap.push_back((*iter)); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
case TARGET_IN_FRONT_OF_CASTER_30: | ||
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_30, SPELL_TARGETS_AOE_DAMAGE); | ||
break; | ||
|
@@ -7079,7 +7124,11 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff) | |
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_AREAEFFECT_INSTANT && | ||
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_AREAEFFECT_INSTANT && | ||
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_AREAEFFECT_CUSTOM && | ||
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_AREAEFFECT_CUSTOM) | ||
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_AREAEFFECT_CUSTOM && | ||
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_NARROW_FRONTAL_CONE && | ||
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_NARROW_FRONTAL_CONE && | ||
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_NARROW_FRONTAL_CONE_2 && | ||
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_NARROW_FRONTAL_CONE_2) | ||
return false; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ifndef __REVISION_NR_H__ | ||
#define __REVISION_NR_H__ | ||
#define REVISION_NR "12735" | ||
#define REVISION_NR "12736" | ||
#endif // __REVISION_NR_H__ |
targetB is not used in code below...