Jump to content

legtoleg

Members
  • Posts

    21
  • Joined

  • Last visited

Posts posted by legtoleg

  1. Hello,

    I use this script and I try to modify the zeny requested by war badges.

    Thank you in advance ?

     

    Quote

    z_agit,16,108,6    script    Claw Machine    563,{

    .@npcName$ = "[" + strnpcinfo(1) + "]";

    mes .@npcName$;
    mes "Hello, for 75 War Badge you have a chance to obtain one of these items :";
    for (.@i = 0; .@i < getarraysize(.items); .@i++) {
            mes "^008000~ " + getitemname(.items[.@i]) + "^000000";
    }
    next;

    switch(select("Gamble!:Leave")) {
            case 1:
                    if (Zeny < 1000000) {
                            mes .@npcName$;
                            mes "I'm afraid you don't have enough to gamble.";
                            close;
                    }

                    Zeny -= 1000000;
                    .@rand = rand(1,100);
                    for (.@i = 0 ; .@i < getarraysize(.items) ; .@i++) {
                            if (.@rand <= .percents[.@i]) { getitem .items[.@i],1 ; dispbottom "Congrats! You won 1 "+getitemname(.items[.@i])+" !"  ; .@won = 1; }
                    }
                    if (!.@won) dispbottom "You lost !";
                    mes .@npcName$;
                    mes "There you go!";
                    break;
            case 2:
                    break;
    }

    close;
    OnInit:
    setarray .items,7773,671;
    setarray .percents,50,20;
    end;
    }

     


  2. Hello,

    I have an npc / mob punching bag on my server.

    The mob is this:

    1277,GREATEST_GENERAL,Greatest General,Greatest General,150,10000000,0,0,0,0,0,0,80,80,0,0,50,0,0,0,0,0,1,0,20,0x4680020,200,0,0,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

     

    I would like to be able to make the mob have the same resistance as a player but by modifying the def / mdef
    For example, 100% def / mdef
    80% def / mdef
    70% def / mdef.

    I changed the def / mdef to 80/80 but I do not have the impression of having a change on the damage ...

    Can you help me please

  3. Hello,

    I would like to add a button so that the server admins can reset the ranking to 0.

    But I have no idea how to do it.

    Can you help me please ?

    pay_arche,62,122,5    script    Barricade Breaker    1905,{
        .@npc$ = "[^0000ff Barricade Test Breaker ^000000]";
        mes .@npc$;
        mes "Last Break Time : ^FF0000"+ (last_break_time / 1000) +"."+ (last_break_time % 1000) +"^000000s.";
        mes "Best Break Time : ^FF0000"+ (p_break_time / 1000) +"."+ (p_break_time % 1000) +"^000000s.";
        next;
        menu "View Ranking", M1, "Enter Barricade Test Breaker", M2;
    
    M1: query_sql("SELECT `char_id`, CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE `key` = 'p_break_time' ORDER BY CAST(`value` AS SIGNED) ASC LIMIT 10",.@cid,.@value);
        for(.@i = 0; .@i<getarraysize(.@cid); .@i++) {
            query_sql("SELECT `name` FROM `char` WHERE `char_id` = "+.@cid[.@i]+";",.@j$);
            .@name$[.@i] = .@j$;
        }
        if (!getarraysize(.@cid))
            mes "The rankings are empty.";
        else
        for (.@i = 0; .@i<getarraysize(.@cid); .@i++)
            mes "Top "+(.@i+1)+". ^0000ff"+.@name$[.@i]+"^000000 ~ ^FF0000"+(.@value[.@i] / 1000)+"."+(.@value[.@i] % 1000)+"^000000s";
        close;
    
    M2: .@ins$ = "Barricade Test Breaker";
        .@pid =  getcharid(1);
        mes .@npc$;
        if ( !.@pid ) {
            mes "You must create a party to enter.";
            close;
        }
        getpartymember .@pid, 1;
        if ( $@partymembercount != 1 ) {
            mes "Please form a party of 1 to continue";
            close;
        }
        mes "Are you sure you want to enter "+.@ins$+"?";
        next;
        if(select("Im ready!:Cancel")==2) close;
        mes .@npc$;
        .@create = instance_create(.@ins$, IM_PARTY);
        if ( .@create < 0 ) {
            switch (.@create) {
                case -1: mes "ERROR: Invalid type."; break;
                case -2: mes "ERROR: Party not found."; break;
                case -3: mes "ERROR: Instance already exists."; break;
                case -4: mes "ERROR: No free instances."; break;
            }
            mes "Instance creation ^FF0000failed^000000.";
            emotion ET_HUK;
            close;
        }
        next;
        .@enter = instance_enter(.@ins$);
        if (.@enter != 0) {
            mes .@npc$;
            switch (.@enter) {
                case 1: mes "ERROR: Party not found."; break;
                case 2: mes "ERROR: Party does not have an instance."; break;
                case 3: mes "ERROR: Unknown error."; break;
            }
            mes "Instance entry ^FF0000failed^000000.";
            emotion ET_HUK;
            close;
        }
        end;
    }
    
    job3_arch03,0,0,0    script    Bari_control    -1,{
    OnInit:
        disablenpc strnpcinfo(0);
        end;
    
    OnInstanceInit:
        sleep 5000;
        'secc = 5; // starting time.. in seconds
        instance_announce instance_id(), "Get ready! in "+ 'secc +"!", bc_map;
        sleep 1000;
        --'secc;
        while ( 'secc > 0 ) {
            instance_announce instance_id(), 'secc+"...", bc_map;
            sleep 1000;
            --'secc;
        }
        monster instance_mapname(strnpcinfo(4), instance_id()),30,28, "--ja--", 3003, 1, instance_npcname(strnpcinfo(0),instance_id())+"::OnBariDown";
        initnpctimer;
        end;
    
    OnBariDown:
        'time = last_break_time = getnpctimer(0);
        if ( !p_break_time ) {
    
            p_break_time = 'time;
            dispbottom "You have set your first personal record.";
        }
        else if ( 'time < p_break_time ) {
            dispbottom "You have broken your personal record!";
            p_break_time = 'time;
        }
        dispbottom "Your current best time is "+ (p_break_time / 1000) +"."+ (p_break_time % 1000) +"s.";
        instance_announce instance_id(), "Time : "+ ('time / 1000) +"."+ ('time % 1000) +"s.", bc_map;
        sleep2 2000;
        instance_announce instance_id(), "Warping out in 5 seconds.", bc_map;
        sleep2 5000; // 5 sec pause
        warp "SavePoint", 0, 0;
        sleep2 1000;
        instance_destroy instance_id();
        end;
    }

     Thanks ? 

  4. Hello !

    I use npc on my server and i would like to know and modify the rate of winning an item please. 
    Thanks you 

    z_agit,16,108,6    script    PC Machine#machine1    563,{
        callfunc "function-ckj";
        end;
    OnInit:
        setarray $@SPgr,7773,25;
        setarray $@Swnm,20506,19602,19603,19604,24196,24208,24210,24212,0,0,0,0,0,0,0,0,0,0,0,0;
        setarray $@Swnn,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0;
        setarray $@SRT,100,100,100,100,100,100,100,100,0,0,0,0,0,0,0,0,0,0,0,0;
        setarray $@Slg$,"-A","-B","-C","-D","-E","-F","-G","-H","-I","-J","-K","-L","-M","-N","-O","-P","-Q","-R","-S","-T";
        end;
    }
    function    script    function-ckj    {
        function ckz {
            for(;.@i<getarraysize($@SRT);set .@i,.@i+1){
                set .@sum,.@sum + $@SRT[.@i];
            }
            set .@rnd,rand(1,.@sum);
            for(;.@rnd>0;set .@l,.@l+1) set .@rnd,.@rnd-$@SRT[.@l];
            return $@Slg$[.@l-1];
        }
        function ss {
            for(set .@i,getarg(0);.@i>0;set .@i,.@i-1)set .@h$,.@h$+getarg(1);
            return .@h$;
        }
        function    semes    {
            function RandColor {
                function Zui {
                    for(set .@i,getarg(0);.@i;set .@i,.@i-1)set .@h$,.@h$+getarg(1);
                    return .@h$;
                }
                function itoax {
                    if(!getarg(0))return "";
                    setarray .@fgd$[10],"A","B","C","D","E";
                    return itoax(getarg(0)/16)+(set(.@ty,getarg(0)%16)<10?.@ty:(.@fgd$[.@ty]==""?"F":.@fgd$[.@ty]));
                }
                return Zui(2-getstrlen(itoax(set(.@R,rand(getarg(0,0)%256,getarg(1,255)%256)))),"0")+itoax(.@R)+Zui(2-getstrlen(itoax(set(.@G,rand(getarg(2,0)%256,getarg(3,255)%256)))),"0")+itoax(.@G)+Zui(2-getstrlen(itoax(set(.@B,rand(getarg(4,0)%256,getarg(5,255)%256)))),"0")+itoax(.@B);
            }
            set .@p$,"^" +RandColor();
            set .@p2$,.@p$+ "========================";
            set .@p3$,(@pc3?"^FF0000":"^FFFFFF");
            set .@p5$,.@p$ +"==^000000";
            mes .@p2$;
            mes .@p5$+"____________________" +.@p$+"==";
            mes .@p5$+"|(   v    v    v  )|" +.@p$+"==";
            mes .@p5$+"|> ^66CCFF" + @game_1$ + "^000000 | ^66CCFF" + @game_2$ + "^000000 | ^66CCFF" + @game_3$ + "^000000   <|" +.@p$+"==";
            mes .@p5$+"|(   ^    ^    ^  )|" +.@p$+"==";
            mes .@p5$+"____________________" +.@p$+"==";
            mes .@p2$;
        }
        mes "Need^FF0000 " + getitemname($@SPgr[0]) + "^000000 x ^000088" + $@SPgr[1] + "^000000";
        mes "Reward(list)";
        for(set .@i,0; .@i < getarraysize($@Swnm); set .@i,.@i + 1){
            mes " ^993300"+getitemname($@Swnm[.@i])+ss((15-getstrlen(getitemname($@Swnm[.@i]))),"")+"^000000 x ^000088"+$@Swnn[.@i];
        }
        next;
        switch(select("^0000FFJoin","^00FF00Leave")){
            case 1:
                goto game;
            case 2:
                close;
            }
    
        game:
            next;
            if(countitem($@SPgr[0])<$@SPgr[1]){ dispbottom "You don't have "+getitemname($@SPgr[0])+"x"+$@SPgr[1]; close; }
            delitem $@SPgr[0],$@SPgr[1];
            set @game_1$,"  ";
            set @game_2$,"  ";
            set @game_3$,"  ";
            set @pc3,0;
            set .@h$,"";
            set .@sum,0;
            semes();
            next;
            select("[Trolley]");
            set .@qc,0;
            while(.@qc<3){
                set .@qc,.@qc+1;
                setd "@game_"+.@qc+"$",ckz();
                if(.@qc>1&&getd("@game_"+.@qc+"$")!=getd("@game_"+(.@qc-1)+"$")){setd "@game_"+.@qc+"$",ckz();}
                semes();
                next;
            }
            set .@p3,0;
            if(@game_1$==@game_2$&&@game_1$==@game_3$){set @pc3,1;}
            semes();
            if(@pc3){
                for(set .@i,0;.@i<getarraysize($@Swnm);set .@i,.@i+1){
                    if(@game_1$==$@Slg$[.@i]&&$@Swnm[.@i]){
                        getitem $@Swnm[.@i],$@Swnn[.@i];
                    }
                }
            }
            if(select("Again","Leave")==1) goto game;
            close;
    }


     

  5. Thanks you so much ! 
    it's perfect 

    n fact, i would like them not to choose the item. He click on the pnj, this one checks if has the request items (10 red potion) if he has everything, the npv gives him an item (put in the script list) or nothing 50% chance.

    Like on chiken ro for the connoisseur (cla machine) 

  6. Hello !

    I would like to have a npc where we give items and in return we have a 50% chance of having defined items or having nothing at all. For example, you have to give 10 apples to have a 50% chance of having certain items and 50% of having nothing

    Can you help me ?

    Thanks ? 

×
×
  • Create New...