public void LoadCharLevel(int index) { CharacterStats tempCharacterStats = CharacterParty.charactersParty[index].charStats; StatsFields currentCharStats = charArray[index]; currentCharStats.lvlText.text = tempCharacterStats.level.ToString(); currentCharStats.expText.text = GetStatsString(tempCharacterStats.currentExp, tempCharacterStats.totalExp); }
public SummonedClone(int id, FightActor caster, Cell cell) : base(id, caster.Team, new List <Spell>(), caster, cell) { Caster = caster; Look = caster.Look.Clone(); m_stats = new StatsFields(this); m_stats.InitializeFromStats(caster.Stats); ResetUsedPoints(); }
public SummonedMonster(int id, FightTeam team, FightActor summoner, MonsterGrade template, Cell cell) : base(id, team, template.Spells.ToArray(), summoner, cell) { this.Monster = template; this.Look = this.Monster.Template.EntityLook; this.m_stats = new StatsFields(this); this.m_stats.Initialize(template); this.AdjustStats(); }
public static void HandleJoinMessage(SimpleClient client, JoinMessage message) { Character character = client.Account.Characters.FirstOrDefault(x => x.Id == message.characterId); if (character == null) { client.Disconnect(); return; } client.Character = character; client.Character.Client = client; Map map = WorldManager.Instance.GetMapById(character.Record.SceneId); if (map == null) { client.Disconnect(); return; } client.Character.Position = new ObjectPosition(character.Record.X, character.Record.Y, character.Record.Z); map.Enter(client.Character); SendJoinRightMessage(client, message.characterId, character.Position.Map.SceneId, character.Position.X, character.Position.Y, character.Position.Z, false, 0);//Send all players in the map var stats = StatsFields.LoadInertieData(); SendSnapshotMessage(client, new Snapshot[] { new SetStateVerSnapshot(1), new UpdateServerTimeSnapshot(DateTime.UtcNow.GetUnixTimeStamp()), new AddObjectSnapshot(client.Character.GetObjectType(true)), new AddObjectSnapshot(new MonsterObjectType(ObjectTypeEnum.OT_MOB, (uint)client.GetHashCode(), 20, 0xFFFFFFFF, 609, 300, 600, 0, 0, 100, "Nuan", stats.Count, stats.Keys.Select(x => (ushort)x).ToArray(), stats.Values.Select(x => x.Total).ToArray(), 0, new byte[0], new int[0], new int[0], 1, false, 255, 0, 0, 0, 0, new uint[0], 0, true, true, false, 0, 0, 2, -1, 0)) }); foreach (var attribute in client.Character.Stats.Fields) { SendSnapshotMessage(client, new [] { new SetValueObjectSnapshot((uint)client.Character.GetHashCode(), (short)attribute.Key, attribute.Value.Total), }); } List <Snapshot> spawnOtherObjects = new List <Snapshot>(); foreach (var @object in map.Objects.Where(x => x != character)) { spawnOtherObjects.Add(new AddObjectSnapshot(@object.GetObjectType())); } SendSnapshotMessage(client, spawnOtherObjects.ToArray()); //foreach (var stats in client.Character.Stats.Fields) //{ // SendSnapshotMessage(client, new Snapshot[] { new SetValueObjectSnapshot((uint)client.Character.GetHashCode(), (short)stats.Key, (int)stats.Value.Total) }); //} }
private void LoadCharStats(int index) { CharacterStats tempCharacterStats = CharacterParty.charactersParty[index].charStats; StatsFields currentCharStats = charArray[index]; currentCharStats.avatarImage.sprite = tempCharacterStats.avatar; currentCharStats.NameText.text = tempCharacterStats.name; currentCharStats.hpText.text = GetStatsString(tempCharacterStats.currentHealthPoints, tempCharacterStats.totalHealthPoints); currentCharStats.mpText.text = GetStatsString(tempCharacterStats.currentMagicPoints, tempCharacterStats.totalMagicPoints); }
//CONSTRUCTOR public SummonedMonster(int id, FightTeam team, FightActor summoner, MonsterGrade template, Cell cell, bool isVisibleTimeline = true, bool treeSummon = false) : base(id, team, template.Spells.ToArray(), summoner, cell) { this.m_isVisibleInTimeLine = isVisibleTimeline; this.IsTreeSummon = treeSummon; this.Monster = template; this.Look = this.Monster.Template.EntityLook; this.m_stats = new StatsFields(this); this.m_stats.Initialize(template); this.AdjustStats(); }
public MonsterFighter(FightTeam team, Monster monster) : base(team, monster.Grade.Spells.ToArray(), monster.Grade.MonsterId) { this.Id = (int)base.Fight.GetNextContextualId(); this.Monster = monster; this.Look = monster.Look.Clone(); this.m_stats = new StatsFields(this); this.m_stats.Initialize(this.Monster.Grade); Cell cell; base.Fight.FindRandomFreeCell(this, out cell, false); this.Position = new ObjectPosition(monster.Group.Map, cell, monster.Group.Direction); }
public TaxCollectorFighter(FightTeam team, TaxCollectorNpc taxCollector) : base(team, taxCollector.Guild.GetTaxCollectorSpells(), taxCollector.GlobalId) { this.TaxCollectorNpc = taxCollector; this.Look = this.TaxCollectorNpc.Look.Clone(); this.m_stats = new StatsFields(this); this.m_stats.Initialize(this.TaxCollectorNpc); Cell cell; if (base.Fight.FindRandomFreeCell(this, out cell, false)) { this.Position = new ObjectPosition(this.TaxCollectorNpc.Map, cell, this.TaxCollectorNpc.Direction); } }
public SummonedMonster(int id, FightTeam team, FightActor summoner, MonsterGrade template, Cell cell) : base(id, team, template.Spells.ToArray(), summoner, cell, template.MonsterId) { Monster = template; Look = Monster.Template.EntityLook.Clone(); m_stats = new StatsFields(this); m_stats.Initialize(template); if (Monster.Template.Race.SuperRaceId == 28) //Invocations { AdjustStats(); } }
public void LoadRecord() { Stats = new StatsFields(this); Stats.Initialize(Record); Inventory = new Inventory(); Inventory.LoadData(Id); Position = new ObjectPosition(new Map() { SceneId = Record.SceneId }, this.Record.X, Record.Y, Record.Z); }
public TaxCollectorFighter(FightTeam team, TaxCollectorNpc taxCollector) : base(team, taxCollector.Guild.GetTaxCollectorSpells(), taxCollector.GlobalId) { Id = Fight.GetNextContextualId(); TaxCollectorNpc = taxCollector; Look = TaxCollectorNpc.Look.Clone(); Items = TaxCollectorNpc.Bag.SelectMany(x => Enumerable.Repeat(x.Template.Id, (int)x.Stack)) .Shuffle() .ToList(); Kamas = TaxCollectorNpc.GatheredKamas; m_stats = new StatsFields(this); m_stats.Initialize(TaxCollectorNpc); if (!Fight.FindRandomFreeCell(this, out var cell, false)) { return; } Position = new ObjectPosition(TaxCollectorNpc.Map, cell, TaxCollectorNpc.Direction); }
public SummonedTurret(int id, FightActor summoner, MonsterGrade template, Spell spell, Cell cell) : base(id, summoner.Team, template.Spells, summoner, cell) { Caster = summoner; Monster = template; Look = Monster.Template.EntityLook.Clone(); m_spell = spell; m_stats = new StatsFields(this); m_stats.Initialize(template); m_stats.MP.Modified += OnMPModified; AdjustStats(); Fight.TurnStarted += OnTurnStarted; if (Monster.Template.Id == (int)MonsterIdEnum.TACTIRELLE_3289) { Team.FighterAdded += OnFighterAdded; } }
public SummonedBomb(int id, FightTeam team, SpellBombTemplate spellBombTemplate, MonsterGrade monsterBombTemplate, FightActor summoner, Cell cell) : base(team) { Id = id; Position = summoner.Position.Clone(); Look = monsterBombTemplate.Template.EntityLook.Clone(); Cell = cell; MonsterBombTemplate = monsterBombTemplate; Summoner = summoner; SpellBombTemplate = spellBombTemplate; m_stats = new StatsFields(this); m_stats.Initialize(monsterBombTemplate); WallSpell = new Spell((int)wallsSpells[SpellBombTemplate.WallId], (byte)MonsterBombTemplate.GradeId); m_color = wallsColors[SpellBombTemplate.WallId]; AdjustStats(); ExplodSpell = new Spell(spellBombTemplate.ExplodReactionSpell, (byte)MonsterBombTemplate.GradeId); Fight.TurnStarted += OnTurnStarted; Team.FighterAdded += OnFighterAdded; m_initialized = true; }
public SummonedClone(int id, FightActor caster, Cell cell) : base(id, caster.Team, new System.Collections.Generic.List <Spell>(), caster, cell) { this.Caster = caster; this.Look = caster.Look.Clone(); this.m_stats = caster.Stats.CloneAndChangeOwner(this); }