RoM Working with profile events

From SolarStrike wiki
Jump to: navigation, search

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>
You also could use the 'hpper' option in the skills section to use a skill at a specific hp level.


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>