LuaBridge:Methods

From ArcEmu-Wiki
Revision as of 00:07, 4 June 2011 by Paroxysm (Talk | contribs)
Jump to: navigation, search

Contents


These are the Methods in LuaBridge.

Some method links have not be documented since the method name and parameters is self documenting enough.



Class Hierarchy

Gossip Menu

GossipMenu : constructor( GUID creature_guid, uint32 text_id, uint32 language )
void : AddItem( uint8 icon, string itemname, uint32 itemid, bool codebox )
void : AddMenuItem( uint8 icon, string itemname, uint32 itemid, uint32 boxmoney, string boxmsg, bool codebox )
void : Send( Player player )
uint32 : GetTextID()
void : SetTextID( uint32 newtextid )
static void : Complete( Player player )
static void : SendSimpleMenu( GUID creature_guid, uint32 text_id, Player player )

Object

The object class is the highest base class(actually eventableobject is the highest but it's not accessible in Lua since it's purely for utility rather than a standalone class) in Arcemu.

All other classes such as Item, Unit, GameObject, derive from Object. All objects in the Lua environment can access their methods without explicit casting since it's the most basic class.

Methods


GUID methods


GUID : GetGUID()
uint32 : GetHighGUID()
uint32 : GetLowGUID()
WoWGUID : GetNewGUID()
uint32 : GetEntryFromGUID()

Class identification methods


uint32 : GetEntry()
uint32 : GetTypeID()
bool : IsUnit()
bool : IsGameObject()
bool : IsPlayer()
bool : IsItem()
bool : IsCreature()
bool : IsPet()

Position methods


float : GetPositionX()
float : GetPositionY()
float : GetPositionZ()
float : GetOrientation()
void : SetPosition( float newX, float newY, float newZ, float newO )
float : GetSpawnX()
float : GetSpawnY()
float : GetSpawnZ()
float : GetSpawnO()
bool : IsInFront( Object target )
bool : IsBehind( Object target)
bool : IsInArc( Object target, float degrees )
float : CalcAngle( float x1, float y1, float x2, float y2 )
float : CalcRadAngle( float x1, float y1, float x2, float y2 )
uint32 : GetMapID()
uint32 : GetZoneID()
uint32 : SetMapID( uint32 newmapid )
uint32 : SetZoneID( uint32 newzoneid )

Object Model Manipulation


float : GetScale()
void : SetScale( float newscale )

Distance Manipulation Methods


float : CalcDistanceToObject( Object )
float : CalcDistanceToLocation( float x, float y, float z )

Phasing Methods


void : Phase ( uint32 command, uint32 newphase )
uint32 : GetPhase()
LCF void : PhaseAdd( uint32 phasetoadd )
LCF void : PhaseSet( uint32 phasetoset )
LCF void : PhaseDelete( uint32 phasetodelete )

InRange Objects Methods


table<Object> : GetInRangeOpposingFactions()
table<Object> : GetInRangeSameFactions()
table<Object> : GetInRangeObjects()
LCF table<Player> : GetInRangePlayers()
LCF table<Unit> : GetInRangeAllies()
LCF table<Unit> : GetInRangeEnemies()
LCF table<Unit> : GetRandomAlly()
LCF table<Unit> : GetRandomEnemy()
LCF table<Unit> : GetClosestAlly()
LCF table<Unit> : GetClosestEnemy()
LCF table<Player> : GetClosestPlayer()
LCF table<Player> : GetRandomPlayer( uint32 type )
LCF table<Creature> : GetInRangeCreatures()
LCF table<Unit> : GetInRangeUnits()
LCF table<Creature> : GetFriendlyCreatures()
LCF table<Creature> : GetHostileCreatures()
LCF table<GameObject> : GetInRangeGameObjects()

Object Flag Methods


