05-16-2020, 12:33 PM
Macro od Single/Multi Target Spell ma mały błąd odnośnie Multi Target. Minimalna liczba mobów to 3 żeby użyło Multi, problem w tym, że skrypt nie sprawdza czy na ekranie jest 3 LUB WIĘCEJ mobów, tylko czy jest DOKŁADNIE 3.
Poprawione kod.
Poprawione kod.
Code:
macro(1000, "Single/Multi Target Spell", function()
local specAmount = 0
local isSafe = true;
if not g_game.isAttacking() then
return
end
for i,mob in ipairs(getSpectators()) do
if (getDistanceBetween(player:getPosition(), mob:getPosition()) <= distance and mob:isMonster()) then
specAmount = specAmount + 1
end
if (mob:isPlayer() and player:getName() ~= mob:getName()) then
isSafe = false;
end
end
if (specAmount >= amountOfMonsters and isSafe) then
say(storage.Spell2, 250)
else
say(storage.Spell1, 250)
end
end, batTab)