Im trying to create a simple mod to say random phrases when the paladin redemption spell is cast. This is mostly for practice as its my first time trying to make a mod. However I t just doesn't work. I get no errors, but when I cast it doesn't say anything.
This is what I have so far:
Code:
------------------------------------------------------------------------------------
TOC file:
## Interface: 5595
## Title: Ressurection Blab
## Notes: Spice up your redemption spell with random phrases.
## Author: Kadoba
## DefaultState: enabled
## Dependencies:
## OptionalDeps:
RessurectionBlab.xml
---------------------------------------------
XML file:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/FrameXML/UI.xsd">
<Script file="RessurectionBlab.lua"/>
<Frame name="RessurectionBlab_MainFrame">
<Scripts>
<OnLoad>
RessurectionBlab_MainFrame_OnLoad();
</OnLoad>
<OnEvent>
RessurectionBlab_MainFrame_OnEvent();
</OnEvent>
</Scripts>
</Frame>
</Ui>
---------------------------------------------
LUA file:
function RessurectionBlab_MainFrame_OnLoad()
this:RegisterEvent("SPELLCAST_START");
end
function RessurectionBlab_MainFrame_OnEvent()
if(event=="SPELLCAST_START" and arg1=="Redemption(Rank 5)") then
blab={
"Statement 1",
"Statement 2",
"Statement 3",
};
SendChatMessage(blab[math.random(3)]);
end
end
---------------------------------------------------------------------------------------
Some possible errors:
- The first error I think it may be is the start of the UI tag in the XML file. I copied it from a very old tutorial and Im not sure if its too out of date to work.
- The second error it may be is when the OnEvent() function is called. Im not sure if the argument in "SPELLCAST_START" is "Redemption(Rank 5)" or not.
Anyway I'm stumped. Any help would be appreciated.