Jump to content
  • 0

Unit____ script commands not working as expected?


Satoh

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  06/24/12
  • Last Seen:  

Ok, so I tried this out, thinking it might be the answer to what I was trying to do.

prontera,150,175,6	script	UnitCT	55,{
.@GID = monster ("this",150,160,"testo",1002,1);
unitwalk .@GID,150,150;
sleep 10000;
unitkill .@GID;
end;
}

What works:

  • The NPC UnitCT gets loaded.
  • When clicked a poring named 'testo' gets created.
  • .@GID gets set to the ID of the new poring.

What doesn't:

  • The poring mob wanders aimlessly instead of going to the assigned coordinates
  • The poring does not die after 10 seconds.

If I modify the script to use  .@GID = getnpcid(0); It still does not act upon the NPC or the poring.

If I modify the script to use  .@GID = getcharid(3); the invoking PC walks about 10 steps, waits a few seconds, and dies.

 

I understand why the character only waits a few seconds instead of exactly ten. The sleep counter starts as soon as the player begins walking, and it takes less than ten seconds to reach the destination, the remainder then expends and the player dies.

 

What I don't understand is why these commands don't work on Mobs or NPCs when even the rAthena wiki implies they should.

 

Can anyone tell me what's up?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  


prontera,150,175,6 script UnitCT 55,{

monster ("this",150,160,"testo",1002,1);

.@GID = $@mobid[0];

unitwalk .@GID,150,150;

sleep2 10000;

unitkill .@GID;

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  06/24/12
  • Last Seen:  

prontera,150,175,6	script	UnitCT	55,{
	monster ("this",150,160,"testo",1002,1);
	.@GID = $@mobid[0];
	unitwalk .@GID,150,150;
	sleep2 10000;
	unitkill .@GID;
	end;
}

 

Thank you for your response.

I tried that code just now, and it does not change the issue I'm having. I still cannot control anything other than player characters.

 

 

EDIT: Server bricked during revision upgrade. Moot point now.

Edited by Satoh
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...