Jump to content

IndieRO

Members
  • Content Count

    286
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by IndieRO


  1. i try use script vending control by emistry

     

     

    //===== eAthena Script =====================================
    //= Vendor Control
    //===== By: ================================================
    //= Original by Emistry
    //= Rewrite by AnnieRuru
    //===== Current Version: ===================================
    //= 1.0
    //===== Compatible With: ===================================
    //= Hercules 2014-02-18
    //===== Description: =======================================
    //= Vendors only vend on certain coordinate, looks tidy 
    //===== Topic ==============================================
    //= http://hercules.ws/board/topic/4509-
    //===== Additional Comments: ===============================
    //= Emistry would love his script rewritten by his master ?
    //==========================================================
    
    vend_zone,100,103,4    script    Vending Helper    4_GEFFEN_13,{
        mes "["+ strnpcinfo(1) +"]";
        if ( !getskilllv( "MC_VENDING" ) ) {
            mes "You dont have ^0055FFVending Skill^000000.";
            close;
        }
        mes "Select a slot and start vending.";
        while ( true ) {
            .@menu$ = .@currentpage ? "Previous Page:" : ":";
            .@pageindex = .@currentpage * .slotperpage;
            for ( .@i = 0; .@i < .slotperpage && .@pageindex + .@i < .count; .@i++ ) {
                if ( !getmapxy( .@map$, .@x, .@y, 1, "#vend_slot"+( .@pageindex + .@i ) ) && getareausers( .map$, .@x, .@y, .@x, .@y ) )
                    .@menu$ = .@menu$ +"Slot No."+( .@pageindex + .@i +1 )+" - ^FF0000[UnAvailable]^000000:";
                else {
                    .@menu$ = .@menu$ +"Slot No."+( .@pageindex + .@i +1 )+" - ^00CC00[Available]^000000:";
                    .@available++;
                }
            }
            if ( .@currentpage != .maxpage )
                .@menu$ = .@menu$ + "Next Page";
            .@pick = select( .@menu$ ) -1;
            if ( !.@pick )
                .@currentpage--;
            else if ( .@pick == .slotperpage +1 )
                .@currentpage++;
            else
                break;
        }
        .@s =  .@currentpage * .slotperpage + .@pick -1 ;
        if ( !getmapxy( .@map$, .@x, .@y, 1, "#vend_slot"+ .@s ) && getareausers( .map$, .@x, .@y, .@x, .@y ) ) {
            mes " ";
            mes "This slot is ^FF0000[UnAvailable]^000000.";
            close;
        }
        warp .@map$, .@x, .@y;
        hideonnpc "#vend_slot"+ .@s;
        donpcevent "#vend_slot"+ .@s +"::OnCheckAvailable";
        end;
    OnInit:
    //    ======================= Configuration HERE =============================
        .map$ = "vend_zone"; // map
        setarray .@x, 56,59,62,65,68,71,74,77,80,83,86,89,92,95,104,107,110,113,116,119,122,125,128,131,134,137,140,143; // x coordinates
        setarray .@y, 140,145,113,0; // y coordinates
        .slotperpage = 20; // display how many slots per page (prevent making the menu too long)
    
    //    too many people said this script causes vendor cannot vend at all on the map, ( coordinates has set too near )
    //    because there is a setting in 'conf\battle\player.conf' to disallow player to vend too near other npcs
        setbattleflag "min_npc_vendchat_distance", 0; // comment this line to make the default value back to 3
    
        freeloop 1;
        setcell .map$, 0,0, 500,500, cell_novending, 1;
        .@x_size = getarraysize( .@x );
        .@y_size = getarraysize( .@y );
        .@i = 0;
        while ( .@i < .@y_size ) {
            .@j = 0;
            while ( .@j < .@x_size ) {
                if ( checkcell( .map$, .@x[.@j], .@y[.@i], cell_chkpass ) ) {
                    movenpc "#vend_slot"+ .count, .@x[.@j], .@y[.@i];
                    setcell .map$, .@x[.@j], .@y[.@i], .@x[.@j], .@y[.@i], cell_novending, 0;
                    if ( getareausers( .map$, .@x[.@j], .@y[.@i], .@x[.@j], .@y[.@i] ) ) {
                        hideonnpc "#vend_slot"+ .count;
                        donpcevent "#vend_slot"+ .count +"::OnCheckAvailable";
                    }
                    .count++;
                }
                .@j++;
            }
            .@i++;
        }
        .maxpage = .count / .slotperpage + ( .count % .slotperpage > 0 ) -1;
        end;
    }
    
    -    script    vend_slot    -1,{
        mes "[Vending Slot]";
        getmapxy .@map$, .@x, .@y, 1;
        if ( !getskilllv( "MC_VENDING" ) ) {
            mes "You dont have ^0055FFVending Skill^000000.";
            close;
        }
        else if ( getareausers( .@map$, .@x, .@y, .@x, .@y ) ) {
            mes "Someone already using this slot";
            close;
        }
        mes "Spot : ^777777Available^000000";
        mes "^0055FF[ Vending Area Rules ]^000000";
        mes "^FF0000 ~ Use proper Shop Name.^000000";
        mes "^777777Player who failed to follow these rules will be punished.^000000";
        unitwalk getcharid(3), .@x, .@y;
        hideonnpc strnpcinfo(0);
        donpcevent strnpcinfo(0)+"::OnCheckAvailable";
        close;
    OnCheckAvailable:
        sleep 10000;
        getmapxy .@map$, .@x, .@y, 1;
        while ( getareausers( .@map$, .@x, .@y, .@x, .@y ) ) sleep 10000;
        hideoffnpc strnpcinfo(0);
        end;
    }
    
    // Add more if needed.
    vend_zone,0,0,4    duplicate(vend_slot)    #vend_slot0    4_BULLETIN_BOARD2
    
     
    

     

    it's possible to setting locate without using array just use spesific X and Y?


  2. is it possible the player get the item when change job
    if yes, can someone help me make this script
     
    how to produce :
    when player change job ex swordman player will get item spear (1404)..
    when player change job ex thief player will get item maingauche (1207)..
     
     

     


  3. i try to use instance pvp but i got error when implement this script

     

     


    -    script    PD_Settings    -1,{

    OnInit:
        set $PD_Timelimit,600;    // Seconds for entering
        set $PD_Minparty,2;        // # of players a party must have
        //set $PD_ItemID,969;    // ItemID //Not working yet
        end;
    }

    brasilis,200,258,5    script    Duel PVP    406,{

        set .@name$,"^0000FFPvP Warper^000000";

        getpartymember(getcharid(1));
        if(!getcharid(1) || $@partymembercount < $PD_Minparty){
                mes .@name$;
                mes "Make or join the party with exactly "+$PD_Minparty+" member or try again.";
            set PD_makeparty,1;
            close;
        }
        if(PD_makeparty){
            mes .@name$;
            mes "Confirmed. You are in a party. What would you like to do?";
            set PD_makeparty,0;
            next;
        }
        mes .@name$;
        mes "If you have generated the PvP Duel already, you can enter it.";
        next;
        if(getpartyleader(getcharid(1),2) == getcharid(0)){
            select("Generate PvP Duel Instance:Enter the PvP Duel Instance:Return to Brasilis:Cancel");
        } else {
            select(":Enter the PvP Duel Instance:Return to Brasilis:Cancel");
        }
        switch(@menu){
        case 1:
            if(instance_id(1)){
                if(has_instance("1@@pvp") == ""){
                    mes .@name$;
                    mes "Your group is already registered at an other instance.";
                    close;
                }
                mes .@name$;
                mes "Your group is already registered.";
                mes "Select ^0000FFEnter the Duel^000000 in the main menu to enter.";
                close;
            }
            mes .@name$;
            mes "^0000FFPvP Duel Instance^000000 - Try to reserve";
            mes "After making a reservation, you have to talk to NPC behind and";
            mes "select the menu 'Enter the Duel' to enter the PvP Duel";
            close2;
            set .@instance_id,instance_create("PvP_Duel",getcharid(1));
            if(.@instance_id < 0){
                mes .@name$;
                mes "Failed to create PvP Duel Intsance.";
                mes "^FF0000PvP Duel Instances reached its limit.^000000";
                mes "Please report this error to an administrator or GM.";
                close;
            }
            instance_attachmap("1@@pvp",.@instance_id);
            instance_set_timeout $PD_Timelimit,600,.@instance_id;
            instance_init .@instance_id;
            instance_attach instance_id(1);
            end;
        case 2:
            if(!instance_id(1) || has_instance("1@@pvp") == ""){
                mes .@name$;
                mes "The PvP Duel Instance does not exist.";
                mes "Please confirm with your party leader wether the memorial dungeon";
                mes "has been destructed or if the time given for entering has been expired.";
                close;
            }
            instance_attach instance_id(1);
            set PD_Lastinstid,instance_id(1);
            set PD_map,1;
            set @id,getcharid(1);
            donpcevent instance_npcname("PD_Manager")+"::OnInstanceInit";
            warpparty "1@@pvp",51,46,@id;
            //warp has_instance("1@@pvp"),0,0;
            close;
        case 3:
            warp "brasilis",195,259;
            close;
        case 4:
            close;
        }
    }

    1@@pvp,0,0,0    script    PD_Manager    -1,{
        end;

    OnInstanceInit:
        if(strnpcinfo(3) == "PD_Manager")
            end;
        sleep 3000;
        instance_announce .@instance_id,"Get Ready...",0x00FF00;
        sleep 3000;
        instance_announce .@instance_id,"4",0x00FF00;
        sleep 3000;
        instance_announce .@instance_id,"3",0x00FF00;
        sleep 3000;
        instance_announce .@instance_id,"2",0x00FF00;
        sleep 3000;
        instance_announce .@instance_id,"1",0x00FF00;
        sleep 3000;
        instance_announce .@instance_id,"GO!",0x00FF00;
        atcommand "@@pvpon";
        end;

    OnPCKillEvent:
        if(PD_map==1){
        //getitem $PD_ItemID,1; //Not working yet
        pvpoff "1@@pvp";
        sleep2 1000;
        instance_attach instance_id(1);
        instance_warpall "brasilis",195,259;
        instance_destroy instance_id(1);
        set PD_map,0;
        end;
        }
        end;
    OnPCLogoutEvent:
        if(PD_map==1){
        pvpoff "1@@pvp";
        instance_attach instance_id(1);
        instance_warpall "brasilis",195,259;
        instance_destroy instance_id(1);
        set PD_map,0;
        end;
    }
        end;

    OnPCDieEvent:
        if(PD_map==1){
        pvpoff "1@@pvp";
        sleep2 1000;
        instance_attach instance_id(1);
        instance_warpall "brasilis",195,259;
        instance_destroy instance_id(1);
        set PD_map,0;
        end;
    }
        end;
        
    OnPCLoginEvent:
        set PD_map,0;
        end;
    }

    1@@pvp    mapflag    pvp_noparty
    1@@pvp    mapflag    pvp_noguild
    1@@pvp    mapflag    partylock
    1@@pvp    mapflag    nowarp
    1@@pvp    mapflag    nowarpto

    this is problem on map server

     

    [Error]: script error in file 'npc/custom/cahya/Instance_PvP.txt' line 68 column
     18
        parse_callfunc: expected ')' to close argument list
        65:         }
        66:         switch(@menu){
        67:         case 1:
    *   68:                 if(instance_id(1)){
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        69:                         if(has_instance("1@@pvp") == ""){
        70:                                 mes .@name$;
        71:                                 mes "Your group is already registered at
     an other instance.";
    [Error]: script error in file 'npc/custom/cahya/Instance_PvP.txt' line 147 colum
    n 30
        parse_callfunc: expected ')' to close argument list
       144:         //getitem $PD_ItemID,1; //Not working yet
       145:         pvpoff "1@@pvp";
       146:         sleep2 1000;
    *  147:         instance_attach instance_id(1);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
       148:         instance_warpall "brasilis",195,259;
       149:         instance_destroy instance_id(1);
       150:         set PD_map,0;

     

    please somebody help me

     


  4. idk maybe try

     

     

    npctalk "^5BA146Hello, world!^000000";
    

     

    but i also see in constants.nd there are these values

     

     

    
    C_AQUA: 65535
    C_BLACK: 0
    C_BLUE: 255
    C_GRAY: 8421504
    C_GREEN: 32768
    C_LIME: 65280
    C_MAROON: 8388608
    C_NAVY: 128
    C_OLIVE: 8421376
    C_ORANGE: 16753920
    C_PURPLE: 8388736
    C_RED: 16711680
    C_SILVER: 12632256
    C_TEAL: 32896
    C_WHITE: 16777215
    C_YELLOW: 16776960
    C_PINK: 16761035
    C_CHOCOLATE: 13789470
    C_GOLD: 16766720
    C_VIOLET: 15631086

    So...I dunno.

    not working bro


  5.  

     

     

    I'm cloning some of the mobs using 3000 ID and UP and add it to mob_avail.txt, everything works fine but I got the following warning message when starting my server.

     

    [Warning]: script_set_constant2: Attempted to overwrite existing constant 'GHOSTRING' (old value=1120, new value=3188).
    [Warning]: script_set_constant2: Attempted to overwrite existing constant 'INCUBUS' (old value=1374, new value=3189).
    [Warning]: script_set_constant2: Attempted to overwrite existing constant 'SUCCUBUS' (old value=1370, new value=3190).
    [Warning]: script_set_constant2: Attempted to overwrite existing constant 'MINI_DEMON' (old value=1292, new value=3191).
     
    Is this okay? or how to ignore this?

    not ok to ignore, its constants used for scripts(if there's any script, like disguise), you see the 2 mob id's 1120 and 3188, having same name GHOSTRING, just change it. add a _, to avoid any more warnings.

    thx for your info very helpfull

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.