All pastes #390074 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-11 03:33 UTC
rendered paste body
function TEST_Threat_AI.DoCastRandomChance(LuaAI, target, chance, spellID, casttime)
	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
                        -- is this right? LuaAI:SetUpdateInterval(casttime)
			LuaAI:DoCast(target, spellID);
			--start attack again
			LuaAI:DoStartAttack(target);
		end
	end

end