Jump to content
  • 0

Block equip/unequipwhile talking with NPC


RagnaDev

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   0
  • Joined:  05/05/17
  • Last Seen:  

Is that possible? I mean, while talking to a npc, block player to unequip or equip hats / armors, etc.

Regards

Edited by DonTako
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  740
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

8 minutes ago, DonTako said:

Is that possible? I mean, while talking to a npc, block player to unequip or equip hats / armors, etc.

Regards

*unequip <equipment slot>{,<char_id>};

This command will unequip whatever is currently equipped in the invoking
character's specified equipment slot. For a full list of possible equipment
slots see 'getequipid'.

If an item occupies several equipment slots, it will get unequipped from all of
them.

 

*getequipid({<equipment slot>,<char_id>})

This function returns the item ID of the item slot that calls the script
on the invoking character or the specified equipment slot. If nothing is
equipped there, it returns -1.
Valid equipment slots are:

EQI_COMPOUND_ON (-1)      - Item slot that calls this script (In context of item script)
EQI_ACC_L (0)             - Accessory 1
EQI_ACC_R (1)             - Accessory 2
EQI_SHOES (2)             - Footgear (shoes, boots)
EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
EQI_HEAD_TOP (6)          - Upper Headgear
EQI_ARMOR (7)             - Armor (jackets, robes)
EQI_HAND_L (8)            - Left hand (weapons, shields)
EQI_HAND_R (9)            - Right hand (weapons)
EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
EQI_COSTUME_GARMENT (13)  - Costume Garment
EQI_AMMO (14)    		  - Arrow/Ammunition
EQI_SHADOW_ARMOR (15)     - Shadow Armor
EQI_SHADOW_WEAPON (16)    - Shadow Weapon
EQI_SHADOW_SHIELD (17)    - Shadow Shield
EQI_SHADOW_SHOES (18)     - Shadow Shoes
EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1

Notice that a few items occupy several equipment slots, and if the character is
wearing such an item, 'getequipid' will return its ID number for either slot.

Can be used to check if you have something equipped, or if you haven't got
something equipped:

	if (getequipid(EQI_HEAD_TOP) == 2234)
		mes "What a lovely Tiara you have on";
	else
		mes "Come back when you have a Tiara on";
	close;

You can also use it to make sure people don't pass a point before removing an
item totally from them. Let's say you don't want people to wear Legion Plate
armor, but also don't want them to equip if after the check, you would do this:

	if (getequipid(EQI_ARMOR) == 2341 || getequipid(EQI_ARMOR) == 2342) {
		mes "You are wearing some Legion Plate Armor, please drop that in your stash before continuing";
		close;
	}
	// the || is used as an or argument, there is 2341 and 2342 cause there are
	// two different legion plate armors, one with a slot one without.

	if (countitem(2341) > 0 || countitem(2432) > 0) {
		mes "You have some Legion Plate Armor in your inventory, please drop that in your stash before continuing";
		close;
	}
	mes "I will lets you pass.";
	close2;
	warp "place",50,50;
	end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   0
  • Joined:  05/05/17
  • Last Seen:  

Thanks for the reply, but I think I expressed myself badly.
I mean that when speaking to the NPC and while the window is active, avoid equipping or removing equipment (either by dragging it or by double clicking).
Anyway, I think I'll fix it by doing extra validations at Npc code.
Thank you very much.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

You prolly need this.

https://github.com/rathena/rathena/blob/c856b07c45aed6c5842ee19a940f7e76f780221c/doc/script_commands.txt#L5003-L5012

*enable_items;
*disable_items;


These commands toggle the ability to change equipment while interacting with
an NPC. To avoid possible exploits, the commands affect the particular script
instance only. Note that if a different script also calls enable_items, it
will override the last call (so you may want to call this command at the start
of your script without assuming it is still in effect).


The default setting, 'item_enabled_npc', is defined in 'conf/battle/items.conf'.

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   0
  • Joined:  05/05/17
  • Last Seen:  

On 8/24/2018 at 10:44 PM, Ninja said:

You prolly need this.

https://github.com/rathena/rathena/blob/c856b07c45aed6c5842ee19a940f7e76f780221c/doc/script_commands.txt#L5003-L5012


*enable_items;
*disable_items;


These commands toggle the ability to change equipment while interacting with
an NPC. To avoid possible exploits, the commands affect the particular script
instance only. Note that if a different script also calls enable_items, it
will override the last call (so you may want to call this command at the start
of your script without assuming it is still in effect).


The default setting, 'item_enabled_npc', is defined in 'conf/battle/items.conf'.

 

Thank you ❤️ Its done

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