uint32 : GetUInt32Value( uint32 field_index)
GUID : GetUInt64Value( uint32 field_index)
void : SetUInt32Value ( uint32 field_index, uint32 newvalue )
void : SetUInt64Value ( uint32 field_index, GUID newguid)
float : GetFloatValue ( uint32 field_index )
void : SetFloatValue ( uint32 field_index, float newvalue )
void : ModFloatValue ( uint32 field_index, float modvalue )
void : ModFloatValueByPCT ( uint32 field_index, int32 percentage )
void : ModUnsigned32Value ( uint32 field_index, int32 modvalue)
void : ModSigned32Value ( uint32 field_index, int32 modvalue)
uint8 : GetByte( uint32 field_index, uint32 byte_index )
void : SetByte( uint32 field_index, uint32 byte_index, uint8 byte_value)
void : SetFlag ( uint32 field_index, uint32 flag_to_append )
void : RemoveFlag ( uint32 field_index, uint32 flag_to_remove)

Misc Methods


void : PlaySoundToSet( uint32 sound_id )
bool : IsInBg()
bool : IsInWorld()
Spell : GetCurrentSpell()
void : SendPacket( WorldPacket packet )
void : DealDamage( Unit target, uint32 damage, uint32 targetEvent, uint32 spellid, bool no_remove_auras )

Unit

The Unit class is used to describe players and creatures.

It's effectively an abstract class since you can't instantiate a Unit.

It either has to be a player instantiation or a creature.

Unit derives from Object so it contains all its methods meaning you can call Object methods from a Unit userdata.

Methods


AIInterface : GetAIInterface()

PvP Methods


bool : IsPVPFlagged()
void : SetPVPFlag()
void : RemovePVPFlag()
bool : IsFFAPVPFlagged()
void : SetFFAPVPFlag()
void : RemoveFFAPVPFlag()
bool : IsSanctuaryFlagged()
void : SetSanctuaryFlag()
void : RemoveSanctuaryFlag()

Stat Methods


uint32 : GetLevel()
void : SetLevel( uint32 newlevel )
void : ModLevel( int32 modlevel )
uint32 : GetAP()
uint32 : GetRAP()
int32 : GetStealthLevel()
int32 : GetStealthDetectBonus()
void : SetMinDamage( float mindamage )
float : GetMinDamage()
void : SetMaxDamage( float maxdamage )
float : GetMaxDamage()
void : SetMinOffhandDamage( float minoffhanddamage )
float : GetMinOffhandDamage()
void : SetMaxOffhandDamage( float maxoffhanddamage )
float : GetMaxOffhandDamage()
void : SetStat( uint32 stat_index, uint32 amount )
uint32 : GetStat( uint32 stat_index )
void : SetResistance( uint32 res_index, uint32 amount )
uint32 : GetResistance( uint32 res_index )
void : SetBaseHealth( uint32 basehealth )
void : SetBaseMana( uint32 basemana )
uint32 : GetHealth()
void : SetHealth( uint32 newhealth)
uint32 : GetHealthPct()
void : SetHealthPct( uint32 percent )
uint32 : GetMaxHealth()
void : SetMaxHealth( uint32 newmaxhealth)
void : ModHealth( int32 modamount)
void : ModMaxHealth( int32 modamount)
uint32 : GetPower( uint32 power_type )
void : SetPower( uint32 power_type, uint32 amount )
uint32 : GetMaxPower( uint32 power_type )
void : SetMaxPower( uint32 power_type, uint32 amount )
void : SetManaPct( uint32 percent )

State Methods


bool : IsCasting()
bool : IsDazed()
bool : IsStealthed()
void  : RemoveStealth()
bool : IsInvisible()
void : SetInvisibility( uint32 id )
void : RemoveInvisibility()
bool : IsAlive()
bool : IsDead()
bool : IsPacified()
bool : IsFeared()
bool : IsStunned()
void : AddStateFlag( uint32 flag )
bool : HasStateFlag( uint32 flag )
void : ClearStateFlag( uint32 flag )
void : EnableAI()
void : DisableAI()
void : SetEmoteState( uint8 emote )
uint32 : GetOldEmote()

Attributes


uint32 : GetClassMask()
uint32 : GetRaceMask()
uint32 : GetFaction()
void : SetFaction( uint32 faction )
bool : IsSpiritHealer()
uint32 : GetClass()
void : SetClass( uint32 class)
uint32 : GetRace()
void : SetRace( uint32 race)
uint32 : GetPowerType()
void : SetPowerType( uint32 power_type )
uint32 : GetDisplayID()
void : SetDisplayID( uint32 newdisplay )
uint32 : GetDisplayID()
void : SetNativeDisplayID( uint32 newdisplay )

