Jump to content
  • 0

Is not deleting the pet egg


Helly

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  258
  • Reputation:   54
  • Joined:  01/09/12
  • Last Seen:  

I found this script is from AnnieRuru, all work fine but when change the pet the old egg is not deleting. Delete the ítem that is needed to evol the pet but not the egg :) can someone help please! TY!

prontera,212,168,1	script	Will Conner	923,{

if ( getpetinfo(PET_CLASS) ) {
        mes .@npcname$;
        mes "Por favor regresa tu mascota a su Huevo.";
        cutin "",255;
        close;
    }
    getinventorylist;
    for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
        if ( @inventorylist_card1[.@i] != 0  ) {
            query_sql "select intimate, 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 ) ), .@intimate, .@class, .@level, .@equipped, .@name$;
            if ( .@intimate > .pet_min_friendly ) {
                .@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 .@npcname$;
        mes "your inventory doesn't have any pet egg that intimate enough";
        cutin "",255;
        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( ".petr"+ .@pet_class[.@s] ) ) {
        mes "require :-";
        .@size = getarraysize( getd( ".petr"+ .@pet_class[.@s] ) );
        for ( .@i = 0; .@i < .@size; .@i += 2 )
            mes getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" )+"x "+ getitemname( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) );
    }
    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 ( getd( ".petr"+ .@pet_class[.@s] ) ) {
        .@size = getarraysize( getd( ".petr"+ .@pet_class[.@s] ) );
        for ( .@i = 0; .@i < .@size; .@i += 2 ) {
            if ( countitem( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) ) < getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" ) ) {
                mes "you need "+ getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" ) +"x "+ getitemname( getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ) ) +" to evolve this pet";
                cutin "",255;
            close;
            }
        }
        for ( .@i = 0; .@i < .@size; .@i += 2 ) {
            delitem getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ), getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" );
            
        }    
    }
    makepet .@get_pet_id = getd( ".pet"+ .@pet_class[.@s] +"["+ rand( getarraysize( getd( ".pet"+ .@pet_class[.@s] ) ) ) +"]" );
    mes "your "+ .@pet_name$[.@c] +" has reborn into "+ getmonsterinfo( .@get_pet_id, 0 );
    mes "please rename your pet ~";
    close;
 
 
 
 
OnInit:
 
 
    .min_level = 2; // minimum level 80 to change pet egg
    .pet_min_friendly = getbattleflag("pet_support_min_friendly");
//    setarray getd( ".petr"+ <require pet egg> ), <require itemID 1>, <require item require 1>, <require itemID 2>, <require item require 2>, ...
    setarray getd( ".petr"+ 3317 ), 7224,1; // custom pet
    setarray getd( ".petr"+ 3318 ), 7224,1; // custom pet
 
//    setarray getd( ".pet"+ <require pet egg> ), <random pet egg 1>, <random pet egg 2> ....
     setarray getd( ".pet"+ 3317 ), 3332; // ??? Angel 1
	 setarray getd( ".pet"+ 3318 ), 3330; // ??? Angel 1
    // add more as needed
 
waitingroom "Pet Evolution" , 0;
 
end;
}
Edited by Helly
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   4
  • Joined:  01/13/13
  • Last Seen:  

        for ( .@i = 0; .@i < .@size; .@i += 2 ) {
            delitem getd( ".petr"+ .@pet_class[.@s] +"["+ .@i +"]" ), getd( ".petr"+ .@pet_class[.@s] +"["+( .@i +1 )+"]" );
            //here is deleting items
        }   
    }
// but there is not any other delitem deleting the egg it shoud be here
// no veo ningun otro delitem asi que deberia ir aqui antes de entregar el nuevo pet
    makepet .@get_pet_id = getd( ".pet"+ .@pet_class[.@s] +"["+ rand( getarraysize( getd( ".pet"+ .@pet_class[.@s] ) ) ) +"]" );
    mes "your "+ .@pet_name$[.@c] +" has reborn into "+ getmonsterinfo( .@get_pet_id, 0 );
    mes "please rename your pet ~";
    close;

also in the post they say

add in request same egg item for Evolution to delete egg , so you can add a second delete or add the egg in the required items

 

Edited by juanfu
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  258
  • Reputation:   54
  • Joined:  01/09/12
  • Last Seen:  

Test and working fine! ty! I dont saw that part! :3 I owe you a drink!

Edited by Helly
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...