setunitdata()

redhotzip

New member
Messages
7
Points
0
Hey guys, I just want to know if we support this script command? I spent 3hrs already working on it to no avail. The getunitdata works fine. I also tried AnnieRuRu's plugin and I guess it's obsolete.

If anyone can enlighten me about this I greatly appreciate it.

 
setunitdata() was added in April 2017, so if you have a recent version of Hercules you should already have it. You can find the documentation in doc/script_commands.txt

 
@meko Yes I do have the most recent Hercules version. For my test server I used rAthena but decided to move to Hercules because of the support it gives for plugins. I did try it however every time I set to increase the HP of a monster it doesn't work.

Code:
prt_fild08,50,50,4	script	IncreaseHP	93,{
  
  mes "I will increase the HP of the monster that I summon";
  set .mob = monster("prt_fild08", 50, 50, "CYBORG 123", 1002, 5, "IncreaseHP::On_Summon");
  .mob;
  close();
  
On_Summon:
  setunitdata(.mob, UDT_HP, 100000);
  end;
  
  
}
 
sorry, we do not provide support for rAthena, however the following should work:

.@mob_id = monster("prontera", 150, 150, "Poring", PORING, 1);
setunitdata(.@mob_id, UDT_MAXHP, 100000);
setunitdata(.@mob_id, UDT_HP, 100000);


Also keep in mind that mob events are called upon death, not summon

 
Thanks @meko

setunitdata(.@mob_id, UDT_MAXHP, 100000);

This is what I missed. I did a few test yesterday and logically I should set the maxHP before I can give the mob additional HP lol. script_commands.txt is my bible and if anything is not commented or part of it I would just thought of it is impossible but the support you get from the forums gives that.

Thanks!

 
Back
Top