Jump to content
  • 0

[R] Instance Script Commands


Pneuma

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

I would like to make my own instance one day here soon however I'm not sure how to go about doing it. So my request is any scripting commands I may need and maybe a guide for the Instance creation such as party limiting, time limit before can re-enter, how many times you can do the instance.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Chapter 7 of script_commands.txt


========================
|7.- Instance commands.|
========================
---------------------------------------

*instance_create("<instance name>");

Creates an instance for the party of the attached player. The instance name,
along with all other instance data, is read from 'db/(pre-)re/instance_db.txt'.
Upon success, the command generates a unique instance ID, duplicates all listed
maps and NPCs, sets the alive time, and triggers the "OnInstanceInit" label in
all NPCs inside the instance.

The command returns the instance ID upon success, and these values upon failure:
 -1: Invalid type.
 -2: Party not found.
 -3: Instance already exists.
 -4: No free instances (MAX_INSTANCE exceeded).

---------------------------------------

*instance_destroy {<instance id>};

Destroys instance with the ID <instance id>. If no ID is specified, the instance
the script is attached to is used. If the script is not attached to an instance,
the instance of the currently attached player's party is used. If that fails,
the script will come to a halt.

---------------------------------------

*instance_enter("<instance name>");

Warps player to the specified instance after the script terminates. The map and
coordinates are located in 'db/(pre-)re/instance_db.txt'.

The command returns 0 upon success, and these values upon failure:
 1: Party not found.
 2: Party does not have an instance.
 3: Other errors (invalid instance name, instance doesn't match with party).

---------------------------------------

*instance_npcname("<npc name>"{,<instance id>})

Returns the unique name of the instanced script. If no ID is specified,
the instance the script is attached to is used. If the script is not attached to
an instance, the instance of the currently attached player's party is used. If
that fails, the script will come to a halt.

---------------------------------------

*instance_mapname("<map name>"{,<instance id>})

Returns the unique name of the instanced map. If no instance ID is specified,
the instance the script is attached to is used. If the script is not attached to
an instance, the instance of the currently attached player's party is used. If
that fails, the command returns an empty string instead.

---------------------------------------

*instance_id()

Returns the unique instance id of the attached script. If the script is not
attached to an instance, the instance of the currently attached player's party is
used. If that fails, the function will return 0.

---------------------------------------

*instance_warpall "<map name>",<x>,<y>{,<instance id>};

Warps all players in the instance <instance id> to <map name> at given
coordinates. If no ID is specified, the instance the script is attached to
is used. If the script is not attached to an instance, the instance of the
currently attached player's party is used. If that fails, the script will
come to a halt.

---------------------------------------

*instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};

Broadcasts a message to all players in the instance <instance id> currently
residing on an instance map. If -1 is specified for <instance id>, the instance
the script is attached to is used. If the script is not attached to an instance,
the instance of the currently attached player's party is used.

For details on the other parameters, see 'announce'.

---------------------------------------

*instance_check_party(<party id>{,<amount>{,<min>{,<max>}}})

This function checks if a party meets certain requirements, returning 1 if all
conditions are met and 0 otherwise. It will only check online characters.

amount - number of online party members (default is 1).
min    - minimum level of all characters in the party (default is 1).
max    - maximum level of all characters in the party (default is max level in conf).

Example:

if (instance_check_party(getcharid(1),2,2,149)) {
    mes "Your party meets the Memorial Dungeon requirements.",
    mes "All online members are between levels 1-150 and at least two are online.";
    close;
} else {
    mes "Sorry, your party does not meet requirements.";
    close;
}

 

For the NPC sample, check out Endless Tower quest.

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