Beispiel #1
0
 public Currency(Blacksmith_whetstone blacksmith_whetstone, Armourer_scrap armourer_scrap, Glassblower_bauble glassblower_bauble, Gemcutter_prism gemcutter_prism, Cartographer_chisel cartographer_chisel, Transmutation transmutation, Alteration alteration, Annulment annulment, Chance chance, Augment augment, Exalted exalted, Mirror mirror, Regal regal, Alchemy alchemy, Chaos chaos, Blessed blessed, Divine divine, Jeweller jeweller, Fusing fusing, Chromatic chromatic, Scouring scouring, Regret regret, Vaal vaal, Silver_coin silver_coin, Perandus_coin perandus_coin, Apprentice_sextant apprentice_sextant, Journeyman_sextant journeyman_sextant, Master_sextant master_sextant)
 {
     this.blacksmith_whetstone = blacksmith_whetstone;
     this.armourer_scrap       = armourer_scrap;
     this.glassblower_bauble   = glassblower_bauble;
     this.gemcutter_prism      = gemcutter_prism;
     this.cartographer_chisel  = cartographer_chisel;
     this.transmutation        = transmutation;
     this.alteration           = alteration;
     this.annulment            = annulment;
     this.chance             = chance;
     this.augment            = augment;
     this.exalted            = exalted;
     this.mirror             = mirror;
     this.regal              = regal;
     this.alchemy            = alchemy;
     this.chaos              = chaos;
     this.blessed            = blessed;
     this.divine             = divine;
     this.jeweller           = jeweller;
     this.fusing             = fusing;
     this.chromatic          = chromatic;
     this.scouring           = scouring;
     this.regret             = regret;
     this.vaal               = vaal;
     this.silver_coin        = silver_coin;
     this.perandus_coin      = perandus_coin;
     this.apprentice_sextant = apprentice_sextant;
     this.journeyman_sextant = journeyman_sextant;
     this.master_sextant     = master_sextant;
 }
        public void Can_CreateTable()
        {
            const string tableName         = "foo";
            const string columnDefinitions = "id INT, val FLOAT, name TEXT";

            Alchemy.CreateTable(GetBytes(tableName), GetBytes(columnDefinitions));
        }
        public void Can_InsertReturnSize()
        {
            const string tableName = "foo";
            const string values    = "2,2.2222222,two";

            Alchemy.InsertReturnSize(GetBytes(tableName), GetBytes(values));
        }
        public void Can_DumpToMysql()
        {
            const string tableName      = "foo";
            const string mysqlTableName = "foo";

            Alchemy.DumpToMysql(GetBytes(tableName), GetBytes(mysqlTableName));
        }
        public void Can_DumpToFile()
        {
            const string tableName = "foo";
            const string fileName  = "foo.sql";

            Alchemy.DumpToFile(GetBytes(tableName), GetBytes(fileName));
        }
        public void Can_Delete()
        {
            const string tableName   = "foo";
            const string whereClause = "id = 1";

            Alchemy.Delete(GetBytes(tableName), GetBytes(whereClause));
        }
        public void Can_ScanSelect()
        {
            const string columnList = "*";
            const string tableName  = "foo";

            Alchemy.ScanSelect(GetBytes(columnList), GetBytes(tableName), null);
        }
        private void IntsertData()
        {
            const string tableName = "foo";
            const string values    = "2,2.2222222,'two'";

            Alchemy.Insert(GetBytes(tableName), GetBytes(values));
        }
        public void Can_Dump()
        {
            const string tableName = "foo";

            IntsertData();
            byte[][] results = Alchemy.Dump(GetBytes(tableName));
        }
        public override GameObject CreateGameObject(ReferenceData referenceData, Transform parent = null)
        {
            var gameObject = base.CreateGameObject(referenceData, parent);

            Alchemy.Create(gameObject, this, referenceData);

            return(gameObject);
        }
        public void Can_Select()
        {
            const string columnList  = "*";
            const string tableName   = "foo";
            const string whereClause = "id = 1";

            Alchemy.Select(GetBytes(columnList), GetBytes(tableName), GetBytes(whereClause));
        }
        public void Can_CreateIndex()
        {
            const string indexName  = "foo_val_index";
            const string tableName  = "foo";
            const string columnName = "val";

            Alchemy.CreateIndex(GetBytes(indexName), GetBytes(tableName), GetBytes(columnName));
        }
        public void Can_Update()
        {
            const string tableName   = "foo";
            const string updateList  = "val=9.999999";
            const string whereClause = "id = 1";

            Alchemy.Update(GetBytes(tableName), GetBytes(updateList), GetBytes(whereClause));
        }
        public override void OnBeforeEachTest()
        {
            base.OnBeforeEachTest();

            const string tableName         = "foo";
            const string columnDefinitions = "id INT, val FLOAT, name TEXT";

            Alchemy.CreateTable(GetBytes(tableName), GetBytes(columnDefinitions));
        }
