Scripts/Icecrown Citadel: Added Professor Putricide script
Scripts/Icecrown Citadel: Fixed Professor Putricide gate opening when both Rotface and Festergut are dead Scripts/Icecrown Citadel: Added script updating entries of NPCs at Light's Hammer depending on faction Scripts/Icecrown Citadel: Rotface should not pick main tank as target for Slime Spray (removed debugging code) Core/Spells/Conditions : Spell script target condition now accepts ConditionValue3 as affecting effect mask (only search targets with matching mask) --HG-- branch : trunk extra : rebase_source : 943e3bac5d9063974d7f7132f144e91946f825d4
This commit is contained in:
@@ -1877,7 +1877,7 @@ void Spell::SearchGOAreaTarget(std::list<GameObject*> &TagGOMap, float radius, S
|
||||
m_caster->GetMap()->VisitGrid(pos->m_positionX, pos->m_positionY, radius, searcher);
|
||||
}
|
||||
|
||||
WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
|
||||
WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, SpellEffIndex effIndex)
|
||||
{
|
||||
switch(TargetType)
|
||||
{
|
||||
@@ -1888,9 +1888,9 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
|
||||
{
|
||||
sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 14)", m_spellInfo->Id, m_caster->GetEntry());
|
||||
if (IsPositiveSpell(m_spellInfo->Id))
|
||||
return SearchNearbyTarget(range, SPELL_TARGETS_ALLY);
|
||||
return SearchNearbyTarget(range, SPELL_TARGETS_ALLY, effIndex);
|
||||
else
|
||||
return SearchNearbyTarget(range, SPELL_TARGETS_ENEMY);
|
||||
return SearchNearbyTarget(range, SPELL_TARGETS_ENEMY, effIndex);
|
||||
}
|
||||
|
||||
Creature* creatureScriptTarget = NULL;
|
||||
@@ -1900,6 +1900,8 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
|
||||
{
|
||||
if ((*i_spellST)->mConditionType != CONDITION_SPELL_SCRIPT_TARGET)
|
||||
continue;
|
||||
if ((*i_spellST)->mConditionValue3 && !((*i_spellST)->mConditionValue3 & (1 << uint32(effIndex))))
|
||||
continue;
|
||||
switch((*i_spellST)->mConditionValue1)
|
||||
{
|
||||
case SPELL_TARGET_TYPE_CONTROLLED:
|
||||
@@ -2087,20 +2089,20 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
case TARGET_UNIT_NEARBY_ENEMY:
|
||||
range = GetSpellMaxRange(m_spellInfo, false);
|
||||
if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ENEMY);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ENEMY, SpellEffIndex(i));
|
||||
break;
|
||||
case TARGET_UNIT_NEARBY_ALLY:
|
||||
case TARGET_UNIT_NEARBY_ALLY_UNK:
|
||||
case TARGET_UNIT_NEARBY_RAID:
|
||||
range = GetSpellMaxRange(m_spellInfo, true);
|
||||
if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ALLY);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ALLY, SpellEffIndex(i));
|
||||
break;
|
||||
case TARGET_UNIT_NEARBY_ENTRY:
|
||||
case TARGET_GAMEOBJECT_NEARBY_ENTRY:
|
||||
range = GetSpellMaxRange(m_spellInfo, IsPositiveSpell(m_spellInfo->Id));
|
||||
if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY);
|
||||
target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY, SpellEffIndex(i));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2303,7 +2305,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
float range = GetSpellMaxRange(m_spellInfo, IsPositiveSpell(m_spellInfo->Id));
|
||||
if (modOwner) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, range, this);
|
||||
|
||||
if (WorldObject *target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY))
|
||||
if (WorldObject *target = SearchNearbyTarget(range, SPELL_TARGETS_ENTRY, SpellEffIndex(i)))
|
||||
m_targets.setDst(*target);
|
||||
break;
|
||||
}
|
||||
@@ -2473,6 +2475,8 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
{
|
||||
if ((*i_spellST)->mConditionType != CONDITION_SPELL_SCRIPT_TARGET)
|
||||
continue;
|
||||
if ((*i_spellST)->mConditionValue3 && !((*i_spellST)->mConditionValue3 & (1<<i)))
|
||||
continue;
|
||||
if ((*i_spellST)->mConditionValue1 == SPELL_TARGET_TYPE_CREATURE)
|
||||
SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, (*i_spellST)->mConditionValue2);
|
||||
else if ((*i_spellST)->mConditionValue1 == SPELL_TARGET_TYPE_CONTROLLED)
|
||||
@@ -2568,6 +2572,8 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
{
|
||||
if ((*i_spellST)->mConditionType != CONDITION_SPELL_SCRIPT_TARGET)
|
||||
continue;
|
||||
if ((*i_spellST)->mConditionValue3 && !((*i_spellST)->mConditionValue3 & (1<<i)))
|
||||
continue;
|
||||
if ((*i_spellST)->mConditionValue1 == SPELL_TARGET_TYPE_GAMEOBJECT)
|
||||
SearchGOAreaTarget(gobjectList, radius, pushType, SPELL_TARGETS_GO, (*i_spellST)->mConditionValue2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user