Jump to content

mahmoudourti

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mahmoudourti

  • Rank
    Actif

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. va sur tes sources sur IdolTemplateRelator et changer la avec ça using System.Collections.Generic; using System.Linq; using Stump.Core.IO; using Stump.DofusProtocol.D2oClasses; using Stump.DofusProtocol.D2oClasses.Tools.D2o; using Stump.ORM; using Stump.ORM.SubSonic.SQLGeneration.Schema; using Stump.Server.WorldServer.Database.Items.Templates; using Stump.Server.WorldServer.Database.Spells; using Stump.Server.WorldServer.Game.Items; using Stump.Server.WorldServer.Game.Spells; namespace Stump.Server.WorldServer.Database.Idols { public class IdolTemplateRelator { public static string FetchQuery = "SELECT * FROM idols_templates"; } [TableName ("idols_templates")] [D2OClass ("Idol", "com.ankamagames.dofus.datacenter.idols")] public sealed class IdolTemplate : IAssignedByD2O, IAutoGeneratedRecord, ISaveIntercepter { private ItemTemplate m_idolItem; private List<int> m_synergyIdolsIds = new List<int> (); private string m_synergyIdolsIdsCSV; private List<float> m_synergyIdolsCoef = new List<float> (); private string m_synergyIdolsCoefCSV; private List<int> m_incompatibleMonsters = new List<int> (); private string m_incompatibleMonstersCSV; [PrimaryKey ("Id", false)] public int Id { get; set; } public string Description { get; set; } public int IdolItemId { get; set; } [Ignore] public ItemTemplate IdolItem => m_idolItem ?? (m_idolItem = ItemManager.Instance.TryGetTemplate (IdolItemId)); public int? IdolSpellId { get { string spellName = IdolItem.Name.Split (' ') [0]; SpellTemplate spell = SpellManager.Instance.GetSpellTemplates ().FirstOrDefault (x => x.Name == spellName); if (spell != null) { return spell.Id; } return null; } } public byte IdolSpellLevel { get { string[] name = IdolItem.Name.Split (' '); if (name.Length == 1) { return 2; } else { if (name[1] == "menor") { return 1; } else if (name[1] == "mayor") { return 3; } else { return 4; } } } } public int CategoryId { get; set; } public bool GroupOnly { get; set; } public int Score { get; set; } public int ExperienceBonus { get; set; } public int DropBonus { get; set; } [Ignore] public List<int> SynergyIdolsIds { get { return m_synergyIdolsIds; } set { m_synergyIdolsIds = value; m_synergyIdolsIdsCSV = m_synergyIdolsIds.ToCSV (","); } } [NullString] public string SynergyIdolsIdsCSV { get { return m_synergyIdolsIdsCSV; } set { m_synergyIdolsIdsCSV = value; m_synergyIdolsIds = !string.IsNullOrEmpty (m_synergyIdolsIdsCSV) ? m_synergyIdolsIdsCSV.FromCSV<int> (",").ToList () : new List<int> (); } } [Ignore] public List<float> SynergyIdolsCoef { get { return m_synergyIdolsCoef; } set { m_synergyIdolsCoef = value; m_synergyIdolsCoefCSV = m_synergyIdolsCoef.ToCSV (";"); } } [NullString] public string SynergyIdolsCoefCSV { get { return m_synergyIdolsCoefCSV; } set { m_synergyIdolsCoefCSV = value; if (!string.IsNullOrEmpty(m_synergyIdolsCoefCSV)) m_synergyIdolsCoefCSV= m_synergyIdolsCoefCSV.Replace(',', ';'); m_synergyIdolsCoef = !string.IsNullOrEmpty(m_synergyIdolsCoefCSV) ? m_synergyIdolsCoefCSV.FromCSV<float>(";").ToList() : new List<float>(); } } [Ignore] public List<int> IncompatibleMonsters { get { return m_incompatibleMonsters; } set { m_incompatibleMonsters = value; m_incompatibleMonstersCSV = m_incompatibleMonsters.ToCSV (","); } } [NullString] public string IncompatibleMonstersCSV { get { return m_incompatibleMonstersCSV; } set { m_incompatibleMonstersCSV = value; m_incompatibleMonsters = !string.IsNullOrEmpty (m_incompatibleMonstersCSV) ? m_incompatibleMonstersCSV.FromCSV<int> (",").ToList () : new List<int> (); } } [NullString] public string TargetString { get; set; } #region IAssignedByD2O Members public void AssignFields (object d2oObject) { var idol = (Idol) d2oObject; Id = idol.id; Description = idol.description; CategoryId = idol.categoryId; IdolItemId = idol.itemId; GroupOnly = idol.groupOnly; Score = idol.score; ExperienceBonus = idol.experienceBonus; DropBonus = idol.dropBonus; SynergyIdolsIds = idol.synergyIdolsIds; SynergyIdolsCoef = idol.synergyIdolsCoeff; IncompatibleMonsters = idol.incompatibleMonsters; } #endregion IAssignedByD2O Members public void BeforeSave (bool insert) { m_synergyIdolsIdsCSV = m_synergyIdolsIds.Select (x => x).ToCSV (","); m_synergyIdolsCoefCSV = m_synergyIdolsCoef.Select (x => x).ToCSV (";"); m_incompatibleMonstersCSV = m_incompatibleMonsters.Select (x => x).ToCSV (","); } } }
  2. xD mon emulateur hhhhhhhhhh bon partage et merci
×
×
  • Create New...