All pastes #448209 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-19 14:48 UTC
rendered paste body
namespace eval ::Onyxia {
	proc CanCast { npc victim } {
		set mobh [ ::GetHealthPCT $npc ]
		set spell_list "18431 20677 18435 20228"
		# Bellowing Roar, Flame Breath, Cleave, Pyroblast
		set spellid [ ::AI::Check $npc $victim 18116 ]
		# Anti-Stun
		if { $spellid == 0 } {
			set spellid [ ::AI::Check $npc $victim 18435 ]
			# Flame Breath
		}
		if { $mobh <= 30 && $spellid == 0 } {
			Emote $npc 254;
			set spellid [ ::AI::Check $npc $victim 17131 ]
			# Hover
		}
		if { $mobh <= 60 && $mobh > 30 && $spellid == 0 } {
			set spellid [ ::AI::Check $npc $victim 20172 ]
			# Spawn Whelps
		}

		if { $spellid == 0 } {
			set spellid [ lindex $spell_list [ expr { int( rand() * [ llength $spell_list ] ) } ] ]
		}
		return [ ::AI::Cast $npc $victim $spellid ]
	}
}