Difference between revisions of "RoM Working with profile events"

From SolarStrike wiki
Jump to: navigation, search
(New page: = Profile Event <onSkillCast> = There are two main situations to use that event. Emergeny casts and finisher. == Emergeny Casts == == Finisher Casts == There is no skill option to do a...)
 
Line 4: Line 4:
  
 
== Emergeny Casts ==
 
== 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  b to use a skill at a specific hp level.
 +
  
 
== Finisher Casts ==
 
== Finisher Casts ==
Line 12: Line 24:
  
 
and in the event add the coding:
 
and in the event add the coding:
<onSkillCast>
+
<source lang="xml"><onSkillCast>
local target = player:getTarget();
+
local target = player:getTarget();
    if( 20 > target.HP/target.MaxHP*100 ) then
+
if( 20 > target.HP/target.MaxHP*100 ) then
        player:cast("MAGE_FIREBALL");
+
player:cast("MAGE_FIREBALL");
    end;
+
end;
</onSkillCast>
+
</onSkillCast></source>

Revision as of 09:05, 19 October 2009

Profile Event <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 b 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 <onCast> 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>