Jump to content
  • 0

How would I be able to do this...


Nipsino

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

I was wondering if there was any script command that would check if a player has a costume item equipped? This is what I've tried in the script that I was creating however I wouldn't get it to work as there's no 'getequipid(1024)' or 'getequipid(2048)' or 'getequipid(4096)'


celestiaj,60,82,5 script Dynamic 817,{
if(isequipped(20003) || isequipped(20004) || isequipped(20005)) {
mes "Looks like you're wearing a Dynamic Headgear! What would you like to do?";
switch(select("Merely nothing!:Change my Upper Headgear:Change my Middle Headgear:Change my Lower Headgear:Clear my Dynamic Headgears!")) {
case 1:
close;

case 2:
if(getequipid(1024) == 20003) {
mes "Please input the headgear ID you wish to change your Upper Headgear to!";
input upper_head;
next;
setlook 1024,upper_head;
close; } else { mes "You trying to trick me or something?!"; close; }

case 3:
if(getequipid(2048) == 20004) {
mes "Please input the headgear ID you wish to change your Middle Headgear to!";
input mid_head;
next;
setlook 2048,mid_head;
close; } else { mes "You trying to trick me or something?!"; close; }

case 4:
if(getequipid(4096) == 20005) {
mes "Please input the headgear ID you wish to change your Lower Headgear to!";
input low_head;
next;
setlook 4096,low_head;
close; } else { mes "You trying to trick me or something?!"; close; }

case 5:
mes "Now reseting your Upper Headgear!";
setlook 1024,0;
next;
mes "Now reseting your Middle Headgear!";
setlook 2048,0;
next;
mes "Now reseting your Lower Headgear!";
setlook 4096,0;
close;
}
} else { mes "I have no business with you."; close; }
}

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,181,5    script    kldjhfksdjhf    100,{
   getinventorylist;
   for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
       if ( @inventorylist_equip[.@i] & ( 1 << 10 ) ) {
           dispbottom "you are wearing "+ getitemname( @inventorylist_id[.@i] );
           break;
       }
   }
   if ( isequipped(19515) )
       dispbottom "yes, you are wearing a yellow hat";
   end;
}

*getinventorylist can retrieve a costume item

its hex value is

2^12 4096 = Costume Low Headgear

2^11 2048 = Costume Mid Headgear

2^10 1024 = Costume Top Headgear

and I tested with @item 19515 and @item 19516 ... seems to work

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Could you change the script to check these? --> EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

*getequipid(<equipment slot>)

This function returns the item ID of the item equipped in the equipment slot

specified on the invoking character. If nothing is equipped there, it returns -1.

Valid equipment slots are:

EQI_HEAD_TOP (1) - Upper head gear

EQI_ARMOR (2) - Armor (Where you keep your Jackets and Robes)

EQI_HAND_L (3) - What is in your Left hand.

EQI_HAND_R (4) - What is in your Right hand.

EQI_GARMENT (5) - The garment slot (Mufflers, Hoods, Manteaus)

EQI_SHOES (6) - What foot gear the player has on.

EQI_ACC_L (7) - Accessory 1.

EQI_ACC_R (8) - Accessory 2.

EQI_HEAD_MID (9) - Middle Headgear (masks and glasses)

EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks)

getequipid don't check if a player has a costume item equipped (not yet implented ?)

Maybe using getinventorylist ?

@inventorylist_equip[] - whether the item is equipped or not.

function checkcostume {
getinventorylist;
for ( .@i = 0; .@i < @inventorylist_count; .@i++ )
	if( @inventorylist_equip[.@i] && getiteminfo( @inventorylist_id[.@i], 5 ) == getarg(0) )
		return @inventorylist_id[.@i];
   return 0;

}

if( checkcostume( 1024 ) == 20003) {

Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

I was wondering if there was any script command that would check if a player has a costume item equipped?

What do you mean by "costume"?

If you mean cloth-changing, such as Santa Suit or other custom suits, refer to Checkoption.

If you mean to check if there is an item equipped on a certain slot, refer to Getequipid.

Tip: getequipid() is a function that needs a certain argument to work. You can find the list of possible arguments in the wiki page I linked above.

Tip2: to check if the slot is empty (nothing is equipped), just check if the function returns -1 or not.

if( getequipid(2) == -1 ) { mes "You are not wearing an Armor!!"; }

input low_head; 

About the input command, try not to use permanent player-attached variables to store your input, but just set them as Scope.

input .@low_head;
// OR, if you need to attach it to a player
input @low_head;

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

*getinventorylist can retrieve a costume item

I was sure (on the moment) @inventorylist_equip would return a boolean value /shy

It's more rational now

btw this commands

@inventorylist_equip[] - whether the item is equipped or not.

@inventorylist_identify[] - whether it is identified.

@inventorylist_attribute[] - whether it is broken.

lack a bit of precision, don't you think ? (personally, i should test to know which value they return X.X)

Edited by Capuche
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...