[svn] Enable linked spells: cast spells/remove auras when spells casted/spells hitting/auras removed. Add new table "spell_linked_spell". Some illustrations provided in sql.
Let trigger creature cast AOE spells when summoned. Illustration provided in sql. Let active creatures always visible if possible. (seems does not work for now, need to find out why) --HG-- branch : trunk
This commit is contained in:
@@ -1482,6 +1482,9 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
||||
if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->AI())
|
||||
((Creature*)this)->AI()->JustSummoned(pCreature);
|
||||
|
||||
if(pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && pCreature->m_spells[0])
|
||||
pCreature->CastSpell(pCreature, pCreature->m_spells[0], true, 0, 0, GetGUID());
|
||||
|
||||
//return the creature therewith the summoner has access to it
|
||||
return pCreature;
|
||||
}
|
||||
|
||||
+1
-1
@@ -926,7 +926,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
if(int32 spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id, 1))
|
||||
{
|
||||
if(spell_triggered > 0)
|
||||
m_caster->CastSpell(unit, spell_triggered, true);
|
||||
unit->CastSpell(unit, spell_triggered, true/*, 0, 0, m_caster->GetGUID()*/);
|
||||
else
|
||||
unit->RemoveAurasDueToSpell(-spell_triggered);
|
||||
}
|
||||
|
||||
+4
-1
@@ -8571,7 +8571,10 @@ bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList)
|
||||
else
|
||||
{
|
||||
// Units far than max visible distance for creature or not in our map are not visible too
|
||||
if (!IsWithinDistInMap(u,World::GetMaxVisibleDistanceForCreature()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f)))
|
||||
// Active unit should always be visibile
|
||||
if (!IsWithinDistInMap(u, u->isActive()
|
||||
? (MAX_VISIBILITY_DISTANCE - (inVisibleList ? 0.0f : World::GetVisibleUnitGreyDistance()))
|
||||
: (World::GetMaxVisibleDistanceForCreature() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f))))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1096,6 +1096,9 @@ void World::SetInitialWorldSettings()
|
||||
sLog.outString( "Loading spell extra attributes...(TODO)" );
|
||||
spellmgr.LoadSpellExtraAttr();
|
||||
|
||||
sLog.outString( "Loading linked spells..." );
|
||||
spellmgr.LoadSpellLinked();
|
||||
|
||||
sLog.outString( "Loading player Create Info & Level Stats..." );
|
||||
objmgr.LoadPlayerInfo();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user