예제 #1
0
        public void CreatePattern()
        {
            string gmInfo        = "|+" + this.CellID + ";" + this.Dir + ";" + this.Bonus.ToString() + ";" + this.ID + ";";
            string monsterIDs    = ("");
            string monstersSkins = ("");
            string monsterLevels = ("");
            string colors        = ("");

            bool first = true;

            foreach (Database.Records.MonsterLevelRecord monster in this.Monsters)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    monsterIDs    += ",";
                    monstersSkins += ",";
                    monsterLevels += ",";
                    colors        += ";";
                }
                Database.Records.MonstersTemplateRecord template = monster.GetTemplate;
                monsterIDs    += template.ID.ToString();
                monstersSkins += template.Skin + "^" + monster.Size;
                monsterLevels += monster.Level.ToString();
                colors        += template.Color1.ToString("x") + "," + template.Color2.ToString("x") + "," + template.Color3.ToString("x") + ";";
            }
            gmInfo += monsterIDs + ";-3;" + monstersSkins + ";" + monsterLevels + ";" + colors;
            this.CatchedPattern = gmInfo;
        }
예제 #2
0
 public void AddStringMonstersData(string data)
 {
     foreach (string monster in data.Split('|'))
     {
         if (monster != "")
         {
             try
             {
                 string[] monsterData = monster.Split(',');
                 int      id          = int.Parse(monsterData[0]);
                 int      level       = int.Parse(monsterData[1]);
                 Database.Records.MonstersTemplateRecord template = World.Helper.MonsterHelper.GetMonsterTemplate(id);
                 if (template != null)
                 {
                     Database.Records.MonsterLevelRecord templateLevel = template.GetLevel(level);
                     if (templateLevel != null)
                     {
                         this.PossibleMonsters.Add(templateLevel);
                     }
                 }
             }
             catch (Exception e)
             {
                 Utilities.ConsoleStyle.Error("Can't add monster on map " + this._map.Map.ID + " : " + e.ToString());
             }
         }
     }
 }
예제 #3
0
 public static void SyncMonsterLevelWithTemplate()
 {
     foreach (Database.Records.MonsterLevelRecord levels in Database.Cache.MonsterLevelCache.Cache)
     {
         Database.Records.MonstersTemplateRecord template = Helper.MonsterHelper.GetMonsterTemplate(levels.TemplateID);
         if (template != null)
         {
             if (template.Levels == null)
             {
                 template.Levels = new List <Database.Records.MonsterLevelRecord>();
             }
             template.Levels.Add(levels);
         }
     }
 }
예제 #4
0
        public static void SummonDouble(Fight fight, Engines.Spells.SpellEffect effect, Engines.Spells.SpellLevel spellLevel, Fighter caster, int cellID)
        {
            /* Create temp template for double summoned */
            Database.Records.MonstersTemplateRecord tempTemplate = new Database.Records.MonstersTemplateRecord()
            {
                ID     = -1,
                Color1 = caster.Character.Color1,
                Color2 = caster.Character.Color2,
                Color3 = caster.Character.Color3,
                Skin   = caster.Character.Look,
                Name   = caster.Nickname,
                Exp    = 0,
                Kamas  = "0,0",
                Drops  = "",
                AI     = 2,
            };
            Database.Records.MonsterLevelRecord tempLevel = new Database.Records.MonsterLevelRecord()
            {
                ID           = -1,
                TemplateID   = -1,
                IsTempLevel  = true,
                TempTemplate = tempTemplate,
                Level        = caster.Level,
                AP           = caster.Stats.GetMaxActionPoints,
                MP           = caster.Stats.GetMaxMovementPoints,
                Life         = caster.Stats.MaxLife,
                Size         = caster.Character.Scal,
                Stats        = "0,0,0,0,0",
                ProtectStats = "0,0,0,0",
                Spells       = "",
            };
            tempLevel.InitMonster();
            Fighter summonedCreature = new Fighter(fight.CurrentEntityTempID, tempLevel, null);

            summonedCreature.CellID      = cellID;
            summonedCreature.SummonOwner = caster.ID;
            summonedCreature.IsInvoc     = true;
            fight.CurrentEntityTempID--;
            fight.AddPlayer(summonedCreature, caster.Team.ID, cellID);
            fight.TimeLine.RemixTimeLine();
            fight.TimelineDisplay();
        }
예제 #5
0
 public static void SummonCreature(Fight fight, Engines.Spells.SpellEffect effect, Engines.Spells.SpellLevel spellLevel, Fighter caster, int cellID)
 {
     if (fight.GetFighterOnCell(cellID) == null)
     {
         Database.Records.MonstersTemplateRecord template = World.Helper.MonsterHelper.GetMonsterTemplate(effect.Value);
         if (template != null)
         {
             Database.Records.MonsterLevelRecord level = template.Levels.FirstOrDefault(x => x.Level == spellLevel.Level);
             if (level != null)
             {
                 Fighter summonedCreature = new Fighter(fight.CurrentEntityTempID, level, null);
                 summonedCreature.CellID      = cellID;
                 summonedCreature.SummonOwner = caster.ID;
                 summonedCreature.IsInvoc     = true;
                 fight.CurrentEntityTempID--;
                 fight.AddPlayer(summonedCreature, caster.Team.ID, cellID);
                 fight.TimeLine.RemixTimeLine();
                 fight.TimelineDisplay();
             }
         }
     }
 }
예제 #6
0
 public static void SummonDouble(Fight fight, Engines.Spells.SpellEffect effect, Engines.Spells.SpellLevel spellLevel, Fighter caster, int cellID)
 {
     /* Create temp template for double summoned */
     Database.Records.MonstersTemplateRecord tempTemplate = new Database.Records.MonstersTemplateRecord()
     {
         ID = -1,
         Color1 = caster.Character.Color1,
         Color2 = caster.Character.Color2,
         Color3 = caster.Character.Color3,
         Skin = caster.Character.Look,
         Name = caster.Nickname,
         Exp = 0,
         Kamas = "0,0",
         Drops = "",
         AI = 2,
     };
     Database.Records.MonsterLevelRecord tempLevel = new Database.Records.MonsterLevelRecord()
     {
         ID = -1,
         TemplateID = -1,
         IsTempLevel = true,
         TempTemplate = tempTemplate,
         Level = caster.Level,
         AP = caster.Stats.GetMaxActionPoints,
         MP = caster.Stats.GetMaxMovementPoints,
         Life = caster.Stats.MaxLife,
         Size = caster.Character.Scal,
         Stats = "0,0,0,0,0",
         ProtectStats = "0,0,0,0",
         Spells = "",
     };
     tempLevel.InitMonster();
     Fighter summonedCreature = new Fighter(fight.CurrentEntityTempID, tempLevel, null);
     summonedCreature.CellID = cellID;
     summonedCreature.SummonOwner = caster.ID;
     summonedCreature.IsInvoc = true;
     fight.CurrentEntityTempID--;
     fight.AddPlayer(summonedCreature, caster.Team.ID, cellID);
     fight.TimeLine.RemixTimeLine();
     fight.TimelineDisplay();
 }