[Command] [FSOD] Vanish Command

Posts 16–30 of 45 · Page 2 of 3
Quote Originally Posted by Riigged View Post
if you added @Matrix1101 blocksight in player.update.cs that may be why since his replaced ALL of player.update and adding this in might have to have the code altered a tiny bit to be compatible with his blocksight since idk its in the same file or something
I have the same problem except I don't have the blocksight code in meaning that isn't the problem. Something else is
Quote Originally Posted by SPRAYxTHExPRAY View Post
I have the same problem except I don't have the blocksight code in meaning that isn't the problem. Something else is
ahh den nvm
PLEASE ADD THIS INSTEAD OF STEP 11'S CODE


Code:
        private IEnumerable<int> GetRemovedEntities()
        {
            foreach (Entity i in clientEntities.Where(i => i is Player))
            {
                    if ((i as Player).isNotVisible && i != this && !PvP)
                {
                    yield return i.Id;
                }
                if (i is Player && i.Owner != null) continue;
                if (MathsUtils.DistSqr(i.X, i.Y, X, Y) > SIGHTRADIUS * SIGHTRADIUS &&
                    !(i is StaticObject && (i as StaticObject).Static) &&
                    i != Quest)
                {
                    if (i is Pet) continue;
                    yield return i.Id;
                }
                else if (i.Owner == null)
                    yield return i.Id;

                if ((i as Player).isNotVisible && i != this && !PvP)
                    yield return i.Id;
            }
        }
@Daemonmann or @Luis please change step 11's code to the code above as the code in step 11 causes pet errors
@Daemonmann or @Luis

Change exchange the command /vanish with this since its gives invincibility and invisibility when the command is used

Code:
    internal class VanishCommand : Command
    {
        public VanishCommand()
        : base("vanish", 1)
        {
        }


        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (!player.isNotVisible)
            {
                player.isNotVisible = true;
                player.Owner.PlayersCollision.Remove(player);
                if (player.Pet != null)
                    player.Owner.LeaveWorld(player.Pet);
                player.ApplyConditionEffect(new ConditionEffect
                {
                    Effect = ConditionEffectIndex.Invincible,
                    DurationMS = -1
                });
                player.ApplyConditionEffect(new ConditionEffect
                {
                    Effect = ConditionEffectIndex.Invisible,
                    DurationMS = -1
                });
                player.SendInfo("You're now hidden from all players!");
                return true;
            }
            player.isNotVisible = false;
            player.ApplyConditionEffect(new ConditionEffect
            {
                Effect = ConditionEffectIndex.Invincible,
                DurationMS = 0
            });
            player.ApplyConditionEffect(new ConditionEffect
            {
                Effect = ConditionEffectIndex.Invisible,
                DurationMS = 0
            });
            player.SendInfo("You're now visible to all players!");
            return true;
        }
    }
Could you add god mode and have it make you invisible? I tried myself but i cant get the 2nd part of the code (vanish) working
Done.
/10chars.
I am having this happen only after the code in, I am guessing it is the GetRemovedEntities
 
SCREENSHOT1


Basically whenever an enemy is killed, it is still there. When you are vanished, sometimes it comes back un-killable

If you leave and come back it is gone.

 
SCREENSHOT2


It is killed but they stay there until you leave and re enter
They also stay on the minimap so if you saw entities from across the world, they stay on your minimap
@Daemonmann

Might be something with GetRemovedEntities
idk for what i have no problems with it :/
my computer got virus when using this code
Quote Originally Posted by Riigged View Post
my computer got virus when using this code
ha.ha.ha, you are very funny
Quote Originally Posted by Riigged View Post
my computer got virus when using this code
XD you got a virus so you got so sick that you thought your pets were hp pots
well can someone fix the command??? the minimap doesnt update when i kill something and it says that the quest is there still after i kill it someone gotta fix it plz xD
Quote Originally Posted by WcCrusher View Post
well can someone fix the command??? the minimap doesnt update when i kill something and it says that the quest is there still after i kill it someone gotta fix it plz xD
Thats player.update.cs
Figure it out
Quote Originally Posted by Desire View Post
Thats player.update.cs
Figure it out
i dont have the patience to try to figure it out xD
Quote Originally Posted by Daemonmann View Post
Hello Friends!

