Code:
local CarlosAEntryID = 90004
local InvisAEntryID = 90005
local OBJECT_END = 0x0006
local GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B
function CLO(pUnit, event)
CarlosA = pUnit
end
function INS(pUnit, event)
InvisA = pUnit
end
RegisterUnitEvent(CarlosAEntryID, 18, "CLO")
RegisterUnitEvent(InvisAEntryID, 18, "INS")
function OnQuestAccept(event, pPlayer, questId, pQuestGiver)
if (questId == 30001) then
InvisA:RegisterEvent("Carlosintro1", 1000, 1)
player:GossipComplete(player)
end
if (intid == 2) then
player:GossipComplete(player)
end
end
RegisterServerHook(14, "OnQuestAccept")
function Carlosintro1(pUnit, event)
local pla = pUnit:GetClosestPlayer()
if pla then
pla:PlayerSendChatMessage(14, 0, "What the f-")
InvisA:SpawnCreature(CarlosAEntryID, 2389.646484, 337.430756, 40.015667, 2.213526, 2, 0)
InvisA:RegisterEvent("Carlosintro2", 2000, 1)
end
end
function Carlosintro2(pUnit, event)
CarlosA:SetMovementFlags(1)
CarlosA:CastSpell(38920)
local gate = InvisA:GetGameObjectNearestCoords(2387.647705, 341.822815, 39.734871, 176594)
if gate then
gate:SetByte(GAMEOBJECT_BYTES_1,0,0) -- open door
CarlosA:MoveTo(2381.572021, 346.992462, 38.104420, 2.264576)
InvisA:RegisterEvent("Carlosintro3", 4000, 1)
end
end
function Carlosintro3(pUnit, event)
CarlosA:SendChatMessage(12, 0, "Hey Spanks, its me Carlos!")
CarlosA:Emote(5, 4000)
InvisA:RegisterEvent("Carlosintro4", 6000, 1)
end
function Carlosintro4(pUnit, event)
pla:SendChatMessage(12, 0, "Oh for goodness sake...")
end