LUA in magos menu

Shout-Out

User Tag List

Thread: LUA in magos

Results 1 to 14 of 14
  1. #1
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA in magos

    Umm how to i put this on my mangos server

    I tried puting it into c:/xampp/mangos/scripts/ but when i go ingame to try use it it wont load and says npcid isnt exisiting

    Code:
    -*****************************************
    --*UniversalTeleNPC script by Oxin v1.2 *
    --* AspireDev.org *
    --*Made for SydneyWotlkBeta *
    --*Everyone is free to distribute and modify to their *
    --*needs but please leave the original credits *
    --*****************************************
    local npcid = 200000
    local menunum = 33310
    local menuicon = 4
    local teleicon = 2
    local menu =
    {
    {"Class Trainers",
    {
    {"Paladin", 37, 1160.088257, 371.752472, 355.525665},
    {"Priest", 37, 1160.088257, 371.752472, 355.525665},
    {"Shaman", 37, 1057.267456, 397.039124, 339.991333},
    {"Warrior", 37, 1024.346680, 386.166229, 332.062164},
    {"Rogue", 37, 1011.189636, 391.762573, 336.828796},
    {"Warlock", 37, 1218.062134, 346.329102, 370.863312},
    {"Mage", 37, 1218.062134, 346.329102, 370.863312},
    {"Hunter", 37, 1165.920898, 308.611786, 354.212952},
    {"Druid", 37, 1165.920898, 308.611786, 354.212952}
    }
    },
    {"Profession Trainers",
    {
    {"Leatherworking", 37, 1026.105103, 385.793518, 336.799896},
    {"Enchanting", 37, 1218.062134, 346.329102, 370.863312},
    {"Blacksmithing", 37, 1240.293823, 243.216705, 355.536072},
    {"Engineering", 37, 1240.293823, 243.216705, 355.536072},
    {"Alchemy", 37, 1227.457886, 198.279648, 354.644836},
    {"Tailoring", 37, 1180.818604, 194.865295, 357.214050},
    {"Jewelcrafting", 37, 1178.090942, 206.977142, 372.440460},
    {"Cooking", 37, 1159.221436, 331.393188, 354.312592}
    }
    },
    {"Vendors",
    {
    {"Main Vendors", 37, 1175.451782, 270.882629, 357.752716},
    {"Gems", 37, 1104.128174, 401.164734, 354.609253},
    {"Containers", 37, 1104.128174, 401.164734, 354.609253},
    {"Projectiles", 37, 1104.128174, 401.164734, 354.609253},
    {"Season 3", 37, 1096.719971, 298.905939, 338.617249},
    {"Dungeon Tiers", 37, 1096.719971, 298.905939, 338.617249},
    {"Food", 37, 1159.419434, 214.685043, 357.204498}
    }
    },
    {"Innkeeper", 37, 1180.024780, 211.609070, 357.207306},
    {"Mounts", 37, 1140.919189, 277.717896, 353.954224},
    {"Battlemasters", 37, 99.597717, 344.603516, 333.011078},
    {"Weaponmaster", 37, 1143.361450, 213.367447, 356.382141}
    }
    
    function TeleNPC_MainMenu(Unit, Player)
    local i = 0
    Unit:GossipCreateMenu(menunum, Player, 0)
    for k,v in pairs(menu) do
    i = i + 1
    if type(v[2]) == "table" then
    Unit:GossipMenuAddItem(menuicon, v[1], i, 0)
    i = i + #(v[2])
    else
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    end
    Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_SubMenu(Unit, Player, i, Submenu)
    Unit:GossipCreateMenu(menunum-i, Player, 0)
    Unit:GossipMenuAddItem(7, "<--Back", 0, 0)
    for k,v in pairs(Submenu) do
    i = i + 1
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    Unit:GossipSendMenu(Player)
    end
    
    function TeleNPC_OnGossipTalk(Unit, Event, Player)
    TeleNPC_MainMenu(Unit, Player)
    end
    
    function TeleNPC_OnGossipSelect(Unit, Event, Player, MenuId, Id, Code)
    local i = 0
    if(Id == 0) then
    TeleNPC_MainMenu(Unit,Player)
    else
    for k,v in pairs(menu) do
    i = i + 1
    if (Id == i) then
    if type(v[2]) == "table" then
    TeleNPC_SubMenu(Unit, Player, i, v[2])
    else
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(v[2], v[3], v[4], v[5])
    end
    Unit:GossipComplete(Player)
    end
    return
    elseif (type(v[2]) == "table") then
    for j,w in pairs(v[2]) do
    i = i + 1
    if (Id == i) then
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(w[2], w[3], w[4], w[5])
    end
    Unit:GossipComplete(Player)
    return
    end
    end
    end
    end
    end
    end
    
    RegisterUnitGossipEvent(npcid, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "TeleNPC_OnGossipSelect")

    LUA in magos
  2. #2
    fresh's Avatar Member
    Reputation
    23
    Join Date
    Oct 2007
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    13 Thread(s)
    Originally Posted by Anthonyrox8 View Post
    Umm how to i put this on my mangos server

    I tried puting it into c:/xampp/mangos/scripts/ but when i go ingame to try use it it wont load and says npcid isnt exisiting

    Code:
    -*****************************************
    --*UniversalTeleNPC script by Oxin v1.2 *
    --* AspireDev.org *
    --*Made for SydneyWotlkBeta *
    --*Everyone is free to distribute and modify to their *
    --*needs but please leave the original credits *
    --*****************************************
    local npcid = 200000
    local menunum = 33310
    local menuicon = 4
    local teleicon = 2
    local menu =
    {
    {"Class Trainers",
    {
    {"Paladin", 37, 1160.088257, 371.752472, 355.525665},
    {"Priest", 37, 1160.088257, 371.752472, 355.525665},
    {"Shaman", 37, 1057.267456, 397.039124, 339.991333},
    {"Warrior", 37, 1024.346680, 386.166229, 332.062164},
    {"Rogue", 37, 1011.189636, 391.762573, 336.828796},
    {"Warlock", 37, 1218.062134, 346.329102, 370.863312},
    {"Mage", 37, 1218.062134, 346.329102, 370.863312},
    {"Hunter", 37, 1165.920898, 308.611786, 354.212952},
    {"Druid", 37, 1165.920898, 308.611786, 354.212952}
    }
    },
    {"Profession Trainers",
    {
    {"Leatherworking", 37, 1026.105103, 385.793518, 336.799896},
    {"Enchanting", 37, 1218.062134, 346.329102, 370.863312},
    {"Blacksmithing", 37, 1240.293823, 243.216705, 355.536072},
    {"Engineering", 37, 1240.293823, 243.216705, 355.536072},
    {"Alchemy", 37, 1227.457886, 198.279648, 354.644836},
    {"Tailoring", 37, 1180.818604, 194.865295, 357.214050},
    {"Jewelcrafting", 37, 1178.090942, 206.977142, 372.440460},
    {"Cooking", 37, 1159.221436, 331.393188, 354.312592}
    }
    },
    {"Vendors",
    {
    {"Main Vendors", 37, 1175.451782, 270.882629, 357.752716},
    {"Gems", 37, 1104.128174, 401.164734, 354.609253},
    {"Containers", 37, 1104.128174, 401.164734, 354.609253},
    {"Projectiles", 37, 1104.128174, 401.164734, 354.609253},
    {"Season 3", 37, 1096.719971, 298.905939, 338.617249},
    {"Dungeon Tiers", 37, 1096.719971, 298.905939, 338.617249},
    {"Food", 37, 1159.419434, 214.685043, 357.204498}
    }
    },
    {"Innkeeper", 37, 1180.024780, 211.609070, 357.207306},
    {"Mounts", 37, 1140.919189, 277.717896, 353.954224},
    {"Battlemasters", 37, 99.597717, 344.603516, 333.011078},
    {"Weaponmaster", 37, 1143.361450, 213.367447, 356.382141}
    }
     
    function TeleNPC_MainMenu(Unit, Player)
    local i = 0
    Unit:GossipCreateMenu(menunum, Player, 0)
    for k,v in pairs(menu) do
    i = i + 1
    if type(v[2]) == "table" then
    Unit:GossipMenuAddItem(menuicon, v[1], i, 0)
    i = i + #(v[2])
    else
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    end
    Unit:GossipSendMenu(Player)
    end
     
    function TeleNPC_SubMenu(Unit, Player, i, Submenu)
    Unit:GossipCreateMenu(menunum-i, Player, 0)
    Unit:GossipMenuAddItem(7, "<--Back", 0, 0)
    for k,v in pairs(Submenu) do
    i = i + 1
    Unit:GossipMenuAddItem(teleicon, v[1], i, 0)
    end
    Unit:GossipSendMenu(Player)
    end
     
    function TeleNPC_OnGossipTalk(Unit, Event, Player)
    TeleNPC_MainMenu(Unit, Player)
    end
     
    function TeleNPC_OnGossipSelect(Unit, Event, Player, MenuId, Id, Code)
    local i = 0
    if(Id == 0) then
    TeleNPC_MainMenu(Unit,Player)
    else
    for k,v in pairs(menu) do
    i = i + 1
    if (Id == i) then
    if type(v[2]) == "table" then
    TeleNPC_SubMenu(Unit, Player, i, v[2])
    else
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(v[2], v[3], v[4], v[5])
    end
    Unit:GossipComplete(Player)
    end
    return
    elseif (type(v[2]) == "table") then
    for j,w in pairs(v[2]) do
    i = i + 1
    if (Id == i) then
    if Player:IsInCombat() then
    Unit:SendChatMessage(12, 0, "You can't teleport while in combat!")
    else
    Player:Teleport(w[2], w[3], w[4], w[5])
    end
    Unit:GossipComplete(Player)
    return
    end
    end
    end
    end
    end
    end
     
    RegisterUnitGossipEvent(npcid, 1, "TeleNPC_OnGossipTalk")
    RegisterUnitGossipEvent(npcid, 2, "TeleNPC_OnGossipSelect")

    have you put the sql of the npc in your database ? if not it won't work until you make that npc

  3. #3
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohhhh how do i do that ? lol sorry for being a nub +rep if u can gimme a SQL to do it for me :P or just tell me haha

  4. #4
    fresh's Avatar Member
    Reputation
    23
    Join Date
    Oct 2007
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    13 Thread(s)
    Originally Posted by Anthonyrox8 View Post
    ohhhh how do i do that ? lol sorry for being a nub +rep if u can gimme a SQL to do it for me :P or just tell me haha
    well this is an example i ain't used mangos for months this is what you can do in your database to make this npc this isnt for mango's its for ascent but same idea on making npc's for mango's

    INSERT INTO `creature_names` VALUES ('50078', 'Reagent', 'Miscellaneous', '0', '0', '4', '0', '3', '0', '0', '23162', '23162', '0', '0', '1', '0', '0', '0');

    INSERT INTO `creature_proto` VALUES ('50078', '100', '100', '35', '1000000', '1000000', '100000', '1', '4224', '100', '10000', '10000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '5', '5', '5', '5', '5', '5', '5', '1', '1', '0', '0', '0', '0', '0', '3', '8', '14', '0', '0', '0', '0', '0', '0', '0', '0');

    creature_names and creture_proto the only edits you need to open to make your npc with lua++ scripts


    your npc would start with whats on your script (((local npcid = 200000)))
    Last edited by fresh; 09-20-2008 at 02:08 AM.

  5. #5
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wots creature_names and creature_proto transfer to in mangos there creature, crreature_template,creature_addon, this is the only problem i realli have.. lol...

  6. #6
    fresh's Avatar Member
    Reputation
    23
    Join Date
    Oct 2007
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    13 Thread(s)
    Originally Posted by Anthonyrox8 View Post
    wots creature_names and creature_proto transfer to in mangos there creature, crreature_template,creature_addon, this is the only problem i realli have.. lol...
    hmmm i can't remember i'll have to do a mango's compile again if you don't get your answer i'll se what i can do and show you step buy step how to make this script work but right now it's 3am here i'm off to sleep lol i'll check on this tomorrow to seeif you got you answer

  7. #7
    markbatt's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To add lua support in mangos look add event.cpp in arcemu . It is the first loading script that check for the directory script and the extention lua and gm. The loading of the lua scripts is controlled be the luascripting.cpp


    secondly you will have to write your own command set .The lua commands in acent lua will not be compatable.

    Hope this is usefull
    Last edited by markbatt; 09-20-2008 at 02:25 AM.

  8. #8
    fresh's Avatar Member
    Reputation
    23
    Join Date
    Oct 2007
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    13 Thread(s)
    here's a mangos vendor try this i just made it for mangos

    INSERT INTO creature_template
    (`entry`, `modelid_a`, `modelid_h`, `name`, `subname`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed`, `rank`, `mindmg`, `maxdmg`, `attackpower`, `baseattacktime`, `rangeattacktime`, `flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `class`, `race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `civilian`, `flag1`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `RacialLeader`, `ScriptName`)
    VALUES
    (200000, 14732, 14732, 'Custom Vendor', 'vendor', 20, 20, 2000, 2000, 2000, 2000, 1, 814, 814, 128, 1.1, 0, 100, 110, 800, 2500, 2500, 0, 0, 0, 0, 0, 0, 0, 200, 250, 800, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, '');

    i made useing your local npcid = 200000 good luck my friend

  9. #9
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ty heres ur rep

  10. #10
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aww doesnt work plz sumone help me

  11. #11
    Dythzer's Avatar Contributor
    Reputation
    271
    Join Date
    May 2008
    Posts
    461
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In MaNGOS things are scripted in C++. There is no Lua engine for it and will probably never be.

    ScriptDev2 is the project for C++ scripting for mangos.

    There was a project called "MangosScript" which supported Lua scripting for MaNGOS a while ago but no one actually wrote any scripts in Lua for it since ScriptDev2 with C++ scripting was so much better and powerful so that project died. So I suggest to look at current scripts for ScriptDev2 and learn from that instead. It's not hard and it's really fun when you've learned to script stuff with it, you can do anything with it like player houses which you spawn from an item or guild houses with guild inkeeper or whatever you want. Not just teleporter NPCs and stuff.
    Last edited by Dythzer; 09-20-2008 at 04:33 AM.

  12. #12
    Anthonyrox8's Avatar Banned
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    uh damn lol i realli cbf to learn c++ i heard its hard... lol
    LF sumone to make me a premade one that i can juist execute into my db will give reps need rezsickness remover, maxskill command,teleports to wotlk locations and tbc and classic, um, buffs, .save command. master trainer for everythink. mm and thats it lol will give u 2 reps hehe
    Last edited by Anthonyrox8; 09-20-2008 at 04:42 AM.

  13. #13
    Dythzer's Avatar Contributor
    Reputation
    271
    Join Date
    May 2008
    Posts
    461
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Anthonyrox8 View Post
    uh damn lol i realli cbf to learn c++ i heard its hard... lol
    For scripting in ScriptDev2 it's not really hard. All you have to learn is simple things like if and switch statements. Everything else can be copied/pasted from other scripts.

  14. #14
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gossip in C++ is pretty easy. Where as CreatureAI is not.


Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  3. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
  4. LUA Refrences
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-22-2007, 08:09 PM
  5. Gm robe and had on magos server
    By Torres in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 09-09-2007, 10:41 AM
All times are GMT -5. The time now is 12:33 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search