Beispiel #1
0
 public static void OnSetDefaults(ref int type, Projectile proj)
 {
     if (SetDefaults == null)
     {
         return;
     }
     SetDefaultsEventArgs<Projectile, int> setDefaultsEventArgs = new SetDefaultsEventArgs<Projectile, int>
     {
         Object = proj,
         Info = type
     };
     SetDefaults(setDefaultsEventArgs);
     type = setDefaultsEventArgs.Info;
 }
Beispiel #2
0
        public static bool CheckProjectilePermission(TSPlayer player, int index, int type)
        {
            if (type == 43)
            {
                return true;
            }

            if (type == 17 && !player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Dirt Rod", player)) //Dirt Rod Projectile
            {
                return true;
            }

            if ((type == 42 || type == 65 || type == 68) && !player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Sandgun", player)) //Sandgun Projectiles
            {
                return true;
            }

            Projectile proj = new Projectile();
            proj.SetDefaults(type);

            if (!player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned(proj.name, player))
            {
                return true;
            }

            if (proj.hostile)
            {
                return true;
            }

            return false;
        }