Jump to content
  • 0

Spawn monsters with despawn time


nakano15

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

I'm making a change to one of my npcs, where bandits (basically monsters) can spawn to try killing the player,

but to not bother other players by keeping them spawned for so long, I'm wanting to make so the bandits

have a despawn time, so after that time, they disappear for good from the map.

How can I do that?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

4 hours ago, nakano15 said:

I believe adding a timer to each mob is the best solution, since using kill monster on the map can end up killing bandits that spawned for other players too.

But how do I make a timer for a monster?

You can try the summon command just be sure to run it from an npc that isn't attached to the player.

*summon "monster name",<monster id>{,<Time Out>{,"event label"}};

 

Some other methods...

.mob_id = monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
unitkill .mob_id;
stopnpctimer;
end;

 

You could do the same thing as above but with killmonster instead.

monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"NPC::OnBlahbanditded",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
killmonster "<map name>","NPC::OnBlahbanditded";
stopnpctimer;
end;

OnBlahbanditded:
end;

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

You can either add a timer to each mob or you can do a simple killmonster on the map. I guess it depends on the map..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

On 1/10/2017 at 3:27 AM, Akkarin said:

You can either add a timer to each mob or you can do a simple killmonster on the map. I guess it depends on the map..

I believe adding a timer to each mob is the best solution, since using kill monster on the map can end up killing bandits that spawned for other players too.

But how do I make a timer for a monster?

 

On 1/10/2017 at 8:16 AM, Skorm said:

You can try the summon command just be sure to run it from an npc that isn't attached to the player.


*summon "monster name",<monster id>{,<Time Out>{,"event label"}};

 

Some other methods...


.mob_id = monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
unitkill .mob_id;
stopnpctimer;
end;

 

You could do the same thing as above but with killmonster instead.


monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"NPC::OnBlahbanditded",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
killmonster "<map name>","NPC::OnBlahbanditded";
stopnpctimer;
end;

OnBlahbanditded:
end;

 

Ah, so there is how one does that.

Thank you, but I believe I will have to attach the timer on the player instead, this will be helpful anyway.

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