private static void CastingEventHandler(LuaEventsId id, List <string> args)
    {
        switch (id)
        {
        case LuaEventsId.SPELLCAST_CHANNEL_START:
            //spellname is Channeling
            _lastSpell         = args[1];
            _lastCastTimeStamp = DateTime.Now.AddMilliseconds(double.Parse(args[0]));
            break;

        case LuaEventsId.SPELLCAST_START:
            _lastSpell         = args[0];
            _lastCastTimeStamp = DateTime.Now.AddMilliseconds(double.Parse(args[1]));
            break;

        case LuaEventsId.SPELLCAST_DELAYED:
            _lastCastTimeStamp = _lastCastTimeStamp.AddMilliseconds(double.Parse(args[0]));
            break;

        case LuaEventsId.SPELLCAST_CHANNEL_UPDATE:
            _lastCastTimeStamp = DateTime.Now.AddMilliseconds(double.Parse(args[0]));
            break;

        case LuaEventsId.SPELLCAST_CHANNEL_STOP:
        case LuaEventsId.SPELLCAST_STOP:
        case LuaEventsId.SPELLCAST_INTERRUPTED:
        case LuaEventsId.SPELLCAST_FAILED:
            _lastCastTimeStamp = DateTime.Now;
            _lastSpell         = null;
            break;
        }
    }
Esempio n. 2
0
    private void EventsLuaWithArgsOnOnEventsLuaWithArgs(LuaEventsId id, List <string> args)
    {
        //Main.LuaPrint("PF: " + id.ToString() + " /" + args[0] + " /" + args[1] + " /" + args[2]);

        if (id.ToString() == "CHAT_MSG_ADDON")
        {
            //https://wrobot.eu/bugtracker/code-doesnt-stop-fighting-complete-r1236/

            string prefix  = args[0];
            string message = args[1];
            string sender  = args[3];

            if (prefix != ObjectManager.Me.Name)
            {
                return;
            }
            else
            {
                Main.LuaPrint(sender + " told me to " + message + " ..MyName: " + ObjectManager.Me.Name);
            }


            //Main.LuaPrint("msg: " + prefix + message + sender + "  MyName:" + ObjectManager.Me.Name);

            foreach (var c in PartyChatCommandSettings.CurrentSetting.Commands)
            {
                if (c.IsValid() && string.Equals(c.CommandChat.Trim(), message, StringComparison.CurrentCultureIgnoreCase))
                {
                    c.Run();
                    break;
                }
            }
        }
    }
    private void CastingEventHandler(LuaEventsId id, List <string> args)
    {
        switch (id)
        {
        case LuaEventsId.SPELLCAST_START:
            _LastSpell         = args[0];
            _LastCastTimeStamp = DateTime.Now.AddMilliseconds(double.Parse(args[1]));
            break;

        case LuaEventsId.SPELLCAST_DELAYED:
            _LastCastTimeStamp = _LastCastTimeStamp.AddMilliseconds(double.Parse(args[0]));
            break;
        }
    }