Beispiel #15
0
    public override void _Ready()
    {
        _alchemy        = GetParent().GetParent <Alchemy>();
        _mortarSplash   = GetParent().GetNode <Particles2D>("Crush/MortarSplash");
        _pestle         = GetParent().GetNode <Pestle>("Pestle");
        _potionCircle   = GetParent().GetNode <PotionCircle>("Crush/PotionCircle");
        _potionProgress = GetParent().GetNode <TextureProgress>("Crush/PotionProgress");

        _mortarSplashBurst = GD.Load <PackedScene>("res://particle/MortarSplashBurst.tscn");

        _pestle.Connect("body_entered", this, nameof(_OnPestleBodyEntered));
    }
Beispiel #16
0
        public override void Paint(Level level, Room room)
        {
            Fill(level, room, Terrain.WALL);
            Fill(level, room, 1, Terrain.EMPTY_SP);

            var entrance = room.Entrance();

            Point pot = null;

            if (entrance.X == room.Left)
            {
                pot = new Point(room.Right - 1, Random.Int(2) == 0 ? room.Top + 1 : room.Bottom - 1);
            }
            else if (entrance.X == room.Right)
            {
                pot = new Point(room.Left + 1, Random.Int(2) == 0 ? room.Top + 1 : room.Bottom - 1);
            }
            else if (entrance.Y == room.Top)
            {
                pot = new Point(Random.Int(2) == 0 ? room.Left + 1 : room.Right - 1, room.Bottom - 1);
            }
            else if (entrance.Y == room.Bottom)
            {
                pot = new Point(Random.Int(2) == 0 ? room.Left + 1 : room.Right - 1, room.Top + 1);
            }

            Set(level, pot, Terrain.ALCHEMY);

            var alchemy = new Alchemy();

            alchemy.Seed(pot.X + Level.Width * pot.Y, 1);
            level.Blobs.Add(typeof(Alchemy), alchemy);

            var n = Random.IntRange(2, 3);

            for (var i = 0; i < n; i++)
            {
                int pos;
                do
                {
                    pos = room.Random();
                }while (level.map[pos] != Terrain.EMPTY_SP || level.heaps[pos] != null);

                level.Drop(Prize(level), pos);
            }

            entrance.Set(Room.Door.DoorType.LOCKED);
            level.AddItemToSpawn(new IronKey());
        }
 //Check if any alchemy objects are close
 private void FindAlchemyObjects()
 {
     foreach (var item in GameManager.Instance.LevelManagerInstance.GetItemSpawnList())
     {
         if (item.item.TypeItem == Item.ItemType.Alchemy)
         {
             if ((item.item as Alchemy).IsHidden == true)
             {
                 if (GetDistanceVector(item.item.VItem.transform.position).magnitude <= _alchemySearchRadius)
                 {
                     _hasFoundObject = true;
                     _foundObject    = item.item as Alchemy;
                 }
             }
         }
     }
 }
Beispiel #18
0
        public static Alchemy FindAlchemyByKey(string alchemykey)
        {
            if (alchemyinfo_list == null || alchemyinfo_list.Count == 0)
            {
                return(null);
            }
            Alchemy ralchemy = null;

            foreach (Alchemy alchemy in alchemyinfo_list)
            {
                if (alchemy.itemkey.CompareTo(alchemykey) == 0)
                {
                    ralchemy = alchemy;
                    break;
                }
            }
            return(ralchemy);
        }
Beispiel #19
0
        // Use this for initialization
        void Start()
        {
            LoadingData.LoadItem();

            Utilities.DebugLog("LoadingData.GetTabCount " + LoadingData.GetTabCount(LoadingData.table_equipment));
            BlackSmithAddition getback          = LoadingData.FindBlackSmithAdditionByKey(blacksmithfindkey);
            Equipment          getback2         = LoadingData.FindEquipmentInfoByKey(equipmentfindkey);
            GameMaterial       getback3         = LoadingData.FindMaterialByKey(materialfindkey);
            MissionPoint       missionpointback = LoadingData.FindMissionByKey(missionpointfindkey);
            Stage   stageback   = LoadingData.FindStageByKey(stagefindkey);
            Alchemy alchemyback = LoadingData.FindAlchemyByKey(alchemyfindkey);

            Utilities.DebugLog("addition info " + getback.itemkey);
            Utilities.DebugLog("need add " + getback.param.Count + "  item");
            foreach (KeyValuePair <string, int> param in getback.param)
            {
                Utilities.DebugLog("addition key " + param.Key + "  value " + param.Value);
            }
            Utilities.DebugLog("================================");
            Utilities.DebugLog("weapon info " + getback2.equipmentkey);

            Utilities.DebugLog("weapon type " + getback2.type);

            Utilities.DebugLog("weapon price " + getback2.price_value);

            Utilities.DebugLog("material info " + getback3.itemkey);

            Utilities.DebugLog("weapon tw " + getback3.tw);

            Utilities.DebugLog("weapon desc " + getback2.tw_desc);

            Utilities.DebugLog("mission point now is " + missionpointback.key);

            Utilities.DebugLog("stageback now is " + stageback.key);
            Utilities.DebugLog("stageback point now is " + stageback.checkpointcount);
            Utilities.DebugLog("stageback king is " + stageback.kingname);

            Utilities.DebugLog("alchemyback now is " + alchemyback.itemkey);
            foreach (KeyValuePair <GameMaterial, int> param in alchemyback.param)
            {
                Utilities.DebugLog("addition key " + param.Key.tw + "  value " + param.Value);
            }
        }