i Have make Vanish Command for FSOD



1 - Go To wServer/Realm/Commands/AdminCommands
2 - Copy This Command Bellow and Paste in AdminCommands
Code:
    internal class VanishCommand : Command
    {
        public VanishCommand()
        : base("vanish", 1)
        {
        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (!player.isNotVisible)
            {
                player.isNotVisible = true;
                player.Owner.PlayersCollision.Remove(player);
                if (player.Pet != null)
                    player.Owner.LeaveWorld(player.Pet);
                player.SendInfo("You're now hidden from all players!");
                return true;
            }
            player.isNotVisible = false;

            player.SendInfo("You're now visible to all players!");
            return true;
        }
    }
3 - Go To wServer/Realm/Entities/Player/Player.cs
4 - Copy And Paste This Code Bellow "private bool resurrecting;"

Code:
        public bool PvP { get; set; }
        public bool isNotVisible = false;
5 - In wServer/Realm/Entities/Player/Player.cs
6 - Copy And Paste This Code Bellow "public void GivePet(PetItem petInfo)"

Code:
        public void Damage(int dmg, Entity chr, bool noDef, bool toSelf = false, float pvpReduction = 0.20f)
        {
            try
            {
                if (HasConditionEffect(ConditionEffects.Paused) ||
                    HasConditionEffect(ConditionEffects.Stasis) ||
                    HasConditionEffect(ConditionEffects.Invincible))
                    return;

                dmg = (int)StatsManager.GetDefenseDamage(dmg, noDef);
                if (chr is Player)
                    dmg = Math.Max(1, (int)(dmg * pvpReduction));
                if (!HasConditionEffect(ConditionEffects.Invulnerable))
                    HP -= dmg;
                UpdateCount++;
                Owner.BroadcastPacket(new DamagePacket
                {
                    TargetId = Id,
                    Effects = 0,
                    Damage = (ushort)dmg,
                    Killed = HP <= 0,
                    BulletId = 0,
                    ObjectId = chr != null ? chr.Id : -1
                }, toSelf ? null : this);
                SaveToCharacter();

                string killerName = chr is Player
                    ? chr.Name
                    : chr != null ? (chr.ObjectDesc.DisplayId ?? chr.ObjectDesc.ObjectId) : "Unknown";

                if (HP <= 0)
                    Death(killerName);
            }
            catch (Exception e)
            {
                log.Error("Error while processing playerDamage: ", e);
            }
        }
7 - In wServer/Realm/Entities/Player/Player.cs
8 - Find "public void Teleport(RealmTime time, TeleportPacket packet)"
9 - Bellow "Color = new ARGB(0xFFFFFFFF)" Copy and Paste

Code:
            }, null);
            if (!isNotVisible)
                Owner.BroadcastPacket(new ShowEffectPacket
                {
                    EffectType = EffectType.Teleport,
                    TargetId = Id,
                    PosA = new Position
                    {
                        X = X,
                        Y = Y
                    },
                    Color = new ARGB(0xFFFFFFFF)
                }, null);
        }
10 - Go to wServer/Realm/Entities/Player/Player.Update.cs
11 - In Any Line, Copy and Paste This Code

Code:
             private IEnumerable<int> GetRemovedEntities()
        {
            foreach (Entity i in clientEntities.Where(i => i is Player))
            {
                    if ((i as Player).isNotVisible && i != this && !PvP)
                {
                    yield return i.Id;
                }
                if (i is Player && i.Owner != null) continue;
                if (MathsUtils.DistSqr(i.X, i.Y, X, Y) > SIGHTRADIUS * SIGHTRADIUS &&
                    !(i is StaticObject && (i as StaticObject).Static) &&
                    i != Quest)
                {
                    if (i is Pet) continue;
                    yield return i.Id;
                }
                else if (i.Owner == null)
                    yield return i.Id;

                if ((i as Player).isNotVisible && i != this && !PvP)
                    yield return i.Id;
            }
        }
            }
        }
 
"than this serve?" Gifs



 
Credits
Serap's Domain Source, this is coded by SD, but i have converted to FSOD!
lol took from sd and used in fsod tut tut my man
Posts 16–30 of 45 · Page 2 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us