Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PlayerClassToInt = {["Warrior"] = 1, ["Paladin"] = 2, ["Hunter"] = 3, ["Rogue"] = 4, ["Priest"] = 5,
- ["Death Knight"] = 6, ["Shaman"] = 7, ["Mage"] = 8, ["Warlock"] = 9, ["Druid"] = 11, ["Demon Hunter"] = 12}
- local RaceDisplayMap = {
- {49, 50}, {51, 52}, {53, 54}, {55, 56}, {57, 58},
- {59, 60}, {1563, 1564}, {1478, 1479}, {6894, 6895}, {15476, 15475},
- {16125, 16126}, {16981, 16980}, {17402, 17403}, {17576,
- 17577}, {17578, 17579}, {21685, 21686}, {21780,21780},{21963,
- 21964}, {26316, 26317}, {26871, 26872}, {26873, 26874}
- };
- function Wait_A_Second_Then_Update_Mirrorimage(pUnit)
- local plr = pUnit:GetClosestPlayer()
- if not plr then
- return
- end
- if plr:GetGender() == 0 then
- plr:RemoveAura(35480)
- else
- plr:RemoveAura(35481)
- end
- pUnit:SetFaction(21)
- --plr:CastSpellOnTarget(69828, pUnit) -- change display
- plr:CastSpellOnTarget(69837, pUnit) -- change name
- --[[local model = RaceDisplayMap[plr:GetPlayerRace()][plr:GetGender()+1]
- if not model then
- model = plr:GetDisplay()
- end
- pUnit:SetModel(model)]]
- 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
- local display = item:GetDisplayId()
- if not display then
- display = 0
- end
- if i == 0 and plr:HasFlag(150, 1024) then
- display = 0
- elseif i == 14 and plr:HasFlag(150, 2048) then
- display = 0
- end
- p:WriteULong(display)
- 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 = 4000
- local class = plr:GetPlayerClass()
- pUnit:SetValue("class", class)
- if class == "Warrior" then
- pUnit:SetMaxPower(1000, 1)
- pUnit:SetPower(100, 1)
- pUnit:SetPowerType(1)
- pUnit:RegisterEvent("GenerateRage", 3500, 0)
- pUnit:SetMaxHealth(plr:GetMaxHealth() * 3.25)
- pUnit:SetHealth(pUnit:GetMaxHealth())
- 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