Exemplo n.º 1
0
    public static PacketWriter TextBanner(EventBannerType type, string script, int duration)
    {
        PacketWriter pWriter = PacketWriter.Of(SendOp.MASSIVE_EVENT);

        pWriter.Write(MassiveEventPacketMode.TextBanner);
        pWriter.Write(type);
        pWriter.WriteUnicodeString(script);
        pWriter.WriteInt(duration);
        return(pWriter);
    }
Exemplo n.º 2
0
    public void SetEventUI(byte typeId, string script, int duration, string box)
    {
        if (typeId == 0)
        {
            // EventUI is a Round Bar UI
            string[] ids = script.Split(",");
            if (ids.Length == 2)
            {
                Field.BroadcastPacket(MassiveEventPacket.RoundBar(int.Parse(ids[0]), int.Parse(ids[1]), 1));
                return;
            }

            Field.BroadcastPacket(MassiveEventPacket.RoundBar(int.Parse(ids[0]), int.Parse(ids[1]), int.Parse(ids[2])));
            return;
        }

        EventBannerType type = EventBannerType.None;

        switch (typeId)
        {
        case 1:
            type = EventBannerType.None;
            break;

        case 3:
            type = EventBannerType.Winner;
            break;

        case 4:
            type = EventBannerType.Lose;
            break;

        case 6:
            type = EventBannerType.Bonus;
            break;
        }

        if (box is "0" or "")
        {
            Field.BroadcastPacket(MassiveEventPacket.TextBanner(type, script, duration));
            return;
        }

        MapTriggerBox triggerBox;
        int           boxId;

        if (box.Contains('!'))
        {
            box        = box[1..];