public void HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player == null)
            {
                return;
            }

            int code = packet.ReadByte();

            if (code != 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("bonuses button: code is other than zero (" + code + ")");
                }
            }

            var info = new List <string>();

            client.Player.GetBonuses(info);

            client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "PlayerBonusesListRequestHandler.HandlePacket.Bonuses"), info);
        }
Exemplo n.º 2
0
        public override bool CheckPreconditions(GameLiving living, long bitmask)
        {
            lock (living.EffectList)
            {
                foreach (IGameEffect effect in living.EffectList)
                {
                    if (effect is GameSpellEffect oEffect)
                    {
                        if (oEffect.Spell.SpellType.ToLower().IndexOf("speeddecrease") != -1 && oEffect.Spell.Value != 99)
                        {
                            if (living is GamePlayer player)
                            {
                                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Skill.Ability.CannotUseSnared"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            }

                            return(true);
                        }
                    }
                }
            }

            return(base.CheckPreconditions(living, bitmask));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Check Ability to use Item
 /// </summary>
 /// <param name="player"></param>
 protected virtual void CheckAbilityToUseItem(GamePlayer player)
 {
     // drop any equiped-non usable item, in inventory or on the ground if full
     lock (player.Inventory)
     {
         foreach (InventoryItem item in player.Inventory.EquippedItems)
         {
             if (!player.HasAbilityToUseItem(item.Template))
             {
                 if (player.Inventory.IsSlotsFree(item.Count, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) == true)
                 {
                     player.Inventory.MoveItem((eInventorySlot)item.SlotPosition, player.Inventory.FindFirstEmptySlot(eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack), item.Count);
                     player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameTrainer.CheckAbilityToUseItem.Text1", item.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                 }
                 else
                 {
                     player.Inventory.MoveItem((eInventorySlot)item.SlotPosition, eInventorySlot.Ground, item.Count);
                     player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameTrainer.CheckAbilityToUseItem.Text1", item.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
    private IEnumerator LoadNextLevel()
    {
        Input.multiTouchEnabled = false;

        SetPercentDone(0);

        Optimizer.CreateSingleton();
        yield return(null);

        Debug.Log("Loading genie...");

        Ekstep.Genie.CreateSingleton();

        while (!Ekstep.Genie.instance.IsInitialized)
        {
            yield return(null);
        }

        Debug.Log("Finished loading genie...");

        if (!EnlearnInstance.CheckInstalled())
        {
            yield break;
        }

        LanguageMgr.CreateSingleton();

        FPSCounter.CreateSingleton();

        AsyncOperation loadOp = Application.LoadLevelAsync(Application.loadedLevel + 1);

        while (!loadOp.isDone)
        {
            SetPercentDone(loadOp.progress);
            yield return(null);
        }
    }
Exemplo n.º 5
0
        public override void SendDamageMessages(AttackData ad)
        {
            // Graveen: only GamePlayer should receive messages :p
            GamePlayer PlayerReceivingMessages = null;

            if (m_caster is GamePlayer)
            {
                PlayerReceivingMessages = m_caster as GamePlayer;
            }
            if (m_caster is GamePet)
            {
                if ((m_caster as GamePet).Brain is IControlledBrain)
                {
                    PlayerReceivingMessages = ((m_caster as GamePet).Brain as IControlledBrain).GetPlayerOwner();
                }
            }
            if (PlayerReceivingMessages == null)
            {
                return;
            }

            if (Spell.Name.StartsWith("Proc"))
            {
                MessageToCaster(String.Format(LanguageMgr.GetTranslation(PlayerReceivingMessages.Client, "DoTSpellHandler.SendDamageMessages.YouHitFor",
                                                                         ad.Target.GetName(0, false), ad.Damage)), eChatType.CT_YouHit);
            }
            else
            {
                MessageToCaster(String.Format(LanguageMgr.GetTranslation(PlayerReceivingMessages.Client, "DoTSpellHandler.SendDamageMessages.YourHitsFor",
                                                                         Spell.Name, ad.Target.GetName(0, false), ad.Damage)), eChatType.CT_YouHit);
            }
            if (ad.CriticalDamage > 0)
            {
                MessageToCaster(String.Format(LanguageMgr.GetTranslation(PlayerReceivingMessages.Client, "DoTSpellHandler.SendDamageMessages.YourCriticallyHits",
                                                                         Spell.Name, ad.Target.GetName(0, false), ad.CriticalDamage)), eChatType.CT_YouHit);
            }
        }
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result2;

            if (player.PlayerCharacter.ConsortiaID != 0)
            {
                result2 = 0;
            }
            else
            {
                int    id     = packet.ReadInt();
                bool   result = false;
                string msg    = "ConsortiaApplyLoginHandler.ADD_Failed";
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    if (db.AddConsortiaApplyUsers(new ConsortiaApplyUserInfo
                    {
                        ApplyDate = DateTime.Now,
                        ConsortiaID = id,
                        ConsortiaName = "",
                        IsExist = true,
                        Remark = "",
                        UserID = player.PlayerCharacter.ID,
                        UserName = player.PlayerCharacter.NickName
                    }, ref msg))
                    {
                        msg    = ((id != 0) ? "ConsortiaApplyLoginHandler.ADD_Success" : "ConsortiaApplyLoginHandler.DELETE_Success");
                        result = true;
                    }
                }
                packet.WriteBoolean(result);
                packet.WriteString(LanguageMgr.GetTranslation(msg, new object[0]));
                player.Out.SendTCP(packet);
                result2 = 0;
            }
            return(result2);
        }
Exemplo n.º 7
0
        /// <summary>
        /// This function is called when player accept the combine
        /// </summary>
        /// <param name="player"></param>
        /// <param name="item"></param>
        public override bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
        {
            if (!base.IsAllowedToCombine(player, item))
            {
                return(false);
            }

            if (((InventoryItem)player.TradeWindow.TradeItems[0]).Object_Type !=
                (int)eObjectType.AlchemyTincture)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
                                                                  "Alchemy.IsAllowedToCombine.AlchemyTinctures"), PacketHandler.eChatType.CT_System,
                                       PacketHandler.eChatLoc.CL_SystemWindow);

                return(false);
            }

            if (player.TradeWindow.ItemsCount > 1)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
                                                                  "Alchemy.IsAllowedToCombine.OneTincture"), PacketHandler.eChatType.CT_System,
                                       PacketHandler.eChatLoc.CL_SystemWindow);

                return(false);
            }

            if (item.ProcSpellID != 0 || item.SpellID != 0)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
                                                                  "Alchemy.IsAllowedToCombine.AlreadyImbued", item.Name),
                                       PacketHandler.eChatType.CT_System, PacketHandler.eChatLoc.CL_SystemWindow);

                return(false);
            }

            return(true);
        }
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result2;

            if (player.PlayerCharacter.ConsortiaID == 0)
            {
                result2 = 0;
            }
            else
            {
                int    id     = packet.ReadInt();
                string remark = packet.ReadString();
                if (string.IsNullOrEmpty(remark) || Encoding.Default.GetByteCount(remark) > 100)
                {
                    player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ConsortiaUserRemarkHandler.Long", new object[0]));
                    result2 = 1;
                }
                else
                {
                    bool   result = false;
                    string msg    = "ConsortiaUserRemarkHandler.Failed";
                    using (ConsortiaBussiness db = new ConsortiaBussiness())
                    {
                        if (db.UpdateConsortiaUserRemark(id, player.PlayerCharacter.ConsortiaID, player.PlayerCharacter.ID, remark, ref msg))
                        {
                            msg    = "ConsortiaUserRemarkHandler.Success";
                            result = true;
                        }
                    }
                    packet.WriteBoolean(result);
                    packet.WriteString(LanguageMgr.GetTranslation(msg, new object[0]));
                    player.Out.SendTCP(packet);
                    result2 = 0;
                }
            }
            return(result2);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Check if the player is near the needed tools (forge, lathe, etc)
        /// </summary>
        /// <param name="player">the crafting player</param>
        /// <param name="recipe">the recipe being used</param>
        /// <param name="itemToCraft">the item to make</param>
        /// <param name="rawMaterials">a list of raw materials needed to create this item</param>
        /// <returns>true if required tools are found</returns>
        protected override bool CheckForTools(GamePlayer player, DBCraftedItem recipe, ItemTemplate itemToCraft, IList <DBCraftedXItem> rawMaterials)
        {
            bool needForge = false;

            foreach (DBCraftedXItem material in rawMaterials)
            {
                ItemTemplate template = GameServer.Database.FindObjectByKey <ItemTemplate>(material.IngredientId_nb);
                if (template != null && template.Model == 519) // metal bar
                {
                    needForge = true;
                    break;
                }
            }

            if (needForge)
            {
                foreach (GameStaticItem item in player.GetItemsInRadius(CRAFT_DISTANCE))
                {
                    if (item.Name == "forge" || item.Model == 478) // Forge
                    {
                        return(true);
                    }
                }

                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Crafting.CheckTool.NotHaveTools", itemToCraft.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                player.Out.SendMessage(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Crafting.CheckTool.FindForge"), eChatType.CT_System, eChatLoc.CL_SystemWindow);

                if (player.Client.Account.PrivLevel > 1)
                {
                    return(true);
                }

                return(false);
            }

            return(true);
        }
