Jump to content
  • 0

Request source mod to prevent @warp/jump/etc... while in a dialog box.


Peopleperson49

Question


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Currently if you are in a script dialog box you can still be recalled with guild/party recall, use jump, warp, etc... This is especially bad for some scripts such as securty scripts upon login. But affects a much wider range of other things. I request a source mod to prevent anything that can warp/jump/recall player while their in a dialog box (modify the current commands to prevent). Need to have a allow setting for the group.conf that allows ADMIN to bypass this.

Peopleperson49

Edited by Peopleperson49
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Development Manager
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  732
  • Reputation:   525
  • Joined:  12/13/11
  • Last Seen:  

You could have a check in pc_setpos() to see if the character is talking to a NPC, but would this affect the warp script function.

if (sd->npc_id)
  return 1;

Return 1 actually returns an invalid map_index, so it's not a good return value but you'd have to create your own value (return 3) and have each function (warp, jump, recall, etc) check for return 3 as a player talking to a NPC. -- Banter. Can read if you wish.

So in short, you'd have to go through each command that changes a player's position (uses the pc_setpos() function) and have the check I used above, but instead of return 1 you would return -1. So you'd end up with:

if (sd->npc_id && get_group_level(sd) < X) {
  clif_displaymessage(fd, "You're talking to a NPC, failed to warp.");
  return -1;
}

You can add a battle_config flag if you want but that just seems like a little more work if you're only going to allow the admin group to bypass the check.

Edited by Aleos
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I really think that something like this should be implemented in the SVN.

The group.conf setting for admin comes into play if a char is stuck in a script thats missing a close or something. Recalling them closes the dialog and gives the admin some flexability without the player having to close out of the game. Granted you never plan for errors but they happen. If you use non-admin chars test scripts this could be useful.

So far I figured out that you would have to modufy warp, warpto, jump, go, recall, recall guild/party/partner.

Peopleperson49

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