Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   AI.OBJ little help (https://postpacific.loc-online.com/showthread.php?t=3648)

AntiPOP 14.03.2006 15:39

AI.OBJ little help
 
Ok guys...i wrote new class but now i cant encode it....anyone can write a manual how to decode

Kenster 14.03.2006 15:58

Post your code, and ill tell you why.

kiralex2 14.03.2006 15:58

All comes with experience.
We use NASC
In L2Tools_1.6.rar there is source code AI

Share your code

AntiPOP 14.03.2006 16:09

I use NASC too, but i cant understand how it working...code is simple...:) all u have ;)

Code:

class merchant_for_token_enchant : default_npc
{
parameter:
        string fnHi = "enchant_token001.htm";        //001
        string fnNotEnoughCrystal= "enchant_token100.htm";       
handler:
        EventHandler TALKED(talker)
        {
                ShowPage(talker, fnHi);
        }
        EventHandler MENU_SELECTED(talker, ask ,reply, i0, i1, i2, i3)
        {
                if(ask == -999)
                {
                        i3 = 0;
                        select(reply)
                        {
case 1        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_wep_d) >= 1){
                i0 =        1        ;       
                i1 = @scrl_of_ench_wp_d        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        2        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_wep_c) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_wp_c        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        3        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_wep_b) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_wp_b        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        4        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_wep_a) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_wp_a        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        5        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_arm_a) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_am_a        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        6        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_arm_b) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_am_b        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        7        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_arm_c) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_am_c        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        8        :                       
{                                       
        if (OwnItemCount(talker,@token_enchant_arm_d) >= 1 ){
                i0 =        1        ;       
                i1 = @scrl_of_ench_am_d        ;       
        }                               
        else i3 = 1;                               
        break;                               
}
// enchantai i tokenus keitimas

case        9        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_wp_d) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_wep_d        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        10        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_wp_c) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_wep_c        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        11        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_wp_b) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_wep_b        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        12        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_wp_a) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_wep_a        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        13        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_am_d) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_arm_d        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        14        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_am_c) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_arm_c        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        15        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_am_b) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_arm_b        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
case        16        :                       
{                                       
        if (OwnItemCount(talker,@scrl_of_ench_am_a) >= 1 ){
                i0 =        1        ;       
                i1 = @token_enchant_arm_a        ;       
        }                               
        else i3 = 1;                               
        break;                               
}                                       
                        }
                }
        }
}

Just wanna write it for myselves

toolpunk 14.03.2006 19:06

make sure to have the parent class (default_npc) in your script as well ;)


All times are GMT. The time now is 16:20.