Jump to content

Script command: getitemcard


Sanasol

  

11 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

Description: Get card id from ANY item

it is desirable to check the unique thing

Download: src code

Definition:

BUILDIN_DEF(getitemcard,"ii")

I have used it for:

needed something that could be transferred, using another player's effect was removed from the owner

Sample:

getarg(0) - item_id

set @card2,getitemcard(getarg(0),2);
set @card3,getitemcard(getarg(0),3);
set @charid,(@card3*pow(2,16)+@card2);
set @cur_charid,getcharid(0);

if(@cur_charid == @charid) {
//my own item - ok
} else {
//not my own item - change owner
delitem2 getarg(0),1,1,0,0,254,0,@card2,@card3;
getnameditem(getarg(0),getcharid(0));
}

Link to comment
Share on other sites


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

isnt this is the same thing ??

*getequipcardid(<equipment slot>,<card slot>)

Returns value from equipped item slot in the indicated slot:

getequipcardid(num,slot)

where:
num = equip position slot
slot = 0,1,2,3 (Card Slot N)

This func returns CARD ID, 255,254,-255 (for card 0, if the item is produced) it's useful
when you want to check item cards or if it's signed. Useful for such quests as
"Sign this refined item with players name" etc;
Hat[0] +4 -> Player's Hat[0] +4

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

The script returns card id of item even if the item isn't equipped.

i think like

...

getinventorylist;

@inventorylist_card1, @inventorylist_card2 etc..

Edited by Lilith
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

It's a little useless if you have the same item several times... It will check the latest each time.

That's why I think it's better to use the getinventorylist() stuff for this check.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

never used getinventorylist, so do not know :(

thx :(

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
Reply to this topic...

×   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...