public static Npc CreateNpc(SpawnTemplate spawnTemplate) { var npc = new Npc { NpcId = spawnTemplate.NpcId, SpawnTemplate = spawnTemplate, NpcTemplate = Data.Data.NpcTemplates[spawnTemplate.Type][spawnTemplate.NpcId], Position = new WorldPosition { MapId = spawnTemplate.MapId, X = spawnTemplate.X, Y = spawnTemplate.Y, Z = spawnTemplate.Z + ((spawnTemplate.FullId == 6301151 || spawnTemplate.FullId == 6301152 || spawnTemplate.FullId == 6301153) ? 0 : 25), Heading = spawnTemplate.Heading, } }; npc.BindPoint = npc.Position.Clone(); npc.GameStats = CreatureLogic.InitGameStats(npc); CreatureLogic.UpdateCreatureStats(npc); AiLogic.InitAi(npc); return(npc); }
public static Npc CreateNpc(SpawnTemplate spawnTemplate) { NpcTemplate npcTemplate = (Data.Data.NpcTemplates.ContainsKey(spawnTemplate.NpcId)) ? Data.Data.NpcTemplates[spawnTemplate.NpcId] : new NpcTemplate(); var npc = new Npc { NpcId = spawnTemplate.NpcId, SpawnTemplate = spawnTemplate, NpcTemplate = npcTemplate, Position = new WorldPosition { MapId = spawnTemplate.MapId, X = spawnTemplate.X, Y = spawnTemplate.Y, Z = spawnTemplate.Z, }, }; npc.BindPoint = npc.Position.Clone(); npc.GameStats = CreatureLogic.InitGameStats(npc); CreatureLogic.UpdateCreatureStats(npc); AiLogic.InitAi(npc); return(npc); }
public void InitPlayer(Player player) { player.GameStats = CreatureLogic.InitGameStats(player); CreatureLogic.UpdateCreatureStats(player); AiLogic.InitAi(player); PlayersOnline.Add(player); }
public Gather CreateGather(GSpawnTemplate gSpawn) { var gather = new Gather { Id = gSpawn.CollectionId, Position = new WorldPosition { MapId = gSpawn.WorldPosition.MapId, X = gSpawn.WorldPosition.X, Y = gSpawn.WorldPosition.Y, Z = gSpawn.WorldPosition.Z + 10, }, CurrentGatherCounter = new Random().Next(1, 3), //todo gather counter }; AiLogic.InitAi(gather); return(gather); }
public void InitPlayer(Player player, bool isProlog) { player.PlayerLevel = 1; while ((player.PlayerLevel + 1) != Data.Data.PlayerExperience.Count - 1 && player.PlayerExp >= Data.Data.PlayerExperience[player.PlayerLevel]) { player.PlayerLevel++; } if (player.Skills.Count == 0) { for (int i = 0; i < Data.Data.DefaultSkillSets[player.TemplateId].SkillSet.Count; i++) { player.Skills.Add(Data.Data.DefaultSkillSets[player.TemplateId].SkillSet[i]); } } player.GameStats = CreatureLogic.InitGameStats(player); CreatureLogic.UpdateCreatureStats(player); AiLogic.InitAi(player); PlayersOnline.Add(player); }