Ejemplo n.º 1
0
        // Set the eWebDisplay status
        private void WdChange(GlobalConstants.eWebDisplay category, GamePlayer player, string state)
        {
            if (string.IsNullOrEmpty(state))
                player.DBCharacter.NotDisplayedInHerald ^= (byte)category;
            else
            {
                if (state == "off")
                    player.DBCharacter.NotDisplayedInHerald |= (byte)category;

                if (state == "on")
                    player.DBCharacter.NotDisplayedInHerald &= (byte)~category;
            }

            log.Debug("Player " + player.Name + ": WD = " + player.DBCharacter.NotDisplayedInHerald);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Artifact Magical Ability delve information (spells, procs).
        /// </summary>
        /// <param name="delve"></param>
        /// <param name="bonusID"></param>
        /// <param name="levelRequirement"></param>
        public virtual void DelveMagicalAbility(List <string> delve, ArtifactBonus.ID bonusID, int levelRequirement)
        {
            string levelTag = (levelRequirement > 0)
                ? string.Format("[L{0}]: ", levelRequirement)
                : string.Empty;

            bool isProc      = false;
            bool isSecondary = false;
            int  spellID     = 0;

            switch (bonusID)
            {
            case ArtifactBonus.ID.Spell:
                spellID     = SpellID;
                isProc      = false;
                isSecondary = false;
                break;

            case ArtifactBonus.ID.Spell1:
                spellID     = SpellID1;
                isProc      = false;
                isSecondary = true;
                break;

            case ArtifactBonus.ID.ProcSpell:
                spellID     = ProcSpellID;
                isProc      = true;
                isSecondary = false;
                break;

            case ArtifactBonus.ID.ProcSpell1:
                spellID     = ProcSpellID1;
                isProc      = true;
                isSecondary = true;
                break;
            }

            if (spellID == 0)
            {
                return;
            }

            delve.Add(string.Empty);
            delve.Add(string.Format("{0}{1}Magical Ability:", levelTag,
                                    isSecondary ? "Secondary " : string.Empty));

            SpellLine spellLine = SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects);

            if (spellLine != null)
            {
                List <Spell> spells = SkillBase.GetSpellList(spellLine.KeyName);
                foreach (Spell spell in spells)
                {
                    if (spell.ID == spellID)
                    {
                        spell.Delve(delve);
                    }
                }
            }

            if (isProc)
            {
                delve.Add(string.Format(
                              "- Spell has a chance of casting when this {0} enemy.",
                              GlobalConstants.IsWeapon(Object_Type)
                                        ? "weapon strikes an" : "armor is hit by"));
            }
            else
            {
                delve.Add("- This spell is cast when the item is used.");
            }
        }
Ejemplo n.º 3
0
        public override void SendDamageMessages(AttackData ad)
        {
            GameObject    target = ad.Target;
            InventoryItem weapon = ad.Weapon;
            GamePlayer    player = Caster as GamePlayer;

            switch (ad.AttackResult)
            {
            case GameLiving.eAttackResult.TargetNotVisible: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.NotInView", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.OutOfRange: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.TooFarAway", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.TargetDead: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.AlreadyDead", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.Blocked: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Blocked", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.Parried: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Parried", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.Evaded: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Evaded", ad.Target.GetName(0, true)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.NoTarget: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.NeedTarget"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.NoValidTarget: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.CantBeAttacked"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.Missed: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Miss"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.Fumbled: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Fumble"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); break;

            case GameLiving.eAttackResult.HitStyle:
            case GameLiving.eAttackResult.HitUnstyled:
                string modmessage = "";
                if (ad.Modifier > 0)
                {
                    modmessage = " (+" + ad.Modifier + ")";
                }
                if (ad.Modifier < 0)
                {
                    modmessage = " (" + ad.Modifier + ")";
                }

                string hitWeapon = "";

                switch (ServerProperties.Properties.SERV_LANGUAGE)
                {
                case "EN":
                    if (weapon != null)
                    {
                        hitWeapon = GlobalConstants.NameToShortName(weapon.Name);
                    }
                    break;

                case "DE":
                    if (weapon != null)
                    {
                        hitWeapon = weapon.Name;
                    }
                    break;

                default:
                    if (weapon != null)
                    {
                        hitWeapon = GlobalConstants.NameToShortName(weapon.Name);
                    }
                    break;
                }

                if (hitWeapon.Length > 0)
                {
                    hitWeapon = " " + LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.WithYour") + " " + hitWeapon;
                }

                string attackTypeMsg = LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.YouAttack");

                // intercept messages
                if (target != null && target != ad.Target)
                {
                    player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Intercepted", ad.Target.GetName(0, true), target.GetName(0, false)), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                    player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.InterceptedHit", attackTypeMsg, target.GetName(0, false), hitWeapon, ad.Target.GetName(0, false), ad.Damage, modmessage), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                }
                else
                {
                    player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.InterceptHit", attackTypeMsg, ad.Target.GetName(0, false), hitWeapon, ad.Damage, modmessage), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                }

                // critical hit
                if (ad.CriticalDamage > 0)
                {
                    player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GamePlayer.Attack.Critical", ad.Target.GetName(0, false), ad.CriticalDamage), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                }
                break;
            }
        }
Ejemplo n.º 4
0
        public void MountRelic(GameRelic relic, bool returning)
        {
            m_mountedRelic = relic;

            if (relic.CurrentCarrier != null && returning == false)
            {
                /* Sending broadcast */
                string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameRelicPad.MountRelic.Stored", relic.CurrentCarrier.Name, GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }
                    cl.Out.SendMessage(LanguageMgr.GetTranslation(cl.Account.Language, "GameRelicPad.MountRelic.Captured", GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name), eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
                NewsMgr.CreateNews(message, relic.CurrentCarrier.Realm, eNewsType.RvRGlobal, false);

                /* Increasing of CapturedRelics */
                //select targets to increase CapturedRelics
                //TODO increase stats

                List <GamePlayer> targets = new List <GamePlayer>();
                if (relic.CurrentCarrier.Group != null)
                {
                    foreach (GamePlayer p in relic.CurrentCarrier.Group.GetPlayersInTheGroup())
                    {
                        targets.Add(p);
                    }
                }
                else
                {
                    targets.Add(relic.CurrentCarrier);
                }

                foreach (GamePlayer target in targets)
                {
                    target.CapturedRelics++;
                }

                Notify(RelicPadEvent.RelicMounted, this, new RelicPadEventArgs(relic.CurrentCarrier, relic));
            }
            else
            {
                // relic returned to pad, probably because it was dropped on ground and timer expired.
                string message = string.Format("The {0} has been returned to {1}.", relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }
                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
            }
        }
        public static void Main()
        {
PlayAgain:

            //creating the first snake in the upper left corner with len of 5
            snake = new Queue <Position>();
            snake = GlobalConstants.InitializeTheSnake();

            //setting the cursor to invisible so the game looks better
            Console.CursorVisible = false;
            Console.BufferHeight  = Console.WindowHeight;

            PrintItems.PrintTheSnakeOnTheConsole(snake);

            Position nextDirection = AvaliableDirections.GetNeededPosition(ConsoleKey.RightArrow);
            Position oldDirection  = AvaliableDirections.GetNeededPosition(ConsoleKey.RightArrow);

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo currMovement = Console.ReadKey();

                    nextDirection = AvaliableDirections.GetNeededPosition(currMovement);

                    bool moveIsNotValid = PositionCheck.CheckIfTheMoveIsValid(nextDirection, oldDirection);

                    if (moveIsNotValid)
                    {
                        nextDirection = oldDirection.ToPosition();
                    }

                    oldDirection = nextDirection.ToPosition();
                }

                Console.Clear();

                bool snakeAteTheFood;
                try
                {
                    snakeAteTheFood = SnakeUpdate.UpdateTheSnake(snake, nextDirection);
                }
                catch (GameOver goe)
                {
                    PrintItems.PrintFinalMessage(goe.Message, snake);

                    goto End;
                }

                HighScoreMenager.UpdateTheCurrentScore(snake);
                PrintItems.ScoreTracker();
                PrintItems.PrintTheSnakeOnTheConsole(snake);
                PrintItems.PrintSnakeFood(snake, snakeAteTheFood);

                Thread.Sleep(ConsoleDelayControl.consoleDelay);
            }

End:

            HighScoreMenager.CheckIfThereIsANewHighscoreAndUpdate();

            bool wantsToPlayAgain = PrintItems.AnotherGameQuestion();

            if (wantsToPlayAgain)
            {
                goto PlayAgain;
            }
        }
