View Single Post
Old 19.05.2007, 15:03   #2
Drego
Архивный участник
 
Join Date: Apr 2006
Posts: 23
Default

Quote:
Originally Posted by andreagighi View Post
Here AI Code Summon for summon_friends skill as retail with item check...
(u need to change id 1061 with summon crystal id)

to add in handler attacked on summon

variable_begin
"skill_name_id"
"myself"
"party0"
"c0"
"c1"
"i0"
"i1"
"attacker"
variable_end


push_event // skill_name_id
push_const 180
add
fetch_i4
push_const 256
div
push_const 1403 //<--- id skill RECALL PARTY MEMBER
equal
push_reg_sp
fetch_i
branch_false L245486


push_event // party0
push_const 400
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i
push_event // attacker
push_const 48
add
fetch_i
func_call 184615033 // func[GetParty]
shift_sp -1
assign
shift_sp -1

push_event // myself
push_const 704
add
fetch_i
push_event // party0
push_const 400
add
fetch_i
func_call 184614916 // func[IsNullParty]
shift_sp -1
branch_true L245486 //END

push_event // c1
push_const 352
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i
push_event // party0
push_const 400
add
fetch_i
func_call 184615027 // func[GetLeaderOfParty]
shift_sp -1
assign
shift_sp -1

L245449
push_event // i1
push_const 264
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i
push_event // c1
push_const 352
add
fetch_i
func_call 184615024 // func[Party_GetCount]
shift_sp -1
assign4
shift_sp -1

push_event // i1
push_const 264
add
fetch_i4
push_const 0
equal
branch_false L245451 //PARTY EXIST JUMP
L245450
//NO MARTINI NO PARTYYYYY
jump L245486
//EXIT NO SKILL TO DO
L245451
push_event // i0
push_const 260
add
push_reg_sp
fetch_i
push_const 0
assign4
fetch_i4
shift_sp -1
//i0=0
L245483
push_event // i0
push_const 260
add
fetch_i4
push_event // i1
push_const 264
add
fetch_i4
less
branch_false L245486
jump L245485
//i0<i1
L245484
push_event // i0
push_const 260
add
push_reg_sp
fetch_i
push_reg_sp
fetch_i
fetch_i4
push_const 1
add
assign4
fetch_i4
shift_sp -1
jump L245483
//i0=i0+1
L245485
push_event // c0
push_const 344
add
push_reg_sp
fetch_i
push_event // myself
push_const 704
add
fetch_i
push_event // c1
push_const 352
add
fetch_i
push_event // i0
push_const 260
add
fetch_i4
func_call 184680561 // func[Party_GetCreature]
shift_sp -2
assign
shift_sp -1
L245490
push_event // myself
push_const 704
add
fetch_i
push_event // c0
push_const 344
add
fetch_i
push_const 1061 //CHECK SUMMON CRYSTAL
func_call 184680579 // func[OwnItemCount]
shift_sp -2
push_const 0
equal
branch_true L245493 //NO SUMMON CRYSTAL
L245492
push_event // myself
push_const 704
add
fetch_i
push_event // c0
push_const 344
add
fetch_i
push_const 1061 //DELETE SUMMON CRYSTAL
push_const 1
func_call 184746114 // func[DeleteItem1]
shift_sp -3
shift_sp -1

//TELEPORT PG TO SUMMON

push_event // myself
push_const 704
add
fetch_i
push_event // c0
push_const 344
add
fetch_i

push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // x
push_const 8
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1

push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // y
push_const 16
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1

push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // z
push_const 24
add
fetch_d
func_call 184615005 // func[FloatToInt]
shift_sp -1

func_call 184811596 // func[InstantTeleport]
shift_sp -4
shift_sp -1

//----------------------------

L245493
jump L245484 //JUMP A i0=i0+1

L245486 //END FOR I
Won't work... The use of "positive" skill on your summon does not execute "Attacked" handler.
And, this version does not prevent user to be summoned from Olympiad (e.g. when he's loosing), and that's a big-big bug...
Drego is offline