Jump to content

dqseishi

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by dqseishi

  1. i tried this pet evolution script made by AnnieRuRu

    prontera,156,178,5    script    ldfhsdfkljs    100,{
        if ( petstat(PET_CLASS) ) {
            mes "please return your pet into egg state to continue";
            close;
        }
        getinventorylist;
        for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
            if ( @inventorylist_card1[.@i] == -256 ) {
                query_sql "select class, level, equip, name from pet where pet_id = "+( .@id = @inventorylist_card2[.@i] + ( ( @inventorylist_card2[.@i] >= 0 )? 0 : 1 << 16 ) + @inventorylist_card3[.@i] * ( 1 << 16 ) ), .@class, .@level, .@equipped, .@name$;
                .@menu$ = .@menu$ +"^0000FF"+ .@name$ +" ^00CC00{"+ getmonsterinfo( .@class, 0 ) +"} ^000000["+ .@level +"] ^FF0000"+( ( .@equipped )? "*equipped" : "" )+":";
                .@pet_id[.@c] = .@id;
                .@egg_id[.@c] = @inventorylist_id[.@i];
                .@pet_name$[.@c] = .@name$;
                .@pet_class[.@c] = .@class;
                .@pet_level[.@c] = .@level;
                .@pet_equipped[.@c] = .@equipped;
                .@c++;
            }
        }
        if ( !.@c ) {
            mes "your inventory doesn't have any pet egg";
            close;
        }
        mes "select which pet that you want it to evolve";
        next;
        .@s = select( .@menu$ ) -1;
        mes "selected : "+ .@pet_name$[.@s];
        mes "level : "+ .@pet_level[.@s];
        mes "equipped : "+( ( .@pet_equipped[.@s] )? "Yes" : "No" );
        if ( getd( ".pet"+ .@pet_class[.@s] ) )
            mes "require : "+ getitemname( getd( ".pet"+ .@pet_class[.@s] ) );
        next;
        if ( !getd( ".pet"+ .@pet_class[.@s] ) ) {
            mes "this pet cannot evolve any further";
            close;
        }
        if ( .@pet_level[.@s] < .min_level ) {
            mes "this pet doesn't meet the level requirement";
            close;
        }
        if ( .@pet_equipped[.@s] ) {
            mes "please unequip this pet accesory to continue";
            close;
        }
        if ( !countitem( getd( ".pet"+ .@pet_class[.@s] ) ) ) {
            mes "you need "+ getitemname( getd( ".pet"+ .@pet_class[.@s] ) ) +" to evolve this pet";
            close;
        }
        delitem  getd( ".pet"+ .@pet_class[.@s] ), 1;
        delitem2 .@egg_id[.@s], 1, 1, 0, 0, -256, ( .@pet_id[.@s] % ( 1 << 16 ) - ( .@remainder15 = .@pet_id[.@s] % ( 1 << 15 ) ) < ( 1 << 15 ) )? .@remainder15 : ( .@remainder15 - ( 1 << 15 ) ), .@pet_id[.@s] >> 16, 0;
        makepet .@get_pet_id = getd( ".pet"+ .@pet_class[.@s] +"["+ rand( 1, getarraysize( getd( ".pet"+ .@pet_class[.@s] ) ) -1 ) +"]" );
        mes "your "+ .@pet_name$[.@c] +" has reborn into "+ getmonsterinfo( .@get_pet_id, 0 );
        mes "please rename your pet ~";
        close;
    OnInit:
        .min_level = 80; // minimum level 80 to change pet egg
    
        //    array getd( ... + <require pet egg> ), <require item>, <random pet egg 1>, <random pet egg 2> ....
        setarray getd( ".pet"+ 1002 ), 501, 1113, 1031; // poring pet(1002) with red pot(501) can evolve into drops(1113) or poporing(1031)
        setarray getd( ".pet"+ 1011 ), 502, 1042; // chonchon(1011) with orange pot(502) can evolve into steel chonchon(1042)
        // add more as needed
        end;
    }
    

    but everytime i try to use it, it always give me this error:

    [Error]: buildin_delitem2: failed to delete 1 items (AID=2000000 item_id=9001).
    

    any help with this??

    btw, i havent touched/changed the script.

  2. i need help with this script which i chopped, copied and mixed.

    //*********************************************************************************************************************************************************************************
    //*********************************************************************************************************************************************************************************
    //***-- Script by :
    //***-- --
    //***
    //*********************************************************************************************************************************************************************************
    //*********************************************************************************************************************************************************************************
    //***-- Messages :
    //***-- This is nothing
    //***-- but a mere trial
    //***
    //*********************************************************************************************************************************************************************************
    //***
    //*********************************************************************************************************************************************************************************
    //***
    //***
    //*********************************************************************************************************************************************************************************
    
    
    //-------------------------NPC [ Pet Farm ] --------------------------------------------------------------------
    
    prontera,146,169,6 script Pet farmer 124,{
    mes "[^119922 Pet farm ^000000]";
    mes "What a wonderful day to catch something cute.";
    mes "Ain't I right?";
    next;
    mes "[^119922 Pet farm ^000000]";
    mes "Here at Pet farm, you can catch different pets.";
    mes "It will only cost you 2 ^CCCC00 PetVouchers^000000";
    mes "To enter and catch pets for 10 minutes!";
    next;
    mes "[^119922 Pet farmer ^000000]";
    mes "What are you going to do now?";
    switch(select("[Enter Petfarm]:[BuyPetVoucher]:[Net Shop]:Another Time")) {
    case 1:
    mes "[^119922 Pet farmer ^000000]";
    mes "So you want to Enter the park.";
    switch(select("Yep:I change my mind.")) {
    case 1:
    mes "[^119922 Pet farmer ^000000]";
    if(countitem(501)<2) {
    mes "You don't have enough Vouchers with you.";
    mes "Sorry, maybe next time.";
    close;
    }
    if(countitem(501)>=2) {
    mes "Hmmm.. Ok you can enter!";
    delitem 501,2;
    next;}
    mes "You will also receive some Nets!";
    message strcharinfo(0), "Use these wisely!";
    getitem 620,3;
    next; {
    warp .Map$,127,97;
    initnpctimer;
    end;
    }
    case 2:
    mes "[^119922 Pet farmer ^000000]";
    mes "Okay then.";
    mes "Talk to me if you change your mind.";
    mes "See yah!";
    close;
    end;
    }
    case 2:
    mes "[^119922 Pet farmer ^000000]";
    switch(select("Continue:Cancel")) {
    case 1:
    mes "[^119922 Pet farmer ^000000]";
    mes "How much Vouchers are you going to buy?";
    input .@amount;
    .@a = (.@amount*10);
    if (.@amount <=0) {
    mes "Please input a number greater than 0.";
    close;
    }
    else if (countitem(969) < .@tokens) {
    mes "Sorry, you dont have enough balance.";
    close;
    }
    else {
    mes "Okay, here you go.";
    mes "You get "+.@amount+" Vouchers.";
    delitem 969, .@amount;
    getitem 501, .@a;
    close;
    end;}
    OnInit:
    set .Map$,"petfarm";
    set .timeOut,30000;
    set $mobID1$,.@mob1[rand (getarraysize(.@mob1)) ];
    set $mobID2$,.@mob2[rand (getarraysize(.@mob2)) ];
    waitingroom "Pet Farm",0;
    end;
    for(.@ix = 0; .@ix < 5; .@ix++) {
    monster .Map$,0,0,"--en--", $mobID1$, 5, strnpcinfo(0)+"::OnKillMob";
    }
    for(.@iy = 0; .@iy < 3; .@iy++) {
    monster .Map$,0,0,"--en--", $mobID2$, 3, strnpcinfo(0)+"::OnKillMob";
    }
    monster .Map$,0,0,"--en--", 1031, 3, strnpcinfo(0)+"::OnKillMob";
    end;
    
    OnKillMob:
    mapannounce .Map$,"There's an idiot who killed a pet!",bc_npc;
    end;
    //Index: MobID 1, MobID 2, MobID 3,etc...
    setarray .@mob1[0], 3356, 3357;
    setarray .@mob2[0], 3358, 3359;
    
    OnTimer10000:
    if(getnpctimer(0)>=.timeOut)
    goto TimesUp;
    else
    {
    message strcharinfo(0), "You have "+((.timeOut-getnpctimer(0))/1000)+" left.";
    initnpctimer;
    }
    end;
    
    TimesUp:
    message strcharinfo(0), "Time's Up !! You will be warped out right now..";
    mapwarp .Map$,"prontera",155,181;
    end;
    }
    case 3:
    mes "[^119922 Pet farmer ^000000]";
    doevent "NetShop1::OnShop";
    end;
    case 4:
    mes "[^119922 Pet farmer ^000000]";
    mes "If that's what you want then.";
    next;
    mes "[^119922 Pet farmer ^000000]";
    mes "Have a nice day.";
    mes "Just come back here if you want to enter!";
    close;
    end;
    }
    
    }
    
    
    // -- ***************************************** F I R S T S H O P **********************************************
    
    
    
    - itemshop custom_seller2 -1,969:20,619:3000
    
    - script NetShop1 -1,{
    
    OnShop:
    set @i,0;
    mes "[^119922 Pet farmer ^000000]";
    mes "I will sell you items for " + getitemname(.CoinID) + ".";
    callshop "custom_seller2",1;
    npcshopattach "custom_seller2";
    end;
    OnBuyItem:
    for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
    for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
    if(@bought_nameid[.@d]==.customs[.@i]) {
    if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
    if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
    delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
    getitem @bought_nameid[.@d],@bought_quantity[.@d];
    } else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
    } else dispbottom "Purchasing these items will put you over the weight limit!";
    }
    }
    }
    deletearray @bought_quantity, getarraysize(@bought_quantity);
    deletearray @bought_nameid, getarraysize(@bought_nameid);
    close;
    
    OnInit:
    setarray .customs[0],619,620,621,622,623;// Enter the ID of customs here
    set .CoinID,969; // Enter the ID of the coin here.
    setarray .Price[0],2,5,5,7,7; // Price for each custom is set to 20 coins
    npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
    for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
    end;
    }
    
    
    // -- ***************************************** Exit NPC **********************************************
    
    
    petfarm,126,104,4 script Exit#01::warp 124,{
    
    mes "You want sure you want to exit?";
    mes "You still have "+(getnpctimer(0)/1000)+" seconds you know?";
    switch(select("I want to exit:Maybe later")) {
    case 1:
    mes "Okay then, I'll teleport you out.";
    next; {
    warp "prontera",155,183;
    stopnpctimer;
    end;
    }
    case 2:
    mes "That's a good decision!";
    close;
    end;
    }
    }
    
    petfarm,130,33,2 duplicate(warp) Exit#02 124
    petfarm,73,41,6 duplicate(warp) Exit#03 124
    petfarm,66,97,6 duplicate(warp) Exit#04 124



    as you can see, i am trying to make a pet farm where everyone can enter anytime with a time limit of 10min.(i haven't set the clock yet to 10min., i think)
    with different pets..but the problem is, there is NO MONSTER. even the TIME LIMIT doesnt start.
    when ever i load my client, there are no errors. but whenever i enter the farm.. this error pops out

    [Error]: script_rid2sd: fatal error ! player not attached!
    [Debug]: Function: strcharinfo (1 parameter):
    [Debug]: Data: number value=0
    [Debug]: Source (NPC): Pet farmer at prontera (146,169)

    and i dont know why, btw. i'm still really noob about scripting.
    please help me please.
    i tried reading other articles here in rathena and at hercules..i can't still seem to find the reason of this error.

    thanx in advance

×
×
  • Create New...