Credits: nutcase560
Hi guys I saw this on Arcemu forums orginally posted by Hypersniper and thought it'd be very useful for some people. I did not make this nor taking credit for it. Just simply posting it here.
I'll try to keep it updated..."try"...
Welcome to LuaHypArc
"BlackBoy0 tested, HalestormXV approved."
1. What is it?
LuaHypArc is a new Lua scripting engine for ArcEmu. It is based off the strong foundation provided by LUAppArc. It boasts over 50 brand new and unique functions that are usable in your Lua bosses, events, items and game objects. Prepare to extend yourself more than ever before. It contains features for advanced and new scripters alike. Additionally, LuaHypArc contains all of the old LUAppArc functions, as well as broken functions now fixed (Yes, CastSpellOnTarget is here.) Consider it an extension on your old favourite.
2. Features
* Over 50 new and fixed commands, usable in all Lua scripts.
* Easier installation than any other engine currently available.
* An updated and more comprehensive "Defined Variables.lua".
* Access to new features for veteran scripters and new:
* Phasing
* Weather manipulation
* Revamped packets system
* GetDistanceYards
* CastSpellOnTarget
* Comprehensive commands list that explains all added functions.
* Room for future expansion - I'll listen to your suggestions.
* Proper, wholesome updates - no need to "SVN Update" 5 times a day.
3. Download & Setup
Couldn't be easier. (However, before installing I suggest you compile your ArcEmu at least once without the Lua engine.)
* 1. Head to the simple, HTTP download link listed below.
* 2. Extract it to your server's \trunk\ folder.
* 3. Run 'install.bat'.
DOWNLOAD LINKS
[Only registered and activated users can see links. ][Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
The SVN is: [Only registered and activated users can see links. ]
4. Commands
A full command command listing can be found with your download, however it is also available: here.
Please find a brand new Defined Variables.lua here.
In Detail - Command Features
Packet System - New Advanced System
The packet system has been completely revamped. The previous packet functions were completely useless, so developers should be very excited with the following changes.
Packet Buffers: You are given 17 packet buffers (0-16) that can all hold different data. You should INITIALISE packets using Unit:InitPacket(buffer_index,packet_type). This sets up the packet on the specified buffer. Once that's done, you can add data to it using Unit:AddDataToPacket(buffer_index,data_type,data). Once you've added your data, you can send your packet using one of the sending commands provided. Once a packet is sent, the buffer is cleared and can be used again.
Phasing Commands
Yep, you can now phase game objects and players using Lua at your will. Phases use a "bitmask system". This means that each phase is labelled by a power of 2. This means that each phase is: 1 (2^0), 2 (2^1), 4(2^2), 8(2^3) and so on. If you set an object to be of phase value 3, this means it is a member of both phases 1 and 2 (1+2=3). Phase 1 is the default phase.
5. Things to get you excited
Unit:SetZoneWeather(zone_id,type,density) - Sets the weather of zone_id to type, and density (0.3-2.0).
Plyr:SetPlayerWeather(type,density) - Same as above, but only Plyr sees the weather change!
Plyr:PlayerSendChatMessage(type,lang,msg) - Just like the normal SendChatMessage, but this one forces a player to say something.
Unit:GetDistanceYards(target) - Returns the distance in Yards.
Plyr:PlaySoundToPlayer(sound_id) - Just like PlaySoundToSet but only plays the sound to Plyr.
Unit:CastSpellOnTarget(spell_id,target) - Enough said.
Unit:VendorAddItem(item_id,amount,extcost) - Adds amount items with entry item_id and extended cost extcost to Unit.
6. Examples
I recommend you use this script with an NPC with display id same as [Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]Code:--[[ __ __ __ ______ /\ \ /\ \/\ \ /\ _ \ \ \ \ __ __ __ \ \ \_\ \ __ __ _____\ \ \_\ \ _____ ___ \ \ \ __/\ \/\ \ /'__`\ \ \ _ \/\ \/\ \/\ '__`\ \ __ \/\`'__\/'___\ \ \ \_\ \ \ \_\ \/\ \_\.\_\ \ \ \ \ \ \_\ \ \ \_\ \ \ \/\ \ \ \//\ \__/ \ \____/\ \____/\ \__/ \_\\ \_\ \_\/`____ \ \ __/\ \_\ \_\ \_\\ \____\ \/___/ \/___/ \/__/\/_/ \/_/\/_/`/___// \ \ \/ \/_/\/_/\/_/ \/____/ /\___/\ \_\ \/__/ \/_/ .zapto.org Example 1: Statue activation Utilises "GetInventoryItemById", "GetDistanceYards" ]]-- EMOTE_STATE_SUBMERGED = 429 local PLAYER_ITEM local INCARCERA local REACTED = {} local NPC_ENTRY = 74000 local ITEM_ENTRY = 74000 function Incarcera_onload(pUnit) INCARCERA = pUnit pUnit:SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) pUnit:SetCombatCapable(1) pUnit:SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED) pUnit:RegisterEvent("Incarcera_SearchPlayers", 1000, 0) pUnit:RegisterEvent("Incarcera_ClearReacted", 1000, 0) end function Incarcera_SearchPlayers(pUnit) for k,v in pairs(pUnit:GetInRangePlayers()) do if (v:GetItemCount(ITEM_ENTRY) > 0 and REACTED[v] ~= true and pUnit:GetDistanceYards(v) < 30) then PLAYER_ITEM = v:GetInventoryItemById(ITEM_ENTRY) PLAYER_ITEM:GossipCreateMenu(ITEM_ENTRY, v, 0) PLAYER_ITEM:GossipMenuAddItem(9, "Activate Uther's Light", 0, 0) PLAYER_ITEM:GossipMenuAddItem(9, "Ignore the statue...", 1, 0) PLAYER_ITEM:GossipSendMenu(v) REACTED[v] = true end end end function Incarcera_ClearReacted(pUnit) for k,v in pairs(REACTED) do if (v ~= nil and k ~= nil) then if (pUnit:GetDistanceYards(k) > 30) then REACTED[k] = false k:GossipComplete() end end end end function Incarcera_ItemOnGossipSelect(item, event, player, id, intid, code) if (intid == 1) then player:GossipComplete() elseif (intid == 0) then if (INCARCERA:GetUInt64Value(UNIT_FIELD_FLAGS) == UNIT_FLAG_NOT_SELECTABLE) then player:GossipComplete() INCARCERA:RemoveEvents() INCARCERA:SendChatMessage(42, 0, "The statue reacts to the revealing light...") INCARCERA:CastSpell(46821) --light visual INCARCERA:RegisterEvent("Incarcera_BattleBegin", 5000, 1) else player:GossipComplete() end end end function Incarcera_BattleBegin(pUnit) pUnit:SetUInt64Value(UNIT_FIELD_FLAGS, 0) pUnit:SetCombatCapable(0) pUnit:RemoveAllAuras() pUnit:CastSpell(61463) --shadowfury pUnit:SendChatMessage(14, 0, "I will not fail the dark master!") --Register any boss phases here. end function Incarcera_OnLeaveCombat(pUnit) pUnit:RemoveEvents() REACTED = {} Incarcera_onload(pUnit) --Calling onload function. Just like copying and pasting it's contents to here. end function Incarcera_OnDeath(pUnit) pUnit:RemoveEvents() REACTED = {} end --Registering events if (GetLuaEngine() ~= "LuaHypArc") then --we gotta make sure they're using LuaHypArc! print("LuaEngine: Did not load 'Incarcera - Statue Activation' script - LuaHypArc not installed.") print("LuaEngine: Please visit http://luahyparc.zapto.org/ for more information.") else RegisterUnitEvent(NPC_ENTRY, 18, "Incarcera_onload") RegisterUnitEvent(NPC_ENTRY, 4, "Incarcera_OnDeath") RegisterUnitEvent(NPC_ENTRY, 2, "Incarcera_OnLeaveCombat") RegisterItemGossipEvent(ITEM_ENTRY, 2, "Incarcera_ItemOnGossipSelect") end
7. Final wordsCode:--[[ __ __ __ ______ /\ \ /\ \/\ \ /\ _ \ \ \ \ __ __ __ \ \ \_\ \ __ __ _____\ \ \_\ \ _____ ___ \ \ \ __/\ \/\ \ /'__`\ \ \ _ \/\ \/\ \/\ '__`\ \ __ \/\`'__\/'___\ \ \ \_\ \ \ \_\ \/\ \_\.\_\ \ \ \ \ \ \_\ \ \ \_\ \ \ \/\ \ \ \//\ \__/ \ \____/\ \____/\ \__/ \_\\ \_\ \_\/`____ \ \ __/\ \_\ \_\ \_\\ \____\ \/___/ \/___/ \/__/\/_/ \/_/\/_/`/___// \ \ \/ \/_/\/_/\/_/ \/____/ /\___/\ \_\ \/__/ \/_/ .zapto.org Example 2: Personal weather effects Utilises "SetPlayerWeather" ]]-- local ITEMID = 75000 function Snowglobe_OnGossipTalk(pUnit, event, player) player:SetPlayerWeather(8, 1.5) --snow, 70% intensity end --Registering events if (GetLuaEngine() ~= "LuaHypArc") then --we gotta make sure they're using LuaHypArc! print("LuaEngine: Did not load 'Titan's Snowglobe - Personal Weather' script - LuaHypArc not installed.") print("LuaEngine: Please visit http://luahyparc.zapto.org/ for more information.") else RegisterItemGossipEvent(ITEMID, 1, "Snowglobe_OnGossipTalk") end
This has been a completely solo project except for the suggestions and testing by BlackBoy0. Thank you very much, man.
In the future Halestorm's custom functions will also be published to the public through LuaHypArc.



LinkBack URL
About LinkBacks



Reply With Quote



Bookmarks