Jump to content
  • 0

setunitdata don't change the HP


Question

Posted (edited)

Hi all. For some reason the command setunitdada does not change only the HP of the monster and must change. The other status are changed, only the HP and MAXHP. What should I do so that they also be changed?

OBS¹: The other older emulator which I wore, everything worked.

OBS²:The console did not appoint any mistakes

		deletearray $@mobid[0],getarraysize($@mobid);
		monster "payon",0,0,"Bigfoot (Weakened)",1060,100,"Room of Dungeon::OnMyMobDead"; //Bigfoot
		
		for (.@i = 0; .@i < getarraysize($@mobid); .@i++) {
			setunitdata $@mobid[.@i],UMOB_LEVEL,5;
			setunitdata $@mobid[.@i],UMOB_MAXHP,100;
			setunitdata $@mobid[.@i],UMOB_HP,100;
			setunitdata $@mobid[.@i],UMOB_ATKMIN,40;
			setunitdata $@mobid[.@i],UMOB_ATKMAX,45;
			setunitdata $@mobid[.@i],UMOB_DEF,15;
			setunitdata $@mobid[.@i],UMOB_MDEF,15;
			setunitdata $@mobid[.@i],UMOB_FLEE,70;
		}

 

Edited by luizragna

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

im really sorry cant help u much :( 

Spoiler

// Spawn some Porings and save the Game ID.
    // - Keep in mind, when the 'monster' script command is used,
    // - all the spawned monster GID's are stored in an array
    // - called $@mobid[].
    monster "prontera",149,190,"Poring",1002,10;
    .GID = $@mobid[9]; // Store and modify the 10th Poring spawned to make him stronger!

    // Save the strong Poring's mob data in the @por_arr[] variable. (@por_arr[1] being level, @por_arr[13] being class, etc.)
    // With this data we can have the NPC display or manipulate it how we want. This does not have to be ran before 'setunitdata'.
    getunitdata .GID,@por_arr;

    // Set the max HP of the Poring to 1000 (current HP will also get updated to 1000).
    setunitdata .GID,UMOB_MAXHP,1000;

 

Edited by Valor
  • Upvote 1
  • 0
Posted

What git hash are you using? I once had an issue about this. The data modification is being dispelled when the mobs element changed.

but it was fixed. Check this LINK

 

If you are using a git hash higher than the fix. Try to execute this code and check if the mob data is being changed.

		.@mon_count = 3;
		monster "payon",0,0,"Bigfoot (Weakened)",1060,.@mon_count,"Room of Dungeon::OnMyMobDead"; //Bigfoot
		for (.@i = 0; .@i < .@mon_count; .@i++) {
			.@mobgid = $@mobid[.@i];
			setunitdata .@mobgid,UMOB_LEVEL,5;
			setunitdata .@mobgid,UMOB_MAXHP,100;
			setunitdata .@mobgid,UMOB_HP,100;
			setunitdata .@mobgid,UMOB_ATKMIN,40;
			setunitdata .@mobgid,UMOB_ATKMAX,45;
			setunitdata .@mobgid,UMOB_DEF,15;
			setunitdata .@mobgid,UMOB_MDEF,15;
			setunitdata .@mobgid,UMOB_FLEE,70;

			// Will check the monster current data if modified by the above script
			getunitdata .@mobgid,.@param;
			dispbottom ""+.@param[UMOB_LEVEL]+"";
			dispbottom ""+.@param[UMOB_MAXHP]+"";
			dispbottom ""+.@param[UMOB_HP]+"";
			dispbottom ""+.@param[UMOB_ATKMIN]+"";
			dispbottom ""+.@param[UMOB_ATKMAX]+"";
			dispbottom ""+.@param[UMOB_DEF]+"";
			dispbottom ""+.@param[UMOB_MDEF]+"";
			dispbottom ""+.@param[UMOB_FLEE]+"";
		}

 

  • Upvote 1
  • 0
Posted (edited)
2 hours ago, Technoken said:

What git hash are you using? I once had an issue about this. The data modification is being dispelled when the mobs element changed.

but it was fixed. Check this LINK

 

If you are using a git hash higher than the fix. Try to execute this code and check if the mob data is being changed.


		.@mon_count = 3;
		monster "payon",0,0,"Bigfoot (Weakened)",1060,.@mon_count,"Room of Dungeon::OnMyMobDead"; //Bigfoot
		for (.@i = 0; .@i < .@mon_count; .@i++) {
			.@mobgid = $@mobid[.@i];
			setunitdata .@mobgid,UMOB_LEVEL,5;
			setunitdata .@mobgid,UMOB_MAXHP,100;
			setunitdata .@mobgid,UMOB_HP,100;
			setunitdata .@mobgid,UMOB_ATKMIN,40;
			setunitdata .@mobgid,UMOB_ATKMAX,45;
			setunitdata .@mobgid,UMOB_DEF,15;
			setunitdata .@mobgid,UMOB_MDEF,15;
			setunitdata .@mobgid,UMOB_FLEE,70;

			// Will check the monster current data if modified by the above script
			getunitdata .@mobgid,.@param;
			dispbottom ""+.@param[UMOB_LEVEL]+"";
			dispbottom ""+.@param[UMOB_MAXHP]+"";
			dispbottom ""+.@param[UMOB_HP]+"";
			dispbottom ""+.@param[UMOB_ATKMIN]+"";
			dispbottom ""+.@param[UMOB_ATKMAX]+"";
			dispbottom ""+.@param[UMOB_DEF]+"";
			dispbottom ""+.@param[UMOB_MDEF]+"";
			dispbottom ""+.@param[UMOB_FLEE]+"";
		}

 

the HP error continues

Edited by luizragna
  • 0
Posted

Would be better if you tell us what kind of error.

what appears on the dispbottom? Is it the same as the modification?

please provide more info about it.

i was confused about the topic. You want only to change the hp and maxhp? Not the other stats?

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...