Jump to content
  • 0
johnbond

Item refinement checker script

Question

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!

 

 


 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

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)+ "'",[email protected];
for ( set [email protected], 0; [email protected] < getarraysize([email protected]); set [email protected], [email protected] + 1 )
    if ( [email protected][[email protected]] > 10 ) 
        end;

 

 

 

 

 

Thank you my friend!

Link to comment
Share on other sites

  • 1

Try this one :

prontera,150,150,0    script    Sample    100,{
    for ( set [email protected], 1; [email protected] < 11; set [email protected], [email protected] + 1 )
        if ( getequiprefinerycnt([email protected]) > 10 ) end;
    getinventorylist;
    for ( set [email protected],0; [email protected] < @inventorylist_count; set [email protected], [email protected] + 1 )
        if ( @inventorylist_refine[[email protected]] > 10 ) end;
        
    mes "Bye ~";
    warp "prontera",150,150;
    close;
}
  • Upvote 1
Link to comment
Share on other sites

Try this one :

prontera,150,150,0    script    Sample    100,{
    for ( set [email protected], 1; [email protected] < 11; set [email protected], [email protected] + 1 )
        if ( getequiprefinerycnt([email protected]) > 10 ) end;
    getinventorylist;
    for ( set [email protected],0; [email protected] < @inventorylist_count; set [email protected], [email protected] + 1 )
        if ( @inventorylist_refine[[email protected]] > 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!

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)+ "'",[email protected];
for ( set [email protected], 0; [email protected] < getarraysize([email protected]); set [email protected], [email protected] + 1 )
    if ( [email protected][[email protected]] > 10 ) 
        end;

 

Link to comment
Share on other sites

you can do like this too

query_sql( "SELECT COUNT(`nameid`) FROM `cart_inventory` WHERE `char_id` = "+getcharid(0)+" AND `refine` > 10",[email protected] );
if( [email protected] ){
    mes "please remove all refined item in your cart.";
    close;
}
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...

Important Information

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