Exemplo n.º 10
0
        public void OnCommand(GameClient client, string[] args)
        {
            if (args.Length != 6)
            {
                DisplaySyntax(client);
                return;
            }

            ushort zoneID = 0;

            if (!ushort.TryParse(args[1], out zoneID))
            {
                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.DebugJump.InvalidZoneID", args[1]));
                return;
            }

            Zone z = WorldMgr.GetZone(zoneID);

            if (z == null)
            {
                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.DebugJump.UnknownZoneID", args[1]));
                return;
            }

            ushort RegionID = z.ZoneRegion.ID;
            int    X        = z.XOffset + Convert.ToInt32(args[2]);
            int    Y        = z.YOffset + Convert.ToInt32(args[3]);
            int    Z        = Convert.ToInt32(args[4]);
            ushort Heading  = Convert.ToUInt16(args[5]);

            if (!CheckExpansion(client, RegionID))
            {
                return;
            }

            client.Player.MoveTo(RegionID, X, Y, Z, Heading);
        }
Exemplo n.º 11
0
 public void RemovePlayerSpecial(GamePlayer player)
 {
     if (this._guestsList.Contains(player))
     {
         this._guestsList.Remove(player);
         player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("SpaRoom.ZeroKick", new object[0]));
         string msg = null;
         if (player.SpaRoomAddGPTotal > 0)
         {
             msg = LanguageMgr.GetTranslation("SpaRoom.Msg2", new object[]
             {
                 player.SpaRoomAddGPTotal
             });
         }
         player.Out.SendPlayerLeaveSpaRoom(player, msg);
         GamePlayer[] roomPlayers = player.CurrentSpaRoom.GetAllPlayers();
         if (roomPlayers != null)
         {
             GamePlayer[] array = roomPlayers;
             for (int i = 0; i < array.Length; i++)
             {
                 GamePlayer p = array[i];
                 p.Out.SendSpaRoomRemoveGuest(player);
             }
         }
         player.CurrentSpaRoom = null;
         this.SendSpaRoomInfoUpdateToSpaScenePlayers(this);
         //DateTime arg_E4_0 = this.ZeroToday;
         //bool flag = 1 == 0;
         player.UpdateLastSpaDate(this.ZeroToday);
         player.SpaRoomAddGPTotal = 0;
     }
     else
     {
         SpaRoom.log.Error(string.Format("SpaRoom ====== player.nickname : {0}, room.roomID : {1}.player is not in this room,but be removing in zero.", player.PlayerCharacter.NickName, this.Spa_Room_Info.RoomID));
     }
 }
