[Question] About Lua menu

User Tag List

Results 1 to 11 of 11
  1. #1
    Nilrac's Avatar Banned
    Reputation
    360
    Join Date
    Nov 2007
    Posts
    762
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] About Lua

    I have had this idea for a server, but I need to know if something is possible.

    First, it is possible to script a door or gate to open at a certain server time using C++ or Lua?

    Also is it possible to add your own music into the server and play it in a script with Unit:PlaySoundToSet(SoundID)

    [Question] About Lua
  2. #2
    Maven01's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2007
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Door or Gate would have to probably be C++...I've looked in the Lua functions (Both Lua++ and ArcEmu's...) and found nothing.
    Code:
    int luaGameObject_GetName(lua_State * L, GameObject * ptr);
    int luaGameObject_GetMapId(lua_State * L, GameObject * ptr);
    int luaGameObject_GetCreatureNearestCoords(lua_State * L, GameObject * ptr);
    int luaGameObject_GetGameObjectNearestCoords(lua_State *L, GameObject * ptr);
    //int luaGameObject_GetAreaID(lua_State * L, GameObject * ptr);
    int luaGameObject_GetClosestPlayer(lua_State * L, GameObject * ptr);
    int luaGameObject_GetZoneId(lua_State *L, GameObject * ptr);
    int luaGameObject_GetItemCount(lua_State * L, GameObject * ptr);
    int luaGameObject_GetSpawnX(lua_State * L, GameObject * ptr);
    int luaGameObject_GetSpawnY(lua_State * L, GameObject * ptr);
    int luaGameObject_GetSpawnZ(lua_State * L, GameObject * ptr);
    int luaGameObject_GetSpawnO(lua_State * L, GameObject * ptr);
    int luaGameObject_GetInRangePlayersCount(lua_State * L, GameObject * ptr);
    int luaGameObject_GetEntry(lua_State * L, GameObject * ptr);
    int luaGameObject_GetX(lua_State * L, GameObject * ptr);
    int luaGameObject_GetY(lua_State * L, GameObject * ptr);
    int luaGameObject_GetZ(lua_State * L, GameObject * ptr);
    int luaGameObject_GetO(lua_State * L, GameObject * ptr);
    int luaGameObject_GetInRangePlayers(lua_State * L, GameObject * ptr);
    int luaGameObject_GetInRangeGameObjects(lua_State * L, GameObject * ptr);
    int luaGameObject_GetInstanceID(lua_State * L, GameObject * ptr);
    int luaGameObject_GetUInt64Value(lua_State * L, GameObject * ptr);
    int luaGameObject_GetUInt32Value(lua_State * L, GameObject * ptr);
    int luaGameObject_GetFloatValue(lua_State * L, GameObject * ptr);
    int luaGameObject_GetGUID(lua_State * L, GameObject* ptr);
    int luaGameObject_Teleport(lua_State * L, GameObject * ptr);
    int luaGameObject_AddItem(lua_State * L, GameObject * ptr);
    int luaGameObject_Despawn(lua_State * L, GameObject * ptr);
    int luaGameObject_IsInWorld(lua_State * L, GameObject * ptr);
    int luaGameObject_IsInBack(lua_State * L, GameObject * ptr);
    int luaGameObject_IsInFront(lua_State * L, GameObject * ptr);
    int luaGameObject_PlaySoundToSet(lua_State * L, GameObject * ptr);
    int luaGameObject_SpawnCreature(lua_State * L, GameObject * ptr);
    int luaGameObject_SpawnGameObject(lua_State * L, GameObject * ptr);
    int luaGameObject_CalcDistance(lua_State * L, GameObject * ptr);
    int luaGameObject_SetOrientation(lua_State * L, GameObject * ptr);
    int luaGameObject_RemoveFromWorld(lua_State * L, GameObject * ptr);
    int luaGameObject_CalcRadAngle(lua_State * L, GameObject * ptr);
    int luaGameObject_SetUInt32Value(lua_State * L, GameObject * ptr);
    int luaGameObject_SetUInt64Value(lua_State * L, GameObject * ptr);
    int luaGameObject_SetFloatValue(lua_State * L, GameObject * ptr);
    int luaGameObject_ModUInt32Value(lua_State * L, GameObject * ptr);
    int luaGameObject_CastSpell(lua_State * L, GameObject * ptr);
    int luaGameObject_FullCastSpell(lua_State * L, GameObject * ptr);
    int luaGameObject_CastSpellOnTarget(lua_State * L, GameObject * ptr);
    int luaGameObject_FullCastSpellOnTarget(lua_State * L, GameObject * ptr);
    int luaGameObject_EventCastSpell(lua_State * L, GameObject * ptr);
    that's all the Lua++ Gameobject functions.

    and the Music is more on the client instead of the server. So you would need MyWarcraftStudio (to add music...) and to edit the MPQ's/DBC's for the Sound ID to be added.


    Hope this helped in anyway.
    Last edited by Maven01; 06-20-2008 at 09:25 PM.

  3. #3
    Greatdrak's Avatar Contributor
    Reputation
    99
    Join Date
    Sep 2007
    Posts
    445
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd say it is possible with LuA, but you cannot trigger the same door to literally open at a certain time, You would have to write a script to despawn the game object and spawn it back in Opened, so I'm not talking about a REAL door that opens and closes, you would have to just use two basic doors that dont open and spawn them back at an angle that appears as if they opened.

    Thats your best bet with LuA

    As far as playing music, you cant play music to other players unless they have the music on their client as well, this requires a patch..havent seen it done in a long long time.
    Roses are Blue, Violets are Red, I'm crap with colors, but killer in Bed.

  4. #4
    Nilrac's Avatar Banned
    Reputation
    360
    Join Date
    Nov 2007
    Posts
    762
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, thanks guys

  5. #5
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have had this idea for a server, but I need to know if something is possible.

    First, it is possible to script a door or gate to open at a certain server time using C++ or Lua?

    Also is it possible to add your own music into the server and play it in a script with Unit:PlaySoundToSet(SoundID)


    Tbh.. If you use a working gameobject the door thing is simple.. ill give u an example inasec.

    The only way to add music to your server is to get the sound files into the other players client. Ex, by using an mpq.


    Code:
    function Door(GameObject)
    OpenDoor=GameObject
    end
    Code:
    RegisterGameObjectEvent(gameobject entry id here,1,"Door")
    
    function Dooropen (Unit, Event)
    Unit:RegisterEvent("Dooropen_Open", Time, 0)
    end
    
    function Dooropen_Open(pUnit)
            OpenDoor:ActivateGameObject()
    end
    
    

    Last edited by b!atch; 06-21-2008 at 05:55 AM.
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  6. #6
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Argh the edit feature is messing up.. combine the 2 code boxes in one and u got the script
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  7. #7
    Nilrac's Avatar Banned
    Reputation
    360
    Join Date
    Nov 2007
    Posts
    762
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you +rep

  8. #8
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Np hon
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  9. #9
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exposing the server time to Lua doesn't sound that hard at all, nor does exposing TimedEvents to it.
    I'll see if I can implement those two things.

  10. #10
    runiker's Avatar Contributor
    Reputation
    105
    Join Date
    Nov 2007
    Posts
    501
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will plus rep the person who shows me the code to get server time as i need ti as well thank you!

  11. #11
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use os.date for this.
    Code:
    if os.date("%H:%M") == "21:00" then
    <do something>
    end
    More info about getting time in Lua

Similar Threads

  1. Question About Lua.
    By Ryan_Duke in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 10-08-2009, 04:30 PM
  2. A question about Lua
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 07-10-2008, 12:02 AM
  3. Question about Lua scripting
    By bill45 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-13-2008, 02:49 AM
  4. [Question] About lua files...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-15-2008, 06:26 PM
  5. A simple question about Lua Scripts
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 12-28-2007, 01:57 AM
All times are GMT -5. The time now is 07:26 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