Beispiel #20
0
        public bool Execute(Equipment item, AffixManager affixManager)
        {
            if (item.Corrupted || item.Rarity != EquipmentRarity.Normal)
            {
                return(false);
            }

            // Unique items are not currently handled
            var roll = Random.Next(5);

            if (roll == 0)
            {
                return(Alchemy.Execute(item, affixManager));
            }
            else
            {
                return(Transmutation.Execute(item, affixManager));
            }
        }
Beispiel #21
0
        public static void SetInitListForAlchemy()
        {
            if (itemTable != null && itemTable.Count > 0)
            {
                if (!itemTable.ContainsKey(table_alchemy))
                {
                    return;
                }
                Hashtable parentTable = (Hashtable)itemTable [table_alchemy];

                foreach (string stringkey in parentTable.Keys)
                {
                    //把每一行抓出來
                    Hashtable currenttable    = (Hashtable)parentTable[stringkey];
                    Alchemy   current_alchemy = new Alchemy();
                    current_alchemy.itemkey = stringkey;
                    current_alchemy.param   = new Dictionary <GameMaterial, int> ();
                    GameMaterial firstmaterial = FindMaterialByKey(Utilities.LoadString(currenttable[key_alchemy_param1], ""));
                    if (firstmaterial == null)
                    {
                        Utilities.DebugLog("alchemy can't find in material " + Utilities.LoadString(currenttable[key_alchemy_param1]));
                        return;
                    }
                    current_alchemy.param.Add(firstmaterial, Utilities.LoadInt(currenttable[key_alchemy_param1count], 0));
                    string checking = Utilities.LoadString(currenttable[key_alchemy_param2], "");
                    if (checking != null && checking.CompareTo("") != 0)
                    {
                        GameMaterial secondmaterial = FindMaterialByKey(Utilities.LoadString(currenttable[key_alchemy_param2], ""));
                        if (secondmaterial == null)
                        {
                            Utilities.DebugLog("alchemy can't find in material " + Utilities.LoadString(currenttable[key_alchemy_param2]));
                            return;
                        }
                        current_alchemy.param.Add(secondmaterial, Utilities.LoadInt(currenttable[key_alchemy_param2count], 0));
                    }

                    Utilities.DebugLog("alchemy now is " + stringkey);
                    alchemyinfo_list.Add(current_alchemy);
                }
            }
        }
Beispiel #22
0
        public static void Imortal()
        {
            Game.PrintMessage("Importal Runn");

            int runTime = 0;

            while (true)
            {
                Game.Wait(5);
                runTime += 5;

                if (World.Player.Hits <= 0)
                {
                    Alchemy.ExecDrinkPotion("Heal");
                }

                //if (runTime % 2500 == 0)
                //{
                //  Game.PrintMessage("Imortal Run...");
                //}
            }

            // Game.PrintMessage("Importal End");
        }
Beispiel #23
0
 private void OnConnect(Alchemy.Classes.UserContext context)
 {
     _clients.Add(context);
 }
