Example #1
0
 private static void BuildCommands()
 {
     // VS Command Setup
     // Default Commands Count: 2 (Baseline), 14 (PvP)
     #region Strike
     VSCommand Strike = new VSCommand() // Baseline damage/heal command
     {
         Name = "VS Strike",
         Alias = "strike",
         Permission = "strike",
         Description = new List<Message>
         {
             new Message("Damages or heals target [player] by [amount].", Color.Yellow),
             new Message("Usage: /strike <player> <amount>", Color.Yellow)
         },
         Cooldown = 15
     };
     Strike.Offensive = (Strike.Damage < 0 ? false : true);
     PVPCommands.Add(Strike);
     #endregion
     #region Heal
     VSCommand Heal = new VSCommand()
     {
         Name = "VS Heal",
         Alias = "vsheal",
         Permission = "heal",
         Damage = -100,
         MsgPlayer = new Message("You just got healed!", false, "", false, "", Color.Pink)
     };
     PVPCommands.Add(Heal);
     #endregion
     #region Stab
     VSCommand Stab = new VSCommand()
     {
         Name = "Stab",
         Alias = "stab",
         Description = new List<Message>()
         {
             new Message("Stabs target player, dealing pvp damage.", Color.Yellow),
             new Message("Usage: /stab <player>", Color.Yellow)
         },
         Permission = "stab",
         Damage = 200,
         Cooldown = VSConfig.config.StabCooldown
     };
     Stab.MsgAll = new Message("", false, "", true, " just got stabbed!", new Color(133, 96, 155));
     PVPCommands.Add(Stab);
     #endregion
     #region DEdge
     VSCommand DEdge = new VSCommand()
     {
         Name = "Double-Edge Slash",
         Alias = "dedge",
         Description = new List<Message>()
         {
             new Message("Hits target player with a reckoning force, dealing pvp damage. User takes 150 damage as recoil.", Color.Yellow),
             new Message("Usage: /dedge <player>", Color.Yellow)
         },
         Permission = "dedge",
         Damage = 300,
         DamageToSelf = 150,
         Cooldown = VSConfig.config.DedgeCooldown,
         MsgSelf = new Message("You have taken the recoil from the double-edged blade!", false, "", false, "", new Color(255, 255, 153))
     };
     DEdge.MsgAll = new Message("", true, " hits ", true, " with a life-risking strike!", new Color(255, 255, 153));
     PVPCommands.Add(DEdge);
     #endregion
     #region Tickle
     VSCommand Tickle = new VSCommand()
     {
         Name = "Tickle",
         Alias = "tickle",
         Description = new List<Message>()
         {
             new Message("Tickles target player, freezing them for 10 seconds.", Color.Yellow),
             new Message("Usage: /tickle <player>", Color.Yellow)
         },
         Permission = "tickle",
         BypassPvp = true,
         Offensive = false,
         Effect = new List<Effect>() { new Effect(EffectTypes.TICKLE, 10) }
     };
     Tickle.MsgAll = new Message("", false, "", true, " is under a freezing attack of tickles!", new Color(243, 112, 234));
     Tickle.Timer.Interval = 10000;
     Tickle.Timer.Elapsed += Tickle.Timer_Tickle;
     PVPCommands.Add(Tickle);
     #endregion
     #region FSight
     VSCommand FSight = new VSCommand()
     {
         Name = "Future Sight",
         Alias = "fsight",
         Description = new List<Message>()
         {
             new Message("Casts a delayed blast, hitting target player for 250 damage. 5 seconds delay.", Color.Yellow),
             new Message("Usage: /fsight <player>", Color.Yellow)
         },
         Cooldown = VSConfig.config.FsightCooldown,
         Permission = "fsight"
     };
     FSight.MsgAll = new Message("", true, " foresaw ", true, "'s future!", Color.MediumPurple);
     FSight.Timer.Interval = 5000;
     FSight.Timer.Elapsed += FSight.Timer_FSight;
     PVPCommands.Add(FSight);
     #endregion
     #region Doom
     VSCommand Doom = new VSCommand()
     {
         Name = "Doom Desire",
         Alias = "doom",
         Description = new List<Message>()
         {
             new Message("Desires doom upon target player, dealing 400 true damage. 5 seconds delay.", Color.Yellow),
             new Message("Usage: /doom <player>", Color.Yellow)
         },
         Cooldown = VSConfig.config.DoomCooldown,
         Permission = "doom"
     };
     Doom.MsgAll = new Message("", true, " has doomed ", true, "'s fate!", Color.Orchid);
     Doom.Timer.Interval = 5000;
     Doom.Timer.Elapsed += Doom.Timer_Doom;
     PVPCommands.Add(Doom);
     #endregion
     #region Chill
     VSCommand Chill = new VSCommand()
     {
         Name = "Chilling Glyph",
         Alias = "chill",
         Permission = "chill",
         Damage = 125,
         Description = new List<Message>()
         {
             new Message("Casts an ice glyph on target player, chilling them for 7 seconds.", Color.Cyan),
             new Message("Usage: /chill <player>", Color.Yellow)
         },
         Effect = new List<Effect>() { new Effect(EffectTypes.BUFF, 46, 7) },
         MsgPlayer = new Message("You have been chilled!", false, "", false, "", Color.Cyan)
     };
     PVPCommands.Add(Chill);
     #endregion
     #region Wish
     VSCommand Wish = new VSCommand()
     {
         Name = "Wish",
         Alias = "wish",
         Description = new List<Message>()
         {
             new Message("Casts a wish on target player, healing them for 200 health. 5 seconds delay.", Color.Yellow),
             new Message("Usage: /wish <player>", Color.Yellow)
         },
         Permission = "wish",
         Cooldown = VSConfig.config.WishCooldown,
         Offensive = false
     };
     Wish.MsgAll = new Message("", true, " wished upon a star!", false, "", Color.RoyalBlue);
     Wish.Timer.Interval = 5000;
     Wish.Timer.Elapsed += Wish.Timer_Wish;
     PVPCommands.Add(Wish);
     #endregion
     #region HWish
     VSCommand HWish = new VSCommand()
     {
         Name = "Healing Wish",
         Alias = "hwish",
         UseSelf = 2,
         Offensive = false,
         Description = new List<Message>()
         {
             new Message("Sacrifices user to fully restore target player after 5 seconds. Cannot be self-cast.", Color.Yellow),
             new Message("Usage: /hwish <player>", Color.Yellow)
         },
         Permission = "hwish",
         Cooldown = VSConfig.config.HwishCooldown,
         DamageToSelf = 10000
     };
     HWish.MsgAll = new Message("", true, " sacrificed himself for greater good!", false, "", Color.SeaGreen);
     HWish.MsgPlayer = new Message("You've been chosen by ", true, "!", false, "", Color.SeaGreen);
     HWish.Timer.Interval = 5000;
     HWish.Timer.Elapsed += HWish.Timer_HWish;
     PVPCommands.Add(HWish);
     #endregion
     #region Drain
     VSCommand Drain = new VSCommand()
     {
         Name = "Drain Life",
         Alias = "drain",
         Description = new List<Message>()
         {
             new Message("Steals target player's life energy, healing the user by 80.", Color.Yellow),
             new Message("Usage: /drain <player>", Color.Yellow)
         },
         Permission = "drain",
         Damage = 100,
         DamageToSelf = -80,
         Cooldown = VSConfig.config.DrainCooldown
     };
     Drain.MsgAll = new Message("", true, " has drained ", true, "'s life!", new Color(133, 96, 155));
     PVPCommands.Add(Drain);
     #endregion
     #region Rake
     VSCommand Rake = new VSCommand()
     {
         Name = "Rake",
         Alias = "rake",
         Description = new List<Message>()
         {
             new Message("Rakes target player, dealing initial damage plus extra bleeding damage over 4 seconds.", Color.Yellow),
             new Message("Usage: /rake <player>", Color.Yellow)
         },
         Permission = "rake",
         Damage = 100,
         Cooldown = VSConfig.config.RakeCooldown,
         MsgPlayer = new Message("You are now bleeding!", false, "", false, "", Color.Salmon)
     };
     Rake.MsgAll = new Message("", true, " just raked ", true, "!", Color.Salmon);
     Rake.Timer.Interval = 4000;
     Rake.Timer.Elapsed += Rake.Timer_Rake;
     PVPCommands.Add(Rake);
     #endregion
     #region Boost
     VSCommand Boost = new VSCommand()
     {
         Name = "Boost",
         Alias = "boost",
         Description = new List<Message>()
         {
             new Message("Improves damage dealt by other PvP Commands for 1 minute. Self-use.", Color.OrangeRed),
             new Message("Usage: /boost", Color.Yellow)
         },
         Permission = "boost",
         Offensive = false,
         UseSelf = 1,
         MsgSelf = new Message("Boost activated! Damage dealt to players by your PvP Commands will be increased by 20%!", false, "", false, "", Color.OrangeRed),
         Effect = new List<Effect>() { new Effect(EffectTypes.STATE, 60, setstate: States.BOOST) },
         Cooldown = VSConfig.config.BoostCooldown
     };
     PVPCommands.Add(Boost);
     #endregion
     #region Shield
     VSCommand Shield = new VSCommand()
     {
         Name = "Virtual Shield",
         Alias = "shield",
         Description = new List<Message>()
         {
             new Message("Activates a virtual shield, reducing damage taken by PvP Commands. Self-use. Lasts 1 minute.", Color.DimGray),
             new Message("Usage: /shield", Color.Yellow)
         },
         Permission = "shield",
         Offensive = false,
         UseSelf = 1,
         MsgSelf = new Message("Virtual Shield activated! Damage taken by PvP Commands will be reduced by 20%!", false, "", false, "", Color.DimGray),
         Effect = new List<Effect>() { new Effect(EffectTypes.STATE, 60, setstate: States.SHIELD) },
         Cooldown = VSConfig.config.ShieldCooldown
     };
     PVPCommands.Add(Shield);
     #endregion
     #region Barrier
     VSCommand Barrier = new VSCommand()
     {
         Name = "Barrier",
         Alias = "barrier",
         Description = new List<Message>()
         {
             new Message("Lifts up a barrier, ignoring the next offensive PvP Command used on the user. " +
                 "Lasts 1 minute or until disposed.", Color.Indigo),
             new Message("Usage: /barrier", Color.Yellow)
         },
         Permission = "barrier",
         Offensive = false,
         UseSelf = 1,
         MsgSelf = new Message("Barrier lifted! The next PvP command used against you will be ignored!", false, "", false, "", Color.DimGray),
         Effect = new List<Effect>() { new Effect(EffectTypes.STATE, 60, setstate: States.BARRIER) },
         Cooldown = VSConfig.config.BarrierCooldown
     };
     PVPCommands.Add(Barrier);
     #endregion
     #region Locus
     VSCommand Locus = new VSCommand()
     {
         Name = "Locus of Power",
         Alias = "locus",
         Description = new List<Message>()
         {
             new Message("Energizes the user for 10 seconds, providing additional damage and resistances at the cost of speed. ",
                 Color.Navy),
             new Message("Boosts: 50% increased PvP Command damage and PvP Command resistance. Chills user for duration.", Color.Navy),
             new Message("Usage: /locus", Color.Yellow)
         },
         Permission = "locus",
         Offensive = false,
         UseSelf = 1,
         Effect = new List<Effect>()
             {
                 new Effect(EffectTypes.STATE, 10, 0, 0, States.LOCUS),
                 new Effect(EffectTypes.BUFF, 46, 10, 0)
             },
         MsgAll = new Message("", true, " activated Locus of Power!", false, "", Color.Navy),
         Cooldown = VSConfig.config.LocusCooldown
     };
     PVPCommands.Add(Locus);
     #endregion
     // Adds Custom Commands
     foreach (VSCommand cmd in VSConfig.config.Commands)
     {
         PVPCommands.Add(cmd);
     }
 }