Exemplo n.º 12
0
        /* This is our callback hook that will be called when the player clicks
         * on any button in the quest offer dialog. We check if he accepts or
         * declines here...
         */

        private static void CheckPlayerAcceptQuest(GamePlayer player, byte response)
        {
            // We recheck the qualification, because we don't talk to players
            // who are not doing the quest
            if (addrir.CanGiveQuest(typeof(ImportantDelivery), player) <= 0)
            {
                return;
            }

            ImportantDelivery quest = player.IsDoingQuest(typeof(ImportantDelivery)) as ImportantDelivery;

            if (quest != null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendReply(player, LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.CheckPlayerAcceptQuest.NoAccept"));
            }
            else
            {
                // Check if we can add the quest!
                if (!addrir.GiveQuest(typeof(ImportantDelivery), player, 1))
                {
                    return;
                }

                addrir.SayTo(player, LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.CheckPlayerAcceptQuest.Accept"));
            }

            // language manager support for items
            recruitsDiary.Name     = LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.DefineItems.RecruitsDiary");
            sackOfSupplies.Name    = LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.DefineItems.SackOfSupplies");
            crateOfVegetables.Name = LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.DefineItems.CrateOfVegetables");
            recruitsCloak.Name     = LanguageMgr.GetTranslation(player.Client, "Hib.ImportantDelivery.DefineItems.RecruitsCloak");
        }
Exemplo n.º 13
0
        public override bool CheckBeginCast(GameLiving selectedTarget)
        {
            if (!(Caster is GamePlayer))
            {
                return(false);
            }

            if (selectedTarget == null)
            {
                MessageToCaster(LanguageMgr.GetTranslation(((GamePlayer)Caster).Client, "TurretsRelease.CheckBeginCast.NoSelectedTarget"), eChatType.CT_SpellResisted);

                return(false);
            }

            if (!(selectedTarget is GameNPC target) || !(target.Brain is TurretBrain) || !Caster.IsControlledNPC(target))
            {
                MessageToCaster(LanguageMgr.GetTranslation(((GamePlayer)Caster).Client, "TurretsRelease.CheckBeginCast.NoSelectedTarget"), eChatType.CT_SpellResisted);

                return(false);
            }

            if (!Caster.IsControlledNPC(target))
            {
                MessageToCaster(LanguageMgr.GetTranslation(((GamePlayer)Caster).Client, "TurretsRelease.CheckBeginCast.NoSelectedTarget"), eChatType.CT_SpellResisted);

                return(false);
            }

            if (!Caster.IsWithinRadius(target, Spell.Range))
            {
                MessageToCaster(LanguageMgr.GetTranslation(((GamePlayer)Caster).Client, "TurretsRelease.CheckBeginCast.TargetTooFarAway"), eChatType.CT_SpellResisted);

                return(false);
            }

            return(base.CheckBeginCast(selectedTarget));
        }
Exemplo n.º 14
0
        /// <summary>
        /// Handles quest events.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            base.Notify(e, sender, args);
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (player.IsDoingQuest(typeof(CemmethsOrders)) == null)
            {
                return;
            }

            if (Step == 1 && e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.CemmethsOrders.Notify.Text1")) >= 0)
                {
                    if (!SkeletonsKilled.IsAchieved)
                    {
                        SkeletonsKilled.Advance();
                        return;
                    }
                }

                if (gArgs.Target.Name.IndexOf(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.CemmethsOrders.Notify.Text2")) >= 0)
                {
                    if (!DecayingGhoulsKilled.IsAchieved)
                    {
                        DecayingGhoulsKilled.Advance();
                        return;
                    }
                }
            }
        }
Exemplo n.º 15
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result2;

            if (player.PlayerCharacter.ConsortiaID == 0)
            {
                result2 = 0;
            }
            else
            {
                bool          result = false;
                string        msg    = "ConsortiaStoreUpGradeHandler.Failed";
                ConsortiaInfo info   = ConsortiaMgr.FindConsortiaInfo(player.PlayerCharacter.ConsortiaID);
                if (info == null)
                {
                    msg = "ConsortiaStoreUpGradeHandler.NoConsortia";
                }
                else
                {
                    using (ConsortiaBussiness cb = new ConsortiaBussiness())
                    {
                        if (cb.UpGradeStoreConsortia(player.PlayerCharacter.ConsortiaID, player.PlayerCharacter.ID, ref msg))
                        {
                            info.StoreLevel++;
                            GameServer.Instance.LoginServer.SendConsortiaStoreUpGrade(info);
                            msg    = "ConsortiaStoreUpGradeHandler.Success";
                            result = true;
                        }
                    }
                }
                packet.WriteBoolean(result);
                packet.WriteString(LanguageMgr.GetTranslation(msg, new object[0]));
                player.Out.SendTCP(packet);
                result2 = 1;
            }
            return(result2);
        }
Exemplo n.º 16
0
 public void ProcessRequest(HttpContext context)
 {
     //CreatShortCut.ashx?gameurl=http%3A//127.0.0.1/gunnyii/
     try
     {
         string str  = context.Request.QueryString["gameurl"];
         string str2 = context.Request.UserAgent.ToUpper();
         string str3 = LanguageMgr.GetTranslation("Game.ProductionName") + ".url";
         if (str2.Contains("MS") && str2.Contains("IE"))
         {
             str3 = HttpUtility.UrlEncode(str3);
         }
         else if (str2.Contains("FIREFOX"))
         {
             str3 = "\"" + str3 + "\"";
         }
         else
         {
             str3 = HttpUtility.UrlEncode(str3);
         }
         context.Response.ContentType = "application/octet-stream;";
         context.Response.AddHeader("Content-Disposition", "attachment;filename=" + str3);
         context.Response.Write("[InternetShortcut]\n");
         context.Response.Write("URL=" + str + "\n");
         context.Response.Write("IDList=\n");
         context.Response.Write("IconFile=\n");
         context.Response.Write("IconIndex=1\n");
         context.Response.Write("[{000214A0-0000-0000-C000-000000000046}]\n");
         context.Response.Write("Prop3=19,2\n");
         context.ApplicationInstance.CompleteRequest();
     }
     catch (Exception exception)
     {
         context.Response.Write("Error:" + exception);
     }
 }
Exemplo n.º 17
0
        protected override bool CheckForTools(GamePlayer player, Recipe recipe)
        {
            bool needForge = false;

            foreach (var ingredient in recipe.Ingredients)
            {
                if (ingredient.Material.Model == 519) // metal bar
                {
                    needForge = true;
                    break;
                }
            }

            if (needForge)
            {
                foreach (GameStaticItem item in player.GetItemsInRadius(CRAFT_DISTANCE))
                {
                    if (item.Name == "forge" || item.Model == 478) // Forge
                    {
                        return(true);
                    }
                }

                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Crafting.CheckTool.NotHaveTools", recipe.Product.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                player.Out.SendMessage(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Crafting.CheckTool.FindForge"), eChatType.CT_System, eChatLoc.CL_SystemWindow);

                if (player.Client.Account.PrivLevel > 1)
                {
                    return(true);
                }

                return(false);
            }

            return(true);
        }