Combat Methods


return type methods
bool IsAttackReady( bool offhand )
void SetAttackTimer( uint32 time, bool offhand )
CombatStatus CombatStatus
void Heal( Unit target, uint32 spellid, uint32 amount )
void Energize( Unit target, uint32 spellid, uint32 amount, uint32 power_type)
uint32 GetThreatModifyer()
void ModThreatModifyer( int32 mod )

Messaging Methods

return type method
void SendChatMessage( uint32 chat_type, uint32 language_type, string message, uint32 delay)
void SendChatMessageToPlayer( uint32 chat_type, uint32 language_type, string message, Player plr)
void SendChatMessageAlternateEntry( uint32 creature_entry, uint32 chat_type, uint32 language_type, string message)

Movement


return type method
float runspeed
float walkspeed
float flyspeed

Spell/Aura


void : Demorph()
void : CastSpell( Unit target, uint32 spellid, bool triggered)
void : CastSpellAoF( float x, float y, float z, SpellEntry spell, bool triggered)
bool : HasAura( uint32 spellid )
uint32 : GetAuraStackCount( uint32 spellid)
bool : HasAurasWithMechanic( uint32 mechanic)
bool : RemoveAura( uint32 spellid, GUID guid)
bool : RemoveAllAuras( uint32 spellid, GUID guid)
void : RemoveNegativeAuras()
void : RemoveAllNonPersistentAuras()

CombatStatus


bool : IsInCombat()

Creature

The Creature class is what all in-game npcs are. It derives from Unit, so it contains all of Units methods.

Methods


Attributes


bool : IsVehicle()
bool : IsVendor()
bool : IsTrainer()
bool : IsClassTrainer()
bool : IsProfTrainer()
bool : IsQuestGiver()
bool : IsFlightMaster()
bool : IsCharterGiver()
bool : IsGuildBanker()
bool : IsBattleMaster()
bool : IsBanker()
bool : IsInnKeeper()
bool : IsTabardDesigner()
bool : IsAuctioneer()
bool : IsStableMaster()
bool : IsArmorer()
bool : IsTotem()
bool : IsExotic()
bool : IsCritter()
bool : IsTrainingDummy()
uint32 : GetSQLID()

Item


bool : HasItems()
uint32 : GetItemIdBySlot( uint32 slot )
uint32 : GetItemAmountBySlot( uint32 slot )
int32 : GetSlotByItemId( uint32 itemid)
uint32 : GetItemAmountByItemId( uint32 itemid)

Quests


bool : HasQuests()
bool : HasQuest( uint32 questid, uint32 type)
void : AddQuest( QuestRelation quest )
void : DeleteQuest( QuestRelation quest )
Quest : FindQuest( uint32 quest_id, uint8 relation)
uint32 : GetQuestRelation( uint32 quest_id)
uint32 : NumOfQuests()

Misc


void : RemoveFromWorld( bool free_guid)
CreatureProto : GetProto()
bool : CanSee( Unit target )
uint32 : GetTotemSlot()
Group : GetGroup()
CreatureInfo : GetCreatureInfo()
bool : isSkinned
bool : IsPickPocketed()
bool : Despawn( uint32 delay, uint32 respawndelay )
bool : m_noRespawn
Player : m_escorter
void : SaveToDB()
bool : canregeneratehp
void : RegisterEvent( lua_function function, uint32 delay, uint32 repeats, ... )
void : RemoveEvents()
CreatureAIScript : GetScript()

CreatureProto

A structure that holds useful information describing a creature. Every unique creature id has a copy of this structure.

property type property name
uint32 Id
uint32 MinLevel
uint32 MaxLevel
uint32 Faction
uint32 MinHealth
uint32 MaxHealth
uint32 Mana
uint32 NPCFlags
uint32 MinDamage
uint32 MaxDamage
uint32 boss
float walk_speed
float run_speed
float fly_speed
uint32 guardtype
uint32 summonguard

CreatureInfo

Another structure that holds useful information for a creature.

property type property name
uint32 Id
string Name
string SubName
uint32 Type
uint32 Family
uint32 Rank

CreatureAIScript

This class is what is responsible for calling the method AIUpdate() for creatures.

