Jump to content
  • 0

How to disable normal attack if you are not equip specific item


Poring King

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Hello im trying to create a event that you are not allowed to kill monster if you are not equip with this item .

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

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

You can try to work with below command to get what you want

Spoiler

*pcblockskill <id>,<option>;
*unitblockskill <id>,<option>;

Prevents the given GID from casting skills when the option is 1, and enables
the ID to cast skills again when the option is 0. This command will run for
the attached unit if the given GID is zero.

Examples:
	// Prevents the current char from casting skills.
	pcblockskill getcharid(3),1;

	// Enables the current char to cast skills again.
	pcblockskill getcharid(3),0;

---------------------------------------

*setpcblock <type>,<state>{,<account ID>};
*getpcblock {<account ID>};

'setpcblock' command prevents/allows the player from doing the given <type> of action according
to the <state> during the player session (note: @reloadscript removes all <type> except PCBLOCK_IMMUNE).
The <type> values are bit-masks, multiples of <type> can be added to change the player action.

The action is blocked when the <state> is true, while false allows the action again.

'getpcblock' command return the bit-mask value of the currently
enabled block flags.

Available <type>:
	PCBLOCK_MOVE				Prevent the player from moving.
	PCBLOCK_ATTACK				Prevent the player from attacking.
	PCBLOCK_SKILL				Prevent the player from using skills/itemskills.
	PCBLOCK_USEITEM				Prevent the player from using usable items.
	PCBLOCK_CHAT				Prevent the player from sending global/guild/party/whisper messages.
	PCBLOCK_IMMUNE				Prevent the player from being hit by monsters.
	PCBLOCK_SITSTAND			Prevent the player from sitting/standing.
	PCBLOCK_COMMANDS			Prevent the player from using atcommands/charcommands.
	PCBLOCK_NPCCLICK			Prevent the player from clicking/touching any NPC/shop/warp.
	PCBLOCK_EMOTION				Prevent the player from using emotions.
	PCBLOCK_NPC				Simulate NPC interaction. Useful for NPC with no mes window. Sum of PCBLOCK_MOVE|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_NPCCLICK.
	PCBLOCK_ALL				Sum of all the flags.

Examples:

// Make the attached player invulnerable to monster (same as @monsterignore)
	setpcblock PCBLOCK_IMMUNE, true;

// Prevents the attached player from attacking and using skills
	setpcblock PCBLOCK_ATTACK|PCBLOCK_SKILL, true;

// Re-enables attack, skills and item use
	setpcblock PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM, false;

// getpcblock related checks
	if (getpcblock() & PCBLOCK_IMMUNE)
		mes "You are invulnerable!";

	if (getpcblock() & (PCBLOCK_MOVE|PCBLOCK_SITSTAND))
		mes "You can't walk or sit.";

	if ((getpcblock() & (PCBLOCK_ATTACK|PCBLOCK_SKILL)) == 0)
		mes "You can attack and use skills.";

	if (getpcblock() & PCBLOCK_CHAT)
		mes "You can't chat.";

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Just now, Patskie said:

You can try to work with below command to get what you want

  Hide contents


*pcblockskill <id>,<option>;
*unitblockskill <id>,<option>;

Prevents the given GID from casting skills when the option is 1, and enables
the ID to cast skills again when the option is 0. This command will run for
the attached unit if the given GID is zero.

Examples:
	// Prevents the current char from casting skills.
	pcblockskill getcharid(3),1;

	// Enables the current char to cast skills again.
	pcblockskill getcharid(3),0;

---------------------------------------

*setpcblock <type>,<state>{,<account ID>};
*getpcblock {<account ID>};

'setpcblock' command prevents/allows the player from doing the given <type> of action according
to the <state> during the player session (note: @reloadscript removes all <type> except PCBLOCK_IMMUNE).
The <type> values are bit-masks, multiples of <type> can be added to change the player action.

The action is blocked when the <state> is true, while false allows the action again.

'getpcblock' command return the bit-mask value of the currently
enabled block flags.

Available <type>:
	PCBLOCK_MOVE				Prevent the player from moving.
	PCBLOCK_ATTACK				Prevent the player from attacking.
	PCBLOCK_SKILL				Prevent the player from using skills/itemskills.
	PCBLOCK_USEITEM				Prevent the player from using usable items.
	PCBLOCK_CHAT				Prevent the player from sending global/guild/party/whisper messages.
	PCBLOCK_IMMUNE				Prevent the player from being hit by monsters.
	PCBLOCK_SITSTAND			Prevent the player from sitting/standing.
	PCBLOCK_COMMANDS			Prevent the player from using atcommands/charcommands.
	PCBLOCK_NPCCLICK			Prevent the player from clicking/touching any NPC/shop/warp.
	PCBLOCK_EMOTION				Prevent the player from using emotions.
	PCBLOCK_NPC				Simulate NPC interaction. Useful for NPC with no mes window. Sum of PCBLOCK_MOVE|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_COMMANDS|PCBLOCK_NPCCLICK.
	PCBLOCK_ALL				Sum of all the flags.

Examples:

// Make the attached player invulnerable to monster (same as @monsterignore)
	setpcblock PCBLOCK_IMMUNE, true;

// Prevents the attached player from attacking and using skills
	setpcblock PCBLOCK_ATTACK|PCBLOCK_SKILL, true;

// Re-enables attack, skills and item use
	setpcblock PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM, false;

// getpcblock related checks
	if (getpcblock() & PCBLOCK_IMMUNE)
		mes "You are invulnerable!";

	if (getpcblock() & (PCBLOCK_MOVE|PCBLOCK_SITSTAND))
		mes "You can't walk or sit.";

	if ((getpcblock() & (PCBLOCK_ATTACK|PCBLOCK_SKILL)) == 0)
		mes "You can attack and use skills.";

	if (getpcblock() & PCBLOCK_CHAT)
		mes "You can't chat.";

 

I think it solve already 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
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...