All pastes #427362 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-06 19:03 UTC
rendered paste body
function TEST_Threat_AI.DoCastRandomChance(LuaAI, target, chance, spellID, casttime1)
	local letsDoSpell = rand_range(1,100)
	data.casting = 0
	if ( letsDoSpell >= ( 100 - chance ) ) and ( spellID > 0 ) then
		-- 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:GetCreature():StopMoving();
		--LuaAI:GetCreature():HandleEmoteCommand(EMOTE_STATE_SPELLPRECAST)
		--LuaAI:SetUpdateInterval(casttime1)
		LuaAI:DoCast(target, spellID);
		--start attack again
		--LuaAI:DoStartAttack(target);
	end
end