Results 1 to 10 of 10
  1. #1
    HGAEHaeheadhetdhtertherh's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    281
    Reputation
    10
    Thanks
    199

    [FSOD] Grenade Fix

    replace Grenade.cs with this
    Code:
    #region
    
    using System;
    using wServer.networking.svrPackets;
    using wServer.realm;
    using wServer.realm.entities;
    using wServer.realm.entities.player;
    
    #endregion
    
    namespace wServer.logic.behaviors
    {
        public class Grenade : Behavior
        {
            //State storage: cooldown timer
    
            private readonly int damage;
            private readonly float radius;
            private readonly double range;
            private Cooldown coolDown;
            private double? fixedAngle;
    
            public Grenade(double radius, int damage, double range = 5,
                double? fixedAngle = null, Cooldown coolDown = new Cooldown())
            {
                this.radius = (float) radius;
                this.damage = damage;
                this.range = range;
                this.fixedAngle = fixedAngle*Math.PI/180;
                this.coolDown = coolDown.Normalize();
            }
    
            protected override void OnStateEntry(Entity host, RealmTime time, ref object state)
            {
                state = 0;
            }
    
            protected override void TickCore(Entity host, RealmTime time, ref object state)
            {
                int cool = (int) state;
    
                if (cool <= 0)
                {
                    if (host.HasConditionEffect(ConditionEffectIndex.Stunned)) return;
    
                    Entity player = host.GetNearestEntity(range, null);
                    if (player != null || fixedAngle != null)
                    {
                        Position target;
                        if (fixedAngle != null)
                            target = new Position
                            {
                                X = host.X + (float)(range * Math.Cos(fixedAngle.Value)),
                                Y = host.Y + (float)(range * Math.Sin(fixedAngle.Value)),
                            };
                        else
                            target = new Position
                            {
                                X = player.X,
                                Y = player.Y,
                            };
                        host.Owner.BroadcastPacket(new ShowEffectPacket
                        {
                            EffectType = EffectType.Throw,
                            Color = new ARGB(0xffff0000),
                            TargetId = host.Id,
                            PosA = target
                        }, null);
                        host.Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                        {
                            world.BroadcastPacket(new AOEPacket
                            {
                                Position = target,
                                Radius = radius,
                                Damage = (ushort) damage,
                                EffectDuration = 0,
                                Effects = 0,
                                OriginType = (short)host.ObjectType
                            }, null);
                            world.Aoe(target, radius, true, p => { (p as IPlayer).Damage(damage, host as Character); });
                        }));
                    }
                    cool = coolDown.Next(Random);
                }
                else
                    cool -= time.thisTickTimes;
    
                state = cool;
            }
        }
    }
    Simple Fix by Me
    Last edited by HGAEHaeheadhetdhtertherh; 01-03-2017 at 03:25 AM.

  2. The Following User Says Thank You to HGAEHaeheadhetdhtertherh For This Useful Post:

    The Real DethStrike (10-09-2017)

  3. #2
    Wojtasowy1234's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Posts
    75
    Reputation
    10
    Thanks
    12
    My Mood
    Amazed
    this work for SD?

  4. The Following User Says Thank You to Wojtasowy1234 For This Useful Post:

    HGAEHaeheadhetdhtertherh (01-03-2017)

  5. #3
    LegumI's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Posts
    340
    Reputation
    10
    Thanks
    131
    My Mood
    Blah
    Quote Originally Posted by Wojtasowy1234 View Post
    this work for SD?
    this say FSOD in title?
    meaning no, it won't work, you can try but i highly doubt

  6. #4
    sgrawsreghawrhgwrhgr's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    UK
    Posts
    516
    Reputation
    10
    Thanks
    727
    My Mood
    Angelic
    Probably will work on SD considering how small the change is

  7. The Following User Says Thank You to sgrawsreghawrhgwrhgr For This Useful Post:

    HGAEHaeheadhetdhtertherh (01-03-2017)

  8. #5
    HGAEHaeheadhetdhtertherh's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    281
    Reputation
    10
    Thanks
    199
    should work on sd too
    FSOD because tested on fsod xd

  9. #6
    Moorz's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Location
    Behind a computer
    Posts
    245
    Reputation
    10
    Thanks
    16
    it might work but might have to make a bit of changes, as i have never fooled around with SD i do not know but i know there is a dif.

  10. #7
    NigrKiller's Avatar
    Join Date
    Nov 2016
    Gender
    male
    Location
    Willy's Realm
    Posts
    85
    Reputation
    10
    Thanks
    52
    What was wrong with them if you dont mind me asking?

  11. #8
    Desire's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Insert Name Here
    Posts
    1,039
    Reputation
    58
    Thanks
    1,394
    My Mood
    Amused
    Quote Originally Posted by NigrKiller View Post
    What was wrong with them if you dont mind me asking?
    I believe adding a fixed angle made them buggy
    Last edited by Desire; 01-08-2017 at 01:07 AM.
    im not really back nor will i ever get back into developing pservers
    though ill check once every month atleast


     

  12. #9
    HGAEHaeheadhetdhtertherh's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    281
    Reputation
    10
    Thanks
    199
    nope, its work perfect on golden oryx grenade phase

  13. #10
    samuepop124's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Can i add you on skype?
    I have some problems with setting up your server..
    Skype: Samuepop

Similar Threads

  1. [FSOD] Davy Jones Fixed.
    By MikeRaarupBirk in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 13
    Last Post: 10-14-2016, 09:19 AM
  2. [Help Request] How to replace/fix FSOD dungeons?
    By ZombiJordan in forum Realm of the Mad God Private Servers Help
    Replies: 2
    Last Post: 09-02-2016, 05:10 AM
  3. [Help Request] how to fix buy gold FSOD
    By OGgurk in forum Realm of the Mad God Private Servers Help
    Replies: 3
    Last Post: 06-06-2016, 06:36 PM
  4. FSoD Paladin Seal fix
    By Masternx in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 15
    Last Post: 05-07-2016, 01:29 AM
  5. grenades
    By gothgod in forum General Game Hacking
    Replies: 5
    Last Post: 12-29-2005, 11:54 AM