I have not so shameless ripped RuneB's archon wiz plugin into a Rathma plugin but I can't figure out one piece.
Code: using System.Linq; using Turbo.Plugins.Default; using Turbo.Plugins.Jack; n - Pastebin.com
PHP Code:
if (boneArmorSkill != null) {
var layout = WarningFont.GetTextLayout("\u22EF\u2995 Bone Armor \u2996\u22EF");
if (!me.Powers.BuffIsActive(466857, 0))
WarningFont.DrawText(layout, hudWidth * 0.5f - (layout.Metrics.Width * 0.5f), hudHeight * (WarningYPos+WarningYPosIncr));
}
PHP Code:
private void UpdateSkills(IPlayer me) {
me.Powers.UsedSkills.ForEach(skill => {
if (skill.SnoPower.Sno == 462089) mageSkill = skill;
if (skill.SnoPower.Sno == 466857) boneArmorSkill = skill;
if (skill.SnoPower.Sno == 465839) landofthedeadSkill = skill;
}); }
If you take Bone Armor off your active skills it still shows the warning text. What is the best way to null out the boneArmorSkill variable on update or is there a better approach.
Edit: may have found a solution
Disadvantages of doing it this way?
Code:
if (me.Powers.UsedSkills.Any(x => x.SnoPower.Sno == 466857))
{
var layout = WarningFont.GetTextLayout("\u22EF\u2995 Bone Armor \u2996\u22EF");
if (!me.Powers.BuffIsActive(466857, 0))
WarningFont.DrawText(layout, hudWidth * 0.5f - (layout.Metrics.Width * 0.5f), hudHeight * (WarningYPos+WarningYPosIncr));
}