Beispiel #24
0
        public static void StayAndFight(int distance, int hpMin, bool boost, bool reversePath, string path, string summonName, int summonCount)
        {
            ManualLastTarget.SwitchShowStatusBar();
            int initGold = World.Player.Gold;
            int initFD   = World.Player.Backpack.AllItems.FindType(0x103D, 0x0B52).Amount;
            //Serial: 0x4023CD57  Name: "Fairy Dust"  Position: 136.144.0  Flags: 0x0020  Color: 0x0B52  Graphic: 0x103D  Amount: 4  Layer: None  Container: 0x4019287E

            PlayerClass pclass = Game.CurrentGame.CurrentPlayer.PlayerClass;

            UOPosition zero = new UOPosition(World.Player.X, World.Player.Y, (ushort)World.Player.Z);

            CalebConfig.AutoHeal = true;
            World.Player.ChangeWarmode(WarmodeChange.War);
            Game.Wait();

            short         maxHitsBase   = World.Player.MaxHits;
            DateTime?     lastBoostTime = null;
            List <Serial> deny          = new List <Serial>();
            UOCharacter   current       = null;
            Robot         r             = new Robot();
            Robot         r2            = new Robot();
            Robot         r3            = new Robot();
            Loot          l             = new Loot();
            DateTime      startTime     = DateTime.Now;

            Hashtable htKilled = new Hashtable();

            int walkCounter = 0;

            GotoEventHandler beforeMoveHandler = (sender, e) =>
            {
                ushort x = e.Destination.X.GetValueOrDefault();
                ushort y = e.Destination.Y.GetValueOrDefault();
                walkCounter++;

                if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0)
                {
                    new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start();
                }

                foreach (UOItem item in World.Ground)
                {
                    if (item.Graphic == 0x0DDA && item.X == x && item.Y == y)
                    {
                        e.IvalidDestination = true;
                    }
                }
            };

            GotoEventHandler beforeMoveHandler2 = (sender, e) =>
            {
                walkCounter++;
                if (current != null && e.Tries > 5)
                {
                    List <UOCharacter> chars = new List <UOCharacter>();
                    chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !deny.Contains(ch.Serial) && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray());


                    if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0)
                    {
                        new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start();
                    }

                    foreach (UOCharacter ch in chars)
                    {
                        if (ch.Distance < current.Distance)
                        {
                            e.Abort = true;
                            break;
                        }
                    }
                }
            };

            GotoEventHandler beforeMoveHandler3 = (sender, e) =>
            {
                walkCounter++;
                List <UOCharacter> chars = new List <UOCharacter>();
                chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !deny.Contains(ch.Serial) && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray());

                if (Game.CurrentGame.Mobs.Count > 0 && (walkCounter % 15) == 0)
                {
                    new Thread(new ThreadStart(MobMaster.Current.MobCome)).Start();
                }


                foreach (UOCharacter ch in chars)
                {
                    if (current == null || ch.Distance < current.Distance)
                    {
                        e.Abort = true;
                        break;
                    }
                }
            };

            List <IUOPosition> posPath = new List <IUOPosition>();

            posPath.Add(new UOPositionBase(World.Player.X, World.Player.Y, (ushort)World.Player.Z));

            if (!String.IsNullOrEmpty(path))
            {
                posPath.AddRange(UOPositionBase.ParseList(path));
            }

            r2.BeforeMove += beforeMoveHandler;
            r2.BeforeMove += beforeMoveHandler2;
            r.BeforeMove  += beforeMoveHandler;

            r3.BeforeMove += beforeMoveHandler;
            r3.BeforeMove += beforeMoveHandler3;

            int pathIndex = 0;

            Poisoning p = new Poisoning();

            while (!UO.Dead)
            {
                if (boost)
                {
                    if (lastBoostTime == null || (DateTime.Now - lastBoostTime).Value.TotalMilliseconds > 180000)
                    {
                        Game.RunScript(8000);
                        lastBoostTime = DateTime.Now;
                        Game.PrintMessage("Try booost...");
                        UO.Cast(StandardSpell.ReactiveArmor, Aliases.Self);
                        Game.Wait(2500);
                        Game.RunScript(4000);
                        UO.Cast(StandardSpell.Strength, Aliases.Self);
                        Game.Wait(3500);
                        Game.RunScript(4000);
                        UO.Cast(StandardSpell.Protection, Aliases.Self);
                        Game.Wait(3500);
                    }
                }

                List <UOCharacter> chars = new List <UOCharacter>();
                chars.AddRange(World.Characters.Where(ch => (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer) && ch.Distance <= distance && !Characters.IsSummon(ch) && ch.Serial != World.Player.Serial).OrderBy(ch => ch.Distance).ThenBy(ch => ch.MaxHits).ToArray());

                foreach (UOCharacter ch in chars)
                {
                    bool isVladimirSkorp = ch.Model == 0x0030 && ch.Color == 0x0B78;

                    if (deny.Contains(ch.Serial) && ch.Distance > 2)
                    {
                        continue;
                    }

                    ch.RequestStatus(500);
                    ch.Click();
                    Game.Wait();

                    if (World.Player.Hits <= hpMin)
                    {
                        while (World.Player.Hits < hpMin)
                        {
                            Game.Wait(500);
                        }
                    }

                    ch.Print(Game.Val_GreenBlue, "[killing...]");

                    current = ch;

                    if (!String.IsNullOrEmpty(summonName) && World.Player.Layers[Layer.Hat].Graphic == 0x1451 && Game.CurrentGame.Mobs.Count < summonCount && World.Player.Mana > 20)
                    {
                        Magery.ExecCastSummonCreature(summonName, "Self");
                        Game.Wait(4000);
                        MobMaster.Current.MobStop();
                    }

                    for (int i = 0; i < Game.CurrentGame.Mobs.Count; i++)
                    {
                        MobMaster.Current.MobKill();
                        Game.Wait(250);
                    }

                    if (ch.Exist && ch.Hits > 0 && ch.Distance < 50 && r2.GoTo(ch.X, ch.Y, 1, 25))
                    {
                        UOItem trainKit = World.Player.Backpack.AllItems.FindType(Poisoning.TrainKit.Graphic, Poisoning.TrainKit.Color);

                        if (trainKit.Exist)
                        {
                            p.TrainPoisEngage();
                        }



                        while (ch.Exist && ch.Hits > 0)
                        {
                            if (!Game.CurrentGame.WorldSave())
                            {
                                //Serial: 0x401E33B3  Position: 0.0.0  Flags: 0x0000  Color: 0x0000  Graphic: 0x1451  Amount: 0  Layer: Hat Container: 0x0037EAF7

                                if (!String.IsNullOrEmpty(summonName) && World.Player.Layers[Layer.Hat].Graphic == 0x1451 && Game.CurrentGame.Mobs.Count < summonCount && World.Player.Mana > 20)
                                {
                                    Magery.ExecCastSummonCreature(summonName, "Self");
                                    Game.Wait(4000);
                                    MobMaster.Current.MobStop();
                                }



                                if (ch.Exist && ch.Hits > 0 && ch.Distance > 1 && ch.Distance < 30)
                                {
                                    Game.PrintMessage("HUNT... " + new UOPositionBase(ch.X, ch.Y, 0));
                                    Game.RunScript(500);
                                    Game.Wait(500);
                                    UO.Attack(ch.Serial);



                                    if (!r.GoTo(ch.X, ch.Y, 1, 5))
                                    {
                                        break;
                                    }
                                }

                                htKilled[ch.Serial] = ch;

                                UO.Attack(ch.Serial);
                                Game.RunScript(1500);
                                Game.Wait(1000);


                                for (int i = 0; i < Game.CurrentGame.Mobs.Count; i++)
                                {
                                    MobMaster.Current.MobKill();
                                    Game.Wait(250);
                                }

                                if (World.Player.Hits <= hpMin)
                                {
                                    while (World.Player.Hits < hpMin)
                                    {
                                        if (pclass == PlayerClass.Vampire)
                                        {
                                            if (Game.CurrentGame.CanDrink)
                                            {
                                                Alchemy.ExecDrinkPotion("Blood");
                                                Game.Wait(500);
                                            }

                                            if (World.Player.Hits < 45)
                                            {
                                                Vampire.SnezBandu();
                                                Game.Wait(500);
                                            }
                                        }
                                        else
                                        {
                                            if (Game.CurrentGame.CanDrink && Potion.Heal.ContainsTopKad(World.Player.Backpack))
                                            {
                                                Alchemy.ExecDrinkPotion("Heal");
                                                Game.Wait(150);
                                            }
                                        }

                                        if (World.Player.Hits < hpMin)
                                        {
                                            Game.RunScript(5);
                                            //  Game.CurrentGame.SwitchWarRunOff();

                                            Game.Wait(2500);
                                        }


                                        if (Game.CurrentGame.Mobs.Count > 0)
                                        {
                                            if (!ch.Exist)
                                            {
                                                MobMaster.Current.MobStop();
                                                Game.Wait(150);
                                            }
                                            else
                                            {
                                                MobMaster.Current.MobKill();
                                                Game.Wait(150);
                                            }
                                        }
                                    }
                                }

                                if (ch.Exist && ch.Hits > 0 && ch.Distance > 1 && ch.Distance < 30)
                                {
                                    Game.PrintMessage("HUNT... " + new UOPositionBase(ch.X, ch.Y, 0));

                                    if (!r.GoTo(ch.X, ch.Y, 1, 5))
                                    {
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                Game.Wait(2500);
                            }
                        }

                        if (!ch.Exist)
                        {
                            if (isVladimirSkorp && World.Player.Backpack.Items.FindType(0x227B, 0x0697).Exist)
                            {
                                Game.UseTypeCust(0x227B, 0x0697, "nearestcorpse", "[Target]", "[Ladislav]");
                            }

                            if (Game.CurrentGame.Mobs.Count > 0)
                            {
                                MobMaster.Current.MobCome();
                            }

                            Game.PrintMessage("KILLED...");
                            Game.Wait(1500);
                            current = null;
                            break;
                        }
                    }
                    else
                    {
                        Game.PrintMessage("Deny ADD " + ch.Name);
                        deny.Add(ch.Serial);
                        break;
                    }
                }

                l.LootGround(Loot.LootType.QuickCut);

                if (chars.Count == 0 || chars.Count - deny.Count <= 0)
                {
                    pathIndex++;
                    if (pathIndex > posPath.Count - 1)
                    {
                        if (reversePath)
                        {
                            posPath.Reverse();
                        }
                        pathIndex = 0;
                    }

                    Game.PrintMessage("Goto Next " + posPath[pathIndex]);
                    deny.Clear();
                    Game.Wait(500);

                    if (!r3.GoTo(posPath[pathIndex], 0, 500))
                    {
                        Game.PrintMessage("Cant go to NEXT " + posPath[pathIndex]);
                        continue;
                    }
                    else
                    {
                        Game.PrintMessage(posPath[pathIndex].ToString() + " - Com:" + posPath[pathIndex].CommandName);


                        if (!String.IsNullOrEmpty(posPath[pathIndex].CommandName))
                        {
                            if (posPath[pathIndex].CommandName.ToLower() == "opendoor")
                            {
                                ItemHelper.OpenDoorAll();
                                Game.Wait();
                            }
                        }

                        //,exec stayandfight 5 110 false true "5125.1152|5122.1163|5124.1178|5124.1185|5124.1185.0.OpenDoor|5124.1187.0.OpenDoor|5125.1188|5125.1198|5125.1209|5137.1208|5143.1207|5156.1208|5167.1209|5181.1209|5182.1212|5188.1211|5188.1201|5188.1193|5180.1193"

                        Game.PrintMessage(String.Format("Zabito {0} za {1:N0} min. Gold: {2}, FD: {3}", htKilled.Values.Count, (DateTime.Now - startTime).TotalMinutes, World.Player.Gold - initGold, World.Player.Backpack.AllItems.FindType(0x103D, 0x0B52).Amount - initFD));
                    }
                }
            }
        }
Beispiel #25
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity <FlowManager>();
            modelBuilder.Entity <ReefCastle>();
            modelBuilder.Entity <Alchemy>();
            modelBuilder.Entity <StormSeal>();

            foreach (var relationship in modelBuilder.Model.GetEntityTypes().SelectMany(e => e.GetForeignKeys()))
            {
                relationship.DeleteBehavior = DeleteBehavior.NoAction;
            }

            var laserShark = new LaserShark
            {
                Id = 1
            };
            var sharkLv1 = new UnitLevel()
            {
                Id            = 1,
                Level         = 1,
                AttackScore   = 5,
                DefenseScore  = 5,
                UnitTypeId    = 1,
                BattlesNeeded = 0
            };
            var sharkLv2 = new UnitLevel()
            {
                Id            = 2,
                Level         = 2,
                AttackScore   = 7,
                DefenseScore  = 7,
                UnitTypeId    = 1,
                BattlesNeeded = 3
            };
            var sharkLv3 = new UnitLevel()
            {
                Id            = 3,
                Level         = 3,
                AttackScore   = 10,
                DefenseScore  = 10,
                UnitTypeId    = 1,
                BattlesNeeded = 8
            };
            var stormSeal = new StormSeal
            {
                Id = 2,
            };
            var sealLv1 = new UnitLevel()
            {
                Id            = 4,
                Level         = 1,
                AttackScore   = 6,
                DefenseScore  = 2,
                UnitTypeId    = 2,
                BattlesNeeded = 0
            };
            var sealLv2 = new UnitLevel()
            {
                Id            = 5,
                Level         = 2,
                AttackScore   = 8,
                DefenseScore  = 3,
                UnitTypeId    = 2,
                BattlesNeeded = 3
            };
            var sealLv3 = new UnitLevel()
            {
                Id            = 6,
                Level         = 3,
                AttackScore   = 10,
                DefenseScore  = 5,
                UnitTypeId    = 2,
                BattlesNeeded = 8
            };
            var combatSeaHorse = new CombatSeaHorse
            {
                Id = 3
            };
            var horseLv1 = new UnitLevel()
            {
                Id            = 7,
                Level         = 1,
                AttackScore   = 2,
                DefenseScore  = 6,
                UnitTypeId    = 3,
                BattlesNeeded = 0
            };
            var horseLv2 = new UnitLevel()
            {
                Id            = 8,
                Level         = 2,
                AttackScore   = 3,
                DefenseScore  = 8,
                UnitTypeId    = 3,
                BattlesNeeded = 3
            };
            var horseLv3 = new UnitLevel()
            {
                Id            = 9,
                Level         = 3,
                AttackScore   = 5,
                DefenseScore  = 10,
                UnitTypeId    = 3,
                BattlesNeeded = 8
            };

            var reefCastle = new ReefCastle
            {
                Id = 1
            };
            var flowManager = new FlowManager
            {
                Id = 2
            };
            var stoneMine = new StoneMine
            {
                Id = 3
            };
            var alchemy = new Alchemy
            {
                Id = 1
            };
            var coralWall = new CoralWall
            {
                Id = 2
            };
            var mudHarvester = new MudHarvester
            {
                Id = 3
            };
            var mudTractor = new MudTractor
            {
                Id = 4
            };
            var sonarCannon = new SonarCannon
            {
                Id = 5
            };
            var underwaterMartialArts = new UnderwaterMartialArts
            {
                Id = 6
            };

            var upgrade1 = new Upgrade
            {
                Id        = 1,
                CountryId = 1,
                State     = UpgradeState.Unresearched,
                TypeId    = 1
            };
            var upgrade2 = new Upgrade
            {
                Id        = 2,
                CountryId = 1,
                State     = UpgradeState.Unresearched,
                TypeId    = 2
            };
            var upgrade3 = new Upgrade
            {
                Id        = 3,
                CountryId = 1,
                State     = UpgradeState.Researched,
                TypeId    = 3
            };
            var upgrade4 = new Upgrade
            {
                Id        = 4,
                CountryId = 1,
                State     = UpgradeState.Unresearched,
                TypeId    = 4
            };
            var upgrade5 = new Upgrade
            {
                Id        = 5,
                CountryId = 1,
                State     = UpgradeState.Unresearched,
                TypeId    = 5
            };
            var upgrade6 = new Upgrade
            {
                Id        = 6,
                CountryId = 1,
                State     = UpgradeState.Researched,
                TypeId    = 6
            };
            var upgrade7 = new Upgrade
            {
                Id        = 7,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 1
            };
            var upgrade8 = new Upgrade
            {
                Id        = 8,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 2
            };
            var upgrade9 = new Upgrade
            {
                Id        = 9,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 3
            };
            var upgrade10 = new Upgrade
            {
                Id        = 10,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 4
            };
            var upgrade11 = new Upgrade
            {
                Id        = 11,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 5
            };
            var upgrade12 = new Upgrade
            {
                Id        = 12,
                CountryId = 2,
                State     = UpgradeState.Unresearched,
                TypeId    = 6
            };

            var buildingGroup1 = new BuildingGroup
            {
                Id = 1
            };
            var buildingGroup2 = new BuildingGroup
            {
                Id = 2
            };

            var building1 = new Building
            {
                Id = 1,
                BuildingGroupId = 1,
                Count           = 4,
                TypeId          = 1
            };
            var building2 = new Building
            {
                Id = 2,
                BuildingGroupId = 1,
                Count           = 1,
                TypeId          = 2
            };
            var building3 = new Building
            {
                Id = 3,
                BuildingGroupId = 2,
                Count           = 1,
                TypeId          = 1
            };
            var building4 = new Building
            {
                Id = 4,
                BuildingGroupId = 2,
                Count           = 0,
                TypeId          = 2
            };
            var building5 = new Building
            {
                Id = 5,
                BuildingGroupId = 1,
                Count           = 0,
                TypeId          = 3
            };
            var building6 = new Building
            {
                Id = 6,
                BuildingGroupId = 2,
                Count           = 0,
                TypeId          = 3
            };

            var unitGroup1 = new UnitGroup
            {
                Id = 1
            };
            var unitGroup2 = new UnitGroup
            {
                Id = 2
            };
            var unitGroup3 = new UnitGroup
            {
                Id = 3
            };
            var unitGroup4 = new UnitGroup
            {
                Id = 4
            };

            var country1 = new Country
            {
                Id = 1,
                AttackingArmyId  = 1,
                DefendingArmyId  = 2,
                BuildingTimeLeft = 0,
                Coral            = 100000,
                Name             = "First Country",
                Pearl            = 100000,
                Stone            = 5000,
                Score            = 0,
                UpgradeTimeLeft  = 0,
                UserId           = 1,
                BuildingGroupId  = 1,
            };
            var country2 = new Country
            {
                Id = 2,
                AttackingArmyId  = 3,
                DefendingArmyId  = 4,
                BuildingTimeLeft = 0,
                Coral            = 100000,
                Name             = "Another Country",
                Pearl            = 100000,
                Stone            = 5000,
                Score            = 0,
                UpgradeTimeLeft  = 0,
                UserId           = 2,
                BuildingGroupId  = 2
            };

            var game = new Game
            {
                Id    = 1,
                Round = 1
            };

            var passwordHasher = new PasswordHasher <User>();
            var user1          = new User
            {
                Id                 = 1,
                GameId             = 1,
                Place              = 1,
                Score              = 100,
                UserName           = "******",
                NormalizedUserName = "******",
                SecurityStamp      = Guid.NewGuid().ToString()
            };

            user1.PasswordHash = passwordHasher.HashPassword(user1, "undersea");

            var user2 = new User
            {
                Id                 = 2,
                GameId             = 1,
                Place              = 2,
                Score              = 50,
                UserName           = "******",
                NormalizedUserName = "******",
                SecurityStamp      = Guid.NewGuid().ToString()
            };

            user2.PasswordHash = passwordHasher.HashPassword(user2, "undersea");

            modelBuilder.Entity <LaserShark>()
            .HasData(laserShark);
            modelBuilder.Entity <StormSeal>()
            .HasData(stormSeal);
            modelBuilder.Entity <CombatSeaHorse>()
            .HasData(combatSeaHorse);

            modelBuilder.Entity <ReefCastle>()
            .HasData(reefCastle);
            modelBuilder.Entity <FlowManager>()
            .HasData(flowManager);
            modelBuilder.Entity <StoneMine>()
            .HasData(stoneMine);

            modelBuilder.Entity <Alchemy>()
            .HasData(alchemy);
            modelBuilder.Entity <MudTractor>()
            .HasData(mudTractor);
            modelBuilder.Entity <MudHarvester>()
            .HasData(mudHarvester);
            modelBuilder.Entity <CoralWall>()
            .HasData(coralWall);
            modelBuilder.Entity <SonarCannon>()
            .HasData(sonarCannon);
            modelBuilder.Entity <UnderwaterMartialArts>()
            .HasData(underwaterMartialArts);

            modelBuilder.Entity <UnitGroup>()
            .HasData(new UnitGroup[]
            {
                unitGroup1,
                unitGroup2,
                unitGroup3,
                unitGroup4
            });
            modelBuilder.Entity <Game>().HasData(game);
            modelBuilder.Entity <User>()
            .HasData(new User[]
            {
                user1,
                user2
            });
            modelBuilder.Entity <Country>()
            .HasData(new Country[]
            {
                country1,
                country2
            });
            modelBuilder.Entity <Upgrade>()
            .HasData(new Upgrade[]
            {
                upgrade1,
                upgrade2,
                upgrade3,
                upgrade4,
                upgrade5,
                upgrade6,
                upgrade7,
                upgrade8,
                upgrade9,
                upgrade10,
                upgrade11,
                upgrade12
            });
            modelBuilder.Entity <BuildingGroup>()
            .HasData(new BuildingGroup[]
            {
                buildingGroup1,
                buildingGroup2
            });
            modelBuilder.Entity <Building>()
            .HasData(new Building[]
            {
                building1,
                building2,
                building3,
                building4,
                building5,
                building6
            });

            modelBuilder.Entity <UnitLevel>()
            .HasData(new UnitLevel[] {
                sharkLv1,
                sharkLv2,
                sharkLv3,
                horseLv1,
                horseLv2,
                horseLv3,
                sealLv1,
                sealLv2,
                sealLv3,
            });
        }
