Ok I tried to fix it by myself before use the ready code

I have a problem with the summon levels. Here is the ai and the data for the first level of kat the cat. The problem is that I set the level to 18 and the cat that is summoned is 22. I can't explain why.
AI.obj (Skill)
Code:
class summon_heal : default_npc
parameter_define_begin
int HealMagic 1030401
parameter_define_end
handler 13 // CREATED
variable_begin
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
shift_sp 1
push_const xx.xx0000
func_call 14 // func[AddPetDefaultDesire_Follow]
shift_sp -1
shift_sp -1
handler_end
handler 0 // NO_DESIRE
variable_begin
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
shift_sp 1
push_const xx.xx0000
func_call 14 // func[AddPetDefaultDesire_Follow]
shift_sp -1
shift_sp -1
handler_end
handler 32 // MENU_SELECTED
variable_begin
"ask"
"reply"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
shift_sp 1
push_parameter HealMagic
func_call 155 // func[Skill_GetConsumeMP]
shift_sp -1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // mp
push_const 352
add
fetch_d
less
push_reg_sp
fetch_i
branch_false L2092
shift_sp 1
push_parameter HealMagic
func_call 154 // func[Skill_GetConsumeHP]
shift_sp -1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // hp
push_const 344
add
fetch_d
less
and
push_reg_sp
fetch_i
branch_false L2092
shift_sp 1
push_parameter HealMagic
func_call 160 // func[Skill_InReuseDelay]
shift_sp -1
push_const 0
equal
and
L2092
branch_false L2094
L2093
shift_sp 1
push_parameter HealMagic
func_call 155 // func[Skill_GetConsumeMP]
shift_sp -1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // mp
push_const 352
add
fetch_d
less
push_reg_sp
fetch_i
branch_false L2095
shift_sp 1
push_parameter HealMagic
func_call 154 // func[Skill_GetConsumeHP]
shift_sp -1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // hp
push_const 344
add
fetch_d
less
and
push_reg_sp
fetch_i
branch_false L2095
shift_sp 1
push_parameter HealMagic
func_call 160 // func[Skill_InReuseDelay]
shift_sp -1
push_const 0
equal
and
L2095
branch_false L2097
L2096
shift_sp 1
push_event // myself
push_const 28
add
fetch_i // master
push_const 2404
add
fetch_i
push_parameter HealMagic
push_const 1
push_const 1
push_const 1000000
func_call 10 // func[AddUseSkillDesire]
shift_sp -5
shift_sp -1
L2097
L2094
handler_end
class_end
AI.obj (Kat the Cat main)
Code:
class cat_the_cat : summon_heal
handler 10 // MY_DYING
variable_begin
"c0"
"c1"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // c0
push_const 272
add
push_reg_sp
fetch_i
shift_sp 1
func_call 83 // func[GetLastAttacker]
assign
shift_sp -1
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005103
equal
branch_false L45754
L45753
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45756
L45755
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45757
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3371
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45757
branch_false L45759
L45758
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3373
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9848. "ItemSound.quest_itemget"
push_string S9848
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3371
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3371
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3370
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3370
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45759
L45756
jump L45760
L45754
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005102
equal
branch_false L45762
L45761
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45764
L45763
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45765
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3361
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45765
branch_false L45767
L45766
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3363
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9849. "ItemSound.quest_itemget"
push_string S9849
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3361
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3361
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3360
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3360
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45767
L45764
jump L45768
L45762
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005105
equal
branch_false L45770
L45769
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45772
L45771
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45773
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3366
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45773
branch_false L45775
L45774
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3368
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9850. "ItemSound.quest_itemget"
push_string S9850
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3366
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3366
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3365
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3365
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45775
L45772
jump L45776
L45770
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005106
equal
branch_false L45778
L45777
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45780
L45779
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45781
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3376
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45781
branch_false L45783
L45782
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3378
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9851. "ItemSound.quest_itemget"
push_string S9851
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3376
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3376
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3375
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3375
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45783
L45780
jump L45784
L45778
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005107
equal
branch_false L45786
L45785
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45788
L45787
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45789
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3386
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45789
branch_false L45791
L45790
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3388
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9852. "ItemSound.quest_itemget"
push_string S9852
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3386
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3386
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3385
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3385
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45791
L45788
jump L45792
L45786
push_event // c0
push_const 272
add
fetch_i // npc_class_id
push_const 1620
add
fetch_i
push_const 1005104
equal
branch_false L45794
L45793
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
branch_false L45796
L45795
push_event // c1
push_const 276
add
push_reg_sp
fetch_i
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // master
push_const 1684
add
fetch_i
assign
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 230
func_call 59 // func[HaveMemo]
shift_sp -2
push_reg_sp
fetch_i
branch_false L45797
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3381
func_call 81 // func[OwnItemCount]
shift_sp -2
and
L45797
branch_false L45799
L45798
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3383
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
S9853. "ItemSound.quest_itemget"
push_string S9853
func_call 173 // func[SoundEffect]
shift_sp -2
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3381
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3381
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3380
shift_sp 1
push_event // c1
push_const 276
add
fetch_i
push_const 3380
func_call 81 // func[OwnItemCount]
shift_sp -2
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L45799
L45796
L45794
L45792
L45784
L45776
L45768
L45760
call_super
handler_end
class_end
Skilldata.txt (Summon Skill)
Code:
skill_begin skill_name = [s_summon_blackcat1] /* [?? ? ? ?] */ skill_id = 1111 level = 1 operate_type = A1 magic_level = 20 effect = {{i_summon;[cat_the_cat_a];70}} operate_cond = {{can_summon}} is_magic = 1 mp_consume1 = 8 mp_consume2 = 31 item_consume = {[crystal_d];3} cast_range = -1 effective_range = -1 skill_hit_time = 6 skill_cool_time = 0 skill_hit_cancel_time = 0.5 reuse_delay = 60 attribute = attr_none effect_point = 0 target_type = self affect_scope = single next_action = none skill_end
Skilldata.txt (Summon's Special Skill)
Code:
skill_begin skill_name = [s_cat_recharge1] /* [??????] */ skill_id = 4025 level = 1 operate_type = A1 magic_level = 10 effect = {{i_mp_by_level;23}} is_magic = 1 mp_consume1 = 5 mp_consume2 = 19 cast_range = 400 effective_range = 600 skill_hit_time = 2.5 skill_cool_time = 0 skill_hit_cancel_time = 0.5 reuse_delay = 8 attribute = attr_none effect_point = 137 target_type = target affect_scope = single next_action = none skill_end
Npcdata.txt (first level of kat the cat servitor)
Code:
npc_begin summon 12006 [cat_the_cat_a] level=18 exp=1242547 acquire_exp_rate=0.3 undying=0 can_be_attacked=0 acquire_sp=3 race=humanoid sex=male temper=100 safe_height=100 org_jump=15 skill_list={@s_summon_magic_defence} magic_list={} max_item=50 item_make_list={} corpse_make_list={} additional_make_list={} additional_make_multi_list={} slot_chest=[] slot_rhand=[] slot_lhand=[] base_attack_type=fist base_can_penetrate=0 base_attack_range=40 base_damage_range={0;0;80;120} base_rand_dam=7 str=40 int=21 dex=30 wit=20 con=43 men=25 hp_increase=40 mp_increase=7 org_hp_regen=4 org_mp_regen=1.5 ground_low={80;0;10} ground_high={120;-30;30} underwater_low={50;0;10} underwater_high={0;0;30} fly_low={0;0;10} fly_high={0;-30;30} float_low={0;0;10} float_high={0;-30;10} org_earshot=100 sight={0;0;2500;120;5} agro_range=1000 org_hp=3xx.xx2109826547 org_mp=219 base_defend=xx.xx79129306508 base_magic_attack=xx.xx04424953224 base_magic_defend=xx.xx23247609444 base_physical_attack=xx.xx33694157268 physical_hit_modify=3.75 physical_avoid_modify=0 base_attack_speed=257 base_reuse_delay=0 base_critical=4 magic_use_speed_modify=0 status={normal} align=-484 collision_radius=9 collision_height=16 category={} clan={} clan_help_range=300 guild={} pledge={} pledge_leader=0 alliance={} alliance_leader=0 ignore_clan_list={} ruler=0 ruling_domain={} npc_ai={[cat_the_cat];{[HealMagic]=@s_cat_recharge1}} corpse_time=7 no_sleep_mode=0 npc_end
I can't explain why the servitor's levels are wrong