Jump to content
  • 0

not attack mobs


Question

6 answers to this question

Recommended Posts

Posted

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
Posted

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
Posted

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?
Posted

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

Posted

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

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