Advertisement
kolton

Untitled

Feb 7th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. explodeCorpses: function (unit) {
  2. if (Config.ExplodeCorpses === 0 || unit.mode === 0 || unit.mode === 12) {
  3. return false;
  4. }
  5.  
  6. var corpseList = [],
  7. range = Math.floor((me.getSkill(Config.ExplodeCorpses, 1) + 7) / 3),
  8. corpse = getUnit(1, -1, 12);
  9.  
  10. if (corpse) {
  11. do {
  12. if (getDistance(unit, corpse) <= range && this.checkCorpse(corpse)) {
  13. corpseList.push(copyUnit(corpse));
  14.  
  15. if (corpseList.length >= 2) { // Explode 2 corpses per cycle, so we can leave some for summoning
  16. break;
  17. }
  18. }
  19. } while (corpse.getNext());
  20. }
  21.  
  22. while (corpseList.length > 0) {
  23. corpse = corpseList.shift();
  24.  
  25. me.overhead("Exploding: " + corpse.classid + " " + corpse.name);
  26.  
  27. if (Skill.cast(Config.ExplodeCorpses, 0, corpse)) {
  28. delay(200);
  29. }
  30. }
  31.  
  32. return true;
  33. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement