Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(allstates, event, ...)
- if event == 'NAME_PLATE_UNIT_ADDED' and ... then
- local unit = ...
- local guid = UnitGUID(unit)
- local _,_,_,_,_, npc_id,_ = strsplit("-",guid)
- if npc_id == '161895' then
- allstates[ unit ] = {
- show = true,
- changed = true,
- nameplate_unit = ...
- }
- le_randomizer = function()
- picked_value = math.random(3) -- Picks random numbr from tablelength.
- while(picked_value == previous_picked_value)
- do
- picked_value = math.random(3) -- Picks random numbr from tablelength.
- end
- previous_picked_value = picked_value
- return picked_value
- end
- rand = le_randomizer()
- if (rand == 1)
- then
- SoundPicked = ([[Interface\CustomFiles\WhyAreYouRunning.ogg]])
- PickedImage = ([[Interface\CustomFiles\WhyAreYouRunning.tga]])
- elseif (rand == 2)
- then
- SoundPicked = ([[Interface\CustomFiles\WannaSpriteCranberry.ogg]])
- PickedImage = ([[Interface\CustomFiles\WannaSpriteCranberry.tga]])
- elseif (rand == 3)
- then
- SoundPicked = ([[Interface\CustomFiles\Lucky.ogg]])
- PickedImage = ([[Interface\CustomFiles\Lucky.tga]])
- elseif (rand == 4)
- then
- rand2 = le_randomizer()
- if (rand2 == 1)
- then
- SoundPicked = ([[Interface\CustomFiles\BoomShakalala.ogg]])
- elseif (rand2 == 2)
- then
- SoundPicked = ([[Interface\CustomFiles\Weee.ogg]])
- end
- end
- PlaySoundFile(SoundPicked, "master")
- end
- ImagePicked = PickedImage
- elseif event == 'NAME_PLATE_UNIT_REMOVED' and ... then
- local unit = ...
- allstates[ unit ] = {
- show = false,
- changed = true
- }
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement