I used to do that using /alert, but now it do not work anymore with the "true" name (I dont know how to call the name that is reported using $target(name) over the one that is give using $target(name,clear)), only with the cleared name. The difference is very important because before using /alert add 1 npc $target(name) you can identify all the mobs around you even if the are of the same type (an orc pawn). I have looked at the C code but at the moment I cant find the solution, the alert source is changed a lot from the version before the plaz (you are GREAT, man) change. Anyway, before the change this was the code I used:
Code: Select all
Sub SKMez
/declare locv1 local
/declare locv2 local
/if @Debug==1 /echo Status: sub SKMez
/varset Mezzing 0
/varset locv2 1
/alert clear 1
/delay 3
/varset mezid(0,1) " "
/varset mezid(0,2) " "
/varset mezid(0,3) " "
/varset mezid(0,4) " "
/varset mezid(0,5) " "
/varset mezid(0,6) " "
/varset mezid(1,1) 0
/varset mezid(1,2) 0
/varset mezid(1,3) 0
/varset mezid(1,4) 0
/varset mezid(1,5) 0
/varset mezid(1,6) 0
/varset mezid(2,1) 0
/varset mezid(2,2) 0
/varset mezid(2,3) 0
/varset mezid(2,4) 0
/varset mezid(2,5) 0
/varset mezid(2,6) 0
/if n @myradius==0 /varset myradius 100
/if $target(id)==$char(id) /press esc
/if $target()==TRUE {
/if $target(class)=="Merchant" /goto :ExitTgLoop
/if $target(type)=="PC" /goto :ExitTgLoop
/if $target(type)=="Corpse" /goto :ExitTgLoop
/varset locv2 2
/varset mezid(2,1) $target(level)
/varset mezid(1,1) $target(id)
/varset mezid(0,1) "$target(name,clean)"
/alert add 1 npc "@mezid(0,1)"
/delay 3
:ExitTgLoop
}
/for locv1 @locv2 to 6
/press esc
/delay 3
/if $alert(1)==FALSE {
/if n @myzradius==0 {
/target npc radius @myradius
} else {
/target npc zradius @myzradius radius @myradius
}
} else {
/if n @myzradius==0 {
/target npc noalert 1 radius @myradius
} else {
/target npc noalert 1 zradius @myzradius radius @myradius
}
}
/delay 3
/if @Debug==1 /echo Status: sub SKMez $target(class) $target(type) @myzradius @myradius
/if $target()==FALSE /goto :ExitSKMez
/if $target(class)=="Merchant" {
/if @Debug==1 /echo Status: sub SKMez "Merchant"
/alert add 1 npc "$target(name,clean)"
/varcalc locv1 @locv1-1
/goto :NextMez
}
/if $target(type)=="PC" {
/if @Debug==1 /echo Status: sub SKMez "PC"
/alert add 1 npc "$target(name,clean)"
/varcalc locv1 @locv1-1
/goto :NextMez
}
/if $target(type)=="Corpse" {
/if @Debug==1 /echo Status: sub SKMez "Corpse"
/alert add 1 npc "$target(name,clean)"
/varcalc locv1 @locv1-1
/goto :NextMez
}
/if n $target(hp,pct)>=1 {
/if @Debug==1 /echo Status: sub SKMez "MOB" OK
/varset mezid(2,@locv1) $target(level)
/varset mezid(1,@locv1) $target(id)
/varset mezid(0,@locv1) "$target(name,clean)"
/alert add 1 npc "@mezid(0,@locv1)"
/delay 3
} else {
/if @Debug==1 /echo Status: sub SKMez "other"
/alert add 1 npc "$target(name,clean)"
/varcalc locv1 @locv1-1
}
:NextMez
/next locv1
:ExitSKMez
/if n @mezid(1,1)!=0 {
/target id @mezid(1,1)
/delay 3
/attack on
}
/echo SKMezz with zradius @myzradius and radius @myradius
/echo xMez "@mezid(0,1)" "@mezid(0,2)" "@mezid(0,3)" "@mezid(0,4)" "@mezid(0,5)" "@mezid(0,6)"
/echo Level "@mezid(2,1)" "@mezid(2,2)" "@mezid(2,3)" "@mezid(2,4)" "@mezid(2,5)" "@mezid(2,6)"
/if @Debug==1 /echo xMez @mezid(1,1) @mezid(1,2) @mezid(1,3) @mezid(1,4) @mezid(1,5) @mezid(1,6)
/g Mezz @mezid(1,1) @mezid(1,2) @mezid(1,3) @mezid(1,4) @mezid(1,5) @mezid(1,6)
/delay 3
/return
The echo lines are for debug purpouse.
To make it short it looks around to see if the are NPC mobs (even with the same name using $target(name)) and put then in the alert list 1. Then make a /target noalert 1 with a give radius (around and up and down with zradius) and see what it gets. If is a PC or a Merchant, it stores it in the alert and to do it again. It will stop or when reached the total of six mobs (if there are more than six a fast evacuate a good think to do) or if the $target() is false. Then it pass the ids of the mobs to my group. Easy, isnt it?
As said the problem is that after the last revamp of MQ, I cant use it any more because /alert cant find the mob using the syntax an_orc_pawn00 but only with an orc pawn. I hope to repair it, but really I need some help from a more skilled C programmer.