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