Jump to content
  • 0

not attack mobs


Jolteo

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/26/14
  • Last Seen:  

I would love to know if you can put Porings in a custom map and not allow players to attack these Porings !!! Thank you

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

You can check if a cell is walkable or not and then let the npc walk to it or use a new random coordination.

checkcell("<map name>",<x>,<y>,<type>);
This command will return 1 or 0, depending on whether the specified cell has the 'type' flag set or not. There are various types to check, all mimicking the server's cell_chk enumeration. The types can be found in db/const.txt.

 

source: Checkcell

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   27
  • Joined:  12/05/13
  • Last Seen:  

Not sure if you can make monsters unkillable, but you can disguise an NPC as a monster by using the mob's ID as the NPC's sprite ID. Then, you can use the script command npcwalkto to make the NPC walk.

 

Here's a working sample:

jupe_ele,42,47,4    script    Poring#1    1002,{
OnInit:
    initnpctimer;
    
OnTimer5000:    
    getmapxy( .map$, .x, .y, 1, strnpcinfo(0) );
    set .x, .x+ rand(1,7) - rand(1,13);
    set .y, .y+  rand(1,7) - rand(1,13);
    npcwalkto .x, .y;
    initnpctimer;

}

You can then just duplicate it as many as you like. You should also take note that the NPC may not always be able to move every 5 seconds since the random coordinates may be unwalkabe.

 

(To be honest, I don't know if this is the best idea.)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/26/14
  • Last Seen:  

Not sure if you can make monsters unkillable, but you can disguise an NPC as a monster by using the mob's ID as the NPC's sprite ID. Then, you can use the script command npcwalkto to make the NPC walk.

 

Here's a working sample:

jupe_ele,42,47,4    script    Poring#1    1002,{
OnInit:
    initnpctimer;
    
OnTimer5000:    
    getmapxy( .map$, .x, .y, 1, strnpcinfo(0) );
    set .x, .x+ rand(1,7) - rand(1,13);
    set .y, .y+  rand(1,7) - rand(1,13);
    npcwalkto .x, .y;
    initnpctimer;

}

You can then just duplicate it as many as you like. You should also take note that the NPC may not always be able to move every 5 seconds since the random coordinates may be unwalkabe.

 

(To be honest, I don't know if this is the best idea.)

 

okay, it's a great option. Won a liked by posting a mode.
 
Will be someone who has more an alternative to the issue at hand?
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

With the mob control source mod have a option to make the mob untouchable

Edited by Zell
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/26/14
  • Last Seen:  

With the mob control source mod have a option to make the mob untouchable

 

Hello friend! Could you tell me the exact place please? I do not know much about src if you could show me I would be grateful and also already learn more ... I await your response

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  02/26/14
  • Last Seen:  

You can check if a cell is walkable or not and then let the npc walk to it or use a new random coordination.

checkcell("<map name>",<x>,<y>,<type>);
This command will return 1 or 0, depending on whether the specified cell has the 'type' flag set or not. There are various types to check, all mimicking the server's cell_chk enumeration. The types can be found in db/const.txt.

 

source: Checkcell

 

 

Very good. Solved

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