void : RegisterAIUpdateEvent( uint32 period )
void : ModifyAIUpdateEvent( uint32 newperiod)
void : RemoveAIUpdateEvent()

AIInterface

This class is what defines AI behavior for creatures.

Methods

return type method name
void SetUnitToFollow( Unit newtarget )
Unit GetUnitToFollow()
void SetFollowDistance( float newdistance )
void SetFollowAngle( float newangle )
Unit GetUnitToFear()
void SetUnitToFear( Unit newtarget )
Unit GetSoullinkedWith()
bool IsSoullinked()
void SetSoulLinkedWith( Unit newtarget )
uint8 GetAIState()
void SetAIState( uint32 newstate )
void MoveTo( float x,float y,float z, float o)
void StopMovement( uint32 stoptime )
bool hasWaypoints()
Unit GetNextTarget()
void SetNextTarget( Unit newtarget )
void AttackReaction( Unit target, uint32 threat, uint32 spellid )
void HealReaction( Unit healer, Unit victim, SpellEntry spell, uint32 amount )
void WipeHateList()
void RemoveThreatByPtr( Unit hated )
bool modThreatByPtr( Unit hated, int32 mod )
uint32 getThreatByPtr( Unit hated )
Unit GetMostHated()
Unit GetSecondHated()
bool taunt( Unit target, bool apply )
Unit GetTauntedBy()
bool IsTaunted()
uint32 GetCurrentWaypoint()
void ChangeWaypointID( uint32 oldid, uint32 newid )
Waypoint GetWaypoint( uint32 wpid )
void DeleteWayPoint( uint32 wpid )
void DeleteWayPoints()
void SetWaypointToMove( uint32 wpid )
void SetMoveType( uint32 movementtype)
uint32 GetMoveType()
bool IsFlying()
void AddWayPoint( Waypoint wptoadd )
uint32 GetAITargetsCount()
properties
property type property name
bool canmove
bool moveRun
bool moveFly
bool disable_combat
bool disable_melee
bool disable_spell
bool disable_targeting

Waypoint

This class defines a structure that provides location vector coordinates and other information creatures use for waypoints.

properties
property type property name
uint32 id
float x
float y
float z
float o
uint32 waittime
uint32 flags
uint32 backwardskinid
uint32 forwardskinid

GameObject

This class object defines things like doors/chests/traps/transports, etc. GameObjects are very passive objects since they mostly require input from a unit to function.

Methods

return type method name
bool HasQuests()
uint32 NumOfQuests()
void Despawn( uint32 delay, uint32 respawndelay )
bool IsQuestGiver()
void RemoveFromWorld( bool free_guid )
GameObjectAIScript GetScript()
GameObjectInfo GetInfo()
void SaveToDB()
void RegisterEvent( lua_function function, uint32 delay, uint32 repeats, ... )
void RemoveEvents()

GameObjectAIScript

This class is what is responsible for calling the method AIUpdate() for gameobjects.

return type method name
void RegisterAIUpdateEvent( uint32 period )
void ModifyAIUpdateEvent( uint32 newperiod)
void RemoveAIUpdateEvent()

GameObjectInfo

property type property name
uint32 ID
uint32 Type
uint32 DisplayID
string Name
uint32 SpellFocus

Player

This class is what defines the player. It derives from Unit so it has all of its methods.

Methods


Skill Manipulation

return type method proto
void AdvanceSkillLine( uint32 skilline, uint32 amount )
void AddSkillLine( uint32 skilline, uint32 current, uint32 max )
uint32 GetSkillLineMax( uint32 skilline )
uint32 GetSkillLineCurrent( uint32 skilline )
uint32 RemoveSkillLine( uint32 skilline )
void ModifySkillBonus( uint32 skilline, int32 mod )
void ModifySkillBonusByType( uint32 skilltype, int32 mod )
bool HasSkillLine( uint32 skilline )
void removeSkillSpells( uint32 skilline )
void RemoveAllSkills()
void advanceSkills( uint32 amount )
void modifyMaxSkill( uint32 skilline, uint32 newmax )
void learnSkillSpells( uint32 skilline, uint32 skillcurrent )

Languages

return type method proto
void RemoveLanguages()
void AddLanguages( bool all )

Taxi

