Jump to content
  • 0
Sign in to follow this  
xienne15

unitattack clarification...

Question

*unitattack <GID>,<Target ID>{,<action type>};*unitattack <GID>,"<Target Name>"{,<action type>};

 

does this mean i can make npc attack monsters? if it is can you give me a sample script?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

GID stands for Game ID. Every in-game object has a Game ID. For players it's the same than their RID, which is also their Account ID. For mobs, it's quite more complicated since here in Hercules the Mob Control suite isn't available.

 

You could use the monster command, spawning 1 only monster and setting what it returns to a variable and then using the unit* commands with it. Refer to some part of doc/script_commands.txt in the monster/areamonster documentation:

 

Both 'monster' and 'areamonster' return the GID of the monster
spawned if there was ONLY ONE monster to be spawned. This is useful for
controlling each of the spawned mobs with the unit* commands shown below.
For example:

 // We'll make a poring which will automatically attack invoking player:
 set .@mobGID, monster "Prontera",150,150,"Poring",1002,1;
 unitattack .@mobGID, getcharid(3); // Attacker GID, attacked GID

The way you can get the GID of more than only one monster is looping
through all the summons to get their individual GIDs and do whatever you
want with them. For example:

 // We want to summon .mobnumber porings which will give us a kiss
 for (set .@i, 0; .@i < .mobnumber; set .@i, .@i + 1){
   set .@mobGID, monster "map",.x,.y,"Kisser Poring",1002,1;
   unitemote .@mobGID, e_kis;
 }

Refer to the unit* commands below in this document.

 

unit* commands are just a leftover of the mob control suite that was custom built long long ago in the eAthena era and then was removed. The unit* commands just give a quite basic control which isn't just enough for much purposes).

Share this post


Link to post
Share on other sites
  • 0

I don't think an npc attacking or using actual skills (not just effects) will get a nice behavior in the emulator. I bet you can make it but you'll probably get a server crash or a huge warning, since npcs don't have any atk value.

 

What you can do with it is maybe making a monster attack another monster provided you have their GIDs. Or a player attacking some other thing without actually ordering his player character himself.

 

But as said, I don't think making a npc attacking or being attacked is a big idea.

Share this post


Link to post
Share on other sites
  • 0

I don't think an npc attacking or using actual skills (not just effects) will get a nice behavior in the emulator. I bet you can make it but you'll probably get a server crash or a huge warning, since npcs don't have any atk value.

 

What you can do with it is maybe making a monster attack another monster provided you have their GIDs. Or a player attacking some other thing without actually ordering his player character himself.

 

But as said, I don't think making a npc attacking or being attacked is a big idea.

how if i use a monster ID as a NPC ID?

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.