Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- explodeCorpses: function (unit) {
- if (Config.ExplodeCorpses === 0 || unit.mode === 0 || unit.mode === 12) {
- return false;
- }
- var corpseList = [],
- range = Math.floor((me.getSkill(Config.ExplodeCorpses, 1) + 7) / 3),
- corpse = getUnit(1, -1, 12);
- if (corpse) {
- do {
- if (getDistance(unit, corpse) <= range && this.checkCorpse(corpse)) {
- corpseList.push(copyUnit(corpse));
- if (corpseList.length >= 2) { // Explode 2 corpses per cycle, so we can leave some for summoning
- break;
- }
- }
- } while (corpse.getNext());
- }
- while (corpseList.length > 0) {
- corpse = corpseList.shift();
- me.overhead("Exploding: " + corpse.classid + " " + corpse.name);
- if (Skill.cast(Config.ExplodeCorpses, 0, corpse)) {
- delay(200);
- }
- }
- return true;
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement