Jump to content
  • 0

Can an NPC lower the HP percentage to a mob?


Question

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...