return type method proto
TaxiPath GetTaxiPath()
bool GetTaxiState()
void TaxiStart( TaxiPath path, uint32 modelid, uint32 starting_node )
void SetTaxiPath( TaxiPath path)
void SetTaxiState( bool state )

Quest

return type method proto
bool HasQuests()
int32 GetOpenQuestSlot()
QuestLogEntry GetQuestLogForEntry( uint32 entry )
QuestLogEntry GetQuestLogInSlot( int32 slot )
uint32 GetQuestSharer()
void SetQuestSharer( uint32 guid )
void SetQuestLogSlot( QuestLogEntry qlog, uint32 slot )
void HasFinishedDaily( uint32 questid )
void AddToFinishedQuests( uint32 questid )
bool HasFinishedQuest( uint32 questid )
bool GetQuestRewardStatus( uint32 questid )
bool HasQuestForItem( uint32 itemid )
bool HasQuestSpell ( uint32 spellid )
void RemoveQuestSpell( uint32 spellid )
bool HasQuest( uint32 questid )
void RemoveQuestMob( uint32 id )

Player Team

return type method proto
uint32 GetTeam()
uint32 getInitialTeam()
void SetTeam( uint32 team )
void ResetTeam()
bool isHordeTeam()
bool isAllianceTeam()

Spells/Talents

return type method proto
bool HasSpell( uint32 spellid )
void AddSpell( uint32 spellid )
void AddShapeShiftSpell( uint32 spellid )
void RemoveShapeShiftSpell( uint32 spellid )
uint8 GetShapeShift()
void SetShapeShift( uint8 newss )
void ResetAllCooldowns()
void ClearCooldownForSpell( uint32 spellid )
uint32 GetTalentPoints()
void ModTalentPoints( int32 mod )
void SetTalentPoints( uint32 talentpoints )
void ResetSpells()
void ResetTalents()

Reputation

return type method proto
int32 GetStanding( uint32 faction )
void ModStanding( uint32 faction, int32 mod )
int32 GetBaseStanding( uint32 faction )
void SetStanding( uint32 faction, int32 value )
Standing GetStandingRank( uint32 faction )
uint32 GetExaltedCount()
uint8 GetPVPRank()
void SetPVPRank( int32 newrank )
uint32 GetMaxPersonalRating()
uint32 HasTitle( RankTitles title )
void SetKnownTitle( RankTitles title, bool set )

Group/Guild

return type method name
bool IsInGroup()
bool IsGroupLeader()
bool IsGroupMember( Player player )
bool IsInGuild()
uint32 GetGuildID()
void SetGuildID( uint32 id )
uint32 GetGuildRank()
void SetGuildRank( uint32 rank )

Dueling

return type method proto
void RequestDuel( Player target )
void EndDuel( uint8 winreason )
void DuelCountDown()
void SetDuelStatus( uint8 status )
uint8 GetDuelStatus()
void SetDuelState( uint8 state )
uint8 GetDuelState()
uint32 GetDuelTeam()
void SetDuelTeam( uint32 team )

Ban/Kick

return type method proto
bool IsBanned()
void SetBanned()
void SetBannedWithReason( string reason )
void clearBan()
string GetBanReason()
void Kick( uint32 delay )
void SoftDisconnect()

Misc

return type method proto
bool CanSee( Object target )
bool IsVisible( GUID target )
bool IsMounted()
void Dismount()
void SafeTeleport( uint32 mapid, uint32 instanceid, float x, float y, float z, float o)
void Teleport( uint32 mapid, float x, float y, float z )
uint32 GetDungeonDifficulty()
uint32 GetRaidDifficulty()
void Possess( Unit target )
void Unpossess()
string GetName()
WorldSession GetSession()
void KillPlayer()
void ResurrectPlayer()
void SetBindPoint( float x, float y, float z, uint32 mapid, uint32 zoneid )
void AddComboPoints( GUID target, uint32 points )
ItemInterface GetItemInterface()
void ResetPVPTimer()
void StopPVPTimer()
void PVPToggle()
void Resurrect()
void SetGlyph( uint32 slot, uint32 id )
void GetGlyph( uint32 slot )

Targetting

return type method proto
GUID GetFarsightTarget()
void SetFarsightTarget( GUID newtarget )
GUID GetTarget()
void SetTarget( GUID newtarget )
GUID GetSelection()
void SetSelection( GUID newtarget )
GameObject GetSelectedGO()

