Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MirrorSpawnImage165(creature, Event)
- creature:RegisterEvent("Wait_A_Second_Then_Update_Mirrorimage", 1000, 1)
- end
- function Wait_A_Second_Then_Update_Mirrorimage(creature)
- local plr = creature:GetClosestPlayer()
- if not plr then
- creature:SendChatMessage(12,0,"Player not found!")
- return
- end
- local model = plr:GetDisplay()
- creature:SendChatMessage(12,0,"My model = "..tostring(model))
- creature:SetModel(plr:GetDisplay())
- local p = LuaPacket:CreatePacket(1026, 68)
- model = creature:GetGUID()
- creature:SendChatMessage(12,0,"My GUID = "..tostring(model))
- p:WriteGUID(creature:GetGUID())
- p:WriteULong(plr:GetDisplay()) -- race display
- model = plr:GetPlayerRace()
- creature:SendChatMessage(12,0,"My race = "..tostring(model))
- model = plr:GetGender()
- creature:SendChatMessage(12,0,"My gender = "..tostring(model))
- model = PlayerClassToInt[plr:GetPlayerClass()]
- creature:SendChatMessage(12,0,"My class = "..tostring(model))
- model = tostring(plr:GetByteValue(153, 0)).." | "..tostring(plr:GetByteValue(153, 0)).." | "..tostring(plr:GetByteValue(153, 1)).." | "..tostring(plr:GetByteValue(153, 2)).." | "..tostring(plr:GetByteValue(154, 0))
- creature:SendChatMessage(12,0,"My face data = "..tostring(model))
- p:WriteUByte(plr:GetPlayerRace()) -- race ID
- p:WriteUByte(plr:GetGender()) -- gender
- p:WriteUByte(PlayerClassToInt[plr:GetPlayerClass()]) -- class ID
- p:WriteUByte(plr:GetByteValue(153, 0)) -- skinID
- p:WriteUByte(plr:GetByteValue(153, 1)) -- faceID
- p:WriteUByte(plr:GetByteValue(153, 2)) -- Hair style ID
- p:WriteUByte(plr:GetByteValue(153, 3)) -- Hair colour ID
- p:WriteUByte(plr:GetByteValue(154, 0)) -- facial hair ID
- local guild = plr:GetGuildId()
- if not guild then
- guild = 0
- end
- p:WriteULong(guild) -- guild
- creature:SendChatMessage(12,0,"My guild data = "..tostring(guild))
- local slot_ids = {0, 2, 3, 4, 5, 6, 7, 8, 9, 14, 18}
- local i;
- for i = 0, 10 do
- local item = plr:GetEquippedItemBySlot(slot_ids[i+1])
- if not item then
- p:WriteULong(0)
- creature:SendChatMessage(12,0,"My item data = "..tostring(i).." : 0")
- else
- p:WriteULong(item:GetEntryId())
- creature:SendChatMessage(12,0,"My item data = "..tostring(i).." : "..tostring(item:GetEntryId()))
- end
- --[[ ITEM_SLOT_HEAD = 0,
- ITEM_SLOT_SHOULDER = 1,
- ITEM_SLOT_BODY = 2,
- ITEM_SLOT_CHEST = 3,
- ITEM_SLOT_WAIST = 4,
- ITEM_SLOT_LEGS = 5,
- ITEM_SLOT_FEET = 6,
- ITEM_SLOT_WRITST = 7,
- ITEM_SLOT_HAND = 8,
- ITEM_SlOT_BACK = 9,
- ITEM_SLOT_TABARD = 10,
- ]]
- end
- local item = plr:GetEquippedItemBySlot(15)
- if item then
- creature:SetUInt32Value(0x0006 + 0x0032, item:GetEntryId()) -- main hand
- else
- creature:SetUInt32Value(0x0006 + 0x0032, 0)
- end
- item = plr:GetEquippedItemBySlot(16)
- if item then
- creature:SetUInt32Value(0x0006 + 0x0032 + 0x1, item:GetEntryId()) -- offhand
- else
- creature:SetUInt32Value(0x0006 + 0x0032 + 0x1, 0)
- end
- item = plr:GetEquippedItemBySlot(17)
- if item then
- creature:SetUInt32Value(0x0006 + 0x0032 + 0x2, item:GetEntryId()) -- ranged
- else
- creature:SetUInt32Value(0x0006 + 0x0032 + 0x2, 0)
- end
- creature:SetUInt32Value(0x0006 + 0x0074, 1) -- bytes2 1
- for _,v in pairs(creature:GetInRangePlayers()) do
- creature:SendPacketToPlayer(p)
- end
- creature:SetUInt32Value(60, bit_or(creature:GetUInt32Value(60), 16))
- creature:SendChatMessage(12,0,"I am now a mirror image of "..plr:GetName().."!")
- end
- RegisterUnitEvent(165, 18, "MirrorSpawnImage165")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement