Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Wait_A_Second_Then_Update_Mirrorimage(pUnit)
- local plr = pUnit:GetClosestPlayer()
- if not plr then
- return
- end
- --[[plr:CastSpellOnTarget(69828, pUnit)
- plr:CastSpellOnTarget(69837, pUnit)]]
- pUnit:SetModel(plr:GetDisplay())
- pUnit:SetUInt32Value(60, bit_or(pUnit:GetUInt32Value(60), 16))
- local p = LuaPacket:CreatePacket(1026, 68)
- p:WriteGUID(pUnit:GetGUID())
- p:WriteULong(plr:GetDisplay()) -- race display
- 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
- 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)
- else
- p:WriteULong(item:GetDisplayId())
- end
- end
- local item = plr:GetEquippedItemBySlot(15)
- if item then
- pUnit:SetUInt32Value(0x0006 + 0x0032, item:GetEntryId()) -- main hand
- else
- pUnit:SetUInt32Value(0x0006 + 0x0032, 0)
- end
- item = plr:GetEquippedItemBySlot(16)
- if item then
- pUnit:SetUInt32Value(0x0006 + 0x0032 + 0x1, item:GetEntryId()) -- offhand
- else
- pUnit:SetUInt32Value(0x0006 + 0x0032 + 0x1, 0)
- end
- item = plr:GetEquippedItemBySlot(17)
- if item then
- pUnit:SetUInt32Value(0x0006 + 0x0032 + 0x2, item:GetEntryId()) -- ranged
- else
- pUnit:SetUInt32Value(0x0006 + 0x0032 + 0x2, 0)
- end
- pUnit:SetUInt32Value(0x0006 + 0x0074, 1) -- bytes2 1
- for _,v in pairs(pUnit:GetInRangePlayers()) do
- v:SendPacketToPlayer(p)
- end
- pUnit:SetMaxHealth(plr:GetMaxHealth() * 2)
- pUnit:SetHealth(pUnit:GetMaxHealth())
- local mana_regen_time = 500
- local class = plr:GetPlayerClass()
- pUnit:SetValue("class", class)
- if class == "Warrior" then
- pUnit:SetMaxPower(1000, 1)
- pUnit:SetPower(1000, 1)
- pUnit:SetPowerType(1)
- pUnit:RegisterEvent("GenerateRage", 3500, 0)
- elseif class == "Paladin" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Hunter" then
- pUnit:SetMaxPower(100, 2)
- pUnit:SetPower(100, 2)
- pUnit:SetPowerType(2)
- pUnit:RegisterEvent("RegenerateFocus", 500, 0)
- elseif class == "Rogue" then
- pUnit:SetMaxPower(100, 3)
- pUnit:SetPower(100, 3)
- pUnit:SetPowerType(3)
- pUnit:RegisterEvent("RegenerateEnergy", 500, 0)
- elseif class == "Priest" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Shaman" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Mage" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Warlock" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Druid" then
- pUnit:SetMaxPower(plr:GetMaxMana() * 2, 0)
- pUnit:SetPower(pUnit:GetMaxMana(), 0)
- pUnit:SetPowerType(0)
- pUnit:RegisterEvent("RegenerateMana", mana_regen_time, 0)
- elseif class == "Demon Hunter" then
- pUnit:SetMaxPower(100, 3)
- pUnit:SetPower(100, 3)
- pUnit:SetPowerType(3)
- pUnit:RegisterEvent("RegenerateEnergy", 500, 0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment