Skip to content
User Avatar
#1864
Auto-translated
Hmm, indeed. Previously, following the manuals, I would replenish mana and set a delay of sleep(1), but the spell cast after that wouldn't go through. I increased the delay by an order of magnitude – the creature gained mana, and the spell was cast. However, the desynchronization of the battlefield and the ATB scale remains the same as I described.
Simplified code:
function DefenderCreatureMove(unit)
local last_mana = GetUnitManaPoints(unit);
SetUnitManaPoints(unit, 100);
sleep(30);
local player_units = GetCreatures(ATTACKER);
UnitCastAimedSpell(unit, SPELL_BLIND, player_units[0]);
sleep(1);
SetUnitManaPoints(unit, last_mana);
end


Added 22 minutes later
Although it seems that there is some more general mechanic at play here – when I cast a regular spell with a hero, the remaining duration of its effect also differs if you look at it through the creature on the battlefield and through the icon on the scale. But it occasionally synchronizes.