Jump to content
  • 0

Please, read.


Legato

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

Hey, everyone. I've got some newbie questions and hoping to get some accurate answers since I don't know what to search for this concern.(Tried reading some script commands but didn't quite understand most of it. So, please bear with me.)

Right, here goes. Please, click the spoiler.

1. Is there a way to check the total numbers of a specific monster on a map? Like for example, I want to check the amount of porings on prt_fild08, if it's <= 20, npc will automatically spawns 20 more porings on that map.

2. (A)Scenario : Player talks to the NPC, then NPC ask the player if he/she wants to do the quest. Player agrees, quest starts after the conversation, then he/she will fail the quest if logs off, dies on the same map(or just die). How can I make that happen? Someone, please post an example. If some of the codes needs an explanation, please do so. I'd really be grateful.

2. (B)Scenario : Player talks to the NPC, then NPC ask the player if he/she wants to do the quest. Player agrees, quest starts after the conversation, but won't fail unless he gave up. How can I make that happen? Someone, please post an example. If some of the codes needs an explanation, please do so. I'd really be grateful.

3. Scenario : Player talks to the NPC to do some quest, NPC ask the player to collect some items, player returns to NPC but didn't bring all the items. NPC got pissed and don't want to talk to that player for an hour. How can I make that happen? Someone, please post an example. If some of the codes needs an explanation, please do so. I'd really be grateful.

I found this while searching the old forum but I am a bit confused.

Pardon me, it's 12:36AM. @_@

Any kind of help would be greatly appreciated.

- Legato

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

  1. You can count number of monsters on a map, but only if they have a "script label" attached. You can also count all (all IDs) regular monsters on a map.
    mobcount("<map name>","<event label>")
    This function will count all the monsters on the specified map that have a given
    event label and return the number or 0 if it can't find any. Naturally, only
    monsters spawned with 'monster' and 'areamonster' script commands can be like
    this.
    However, apparently, if you pass this function an empty string for the event
    label, it should return the total count of normal permanently respawning
    monsters instead. With the current dynamic mobs system, where mobs are not kept
    in memory for maps with no actual people playing on them, this will return a 0
    for any such map.

  2. To run a script when player logs off, use OnPCLogout event label. To run a script when player dies, use OnPCDead event label.
    OnPCLoginEvent:
    OnPCLogoutEvent:
    OnPCBaseLvUpEvent:
    OnPCJobLvUpEvent:
    It's pretty obvious when these four special labels will be invoked. For more
    information, see 'doc/sample/PCLoginEvent.txt'
    OnPCDieEvent:
    This special label triggers when a player dies. The variable 'killerrid' is
    set to the ID of the killer.

  3. You don't really need to make anything special here. Most quests work like this. Please note, that there is no way to give up quest in quest window. So probably, player would have to talk to the NPC to give up the quest.

  4. Use gettimetick(2) script command.

No examples, sorry. There are some in doc/script_commands.txt and doc/sample/.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

For other examples you can search for all the files in npc folder that contains that script command.

They may not be (over)documented though.

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