Core/Scripts: Change PlayerScript and CreatureScript inheritance
Port From (https://github.com/TrinityCore/TrinityCore/commit/ed5ba915f1ec7dad8f4935b62b0ec2d202d26c1c)
This commit is contained in:
@@ -286,9 +286,8 @@ namespace Game.Scripting
|
|||||||
|
|
||||||
public class UnitScript : ScriptObject
|
public class UnitScript : ScriptObject
|
||||||
{
|
{
|
||||||
public UnitScript(string name, bool addToScripts = true) : base(name)
|
public UnitScript(string name) : base(name)
|
||||||
{
|
{
|
||||||
if (addToScripts)
|
|
||||||
Global.ScriptMgr.AddScript(this);
|
Global.ScriptMgr.AddScript(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,9 +323,9 @@ namespace Game.Scripting
|
|||||||
object[] _args;
|
object[] _args;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreatureScript : UnitScript
|
public class CreatureScript : ScriptObject
|
||||||
{
|
{
|
||||||
public CreatureScript(string name) : base(name, false)
|
public CreatureScript(string name) : base(name)
|
||||||
{
|
{
|
||||||
Global.ScriptMgr.AddScript<CreatureScript>(this);
|
Global.ScriptMgr.AddScript<CreatureScript>(this);
|
||||||
}
|
}
|
||||||
@@ -582,9 +581,9 @@ namespace Game.Scripting
|
|||||||
public virtual bool OnCheck(Player source, Unit target) { return false; }
|
public virtual bool OnCheck(Player source, Unit target) { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlayerScript : UnitScript
|
public class PlayerScript : ScriptObject
|
||||||
{
|
{
|
||||||
public PlayerScript(string name) : base(name, false)
|
public PlayerScript(string name) : base(name)
|
||||||
{
|
{
|
||||||
Global.ScriptMgr.AddScript(this);
|
Global.ScriptMgr.AddScript(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1098,7 +1098,6 @@ namespace Game.Scripting
|
|||||||
{
|
{
|
||||||
int dmg = damage;
|
int dmg = damage;
|
||||||
ForEach<UnitScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg, spellInfo));
|
ForEach<UnitScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg, spellInfo));
|
||||||
ForEach<PlayerScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg, spellInfo));
|
|
||||||
damage = dmg;
|
damage = dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user