Jump to content
  • 0
Wolfeh

Does getunitdata work with mob HP?

Question

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.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

Edited by Wolfeh

Share this post


Link to post
Share on other sites
  • 0

Wow came back when get/setunitdata is available? I wonder can we now directly modify mob HP at will? :o

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.