Jump to content

Target_Caster_Coordinates, Target_Areaeffect_Instant


Recommended Posts

Posted

I have problems with the Spell 28374 (Decimate)

The target for the Script Effekt is (22, 7)

in my opinion this code make the targets. Why attack this spell not all target (players and other mobs)?

        case TARGET_AREAEFFECT_INSTANT:
       {
           SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;

           // Select friendly targets for positive effect
           if (IsPositiveEffect(m_spellInfo->Id, effIndex))
               targetB = SPELL_TARGETS_FRIENDLY;

           UnitList tempTargetUnitMap;
           SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id);

           // fill real target list if no spell script target defined
           FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap,
               m_caster->GetPositionX(), m_caster->GetPositionY(), radius, PUSH_DEST_CENTER, bounds.first != bounds.second ? SPELL_TARGETS_ALL : targetB);

           if (!tempTargetUnitMap.empty())
           {
               for (UnitList::const_iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter)
               {
                   if ((*iter)->GetTypeId() != TYPEID_UNIT)
                       continue;

                   for(SpellScriptTarget::const_iterator i_spellST = bounds.first; i_spellST != bounds.second; ++i_spellST)
                   {
                       // only creature entries supported for this target type
                       if (i_spellST->second.type == SPELL_TARGET_TYPE_GAMEOBJECT)
                           continue;

                       if ((*iter)->GetEntry() == i_spellST->second.targetEntry)
                       {
                           if (i_spellST->second.type == SPELL_TARGET_TYPE_DEAD && ((Creature*)(*iter))->IsCorpse())
                           {
                               targetUnitMap.push_back((*iter));
                           }
                           else if (i_spellST->second.type == SPELL_TARGET_TYPE_CREATURE && (*iter)->isAlive())
                           {
                               targetUnitMap.push_back((*iter));
                           }

                           break;
                       }
                   }
               }
           }

           // exclude caster
           targetUnitMap.remove(m_caster);
           break;
       }

At the moment this spell attack only players. I hope someone can help me

Posted

ScriptEffect is not considered by default as positive spell, so it will only attack enemies.

I think it will become difficult to let the ScriptEffect target all nearby units :(

But possible this spell should not target he adds - but the adds are to be handled by the Send Event effect.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use