Core/Spells: Handle GAMEOBJECT_TYPE_UI_LINK spellFocus
Port From (https://github.com/TrinityCore/TrinityCore/commit/97afa3a609923bd9b7c0e9cfc52c29ba9dbfe35d)
This commit is contained in:
@@ -517,6 +517,32 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public uint GetSpellFocusType()
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case GameObjectTypes.SpellFocus:
|
||||||
|
return SpellFocus.spellFocusType;
|
||||||
|
case GameObjectTypes.UILink:
|
||||||
|
return UILink.spellFocusType;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public uint GetSpellFocusRadius()
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case GameObjectTypes.SpellFocus:
|
||||||
|
return SpellFocus.radius;
|
||||||
|
case GameObjectTypes.UILink:
|
||||||
|
return UILink.radius;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void InitializeQueryData()
|
public void InitializeQueryData()
|
||||||
{
|
{
|
||||||
QueryData = new QueryGameObjectResponse();
|
QueryData = new QueryGameObjectResponse();
|
||||||
|
|||||||
@@ -2247,16 +2247,13 @@ namespace Game.Maps
|
|||||||
|
|
||||||
public bool Invoke(GameObject go)
|
public bool Invoke(GameObject go)
|
||||||
{
|
{
|
||||||
if (go.GetGoInfo().type != GameObjectTypes.SpellFocus)
|
if (go.GetGoInfo().GetSpellFocusType() != i_focusId)
|
||||||
return false;
|
|
||||||
|
|
||||||
if (go.GetGoInfo().SpellFocus.spellFocusType != i_focusId)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!go.IsSpawned())
|
if (!go.IsSpawned())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float dist = go.GetGoInfo().SpellFocus.radius / 2.0f;
|
float dist = go.GetGoInfo().GetSpellFocusRadius() / 2.0f;
|
||||||
|
|
||||||
return go.IsWithinDistInMap(i_unit, dist);
|
return go.IsWithinDistInMap(i_unit, dist);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user