Jump to content
  • 0

Item refinement checker script


Question

Posted

Hello everyone,

 

May I request a simple checker script that would check players' equipped items and inventory of over upgraded items more than +10. When there are no items of above +10 refinement in equip and inventory they will be warped somewhere. Or is this even possible?

 

I tried to do this but I cannot find the right scripts to use to check for refinements on items on a player.

 

Any help would be greatly appreciated.

 

Thank you guys!

 

 


 

7 answers to this question

Recommended Posts

Posted

The query would only work if they talk to the npc. Not everytime. So i think it would not affect server performance that much.

 

For refine, add this on your script :

query_sql "SELECT `refine` FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0)+ "'",.@refine;
for ( set .@i, 0; .@i < getarraysize(.@refine); set .@i, .@i + 1 )
    if ( .@refine[.@i] > 10 ) 
        end;

 

 

 

 

 

Thank you my friend!

  • 1
Posted

Try this one :

prontera,150,150,0    script    Sample    100,{
    for ( set .@j, 1; .@j < 11; set .@j, .@j + 1 )
        if ( getequiprefinerycnt(.@j) > 10 ) end;
    getinventorylist;
    for ( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 )
        if ( @inventorylist_refine[.@i] > 10 ) end;
        
    mes "Bye ~";
    warp "prontera",150,150;
    close;
}
  • Upvote 1
Posted

Try this one :

prontera,150,150,0    script    Sample    100,{
    for ( set .@j, 1; .@j < 11; set .@j, .@j + 1 )
        if ( getequiprefinerycnt(.@j) > 10 ) end;
    getinventorylist;
    for ( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 )
        if ( @inventorylist_refine[.@i] > 10 ) end;
        
    mes "Bye ~";
    warp "prontera",150,150;
    close;
}

 

 

Nice it works! But can you also add a cart items checker? Because I just remembered players can just put the +11 items in cart first upon entering and get it from cart when inside to bypass these checks. Then deal the items to friends inside the map. Only for cart skilled jobs.

 

 

Thank you my friend!

 

Posted

I think there is no existing script command to check all items of cart of a certain player. Can be done through query_sql.

 

Can you give me an sql line that would do such query?

 

But dont you think it will affect server performance if there will be too much sql queries when player goes in a map? It will be a pvp map and multiple players will often going in multiple times a day.

 

Thanks.

Posted

The query would only work if they talk to the npc. Not everytime. So i think it would not affect server performance that much.

 

For refine, add this on your script :

query_sql "SELECT `refine` FROM `cart_inventory` WHERE `char_id` = '" +getcharid(0)+ "'",.@refine;
for ( set .@i, 0; .@i < getarraysize(.@refine); set .@i, .@i + 1 )
    if ( .@refine[.@i] > 10 ) 
        end;

 

Posted

you can do like this too

query_sql( "SELECT COUNT(`nameid`) FROM `cart_inventory` WHERE `char_id` = "+getcharid(0)+" AND `refine` > 10",.@count );
if( .@count ){
    mes "please remove all refined item in your cart.";
    close;
}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...