Beispiel #26
0
        public virtual void Press(int cell, actors.Character ch)
        {
            if (pit[cell] && ch == Dungeon.Hero)
            {
                Chasm.HeroFall(cell);
                return;
            }

            var trap = false;

            switch (map[cell])
            {
            case Terrain.SECRET_TOXIC_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.TOXIC_TRAP;

            case Terrain.TOXIC_TRAP:
                trap = true;
                ToxicTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_FIRE_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.FIRE_TRAP;

            case Terrain.FIRE_TRAP:
                trap = true;
                FireTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_PARALYTIC_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.PARALYTIC_TRAP;

            case Terrain.PARALYTIC_TRAP:
                trap = true;
                ParalyticTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_POISON_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.POISON_TRAP;

            case Terrain.POISON_TRAP:
                trap = true;
                PoisonTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_ALARM_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.ALARM_TRAP;

            case Terrain.ALARM_TRAP:
                trap = true;
                AlarmTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_LIGHTNING_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.LIGHTNING_TRAP;

            case Terrain.LIGHTNING_TRAP:
                trap = true;
                LightningTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_GRIPPING_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.GRIPPING_TRAP;

            case Terrain.GRIPPING_TRAP:
                trap = true;
                GrippingTrap.Trigger(cell, ch);
                break;

            case Terrain.SECRET_SUMMONING_TRAP:
                GLog.Information(TXT_HIDDEN_PLATE_CLICKS);
                goto case Terrain.SUMMONING_TRAP;

            case Terrain.SUMMONING_TRAP:
                trap = true;
                SummoningTrap.Trigger(cell, ch);
                break;

            case Terrain.HIGH_GRASS:
                HighGrass.Trample(this, cell, ch);
                break;

            case Terrain.WELL:
                WellWater.AffectCell(cell);
                break;

            case Terrain.ALCHEMY:
                if (ch == null)
                {
                    Alchemy.Transmute(cell);
                }
                break;

            case Terrain.DOOR:
                Door.Enter(cell);
                break;
            }

            if (trap)
            {
                Sample.Instance.Play(Assets.SND_TRAP);

                if (ch == Dungeon.Hero)
                {
                    Dungeon.Hero.Interrupt();
                }

                Set(cell, Terrain.INACTIVE_TRAP);
                GameScene.UpdateMap(cell);
            }

            var plant = plants[cell];

            if (plant != null)
            {
                plant.Activate(ch);
            }
        }
