Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 01.12.2005, 01:33   #1
dar55
Архивный участник
 
Join Date: Aug 2005
Posts: 180
Default Help Ai

I have this code
Code:
handler 10	//  MY_DYING
	variable_begin
		"c1"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  c1
	push_const 276
	add
	push_reg_sp
	fetch_i
	shift_sp 1
	func_call 83	//  func[GetLastAttacker]
	assign
	shift_sp -1

	shift_sp 1
	push_event	//  c1
	push_const 276
	add
	fetch_i
	push_const 4629
	func_call 81	//  func[OwnItemCount]
	shift_sp -2
	push_const 0
	equal
	and
	branch_false L7672

	shift_sp 1
	push_event	//  c1
	push_const 276
	add
	fetch_i
	push_const 4630
	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
	push_const 4629
	push_const 1
	func_call 80	//  func[DeleteItem1]
	shift_sp -3
	shift_sp -1
L7672
L7670
	call_super
handler_end
If i kill 1 monster, then all good work. But, if kill many monsters, error...
12/01/2005 04:02:xx.xx1, Kicked for invalid items. (nick)(276)

Who know how fix this error?
dar55 is offline  
Old 01.12.2005, 17:36   #2
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Try this
Code:
handler 10   //  MY_DYING 
   variable_begin 
      "c1" 
      "myself" 
      "_choiceN" 
      "_code" 
      "_from_choice" 
   variable_end 

   push_event   //  c1 
   push_const 276 
   add 
   push_reg_sp 
   fetch_i 
   shift_sp 1 
   func_call 83   //  func[GetLastAttacker] 
   assign 
   shift_sp -1 

   shift_sp 1 
   push_event   //  c1 
   push_const 276 
   add 
   fetch_i 
   push_const 4629 
   func_call 81   //  func[OwnItemCount] 
   shift_sp -2 
   push_const 0 
   equal 
   branch_false L<N>

   shift_sp 1 
   push_event   //  c1 
   push_const 276 
   add 
   fetch_i 
   push_const 4630 
   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 
   push_const 4629 
   push_const 1 
   func_call 80   //  func[DeleteItem1] 
   shift_sp -3 
   shift_sp -1 
L<N>
   call_super 
handler_end
L<N> - must be unique
If u kill many mobs simultaneously, OwnItemCount() will return the items amount to all mobs handler. If mobs count > items count, then ur AI code will try to delete an nonexistent item => error. IMHO
To check the OwnItemCount(), DeleteItem1() func`s work, try this:
...
c1=GetLastAttacker();
SayInt(OwnItemCount(c1));
DeleteItem1(c1,...);
SayInt(OwnItemCount(c1));
...
U should get the same value after both SayInt(OwnItemCount(c1)) functions execution.
IMHO, CacheD.exe
kvoxi is offline  
Old 02.12.2005, 10:21   #3
dar55
Архивный участник
 
Join Date: Aug 2005
Posts: 180
Default

Quote:
Originally Posted by kvoxi
Try this
Code:
handler 10   //  MY_DYING 
   variable_begin 
      "c1" 
      "myself" 
      "_choiceN" 
      "_code" 
      "_from_choice" 
   variable_end 

   push_event   //  c1 
   push_const 276 
   add 
   push_reg_sp 
   fetch_i 
   shift_sp 1 
   func_call 83   //  func[GetLastAttacker] 
   assign 
   shift_sp -1 

   shift_sp 1 
   push_event   //  c1 
   push_const 276 
   add 
   fetch_i 
   push_const 4629 
   func_call 81   //  func[OwnItemCount] 
   shift_sp -2 
   push_const 0 
   equal 
   branch_false L<N>

   shift_sp 1 
   push_event   //  c1 
   push_const 276 
   add 
   fetch_i 
   push_const 4630 
   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 
   push_const 4629 
   push_const 1 
   func_call 80   //  func[DeleteItem1] 
   shift_sp -3 
   shift_sp -1 
L<N>
   call_super 
handler_end
L<N> - must be unique
If u kill many mobs simultaneously, OwnItemCount() will return the items amount to all mobs handler. If mobs count > items count, then ur AI code will try to delete an nonexistent item => error. IMHO
To check the OwnItemCount(), DeleteItem1() func`s work, try this:
...
c1=GetLastAttacker();
SayInt(OwnItemCount(c1));
DeleteItem1(c1,...);
SayInt(OwnItemCount(c1));
...
U should get the same value after both SayInt(OwnItemCount(c1)) functions execution.
IMHO, CacheD.exe
<rus> что что? ниче не понял...хотя в принципе проблема решена уже, там всего то одна масенькая не правильность...и для справки, метка должна быть уникальна исключительно в одном хандлере,т.е. по другому говоря, если эта метка уже где то используется, ничего в этом страшного <rus>
dar55 is offline  
Old 03.12.2005, 10:57   #4
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by dar55
...хотя в принципе проблема решена уже, там всего то одна масенькая не правильность...
How u resolve a problem? Pls, share.
From my experience: two sequential DeleteItem() calls cause client disconnect and L2server error: kicked for invalid items (items more than two in PC inventory)
<rus>Можешь поделиться как ты решил проблему? У меня два вызова подряд функции DeleteItem() вызывают kicked for invalid items, даже тогда когда итемов более двух. PS: в коде, что я привел в своем ответе нет оператора "and". Спасибо за инфу про ссылки<rus>
kvoxi is offline  
Old 09.12.2005, 01:09   #5
dar55
Архивный участник
 