Gold/Honor/XP

return type method proto
uint32 GetGold()
void ModGold( int32 amount_to_mod )
bool HasGold( uint32 amount_to_check )
void SetGold( uint32 amount_to_set )
void GiveGold( int32 amount_to_give )
void TakeGold( int32 amount_to_take)
void SetHonorCurrency( uint32 amount_to_set )
void ModHonorCurrency( int32 amount_to_mod )
uint32 GetHonorCurrency()
void SetArenaCurrency( uint32 amount_to_set )
void ModArenaCurrency( int32 amount_to_mod )
uint32 GetArenaCurrency()
void SetXP( uint32 xp_to_set)
uint32 GetXP()
void SetNextLevelXP( uint32 xp_to_set )

WorldSession

This class is instantiated for every logged in player and it contains information about the players login session.

return type method proto
string GetAccountName()
string GetPermissions()
bool IsGM()
MovementInfo GetMovementInfo()

MovementInfo

A player structure that contains movement data.

property type property name
uint32 flags

ItemInterface

This class handles item manipulation and is coupled w/ a player object.

return type method proto
Player GetOwner()
bool IsBagSlot( uint32 slot )
Item GetInventoryItem( int8 slot_of_bag, int32 slot_in_bag )
int32 GetInventorySlotByID( uint32 item_id )
bool RemoveItemFromSlot( int8 slot_of_bag, int32 slot_in_bag )
uint32 AddItemToFreeSlot( Item item_to_add )
uint32 AddItemToFreeBankSlot( Item item_to_add )
uint32 GetItemCount( uint32 item_id, bool include_bank )
uint32 RemoveItemAmount( uint32 item_id, uint32 amount_to_remove )
void RemoveAllConjured()
int8 FindFreeBackPackSlot()
uint8 FindFreeBackPackSlotMax()
int8 FindFreeKeyringSlot()
bool IsEquipped( uint32 item_id )
bool AddItemByID( uint32 item_id, uint32 item_count, int32 random_prop = 0 )

Global Methods

Event Registering/Creation

return type function proto
bool RegisterServerHook( uint32 server_enter_to_hook, lua_function callback_function )
void RegisterCreatureEvent( uint32 creature_id, uint32 creature_event_to_hook, lua_function callback_function)
void RegisterQuestEvent( uint32 quest_id, uint32 quest_event_to_hook, lua_function callback_function)
void RegisterGameObjectEvent( uint32 gameobject_id, uint32 gameobject_event_to_hook, lua_function callback_function)
void RegisterInstanceEvent( uint32 map_id, uint32 instance_event_to_hook, lua_function callback_function)
void RegisterCreatureGossip( uint32 creature_id, uint32 gossip_event_to_hook, lua_function callback_function)
void RegisterItemGossip( uint32 item_id, uint32 gossip_event_to_hook, lua_function callback_function)
void RegisterGOGossip( uint32 gameobject_id, uint32 gossip_event_to_hook, lua_function callback_function)
bool RegisterDummySpell( uint32 spell_id, lua_function callback_function, ... args_to_pass)
int32 CreateLuaEvent( lua_function callback_function, uint32 callback_delay, uint32 callback_repeats )
void ModifyLuaEventInterval( int32 event_id, uint32 new_callback_delay )
void DestroyLuaEvent( int32 event_id )

Timed Coroutines

return type method proto
int32 SuspendLuaThread( coroutine coroutine_to_yield, uint32 yield_duration, ... args_to_save)

Object Type Casting

return type method proto
Player TO_PLAYER( Object object_to_cast )
Creature TO_CREATURE( Object object_to_cast )
Item TO_ITEM( Object object_to_cast )
Unit TO_UNIT( Object object_to_cast )
GameObject TO_GAMEOBJECT( Object object_to_cast )

Bitwise Operators

return type method proto
uint32 bit_and( uint32 left_operand, ... right_operands )
uint32 bit_or( uint32 left_operand, ... right_operands )
uint32 bit_xor( uint32 left_operand, ... right_operands )
uint32 bit_not( uint32 operand_to_negate )
uint32 bit_shiftleft( uint32 operand_to_shift, uint8 shift_count)
uint32 bit_shiftright( uint32 operand_to_shift, uint8 shift_count)

