Jump to content

Simple Warper NPC


Valiente

Recommended Posts


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  132
  • Reputation:   8
  • Joined:  07/19/12
  • Last Seen:  

Simple Warper NPC

This is just a simple script that I coded in a matter of 2 days wherein players can type the name of the map (eg. prontera, ra_san01, /etc) that they want to warp to.

It also comes with a last warp system so that players won't have to type the same map name over and over again. The npc is placed in Prontera only. It's up to you whether you want to add new duplicates.

Special thanks to AnnieRuru for giving helpful advices.

Enjoy everyone. :)

Suggestions to improve the script are encouraged!

http://pastebin.com/XXNt13cy

Edited by Valiente
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

I highly suggest setting all your arrays as NPC variables OnInit so they don't load every time a player wants to warp. I'd also suggest removing the special payment cases, or at least make a note of it in your description.

While I can see what you were attempting with your spacing, it's still much more difficult to read than scripts with standard indentation. :3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  132
  • Reputation:   8
  • Joined:  07/19/12
  • Last Seen:  

Thanks for that. What do you exactly mean by OnInit. Sorry but I'm kinda new with the scripting commands. I'm trying to learn the language lol.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Everything you need is here: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/doc/script_commands.txt

OnInit:

OnInit will execute every time the scripts loading is complete, including when

they are reloaded with @reloadscript command.

Set all of your arrays once as NPC variables (.var[] instead of .@var[]) under that label, so you won't have to keep re-setting those large lists.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  132
  • Reputation:   8
  • Joined:  07/19/12
  • Last Seen:  

Okay, I'll do the changes to qualify your advice.

Thanks for the info.

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