Join Date: Aug 2005
Posts: 180
Default

Quote:
Originally Posted by kvoxi
Quote:
Originally Posted by dar55
...хотя в принципе проблема решена уже, там всего то одна масенькая не правильность...
How u resolve a problem? Pls, share.
From my experience: two sequential DeleteItem() calls cause client disconnect and L2server error: kicked for invalid items (items more than two in PC inventory)
<rus>Можешь поделиться как ты решил проблему? У меня два вызова подряд функции DeleteItem() вызывают kicked for invalid items, даже тогда когда итемов более двух. PS: в коде, что я привел в своем ответе нет оператора "and". Спасибо за инфу про ссылки<rus>
<rus> я решил проблему?) да я ее уже две недели пытаюсь решить)
короче если убивать по одному все отлично пашет. а вот если сразу несколько...) да и заметил еще такую ерунду, что если даже прокатывает убийство большого количества мобов и не кикает, все равно последнее действие это deleteitem. То что я написал выше, что проблема решена, это я погорячился)<rus>

Code:
handler 10   //  MY_DYING 
   variable_begin 
	"c1" 
	"myself" 
	"_choiceN" 
	"_code" 
	"_from_choice" 
   variable_end 

	push_event   //  c1 
	push_const 276 
	add 
	push_reg_sp 
	fetch_i 
	shift_sp 1 
	func_call 83   //  func[GetLastAttacker] 
	assign 
	shift_sp -1 

	shift_sp 1 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  level 
	push_const 888 
	add 
	fetch_i 
	push_const 60 
	less_equal 
	branch_false L900610
L900499 
	push_event	//  c1
	push_const 276
	add 
	fetch_i  
	push_const 2336   //id i_ai0 
	add 
	push_reg_sp 
	fetch_i 
	shift_sp 1 
	push_const 400    
	func_call 55   //  func[Rand] 
	shift_sp -1 
	assign    
	shift_sp -1 

L900500
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4629 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900511
L900501
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4630 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900512 
L900502
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4631 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900513 
L900503
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4632 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900514 
L900504
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4633 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900515 
L900505
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4634 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900516 
L900506
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4635 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900517 
L900507
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4636 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900518 
L900508
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4637 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900519 
L900509
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4638 
	func_call 81   //  func[OwnItemCount] 
	shift_sp -2 
	push_const 1 
	equal
	branch_true L900520

	jump 900610
L900511 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 41
	less 
	branch_true L900525 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 395 
	greater 
	branch_true L900526 
	jump L900610 
L900512 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 39 
	less 
	branch_true L900527 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 394 
	greater 
	branch_true L900528
	jump L900610 
L900513 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 37 
	less 
	branch_true L900529 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 393 
	greater 
	branch_true L900530 
	jump L900610 
L900514 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 35 
	less 
	branch_true L900531

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 392 
	greater 
	branch_true L900532 
	jump L900610 
L900515 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 33 
	less 
	branch_true L900533 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 391 
	greater 
	branch_true L900534 
	jump L900610 
L900516 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 31 
	less 
	branch_true L900535 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 390 
	greater 
	branch_true L900536 
	jump L900610 
L900517 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 26 
	less 
	branch_true L900537 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 389 
	greater 
	branch_true L900538 
	jump L900610 
L900518 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 23 
	less 
	branch_true L900539 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 388 
	greater 
	branch_true L900540 
	jump L900610 
L900519 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 20 
	less 
	branch_true L900541 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 387 
	greater 
	branch_true L900542 
	jump L900610 
L900520 
	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 16 
	less 
	branch_true L900543 

	push_event	//  c1
	push_const 276
	add 
	fetch_i   //  i_ai0 
	push_const 2336 
	add 
	fetch_i 
	push_const 386 
	greater 
	branch_true L900544 
	jump L900610 
L900525
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4630 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900526
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4629 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1
	jump L900600  
L900527
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4631 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900528
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4630 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900529
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4632 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900530
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4631 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900531
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4633 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900532
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4632 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900533
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4634 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900534
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4633 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900535
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4635 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900536
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4634 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900537
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4636
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900538
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4635 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900539
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4637 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900540
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4636 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900541
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4638 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900542
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4637 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900543
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4639 
	push_const 1 
	func_call 77   //  func[GiveItem1] 
	shift_sp -3 
	shift_sp -1
L900544
	shift_sp 1 
	push_event   //  c1 
	push_const 276 
	add 
	fetch_i 
	push_const 4638 
	push_const 1 
	func_call 80   //  func[DeleteItem1] 
	shift_sp -3 
	shift_sp -1 
	jump L900600
L900600

	shift_sp 1
	push_event	//  c1
	push_const 276
	add
	fetch_i
S99087.	"ItemSound.quest_middle"
	push_string S99087
	func_call 173	//  func[SoundEffect]
	shift_sp -2
	shift_sp -1
L900610
	call_super
handler_end
dar55 is offline  
Old 09.12.2005, 08:21   #6
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

digital...
could you please re-add the specific language sections.
this here is pretty annoying.
and i guess im not the only one who feels so...
toolpunk is offline  
Old 09.12.2005, 09:39   #7
Truffe
Архивный участник
 
Join Date: May 2005
Posts: 944
Default

+1 :mrgreen:
Truffe is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:49.