Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 03.05.2007, 07:28   #12
forsage
Архивный участник
 
Join Date: Oct 2006
Posts: 17
Default

Thanks !
This is very good information
So , I little changed my task.
If attacker's level > 10 , there will be "text 1" message, and else, "text 2" message.

ai code:
Code:
class 1 test : (null)

handler 1 12
	variable_begin
		"attacker"
		"damage"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	
	push_const 48
	add
	fetch_i
	push_const 1092
	add
	fetch_i4
	push_const 10
	greater
	branch_false L101
L100

	push_event
	push_const 704
	add
	fetch_i
S100.	"Text 1"
	push_string S100
	func_call 184614973
	shift_sp -1
	jump L102
L101
	push_event
	push_const 704
	add
	fetch_i
S101.	"Text 2"
	push_string S101
	func_call 184614973
	shift_sp -1
L102
handler_end
class_end
Is it right ?

One another question, what difference between fetch_i4 and fetch_i ?
If I change fetch_i4 at fetch_i , the result of decompiler as the same:

Code:
class test : (null)
{
handler:
	EventHandler ATTACKED(attacker,damage)
	{
		if( ( attacker + 1092 ) > 10 )
		{
			myself->Say("Text 1");
		}
		else
		{
			myself->Say("Text 2");
		}
	}

}
forsage is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 20:13.