Ejemplo n.º 6
0
 private void btnExcel_Click(object sender, EventArgs e)
 {
     GlobalConstants.ExportExcel(dgvDuLieu);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Sends a message to all players to notify them of the keep capture
        /// </summary>
        /// <param name="keep">The keep object</param>
        public static void BroadcastCapture(AbstractGameKeep keep)
        {
            string message = "";

            if (keep.Realm != eRealm.None)
            {
                message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.Captured", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
            }
            else
            {
                message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.CapturedR0", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
            }

            /*
             * switch (GameServer.Instance.Configuration.ServerType)
             * {
             *      case eGameServerType.GST_Normal:
             *              {
             *                      message = string.Format("The forces of {0} have captured {1}!", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name);
             *                      break;
             *              }
             *      case eGameServerType.GST_PvP:
             *              {
             *                      string defeatersStr = "";
             *                      message = string.Format("The forces of {0} have defeated the defenders of {1}!", defeatersStr, keep.Name);
             *                      break;
             *              }
             * }*/

            BroadcastMessage(message, eRealm.None);
            NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
        }
Ejemplo n.º 8
0
        public void resultsToFile(HashSet <string> geometryInUse, StringBuilder badGeometries, string inputSeason, GlobalConstants gc, DDebugg debug)
        {
            var pathToResults = gc.pathToResults;
            var resultFile    = $"{inputSeason.ToUpper()} - geometries.txt";
            var badFileName   = $"MissingThumbs - {inputSeason.ToUpper()}.txt";

            StringBuilder result = new StringBuilder();

            foreach (var geometry in geometryInUse)
            {
                result.AppendLine(geometry);
            }

            File.WriteAllText(pathToResults + resultFile, result.ToString());

            File.WriteAllText(pathToResults + badFileName, badGeometries.ToString());
        }
Ejemplo n.º 9
0
        public void OnCommand(GameClient client, string[] args)
        {
            if (args.Length < 2)
            {
                DisplaySyntax(client);
                return;
            }

            try
            {
                #region List
                if (args[1].ToLower() == "list")
                {
                    List <string> list  = new List <string>();
                    int           count = 0;
                    foreach (int value in Enum.GetValues(typeof(eCraftingSkill)))
                    {
                        if (++count < 16)                         // get rid of duplicate due to _Last
                        {
                            list.Add(value + " = " + Enum.GetName(typeof(eCraftingSkill), value));
                        }
                    }

                    client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.SkillDescription"), list);
                    return;
                }
                #endregion List

                #region Salvage

                if (args[1].ToLower() == "salvageinfo")
                {
                    List <string> list      = new List <string>();
                    int           salvageID = Convert.ToInt32(args[2]);
                    SalvageYield  salvage   = GameServer.Database.SelectObject <SalvageYield>("ID=" + salvageID);

                    if (salvage == null)
                    {
                        DisplayMessage(client, "SalvageYield ID not found!");
                        return;
                    }

                    ItemTemplate template     = GameServer.Database.FindObjectByKey <ItemTemplate>(salvage.MaterialId_nb);
                    string       materialName = "Not Found!";

                    if (template != null)
                    {
                        materialName = template.Name;
                    }

                    list.Add("SalvageYield ID: " + salvageID);
                    list.Add("     ObjectType: " + (salvage.ObjectType == 0 ? "Unused" : salvage.ObjectType.ToString()));
                    list.Add("   SalvageLevel: " + (salvage.SalvageLevel == 0 ? "Unused" : salvage.SalvageLevel.ToString()));
                    list.Add("       Material: " + materialName + " (" + salvage.MaterialId_nb + ")");
                    list.Add("          Count: " + (salvage.Count == 0 ? "Calculated" : salvage.Count.ToString()));
                    list.Add("          Realm: " + (salvage.Realm == 0 ? "Any" : GlobalConstants.RealmToName((eRealm)salvage.Realm)));
                    list.Add("      PackageID: " + salvage.PackageID);

                    client.Out.SendCustomTextWindow("SalvageYield ID " + salvageID, list);
                    return;
                }

                if (args[1].ToLower() == "salvageadd" || args[1].ToLower() == "salvageupdate")
                {
                    try
                    {
                        int    salvageID = Convert.ToInt32(args[2]);
                        string material  = args[3];
                        int    count     = Convert.ToInt32(args[4]);
                        byte   realm     = 0;
                        string package   = "";

                        if (args.Length > 5)
                        {
                            realm = Convert.ToByte(args[5]);
                        }

                        if (args.Length > 6)
                        {
                            package = args[6];
                        }

                        ItemTemplate template = GameServer.Database.FindObjectByKey <ItemTemplate>(material);

                        if (template == null)
                        {
                            DisplayMessage(client, "Material id_nb " + material + " not found!");
                            return;
                        }

                        SalvageYield salvage = GameServer.Database.SelectObject <SalvageYield>("ID=" + salvageID);

                        if (args[1].ToLower() == "salvageadd")
                        {
                            if (salvage != null)
                            {
                                DisplayMessage(client, "This SalvageYield ID already exists, use salvageupdate to change it.");
                                return;
                            }

                            salvage = new SalvageYield();
                            if (salvageID > 0)
                            {
                                salvage.ID = salvageID;
                            }

                            salvage.MaterialId_nb = material;
                            salvage.Count         = Math.Max(1, count);
                            salvage.Realm         = realm;

                            if (package == "")
                            {
                                package = client.Player.Name;
                            }

                            salvage.PackageID = package;

                            GameServer.Database.AddObject(salvage);

                            DisplayMessage(client, string.Format("Created SalvageYield ID: {0}, Material: {1}, Count: {2}, Realm: {3}, PackageID: {4}",
                                                                 salvage.ID, salvage.MaterialId_nb, salvage.Count, salvage.Realm, salvage.PackageID));
                        }
                        else
                        {
                            if (salvage == null)
                            {
                                DisplayMessage(client, "SalvageID not found!");
                                return;
                            }

                            if (salvage.PackageID == SalvageYield.LEGACY_SALVAGE_ID)
                            {
                                DisplayMessage(client, "This SalvageYield ID is used for legacy salvage support and can not be updated.");
                                return;
                            }

                            salvage.MaterialId_nb = material;
                            salvage.Count         = Math.Max(1, count);
                            salvage.Realm         = realm;

                            if (string.IsNullOrEmpty(salvage.PackageID) && package == "")
                            {
                                package = client.Player.Name;
                            }

                            if (package != "")
                            {
                                salvage.PackageID = package;
                            }

                            GameServer.Database.SaveObject(salvage);

                            DisplayMessage(client, string.Format("Updated SalvageYield ID: {0}, Material: {1}, Count: {2}, Realm: {3}, PackageID: {4}",
                                                                 salvage.ID, salvage.MaterialId_nb, salvage.Count, salvage.Realm, salvage.PackageID));
                        }
                    }
                    catch
                    {
                        DisplaySyntax(client);
                    }

                    return;
                }

                #endregion Salvage

                GamePlayer target = null;
                if ((client.Player.TargetObject != null) && (client.Player.TargetObject is GamePlayer))
                {
                    target = client.Player.TargetObject as GamePlayer;
                }
                else
                {
                    DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.NoPlayerTarget"));
                    return;
                }

                switch (args[1].ToLower())
                {
                    #region Add
                case "add":
                {
                    eCraftingSkill craftingSkillID = eCraftingSkill.NoCrafting;
                    int            startLevel      = 1;
                    try
                    {
                        craftingSkillID = (eCraftingSkill)Convert.ToUInt16(args[2]);
                        if (args.Length > 3)
                        {
                            startLevel = Convert.ToUInt16(args[3]);
                        }

                        AbstractCraftingSkill skill = CraftingMgr.getSkillbyEnum(craftingSkillID);
                        if (skill == null)
                        {
                            DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.InvalidSkill"));
                        }
                        else
                        {
                            if (target.AddCraftingSkill(craftingSkillID, startLevel))
                            {
                                target.Out.SendUpdateCraftingSkills();
                                target.SaveIntoDatabase();
                                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.SkillAdded", skill.Name));
                            }
                            else
                            {
                                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.AlreadyHaveSkill", target.Name, skill.Name));
                            }
                        }
                    }
                    catch (Exception)
                    {
                        DisplaySyntax(client);
                    }
                    break;
                }

                    #endregion Add
                    #region Change
                case "change":
                {
                    eCraftingSkill craftingSkillID = eCraftingSkill.NoCrafting;
                    int            amount          = 1;
                    try
                    {
                        craftingSkillID = (eCraftingSkill)Convert.ToUInt16(args[2]);

                        if (args.Length > 3)
                        {
                            amount = Convert.ToInt32(args[3]);
                        }

                        AbstractCraftingSkill skill = CraftingMgr.getSkillbyEnum(craftingSkillID);
                        if (skill == null)
                        {
                            DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.InvalidSkill"));
                        }
                        else
                        {
                            if (target.GetCraftingSkillValue(craftingSkillID) < 0)
                            {
                                DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.NotHaveSkillAddIt", target.Name, skill.Name));
                                return;
                            }

                            if (amount > 0)
                            {
                                target.GainCraftingSkill(craftingSkillID, amount);
                            }
                            else
                            {
                                target.CraftingSkills[craftingSkillID] += amount;
                            }
                            target.Out.SendUpdateCraftingSkills();
                            target.SaveIntoDatabase();
                            DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.SkillChanged", skill.Name));
                            DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Crafting.NowHasSkillPoints", target.Name, target.GetCraftingSkillValue(craftingSkillID), (eCraftingSkill)craftingSkillID));
                        }
                    }
                    catch (Exception)
                    {
                        DisplaySyntax(client);
                        return;
                    }
                    break;
                }

                    #endregion Change
                    #region Default
                default:
                {
                    DisplaySyntax(client);
                    break;
                }
                    #endregion Default
                }
            }
            catch
            {
                DisplaySyntax(client);
            }
        }
Ejemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     DontDestroyOnLoad(this);
     instance = this;
     Client   = new DiscordRpcClient("my_client_id");
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Check if the player can enchant the item
        /// </summary>
        /// <param name="player"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public virtual bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
        {
            if (item == null)
            {
                return(false);
            }

            if (player.TradeWindow.ItemsCount <= 0)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.Imbue", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return(false);
            }

            if (!item.IsCrafted)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.CraftedItems"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return(false);
            }


            InventoryItem itemToCombine = (InventoryItem)player.TradeWindow.TradeItems[0];

            if (itemToCombine.Object_Type == (int)eObjectType.AlchemyTincture)
            {
                if (item.Object_Type != (int)eObjectType.Instrument) // Only check for non instruments
                {
                    switch (itemToCombine.Type_Damage)
                    {
                    case 0:     //Type damage 0 = armors
                        if (!GlobalConstants.IsArmor(item.Object_Type))
                        {
                            if (item.Object_Type == (int)eObjectType.Shield)     // think shield can do armor and weapon ? not verified.
                            {
                                return(true);
                            }

                            player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.NoGoodCombine"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            return(false);
                        }
                        break;

                    case 1:     //Type damage 1 = weapons
                        if (!GlobalConstants.IsWeapon(item.Object_Type))
                        {
                            player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.NoGoodCombine"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            return(false);
                        }
                        break;

                    default:
                        player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.ProblemCombine"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return(false);
                    }
                }
                else // Instrument
                {
                    if (itemToCombine.Type_Damage != 0) //think instrument can do only armorproc ? not verified.
                    {
                        player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.NoGoodCombine"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        return(false);
                    }
                }
            }

            if (!GlobalConstants.IsArmor(item.Object_Type) && !GlobalConstants.IsWeapon(item.Object_Type) && item.Object_Type != (int)eObjectType.Instrument)
            {
                player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AdvancedCraftingSkill.IsAllowedToCombine.NoEnchanted"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 12
0
        /*          Relic status
         *
         * Albion Relics:
         * Strength: OwnerRealm
         * Power: OwnerRealm
         *
         * Midgard Relics:
         * Strength: OwnerRealm
         * Power: OwnerRealm
         *
         * Hibernia Relics:
         * Strength: OwnerRealm
         * Power: OwnerRealm
         *
         * Use '/realm' for Realm Info.
         */

        public void OnCommand(GameClient client, string[] args)
        {
            if (IsSpammingCommand(client.Player, "relic"))
            {
                return;
            }

            string albStr = "", albPwr = "", midStr = "", midPwr = "", hibStr = "", hibPwr = "";
            var    relicInfo = new List <string>();

            #region Reformat Relics  '[Type]: [OwnerRealm]'
            foreach (GameRelic relic in RelicMgr.getNFRelics())
            {
                switch (relic.OriginalRealm)
                {
                case eRealm.Albion:
                {
                    if (relic.RelicType == eRelicType.Strength)
                    {
                        albStr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Strength") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    if (relic.RelicType == eRelicType.Magic)
                    {
                        albPwr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Power") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    break;
                }

                case eRealm.Midgard:
                {
                    if (relic.RelicType == eRelicType.Strength)
                    {
                        midStr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Strength") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    if (relic.RelicType == eRelicType.Magic)
                    {
                        midPwr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Power") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    break;
                }

                case eRealm.Hibernia:
                {
                    if (relic.RelicType == eRelicType.Strength)
                    {
                        hibStr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Strength") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    if (relic.RelicType == eRelicType.Magic)
                    {
                        hibPwr = LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Power") + ": " + GlobalConstants.RealmToName(relic.Realm);
                    }
                    break;
                }
                }
            }
            #endregion

            relicInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.AlbRelics") + ":");
            relicInfo.Add(albStr);
            relicInfo.Add(albPwr);
            relicInfo.Add("");
            relicInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.MidRelics") + ":");
            relicInfo.Add(midStr);
            relicInfo.Add(midPwr);
            relicInfo.Add("");
            relicInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.HibRelics") + ":");
            relicInfo.Add(hibStr);
            relicInfo.Add(hibPwr);
            relicInfo.Add("");
            relicInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.UseRealmCommand"));

            client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Relic.Title"), relicInfo);
        }
Ejemplo n.º 13
0
        public override IList GetExamineMessages(GamePlayer player)
        {
            IList messages = base.GetExamineMessages(player);

            messages.Add(IsMounted ? ("It is owned by " + ((player.Realm == Realm) ? "your realm" : GlobalConstants.RealmToName((eRealm)Realm)) + ".") : "It is without owner, take it!");
            return(messages);
        }
Ejemplo n.º 14
0
        public override bool CheckBeginCast(GameLiving selectedTarget)
        {
            if (m_caster.ObjectState != GameLiving.eObjectState.Active)
            {
                return(false);
            }
            if (!m_caster.IsAlive)
            {
                MessageToCaster("You are dead and can't cast!", eChatType.CT_System);
                return(false);
            }

            // Is PS ?
            GameSpellEffect Phaseshift = SpellHandler.FindEffectOnTarget(Caster, "Phaseshift");

            if (Phaseshift != null && (Spell.InstrumentRequirement == 0 || Spell.SpellType == "Mesmerize"))
            {
                MessageToCaster("You're phaseshifted and can't cast a spell", eChatType.CT_System);
                return(false);
            }

            // Is Shield Disarm ?
            ShieldTripDisarmEffect shieldDisarm = Caster.EffectList.GetOfType <ShieldTripDisarmEffect>();

            if (shieldDisarm != null)
            {
                MessageToCaster("You're disarmed and can't cast a spell", eChatType.CT_System);
                return(false);
            }

            // Is Mentalist RA5L ?
            SelectiveBlindnessEffect SelectiveBlindness = Caster.EffectList.GetOfType <SelectiveBlindnessEffect>();

            if (SelectiveBlindness != null)
            {
                GameLiving EffectOwner = SelectiveBlindness.EffectSource;
                if (EffectOwner == selectedTarget)
                {
                    if (m_caster is GamePlayer)
                    {
                        ((GamePlayer)m_caster).Out.SendMessage(string.Format("{0} is invisible to you!", selectedTarget.GetName(0, true)), eChatType.CT_Missed, eChatLoc.CL_SystemWindow);
                    }

                    return(false);
                }
            }

            // Is immune ?
            if (selectedTarget != null && selectedTarget.HasAbility("DamageImmunity"))
            {
                MessageToCaster(selectedTarget.Name + " is immune to this effect!", eChatType.CT_SpellResisted);
                return(false);
            }

            if (m_caster.IsSitting)
            {
                MessageToCaster("You can't cast while sitting!", eChatType.CT_SpellResisted);
                return(false);
            }
            if (m_spell.RecastDelay > 0)
            {
                int left = m_caster.GetSkillDisabledDuration(m_spell);
                if (left > 0)
                {
                    MessageToCaster("You must wait " + (left / 1000 + 1).ToString() + " seconds to use this spell!", eChatType.CT_System);
                    return(false);
                }
            }
            String targetType = m_spell.Target.ToLower();

            if (targetType == "area")
            {
                if (!m_caster.IsWithinRadius(m_caster.GroundTarget.Value, CalculateSpellRange()))
                {
                    MessageToCaster("Your area target is out of range.  Select a closer target.", eChatType.CT_SpellResisted);
                    return(false);
                }
            }

            if (targetType == "enemy")
            {
                if (m_caster.IsObjectInFront(selectedTarget, 180) == false)
                {
                    MessageToCaster("Your target is not in view!", eChatType.CT_SpellResisted);
                    Caster.Notify(GameLivingEvent.CastFailed, new CastFailedEventArgs(this, CastFailedEventArgs.Reasons.TargetNotInView));
                    return(false);
                }

                if (m_caster.TargetInView == false)
                {
                    MessageToCaster("Your target is not visible!", eChatType.CT_SpellResisted);
                    Caster.Notify(GameLivingEvent.CastFailed, new CastFailedEventArgs(this, CastFailedEventArgs.Reasons.TargetNotInView));
                    return(false);
                }
            }

            if (Caster != null && Caster is GamePlayer && Caster.AttackWeapon != null && GlobalConstants.IsBowWeapon((eObjectType)Caster.AttackWeapon.Object_Type))
            {
                if (Spell.LifeDrainReturn == (int)eShotType.Critical && (!(Caster.IsStealthed)))
                {
                    MessageToCaster("You must be stealthed and wielding a bow to use this ability!", eChatType.CT_SpellResisted);
                    return(false);
                }

                return(true);
            }
            else
            {
                if (Spell.LifeDrainReturn == (int)eShotType.Critical)
                {
                    MessageToCaster("You must be stealthed and wielding a bow to use this ability!", eChatType.CT_SpellResisted);
                    return(false);
                }

                MessageToCaster("You must be wielding a bow to use this ability!", eChatType.CT_SpellResisted);
                return(false);
            }
        }
Ejemplo n.º 15
0
        public static Guild CreateGuild(eRealm realm, string guildName, GamePlayer creator = null)
        {
            if (DoesGuildExist(guildName))
            {
                if (creator != null)
                {
                    creator.Out.SendMessage(guildName + " already exists!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                return(null);
            }

            try
            {
                DBGuild dbGuild = new DBGuild();
                dbGuild.GuildName = guildName;
                dbGuild.GuildID   = System.Guid.NewGuid().ToString();
                dbGuild.Realm     = (byte)realm;
                Guild newguild = new Guild(dbGuild);
                if (newguild.AddToDatabase() == false)
                {
                    if (creator != null)
                    {
                        creator.Out.SendMessage("Database error, unable to add a new guild!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                    return(null);
                }
                AddGuild(newguild);
                CreateRanks(newguild);

                if (log.IsDebugEnabled)
                {
                    log.Debug("Create guild; guild name=\"" + guildName + "\" Realm=" + GlobalConstants.RealmToName(newguild.Realm));
                }

                return(newguild);
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("CreateGuild", e);
                }
                return(null);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Change location on character creation
        /// </summary>
        public static void CharacterCreation(DOLEvent ev, object sender, EventArgs args)
        {
            CharacterEventArgs chArgs = args as CharacterEventArgs;

            if (chArgs == null)
            {
                return;
            }
            DOLCharacters ch = chArgs.Character;

            try
            {
                StartLocation   startLocation     = null;
                GameClient      client            = chArgs.GameClient;
                StartupLocation dbStartupLocation = null;

                // do we have custom locations in the DB ?
                if (ServerProperties.Properties.USE_CUSTOM_START_LOCATIONS)
                {
                    // First try to find an ALL entry
                    var startupLocations = GameServer.Database.SelectObjects <StartupLocation>("ClassIDs = 'ALL'");
                    if (startupLocations.Count > 0)
                    {
                        dbStartupLocation = startupLocations[0];
                    }
                    else
                    {
                        // find realm-based SL
                        startupLocations = GameServer.Database.SelectObjects <StartupLocation>("ClassIDs LIKE '%" + GlobalConstants.RealmToName((eRealm)ch.Realm).Substring(0, 3) + "%'");
                        if (startupLocations.Count > 0)
                        {
                            dbStartupLocation = startupLocations[0];
                        }
                        else
                        {
                            // find class-based SL
                            startupLocations = GameServer.Database.SelectObjects <StartupLocation>("ClassIDs LIKE '%" + ch.Class + "%'");
                            foreach (var curSL in startupLocations)
                            {
                                foreach (var classID in curSL.ClassIDs.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                                {
                                    int charClass = 0;
                                    int.TryParse(classID, out charClass);
                                    if (charClass == ch.Class)
                                    {
                                        dbStartupLocation = curSL;
                                        break;
                                    }
                                }
                                if (dbStartupLocation != null)
                                {
                                    break;
                                }
                            }
                        }
                    }

                    // fill loc with our found SL
                    if (dbStartupLocation != null)
                    {
                        startLocation = new StartLocation(dbStartupLocation.XPos, dbStartupLocation.YPos, dbStartupLocation.ZPos, dbStartupLocation.Heading);
                        ch.Region     = dbStartupLocation.Region;
                    }
                }

                // no custom SL or custom SL not found
                if (dbStartupLocation == null)
                {
                    // tutorial all realms use the same region
                    // except if disabled in SP, v1.93+ start is in tutorial zone
                    if ((ch.Region == 27 || (int)client.Version >= (int)GameClient.eClientVersion.Version193) && !ServerProperties.Properties.DISABLE_TUTORIAL)
                    {
                        switch (ch.Realm)
                        {
                        case 1:                                 // alb
                            startLocation = new StartLocation(95638, 101322, 5340, 998);
                            break;

                        case 2:                                 // mid
                            startLocation = new StartLocation(226716, 232385, 5340, 1024);
                            break;

                        case 3:                                 // hib
                            startLocation = new StartLocation(357788, 363457, 5340, 1024);
                            break;
                        }
                    }
                    else if ((int)client.Version >= (int)GameClient.eClientVersion.Version193)
                    {
                        // no base classes, so we choose a common startuplocation per realm
                        switch (ch.Realm)
                        {
                        case 1:                                 // alb
                            startLocation = new StartLocation(562418, 512268, 2500, 2980);
                            break;

                        case 2:                                 // mid
                            startLocation = new StartLocation(802869, 726016, 4699, 1399);
                            break;

                        case 3:                                 // hib
                            startLocation = new StartLocation(347279, 489681, 5200, 2332);
                            break;
                        }
                    }
                    else if ((int)client.Version >= (int)GameClient.eClientVersion.Version180)
                    {
                        startLocation = (StartLocation)MainTownStartingLocations[ch.Class];
                    }
                    else if (ch.Region == 1 || ch.Region == 100 || ch.Region == 200)                     // all classic regions
                    {
                        startLocation = (StartLocation)ClassicLocations[ch.Race][ch.Class];
                    }
                    else if (ch.Region == 51 || ch.Region == 151 || ch.Region == 181)                     // all ShroudedIsles regions
                    {
                        startLocation = (StartLocation)ShroudedIslesLocations[ch.Race][ch.Class];
                    }
                    else
                    {
                        log.DebugFormat("tried to create char in unknown region {0}", ch.Region);
                        switch (ch.Realm)
                        {
                        default: ch.Region = 1; break;

                        case 2: ch.Region = 100; break;

                        case 3: ch.Region = 200; break;
                        }
                        startLocation = (StartLocation)ClassicLocations[ch.Race][ch.Class];
                    }
                }

                if (startLocation == null)
                {
                    log.Warn("startup location not found: account=" + ch.AccountName + "; char name=" + ch.Name + "; region=" + ch.Region + "; realm=" + ch.Realm + "; class=" + ch.Class + " (" + (eCharacterClass)ch.Class + "); race=" + ch.Race + " (" + (eRace)ch.Race + ")");
                }
                else
                {
                    ch.Xpos      = startLocation.X;
                    ch.Ypos      = startLocation.Y;
                    ch.Zpos      = startLocation.Z;
                    ch.Direction = startLocation.Heading;
                }

                BindCharacter(ch);
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("StartupLocations script: error changing location. account=" + ch.AccountName + "; char name=" + ch.Name + "; region=" + ch.Region + "; realm=" + ch.Realm + "; class=" + ch.Class + " (" + (eCharacterClass)ch.Class + "); race=" + ch.Race + " (" + (eRace)ch.Race + ")", e);
                }
            }
        }
Ejemplo n.º 17
0
        public string TransferIfAllFalse(string inputGarment, string frontSide, string backSide, string extension,
                                         string thumbnailsFolder, string destinationPath, int thumbsCopied, int thumbsNon, StringBuilder badGeometries,
                                         List <string> collectedPaths, HashSet <string> geometryInUse, string inputSeason, GlobalConstants gc, DDebugg debug, printAndExport printExport)
        {
            thumbsCopied = 0;
            thumbsNon    = 0;
            bool isEnd;

            Console.WriteLine();
            Console.WriteLine("Insert garment code: ");

            while (true)
            {
                inputGarment = Console.ReadLine().ToUpper();

                //search for end variable
                isEnd = inputGarment == "END!" ? true : false;

                //if input is end! then break
                if (isEnd == true)
                {
                    break;
                }

                string splitThumbCounts = TransferCopies(inputGarment, frontSide, backSide, extension, thumbnailsFolder,
                                                         destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths);

                var split = splitThumbCounts
                            .Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                            .Select(int.Parse)
                            .ToArray();

                thumbsCopied += split[0];
                thumbsNon    += split[1];
            }

            //print STATISTICS
            printExport.resultsToFile(geometryInUse, badGeometries, inputSeason, gc, debug);
            string result = printExport.printResults(thumbsCopied, thumbsNon, badGeometries, geometryInUse);

            return(result);
        }
Ejemplo n.º 18
0
            protected override void OnTick()
            {
                GameLiving target = m_arrowTarget;
                GameLiving caster = (GameLiving)m_actionSource;

                if (target == null || !target.IsAlive || target.ObjectState != GameObject.eObjectState.Active || target.CurrentRegionID != caster.CurrentRegionID)
                {
                    return;
                }

                int missrate = 100 - m_handler.CalculateToHitChance(target);
                // add defence bonus from last executed style if any
                AttackData targetAD = (AttackData)target.TempProperties.getProperty <object>(GameLiving.LAST_ATTACK_DATA, null);

                if (targetAD != null &&
                    targetAD.AttackResult == GameLiving.eAttackResult.HitStyle &&
                    targetAD.Style != null)
                {
                    missrate += targetAD.Style.BonusToDefense;
                }

                // half of the damage is magical
                // subtract any spelldamage bonus and re-calculate after half damage is calculated
                AttackData ad = m_handler.CalculateDamageToTarget(target, 0.5 - (caster.GetModified(eProperty.SpellDamage) * 0.01));

                // check for bladeturn miss
                if (ad.AttackResult == GameLiving.eAttackResult.Missed)
                {
                    return;
                }

                if (Util.Chance(missrate))
                {
                    ad.AttackResult = GameLiving.eAttackResult.Missed;
                    m_handler.MessageToCaster("You miss!", eChatType.CT_YouHit);
                    m_handler.MessageToLiving(target, caster.GetName(0, false) + " missed!", eChatType.CT_Missed);
                    target.OnAttackedByEnemy(ad);
                    target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, caster);
                    if (target is GameNPC)
                    {
                        IOldAggressiveBrain aggroBrain = ((GameNPC)target).Brain as IOldAggressiveBrain;
                        if (aggroBrain != null)
                        {
                            aggroBrain.AddToAggroList(caster, 1);
                        }
                    }
                    return;
                }

                ad.Damage = (int)((double)ad.Damage * (1.0 + caster.GetModified(eProperty.SpellDamage) * 0.01));

                bool arrowBlock = false;

                if (target is GamePlayer && !target.IsStunned && !target.IsMezzed && !target.IsSitting && m_handler.Spell.LifeDrainReturn != (int)Archery.eShotType.Critical)
                {
                    GamePlayer    player   = (GamePlayer)target;
                    InventoryItem lefthand = player.Inventory.GetItem(eInventorySlot.LeftHandWeapon);
                    if (lefthand != null && (player.AttackWeapon == null || player.AttackWeapon.Item_Type == Slot.RIGHTHAND || player.AttackWeapon.Item_Type == Slot.LEFTHAND))
                    {
                        if (target.IsObjectInFront(caster, 180) && lefthand.Object_Type == (int)eObjectType.Shield)
                        {
                            // TODO: shield size vs number of attackers not calculated
                            double shield      = 0.5 * player.GetModifiedSpecLevel(Specs.Shields);
                            double blockchance = ((player.Dexterity * 2) - 100) / 40.0 + shield + (0 * 3) + 5;
                            blockchance += 30;
                            blockchance -= target.GetConLevel(caster) * 5;
                            if (blockchance >= 100)
                            {
                                blockchance = 99;
                            }
                            if (blockchance <= 0)
                            {
                                blockchance = 1;
                            }

                            if (target.IsEngaging)
                            {
                                EngageEffect engage = target.EffectList.GetOfType <EngageEffect>();
                                if (engage != null && target.AttackState && engage.EngageTarget == caster)
                                {
                                    // Engage raised block change to 85% if attacker is engageTarget and player is in attackstate
                                    // You cannot engage a mob that was attacked within the last X seconds...
                                    if (engage.EngageTarget.LastAttackedByEnemyTick > engage.EngageTarget.CurrentRegion.Time - EngageAbilityHandler.ENGAGE_ATTACK_DELAY_TICK)
                                    {
                                        if (engage.Owner is GamePlayer)
                                        {
                                            (engage.Owner as GamePlayer).Out.SendMessage(engage.EngageTarget.GetName(0, true) + " has been attacked recently and you are unable to engage.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                                        }
                                    }                                      // Check if player has enough endurance left to engage
                                    else if (engage.Owner.Endurance < EngageAbilityHandler.ENGAGE_DURATION_LOST)
                                    {
                                        engage.Cancel(false);                                         // if player ran out of endurance cancel engage effect
                                    }
                                    else
                                    {
                                        engage.Owner.Endurance -= EngageAbilityHandler.ENGAGE_DURATION_LOST;
                                        if (engage.Owner is GamePlayer)
                                        {
                                            (engage.Owner as GamePlayer).Out.SendMessage("You concentrate on blocking the blow!", eChatType.CT_Skill, eChatLoc.CL_SystemWindow);
                                        }

                                        if (blockchance < 85)
                                        {
                                            blockchance = 85;
                                        }
                                    }
                                }
                            }

                            if (blockchance >= Util.Random(1, 100))
                            {
                                arrowBlock = true;
                                m_handler.MessageToLiving(player, "You block " + caster.GetName(0, false) + "'s arrow!", eChatType.CT_System);
                                if (m_handler.Spell.Target.ToLower() != "area")
                                {
                                    m_handler.MessageToCaster(player.GetName(0, true) + " blocks your arrow!", eChatType.CT_System);
                                    m_handler.DamageTarget(ad, false, 0x02);
                                }
                            }
                        }
                    }
                }

                if (arrowBlock == false)
                {
                    // now calculate the magical part of arrow damage (similar to bolt calculation).  Part 1 Physical, Part 2 Magical

                    double damage = m_handler.Spell.Damage / 2;                     // another half is physical damage
                    if (target is GamePlayer)
                    {
                        ad.ArmorHitLocation = ((GamePlayer)target).CalculateArmorHitLocation(ad);
                    }

                    InventoryItem armor = null;
                    if (target.Inventory != null)
                    {
                        armor = target.Inventory.GetItem((eInventorySlot)ad.ArmorHitLocation);
                    }

                    double ws = (caster.Level * 8 * (1.0 + (caster.GetModified(eProperty.Dexterity) - 50) / 200.0));

                    damage     *= ((ws + 90.68) / (target.GetArmorAF(ad.ArmorHitLocation) + 20 * 4.67));
                    damage     *= 1.0 - Math.Min(0.85, ad.Target.GetArmorAbsorb(ad.ArmorHitLocation));
                    ad.Modifier = (int)(damage * (ad.Target.GetResist(ad.DamageType) + SkillBase.GetArmorResist(armor, ad.DamageType)) / -100.0);
                    damage     += ad.Modifier;

                    double effectiveness = caster.Effectiveness;
                    effectiveness += (caster.GetModified(eProperty.SpellDamage) * 0.01);
                    damage         = damage * effectiveness;

                    damage *= (1.0 + RelicMgr.GetRelicBonusModifier(caster.Realm, eRelicType.Magic));

                    if (damage < 0)
                    {
                        damage = 0;
                    }

                    ad.Damage += (int)damage;

                    if (caster.AttackWeapon != null)
                    {
                        // Quality
                        ad.Damage -= (int)(ad.Damage * (100 - caster.AttackWeapon.Quality) * .01);

                        // Condition
                        ad.Damage = (int)((double)ad.Damage * Math.Min(1.0, (double)caster.AttackWeapon.Condition / (double)caster.AttackWeapon.MaxCondition));

                        // Patch Note:  http://support.darkageofcamelot.com/kb/article.php?id=931
                        // - The Damage Per Second (DPS) of your bow will have an effect on your damage for archery shots. If the effective DPS
                        //   of your equipped bow is less than that of your max DPS for the level of archery shot you are using, the damage of your
                        //   shot will be reduced. Max DPS for a particular level can be found by using this equation: (.3 * level) + 1.2

                        int spellRequiredDPS = 12 + 3 * m_handler.Spell.Level;

                        if (caster.AttackWeapon.DPS_AF < spellRequiredDPS)
                        {
                            double percentReduction = (double)caster.AttackWeapon.DPS_AF / (double)spellRequiredDPS;
                            ad.Damage = (int)(ad.Damage * percentReduction);
                        }
                    }

                    if (ad.Damage < 0)
                    {
                        ad.Damage = 0;
                    }

                    ad.UncappedDamage = ad.Damage;
                    ad.Damage         = (int)Math.Min(ad.Damage, m_handler.DamageCap(effectiveness));

                    if (ad.CriticalDamage > 0)
                    {
                        if (m_handler.Spell.Target.ToLower() == "area")
                        {
                            ad.CriticalDamage = 0;
                        }
                        else
                        {
                            int critMax = (target is GamePlayer) ? ad.Damage / 2 : ad.Damage;
                            ad.CriticalDamage = Util.Random(critMax / 10, critMax);
                        }
                    }

                    target.ModifyAttack(ad);

                    m_handler.SendDamageMessages(ad);
                    m_handler.DamageTarget(ad, false, 0x14);
                    target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, caster);
                }


                if (m_handler.Spell.SubSpellID != 0)
                {
                    Spell subspell = SkillBase.GetSpellByID(m_handler.Spell.SubSpellID);
                    if (subspell != null)
                    {
                        subspell.Level = m_handler.Spell.Level;
                        ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_handler.Caster, subspell, SkillBase.GetSpellLine(GlobalSpellsLines.Combat_Styles_Effect));
                        if (spellhandler != null)
                        {
                            spellhandler.StartSpell(target);
                        }
                    }
                }

                if (arrowBlock == false && m_handler.Caster.AttackWeapon != null && GlobalConstants.IsBowWeapon((eObjectType)m_handler.Caster.AttackWeapon.Object_Type))
                {
                    if (ad.AttackResult == GameLiving.eAttackResult.HitUnstyled || ad.AttackResult == GameLiving.eAttackResult.HitStyle)
                    {
                        caster.CheckWeaponMagicalEffect(ad, m_handler.Caster.AttackWeapon);
                    }
                }
            }
Ejemplo n.º 19
0
        public void Run()
        {
            GlobalConstants gc          = new GlobalConstants();
            DDebugg         debug       = new DDebugg();
            printAndExport  printExport = new printAndExport();

            Console.WriteLine("........................");
            Console.WriteLine("....THUMBS COLLECTOR....");
            Console.WriteLine("........................");
            Console.WriteLine();

            Console.Write("SEASON :");
            Console.WriteLine();

            getInfo getSeasonalInfo = new getInfo();
            string  inputSeason     = getSeasonalInfo.currentSeason();

            Validator validator = new Validator(inputSeason);

            inputSeason = validator.ValidateSeason();
            string validationPattern = validator.Pattern();

            //get allfiles and used geometries
            var allFilesPsd = getSeasonalInfo
                              .GetAllFilesParralelAsync(gc.psdExtension, gc.MenWomen, gc.YoungAthletes, gc.PlusSize); //psd search

            var allFilesJpg = getSeasonalInfo
                              .GetAllFilesParralelAsync(gc.jpgExtension, gc.MenWomen, gc.YoungAthletes, gc.PlusSize); //jpg search

            //main thumbs folder
            string thumbnailsFolder = gc.thumbnailsFolder;

            //enter directory where you want to save thumbs
            Console.WriteLine();
            Console.WriteLine("Please enter directory to save thumbs:".ToUpper());
            string destinationPath = getSeasonalInfo.DestinationTo();

            Console.WriteLine();
            Console.WriteLine($"DO YOU WANT TO COLLECT ALL \"{inputSeason}\" THUMBNAILS? (ALL / N)");
            var isAllThumbs = getSeasonalInfo.isApproved();

            var geometryInUse = getSeasonalInfo.GeometryInUse(allFilesPsd, validationPattern);

            string frontSide    = gc.frontSide;
            string backSide     = gc.backSide;
            string pngExtension = gc.pngExtension;

            string[] allowedExtensions = gc.allowedExtensions;
            int      thumbsCopied      = 0;
            int      thumbsNon         = 0;

            ////Scan thumbs folder
            List <string> collectedPaths = getSeasonalInfo.ScanThumbsFolder(thumbnailsFolder, allowedExtensions);
            StringBuilder badGeometries  = new StringBuilder();

            string inputGarment = "";

            if (isAllThumbs)
            {
                Console.WriteLine(TransferIfAll(inputGarment, frontSide, backSide, pngExtension, thumbnailsFolder,
                                                destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths, geometryInUse,
                                                inputSeason, gc, debug, printExport));
            }

            if (isAllThumbs == false)
            {
                Console.WriteLine(TransferIfAllFalse(inputGarment, frontSide, backSide, pngExtension, thumbnailsFolder,
                                                     destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths, geometryInUse,
                                                     inputSeason, gc, debug, printExport));
            }

            Console.WriteLine();
            Console.WriteLine($"DO YOU WANT TO GENERATE A LIST OF GEOEMETRIES/SKUS USED BY {inputSeason} ?: (Y / N)");
            var isGenerate = getSeasonalInfo.isApproved();

            if (isGenerate)
            {
                Stopwatch sw = new Stopwatch();
                sw.Start();
                Console.WriteLine($"GENERATING LIST...");

                while (true)
                {
                    if (allFilesJpg.IsCompleted == false)
                    {
                        continue;
                    }

                    break;
                }

                printExport.createOutputFileForEndOfSeasonAsync(validationPattern, allFilesJpg, inputSeason, gc.fileName, gc.xlsxExtension, gc.excelFilePath).Wait();

                Console.WriteLine("DONE!");
                sw.Stop();
                Console.WriteLine(sw.Elapsed);
            }
            else
            {
                Console.WriteLine("OK! Have a nice day!");
            }

            Console.ReadLine();
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Sends a message to all players to notify them of the raize
        /// </summary>
        /// <param name="keep">The keep object</param>
        /// <param name="realm">The raizing realm</param>
        public static void BroadcastRaize(AbstractGameKeep keep, eRealm realm)
        {
            string message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastRaize.Razed", keep.Name, GlobalConstants.RealmToName(realm)));

            BroadcastMessage(message, eRealm.None);
            NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
        }
Ejemplo n.º 21
0
        public string TransferIfAll(string inputGarment, string frontSide, string backSide, string extension, string thumbnailsFolder,
                                    string destinationPath, int thumbsCopied, int thumbsNon, StringBuilder badGeometries, List <string> collectedPaths,
                                    HashSet <string> geometryInUse, string inputSeason, GlobalConstants gc, DDebugg debug, printAndExport printExport)
        {
            thumbsCopied = 0;
            thumbsNon    = 0;

            foreach (var geometry in geometryInUse)
            {
                //input garment code
                inputGarment = geometry;

                string splitThumbCounts = TransferCopies(inputGarment, frontSide, backSide, extension, thumbnailsFolder,
                                                         destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths);

                var split = splitThumbCounts
                            .Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                            .Select(int.Parse)
                            .ToArray();

                thumbsCopied += split[0];
                thumbsNon    += split[1];
            }

            //print STATISTICS
            printExport.resultsToFile(geometryInUse, badGeometries, inputSeason, gc, debug);
            string result = printExport.printResults(thumbsCopied, thumbsNon, badGeometries, geometryInUse);

            return(result);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// When Lord dies, we update Area Mgr to call the various functions we need
        /// And update the player stats
        /// </summary>
        /// <param name="killer">The killer object</param>
        public override void Die(GameObject killer)
        {
            m_lastRealm = eRealm.None;

            if (ServerProperties.Properties.LOG_KEEP_CAPTURES)
            {
                try
                {
                    if (this.Component != null)
                    {
                        DOL.Database.KeepCaptureLog keeplog = new DOL.Database.KeepCaptureLog();
                        keeplog.KeepName = Component.AbstractKeep.Name;

                        if (Component.AbstractKeep is GameKeep)
                        {
                            keeplog.KeepType = "Keep";
                        }
                        else
                        {
                            keeplog.KeepType = "Tower";
                        }

                        keeplog.NumEnemies  = GetEnemyCountInArea();
                        keeplog.RPReward    = RealmPointsValue;
                        keeplog.BPReward    = BountyPointsValue;
                        keeplog.XPReward    = ExperienceValue;
                        keeplog.MoneyReward = MoneyValue;

                        if (Component.AbstractKeep.StartCombatTick > 0)
                        {
                            keeplog.CombatTime = (int)((Component.AbstractKeep.CurrentRegion.Time - Component.AbstractKeep.StartCombatTick) / 1000 / 60);
                        }

                        keeplog.CapturedBy = GlobalConstants.RealmToName(killer.Realm);

                        string listRPGainers = "";

                        foreach (System.Collections.DictionaryEntry de in XPGainers)
                        {
                            GameLiving living = de.Key as GameLiving;
                            if (living != null)
                            {
                                listRPGainers += living.Name + ";";
                            }
                        }

                        keeplog.RPGainerList = listRPGainers.TrimEnd(';');

                        GameServer.Database.AddObject(keeplog);
                    }
                    else
                    {
                        log.Error("Component null for Guard Lord " + Name);
                    }
                }
                catch (System.Exception ex)
                {
                    log.Error("KeepCaptureLog Exception", ex);
                }
            }

            base.Die(killer);

            if (this.Component != null)
            {
                GameServer.ServerRules.ResetKeep(this, killer);
            }

            m_lastKillTime = CurrentRegion.Time;
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Add newly created player to startup guild.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public static void AddNewbieToStarterGuild(DOLEvent e, object sender, EventArgs args)
        {
            if (!STARTING_GUILD)
            {
                return;
            }

            // Check Args
            var chArgs = args as CharacterEventArgs;

            if (chArgs == null)
            {
                return;
            }

            DOLCharacters ch      = chArgs.Character;
            Account       account = chArgs.GameClient.Account;

            if ((ePrivLevel)account.PrivLevel == ePrivLevel.Player)
            {
                var guildname = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, string.Format("Guild.StartupGuild.{0}", GlobalConstants.RealmToName((eRealm)ch.Realm)));
                ch.GuildID = GuildMgr.GuildNameToGuildID(guildname);

                if (ch.GuildID != "")
                {
                    ch.GuildRank = 8;
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Talk to the NPC.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="str"></param>
        /// <returns></returns>
        public override bool WhisperReceive(GameLiving source, string text)
        {
            if (!base.WhisperReceive(source, text) || !(source is GamePlayer))
            {
                return(false);
            }

            GamePlayer player = source as GamePlayer;

            if ((text.ToLower() == "king" || text.ToLower() == "exit") && GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
            {
                uint   throneRegionID   = 0;
                string teleportThroneID = "error";
                string teleportExitID   = "error";

                switch (Realm)
                {
                case eRealm.Albion:
                    throneRegionID   = 394;
                    teleportThroneID = "AlbThroneRoom";
                    teleportExitID   = "AlbThroneExit";
                    break;

                case eRealm.Midgard:
                    throneRegionID   = 360;
                    teleportThroneID = "MidThroneRoom";
                    teleportExitID   = "MidThroneExit";
                    break;

                case eRealm.Hibernia:
                    throneRegionID   = 395;
                    teleportThroneID = "HibThroneRoom";
                    teleportExitID   = "HibThroneExit";
                    break;
                }

                if (throneRegionID == 0)
                {
                    log.ErrorFormat("Can't find King for player {0} speaking to {1} of realm {2}!", player.Name, Name, Realm);
                    player.Out.SendMessage("Server error, can't find throne room.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                    return(false);
                }

                Teleport teleport = null;

                if (player.CurrentRegionID == throneRegionID)
                {
                    teleport = DOLDB <Teleport> .SelectObject(DB.Column("TeleportID").IsEqualTo(teleportExitID));

                    if (teleport == null)
                    {
                        log.ErrorFormat("Can't find throne room exit TeleportID {0}!", teleportExitID);
                        player.Out.SendMessage("Server error, can't find exit to this throne room.  Moving you to your last bind point.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                        player.MoveToBind();
                    }
                }
                else
                {
                    teleport = DOLDB <Teleport> .SelectObject(DB.Column("TeleportID").IsEqualTo(teleportThroneID));

                    if (teleport == null)
                    {
                        log.ErrorFormat("Can't find throne room TeleportID {0}!", teleportThroneID);
                        player.Out.SendMessage("Server error, can't find throne room teleport location.", DOL.GS.PacketHandler.eChatType.CT_Staff, DOL.GS.PacketHandler.eChatLoc.CL_SystemWindow);
                    }
                }

                if (teleport != null)
                {
                    SayTo(player, "Very well ...");
                    player.MoveTo((ushort)teleport.RegionID, teleport.X, teleport.Y, teleport.Z, (ushort)teleport.Heading);
                }

                return(true);
            }


            if (text.ToLower() == "do")
            {
                if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
                {
                    SayTo(player, "Very well then. Here's your Personal Bind Recall Stone, may it serve you well.");
                    player.ReceiveItem(this, "Personal_Bind_Recall_Stone");
                }
                return(false);
            }

            return(true);
        }
Ejemplo n.º 25
0
        public static void CheckStartupGuilds()
        {
            foreach (eRealm currentRealm in Enum.GetValues(typeof(eRealm)))
            {
                if (currentRealm == eRealm.None || currentRealm == eRealm.Door)
                {
                    continue;
                }

                CheckGuild(currentRealm, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, string.Format("Guild.StartupGuild.{0}", GlobalConstants.RealmToName(currentRealm))));
            }
        }
Ejemplo n.º 26
0
        public void RemoveRelic(GameRelic relic)
        {
            m_mountedRelic = null;

            if (relic.CurrentCarrier != null)
            {
                string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameRelicPad.RemoveRelic.Removed", relic.CurrentCarrier.Name, GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }
                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
                NewsMgr.CreateNews(message, relic.CurrentCarrier.Realm, eNewsType.RvRGlobal, false);

                Notify(RelicPadEvent.RelicStolen, this, new RelicPadEventArgs(relic.CurrentCarrier, relic));
            }
        }
Ejemplo n.º 27
0
        public void OnCommand(GameClient client, string[] args)
        {
            uint hour    = WorldMgr.GetCurrentGameTime() / 1000 / 60 / 60;
            uint minute  = WorldMgr.GetCurrentGameTime() / 1000 / 60 % 60;
            uint seconde = WorldMgr.GetCurrentGameTime() / 1000 % 60;

            string name = "(NoName)";
            var    info = new List <string>();

            info.Add("        Current Region : " + client.Player.CurrentRegionID);
            info.Add(" ");
            Type regionType = client.Player.CurrentRegion.GetType();

            info.Add("       Region ClassType: " + regionType.FullName);
            info.Add(" ");

            if (client.Player.TargetObject != null)
            {
                if (!string.IsNullOrEmpty(client.Player.TargetObject.Name))
                {
                    name = client.Player.TargetObject.Name;
                }

                #region Mob
                /********************* MOB ************************/
                if (client.Player.TargetObject is GameNPC)
                {
                    var target = client.Player.TargetObject as GameNPC;

                    if (target.NPCTemplate != null)
                    {
                        info.Add(" + NPCTemplate: " + "[" + target.NPCTemplate.TemplateId + "] " + target.NPCTemplate.Name);
                    }
                    info.Add(" + Class: " + target.GetType().ToString());
                    info.Add(" + Brain: " + (target.Brain == null ? "(null)" : target.Brain.GetType().ToString()));
                    if (target.LoadedFromScript)
                    {
                        info.Add(" + Loaded: from Script");
                    }
                    else
                    {
                        info.Add(" + Loaded: from Database");
                    }
                    info.Add(" ");
                    if (client.Player.TargetObject is GameMerchant)
                    {
                        var targetM = client.Player.TargetObject as GameMerchant;

                        info.Add(" + Is Merchant ");
                        if (targetM.TradeItems != null)
                        {
                            info.Add(" + Sell List: \n   " + targetM.TradeItems.ItemsListID);
                        }
                        else
                        {
                            info.Add(" + Sell List:  Not Present !\n");
                        }
                        info.Add(" ");
                    }
                    if (client.Player.TargetObject is GamePet)
                    {
                        var targetP = client.Player.TargetObject as GamePet;
                        info.Add(" + Is Pet ");
                        info.Add(" + Pet Owner:   " + targetP.Owner);
                        info.Add(" ");
                    }

                    if (client.Player.TargetObject is GameMovingObject)
                    {
                        var targetM = client.Player.TargetObject as GameMovingObject;
                        info.Add(" + Is GameMovingObject  ");
                        info.Add(" + ( Boats - Siege weapons - Custom Object");
                        info.Add(" + Emblem:   " + targetM.Emblem);
                        info.Add(" ");
                    }

                    info.Add(" + Name: " + name);
                    if (target.GuildName != null && target.GuildName.Length > 0)
                    {
                        info.Add(" + Guild: " + target.GuildName);
                    }
                    info.Add(" + Level: " + target.Level);
                    info.Add(" + Realm: " + GlobalConstants.RealmToName(target.Realm));
                    info.Add(" + Model:  " + target.Model);
                    info.Add(" + Size " + target.Size);
                    info.Add(string.Format(" + Flags: {0} (0x{1})", ((GameNPC.eFlags)target.Flags).ToString("G"), target.Flags.ToString("X")));
                    info.Add(" ");

                    info.Add(" + Speed(current/max): " + target.CurrentSpeed + "/" + target.MaxSpeedBase);
                    info.Add(" + Health: " + target.Health + "/" + target.MaxHealth);
                    info.Add(" + Endu: " + target.Endurance + "/" + target.MaxEndurance);
                    info.Add(" + Mana: " + target.Mana + "/" + target.MaxMana);
                    info.Add(" + Conc: " + target.Concentration + "/" + target.MaxConcentration);

                    IOldAggressiveBrain aggroBrain = target.Brain as IOldAggressiveBrain;
                    if (aggroBrain != null)
                    {
                        info.Add(" + Aggro level: " + aggroBrain.AggroLevel);
                        info.Add(" + Aggro range: " + aggroBrain.AggroRange);

                        if (target.MaxDistance < 0)
                        {
                            info.Add(" + MaxDistance: " + -target.MaxDistance * aggroBrain.AggroRange / 100);
                        }
                        else
                        {
                            info.Add(" + MaxDistance: " + target.MaxDistance);
                        }
                    }
                    else
                    {
                        info.Add(" + Not aggressive brain");
                    }

                    if (target.NPCTemplate != null)
                    {
                        info.Add(" + NPCTemplate: " + "[" + target.NPCTemplate.TemplateId + "] " + target.NPCTemplate.Name);
                    }

                    info.Add(" + Roaming Range: " + target.RoamingRange);

                    TimeSpan respawn = TimeSpan.FromMilliseconds(target.RespawnInterval);
                    if (target.RespawnInterval <= 0)
                    {
                        info.Add(" + Respawn: NPC will not respawn");
                    }
                    else
                    {
                        string days  = "";
                        string hours = "";
                        if (respawn.Days > 0)
                        {
                            days = respawn.Days + " days ";
                        }
                        if (respawn.Hours > 0)
                        {
                            hours = respawn.Hours + " hours ";
                        }
                        info.Add(" + Respawn: " + days + hours + respawn.Minutes + " minutes " + respawn.Seconds + " seconds");
                        info.Add(" + SpawnPoint:  " + target.SpawnPoint.X + ", " + target.SpawnPoint.Y + ", " + target.SpawnPoint.Z);
                    }

                    if (target.QuestListToGive.Count > 0)
                    {
                        info.Add(" + Quests to give:  " + target.QuestListToGive.Count);
                    }

                    if (target.PathID != null && target.PathID.Length > 0)
                    {
                        info.Add(" + Path: " + target.PathID);
                    }

                    if (target.OwnerID != null && target.OwnerID.Length > 0)
                    {
                        info.Add(" + OwnerID: " + target.OwnerID);
                    }

                    info.Add(" ");
                    info.Add($" + {target.Strength} STR / {target.Constitution} CON / {target.Dexterity} DEX / {target.Quickness} QUI");
                    info.Add($" + {target.Intelligence} INT / {target.Empathy} EMP / {target.Piety} PIE / {target.Charisma} CHR");
                    info.Add($" + {target.WeaponDps} DPS / {target.WeaponSpd} SPD / {target.ArmorFactor} AF / {target.ArmorAbsorb} ABS");
                    info.Add($" + {target.BlockChance}% Block / {target.ParryChance}% Parry / {target.EvadeChance}% Evade");

                    info.Add(" + Damage type: " + target.MeleeDamageType);
                    if (target.LeftHandSwingChance > 0)
                    {
                        info.Add(" + Left Swing %: " + target.LeftHandSwingChance);
                    }

                    if (target.Abilities != null && target.Abilities.Count > 0)
                    {
                        info.Add(" + Abilities: " + target.Abilities.Count);
                    }

                    if (target.Spells != null && target.Spells.Count > 0)
                    {
                        info.Add(" + Spells: " + target.Spells.Count);
                    }

                    if (target.Styles != null && target.Styles.Count > 0)
                    {
                        info.Add(" + Styles: " + target.Styles.Count);
                    }

                    info.Add(" ");
                    if (target.Race > 0)
                    {
                        info.Add(" + Race:  " + target.Race);
                    }

                    if (target.BodyType > 0)
                    {
                        info.Add(" + Body Type:  " + target.BodyType);
                    }

                    if (target.GetDamageResist(eProperty.Resist_Crush) > 0)
                    {
                        info.Add(" + Resist Crush:  " + target.GetDamageResist(eProperty.Resist_Crush));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Slash) > 0)
                    {
                        info.Add(" + Resist Slash:  " + target.GetDamageResist(eProperty.Resist_Slash));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Thrust) > 0)
                    {
                        info.Add(" + Resist Thrust:  " + target.GetDamageResist(eProperty.Resist_Thrust));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Heat) > 0)
                    {
                        info.Add(" + Resist Heat:  " + target.GetDamageResist(eProperty.Resist_Heat));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Cold) > 0)
                    {
                        info.Add(" + Resist Cold:  " + target.GetDamageResist(eProperty.Resist_Cold));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Matter) > 0)
                    {
                        info.Add(" + Resist Matter:  " + target.GetDamageResist(eProperty.Resist_Matter));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Natural) > 0)
                    {
                        info.Add(" + Resist Natural:  " + target.GetDamageResist(eProperty.Resist_Natural));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Body) > 0)
                    {
                        info.Add(" + Resist Body:  " + target.GetDamageResist(eProperty.Resist_Body));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Spirit) > 0)
                    {
                        info.Add(" + Resist Spirit:  " + target.GetDamageResist(eProperty.Resist_Spirit));
                    }
                    if (target.GetDamageResist(eProperty.Resist_Energy) > 0)
                    {
                        info.Add(" + Resist Energy:  " + target.GetDamageResist(eProperty.Resist_Energy));
                    }
                    info.Add(" + Active weapon slot: " + target.ActiveWeaponSlot);
                    info.Add(" + Visible weapon slot: " + target.VisibleActiveWeaponSlots);

                    if (target.EquipmentTemplateID != null && target.EquipmentTemplateID.Length > 0)
                    {
                        info.Add(" + Equipment Template ID: " + target.EquipmentTemplateID);
                    }

                    if (target.Inventory != null)
                    {
                        info.Add(" + Inventory: " + target.Inventory.AllItems.Count + " items");
                    }

                    info.Add(" ");
                    info.Add(" + Mob_ID:  " + target.InternalID);
                    info.Add(" + Position:  " + target.Position.ToString("F0") + ", " + target.Heading);
                    info.Add(" + OID: " + target.ObjectID);
                    info.Add(" + Package ID:  " + target.PackageID);

                    /*	if (target.Brain != null && target.Brain.IsActive)
                     *      {
                     *              info.Add(target.Brain.GetType().FullName);
                     *              info.Add(target.Brain.ToString());
                     *              info.Add("");
                     *      }
                     */
                    info.Add("");
                    info.Add(" ------ State ------");
                    if (target.IsReturningHome || target.IsReturningToSpawnPoint)
                    {
                        info.Add("IsReturningHome: " + target.IsReturningHome);
                        info.Add("IsReturningToSpawnPoint: " + target.IsReturningToSpawnPoint);
                        info.Add("");
                    }

                    info.Add("InCombat: " + target.InCombat);
                    info.Add("AttackState: " + target.AttackState);
                    info.Add("LastCombatPVE: " + target.LastAttackedByEnemyTickPvE);
                    info.Add("LastCombatPVP: " + target.LastAttackedByEnemyTickPvP);

                    if (target.InCombat || target.AttackState)
                    {
                        info.Add("RegionTick: " + target.CurrentRegion.Time);
                    }

                    info.Add("");

                    if (target.TargetObject != null)
                    {
                        info.Add("TargetObject: " + target.TargetObject.Name);
                        info.Add("InView: " + target.TargetInView);
                    }

                    if (target.Brain != null && target.Brain is StandardMobBrain)
                    {
                        Dictionary <GameLiving, long> aggroList = (target.Brain as StandardMobBrain).AggroTable;

                        if (aggroList.Count > 0)
                        {
                            info.Add("");
                            info.Add("Aggro List:");

                            foreach (GameLiving living in aggroList.Keys)
                            {
                                info.Add(living.Name + ": " + aggroList[living]);
                            }
                        }
                    }

                    if (target.Attackers != null && target.Attackers.Count > 0)
                    {
                        info.Add("");
                        info.Add("Attacker List:");

                        foreach (GameLiving attacker in target.Attackers)
                        {
                            info.Add(attacker.Name);
                        }
                    }

                    if (target.EffectList.Count > 0)
                    {
                        info.Add("");
                        info.Add("Effect List:");

                        foreach (IGameEffect effect in target.EffectList)
                        {
                            info.Add(effect.Name + " remaining " + effect.RemainingTime);
                        }
                    }

                    info.Add("");
                    info.Add(" + Loot:");

                    var template = DOLDB <LootTemplate> .SelectObjects(DB.Column(nameof(LootTemplate.TemplateName)).IsEqualTo(target.Name));

                    foreach (LootTemplate loot in template)
                    {
                        ItemTemplate drop = GameServer.Database.FindObjectByKey <ItemTemplate>(loot.ItemTemplateID);

                        string message = "";
                        if (drop == null)
                        {
                            message += loot.ItemTemplateID + " (Template Not Found)";
                        }
                        else
                        {
                            message += drop.Name + " (" + drop.Id_nb + ")";
                        }

                        message += " Chance: " + loot.Chance.ToString();
                        info.Add("- " + message);
                    }
                }

                #endregion Mob

                #region Player
                /********************* PLAYER ************************/
                if (client.Player.TargetObject is GamePlayer)
                {
                    var target = client.Player.TargetObject as GamePlayer;

                    info.Add("PLAYER INFORMATION (Client # " + target.Client.SessionID + ")");
                    info.Add("  - Name : " + target.Name);
                    info.Add("  - Lastname : " + target.LastName);
                    info.Add("  - Realm : " + GlobalConstants.RealmToName(target.Realm));
                    info.Add("  - Level : " + target.Level);
                    info.Add("  - Class : " + target.CharacterClass.Name);
                    info.Add("  - Guild : " + target.GuildName);
                    info.Add(" ");
                    info.Add("  - Account Name : " + target.AccountName);
                    info.Add("  - IP : " + target.Client.Account.LastLoginIP);
                    info.Add("  - Priv. Level : " + target.Client.Account.PrivLevel);
                    info.Add("  - Client Version: " + target.Client.Account.LastClientVersion);
                    info.Add(" ");
                    info.Add("  - Craftingskill : " + target.CraftingPrimarySkill + "");
                    info.Add("  - Model ID : " + target.Model);
                    info.Add("  - AFK Message: " + target.TempProperties.getProperty <string>(GamePlayer.AFK_MESSAGE) + "");
                    info.Add(" ");
                    info.Add("  - Money : " + Money.GetString(target.GetCurrentMoney()) + "\n");
                    info.Add("  - Speed : " + target.MaxSpeedBase);
                    info.Add("  - XPs : " + target.Experience);
                    info.Add("  - RPs : " + target.RealmPoints);
                    info.Add("  - BPs : " + target.BountyPoints);

                    String sCurrent = "";
                    String sTitle   = "";
                    int    cnt      = 0;

                    info.Add(" ");
                    info.Add("SPECCING INFORMATIONS ");
                    info.Add("  - Remaining spec. points : " + target.SkillSpecialtyPoints);
                    sTitle   = "  - Player specialisations / level: \n";
                    sCurrent = "";
                    foreach (Specialization spec in target.GetSpecList())
                    {
                        sCurrent += "  - " + spec.Name + " = " + spec.Level + " \n";
                    }
                    info.Add(sTitle + sCurrent);

                    sCurrent = "";
                    sTitle   = "";

                    info.Add(" ");
                    info.Add("CHARACTER STATS ");
                    info.Add("  - Maximum Health : " + target.MaxHealth);
                    info.Add("  - Current AF : " + target.GetModified(eProperty.ArmorFactor));
                    info.Add("  - Current ABS : " + target.GetModified(eProperty.ArmorAbsorption));

                    for (eProperty stat = eProperty.Stat_First; stat <= eProperty.Stat_Last; stat++, cnt++)
                    {
                        sTitle   += GlobalConstants.PropertyToName(stat);
                        sCurrent += target.GetModified(stat);

                        info.Add("  - " + sTitle + " : " + sCurrent);
                        sCurrent = "";
                        sTitle   = "";
                    }

                    sCurrent = "";
                    sTitle   = "";
                    cnt      = 0;
                    for (eProperty res = eProperty.Resist_First; res <= eProperty.Resist_Last; res++, cnt++)
                    {
                        sTitle   += GlobalConstants.PropertyToName(res);
                        sCurrent += target.GetModified(res);
                        info.Add("  - " + sTitle + " : " + sCurrent);
                        sCurrent = "";
                        sTitle   = "";
                    }

                    info.Add(" ");
                    info.Add(" ");
                    info.Add("  - Respecs dol : " + target.RespecAmountDOL);
                    info.Add("  - Respecs single : " + target.RespecAmountSingleSkill);
                    info.Add("  - Respecs full : " + target.RespecAmountAllSkill);

                    info.Add(" ");
                    info.Add(" ");
                    info.Add("  --------------------------------------");
                    info.Add("  -----  Inventory Equiped -----");
                    info.Add("  --------------------------------------");
                    ////////////// Inventaire /////////////
                    info.Add("  ----- Money:");
                    info.Add(Money.GetShortString(target.GetCurrentMoney()));
                    info.Add(" ");

                    info.Add("  ----- Wearing:");
                    foreach (InventoryItem item in target.Inventory.EquippedItems)
                    {
                        info.Add(" [" + GlobalConstants.SlotToName(item.Item_Type) + "] " + item.Name);
                    }
                    info.Add(" ");
                }

                #endregion Player

                #region StaticItem

                /********************* OBJECT ************************/
                if (client.Player.TargetObject is GameStaticItem)
                {
                    var target = client.Player.TargetObject as GameStaticItem;

                    info.Add("  ------- OBJECT ------\n");
                    info.Add(" Name: " + name);
                    info.Add(" Model: " + target.Model);
                    info.Add(" Emblem: " + target.Emblem);
                    info.Add(" Realm: " + target.Realm);
                    if (target.Owners.LongLength > 0)
                    {
                        info.Add(" ");
                        info.Add(" Owner Name: " + target.Owners[0].Name);
                    }
                    info.Add(" ");
                    info.Add(" OID: " + target.ObjectID);
                    info.Add(" Type: " + target.GetType());

                    WorldInventoryItem invItem = target as WorldInventoryItem;
                    if (invItem != null)
                    {
                        info.Add(" Count: " + invItem.Item.Count);
                    }

                    info.Add(" ");
                    info.Add(" Location: " + target.Position.ToString("F0"));
                }

                #endregion StaticItem

                #region Door

                /********************* DOOR ************************/
                if (client.Player.TargetObject is GameDoor)
                {
                    var target = client.Player.TargetObject as GameDoor;

                    string Realmname = "";
                    string statut    = "";

                    name = target.Name;

                    if (target.Realm == eRealm.None)
                    {
                        Realmname = "None";
                    }

                    if (target.Realm == eRealm.Albion)
                    {
                        Realmname = "Albion";
                    }

                    if (target.Realm == eRealm.Midgard)
                    {
                        Realmname = "Midgard";
                    }

                    if (target.Realm == eRealm.Hibernia)
                    {
                        Realmname = "Hibernia";
                    }

                    if (target.Realm == eRealm.Door)
                    {
                        Realmname = "All";
                    }

                    if (target.Locked == 1)
                    {
                        statut = " Locked";
                    }

                    if (target.Locked == 0)
                    {
                        statut = " Unlocked";
                    }

                    info.Add("  ------- DOOR ------\n");
                    info.Add(" ");
                    info.Add(" + Name : " + target.Name);
                    info.Add(" + ID : " + target.DoorID);
                    info.Add(" + Realm : " + (int)target.Realm + " : " + Realmname);
                    info.Add(" + Level : " + target.Level);
                    info.Add(" + Guild : " + target.GuildName);
                    info.Add(" + Health : " + target.Health + " / " + target.MaxHealth);
                    info.Add(" + Statut : " + statut);
                    info.Add(" + Type : " + DoorRequestHandler.m_handlerDoorID / 100000000);
                    info.Add(" ");
                    info.Add(" + Position : " + target.Position.ToString("F0"));
                    info.Add(" + Heading : " + target.Heading);
                }

                #endregion Door

                #region Keep

                /********************* KEEP ************************/
                if (client.Player.TargetObject is GameKeepComponent)
                {
                    var target = client.Player.TargetObject as GameKeepComponent;

                    name = target.Name;

                    string realm = " other realm";
                    if ((byte)target.Realm == 0)
                    {
                        realm = " Monster";
                    }
                    if ((byte)target.Realm == 1)
                    {
                        realm = " Albion";
                    }
                    if ((byte)target.Realm == 2)
                    {
                        realm = " Midgard";
                    }
                    if ((byte)target.Realm == 3)
                    {
                        realm = " Hibernia";
                    }

                    info.Add("  ------- KEEP ------\n");
                    info.Add(" + Name : " + target.Name);
                    info.Add(" + KeepID : " + target.Keep.KeepID);
                    info.Add(" + Level : " + target.Level);
                    info.Add(" + BaseLevel : " + target.Keep.BaseLevel);
                    info.Add(" + Realm : " + realm);
                    info.Add(" ");
                    info.Add(" + Model : " + target.Model);
                    info.Add(" + Skin : " + target.Skin);
                    info.Add(" + Height : " + target.Height);
                    info.Add(" + ID : " + target.ID);
                    info.Add(" ");
                    info.Add(" + Health : " + target.Health);
                    info.Add(" + IsRaized : " + target.IsRaized);
                    info.Add(" + Status : " + target.Status);
                    info.Add(" ");
                    info.Add(" + Climbing : " + target.Climbing);
                    info.Add(" ");
                    info.Add(" + ComponentX : " + target.ComponentX);
                    info.Add(" + ComponentY : " + target.ComponentY);
                    info.Add(" + ComponentHeading : " + target.ComponentHeading);
                    info.Add(" ");
                    info.Add(" + HookPoints : " + target.HookPoints.Count);
                    info.Add(" + Positions : " + target.Positions.Count);
                    info.Add(" ");
                    info.Add(" + RealmPointsValue : " + target.RealmPointsValue);
                    info.Add(" + ExperienceValue : " + target.ExperienceValue);
                    info.Add(" + AttackRange : " + target.AttackRange);
                    info.Add(" ");
                    if (GameServer.KeepManager.GetFrontierKeeps().Contains(target.Keep))
                    {
                        info.Add(" + Keep Manager : " + GameServer.KeepManager.GetType().FullName);
                        info.Add(" + Frontiers");
                    }
                    else if (GameServer.KeepManager.GetBattleground(target.CurrentRegionID) != null)
                    {
                        info.Add(" + Keep Manager : " + GameServer.KeepManager.GetType().FullName);
                        Battleground bg = GameServer.KeepManager.GetBattleground(client.Player.CurrentRegionID);
                        info.Add(" + Battleground (" + bg.MinLevel + " to " + bg.MaxLevel + ", max RL: " + bg.MaxRealmLevel + ")");
                    }
                    else
                    {
                        info.Add(" + Keep Manager :  Not Managed");
                    }
                }

                #endregion Keep

                client.Out.SendCustomTextWindow("[ " + name + " ]", info);
                return;
            }

            if (client.Player.TargetObject == null)
            {
                /*********************** HOUSE *************************/
                if (client.Player.InHouse)
                {
                    #region House

                    House house = client.Player.CurrentHouse as House;

                    name = house.Name;

                    int      level = house.Model - ((house.Model - 1) / 4) * 4;
                    TimeSpan due   = (house.LastPaid.AddDays(ServerProperties.Properties.RENT_DUE_DAYS).AddHours(1) - DateTime.Now);

                    info.Add("  ------- HOUSE ------\n");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Owner", name));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Lotnum", house.HouseNumber));
                    info.Add("Unique ID: " + house.UniqueID);
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Level", level));
                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Porch"));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.PorchEnabled", (house.Porch ? " Present" : " Not Present")));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.PorchRoofColor", Color(house.PorchRoofColor)));
                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.ExteriorMaterials"));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RoofMaterial", MaterialWall(house.RoofMaterial)));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.WallMaterial", MaterialWall(house.WallMaterial)));

                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.DoorMaterial", MaterialDoor(house.DoorMaterial)));

                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.TrussMaterial", MaterialTruss(house.TrussMaterial)));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.PorchMaterial", MaterialTruss(house.PorchMaterial)));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.WindowMaterial", MaterialTruss(house.WindowMaterial)));

                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.ExteriorUpgrades"));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.OutdoorGuildBanner", ((house.OutdoorGuildBanner) ? " Present" : " Not Present")));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.OutdoorGuildShield", ((house.OutdoorGuildShield) ? " Present" : " Not Present")));
                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.InteriorUpgrades"));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.IndoorGuildBanner", ((house.IndoorGuildBanner) ? " Present" : " Not Present")));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.IndoorGuildShield", ((house.IndoorGuildShield) ? " Present" : " Not Present")));
                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.InteriorCarpets"));
                    if (house.Rug1Color != 0)
                    {
                        info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Rug1Color", Color(house.Rug1Color)));
                    }
                    if (house.Rug2Color != 0)
                    {
                        info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Rug2Color", Color(house.Rug2Color)));
                    }
                    if (house.Rug3Color != 0)
                    {
                        info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Rug3Color", Color(house.Rug3Color)));
                    }
                    if (house.Rug4Color != 0)
                    {
                        info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Rug4Color", Color(house.Rug4Color)));
                    }
                    info.Add(" ");
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Lockbox", Money.GetString(house.KeptMoney)));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RentalPrice", Money.GetString(HouseMgr.GetRentByModel(house.Model))));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.MaxLockbox", Money.GetString(HouseMgr.GetRentByModel(house.Model) * ServerProperties.Properties.RENT_LOCKBOX_PAYMENTS)));
                    info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RentDueIn", due.Days, due.Hours));

                    #endregion House

                    client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.HouseOwner", name), info);
                }
                else                 // No target and not in a house
                {
                    string realm = " other realm";
                    if (client.Player.CurrentZone.Realm == eRealm.Albion)
                    {
                        realm = " Albion";
                    }
                    if (client.Player.CurrentZone.Realm == eRealm.Midgard)
                    {
                        realm = " Midgard";
                    }
                    if (client.Player.CurrentZone.Realm == eRealm.Hibernia)
                    {
                        realm = " Hibernia";
                    }

                    info.Add(" Game Time: \t" + hour.ToString() + ":" + minute.ToString());
                    info.Add(" ");
                    info.Add(" Server Rules: " + GameServer.ServerRules.GetType().FullName);

                    if (GameServer.KeepManager.FrontierRegionsList.Contains(client.Player.CurrentRegionID))
                    {
                        info.Add(" Keep Manager: " + GameServer.KeepManager.GetType().FullName);
                        info.Add(" Frontiers");
                    }
                    else if (GameServer.KeepManager.GetBattleground(client.Player.CurrentRegionID) != null)
                    {
                        info.Add(" Keep Manager: " + GameServer.KeepManager.GetType().FullName);
                        Battleground bg = GameServer.KeepManager.GetBattleground(client.Player.CurrentRegionID);
                        info.Add(" Battleground (" + bg.MinLevel + " to " + bg.MaxLevel + ", max RL: " + bg.MaxRealmLevel + ")");
                    }
                    else
                    {
                        info.Add(" Keep Manager :  None for this region");
                    }

                    info.Add(" ");
                    info.Add(" Server players: " + WorldMgr.GetAllPlayingClientsCount());
                    info.Add(" ");
                    info.Add(" Region Players:");
                    info.Add(" All players: " + WorldMgr.GetClientsOfRegionCount(client.Player.CurrentRegion.ID));
                    info.Add(" ");
                    info.Add(" Alb players: " + WorldMgr.GetClientsOfRegionCount(client.Player.CurrentRegion.ID, eRealm.Albion));
                    info.Add(" Hib players: " + WorldMgr.GetClientsOfRegionCount(client.Player.CurrentRegion.ID, eRealm.Hibernia));
                    info.Add(" Mid players: " + WorldMgr.GetClientsOfRegionCount(client.Player.CurrentRegion.ID, eRealm.Midgard));

                    info.Add(" ");
                    info.Add(" Total objects in region: " + client.Player.CurrentRegion.TotalNumberOfObjects);

                    info.Add(" ");
                    info.Add(" NPC in zone:");
                    info.Add(" Alb : " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Albion).Count);
                    info.Add(" Hib : " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Hibernia).Count);
                    info.Add(" Mid: " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Midgard).Count);
                    info.Add(" None : " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.None).Count);
                    info.Add(" ");
                    info.Add(" Total objects in zone: " + client.Player.CurrentZone.TotalNumberOfObjects);
                    info.Add(" ");
                    info.Add(" Zone Description: " + client.Player.CurrentZone.Description);
                    info.Add(" Zone Realm: " + realm);
                    info.Add(" Zone ID: " + client.Player.CurrentZone.ID);
                    info.Add(" Zone IsDungeon: " + client.Player.CurrentZone.IsDungeon);
                    info.Add(" Zone SkinID: " + client.Player.CurrentZone.ZoneSkinID);
                    info.Add(" Zone X: " + client.Player.CurrentZone.XOffset);
                    info.Add(" Zone Y: " + client.Player.CurrentZone.YOffset);
                    info.Add(" Zone Width: " + client.Player.CurrentZone.Width);
                    info.Add(" Zone Height: " + client.Player.CurrentZone.Height);
                    info.Add(" Zone DivingEnabled: " + client.Player.CurrentZone.IsDivingEnabled);
                    info.Add(" Zone Waterlevel: " + client.Player.CurrentZone.Waterlevel);
                    info.Add(" ");
                    info.Add(" Region Name: " + client.Player.CurrentRegion.Name);
                    info.Add(" Region Description: " + client.Player.CurrentRegion.Description);
                    info.Add(" Region Skin: " + client.Player.CurrentRegion.Skin);
                    info.Add(" Region ID: " + client.Player.CurrentRegion.ID);
                    info.Add(" Region Expansion: " + client.Player.CurrentRegion.Expansion);
                    info.Add(" Region IsRvR: " + client.Player.CurrentRegion.IsRvR);
                    info.Add(" Region IsFrontier: " + client.Player.CurrentRegion.IsFrontier);
                    info.Add(" Region IsDungeon: " + client.Player.CurrentRegion.IsDungeon);
                    info.Add(" Zone in Region: " + client.Player.CurrentRegion.Zones.Count);
                    info.Add(" Region WaterLevel: " + client.Player.CurrentRegion.WaterLevel);
                    info.Add(" Region HousingEnabled: " + client.Player.CurrentRegion.HousingEnabled);
                    info.Add(" Region IsDisabled: " + client.Player.CurrentRegion.IsDisabled);
                    info.Add(" ");
                    info.Add(" Region ServerIP: " + client.Player.CurrentRegion.ServerIP);
                    info.Add(" Region ServerPort: " + client.Player.CurrentRegion.ServerPort);

                    client.Out.SendCustomTextWindow("[ " + client.Player.CurrentRegion.Description + " ]", info);
                }
            }
        }
