Esempio n. 1
0
        public void Hit(Character character, short actionDelay, int skillID)
        {
            ReactorState state = States[State];

            switch (state.Type)
            {
            case ReactorConstants.ReactorEventType.PlainAdvanceState:
            {
                State = state.NextState;

                if (State == States.Length - 1)         // TODO: Is this the correct way of doing this?
                {
                    Map.Reactors.Remove(this);
                }
                else
                {
                    using (Packet oPacket = new Packet(ServerOperationCode.ReactorChangeState))
                    {
                        oPacket
                        .WriteInt(ObjectID)
                        .WriteByte(State)
                        .WriteShort(Position.X)
                        .WriteShort(Position.Y)
                        .WriteShort(actionDelay)
                        .WriteByte()             // NOTE: Event index.
                        .WriteByte(4);           // NOTE: Delay.

                        Map.Broadcast(oPacket);
                    }
                }
            }
            break;
            }
        }
Esempio n. 2
0
 public Reactor(Datum datum) : base()
 {
     MapleID = (int)datum["reactorid"];
     Label   = string.Empty; // TODO: Is this even relevant?
     State   = 0;
     States  = new ReactorState[(sbyte)datum["max_states"]];
 }