[Lua][Noob Friendly] How to make Teleporter NPC w/ diff menu's menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Asbonia's Avatar Private
    Reputation
    1
    Join Date
    Jul 2010
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua][Noob Friendly] How to make Teleporter NPC w/ diff menu's

    Hey I'm Asbonia from Executer WoW Developing Staff.
    I'm here to show you guys how to make a Teleporter NPC w/ different menu's for Alliance and Horde.

    First lets start off with NPC id and the first function
    (Color Red = Must be changed)

    local npcid = NPC-ID

    function TeleNPC_OnGossipTalk(unit, event, player)
    Now we got the NPC id in place and the first function.
    Now we will find the race ID's to Alliance..

    local race=player:GetPlayerRace()
    if race==1 or race==3 or race==4 or race==7 or race==11 then
    Now we have found the race ids: 1, 3, 4, 7 and 11. Thats the Alliance's ones.

    Now lets make the alliance first menu:
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Menu Name", Menu ID, 0)
    unit:GossipSendMenu(player)
    the "Menu Name" you can switch to the name you want the menu to be named.
    Then "Menu ID" is important! Do not set the same ID twice!

    Now lets create a menu for the Horde:
    else

    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Menu Name", MenuID, 0)
    unit:GossipSendMenu(player)
    end
    end
    Change the same things you changed upside this.

    Now lets fix the sub-menues for Ally and Horde Menu.. (Only use the different menuid)
    function TeleNPC_OnGossipSelect(unit, event, player, id, intid, code)
    if(intid == MenuID for ALLY) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Stormwind", SubMenuID, 0)
    unit:GossipSendMenu(player)
    end
    Now you put in the Menu id in: if(intid == AllyMenuID) then

    And then you change the Sub Menu ID (This is the important ID!) This ID will be used when we add the teleports.

    Now a horde SuB Menu:
    if(intid == HordeMenuID) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Orgrimmar", SubMenuID, 0)
    unit:GossipSendMenu(player)
    end
    The sub menu id's for Ally and Horde can't be the same! Then the hole script ****s up

    Now to the teleports
    if(intid == StormwindMenuID) then
    player:Teleport(0, -8913.230469, 554.632996, 93.794830)
    unit:GossipComplete(player)
    end

    if(intid == OrgrimmarMenuID) then
    player:Teleport(1, 1505.377319, -4414.602539, 20.598469)
    unit:GossipComplete(player)
    end
    Now we finish up with registration the functions:
    RegisterUnitGossipEvent(npcid, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "TeleNPC_OnGossipSelect")
    Credits:
    Asbonia(Me) For the script
    DaWarrior99 For helping setting it up
    Have any questions? Just ask
    Last edited by Asbonia; 07-23-2010 at 09:18 AM.

    [Lua][Noob Friendly] How to make Teleporter NPC w/ diff menu's
  2. #2
    ramble's Avatar Knight-Lieutenant
    Reputation
    29
    Join Date
    Mar 2010
    Posts
    332
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    one question..

    where do i start? XD

  3. #3
    bfwlegend's Avatar Member
    Reputation
    4
    Join Date
    Jul 2007
    Posts
    71
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First you need to make a lua file and put
    Code:
    local npcid = NPC-ID
    
    function TeleNPC_OnGossipTalk(unit, event, player)
    in it like it says also look at other peoples teleporters and lua scripts to learn how to script lua that what i did to make my teleporter

    Edit: also get Notepad++ it will help you ALOT

  4. #4
    ramble's Avatar Knight-Lieutenant
    Reputation
    29
    Join Date
    Mar 2010
    Posts
    332
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay will try :]

    im done? Where should i put the file? im new to the database etc
    Last edited by ramble; 07-31-2010 at 11:50 AM.

  5. #5
    Boyyini's Avatar Private
    Reputation
    1
    Join Date
    Apr 2010
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for bringing up an old thread (its only a month ) but I have been looking for a guide like this for a long time.

    So what do you do after you have your code all set up? Lots of people dont understand how Lua works.

  6. #6
    shadowknight513's Avatar Knight
    Reputation
    11
    Join Date
    Apr 2008
    Posts
    197
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A piece of advice:
    Identify what type of core this is meant to be for / tested on.

Similar Threads

  1. [Guide] How to make a NPC cast spells. NO LUA!
    By Power of Illuminati in forum WoW EMU Guides & Tutorials
    Replies: 52
    Last Post: 05-06-2011, 07:13 AM
  2. [GUIDE][NOOB FRIENDLY] How To Add NPC L00t
    By sasoritail in forum WoW EMU Guides & Tutorials
    Replies: 9
    Last Post: 04-03-2009, 01:05 AM
  3. [Help] How to make an NPC Talk with Lua
    By Silentnvd in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-26-2008, 08:08 PM
  4. [Question] how to make custom NPCS?
    By sonnyd666 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 03-30-2008, 10:21 AM
  5. {PICS}How to make a NPC Have Armor or a Weapon
    By Dragonscale in forum WoW EMU Guides & Tutorials
    Replies: 20
    Last Post: 12-29-2007, 05:34 AM
All times are GMT -5. The time now is 03:40 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search