Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function staticBoss(id, percent) {
- var i, unit, staticRange;
- for (i = 0; i < 5 && !unit; i += 1) {
- unit = getUnit(1, id);
- delay(200);
- }
- if (!unit) {
- return false;
- }
- // Static
- if (me.getSkill(42, 1) && Attack.checkResist(unit, "lightning") && Math.round(unit.hp * 100 / unit.hpmax) > percent) {
- staticRange = Math.floor((me.getSkill(42, 1) + 4) * 2 / 3);
- while (Math.round(unit.hp * 100 / unit.hpmax) > percent) {
- if (getDistance(me, unit) > staticRange || checkCollision(me, unit, 0x4)) {
- if (!Attack.getIntoPosition(unit, staticRange, 0x4)) {
- return false;
- }
- }
- if (!Skill.cast(42, 0)) {
- return false;
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement