hello, i try to do something, i want the following class use randomly 1 of his 3 skills when we attack him:
Code:
class myclass : parent_class
parameter_define_begin
int SkillPch0 278018 // s_haste2
int SkillPch1 308226 // s_wind_walk2
int SkillPch2 271107 // s_empower3
int NbSkills 2
parameter_define_end
handler 1 // ATTACKED
variable_begin
"attacker"
"damage"
"i0"
"c0"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
...
push_event // i0
push_const 192
add
push_reg_sp
fetch_i
shift_sp 1
push_parameter NbSkills // 2 [0-2]
func_call 55 // Rand
shift_sp -1
assign
shift_sp -1
L18600
push_event // i0
push_const 192 //
add //
fetch_i //
push_const 0 // if i0 <= 0
less_equal
branch_false L18601
shift_sp 1
push_parameter SkillPch0
func_call 155 // func[Skill_GetConsumeMP]
shift_sp -1
jump L18603
L18601
push_event // i0
push_const 192 //
add //
fetch_i //
push_const 1 // if i0 = 1
equal
branch_false L18602
shift_sp 1
push_parameter SkillPch1
func_call 155 // func[Skill_GetConsumeMP]
shift_sp -1
jump L18603
L18602
push_event // i0
push_const 192 //
add //
fetch_i //
push_const 2 // if i0 >= 2
greater_equal
branch_false L18603
shift_sp 1
push_parameter SkillPch2
func_call 155 // func[Skill_GetConsumeMP]
shift_sp -1
jump L18603
L18603
...
handler_end
end_class
and it doesnt work every time :? any idea ?
Tx in advance