So the spawn command was actually from Project B/Realm Reso source @
badboyallan123 also did the same thing, if you need the code here it is=
internal class ArenaCommand : Command
{
public ArenaCommand()
: base("sarena", 1)
{
}
protected override bool Process(Player player, RealmTime time, string[] args)
{
Entity entity = Entity.Resolve(player.Manager, 0x47a9);
World we = player.Manager.GetWorld(player.Owner.Id); //can't use Owner here, as it goes out of scope
int TimeoutTime = player.Manager.GameData.Portals[0x47a9].TimeoutTime;
string DungName = player.Manager.GameData.Portals[0x47a9].DungeonName;
entity.Move(player.X, player.Y);
we.EnterWorld(entity);
ARGB c = new ARGB(0xFF00FF);
TextPacket packet = new TextPacket
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "A spawn arena has been opened by " + player.Name
};
player.Owner.BroadcastPacket(packet, null);
we.Timers.Add(new WorldTimer(TimeoutTime * 1000,
(world, t) => //default portal close time * 1000
{
try
{
we.LeaveWorld(entity);
}
catch (Exception ex)
//couldn't remove portal, Owner became null. Should be fixed with RealmManager implementation
{
log.ErrorFormat("Couldn't despawn portal.\n{0}", ex);
}
}));
return true;
}
And the error i get when using the command /sarena:
Client:
WServer:
PS:if the command is wrong,could you kindly fix it?