Beispiel #27
0
        public void CheckChanges()
        {
            var context = BulkOrderSystem.GetContext(Player, false);

            if (context != null)
            {
                foreach (var kvp in context.Entries)
                {
                    switch (kvp.Key)
                    {
                    case BODType.Smith:
                        if (Smithy == null)
                        {
                            Smithy = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Smithy.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Tailor:
                        if (Tailor == null)
                        {
                            Tailor = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Tailor.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Alchemy:
                        if (Alchemy == null)
                        {
                            Alchemy = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Alchemy.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Inscription:
                        if (Inscription == null)
                        {
                            Inscription = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Inscription.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Tinkering:
                        if (Tinkering == null)
                        {
                            Tinkering = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Tinkering.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Cooking:
                        if (Cooking == null)
                        {
                            Cooking = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Cooking.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Fletching:
                        if (Fletching == null)
                        {
                            Fletching = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Fletching.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Carpentry:
                        if (Carpentry == null)
                        {
                            Carpentry = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Carpentry.CheckChanges(kvp.Value);
                        }
                        break;
                    }
                }
            }
        }
Beispiel #28
0
 public void AddBlood()
 {
     Alchemy.AddElement(Elements.blood);
     animator.SetTrigger("animate");
     PlaySound();
 }
Beispiel #29
0
 public void RemoveShadow()
 {
     Alchemy.RemoveElement(Elements.shadow);
     animator.SetTrigger("animate");
 }
Beispiel #30
0
 public void AddShadow()
 {
     Alchemy.AddElement(Elements.shadow);
     animator.SetTrigger("animate");
     PlaySound();
 }
Beispiel #31
0
 public void RemoveSlime()
 {
     Alchemy.RemoveElement(Elements.slime);
     animator.SetTrigger("animate");
 }