Ejemplo n.º 28
0
        public override void SendUpdatePlayerSkills()
        {
            if (m_gameClient.Player == null)
            {
                return;
            }

            // Get Skills as "Usable Skills" which are in network order ! (with forced update)
            List <Tuple <Skill, Skill> > usableSkills = m_gameClient.Player.GetAllUsableSkills(true);

            bool sent        = false;              // set to true once we can't send packet anymore !
            int  index       = 0;                  // index of our position in the list !
            int  total       = usableSkills.Count; // cache List count.
            int  packetCount = 0;                  // Number of packet sent for the entire list

            while (!sent)
            {
                int packetEntry = 0;                 // needed to tell client how much skill we send
                // using pak
                using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.VariousUpdate)))
                {
                    // Write header
                    pak.WriteByte(0x01);                     //subcode for skill
                    pak.WriteByte((byte)0);                  //packet entries, can't know it for now...
                    pak.WriteByte((byte)0x03);               //subtype for following pages
                    pak.WriteByte((byte)index);              // packet first entry

                    // getting pak filled
                    while (index < total)
                    {
                        // this item will break the limit, send the packet before, keep index as is to continue !
                        if ((index >= byte.MaxValue) || ((pak.Length + 8 + usableSkills[index].Item1.Name.Length) > 1400))
                        {
                            break;
                        }

                        // Enter Packet Values !! Format Level - Type - SpecialField - Bonus - Icon - Name
                        Skill skill        = usableSkills[index].Item1;
                        Skill skillrelated = usableSkills[index].Item2;

                        if (skill is Specialization)
                        {
                            Specialization spec = (Specialization)skill;
                            pak.WriteByte((byte)spec.Level);
                            pak.WriteShort((ushort)spec.InternalID);                             //new 1.112
                            pak.WriteByte((byte)spec.SkillType);
                            pak.WriteShort(0);
                            pak.WriteByte((byte)(m_gameClient.Player.GetModifiedSpecLevel(spec.KeyName) - spec.Level));                             // bonus
                            pak.WriteShort((ushort)spec.Icon);
                            pak.WritePascalString(spec.Name);
                        }
                        else if (skill is Ability)
                        {
                            Ability ab = (Ability)skill;
                            pak.WriteByte((byte)ab.Level);
                            pak.WriteShort((ushort)ab.InternalID);                             //new 1.112
                            pak.WriteByte((byte)ab.SkillType);
                            pak.WriteShort(0);
                            pak.WriteByte((byte)0);
                            pak.WriteShort((ushort)ab.Icon);
                            pak.WritePascalString(ab.Name);
                        }
                        else if (skill is Spell)
                        {
                            Spell spell = (Spell)skill;
                            pak.WriteByte((byte)spell.Level);
                            pak.WriteShort((ushort)spell.InternalID);                             //new 1.112
                            pak.WriteByte((byte)spell.SkillType);

                            // spec index for this Spell - Special for Song and Unknown Indexes...
                            int spin = 0;
                            if (spell.SkillType == eSkillPage.Songs)
                            {
                                spin = 0xFF;
                            }
                            else
                            {
                                // find this line Specialization index !
                                if (skillrelated is SpellLine && !Util.IsEmpty(((SpellLine)skillrelated).Spec))
                                {
                                    spin = usableSkills.FindIndex(sk => (sk.Item1 is Specialization) && ((Specialization)sk.Item1).KeyName == ((SpellLine)skillrelated).Spec);

                                    if (spin == -1)
                                    {
                                        spin = 0xFE;
                                    }
                                }
                                else
                                {
                                    spin = 0xFE;
                                }
                            }

                            pak.WriteShort((ushort)spin);                                                 // special index for spellline
                            pak.WriteByte(0);                                                             // bonus
                            pak.WriteShort(spell.InternalIconID > 0 ? spell.InternalIconID : spell.Icon); // icon
                            pak.WritePascalString(spell.Name);
                        }
                        else if (skill is Style)
                        {
                            Style style = (Style)skill;
                            pak.WriteByte((byte)style.SpecLevelRequirement);
                            pak.WriteShort((ushort)style.InternalID);                             //new 1.112
                            pak.WriteByte((byte)style.SkillType);

                            // Special pre-requisite (First byte is Pre-requisite Icon / second Byte is prerequisite code...)
                            int pre = 0;

                            switch (style.OpeningRequirementType)
                            {
                            case Style.eOpening.Offensive:
                                pre = (int)style.AttackResultRequirement;                                         // last result of our attack against enemy hit, miss, target blocked, target parried, ...
                                if (style.AttackResultRequirement == Style.eAttackResultRequirement.Style)
                                {
                                    // get style requirement value... find prerequisite style index from specs beginning...
                                    int styleindex = Math.Max(0, usableSkills.FindIndex(it => (it.Item1 is Style) && it.Item1.ID == style.OpeningRequirementValue));
                                    int speccount  = Math.Max(0, usableSkills.FindIndex(it => (it.Item1 is Specialization) == false));
                                    pre |= ((byte)(100 + styleindex - speccount)) << 8;
                                }
                                break;

                            case Style.eOpening.Defensive:
                                pre = 100 + (int)style.AttackResultRequirement;                                         // last result of enemies attack against us hit, miss, you block, you parry, ...
                                break;

                            case Style.eOpening.Positional:
                                pre = 200 + style.OpeningRequirementValue;
                                break;
                            }

                            // style required?
                            if (pre == 0)
                            {
                                pre = 0x100;
                            }

                            pak.WriteShort((ushort)pre);
                            pak.WriteByte(GlobalConstants.GetSpecToInternalIndex(style.Spec));                             // index specialization in bonus...
                            pak.WriteShort((ushort)style.Icon);
                            pak.WritePascalString(style.Name);
                        }

                        packetEntry++;
                        index++;
                    }

                    // test if we finished sending packets
                    if (index >= total || index >= byte.MaxValue)
                    {
                        sent = true;
                    }

                    // rewrite header for count.
                    pak.Position = 4;
                    pak.WriteByte((byte)packetEntry);

                    if (!sent)
                    {
                        pak.WriteByte((byte)99);
                    }

                    SendTCP(pak);
                }

                packetCount++;
            }

            // Send List Cast Spells...
            SendNonHybridSpellLines();
            // clear trainer cache
            m_gameClient.TrainerSkillCache = null;

            if (ForceTooltipUpdate)
            {
                SendForceTooltipUpdate(usableSkills.Select(t => t.Item1));
            }
        }
