예제 #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();
            });
        }
예제 #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);
        }
예제 #3
0
 public L2Warehouse(int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template, spawn)
 {
     Template = template;
     Name     = template.Name;
     InitializeCharacterStatus();
     this.spawn = spawn;
 }
예제 #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);
 }
예제 #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);
 }
예제 #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();
 }
예제 #7
0
 public L2Warrior(SpawnTable spawnTable, int objectId, NpcTemplate template, L2Spawn spawn) : base(spawnTable, objectId, template, spawn)
 {
 }
예제 #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;
 }
예제 #9
0
 public L2Warrior(int objectId, NpcTemplate template, L2Spawn spawn) : base(objectId, template, spawn)
 {
 }