[LUA Scripting] For Beginners 1.0 menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Blackheat's Avatar Member
    Reputation
    81
    Join Date
    Apr 2007
    Posts
    67
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA Scripting] For Beginners 1.0

    Blackheats LUA Guide 1.0

    -----|Forewords|----------------------
    Greetings! It's nice to have you here.
    Grap a cup of tea, pull up a chair and listen to what I have to say...

    --------------------------|Contents|-----
    Today we're learning basics.

    Table of Contents
    1.1- Introducing LUA
    1.2- Simple boss script
    1.3- Numbers Used

    ------|Introducing LUA|------
    Lua is a script languange which is most known within World of Warcraft.
    World of Warcraft AddOns is scripted with LUA etc.
    Then what does this have anything to do with "Script a simple boss"?

    LUA Is also used for scripting bosses at World of Warcraft "private" servers.
    You'll hopefully get it soon :-)

    ------|Simple boss script|------
    Alright, let's start with your first script!
    This is going to be exciting right?! If not, you should be here. Before we start I have another thing to say. If you're not intrested in scripting etc etc then it's 50% Harder to learn anything.

    Alright, I am going to start showing you the complete script (Please note: This script is only for educational purposes, it's not a show of or anything)

    Code:
     
    function BossName_NowTalk(Unit, Event)
    Unit:SendChatMessage(Type, Language, "Boss talk/yell Message!")
    end
    
    RegisterUnitEvent(NpcID, When, "BossName_NowTalk")


    Alright, there you have it. All the fields marked with yellow color is the fields that you edit.

    We'll start from up to down..
    Code:
    BossName_NowTalk

    "BossName" Is where you put your NPC/Boss name, it's up to you!
    "NowTalk" Can the be the phase of the boss or just a note to know when.

    Code:
    Type, Language, "Boss talk/yell Message!"
    Type: For example this can be: Yell, Say, Whisper, etc etc. The exact numbers for this, scroll down.
    Language: Is the language you want the creature to talk. Numbers are also below.
    "Boss talk/yell Message!": PLEASE NOTE: The message must be inside of two of theese " ".
    Simply put the message you want the creature to say / yell.

    Code:
    NpcID, When, "BossName_NowTalk"

    NpcID: Here you put the ID Of the creature, this binds the script to the creature.
    When: This is when you want the script to react. Example, when the player(s) enter range, when the creature engages in combat etc etc. Numbers below.
    BossName_NowTalk: This must be the same as


    Code:
    function BossName_NowTalk(Unit, Event)
    Now, lets review the other part of the script, the noneditable.

    Code:
    function BossName_NowTalk(Unit, Event)
    Code:
    Unit:SendChatMessage(Type, Language, "Boss talk/yell Message!")
    end
    The ones marked with red MUST always be there, no matter what.
    function, always in start and end always in the end.
    Same goes for the Unit, Event.

    What about Unit:SendChatMessage ?
    This is a command which commands the unit to perform a action.
    You can also switch this out with other commands such as:
    Unit:CastSpell(Spellid)

    When you're done with your script, save it as "Boss_Name.lua" and you must have LUA enabled at your server.
    ------|Numbers Used|------
    Types
    12 - Monster Say
    14 - Monster Yell.
    Others will come in next guide.

    Languages
    0 - Universal (All races understands this)
    1 - Orcish (Orc Language, All horde understands)
    2 - Darnassian (Night Elf Language)
    3 - Taurahe (Tauren Language)
    6 - Dwarvish (Dwarf Language)
    7 - Common (Human Language, All alliance understands this)
    8 - Demonic
    9 - Titan
    13 - Gnomish (Gnome Language)
    14 - Troll (Troll Language, lol)
    33 - Gutterspeak (Undead Language)
    35 - Draenei (Draenei Language)

    When
    1 - When boss/npc enters combat.
    2 - Boss/NPC leaves combat.
    3 - Boss/NPC kills a player.
    4 - Boss/NPC dies.
    -------------------------------------

    ---------|EXTRAS|--------
    This is a fully working script, feel free to use it for educational purposes and to your server.

    Code:
     
    function Boss_Yell(Unit, Event)
    Unit:SendChatMessage(14, 0, "I will crush you!")
    end
     
    RegisterUnitEvent(PutYourNPCIDHere, 1, "Boss_Yell")



    ------------------------

    P.S. LUA Scripts are case sensetive!

    Thank you for this time, more coming up!
    Last edited by Blackheat; 03-22-2009 at 05:04 PM.

    [LUA Scripting] For Beginners 1.0
  2. #2
    Azshaz's Avatar Member
    Reputation
    7
    Join Date
    Feb 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A few questions.

    1) I see that you split the code boxes sometimes. Will these be seperate files, or the same file just a different line?
    2) We can just type these in notepad right?

    Thanks, and +rep for the great guide!

  3. #3
    Blackheat's Avatar Member
    Reputation
    81
    Join Date
    Apr 2007
    Posts
    67
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Azshaz View Post
    A few questions.

    1) I see that you split the code boxes sometimes. Will these be seperate files, or the same file just a different line?
    2) We can just type these in notepad right?
    @ 1): This is a bug which comes when I copy all my text.
    A whole script:

    Code:
    function PhaseorFunction_NPCname(Unit, Event)
    Unit:SendChatMessage(14, 0, "message")
    end
    
    RegisterUnitEvent(NPCID, When, "PhaseorFunction_NPCname")
    Sometimes in this guide it's different only different lines..
    Its not different lines when I explain, but when you see the script as a whole.

    @ 2): Yes. Aslong as you save them as a lua file.

  4. #4
    Azshaz's Avatar Member
    Reputation
    7
    Join Date
    Feb 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, thanks!

  5. #5
    knaur's Avatar Elite User
    Reputation
    400
    Join Date
    Nov 2007
    Posts
    634
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice one +4 rep
    ------------------------------------------------------
    Knaur - Founder of The Norwegian Elite Team

  6. #6
    Azshaz's Avatar Member
    Reputation
    7
    Join Date
    Feb 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where do I put it after its made? It doesn't work if I put it in script_bin

  7. #7
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice to see you contributing. +Rep x2


  8. #8
    knaur's Avatar Elite User
    Reputation
    400
    Join Date
    Nov 2007
    Posts
    634
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Azshaz View Post
    Where do I put it after its made? It doesn't work if I put it in script_bin

    hehe it shall be in your scripts folder not script_bin lol
    ------------------------------------------------------
    Knaur - Founder of The Norwegian Elite Team

  9. #9
    Azshaz's Avatar Member
    Reputation
    7
    Join Date
    Feb 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by knaur View Post
    hehe it shall be in your scripts folder not script_bin lol
    Don't see a scripts folder :<

    Could it be perhaps I'm using an older repack? I'm using a 2.4.3 repack. Or should I just make the folder?

  10. #10
    mineo117's Avatar Member
    Reputation
    3
    Join Date
    Jul 2008
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the reason you have not scripts folder is because you are using a repack. I personally do not advice you to use a repack rather you should compile server from the base source code. If you do not wish to start from scratch then you can simply just make a new folder in the root directory of your server folder called scripts and put your .lua files in there. I hope this helps you. +Rep for this guide not as detailed as i would have like but this is not a classroom either so great job.

  11. #11
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bumping this thread, i think its great. +rep x2

  12. #12
    Heliumz's Avatar Member
    Reputation
    26
    Join Date
    Jun 2009
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to be sure it's great :P
    Thank you Blackheat +rep
    Last edited by Heliumz; 06-22-2009 at 02:59 PM. Reason: rep added

  13. #13
    iavnunes's Avatar Active Member
    Reputation
    21
    Join Date
    Jan 2008
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its great

  14. #14
    Heliumz's Avatar Member
    Reputation
    26
    Join Date
    Jun 2009
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great Guide again.. +rep

  15. #15
    Cardell's Avatar Member
    Reputation
    9
    Join Date
    Mar 2008
    Posts
    68
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gonna use this to learn scripting soon

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 06-01-2010, 05:29 AM
  2. Lua Script For a Checkpoint Tele
    By shadowslayer133 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-12-2009, 05:07 PM
  3. Writing an LUA script for portals
    By ledz14 in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 08-10-2008, 12:05 PM
  4. Replies: 9
    Last Post: 06-19-2008, 03:55 AM
  5. LUA scripting. For noobs.
    By Locky in forum WoW EMU Guides & Tutorials
    Replies: 17
    Last Post: 06-05-2008, 02:12 PM
All times are GMT -5. The time now is 05:17 AM. 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