コード例 #1
0
    public static bool HasDebuffType(this WoWUnit unit, string type)
    {
        string luaString = @"hasDebuff = false;
        for i=1,40 do
	        local _, _ debuffType = UnitDebuff(""{1}"", i);
            if debuffType == ""{0}"" then
                hasDebuff = true
                break;
            end
        end";
        return Lua.LuaDoString<bool>(FormatLua(luaString, type, CombatUtil.GetLuaId(unit)), "hasDebuff");
    }
コード例 #2
0
    public static bool IsPlayer(this WoWUnit unit)
    {
        string luaString = @"isPlayer = (UnitIsPlayer(""{0}"") == 1)";

        return(Lua.LuaDoString <bool>(FormatLua(luaString, CombatUtil.GetLuaId(unit)), "isPlayer"));
    }
コード例 #3
0
    public static bool IsCreatureType(this WoWUnit unit, string type)
    {
        string luaString = @"isCreatureType = (UnitCreatureType(""{1}"") == ""{0}"" or false);";

        return(Lua.LuaDoString <bool>(FormatLua(luaString, type, CombatUtil.GetLuaId(unit)), "isCreatureType"));
    }
コード例 #4
0
    public static bool HasMana(this WoWUnit unit)
    {
        string luaString = @"return (UnitPowerType(""{0}"") == 0 and UnitMana(""{0}"") > 1)";

        return(Lua.LuaDoString <bool>(FormatLua(luaString, CombatUtil.GetLuaId(unit))));
    }