Difference between revisions of "RoM Working with profile events"
From SolarStrike wiki
(→Emergeny Casts) |
m (Reverted edits by 207.249.174.245 (Talk) to last revision by 95.115.1.146) |
||
Line 12: | Line 12: | ||
There are two main situations to use that event. Emergeny casts and finisher. | There are two main situations to use that event. Emergeny casts and finisher. | ||
− | + | == Emergeny Casts == | |
+ | |||
+ | Using the onSkillCast event has the advantage that the emergency situation is checked after every skill use and not only after every 'skill using round'. | ||
+ | <source lang="xml"><onSkillCast> | ||
+ | if( 20 > player.HP/player.MaxHP*100 ) then | ||
+ | player:cast("PRIEST_SOUL_SOURCE"); | ||
+ | elseif( 30 > player.HP/player.MaxHP*100 ) then | ||
+ | player:cast("PRIEST_HOLY_AURA"); | ||
+ | player:cast("PRIEST_URGENT_HEAL"); | ||
+ | player:cast("PRIEST_URGENT_HEAL"); | ||
+ | end; | ||
+ | </onSkillCast></source>You also could use the 'hpper' option in the skills section to use a skill at a specific hp level. | ||
+ | |||
== Finisher Casts == | == Finisher Casts == |
Latest revision as of 17:07, 9 April 2010
Profile Event <onSkillCast>
OnSkillCast will receive a Lua table ('arg1') that is a copy of the skill being cast. You can use this to query information about the skill. This can be useful in "skill chaining."
<onSkillCast>
if( arg1.Name == "PRIEST_HOLY_AURA" ) then
yrest(1000);
player:cast("PRIEST_URGENT_HEAL");
end
</onSkillCast>
There are two main situations to use that event. Emergeny casts and finisher.
Emergeny Casts
Using the onSkillCast event has the advantage that the emergency situation is checked after every skill use and not only after every 'skill using round'.
<onSkillCast>
if( 20 > player.HP/player.MaxHP*100 ) then
player:cast("PRIEST_SOUL_SOURCE");
elseif( 30 > player.HP/player.MaxHP*100 ) then
player:cast("PRIEST_HOLY_AURA");
player:cast("PRIEST_URGENT_HEAL");
player:cast("PRIEST_URGENT_HEAL");
end;
</onSkillCast>
Finisher Casts
There is no skill option to do a finishing skill. But you could to that in the <onSkillCast> event. Insert the skill into your profile, assign a hotkey and set it to autouse=false:
<skill name="MAGE_FIREBALL" hotkey="VK_R" autouse="false" />
and in the event add the coding:
<onSkillCast>
local target = player:getTarget();
if( 20 > target.HP/target.MaxHP*100 ) then
player:cast("MAGE_FIREBALL");
end;
</onSkillCast>