ArcEmu: [lua] Teleporter Script - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[lua] Teleporter Script Simple NPC teleporter

#1 User is offline   metalsynkk 

  • Newbie
  • Group: Members
  • Posts: 2
  • Joined: 27-February 13
  • Gender:Male
  • Server OS:Windows

Posted 03 March 2013 - 07:46 PM

This is my first post here, I have been working from 0 knowledge in Lua to this in 2 days time, researching everything on my own, and I have tested this script and it's working (for as far as I've filled in the coordinates). This is the link:

[Lua] Simple Teleporter

What it is:

A basic teleporter with a menu for Alliance Cities, Horde Cities, Neutral Cities, Instances (divided into 3 submenu's for levels 11-40, 41-70 and 71-80), Raids (divided into Vanilla, TBC and WotLK), Arena and Battlegrounds, and a cancel function. I have added some colors to match some of the cities and instances, just to experiment with it.

A couple of remarks:

1. I have only filled in the coordinates of the 10 main cities, INCLUDING orientation as you are able to set that, so when you click the name it will port you to the city and you will be facing the city instead of some other random direction, as some players can be a little dumb and continue running in the direction the teleporter ports them.
2. The section for Arena and Battlegrounds isn't complete as my server is nowhere near those functions yet in terms of amount of players. If you know basic lua you can add those yourself, or ask me in the comments and I will get to it as soon as possible.
3. The "Never mind." option just exits the gossip in general, as I had trouble with going back in a menu (not anymore, I will fix it later). I now know how to make a subsubmenu (read the script) go back to a submenu, but as the main menu does not have an intid I have no idea how to go back to that.

Anyways, if you have anything to say about this script, please do, as I am just a novice and willing to learn new stuff about this. If you want to use this script, do not forget to create an NPC first here (a very handy tool, if you just read what it says you will have your npc in no time).

WoW-V NPC Creator

And if you want to include this script in your own server, be free to do so. This is not some masterpiece that needs copyright and credit everywhere, and even if I someday make a such a thing, it would be free.

M.
2

#2 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 06 March 2013 - 04:10 AM

Just a comment:

For better performance use instead
if () then 
  ....
end
if () then 
  ....
end
if () then 
  ....
end


this

if () then
  ...
elseif () then 
  ...
elseif () then
  ..
end


That's a kind of replacement for the case statement known in other languages than Lua.
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


1

#3 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 06 March 2013 - 04:50 AM

Nice script, +1 from me. You can return to the main menu by making another identical menu with intid say 998 or something and point the "Never Mind" from the first sub menus to that. Like so: http://pastebin.com/nrcJiuK6 .
You can really add lots of functions into this, you can make options to give you stuff or teach you spells, mounts and etc, max your skills and even enchant your gear. You can also make the gossip have some text in the menu above the options (not sure if you know this so i mentioned it). You can do this here "pUnit:GossipCreateMenu(100, pPlayer, 0)". The number 100 is ment to be a npc text id from "npc_text" table in your world database. You can either do custom text id or use something that already exists. You just replace that 100 with some text id and you have a gossip menu that says something and also has options.
However, i am not sure if you will be able to teleport to any battleground. The core will not allow you to do that. You can send battleground window to the player so he can join queue, but without some database editing you will not be able to teleport to a battleground or arena via lua script of any kind. And if you edit the database, the battleground itself might not work at all as intended.
Anyway, you did a great job so far. :)
Edit: You should also do the overall selection of the options as Magnifikator pointed out above.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users