public void Initialize() { if (this.myInitialized) { return; } if (this.Spells.Length == 1) { this.mySpells = SpellBook.GenerateForGuild(); } else { this.mySpells = SpellBook.FromDatabase(this.Spells); } if (this.Stats != string.Empty) { this.ParseStats(); } this.myFightStats.AddBase(EffectEnum.AddForce, this.Level); this.myFightStats.AddBase(EffectEnum.AddSagesse, this.myStats.GetTotal(EffectEnum.AddSagesse)); this.myFightStats.AddBase(EffectEnum.AddIntelligence, this.Level); this.myFightStats.AddBase(EffectEnum.AddChance, this.Level); this.myFightStats.AddBase(EffectEnum.AddAgilite, this.Level); this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentNeutre, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentFeu, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentEau, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentAir, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentTerre, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddEsquivePA, (int)Math.Floor((double)this.Level / 2)); this.myFightStats.AddBase(EffectEnum.AddEsquivePM, (int)Math.Floor((double)this.Level / 2)); this.PatternSpells = new CachedString(new Func <String>(() => { return(string.Join("|", this.mySpells.GetMySpells().Values.Select(x => x.Id + ";" + x.Level))); })); /* * SpellBook.SpellInfo curSpell in mySpells.GetSpellInfos()*/ this.myInitialized = true; }
private void Initialize() { this.myStats = new GenericStats(this); for (int i = 1; i < 16; i++) { var Item = this.InventoryCache.GetItemInSlot((ItemSlotEnum)i); if (Item != null) { this.myStats.Merge(Item.GetStats()); this.Life += Item.GetStats().GetTotal(EffectEnum.AddVitalite); } } if (this.ZaapString != null) { foreach (String str in ZaapString.Split(',')) { short zaap; if (!short.TryParse(str, out zaap)) { continue; } try { Zaaps.Add(zaap); } catch (Exception e) { Logger.Error(e); } } } else { if (Settings.AppSettings.GetBoolElement("World.AllZaap")) { foreach (short map in ZaapTable.Cache.Keys) { this.Zaaps.Add(map); } } } if (this.MountID != -1) { Mount = MountTable.getMount(this.MountID); if (Mount != null) { Mount.Intialize(); } } if (this.SpellString == null || this.SpellString == "") { this.mySpells = SpellBook.GenerateForBreed((ClassEnum)this.Classe); for (int i = 1; i < Client.GetCharacter().Level; i++) { this.mySpells.GenerateLevelUpSpell((ClassEnum)Client.GetCharacter().Classe, i); } Client.Send(new BasicNoOperationMessage()); Client.Send(new SpellsListMessage(Client.Character)); } else { this.mySpells = SpellBook.FromDatabase(this.SpellString); } if (LifePer <= 0) { LifePer = 1; } Life = (MaxLife * LifePer / 100); if (Life == 0) { Life = 1; } _exPdv = Life; this.myInitialized = true; }