Advertisement
SmooKy

Untitled

Mar 29th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. function(allstates, event, ...)
  2.  
  3. if event == 'NAME_PLATE_UNIT_ADDED' and ... then
  4.  
  5. local unit = ...
  6.  
  7. local guid = UnitGUID(unit)
  8. local _,_,_,_,_, npc_id,_ = strsplit("-",guid)
  9.  
  10. if npc_id == '161895' then
  11. allstates[ unit ] = {
  12. show = true,
  13. changed = true,
  14. nameplate_unit = ...
  15. }
  16. le_randomizer = function()
  17. picked_value = math.random(3) -- Picks random numbr from tablelength.
  18. while(picked_value == previous_picked_value)
  19. do
  20. picked_value = math.random(3) -- Picks random numbr from tablelength.
  21. end
  22. previous_picked_value = picked_value
  23. return picked_value
  24. end
  25. rand = le_randomizer()
  26. if (rand == 1)
  27. then
  28. SoundPicked = ([[Interface\CustomFiles\WhyAreYouRunning.ogg]])
  29. PickedImage = ([[Interface\CustomFiles\WhyAreYouRunning.tga]])
  30. elseif (rand == 2)
  31. then
  32. SoundPicked = ([[Interface\CustomFiles\WannaSpriteCranberry.ogg]])
  33. PickedImage = ([[Interface\CustomFiles\WannaSpriteCranberry.tga]])
  34. elseif (rand == 3)
  35. then
  36. SoundPicked = ([[Interface\CustomFiles\Lucky.ogg]])
  37. PickedImage = ([[Interface\CustomFiles\Lucky.tga]])
  38. elseif (rand == 4)
  39. then
  40. rand2 = le_randomizer()
  41. if (rand2 == 1)
  42. then
  43. SoundPicked = ([[Interface\CustomFiles\BoomShakalala.ogg]])
  44. elseif (rand2 == 2)
  45. then
  46. SoundPicked = ([[Interface\CustomFiles\Weee.ogg]])
  47. end
  48. end
  49. PlaySoundFile(SoundPicked, "master")
  50. end
  51.  
  52. ImagePicked = PickedImage
  53.  
  54.  
  55.  
  56. elseif event == 'NAME_PLATE_UNIT_REMOVED' and ... then
  57.  
  58. local unit = ...
  59.  
  60. allstates[ unit ] = {
  61. show = false,
  62. changed = true
  63. }
  64.  
  65. end
  66.  
  67. return true
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement