View Single Post
Old 03.05.2006, 17:20   #2
Larson
Архивный участник
 
Join Date: Mar 2006
Posts: 43
Default [Share] New version of base classes in AI.obj

As some from present on this forum, I started to make my own AI.obj with the purpose of optimization, an opportunity of addition quests, delete holes... For the beginning in it topic I shall lay out base classes already compiled by me and if to whom they will be useful I shall fill up probably the list...
So:

Code:
class default_npc : (null)
parameter_define_begin
	int DesirePqSize 150
	int FavorListSize 150
	float IdleDesire_DecayRatio 0.000000
	float MoveAround_DecayRatio 0.000000
	float DoNothing_DecayRatio 0.000000
	float Attack_DecayRatio 0.000000
	float Chase_DecayRatio 0.000000
	float Flee_DecayRatio 0.000000
	float GetItem_DecayRatio 0.000000
	float Follow_DecayRatio 0.000000
	float Decaying_DecayRatio 0.000000
	float MoveToWayPoint_DecayRatio 0.000000
	float UseSkill_DecayRatio 0.000000
	float MoveTo_DecayRatio 0.000000
	float EffectAction_DecayRatio 0.000000
	float IdleDesire_BoostValue 0.000000
	float MoveAround_BoostValue 0.000000
	float DoNothing_BoostValue 0.000000
	float Attack_BoostValue 0.000000
	float Chase_BoostValue 0.000000
	float Flee_BoostValue 0.000000
	float GetItem_BoostValue 0.000000
	float Follow_BoostValue 0.000000
	float Decaying_BoostValue 0.000000
	float MoveToWayPoint_BoostValue 0.000000
	float UseSkill_BoostValue 0.000000
	float MoveTo_BoostValue 0.000000
	float EffectAction_BoostValue 0.000000
parameter_define_end
handler 0	//  NO_DESIRE
	variable_begin
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

handler_end

class_end


class citizen : default_npc
parameter_define_begin
	string fnHi "chi.htm"
	int SocialAction 1
parameter_define_end
handler 13	//  CREATED
	variable_begin
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_parameter SocialAction
	push_const 0
	greater
	branch_false L1
L0
	shift_sp 1
	push_const 1002
	push_const 10000
	func_call 28	//  func[AddTimerEx]
	shift_sp -2
	shift_sp -1
L1
handler_end

handler 12	//  TIMER_FIRED_EX
	variable_begin
		"timer_id"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  timer_id
	push_const 176
	add
	fetch_i
	push_const 1002
	equal
	branch_false L3
L2
	push_parameter SocialAction
	push_const 0
	greater
	push_reg_sp
	fetch_i
	branch_false L4
	shift_sp 1
	push_const 4
	func_call 55	//  func[Rand]
	shift_sp -1
	push_const 0
	equal
	and
L4
	branch_false L6
L5
	shift_sp 1
	push_event	//  myself
	push_const 28
	add
	fetch_i	//  sm
	push_const 2400
	add
	fetch_i
	push_const 2
	push_const 3000
	push_const 10000
	func_call 13	//  func[AddEffectActionDesire]
	shift_sp -4
	shift_sp -1
L6
	shift_sp 1
	push_const 1002
	push_const 10000
	func_call 28	//  func[AddTimerEx]
	shift_sp -2
	shift_sp -1
	exit_handler
L3
	call_super
handler_end

handler 3	//  TALKED
	variable_begin
		"talker"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	shift_sp 1
	push_event	//  myself
	push_const 28
	add
	fetch_i	//  sm
	push_const 2400
	add
	fetch_i
	push_const 1
	push_const 3000
	push_const 10000
	func_call 13	//  func[AddEffectActionDesire]
	shift_sp -4
	shift_sp -1
	shift_sp 1
	push_event	//  talker
	push_const 32
	add
	fetch_i
	push_parameter fnHi
	func_call 43	//  func[ShowPage]
	shift_sp -2
	shift_sp -1
handler_end

handler 4	//  TALK_SELECTED
	variable_begin
		"talker"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	shift_sp 1
	push_event	//  myself
	push_const 28
	add
	fetch_i	//  sm
	push_const 2400
	add
	fetch_i
	push_const 1
	push_const 3000
	push_const 10000
	func_call 13	//  func[AddEffectActionDesire]
	shift_sp -4
	shift_sp -1
	shift_sp 1
	push_event	//  talker
	push_const 32
	add
	fetch_i
S0.	"noquest.htm"
	push_string S0
	func_call 43	//  func[ShowPage]
	shift_sp -2
	shift_sp -1
handler_end

class_end
Larson is offline