viewing paste Unknown #21139 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
-----------------------------------
-- onMobFight Action
-----------------------------------
 
function onMobFight(mob,target)
    local Wings = mob:getLocalVar("Wings");
    local popTime = mob:getLocalVar("lastPetPop");
    
    if (os.time() - popTime > 300) then
        local alreadyPopped = false;
        for Helper = mob:getID()+1, mob:getID()+2 do
            if (alreadyPopped == true) then
                break;
            else
                if (GetMobAction(Helper) == ACTION_NONE or GetMobAction(Helper) == ACTION_SPAWN) then
                    SpawnMob(Helper, 300):updateEnmity(target);
                    mob:setLocalVar("lastPetPop", os.time());
                    alreadyPopped = true;
                end
            end
        end
    end
 
    if (mob:getBattleTime() - mob:getLocalVar("Wings") > 180) then
        if (mob:AnimationSub() == 1) then
           if (GetMobAction(Helper) == ACTION_NONE or GetMobAction(Helper) == ACTION_SPAWN) then        
               mob:useMobAbility(1026);
               mob:setLocalVar("Wings", mob:getBattleTime());
           end    
        elseif (mob:AnimationSub() == 2) then
           mob:AnimationSub(1); -- fly
           mob:addStatusEffectEx(EFFECT_ALL_MISS, 0, 1, 0, 0);
           mob:SetMobSkillAttack(true);
           mob:setLocalVar("Wings", mob:getBattleTime());
        elseif (mob:AnimationSub() == 0) then
           mob:AnimationSub(1); -- fly
           mob:addStatusEffectEx(EFFECT_ALL_MISS, 0, 1, 0, 0);
           mob:SetMobSkillAttack(true);
           mob:setLocalVar("Wings", mob:getBattleTime());
       end
    end
end;
 
Viewed 651 times, submitted by Guest.