Jump to content
  • 0

Item refinement checker script


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

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!

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

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!

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  03/15/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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;

 

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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;
}
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...