Exemplo n.º 18
0
        public void OnCommand(GameClient client, string[] args)
        {
            if (ServerProperties.Properties.DISABLE_APPEALSYSTEM)
            {
                AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.SystemDisabled"));
                return;
            }

            if (args.Length < 5)
            {
                AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.NeedMoreDetail"));
                return;
            }

            //send over the info to the /report command
            args[1] = "";
            //strip these words if they are the first word in the bugreport text
            switch (args[2].ToLower())
            {
            case "harassment":
            case "naming":
            case "other":
            case "conduct":
            case "stuck":
            case "emergency":
            {
                args[2] = "";
                break;
            }
            }
            ReportCommandHandler report = new ReportCommandHandler();

            report.OnCommand(client, args);
            AppealMgr.MessageToAllStaff(client.Player.Name + " submitted a bug report.");
            return;
        }
Exemplo n.º 19
0
        /// <summary>
        /// Talk to trainer
        /// </summary>
        /// <param name="source"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, string text)
        {
            if (!base.WhisperReceive(source, text))
            {
                return(false);
            }
            GamePlayer player    = source as GamePlayer;
            String     lowerCase = text.ToLower();

            if (lowerCase == LanguageMgr.GetTranslation(player.Client.Account.Language, "BainsheeTrainer.WhisperReceiveCase.Text1"))
            {
                // promote player to other class
                if (CanPromotePlayer(player))
                {
                    player.RemoveAllSpellLines();
                    player.RemoveAllSpecs();
                    player.RemoveAllStyles();
                    player.Out.SendUpdatePlayerSkills();
                    PromotePlayer(player, (int)eCharacterClass.Bainshee, LanguageMgr.GetTranslation(player.Client.Account.Language, "BainsheeTrainer.WhisperReceive.Text1", player.GetName(0, false)), null);
                    player.ReceiveItem(this, WEAPON_ID1);
                }
            }
            return(true);
        }
