thetaxi 1 Posted April 21, 2023 Share Posted April 21, 2023 Working in XML and cannot get this to work. I have tried both lua script and C#code and still not working. First the lua script <FightClassSpell> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript>anyCurse = false; for i=1,40 do local name, rank, icon, count, debuffAuraType = UnitAura("player", i); if debuffAuraType == "Magic" then anyCurse = true; return; end end</LuaScript> <VarRet>anyCurse</VarRet> <ValueRet>true</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <SpellName>CastSpellByID(100503);</SpellName> <Priority>13</Priority> <CombatOnly>false</CombatOnly> <CheckIfKnow>false</CheckIfKnow> <CheckIfSpellUsable>false</CheckIfSpellUsable> <CheckSpellDistance>false</CheckSpellDistance> <CheckIfView>false</CheckIfView> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <Debug>true</Debug> <WaitDuringCasting>false</WaitDuringCasting> </FightClassSpell> Ive also tried this <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript>anyCurse = false; for i=1,40 do local name, rank, icon, count, debuffAuraType = UnitAura("player", i); if name and debuffAuraType and debuffAuraType == "Magic" then anyCurse = true; return; end end</LuaScript> <VarRet>anyCurse</VarRet> <ValueRet>true</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <SpellName>CastSpellByID(100503);</SpellName> <Priority>13</Priority> <CombatOnly>false</CombatOnly> <CheckIfKnow>false</CheckIfKnow> <CheckIfSpellUsable>false</CheckIfSpellUsable> <CheckSpellDistance>false</CheckSpellDistance> <CheckIfView>false</CheckIfView> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <Debug>true</Debug> <WaitDuringCasting>false</WaitDuringCasting> </FightClassSpell> Link to comment https://wrobot.eu/forums/topic/15149-detect-magic-debuff-and-cast-spell-by-id-or-name/ Share on other sites More sharing options...
Droidz 2738 Posted April 22, 2023 Share Posted April 22, 2023 Hello, what is log debug log lines when the spell should be cast? Link to comment https://wrobot.eu/forums/topic/15149-detect-magic-debuff-and-cast-spell-by-id-or-name/#findComment-68076 Share on other sites More sharing options...
thetaxi 1 Posted April 22, 2023 Author Share Posted April 22, 2023 [D] 08:45:24 - [FightClass] CastSpellByID(100503); - NeedToRun time to execute: 27 [D] 08:45:24 - [FightClass] CastSpellByID(100503); - NeedToRun = false - condition [D] 08:45:24 - [FightClass] CastSpellByID(100503); - NeedToRun time to execute: 33 [D] 08:45:24 - [FightClass] CastSpellByID(100503); - NeedToRun = false - condition Link to comment https://wrobot.eu/forums/topic/15149-detect-magic-debuff-and-cast-spell-by-id-or-name/#findComment-68078 Share on other sites More sharing options...
Droidz 2738 Posted April 23, 2023 Share Posted April 23, 2023 When you run your Lua code (in "dev... tools"), it works ? try to add a print in you code to debug it, like that : for i=1,40 do local name, rank, icon, count, debuffAuraType = UnitAura("player", i); if debuffAuraType == "Magic" then anyCurse = true; print("true") return; end end print("false") Link to comment https://wrobot.eu/forums/topic/15149-detect-magic-debuff-and-cast-spell-by-id-or-name/#findComment-68086 Share on other sites More sharing options...
thetaxi 1 Posted April 26, 2023 Author Share Posted April 26, 2023 Its not working. The debuff is custom so i dont think its being picked up. How can i adapt this to use spellID which i know. I can just write a couple of options for different spell ids I confirmed it worked with other magic but not these custom spells. Link to comment https://wrobot.eu/forums/topic/15149-detect-magic-debuff-and-cast-spell-by-id-or-name/#findComment-68110 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now