Thread Tools Display Modes
08-22-06, 05:36 PM   #1
Kadoba
A Defias Bandit
Join Date: Aug 2006
Posts: 2
Help with a simple mod

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.

Last edited by Kadoba : 08-22-06 at 05:43 PM.
  Reply With Quote
08-22-06, 07:22 PM   #2
Guillotine
A Cobalt Mageweaver
 
Guillotine's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 206
I don't have the time to look through that right now, but check www.wowwiki.com. You can read up on the events there to see if their correct

edit: just glancing through it (this isn't the problem, just an improvment), you don't need to declare that table every time you cast the spall. You can just declare it in the OnLoad event

Edit2: Just realized, you used Spellcast_Start. For some reason, Spellcast_Start does not trigger on instant cast spells

Edit3: See http://www.wowwiki.com/HOWTO:_Detect...nt_Cast_Spells It's a slightly more project than you thought at first :/ Maybe try a non-instant cast spell to begin with?

Last edited by Guillotine : 08-22-06 at 07:36 PM.
  Reply With Quote
08-22-06, 07:40 PM   #3
Kadoba
A Defias Bandit
Join Date: Aug 2006
Posts: 2
Thanks for the reply. The event page on wowwiki is actually where I looked up the event. However it only says that the argument is the name of the spell, but it doesn't specify or give an example.

update: I started playing around with the script and realized that the OnLoad() function wasn't even being called. I think that the XML isnt even being loaded at all. I don't know if this has to do with the 1.12 patch or if I called the XML file wrong in the TOC document.
  Reply With Quote
08-22-06, 07:53 PM   #4
mindtrix
A Murloc Raider
Join Date: Jun 2006
Posts: 7
If you get this working please let me know. This is EXACTLY the mod I have been looking for. Everyone told me to use Battlecry, but it has too many variables and doesn't seem to work without having a target selected first (when using rez spells).

Could you perhaps make this work with the Priest's Resurrection spell as well?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with a simple mod

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