Exemplo n.º 20
0
        public override bool Interact(GamePlayer player)
        {
            if (!base.Interact(player))
            {
                return(false);
            }

            TurnTo(player, 5000);
            if (!player.Champion && player.Level == 50)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "KingNPC.WhisperReceive.AskForChampion"), eChatType.CT_System, eChatLoc.CL_PopupWindow);
            }

            if (player.Champion)
            {
                bool cllevel = false;

                while (player.ChampionLevel < player.ChampionMaxLevel && player.ChampionExperience >= player.ChampionExperienceForNextLevel)
                {
                    player.ChampionLevelUp();
                    cllevel = true;
                }

                if (cllevel)
                {
                    player.Out.SendMessage("You reached champion level " + player.ChampionLevel + "!", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                }

                if (player.ChampionLevel >= 5)
                {
                    player.Out.SendMessage("I can [respecialize] your champion skills if you so desire.", eChatType.CT_System, eChatLoc.CL_PopupWindow);
                }
            }

            return(true);
        }
Exemplo n.º 21
0
        public void OnCommand(GameClient client, string[] args)
        {
            if (IsSpammingCommand(client.Player, "boot"))
            {
                return;
            }

            House house = client.Player.CurrentHouse;

            if (house == null)
            {
                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Boot.InHouseError"));
                return;
            }

            // no permission to banish, return
            if (!house.CanBanish(client.Player))
            {
                DisplayMessage(client, "You do not have permissions to do that.");
                return;
            }

            // check each player, try and find player with the given name (lowercase cmp)
            foreach (GamePlayer player in house.GetAllPlayersInHouse())
            {
                if (player != client.Player && player.Name.ToLower() != args[1].ToLower())
                {
                    ChatUtil.SendSystemMessage(client, "Scripts.Players.Boot.YouRemoved", client.Player.Name);
                    player.LeaveHouse();

                    return;
                }
            }

            ChatUtil.SendHelpMessage(client, "Scripts.Players.Boot.NoOneOnline", null);
        }
