Hi,
wanted to share this very basic plugin which was requested by traderjoe in this thread: Linkl
I wrote it straight from head just browsing through the API for the needed functions. I did not test this at all.(Need second account for this) But it compiles fine. It's very basic and it will follow the party leader around and tries to stay in heal/follow range and heals the lowest partymember if it has low hp. It is really just an example and not tested with a second account/party.
Feel free to improve it and post your results here !
Adjust those values on top to make it work for your healing skills:
wanted to share this very basic plugin which was requested by traderjoe in this thread: Linkl
I wrote it straight from head just browsing through the API for the needed functions. I did not test this at all.(Need second account for this) But it compiles fine. It's very basic and it will follow the party leader around and tries to stay in heal/follow range and heals the lowest partymember if it has low hp. It is really just an example and not tested with a second account/party.
Feel free to improve it and post your results here !
Adjust those values on top to make it work for your healing skills:
Code:
private Double _followRange = 10.0;
private Double _healRange = 15.0;
private String _healSkill1 = "ABC";
private String _healSkill2 = "ABC2";
private Double _healPercentage = 80.0;
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace Follower{
public class Follower : Core
{
public static string GetPluginAuthor()
{
return "2face";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "Follower Plugin";
}
private Double _followRange = 10.0;
private Creature _leader = null;
private Double _healRange = 15.0;
private String _healSkill1 = "ABC";
private String _healSkill2 = "ABC2";
private Double _healPercentage = 80.0;
//Call on plugin start
public void PluginRun()
{
_leader = getPartyLeaderObj();
if(_leader == null || _leader == me){
Log("Please set leader");
}else{
Start();
}
}
public void Start(){
while(true){
Thread.Sleep(50);
if(_leader != null){
if(_leader.inFight && me.dist(_leader) < _healRange){
healRoutine();
}else{
moveToPlayer(_leader);
}
}
}
}
public Creature getLowestHPMember(){
Creature obj = null;
Double lowestHp = 99999999;
Double pCurHP = 100;
foreach(var member in getPartyMembers()){
pCurHP = member.maxhp * (member.curhp / 100);
if(pCurHP < lowestHp){
lowestHp = pCurHP;
obj = member.obj;
}
}
return obj;
}
public bool hasLowHP(Creature target){
return (target.maxHp * (target.hp * 100) <= _healPercentage);
}
public void healRoutine(){
Creature healTarget = getLowestHPMember();
if(healTarget != null){
if(me.dist(healTarget) < _healRange){
if(me.target != healTarget){
SetTarget(healTarget);
if(hasLowHP(healTarget)){
if(healTarget == me){
UseSkillAndWait(_healSkill1, true);
UseSkillAndWait(_healSkill2, true);
}else{
UseSkillAndWait(_healSkill1, false);
UseSkillAndWait(_healSkill1, false);
}
}
}
}else{
moveToPlayer(healTarget);
}
}
}
public void UseSkillAndWait(string skillName, bool selfTarget = false)
{
//wait cooldowns first, before we try to cast skill
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
if (!UseSkill(skillName, true, selfTarget))
{
if (me.target != null && GetLastError() == LastError.NoLineOfSight)
{
//No line of sight, try come to target.
if (dist(me.target) <= 5)
ComeTo(me.target, 2);
else if (dist(me.target) <= 10)
ComeTo(me.target, 3);
else if (dist(me.target) < 20)
ComeTo(me.target, 8);
else
ComeTo(me.target, 8);
}
}
//wait cooldown again, after we start cast skill
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
}
public void moveToPlayer(Creature obj){
ComeTo(obj, _followRange);
}
//Call on plugin stop
public void PluginStop()
{
}
}
}