Ejemplo n.º 29
0
        /*          Realm status
         *
         * Albion Keeps:
         * Caer Benowyc: OwnerRealm (Guild)
         * Caer Berkstead: OwnerRealm (Guild)
         * Caer Erasleigh: OwnerRealm (Guild)
         * Caer Boldiam: OwnerRealm (Guild)
         * Caer Sursbrooke: OwnerRealm (Guild)
         * Caer Hurbury: OwnerRealm (Guild)
         * Caer Renaris: OwnerRealm (Guild)
         *
         * Midgard Keeps:
         * Bledmeer Faste: OwnerRealm (Guild)
         * Notmoor Faste: OwnerRealm (Guild)
         * Hlidskialf Faste: OwnerRealm (Guild)
         * Blendrake Faste: OwnerRealm (Guild)
         * Glenlock Faste: OwnerRealm (Guild)
         * Fensalir Faste: OwnerRealm (Guild)
         * Arvakr Faste: OwnerRealm (Guild)
         *
         * Hibernia Keeps:
         * Dun Chrauchon: OwnerRealm (Guild)
         * Dun Crimthainn: OwnerRealm (Guild)
         * Dun Bolg: OwnerRealm (Guild)
         * Dun na nGed: OwnerRealm (Guild)
         * Dun da Behnn: OwnerRealm (Guild)
         * Dun Scathaig: OwnerRealm (Guild)
         * Dun Ailinne: OwnerRealm (Guild)
         *
         * Darkness Falls: DFOwnerRealm
         *
         * Type '/relic' to display the relic status.
         */

        public void OnCommand(GameClient client, string[] args)
        {
            if (IsSpammingCommand(client.Player, "realm"))
            {
                return;
            }

            string albKeeps = string.Empty;
            string midKeeps = string.Empty;
            string hibKeeps = string.Empty;
            ICollection <AbstractGameKeep> keepList = GameServer.KeepManager.GetFrontierKeeps();

            foreach (AbstractGameKeep keep in keepList)
            {
                if (keep is GameKeep)
                {
                    switch (keep.OriginalRealm)
                    {
                    case eRealm.Albion:
                        albKeeps += KeepStringBuilder(keep);
                        break;

                    case eRealm.Hibernia:
                        hibKeeps += KeepStringBuilder(keep);
                        break;

                    case eRealm.Midgard:
                        midKeeps += KeepStringBuilder(keep);
                        break;
                    }
                }
            }

            var realmInfo = new List <string>();

            realmInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.AlbKeeps") + ":");
            realmInfo.Add(albKeeps);
            realmInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.MidKeeps") + ":");
            realmInfo.Add(midKeeps);
            realmInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.HibKeeps") + ":");
            realmInfo.Add(hibKeeps);
            realmInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.DarknessFalls") + ": " + GlobalConstants.RealmToName(DFEnterJumpPoint.DarknessFallOwner));
            realmInfo.Add(" ");
            realmInfo.Add(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.UseRelicCommand"));
            client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Realm.Title"), realmInfo);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Write item technical info
        /// </summary>
        /// <param name="output"></param>
        /// <param name="item"></param>
        public override void WriteTechnicalInfo(List <string> delve, GameClient client)
        {
            delve.Add(" ");
            delve.Add("--- Artifact/Item technical information ---");
            delve.Add(" ");
            delve.Add("Item Template: " + Id_nb);
            delve.Add("         Name: " + Name);
            delve.Add("   Experience: " + Experience);
            delve.Add("       Object: " + GlobalConstants.ObjectTypeToName(Object_Type) + " (" + Object_Type + ")");
            delve.Add("         Type: " + GlobalConstants.SlotToName(Item_Type) + " (" + Item_Type + ")");
            delve.Add("    Extension: " + Extension);
            delve.Add("        Model: " + Model);
            delve.Add("        Color: " + Color);
            delve.Add("       Emblem: " + Emblem);
            delve.Add("       Effect: " + Effect);
            delve.Add("  Value/Price: " + Money.GetShortString(Price));
            delve.Add("       Weight: " + (Weight / 10.0f) + "lbs");
            delve.Add("      Quality: " + Quality + "%");
            delve.Add("   Durability: " + Durability + "/" + MaxDurability + "(max)");
            delve.Add("    Condition: " + Condition + "/" + MaxCondition + "(max)");
            delve.Add("        Realm: " + Realm);
            delve.Add("  Is dropable: " + (IsDropable ? "yes" : "no"));
            delve.Add("  Is pickable: " + (IsPickable ? "yes" : "no"));
            delve.Add(" Is stackable: " + (IsStackable ? "yes" : "no"));
            delve.Add(" Is tradeable: " + (IsTradable ? "yes" : "no"));
            delve.Add("  ProcSpellID: " + ProcSpellID);
            delve.Add(" ProcSpellID1: " + ProcSpellID1);
            delve.Add("      SpellID: " + SpellID + " (" + Charges + "/" + MaxCharges + ")");
            delve.Add("     SpellID1: " + SpellID1 + " (" + Charges1 + "/" + MaxCharges1 + ")");
            delve.Add("PoisonSpellID: " + PoisonSpellID + " (" + PoisonCharges + "/" + PoisonMaxCharges + ") ");

            if (GlobalConstants.IsWeapon(Object_Type))
            {
                delve.Add("         Hand: " + GlobalConstants.ItemHandToName(Hand) + " (" + Hand + ")");
                delve.Add("Damage/Second: " + (DPS_AF / 10.0f));
                delve.Add("        Speed: " + (SPD_ABS / 10.0f));
                delve.Add("  Damage type: " + GlobalConstants.WeaponDamageTypeToName(Type_Damage) + " (" + Type_Damage + ")");
                delve.Add("        Bonus: " + Bonus);
            }
            else if (GlobalConstants.IsArmor(Object_Type))
            {
                delve.Add("  Armorfactor: " + DPS_AF);
                delve.Add("   Absorption: " + SPD_ABS);
                delve.Add("        Bonus: " + Bonus);
            }
            else if (Object_Type == (int)eObjectType.Shield)
            {
                delve.Add("Damage/Second: " + (DPS_AF / 10.0f));
                delve.Add("        Speed: " + (SPD_ABS / 10.0f));
                delve.Add("  Shield type: " + GlobalConstants.ShieldTypeToName(Type_Damage) + " (" + Type_Damage + ")");
                delve.Add("        Bonus: " + Bonus);
            }
            else if (Object_Type == (int)eObjectType.Arrow || Object_Type == (int)eObjectType.Bolt)
            {
                delve.Add(" Ammunition #: " + DPS_AF);
                delve.Add("       Damage: " + GlobalConstants.AmmunitionTypeToDamageName(SPD_ABS));
                delve.Add("        Range: " + GlobalConstants.AmmunitionTypeToRangeName(SPD_ABS));
                delve.Add("     Accuracy: " + GlobalConstants.AmmunitionTypeToAccuracyName(SPD_ABS));
                delve.Add("        Bonus: " + Bonus);
            }
            else if (Object_Type == (int)eObjectType.Instrument)
            {
                delve.Add("   Instrument: " + GlobalConstants.InstrumentTypeToName(DPS_AF));
            }
        }
Ejemplo n.º 31
0
        public void OnCommand(GameClient client, string[] args)
        {
            try
            {
                Zone zone;

                if (args[1].ToLower() == "info")
                {
                    var info = new List <string>();
                    info.Add(" ");
                    info.Add(" NPCs in zone:");
                    info.Add(" Alb: " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Albion).Count);
                    info.Add(" Hib: " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Hibernia).Count);
                    info.Add(" Mid: " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.Midgard).Count);
                    info.Add(" None: " + client.Player.CurrentZone.GetNPCsOfZone(eRealm.None).Count);
                    info.Add(" ");
                    info.Add(string.Format(" Objects in zone: {0}, Total allowed for region: {1}", client.Player.CurrentZone.TotalNumberOfObjects, ServerProperties.Properties.REGION_MAX_OBJECTS));
                    info.Add(" ");
                    info.Add(" Zone Description: " + client.Player.CurrentZone.Description);
                    info.Add(" Zone Realm: " + GlobalConstants.RealmToName(client.Player.CurrentZone.Realm));
                    info.Add(" Zone ID: " + client.Player.CurrentZone.ID);
                    info.Add(" Zone IsDungeon: " + client.Player.CurrentZone.IsDungeon);
                    info.Add(" Zone SkinID: " + client.Player.CurrentZone.ZoneSkinID);
                    info.Add(" Zone X: " + client.Player.CurrentZone.XOffset);
                    info.Add(" Zone Y: " + client.Player.CurrentZone.YOffset);
                    info.Add(" Zone Width: " + client.Player.CurrentZone.Width);
                    info.Add(" Zone Height: " + client.Player.CurrentZone.Height);
                    info.Add(" Zone DivingEnabled: " + client.Player.CurrentZone.IsDivingEnabled);
                    info.Add(" Zone Waterlevel: " + client.Player.CurrentZone.Waterlevel);

                    zone = WorldMgr.GetZone(client.Player.CurrentZone.ID);
                    Zones dbZone = GameServer.Database.SelectObject <Zones>("`ZoneID` = '" + zone.ID + "' AND `RegionID` = '" + zone.ZoneRegion.ID + "'");

                    if (dbZone != null)
                    {
                        string dflag = "Use Region";
                        if (dbZone.DivingFlag == 1)
                        {
                            dflag = "Always Yes";
                        }
                        else if (dbZone.DivingFlag == 2)
                        {
                            dflag = "Always No";
                        }

                        info.Add(" Zone DivingFlag: " + dbZone.DivingFlag + " (" + dflag + ")");
                    }

                    client.Out.SendCustomTextWindow("[ " + client.Player.CurrentZone.Description + " ]", info);
                    return;
                }

                if (args[1].ToLower() == "divingflag")
                {
                    zone = WorldMgr.GetZone(client.Player.CurrentZone.ID);
                    byte divingFlag = Convert.ToByte(args[2]);
                    if (divingFlag > 2)
                    {
                        DisplaySyntax(client);
                        return;
                    }

                    if (divingFlag == 0)
                    {
                        zone.IsDivingEnabled = client.Player.CurrentRegion.IsRegionDivingEnabled;
                    }
                    else if (divingFlag == 1)
                    {
                        zone.IsDivingEnabled = true;
                    }
                    else
                    {
                        zone.IsDivingEnabled = false;
                    }

                    Zones dbZone = GameServer.Database.SelectObject <Zones>("`ZoneID` = '" + zone.ID + "' AND `RegionID` = '" + zone.ZoneRegion.ID + "'");
                    dbZone.DivingFlag = divingFlag;
                    GameServer.Database.SaveObject(dbZone);

                    // Update water level and diving flag for the new zone
                    client.Out.SendPlayerPositionAndObjectID();

                    string dflag = "Use Region";
                    if (dbZone.DivingFlag == 1)
                    {
                        dflag = "Always Yes";
                    }
                    else if (dbZone.DivingFlag == 2)
                    {
                        dflag = "Always No";
                    }

                    DisplayMessage(client, string.Format("Diving Flag for {0}:{1} changed to {2} ({3}).", zone.ID, zone.Description, divingFlag, dflag));
                    return;
                }

                if (args[1].ToLower() == "waterlevel")
                {
                    zone = WorldMgr.GetZone(client.Player.CurrentZone.ID);
                    int waterlevel = Convert.ToInt32(args[2]);
                    zone.Waterlevel = waterlevel;

                    Zones dbZone = GameServer.Database.SelectObject <Zones>("`ZoneID` = '" + zone.ID + "' AND `RegionID` = '" + zone.ZoneRegion.ID + "'");
                    dbZone.WaterLevel = waterlevel;
                    GameServer.Database.SaveObject(dbZone);

                    // Update water level and diving flag for the new zone
                    client.Out.SendPlayerPositionAndObjectID();

                    client.Player.MoveTo(client.Player.CurrentRegionID, client.Player.X, client.Player.Y, client.Player.Z + 1, client.Player.Heading);

                    DisplayMessage(client, string.Format("Waterlevel for {0}:{1} changed to {2}.", zone.ID, zone.Description, waterlevel));
                    return;
                }

                // otherwise set zone bonuses

                //make sure that only numbers are used to avoid errors.
                foreach (char c in string.Join(" ", args, 2, 4))
                {
                    if (char.IsLetter(c))
                    {
                        DisplaySyntax(client);
                        return;
                    }
                }

                switch (args[1].ToString().ToLower())
                {
                case "c":
                case "cu":
                case "cur":
                case "curr":
                case "curre":
                case "current":
                {
                    zone = WorldMgr.GetZone(client.Player.CurrentZone.ID);
                }
                break;

                default:
                {
                    //make sure that its a number again.
                    foreach (char c in args[1])
                    {
                        if (!(char.IsNumber(c)))
                        {
                            DisplaySyntax(client);
                            return;
                        }
                    }

                    if (WorldMgr.GetZone(ushort.Parse(args[1])) == null)
                    {
                        DisplayMessage(client, "No Zone with that ID was found!");
                        return;
                    }
                    zone = WorldMgr.GetZone(ushort.Parse(args[1]));
                }
                break;
                }

                zone.BonusExperience   = int.Parse(args[2]);
                zone.BonusRealmpoints  = int.Parse(args[3]);
                zone.BonusBountypoints = int.Parse(args[4]);
                zone.BonusCoin         = int.Parse(args[5]);

                if (args[6].ToLower().StartsWith("t"))
                {
                    client.Player.TempProperties.setProperty("ZONE_BONUS_SAVE", zone);
                    client.Player.Out.SendCustomDialog(string.Format("Are you sure you wan't to over write {0} in the database?", zone.Description), new CustomDialogResponse(AreYouSure));
                }
                else
                {
                    client.Player.Out.SendCustomDialog(string.Format("The zone settings for {0} will be reverted back to database settings on server restart.", zone.Description), null);
                }
            }
            catch
            {
                DisplaySyntax(client);
            }
        }