kusanagy

Shirt Morph

Jan 14th, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. --[[
  2.   * TITLE  : Morph Shirts
  3.   * AUTHOR : hates_sundays
  4.   * CONTACT: http://sundays.org.uk/
  5.   * VERSION: 1.0
  6.   * CREATED: 19/3/2016
  7.   * UPDATED: 19/3/2016
  8.   * DESC   : Applies an aura to your character depending on which shirt you equip.
  9. --]]
  10.  
  11. local Auras = {
  12.   37810, -- TaurenMale
  13.   37811, -- TaurenFemale
  14.   35466, -- HumanMale
  15.   37805, -- HumanFemale
  16.   37808, -- GnomeMale
  17.   37809, -- GnomeFemale
  18.   37807, -- BloodelfMale
  19.   37806; -- BloodelfFemale
  20. };
  21.  
  22. local Shirts = {
  23.   6384,  -- Stylish Blue Shirt
  24.   6385,  -- Stylish Green Shirt
  25.   4330,  -- Stylish Red SHirt
  26.   41251, -- Yellow Lumberjack Shirt
  27.   2576,  -- White Linen Shirt
  28.   10056, -- Orange Mageweave Shirt
  29.   10054, -- Lavender Mageweave Shirt
  30.   11840; -- Master Builder's Shirt
  31. };
  32.  
  33. local function OnEquip(event, player, item, bag, slot)
  34.   if slot == 3 then -- Shirt slot id
  35.     for i, v in ipairs(Shirts) do
  36.       if item:GetEntry() == v then
  37.         player:AddAura(Auras[i], player);
  38.         player:SendBroadcastMessage("You feel tingly all over.");
  39.         break;
  40.       else
  41.         for i, v in ipairs(Auras) do
  42.           if player:HasAura(v) then
  43.             player:RemoveAura(v);
  44.           end
  45.         end
  46.       end
  47.     end
  48.   end
  49. end
  50.  
  51. RegisterPlayerEvent(29, OnEquip); -- PLAYER_EVENT_ON_EQUIP
Add Comment
Please, Sign In to add comment