Jump to content

Release: [Script Command] viewcondition


Zell

Recommended Posts


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

[Script Command] viewcondition


This mod allows you to set some conditions to a player can see or interact with a NPC.

Command:
viewcondition( npc_name, int_variable_name, compare_method, value_1, { value_2 } );

Compara Methods Avaiable:

EVC_LESS - If player variable is < value_1

EVC_EQUALS - if player variable is == value_1

EVC_MORE - if player variable is  > value_1

EVC_BETWEEN - if player variable is  >= value_1 and <= value_2

EVC_DIFFERENT - if player variable is != value_1

You can apply more than one condition to a npc, but if one condition fail, the npc will not be seeing by the player.

Script Sample:

 

new_1,55,111,5    Script    Lupina#1    10078,{

  mes "You can see and talk with me because your @teste variable is less than one!";
  next;
  mes "Now, I will set @teste to 2 and you will no longe see me when goes outsight me or if use @refesh!";
  close2;
  @teste = 2;
  end;

  OnInit:
     viewcondition( strnpcinfo(0), "@teste", EVC_LESS, 1 );
     end;
}

 


 

  • Upvote 3
Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   1
  • Joined:  06/21/20
  • Last Seen:  

Version 1.0 and 1.1 are the same.

I suggest you to add a check in OnTouch flag.

I also suggest you to add a way to refresh the view of the player when a variable is changed, otherwise the NPC won't disappear when check_can_see is false.
You could play around clif_getareachar_unit and clif_clearunit_single.

Edit:
Nice work by the way!

Edited by xVaan
Link to comment
Share on other sites

  • 10 months later...

  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

Any update for this? T_T

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