Fix loading of core scripts
This commit is contained in:
@@ -1089,58 +1089,6 @@ namespace Game.AI
|
||||
SmartScript mScript = new SmartScript();
|
||||
}
|
||||
|
||||
[Script]
|
||||
class SmartTrigger : AreaTriggerScript
|
||||
{
|
||||
public SmartTrigger() : base("SmartTrigger") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!player.IsAlive())
|
||||
return false;
|
||||
|
||||
Log.outDebug(LogFilter.ScriptsAi, "AreaTrigger {0} is using SmartTrigger script", trigger.Id);
|
||||
SmartScript script = new SmartScript();
|
||||
script.OnInitialize(trigger);
|
||||
script.ProcessEventsFor(SmartEvents.AreatriggerOntrigger, player, trigger.Id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class SmartScene : SceneScript
|
||||
{
|
||||
public SmartScene() : base("SmartScene") { }
|
||||
|
||||
public override void OnSceneStart(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneStart, player);
|
||||
}
|
||||
|
||||
public override void OnSceneTriggerEvent(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate, string triggerName)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneTrigger, player, 0, 0, false, null, null, triggerName);
|
||||
}
|
||||
|
||||
public override void OnSceneCancel(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneCancel, player);
|
||||
}
|
||||
|
||||
public override void OnSceneComplete(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneComplete, player);
|
||||
}
|
||||
}
|
||||
|
||||
public enum SmartEscortState
|
||||
{
|
||||
None = 0x00, //nothing in progress
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.Scripting;
|
||||
|
||||
namespace Game.PvP
|
||||
{
|
||||
class HellfirePeninsulaPvP : OutdoorPvP
|
||||
public class HellfirePeninsulaPvP : OutdoorPvP
|
||||
{
|
||||
public HellfirePeninsulaPvP()
|
||||
{
|
||||
@@ -310,17 +310,6 @@ namespace Game.PvP
|
||||
uint m_TowerType;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class HellfirePeninsulaPvPScript : OutdoorPvPScript
|
||||
{
|
||||
public HellfirePeninsulaPvPScript() : base("outdoorpvp_hp") { }
|
||||
|
||||
public override OutdoorPvP GetOutdoorPvP()
|
||||
{
|
||||
return new HellfirePeninsulaPvP();
|
||||
}
|
||||
}
|
||||
|
||||
struct HPConst
|
||||
{
|
||||
public static uint[] LangCapture_A = { DefenseMessages.BrokenHillTakenAlliance, DefenseMessages.OverlookTakenAlliance, DefenseMessages.StadiumTakenAlliance };
|
||||
|
||||
@@ -56,26 +56,27 @@ namespace Game.Scripting
|
||||
|
||||
FillSpellSummary();
|
||||
|
||||
//Load Core Scripts
|
||||
LoadScripts(Assembly.GetExecutingAssembly());
|
||||
|
||||
//Load Scripts.dll
|
||||
if (!File.Exists("Scripts.dll"))
|
||||
Log.outError(LogFilter.ServerLoading, "Cant find file {0}, Only Core Scripts are loaded.");
|
||||
else
|
||||
{
|
||||
Assembly asm = Assembly.LoadFile(Path.GetFullPath("Scripts.dll"));
|
||||
if (asm == null)
|
||||
Log.outError(LogFilter.ServerLoading, "Error Loading Scripts.dll, Only Core Scripts are loaded.");
|
||||
else
|
||||
LoadScripts(asm);
|
||||
}
|
||||
LoadScripts();
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {GetScriptCount()} C# scripts in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
public void LoadScripts(Assembly assembly)
|
||||
public void LoadScripts()
|
||||
{
|
||||
if (!File.Exists("Scripts.dll"))
|
||||
{
|
||||
Log.outError(LogFilter.ServerLoading, "Cant find file {0}, Only Core Scripts are loaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
Assembly assembly = Assembly.LoadFile(Path.GetFullPath("Scripts.dll"));
|
||||
if (assembly == null)
|
||||
{
|
||||
Log.outError(LogFilter.ServerLoading, "Error Loading Scripts.dll, Only Core Scripts are loaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var type in assembly.GetTypes())
|
||||
{
|
||||
var attributes = (ScriptAttribute[])type.GetCustomAttributes<ScriptAttribute>();
|
||||
|
||||
Reference in New Issue
Block a user