Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- room = getRoom(me.x, me.y);
- monsterList = [];
- target = NTC_GetUnit(NTC_UNIT_MONSTER, null, MODE_ALIVE);
- if (target) { // build monster list. all monsters within getUnit range.
- do {
- monsterList.push(copyUnit(target));
- } while (target.getNext());
- }
- print("mon list: " + monsterList.length);
- MainLoop : while (monsterList.length > 0) {
- monsterList.sort(NTA_SortMonsters);
- target = monsterList[0];
- if (room.unitInRoom(target) && (!spectype || target.spectype & spectype) && NTA_IsValidTarget(target)) {
- result = NTA_Attack(target, attackCount % 30 === 0);
- switch (result) {
- case 1:
- print("att fail");
- monsterList.shift();
- break;
- case 2:
- case 3:
- if (!target.spectype & 0x7) {
- if(!gidAttack[target.gid]) {
- gidAttack[target.gid] = 0;
- }
- gidAttack[target.gid] += 1;
- if (gidAttack[target.gid] > 8) {
- print("Skipping " + target.name);
- monsterList.shift();
- }
- }
- attackCount += 1;
- if (target.mode === 0 || target.mode === 12) {
- NTA_FastPick();
- }
- break;
- default:
- return false;
- }
- } else {
- monsterList.shift();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement