Lua within WoW Emulation menu

User Tag List

Results 1 to 7 of 7
  1. #1
    SpellEffects's Avatar Sergeant
    Reputation
    64
    Join Date
    Apr 2011
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua within WoW Emulation

    Introduction
    A whole lot has changed since the beginning of the LuaHypArc "era".

    Today ArcEmu no longer uses LuaHypArc, they now use LuaBridge instead which has been implemented by Paroxysm.

    There are some changes you should know about as a scripter.

    LuaBridge now easily allows developers to easily bind classes, which makes it easy to use C++ methods from Lua with a single line of code.

    The syntax has changed
    The syntax has changed slightly.

    While an old function would look like this:

    pCreature:RegisterAIUpdateEvent(1000)

    It would today look like this:

    pCreature:GetScript():RegisterAIUpdateEvent(1000)

    Whereas pCreature stands for pointerCreature, GetScript() is the class and RegisterAIUpdateEvent is the method and within the method parenthesis is the arguments.

    Pointer:Class():Method(args)

    Things you should know
    • LuaBridge will only function on Windows 2008 Server / Vista or newer.
    • Any Unit method can be invoked on either Unit, GameObject, Creature or Player Object.
    • To avoid any unnecessary errors the following code should put at the top of every script.
      Code:
      if not MapMgr then return end
      -- You can also only run your script on a specific map if you want.
      if not MapMgr:GetMapInfo().mapid == ### then return end
      -- If you do this your script will cease running on the Map unless it matches the chosen Map ID.


    Methods
    Unit Methods
    Code:
    :GetAIInterface()
    :IsPVPFlagged()
    :SetPvPFlag()
    :RemovePvPFlag()
    :IsFFAPvPFlagged()
    :SetFFAPvPFlag()
    :RemoveFFAPvPFlag()
    :IsSanctuaryFlagged()
    :SetSanctuaryFlag()
    :RemoveSanctuaryFlag()
    :setAttackTimer()
    :isAttackReady()
    :getLevel()
    :setLevel()
    :modLevel()
    :getClassMask()
    :getRaceMask()
    :getStandState()
    :addStateFlag()
    :hasStateFlag()
    :clearStateFlag()
    :GetAP()
    :GetRAP()
    :CastSpell(Unit*,uint32,bool)
    :CastSpellAoF()
    :IsCasting()
    :IsInInstance()
    :Demorph()
    :IsDazed()
    :GetStealthLevel()
    :GetStealthDetectBonus()
    :IsStealthed()
    :SetInvisibility()
    :IsInvisible()
    :HasAura()
    :GetAuraStackCount()
    :HasAuraWithMechanic()
    :RemoveAura(uint32)
    :RemoveAllAuras()
    :isAlive()
    :IsDead()
    :RemoveNegativeAuras()
    :RemoveAllNonPersistentAuras()
    :setAItoUse()
    :GetThreatModifyer()
    :ModThreatModifyer()
    :GetGeneratedThreatModifyer()
    :ModGeneratedThreatModifyer()
    :IsPacified()
    :IsStunned()
    :IsFeared()
    :Heal()
    :Energize()
    :setEmoteState()
    :GetOldEmote()
    :GetFaction()
    :GetHealthPct()
    :SetFaction()
    :SendChatMessage()
    :SendChatMessageToPlayer()
    :SendChatMessageAlternateEntry()
    :SetHealthPct()
    :GetManaPct()
    :GetCurrentSpell()
    :SetCurrentSpell()
    :RemoveStealth()
    :RemoveInvisibility()
    :create_guardian()
    :DisableAI()
    :EnableAI()
    :IsSpiritHealer()
    :Phase()
    :SetFacing()
    :SetMinDamage()
    :GetMinDamage()
    :SetMaxDamage()
    :GetMaxDamage()
    :SetMinOffhandDamage()
    :GetMinOffhandDamage()
    :SetMaxOffhandDamage()
    :GetMaxOffhandDamage()
    :SetMaxRangedDamage()
    :GetMaxRangedDamage()
    :SetMount()
    :GetMount()
    :SetCreatedBySpell()
    :GetCreatedBySpell()
    :SetStat()
    :GetStat()
    :SetResistance()
    :GetResistance()
    :SetBaseMana()
    :SetBaseHealth()
    :SetAttackPower()
    :GetAttackPower()
    :GetRangedAttackPower()
    :SetRangedAttackPower()
    :getRace()
    :setRace()
    :getClass()
    :setClass()
    :getGender()
    :setGender()
    :SetPowerType()
    :GetPowerType()
    :SetHealth()
    :GetHealth()
    :SetMaxHealth()
    :GetMaxHealth()
    :ModHealth()
    :ModMaxHealth()
    :SetPower()
    :ModPower()
    :GetPower()
    :SetMaxPower()
    :GetMaxPower()
    :SetDisplayId()
    :GetDisplayId()
    :GetNativeDisplayId()
    :SetNativeDisplayId()
    Creature Methods
    Code:
    :IsVehicle()
    :RemoveFromWorld(bool)
    :HasItems()
    :GetProto()
    :GetItemIdBySlot()
    :GetItemAmountBySlot()
    :GetSlotByItemId()
    :GetItemAmountByItemId()
    :HasQuests()
    :HasQuest()
    :AddQuest()
    :DeleteQuest()
    :FindQuest()
    :GetQuestRelation()
    :NumOfQuests()
    :isVendor()
    :isTrainer()
    :isClass()
    :isProf()
    :isQuestGiver()
    :isGossip()
    :isTaxi()
    :isCharterGiver()
    :isGuildBank()
    :isBattleMaster()
    :isBanker()
    :isInnkeeper()
    :isSpiritHealer()
    :isTabardDesigner()
    :isAuctioner()
    :isStableMaster()
    :isArmorer()
    :CanSee()
    :GetSQL_id()
    :GetTotemSlot()
    :GetGroup()
    :IsPickPocketed()
    :GetCreatureInfo()
    :SetCreatureProto()
    :IsTotem()
    :IsExotic()
    :GetScript()
    :IsCritter()
    :IsTrainingDummy()
    :Despawn()
    :RegisterEvent()
    :RemoveEvents()
    :GetRandomEnemy()
    :GetRandomFriend()
    :GetRandomPlayer()
    :GetClosestFriend()
    :GetClosestEnemy()
    :GetClosestPlayer()
    Creature AI Interface
    Code:
    :GetPetOwner()
    :SetPetOwner()
    :SetUnitToFollow(Unit*)
    :getUnitToFollow()
    :SetFollowDistance()
    :SetUnitToFollowAngle()
    :getUnitToFear()
    :SetUnitToFear(Unit*)
    :getSoullinkedWith()
    :GetIsSoulLinked()
    :SetSoulLinkedWith()
    :getAIState()
    :SetAIState()
    :addSpellToList()
    :SetNextSpell()
    :MoveTo()
    :StopMovement()
    :hasWaypoints()
    :getNextTarget()
    :setNextTarget(Unit*)
    :AttackReaction()
    :HealReaction()
    :ClearHateList()
    :WipeHateList()
    :WipeTargetList()
    :RemoveThreatByPtr()
    :modThreatByPtr()
    :getThreatByPtr()
    :GetMostHated()
    :GetSecondHated()
    :taunt()
    :getTauntedBy()
    :GetIsTaunted()
    :getSoullinkedWith()
    :SetSoulLinkedWith()
    :GetIsSoulLinked()
    :getOutOfCombatRange()
    :setOutOfCombatRange()
    :MoveTo()
    :getCurrentWaypoint()
    :changeWayPointID()
    :getWayPoint()
    :deleteWayPoint()
    :deleteWaypoints()
    :setMoveType()
    :getMoveType()
    :setMoveRunFlag()
    :getMoveRunFlag()
    :setWaypointToMove()
    :IsFlying()
    :getCurrentAgent()
    :setCurrentAgent()
    :SetAllowedToEnterCombat()
    :GetAllowedToEnterCombat()
    :GetAITargetsCount()
    Creature Script
    Code:
    :RegisterAIUpdateEvent()
    :ModifyAIUpdateEvent()
    :RemoveAIUpdateEvent()
    GameObject Methods
    Code:
    :GetGUID() - returns the object's GUID.
    :GetHighGUID() - returns the object's HighGUID.
    :GetLowGUID() - returns the object's LowGUID.
    :GetNewGUID() - returns the object's NewGUID.
    :GetEntry() - returns the object's Entry.
    :GetScale() - returns the object's Scale.
    :SetScale()
    :GetTypeFromGUID() 
    :GetEntryFromGUID()
    :GetTypeID() - returns the object's Type ID.
    :IsUnit()
    :IsGameObject()
    :IsPlayer()
    :IsItem()
    :IsCreature()
    :IsPet()
    :SetPosition(Object)
    :GetPositionX() - returns the object's X.
    :GetPositionY() - returns the object's Y.
    :GetPositionZ() - returns the object's Z.
    :GetOrientation() - returns the object's Orientation.
    :GetO() - returns the object's O.
    :GetSpawnX() - returns the object's SpawnX.
    :GetSpawnY() - returns the object's SpawnY.
    :GetSpawnZ() - returns the object's SpawnZ.
    :CalcDistance2Object(Object)
    :CalcDistance2Location(Object)
    :CalcDistanceBtwnObjects(Object*,Object*)
    :CalcDistanceObject2Location(Object*,float,float,float)
    :CalcDistanceLocation2Location(float,float,float,float,float,float)
    :GetMapID() - returns the object's MapID.
    :GetZoneID() - returns the object's ZoneID.
    :SetZoneID()
    :SetMapID()
    :GetUInt32Value()
    :GetUInt64Value() 
    :SetUInt32Value()
    :SetUInt64Value()
    :GetFloatValue() 
    :ModFloatValue()
    :ModFloatValueByPCT()
    :ModSignedUInt32Value()
    :ModUnsignedUInt32Value()
    :GetByte()
    :SetByte()
    :SetByteFlag()
    :RemoveByteFlag()
    :HasByteFlag()
    :EventSetUInt32Value()
    :SetFloatValue()
    :SetFlag()
    :HasFlag()
    :IsInRange()
    :IsInFront()
    :IsBehind()
    :IsInArc()
    :calcAngle()
    :calcRadAngle()
    :getEasyAngle()
    :GetDistance2Object(Object*)
    :GetDistance(float,float,float)
    :GetCurrentSpell()
    :SetCurrentSpell()
    Dynamic Object Methods
    Code:
    :Create()
    :Remove()

    Player Methods
    Code:
    :Gossip_Complete()
    :Gossip_SendPOI()
    :AdvanceSkillLine()
    :AddSkillLine()
    :GetSkillLineMax()
    :GetSkillLineCurrent()
    :RemoveSkillLine()
    :UpdateMaxSkillLineCounts()
    :ModifySkillBonus()
    :ModifySkillBonusByType()
    :HasSkillLine()
    :RemoveSpellsFromLine()
    :RemoveAllSkills()
    :RemoveLanguages()
    :AddLanguages()
    :AdvanceAllSkills()
    :ModifySkillMaximum()
    :LearnSkillSpells()
    :Cooldown_AddStart()
    :Cooldown_Add()
    :Cooldown_AddItem()
    :Cooldown_CanCast(SpellEntry*)
    :SendPacket()
    :SendMessageToSet()
    :GetTaxiPath()
    :GetTaxiState()
    :TaxiStart()
    :SetTaxiPath()
    :SetTaxiPos()
    :SetTaxiState()
    :HasQuests()
    :GetOpenQuestSlot()
    :GetQuestLogForEntry()
    :GetQuestLogInSlot()
    :GetQuestSharer()
    :SetQuestSharer()
    :SetQuestLogSlot()
    :HasFinishedDaily()
    :AddToFinishedQuests()
    :HasFinishedQuest()
    :GetQuestRewardStatus()
    :HasQuestForItem()
    :HasQuestSpell()
    :RemoveQuestSpell()
    :HasQuest()
    :RemoveQuestMob()
    :GetTeam()
    :GetTeamInitial()
    :SetTeam()
    :ResetTeam()
    :IsTeamHorde()
    :IsTeamAlliance()
    :IsInFeralForm()
    :GetMaxLevel()
    :GetSelection()
    :GetTarget()
    :SetSelection()
    :SetTarget()
    :HasSpell()
    :HasSpell()
    :LearnSpell()
    :UnlearnSpell()
    :AddShapeShiftSpell()
    :RemoveShapeShiftSpell()
    :ModStanding()
    :GetStanding()
    :GetBaseStanding()
    :SetStanding()
    :SetAtWar()
    :GetStandingRank()
    :GetReputationRankFromStanding()
    :SetFactionInactive()
    :GetExaltedCount()
    :GetPVPRank()
    :SetPVPRank()
    :GetMaxPersonalRating()
    :HasTitle()
    :SetKnownTitle()
    :InGroup()
    :IsGroupLeader()
    :HasBeenInvited()
    :SetInviter()
    :GetInviter()
    :GetGroup()
    :GetSubGroup()
    :IsGroupMember()
    :IsBanned()
    :SetBanned()
    :SetBannedWithReason(string)
    :UnSetBanned()
    :GetBanReason()
    :IsInGuild()
    :GetGuildID()
    :SetGuildID()
    :GetGuildRank()
    :SetGuildRank()
    :GetGuildInvitersGuid()
    :SetGuildInvitersGuid()
    :UnSetGuildInvitersGuid()
    :RequestDuel()
    :EndDuel()
    :DuelCountdown()
    :SetDuelStatus()
    :GetDuelStatus()
    :SetDuelState()
    :GetDuelState()
    :GetDuelTeam()
    :SetDuelTeam()
    :SetBindPoint()
    :KillPlayer()
    :ResurrectPlayer()
    :GetShapeShift()
    :SetShapeShift()
    :CanSee()
    :IsVisible()
    :Reset_Spells()
    :Reset_Talents()
    :GetSelectedGo()
    :IsMounted()
    :Dismount()
    :Kick()
    :SoftDisconnect()
    :GetSummonedObject()
    :SetSummonedObject()
    :ClearCooldownsOnLine()
    :ResetAllCooldowns()
    :ClearCooldownForSpell()
    :Phase()
    :ExitInstance()
    :GetAreaID()
    :SetAreaID()
    :EventTeleport()
    :EventTeleportTaxi()
    :SafeTeleport(uint32,uint32,float,float,float,float)
    :GetDungeonDifficulty()
    :GetRaidDifficulty()
    :GetGold()
    :ModGold()
    :HasGold()
    :SetGold()
    :GiveGold()
    :TakeGold()
    :SetFarsightTarget()
    :GetFarsightTarget()
    :SetXp()
    :GetXp()
    :SetNextLevelXp()
    :SetTalentPoints()
    :ModTalentPoints()
    :GetTalentPoints()
    :SetHonorCurrency()
    :GetHonorCurrency()
    :ModHonorCurrency()
    :GetArenaCurrency()
    :SetArenaCurrency()
    :ModArenaCurrency()
    :SetGlyph()
    :GetGlyph()
    :ResetPvPTimer()
    :StopPvPTimer()
    :PvPToggle()
    :LearnTalent()
    :AddComboPoints()
    :GetTradeTarget()
    :Possess()
    :UnPossess()
    :IsAttacking()
    :PlaySound()
    :GetItemInterface()
    :Resurrect()
    :ResurrectPlayer()
    :GetName()

    Global Methods
    Code:
    LuaPacket(opcode, size)- Creates a LuaPacket object so that you can use Packet Methods on it.
    CreateLuaEvent()
    ModifyLuaEventInterval()
    ModifyLuaEventTimer()
    DestroyLuaEvent()
    getregistry()
    TO_PLAYER()
    TO_CREATURE()
    TO_ITEM()
    TO_UNIT()
    TO_GAMEOBJECT()
    GetGameTime()
    GetPlayer()
    GetEngineName()
    GetEngineVersion()
    logcolor()
    WorldDBQuery()
    CharDBQuery()
    SendWorldMessage()
    ReloadTable()
    ReloadLuaEngine()
    GetPlayersInWorld()
    Rehash()
    GetArcemuRevision()
    GetPlayersInMap()
    GetPlayersInZone()
    bit_and()
    bit_or()
    bit_xor()
    bit_not()
    bit_shiftleft()
    bit_shiftright()
    GetPlatform()
    SendPacketToZone()
    SendPacketToInstance()
    SendPacketToWorld()
    SendPacketToChannel()
    GetInstanceCreature()
    GetInstancePlayerCount()
    GetPlayersInInstance()
    DBC Spell
    This is executed on dbcSpell. This is a global variable.
    Code:
    :LookupEntry()
    :GetNumRows()
    :LookupEntryForced()
    SQL Query
    These are executed on WorldDB or CharacterDB. Both of these are global variables.
    Code:
    :Query()
    :Execute()
    Map Methods
    Code:
    :GetMapID()
    :GetObject()
    :CreateGameObject()
    :CreateAndSpawnGameObject()
    :GetGameObject()
    :GetCreature()
    :GetMapInfo()
    :CreateCreature()
    :CreateDynamicObject()
    :GetDynamicObject()
    :GetPlayer()
    :GetInstanceID()
    :GetInterface()
    :HasPlayers()
    :GetPlayerCount()
    :GetSqlIdCreature()
    :GetSqlIdGameObject()
    Map Script Interface
    Code:
    :GetGameObjectNearestCoords(GetGameObjectNearestCoords)
    :GetCreatureNearestCoords(GetCreatureNearestCoords)
    :GetPlayerNearestCoords(GetPlayerNearestCoords)
    :SpawnCreature(uint32,float,float,float,float,bool,bool,uint32,uint32,uint32)
    :SpawnGameObject(uint32,float,float,float,float,bool,uint32,uint32,uint32)
    Taxi Methods

    Code:
    :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. pcode()
    Code:
    :clear()
    :WriteInt8()
    :WriteUInt8()
    :WriteInt16()
    :WriteUInt16()
    :WriteInt32()
    :WriteUInt32()
    :WriteWoWGuid()
    :size()
    Spell Methods

    Code:
    :gettype()
    :getstate()
    :cancel()
    :cast()
    :finish()
    :getproto()
    :isaspect()
    :isseal()
    :createprotooverride()
    :getduration()
    :getradius()
    :isstealthspell()
    :isinvisibilityspell()
    Will update this thread later with more a concrete tutorial on the new engine.
    uint32 = -1;
    I guess some people just find it hard to input their question into a field and press enter.

    Check out my blog here on the forums

    Lua within WoW Emulation
  2. #2
    flamesdeath's Avatar Sergeant
    Reputation
    11
    Join Date
    Jan 2011
    Posts
    40
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is this for patch 4.1 or have emu servers changed to a better software for 4.0.6?

  3. #3
    SpellEffects's Avatar Sergeant
    Reputation
    64
    Join Date
    Apr 2011
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flamesdeath View Post
    is this for patch 4.1 or have emu servers changed to a better software for 4.0.6?
    ArcEmu is for 3.3.5.

    So it's for 3.3.5 unless you have a working patch to update to either 4.0.6 or 4.1.

    Which I doubt you do.
    uint32 = -1;
    I guess some people just find it hard to input their question into a field and press enter.

    Check out my blog here on the forums

  4. #4
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hot damn it's about time we see this on here. Would love to +Rep but I need to spread. Good work!

  5. #5
    Facerolling's Avatar Contributor
    Reputation
    116
    Join Date
    Mar 2007
    Posts
    307
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LuaBridge Information - ArcEmu-wiki
    LuaBridge Methods - ArcEmu-wiki

    It's good to cite sources Other than that, thanks for bringing this to MMOwned.
    hey ervyone whats up gamboys

  6. #6
    SpellEffects's Avatar Sergeant
    Reputation
    64
    Join Date
    Apr 2011
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Facerolling View Post
    LuaBridge Information - ArcEmu-wiki
    LuaBridge Methods - ArcEmu-wiki

    It's good to cite sources Other than that, thanks for bringing this to MMOwned.
    I think we both know that some people are too lazy to checkout the wiki.
    uint32 = -1;
    I guess some people just find it hard to input their question into a field and press enter.

    Check out my blog here on the forums

  7. #7
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    When you use lots from a singular resource you should credit it - people put time into creating the original source...

Similar Threads

  1. [Question] Good page/tutorial for learning LUA for WOW emulation?
    By DeadlyMaker in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 12-24-2016, 11:03 AM
  2. WoW Emulation Thread proposal
    By ZLau in forum World of Warcraft General
    Replies: 0
    Last Post: 10-01-2007, 09:57 PM
  3. Wow emulated sever with the real thing.
    By sa8 in forum World of Warcraft Emulator Servers
    Replies: 22
    Last Post: 09-21-2007, 04:49 PM
  4. WoW Emulator Servers
    By Dag001 in forum Suggestions
    Replies: 8
    Last Post: 06-11-2007, 03:02 PM
  5. why cant you post in the wow emulation?
    By ShortButStrong in forum World of Warcraft General
    Replies: 0
    Last Post: 12-02-2006, 03:12 AM
All times are GMT -5. The time now is 04:09 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search