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..
"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!