Quantcast Help Modding A Current UI - WoWInterface
Thread Tools Display Modes
02-26-06, 01:48 PM   #1
chippewa
A Fallenroot Satyr
Join Date: Aug 2005
Posts: 21
Help Modding A Current UI

I'm currently using ajackalope's NightfallProc UI, a very basic UI that plays a sound when my warlock's Nightfall ability Procs. I prefer this UI to Necrosis since Necrosis often crashes on me for some reason and I dont really like/need all of the functionality of it.

If possible, I would like to create another mod that has the same functionality of NightfallProc but instead plays a sound when my Soulstone expires. I was wondering if anyone could tell me how to mod the code from the NightfallProc UI to do the same thing for SoulStone expiring?

The LUA from NightfallProc is very short and listed below:


function NightfallProc_onLoad()
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS");
DEFAULT_CHAT_FRAME:AddMessage("NightfallProc Version 1 loaded.");
end

function NightfallProc_onEvent(event)
if (arg1 == "You gain Shadow Trance.") then
DEFAULT_CHAT_FRAME:AddMessage("Nightfall!");
PlaySoundFile("Interface\\AddOns\\NightfallProc\\cpi.wav");
end;
end



I thought all I would have to do is replace the quoted text in arg1 with the text that is displayed when the Soulstone expires, but I am either entering the wrong text phrase or something because I cannot get it to work.

Any suggestions?

Last edited by chippewa : 04-12-06 at 03:58 PM.
  Reply With Quote
03-01-06, 11:12 PM   #2
Gello
A Firelord
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 488
The event CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS will probably need to change.

Probably for soulstone you want to register for both of these:
CHAT_MSG_SPELL_AURA_GONE_OTHER
CHAT_MSG_SPELL_AURA_GONE_SELF

OnLoad:
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER")
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF")

OnEvent:
if string.find(arg1,"Soulstone expired") then
DEFAULT_CHAT_FRAME:AddMessage("Nightfall!");
PlaySoundFile("Interface\\AddOns\\NightfallProc\\cpi.wav");
end

If you use string.find you can use partial matches. Not sure if "Soulstone expired" will work. It will pick up other warlock's soulstones expiring also. To capture only yours you would need to keep track of who you cast it on and then match the expire message to their names.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Help Modding A Current UI

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off