First try at making spells in SmartAI

Signed-off-by: hondacrx <prelude_20032002@yahoo.com>
This commit is contained in:
hondacrx
2017-07-10 14:23:51 -04:00
parent 40a4685a9c
commit 809e601945
7 changed files with 412 additions and 60 deletions
+21
View File
@@ -19,6 +19,8 @@ using Framework.Constants;
using Game.Entities;
using Game.Movement;
using System.Collections.Generic;
using Game.Scripting;
using Game.Spells;
namespace Game.AI
{
@@ -126,5 +128,24 @@ namespace Game.AI
}
return new NullGameObjectAI(go);
}
public static SpellScript SelectSpellScript(Spell spell)
{
var holder = Global.SmartAIMgr.GetScript((int)spell.GetSpellInfo().Id, SmartScriptType.Spell);
if (holder.Empty())
return null;
var script = new SmartSpell();
script._Init("", spell.GetSpellInfo().Id);
if (!script._Load(spell))
return null;
script._Register();
if (!script._Validate(spell.GetSpellInfo()))
return null;
return script;
}
}
}