Page 1 of 1
Best way to stop casting Disarmament once stacked 4 times.
Posted: Fri Nov 05, 2010 1:09 pm
by Mushroomstamp
I'd like to stack disarmament 4 times to start a fight, but then not use it again in that fight, or at least until the affect wears off. What would be the easiest way to do this?
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Fri Nov 05, 2010 6:24 pm
by rock5
You could set its maxuse value to 1
Code: Select all
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="macro" priority="90" maxuse="1"/>
Then, in the <onSkillCast> section, check if the skill is Disarmament, if so then it casts it another 3 times.
Code: Select all
if arg1.Name == "KNIGHT_DISARMAMENT" then
player:cast("KNIGHT_DISARMAMENT");
player:cast("KNIGHT_DISARMAMENT");
player:cast("KNIGHT_DISARMAMENT");
end
That's simple but just remember it isn't checking health or mana during that time.
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Sat Nov 06, 2010 9:09 am
by Mushroomstamp
Perfect - thanks Rock!
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Sat Nov 06, 2010 10:22 am
by jduartedj
rock5 wrote:You could set its maxuse value to 1
Code: Select all
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="macro" priority="90" maxuse="1"/>
Then, in the <onSkillCast> section, check if the skill is Disarmament, if so then it casts it another 3 times.
Code: Select all
if arg1.Name == "KNIGHT_DISARMAMENT" then
player:cast("KNIGHT_DISARMAMENT");
player:cast("KNIGHT_DISARMAMENT");
player:cast("KNIGHT_DISARMAMENT");
end
That's simple but just remember it isn't checking health or mana during that time.
BTW is there already a way to check if you got so many stacked of such buff?
I was thinking in this case, and not have it without checking for HP/MP, you could use checking the buff created by this skill and then if its <4 cast it, i think that would work, But checking buff stacks would be good in a lot of skills.
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Sat Nov 06, 2010 9:31 pm
by rock5
jduartedj wrote:BTW is there already a way to check if you got so many stacked of such buff?
Some of the skills in the skills database include buff and debuff requirements, eg.
Code: Select all
<skill name="WARRIOR_TACTICAL_ATTACK" aslevel="4" skilltab="4" skillnum="4" rage="15" range="50" cooldown="5" type="damage" target="enemy" reqbufftype="debuff" reqbuffcount="1" reqbufftarget="target" reqbuffname="Bleed" />
but not many of them do. This is mainly because updateBuffs uses RoMScript, which is slow and unreliable, so you want to minimize it's use and there is a delay between casting a spell and the debuff appearing on the mob so the skill usually casts too many times. So if you want to update the skills.xml database, you're free to do so.
There are also buff functions pawn:hasBuff() and pawn:hasDebuff() but they don't return the number even though updateBuffs does collect that information.
I guess the easiest way to do it would be to run
Code: Select all
target=player:getTarget()()
target:updateBuffs()
for i = 3, target.Debuffs["Disarmament debuff name"), -1 do -- Not sure what the debuff is called
player:cast("KNIGHT_DISARMAMENT");
end
Note: This way only uses updateBuffs once then uses the for loop to cast the skill the correct number of times. This is to reduce the use of updateBuffs.
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Fri Nov 12, 2010 7:55 am
by fluxus
i have been using this config for quite some time
Code: Select all
<onSkillCast>
local target = player:getTarget();
local bool, count = target:hasDebuff("Heilige Siegel (3)");
if bool == true then
player:cast("KNIGHT_MANA_ABSORPTION");
end;
local bool, count = target:hasDebuff("Abrüstung IV");
if bool == false then
player:cast("KNIGHT_DISARMAMENT");
end;
</onSkillCast>
u have to replace "Heilige Siegel (3)" and "Abrüstung IV" with the corresponding debuff name of your client language
-flix
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Tue Nov 16, 2010 11:01 am
by Petzzz
<onSkillCast>
local target = player:getTarget();
local bool, count = target:hasDebuff("Heilige Siegel (3)");
if bool == true then
player:cast("KNIGHT_MANA_ABSORPTION");
end;
local bool, count = target:hasDebuff("Abr\129stung IV");
if bool == false then
player:cast("KNIGHT_DISARMAMENT");
end;
</onSkillCast>
works better (ü=\129)
any idea how to stop casting KNIGHT_DISARMAMENT at buffing myself?
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_6" priority="80" autouse="false" inbattle="true" /> didnt work
rock5 code didnt work
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Tue Nov 16, 2010 11:12 am
by rock5
I don't know about umlauts but are the debuffs supposed to have the numbers after their names? After all that's what the 'count' variable is for. Try it without the numbers.
Re: Best way to stop casting Disarmament once stacked 4 time
Posted: Wed Nov 17, 2010 8:02 am
by Petzzz
problem is that the debuff cout is not 1,2,3 its I,II,III,IV so we need a reqdebuffcount= < 4 or IV
without nummbers bot just spam the skilll
maybe target:hasDebuff("Abr\129stung (IV)"); works, ill give it a test and post what happend.