Does getunitdata work with mob HP?

Wolfeh

New member
Messages
63
Points
0
Github
ItsWolfeh
Emulator
I've been mulling over this script for a while now and can't get this section of it to work:

getunitdata($@mobgid,UDT_HP,.@hp);
if (.@hp > 3000000 && .@hp < 4900000)
donpcevent("#testing::OnStart1");
else if (.@hp > 10000 && .@hp < 2500001)
donpcevent("#testing::OnStart2");


If I comment out the HP check lines, it works 100% fine. I've tried UDT_HP and UDT_MAXHP, this script also uses setunitdata which has been working just fine with the mob's HP (same variable and everything, it is used before this part of the script). I've also tried: .@hp = getunitdata($@mobgid,UDT_HP);, as well as skipping the variable and just using UDT_HP, and that didn't work either.

 
Managed to get it working today, pretty sure I wrote it like this before (maybe I just thought I did) but it decided to work.

gmcas,40,47,3 script HP Checker 1_M_04,{
.@mobGID = areamonster("gmcas",44,36,50,40,"Poring",PORING,1);
.@hp = getunitdata(.@mobGID,UDT_HP);
mes "[HP Checker]";
mes "This mob has "+.@hp+" HP.";
close;
}




Edit: Also realized in my original script that I was misreading it, and the mob simply wasn't "true" for the check.

facepalm-headdesk.jpg


 
Last edited by a moderator:
Back
Top