Jump to content
  • 0

Can an NPC lower the HP percentage to a mob?


alelelo

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  37
  • Reputation:   0
  • Joined:  02/03/17
  • Last Seen:  

This is the question...

Can an NPC lower the HP percentage to a mob?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  255
  • Reputation:   232
  • Joined:  07/24/13
  • Last Seen:  

1 hour ago, alelelo said:

This is the question...

Can an NPC lower the HP percentage to a mob?

Yes, you can controll mob params from npc.
For example HP controller.

prontera,160,190,4	script	Mob_HP_controller	4_EP16_GRANZ,{ 
	switch(select("Create monster","Change monster HP(%)")){
	case 1:
		mes "Monster created.";
		close2;
		monster "prontera",160,185,"--ja--",1100,1,"Mob_HP_controller::OnMobControll";
		.monsterid = $@mobid[0];
		end;
	case 2:
		getunitdata .monsterid, .@data;
		mes "Current mob HP: ["+.@data[UMOB_HP]+"/"+.@data[UMOB_MAXHP]+"]";
		input .@hp;
		next;
		mes "Monster HP changed.";
		.@hp_per = .@data[UMOB_MAXHP] / 100 * .@hp;
		setunitdata .monsterid, UMOB_HP, .@hp_per;
		close;
	}
}

You can read more about mob params in script_commands > setunitdata <GID>,<parameter>,<new value>;

Edited by Balfear
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  37
  • Reputation:   0
  • Joined:  02/03/17
  • Last Seen:  

Thanks!!!

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...