AI:
NASC:
Код:
class 1 nobless_helper : citizenparameter_define_begin
string fnHi "l2ee_main_nobless.htm"
string fnOk "l2ee_give_nobless.htm"
string fnCancel "l2ee_cancel_nobless.htm"
int ItemId 15000 // ID требуемой вещи для взятия Статуса Дворянина
int AmountItem 1 // Количество вещи для взятия Статус Дворянина
parameter_define_end
handler 32 115 // MENU_SELECTED
variable_begin
"talker"
"ask"
"reply"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // ask
push_const 160
add
fetch_i4
push_const 3
negate
equal
push_reg_sp
fetch_i
branch_false L0
push_event // reply
push_const 164
add
fetch_i4
push_const 2
equal
and
L0
branch_false L2
L1
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_parameter ItemId
func_call 184680579 // func[OwnItemCount]
shift_sp -2
push_parameter AmountItem
greater_equal
branch_false L4
L3
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_parameter ItemId
push_parameter AmountItem
func_call 184746114 // func[DeleteItem1]
shift_sp -3
shift_sp -1
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_const 241
push_const 1
func_call 184746091 // func[SetOneTimeQuestFlag]
shift_sp -3
shift_sp -1
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_const 242
push_const 1
func_call 184746091 // func[SetOneTimeQuestFlag]
shift_sp -3
shift_sp -1
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_const 246
push_const 1
func_call 184746091 // func[SetOneTimeQuestFlag]
shift_sp -3
shift_sp -1
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_parameter fnOk
func_call 184680516 // func[ShowPage]
shift_sp -2
shift_sp -1
jump L5
L4
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_parameter fnCancel
func_call 184680516 // func[ShowPage]
shift_sp -2
shift_sp -1
L5
L2
handler_end
class_end
Код:
class 1 nobless_helper : citizen{
parameter:
string fnHi = "l2ee_main_nobless.htm";
string fnOk = "l2ee_give_nobless.htm";
string fnCancel = "l2ee_cancel_nobless.htm";
int ItemId = 15000;
int AmountItem = 1;
handler:
EventHandler MENU_SELECTED( talker, ask, reply )
{
if( ask == -3 && reply == 2 )
{
if( myself::OwnItemCount( talker, ItemId ) >= AmountItem )
{
myself::DeleteItem1( talker, ItemId, AmountItem );
myself::SetOneTimeQuestFlag( talker, @noble_soul_noblesse_1, 1 );
myself::SetOneTimeQuestFlag( talker, @noble_soul_noblesse_2, 1 );
myself::SetOneTimeQuestFlag( talker, @noble_soul_noblesse_3, 1 );
myself::ShowPage( talker, fnOk );
}
else
{
myself::ShowPage( talker, fnCancel );
}
}
}
}