Exemplo n.º 1
0
 public static void BeginJump( Player pm )
 {
     if( !pm.Alive || pm.Frozen || pm.Paralyzed || pm.Stam <= 0 || ( pm.Mounted && (pm.Race != Race.Elemental && !pm.AbilityActive)))
     {
         pm.SendMessage("You cannot jump in your current state.");
     }
     else if( pm.JumpRange == 0 )
     {
         pm.SendMessage("You cannot jump right now!");
     }
     else
     {
         pm.BeginTarget(pm.JumpRange, true, Targeting.TargetFlags.None, OnJumpTarget);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Plays a special effect for upgrading a perk level
        /// </summary>
        private void PlayUpgradeEffect( Player player, Perk perk, PerkLevel newLevel )
        {
            Effects.SendMovingEffect(new Entity(Server.Serial.Zero, new Point3D(player.Location, player.Z + 20), player.Map), player, 0x373A, 10, 10, false, false);
            Effects.SendTargetEffect(player, 0x3779, 10, 10);
            player.PlaySound(0x0F8);

            if( newLevel == PerkLevel.First )
            {
                player.SendMessage("You have unlocked the first level of the {0} perk!", perk.Label);
            }
            else
            {
                player.SendMessage("You have upgraded {0} to the {1} level!", perk.Label, newLevel);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Completes a perk level upgrade
        /// </summary>
        private void PurchaseUpgrade( Player player, Perk currentPerk, PerkLevel targetLevel )
        {
            if( currentPerk == null )
            {
                player.SendMessage("You have not started on this perk track!");
            }
            else if( targetLevel <= currentPerk.Level )
            {
                player.SendMessage("Your current abilities exceed your selected upgrade.");
            }
            else
            {
                int upgradeCost = GetUpgradeCost(currentPerk.Level, targetLevel);

                if( upgradeCost > player.EssenceOfCharacter )
                {
                    player.SendMessage("You do not have enough Essence of Character to afford this upgrade!");
                }
                else
                {
                    player.EssenceOfCharacter -= upgradeCost;
                    currentPerk.Level = targetLevel;

                    PlayUpgradeEffect(player, currentPerk, targetLevel);
                }
            }
        }