function TEST_Threat_AI.DoCastRandomChance(LuaAI, target, chance, spellID) local letsDoSpell = rand_range(1,100) if (letsDoSpell >= (100 - chance) ) then if( spellID > 0 ) then LuaAI:DoStopAttack(); -- stopped attack to cast --need to make mob start cast here (emote with spell gfx) -- add if hit check and random cast time reset LuaAI:DoCast(target, spellID); --start attack again LuaAI:DoStartAttack(target); end end end