A list of LUA commands that can be added to a script. (more to come when more are known to me)
() is the place to add the ID's of the spell/sound, this list will NOT include ID's and numbers that are added inside the ()
X is NOT a real number, it is just to mark where you enter ID's of models, spells, NPCsounds and the like.
PlaySoundToSet(X) --> Plays a sound set X. (the sound is from NPC currently in the game, like Ragnaros)
CastSpell(X) --> Makes the NPC cast spell X on itself.
RemoveAura(X) --> Removes spell X from the NPC.
SendChatMessage(X, XX, XXX) --> Displays a chat message.
X: A number that tells the NPC if its supposed to /yell, /say and the like.
XX: If it is in a specific language (note: 0 is universal language)
XXX: The desired text for the NPC to say.
GetHealthPct() < X then --> If the NPC's health drops below X% a new event will begin if an event is included.
RemoveEvents() --> Removes all current events from the NPC. (Use this if the NPC dies or leaves combat)
SetModel(X) --> Changes the Units model into X
FullCastSpellOnTarget(X, pUnit:XX) --> Casts a spell on a target player.
X: is the spellID
You can put these as XX:
GetMainTank() casts spell X on the player with the highest aggro.
GetRandomPlayer(0) casts spell X on a random player within range.
GetAddTank() casts spell X on the player with the second highest threat. <--Halestorm wrote there has been problems with GetAddTank.
ClearHateList() --> Resets the NPC's threat list
:GetName() : Returns the unit's name.
:GetX() : Returns the unit's X position.
:GetY() : Returns the unit's Y position.
:GetZ() : Returns the unit's Z position.
:GetO() : Returns the unit's orientation.
:IsPlayer() : Returns true if the unit is a player, false otherwise.
:IsCreature() : Returns true if the unit is a creature, false otherwise.
:HasFinishedQuest(questID) : Returns true or false depending on if the quest has been completed.
:GetItemCount(itemID) : Returns the number of the items a unit has.
:GetHealthPct() : Returns the unit's health as a percentage.
:GetUnitBySqlId(sqlID) : Returns a unit from the sql ID.
:GetClosestPlayer() : Returns the nearest in-range unit that is a player.
:GetRandomPlayer(flags) : Returns a random in-range unit that is a player.
:GetRandomFriend() : Returns a random in-range unit that is a player and is friendly towards the current player.
:GetMainTank() : Returns the main tank (most hated).
:GetAddTank() : Returns the add tank (second most hated).
:GetTauntedBy() : Returns the player that taunted the unit.
:GetSoulLinkedWith() : Returns the unit that is set as the soul link for this unit.
:RegisterEvent() :
:SendChatMessage(type, language, message) : 'Unit says: <message>' style chat message.
:SendBroadcastMessage(message) :
:SendAreaTriggerMessage(message) :
:MoveTo(x, y, z, o) : Moves the unit to the specified position.
:CastSpell(spellID) : Causes the unit to cast a spell.
:CastSpellOnTarget(spellID, unitTarget) : Casts a spell on a target unit.
:FullCastSpell(spellID) : Casts a spell with casting time.
:FullCastSpellOnTarget(spellID, unitTarget) : Casts a spell with casting time on a target unit.
:SpawnGameObject(entryID, x, y, z, o, duration) : Spawns a gameobject at the specified position, despawning after duration milliseconds.
:SpawnCreature(entryID, x, y, z, o, faction, duration) : Spawns a creature at a position with specified faction, despawning after duration milliseconds.
:KnockBack(dx, dy, affect1, affect2) :
:MarkQuestObjectiveAsComplete(questID, objective) : Marks an objective of a quest as complete.
:LearnSpell(spellID) : Adds a spell to a unit.
:UnlearnSpell(spellID) : Removes a spell from a unit.
espawn(delay, respawn) : Despawns a unit after delay milliseconds and respawns it after respawn milliseconds.
:PlaySoundToSet(soundID) : Plays a sound to the surrounding area.
:RemoveAura(auraID) : Removes an aura from a unit.
:StopMovement(time) : Stops a unit from moving for time milliseconds.
:Emote(emoteID) : Tells a unit to perform an emote.
:AddItem(itemID, count) : Adds a quantity of items to a unit.
:RemoveItem(itemID, count) : Removes a quantity of items from a unit.
:CreateCustomWaypointMap() : Creates a custom waypoint map.
:CreateWaypoint(x, y, z, o, waitTime, flags, modelID) : Adds a waypoint to the custom waypoint map.
estroyCustomWaypointMap() : Destroys a created custom waypoint map.
:MoveToWaypoint(waypointID) : Tells a unit to move to a particular waypoint.
:SetMovementType(movementType) :
:SetCombatCapable(value) : If value is 1 the unit cannot attack.
:SetHealthPct(value) : Sets the unit's health percentage.
:SetNPCFlags(flags) : Sets the NPC flags of a unit.
:SetModel(modelID) : Sets the model (display ID) of a unit.
:SetScale(scale) : Sets the scale (size) of a unit.
:SetFaction(factionID) : Sets the faction of a unit.
:SetTauntedBy(unit) : Sets the unit that taunted the current unit.
:SetSoulLinkedWith(unit) : Sets the unit that is soul linked with this unit.
If people tell me plz because its shorter than please, i tell them no because its shorter than yes
i found this on a diffrent site i take no credit for makeing it at ALL! i repeat i take no credit for makeing this, in any case i hope it will help some people make a better server for there player or themselves, enjoy it thanks you alls