Ejemplo n.º 1
0
        protected internal override async Task UseAsync(L2Player admin, string alias)
        {
            await Task.Run(() =>
            {
                var processedVar    = alias.Replace("spawn", string.Empty).Trim();
                NpcTemplate npcTemp = null;

                int potentialInt;
                if (int.TryParse(processedVar, out potentialInt))
                {
                    npcTemp = NpcTable.Instance.GetTemplate(potentialInt);
                }
                else
                {
                    npcTemp = NpcTable.Instance.GetTemplateByName(processedVar);
                }
                if (npcTemp == null)
                {
                    throw new NullReferenceException($"npcTemp is null for {processedVar}");
                }

                L2Spawn spawn  = new L2Spawn(npcTemp, _idFactory, _spawnTable);
                spawn.Location = new SpawnLocation(admin.X, admin.Y, admin.Z, admin.Heading, 0);
                spawn.Spawn();
            });
        }
Ejemplo n.º 2
0
        protected internal override void Use(L2Player admin, string alias)
        {
            var         processedVar = alias.Replace("spawn", string.Empty).Trim();
            NpcTemplate npcTemp      = null;

            int potentialInt;

            if (int.TryParse(processedVar, out potentialInt))
            {
                npcTemp = NpcTable.Instance.GetTemplate(potentialInt);
            }
            else
            {
                npcTemp = NpcTable.Instance.GetTemplateByName(processedVar);
            }
            if (npcTemp == null)
            {
                throw new NullReferenceException($"npcTemp is null for {processedVar}");
            }

            L2Spawn spawn = new L2Spawn(npcTemp, _idFactory, _spawnTable);

            spawn.Location = new SpawnLocation(admin.X, admin.Y, admin.Z, admin.Heading, 0);
            spawn.Spawn();
            //L2Spawn spawn = new L2Spawn(18342, 50000, new []{"","",""});
            //NpcTable.Instance.SpawnNpc(Convert.ToInt32(alias.Split(' ')[1]), admin.X, admin.Y, admin.Z, admin.Heading);
        }
Ejemplo n.º 3
0
 public L2Warehouse(int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template, spawn)
 {
     Template = template;
     Name     = template.Name;
     InitializeCharacterStatus();
     this.spawn = spawn;
 }
Ejemplo n.º 4
0
 public L2Merchant(int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template, spawn)
 {
     Template = template;
     Name     = template.Name;
     InitializeCharacterStatus();
     CharStatus.SetCurrentHp(MaxHp);
     CharStatus.SetCurrentMp(MaxMp);
     //Stats = new CharacterStat(this);
 }
Ejemplo n.º 5
0
 public L2Trainer(SpawnTable spawnTable, int objectId, NpcTemplate template, L2Spawn spawn) : base(spawnTable, objectId, template, spawn)
 {
     Template = template;
     Name     = template.Name;
     InitializeCharacterStatus();
     CharStatus.SetCurrentHp(MaxHp);
     CharStatus.SetCurrentMp(MaxMp);
     //Stats = new CharacterStat(this);
 }
Ejemplo n.º 6
0
 public L2Npc(SpawnTable spawnTable, int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template)
 {
     Template = template;
     Name     = Template.Name;
     Initialize();
     CharStatus.SetCurrentHp(MaxHp);
     CharStatus.SetCurrentMp(MaxMp);
     this.spawn = spawn;
     //CStatsInit();
 }
Ejemplo n.º 7
0
 public L2Warrior(SpawnTable spawnTable, int objectId, NpcTemplate template, L2Spawn spawn) : base(spawnTable, objectId, template, spawn)
 {
 }
Ejemplo n.º 8
0
 public L2Warehouse(SpawnTable spawnTable, int objectId, NpcTemplate template, L2Spawn spawn) : base(spawnTable, objectId, template, spawn)
 {
     Template = template;
     Name     = template.Name;
     Initialize();
     this.spawn = spawn;
 }
Ejemplo n.º 9
0
 public L2Warrior(int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template, spawn)
 {
 }