Exemplo n.º 22
0
        public override void OnStartGame()
        {
            base.OnStartGame();
            m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 1, 0);
            m_front     = Game.Createlayer(725, 395, "font", "game.asset.living.BombKingAsset", "out", 1, 1, 0);
            //再试一次跳过剧情动画
            if (Game.WantTryAgain == 1)
            {
                return;
            }
            Game.SendPlayBackgroundSound(false);
            Game.AddAction(new LockFocusAction(false, 0, 0));

            m_king = Game.CreateBoss(kingID, 888, 715, 1, 0);
            Game.AddAction(new FocusAction(m_king.X, m_king.Y - 90, 0, 0, 0));

            m_king.PlayMovie("cry", 4000, 2000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg1"), 2, 4000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg2"), 2, 9000);

            m_king.MoveTo(500, m_king.Y, "walk", 13000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg3"), 2, 21000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg4"), 2, 25000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg5"), 2, 29000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg6"), 2, 33000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg7"), 2, 37000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg8"), 2, 41000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg9"), 2, 45000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg10"), 2, 49000);
            m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1277.msg11"), 2, 53000, 4000);

            foreach (Player player in Game.GetAllFightPlayers())
            {
                Game.SendLivingToTop(player);
            }
        }
Exemplo n.º 23
0
        private void CriticalStrikes()
        {
            Player        target          = Game.GetFrostPlayerRadom();
            List <Player> players         = Game.GetAllFightPlayers();
            List <Player> NotFrostPlayers = new List <Player>();

            foreach (Player player in players)
            {
                if (player.IsFrost == false)
                {
                    NotFrostPlayers.Add(player);
                }
            }

            ((SimpleBoss)Body).CurrentDamagePlus = 30;

            if (NotFrostPlayers.Count != players.Count)
            {
                if (NotFrostPlayers.Count != 0)
                {
                    Body.PlayMovie("beat1", 0, 0);
                    Body.RangeAttacking(Body.X - 1000, Body.X + 1000, "beat1", 1500, NotFrostPlayers);
                }
                else
                {
                    Body.PlayMovie("beat1", 0, 0);
                    Body.RangeAttacking(Body.X - 1000, Body.X + 1000, "beat1", 1500, null);
                }
            }
            else
            {
                Body.Say(LanguageMgr.GetTranslation("GameServerScript.AI.NPC.NormalKingSecond.msg22"), 1, 3300);
                Body.PlayMovie("renew", 3500, 0);
                Body.CallFuction(new LivingCallBack(CreateChild), 6000);
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Change Player Anonymous Flag on Command
        /// </summary>
        /// <param name="client"></param>
        /// <param name="args"></param>
        public void OnCommand(GameClient client, string[] args)
        {
            if (client.Player == null)
            {
                return;
            }

            if (client.Account.PrivLevel == 1 && ServerProperties.Properties.ANON_MODIFIER == -1)
            {
                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Anonymous.Error"));
                return;
            }

            client.Player.IsAnonymous = !client.Player.IsAnonymous;

            if (client.Player.IsAnonymous)
            {
                client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Anonymous.On"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
            else
            {
                client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Anonymous.Off"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
        }
Exemplo n.º 25
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.ConsortiaID == 0)
            {
                return(0);
            }

            int  id      = packet.ReadInt();
            bool isFight = packet.ReadBoolean();

            bool   result = false;
            string msg    = "ConsortiaAllyAddHandler.Add_Failed";

            using (ConsortiaBussiness db = new ConsortiaBussiness())
            {
                ConsortiaAllyInfo info = new ConsortiaAllyInfo();
                info.Consortia1ID = client.Player.PlayerCharacter.ConsortiaID;
                info.Consortia2ID = id;
                info.Date         = DateTime.Now;
                info.IsExist      = true;
                info.State        = 2;//isFight ? 2 : 0;
                info.ValidDate    = 0;
                if (db.AddConsortiaAlly(info, client.Player.PlayerCharacter.ID, ref msg))
                {
                    msg = isFight ? "ConsortiaAllyAddHandler.Add_Success2" : "ConsortiaAllyAddHandler.Add_Success1";

                    result = true;
                    GameServer.Instance.LoginServer.SendConsortiaAlly(info.Consortia1ID, info.Consortia2ID, info.State);
                }
            }
            packet.WriteBoolean(result);
            packet.WriteString(LanguageMgr.GetTranslation(msg));
            client.Out.SendTCP(packet);

            return(0);
        }
Exemplo n.º 26
0
        public static void ClearLoginPlayer(int playerId)
        {
            GameClient gameClient = null;
            object     locker;

            Monitor.Enter(locker = LoginMgr._locker);
            try
            {
                if (LoginMgr._players.ContainsKey(playerId))
                {
                    gameClient = LoginMgr._players[playerId];
                    LoginMgr._players.Remove(playerId);
                }
            }
            finally
            {
                Monitor.Exit(locker);
            }
            if (gameClient != null)
            {
                gameClient.Out.SendKitoff(LanguageMgr.GetTranslation("Game.Server.LoginNext", new object[0]));
                gameClient.Disconnect();
            }
        }
Exemplo n.º 27
0
        public static void ExecuteCode(GameClient client, string methodBody)
        {
            var compiler         = new DOLScriptCompiler();
            var compiledAssembly = compiler.CompileFromText(client, GetCode(methodBody));

            var methodinf = compiledAssembly.GetType("DynCode").GetMethod("DynMethod");

            try
            {
                methodinf.Invoke(null, new object[] { client.Player == null ? null : client.Player.TargetObject, client.Player });

                if (client.Player != null)
                {
                    client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "AdminCommands.Code.CodeExecuted"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
                else
                {
                    log.Debug("Code Executed.");
                }
            }
            catch (Exception ex)
            {
                if (client.Player != null)
                {
                    string[] errors = ex.ToString().Split('\n');
                    foreach (string error in errors)
                    {
                        client.Out.SendMessage(error, eChatType.CT_System, eChatLoc.CL_PopupWindow);
                    }
                }
                else
                {
                    log.Debug("Error during execution.");
                }
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// Apply the effect.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="effectiveness"></param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GamePlayer player = target as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (player.InCombat || GameRelic.IsPlayerCarryingRelic(player))
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.UseSlot.CantUseInCombat"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            SendEffectAnimation(player, 0, false, 1);

            UniPortalEffect effect = new UniPortalEffect(this, 1000);

            effect.Start(player);

            player.LeaveHouse();
            player.MoveTo((ushort)m_destination.RegionID, m_destination.X, m_destination.Y, m_destination.Z, (ushort)m_destination.Heading);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Called whenever a player enters the given area
        /// </summary>
        /// <param name="player"></param>
        public virtual void OnPlayerEnter(GamePlayer player)
        {
            if (m_displayMessage && Description != null && Description != "")
            {
                string description       = Description;
                string screenDescription = description;

                LanguageDataObject translation = LanguageMgr.GetTranslation(player.Client.Account.Language, this);
                if (translation != null)
                {
                    if (!Util.IsEmpty(((DBLanguageArea)translation).Description))
                    {
                        description = ((DBLanguageArea)translation).Description;
                    }

                    if (!Util.IsEmpty(((DBLanguageArea)translation).ScreenDescription))
                    {
                        screenDescription = ((DBLanguageArea)translation).ScreenDescription;
                    }
                }

                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractArea.Entered", description),
                                       eChatType.CT_System, eChatLoc.CL_SystemWindow);

                //Changed by Apo 9. August 2010: Areas never send an screen description, but we will support it with an server property
                if (ServerProperties.Properties.DISPLAY_AREA_ENTER_SCREEN_DESC)
                {
                    player.Out.SendMessage(screenDescription, eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
                }
            }
            if (Sound != 0)
            {
                player.Out.SendRegionEnterSound(Sound);
            }
            player.Notify(AreaEvent.PlayerEnter, this, new AreaEventArgs(this, player));
        }
Exemplo n.º 30
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int    activeID = packet.ReadInt();
            string awardID  = packet.ReadString();
            string msg      = "ActivePullDownHandler.Fail";

            using (ActiveBussiness db = new ActiveBussiness())
            {
                int result = db.PullDown(activeID, awardID, player.PlayerCharacter.ID, ref msg);
                if (result == 0)
                {
                    player.Out.SendMailResponse(player.PlayerCharacter.ID, eMailRespose.Receiver);
                }
                if (msg != "ActiveBussiness.Msg0")
                {
                    player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation(msg, new object[0]));
                }
                else
                {
                    player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(msg, new object[0]));
                }
            }
            return(0);
        }