Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------
- --[[
- This script was made by Stoneharry of www.MMOwned.com
- This script may be edited and changed at will, but full credits must be provided.
- Please respect the original author, thank you.
- ]]
- -- Variable declaration and generally setting up the script
- --?!MAP= 631
- local TirionNPCID = 38995
- local LichKingNPCID = 36597
- -- For 3.3.5a
- local OBJECT_END = 0x0006
- local UNIT_NPC_FLAGS = OBJECT_END + 0x004C
- local UNIT_FIELD_FLAGS = OBJECT_END + 0x0035
- local UNIT_FIELD_BYTES_1 = OBJECT_END + 0x0044
- local UNIT_FLAG_NOT_SELECTABLE = 0x02000000
- -- Unconfigurable Variables
- --[[local Lich = nil -- Global variables are automatically local to the script now
- local Tirion = nil]]
- local Ready = false
- ------------------------------------------------------------------
- -- The gossip used to start the encounter - Tirion ---------------
- -- Also set up events etc ----------------------------------------
- ------------------------------------------------------------------
- function Tirion_OnGossipTalk(pUnit, event, player)
- local menu = GossipMenu(pUnit, 2975252, 1)
- menu:AddItem(9, "We are prepared, Highlord. Let us battle for the fate of Azeroth! For the light of dawn!", 1, false)
- menu:AddItem(0, "We are not yet prepared, Highlord.", 2, false)
- menu:Send(player)
- end
- function Tirion_OnGossipSelect(pUnit, Event, player, id, intid, code, pMisc)
- if (id == 1) then
- Tirion = TO_CREATURE(pUnit)
- Ready = true
- Tirion:SetUInt32Value(UNIT_NPC_FLAGS, 2) -- Quest flags disable gossip
- -- Gossip complete
- elseif (id == 2) then
- pUnit:SetUInt32Value(UNIT_NPC_FLAGS, 2) -- Quest flags disable gossip
- -- Gossip complete
- end
- end
- RegisterUnitGossipEvent(TirionNPCID, 1, Tirion_OnGossipTalk)
- RegisterUnitGossipEvent(TirionNPCID, 2, Tirion_OnGossipSelect)
- function Tirion_OnSpawnHandleStart(pUnit, Event)
- TO_CREATURE(pUnit):RegisterEvent("CheckForStart_Tirion", 2500, 0)
- end
- RegisterUnitEvent(TirionNPCID, 18, Tirion_OnSpawnHandleStart)
- function LichKing_OnSpawnHandleDefineAndBytes(pUnit, Event)
- TO_CREATURE(pUnit):RegisterEvent("SetBytesAndHandleVariable_LichKing", 2000, 1)
- end
- function SetBytesAndHandleVariable_LichKing(pUnit)
- Lich = TO_CREATURE(pUnit)
- Lich:SetUInt32Value(UNIT_FIELD_BYTES_1, 1) -- Sit on the throne
- end
- RegisterUnitEvent(LichKingNPCID, 18, "LichKing_OnSpawnHandleDefineAndBytes")
- ------------------------------------------------------------------
- -- Mini-cinematic at the start -----------------------------------
- ------------------------------------------------------------------
- function CheckForStart_Tirion(pUnit)
- if (Ready and Lich ~= nil) then
- Tirion:RemoveEvents()
- Ready = false
- print("Worked thus far")
- end
- end
- ------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment