Results 1 to 1 of 1
  1. #1
    dewewe's Avatar
    Join Date
    Feb 2017
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    3

    RotMG [NR-Core] OpenGate Function

    This can allow static objects to despawn! I would like to give credit to @Matrix1101 for the original code, although the code was typed in FsoD, I have altered the code a bit to resolve errors.

    you put this in the behavior you want,
    ------------------------------------------------------
    new OpenGate("SNR Wen Br Bookshelf Gate")


    make a new file in behaviors folder
    ------------------------------------------------------
    using System;
    using wServer.realm;
    using wServer.realm.entities;

    namespace wServer.logic.behaviors
    {
    public class OpenGate : Behavior
    {
    private int xMin;
    private int xMax;
    private int yMin;
    private int yMax;

    private string target;
    private int area;

    private bool usearea;

    public OpenGate(int xMin, int xMax, int yMin, int yMax)
    {
    this.xMin = xMin;
    this.xMax = xMax;
    this.yMin = yMin;
    this.yMax = yMax;
    }

    public OpenGate(string target, int area = 10)
    {
    this.target = target;
    this.area = area;
    this.usearea = true;
    }

    protected override void TickCore(Entity host, RealmTime time, ref object state)
    {
    if (usearea)
    {
    for (int x = (int)host.X - area; x <= (int)host.X + area; x++)
    {
    for (int y = (int)host.Y - area; y <= (int)host.Y + area; y++)
    {
    var tile = host.Owner.Map[x, y];
    if (tile.ObjType == host.Manager.Resources.GameData.IdToObjectType[target])
    {
    tile.ObjType = 0;
    host.Owner.Map[x, y] = tile;
    }
    }
    }
    }
    else
    {
    for (int x = xMax; x <= xMax; x++)
    {
    for (int y = yMin; y <= yMax; y++)
    {
    var tile = host.Owner.Map[x, y];
    tile.ObjType = 0;
    host.Owner.Map[x, y] = tile;
    }
    }
    }
    }
    }
    }

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

    jone112233 (03-27-2020)

Similar Threads

  1. RotMG [NR-Core] Vault Slot Unlocker + Character Slot Unlocker
    By dewewe in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 5
    Last Post: 06-29-2020, 04:25 PM
  2. Warrock and dual cores
    By svalkur in forum WarRock - International Hacks
    Replies: 10
    Last Post: 11-20-2007, 01:46 PM
  3. Replies: 8
    Last Post: 07-09-2007, 03:15 PM
  4. Disable some of punkbuster's functions.
    By System79 in forum Game Hacking Tutorials
    Replies: 3
    Last Post: 09-06-2006, 11:32 PM