Misc

return type method proto
table GetRegistry( string table_name )
uint32 GetGameTime()
Player GetPlayer( string player_character_name )
string GetEngineName()
uint32 GetEngineVersion()
void SetConsoleColor( uint32 color_number )
void SendWorldMessage( string message_to_send, uint32 message_type )
table<Player> GetPlayersInWorld()
table<Player> GetPlayersInMap( uint32 map_id )
table<Player> GetPlayersInZone( uint32 zone_id)
string GetPlatform()
void SendPacketToZone( WorldPacket packet_to_send, uint32 zone_id )
void SendPacketToInstance( WorldPacket packet_to_send, uint32 map_id )
void SendPacketToWorld( WorldPacket packet_to_send )
bool include( string script_filename, bool once )

Global Objects

Some classes in core are singletons. Meaning that there can only be one instance of that class. Such classes are pushed to Lua as global objects. They may or may not have static methods so always look out for static method tables.

dbcSpell

return type method proto
SpellEntry LookupEntryForced( uint32 spell_entry )
uint32 GetNumRows()

WorldDB and CharacterDB

return type method proto
QueryResult Query( string sql_statement )
void Execute( string sql_statement )

MapMgr

return type method proto
uint32 GetMapID()
Object GetObject( GUID object_guid )
GameObject GetGameObject( uint32 gameobject_low_guid )
Creature GetCreature( uint32 creature_low_guid )
Player GetPlayer( uint32 player_low_guid )
MapInfo GetMapInfo()
uint32 GetInstanceID()
MapScriptInterface GetInterface()
bool HasPlayers()
uint32 GetPlayerCount()
void SetWorldState( uint32 zone_id, uint32 index, uint32 value )
Creature GetSqlIdCreature( uint32 creature_sqlid )
GameObject GetSqlIdGameObject( uint32 go_sqlid )
DynamicObject CreateDynamicObject()
DynamicObject GetDynamicObject( uint32] dygo_low_guid )
LCF Creature SpawnCreature( uint32 creature_entry, float x, float y, float z, float o, uint32 phase )
LCF GameObject SpawnGameObject( uint32 gameobject_entry, float x, float y, float z, float o, uint32 phase )

MapScriptInterface

A class that handles retrieval/spawning of any objects on the map.

return type method proto
GameObject GetGameObjectNearestCoords( float x, float y, float z, uint32 gameobject_entry )
Creature GetCreatureNearestCoords( float x, float y, float z, uint32 creature_entry )
Player GetPlayerNearestCoords( float x, float y, float z, uint32 player_entry = 0 )

MapInfo

A structure that contains information describing a map

property type property name
uint32 mapid
uint32 screenid
uint32 type
uint32 playerlimit
uint32 minlevel
uint32 minlevel_heroic
float repopx
float repopy
float repopz
string name
uint32 flags
uint32 cooldown
uint32 required_quest
uint32 required_item
uint32 heroic_key_1
uint32 heroic_key_2
return type method proto
bool HasFlag( uint32 flag_to_check )

sChatHandler

return type method proto
WorldPacket FillMessageData( uint32 chat_type, uint32 language_type, string message, GUID speaker, uint32 flag )
WorldPacket FillSystemMessageData( string message )

Item

return type method proto

ItemPrototype

property type property name

Taxi Methods

:GetTaxiNode(GetTaxiNode)
:GetTaxiPath(uint32)
:GetTaxiPathFT(uint32,uint32)
:GetNearestTaxiNode(GetNearestTaxiNode)
:GetID(GetID)
:AddPathNode(AddPathNode)
:GetNodeCount(GetNodeCount)
:GetPrice(GetPrice)

Packet Methods

These are invoked on LuaPacket objects. :opcode()
:clear()
:WriteInt8()
:WriteUInt8()
:WriteInt16()
:WriteUInt16()
:WriteInt32()
:WriteUInt32()
:WriteWoWGuid()
:size()

Spell Methods

:gettype()
:getstate()
:cancel()
:cast()
:finish()
:getproto()
:isaspect()
:isseal()
:createprotooverride()
:getduration()
:getradius()
:isstealthspell()
:isinvisibilityspell()

Personal tools