Example #2
0
        // PvP Command execution
        private static void VSExecute(VSPlayer user, VSCommand command, TSPlayer target)
        {
            // Sets command user and target
            command.User = user;
            command.Target = target;

            // Self-use Check & PvP Check
            if (command.UseSelf == 2 && user.TSPlayer == target)
            {
                user.TSPlayer.SendErrorMessage("[PvP] Error: You cannot use this command on yourself!");
                return;
            }
            if (!PVPCheck(target) && !command.BypassPvp)
            {
                user.TSPlayer.SendErrorMessage("[PvP] Error: Target is not hostile!");
                return;
            }

            // Cooldown Check
            if (VSConfig.config.Cooldowns && !user.TSPlayer.Group.HasPermission("vs.ignore.cooldown"))
            {
                if (command.Counter > 0)
                {
                    user.TSPlayer.SendErrorMessage(string.Format("[PvP] Error: You must wait {0} seconds before using {1} again!",
                        command.Counter, command.Name));
                    return;
                }
                else
                {
                    command.Counter = command.Cooldown;
                }
            }

            // Damage Check
            if (command.Damage != 0)
            {
                VSPlayers[target.UserID].DamagePlayer(command.Damage, command, user);
            }
            if (command.DamageToSelf != 0)
            {
                user.DamagePlayer(command.DamageToSelf, command, user);
            }

            // Effect Check
            if (command.Effect != null)
            {
                foreach (Effect eff in command.Effect)
                {
                    Effect.Event(user, target, eff.Type, eff.Parameter, eff.Parameter2, eff.Who, eff.SetState);
                }
            }

            // Timer Check
            if (command.Timer.Interval != 1)
            {
                command.Timer.Start();
            }

            // Messages Check
            if (command.MsgAll != null)
            {
                Message msg = new Message(command.MsgAll.InitMsg, command.MsgAll.UsePlr1 ? command.User.TSPlayer : null,
                    command.MsgAll.MidMsg, command.MsgAll.UsePlr2 ? command.Target : null, command.MsgAll.EndMsg, command.MsgAll.Color);
                TSPlayer.All.SendMessage(msg.Text, msg.Color);
            }
            if (command.MsgSelf != null)
            {
                Message msg = new Message(command.MsgSelf.InitMsg, command.MsgSelf.UsePlr1 ? command.User.TSPlayer : null,
                    command.MsgSelf.MidMsg, command.MsgSelf.UsePlr2 ? command.Target : null, command.MsgSelf.EndMsg, command.MsgSelf.Color);
                user.TSPlayer.SendMessage(msg.Text, msg.Color);
            }
            if (command.MsgPlayer != null)
            {
                Message msg = new Message(command.MsgPlayer.InitMsg, command.MsgPlayer.UsePlr1 ? command.User.TSPlayer : null,
                    command.MsgPlayer.MidMsg, command.MsgPlayer.UsePlr2 ? command.Target : null, command.MsgPlayer.EndMsg, command.MsgPlayer.Color);
                target.SendMessage(msg.Text, msg.Color);
            }
            return;
        }
Example #3
0
 public void DamagePlayer(double damage, VSCommand cmd, VSPlayer user)
 {
     if (damage < 0)
     {
         TSPlayer.Heal(VSSystem.Equalize(damage));
     }
     else
     {
         if (cmd.Offensive)
         {
             if (State.ContainsKey(States.BARRIER))
             {
                 Message msg = new Message("Barrier has been disposed!", false, "", false, "", Color.Indigo);
                 RemoveState(States.BARRIER);
                 TSPlayer.SendInfoMessage(msg.Text, msg.Color);
                 return;
             }
             if (State.ContainsKey(States.SHIELD))
             {
                 damage *= 0.8;
             }
             if (State.ContainsKey(States.LOCUS))
             {
                 damage *= 0.5;
             }
         }
         if (user.State.ContainsKey(States.BOOST))
         {
             damage *= 1.2;
         }
         if (user.State.ContainsKey(States.LOCUS))
         {
             damage *= 1.5;
         }
         TSPlayer.DamagePlayer(VSSystem.Equalize(damage, TSPlayer));
     }
 }