Implement generic script loaders to greatly reduce code duplication
This commit is contained in:
+11
-5
@@ -24,6 +24,7 @@ using Game.Scripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Game.AI;
|
||||
|
||||
namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
|
||||
{
|
||||
@@ -32,11 +33,6 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
|
||||
{
|
||||
public instance_trial_of_the_champion() : base("instance_trial_of_the_champion", 650) { }
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_trial_of_the_champion_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
class instance_trial_of_the_champion_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_trial_of_the_champion_InstanceMapScript(Map map) : base(map)
|
||||
@@ -329,5 +325,15 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
|
||||
|
||||
//bool bDone;
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_trial_of_the_champion_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
public static T GetTrialOfTheChampionAI<T>(Creature creature) where T : CreatureAI
|
||||
{
|
||||
return GetInstanceAI<T>(creature, "instance_trial_of_the_champion");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user