Browse Source

* Added documentation for the instance system rewrite and modified some return values. (follow-up r17386)
* Gathered remaining dialogues for Pyramids Nightmare script. (follow-up r17382)
* Added missing items to "Guardian of Power" NPC from Mora Enchants.
* Updated Hunting Missions script to v1.3a, which adds some mission reset options.
* Added newline at end of files.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17387 54d463be-8e91-2dee-dedb-b68131a5f0ec

euphyy 12 years ago
parent
commit
78eb7d3793

+ 1 - 1
db/pre-re/instance_db.txt

@@ -6,4 +6,4 @@
 0,Endless Tower,14400,1@tower,50,355,1@tower,2@tower,3@tower,4@tower,5@tower,6@tower
 1,Sealed Catacomb,7200,1@cata,100,224,1@cata,2@cata
 2,Orc's Memory,3600,1@orcs,179,15,1@orcs,2@orcs
-3,Nidhoggur's Nest,14400,1@nyd,32,36,1@nyd,2@nyd
+3,Nidhoggur's Nest,14400,1@nyd,32,36,1@nyd,2@nyd

+ 1 - 1
db/re/instance_db.txt

@@ -14,4 +14,4 @@
 8,Buwaya Cave,3600,1@ma_c,31,56,1@ma_c
 9,Bakonawa Lake,7200,1@ma_b,77,52,1@ma_b
 //10,Wolfchev's Laboratory,14400,1@lhz,45,148,1@lhz
-//11,Old Glast Heim,3600,1@gl_k,150,20,1@gl_k,2@gl_k
+//11,Old Glast Heim,3600,1@gl_k,150,20,1@gl_k,2@gl_k

+ 3 - 1
doc/atcommands.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= rAthena Dev Team
 //===== Current Version: =====================================
-//= 20130614
+//= 20130626
 //===== Description: =========================================
 //= List of available atcommands and their functions.
 //============================================================
@@ -1167,6 +1167,7 @@ This will also send a packet to clients causing them to close.
 @reload <type>
 @reloadatcommand
 @reloadbattleconf
+@reloadinstancedb
 @reloaditemdb
 @reloadmobdb
 @reloadmotd
@@ -1181,6 +1182,7 @@ This will also send a packet to clients causing them to close.
 Reloads a database or configuration file.
 
 Databases:
+-- instancedb: Instance Database
 -- itemdb: Item Database
 -- mobdb: Monster Database
 -- packetdb: Packet Database

+ 34 - 101
doc/script_commands.txt

@@ -7284,33 +7284,19 @@ This will open a book item at the specified page
 ========================
 ---------------------------------------
 
-*instance_create("<instance name>",<party id>);
+*instance_create("<instance name>");
 
-Create an instance using the name "<instance name>" for the Party of <party id>.
-Most instance_* commands are used in conjunction with this command and depend
-on the ID this command returns.
+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.
 
-Example:
-	// Store the Party ID of the invoking character.
-	set .@party_id, getcharid(1);
-
-	// Attempt to create an instance using that party ID.
-	set .@id, instance_create("Endless Tower", .@party_id);
-	if (.@id == -1) { // Invalid type - not used anymore
-		...
-	}
-	else if (.@id == -2) { // Invalid Party ID
-		...
-	}
-	else if (.@id == -3) { // No free instances (MAX_INSTANCE exceeded)
-		...
-	}
-	else if (.@id == -4) { // Already exists
-		...
-	}
-	else (.@id < 0) { // Unspecified error while queuing 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).
 
 ---------------------------------------
 
@@ -7318,83 +7304,46 @@ Example:
 
 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 no player is
-currently attached, the command fails and causes the script to halt.
-
----------------------------------------
-
-*instance_attachmap("<map name>",<instance id>{,<use base name>});
-
-Attaches the map "<map name>" to the instance specified with <instance id>. The
-optional parameter specifies, whether a map requires emulation for instancing (1)
-or not (0 = default).
-
-Returns the resulting map name on success or an empty string on failure.
-
----------------------------------------
-
-*instance_detachmap "<map name>"{,<instance id>};
-
-Detach the map "<map name>" to the instance with the <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 no player is currently attached, the command fails and causes the script
-to halt.
+the instance of the currently attached player's party is used. If that fails,
+the script will come to a halt.
 
 ---------------------------------------
 
-*instance_init <instance id>;
-
-Initializes the instance given by <instance id>. This copies all NPCs from the
-source maps to the instanced maps.
-
----------------------------------------
-
-*instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};
-
-Works like announce, but has the <instance id> parameter. If instance id is 0, 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 no
-player is currently attached, the command fails and causes the script to halt.
-
----------------------------------------
+*instance_enter("<instance name>");
 
-*instance_attach <instance id>;
+Warps player to the specified instance after the script terminates. The map and
+coordinates are located in 'db/(pre-)re/instance_db.txt'.
 
-Attaches the current script to the instance given by <instance id>.
+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>});
 
-Retrieves the unique name given to a copy of an NPC given by "<npc name>" in an
-instance specified <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 no player is
-currently attached, the command fails and causes the script to halt.
+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.
 
 ---------------------------------------
 
-*has_instance("<map name>"{,<instance id>});
-
-Checks whether or not the given map belongs to specified instance. 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 no player is currently attached, the command fails and causes the
-script to halt.
+*instance_mapname("<map name>"{,<instance id>});
 
-Returns the name of the instanced map on success, otherwise an empty string.
+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({<type>});
 
-Retrieves the instance id, depending on <type>. If type is not given, it defaults
-to 0.
-
-Type:
-    0 - Instance ID the script is attached to.
-    1 - Instance ID of the currently attached player's party.
+Returns the unique instance id depending on <type>:
+ 0: Instance ID of the attached script (default).
+ 1: Instance ID of the currently attached player's party.
 
 ---------------------------------------
 
@@ -7403,24 +7352,8 @@ Type:
 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 no player is currently attached,
-the command fails and causes the script to halt.
-
----------------------------------------
-
-*instance_set_timeout <alive timeout>,<idle timeout>{,<instance id>};
-
-Sets the timeout values for an instance given by <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 no player is currently attached, the command fails and causes
-the script to halt.
-
-Parameter <alive timeout> specifies the total amount of time the instance will
-exist. Parameter <idle timeout> specifies how long players have, when they are
-outside of the instance, until it is destroyed.
-
-Both timeout values are in seconds.
+currently attached player's party is used. If that fails, the script will
+come to a halt.
 
 ---------------------------------------
 

+ 26 - 4
npc/custom/quests/hunting_missions.txt

@@ -3,12 +3,19 @@
 //===== By: ==================================================
 //= Euphy
 //===== Current Version: =====================================
-//= 1.3
+//= 1.3a
 //===== Compatible With: ===================================== 
 //= rAthena SVN
 //===== Description: =========================================
 //= Random hunting missions.
 //= Rewards are based on quest difficulty.
+//===== Additional Comments: =================================
+//= 1.0 Initial script.
+//= 1.1 Small improvements and fixes.
+//= 1.2 Added party support and replaced blacklists with an
+//=     SQL query, both thanks to AnnieRuru.
+//= 1.3 Re-added a blacklist adapted for the SQL query.
+//= 1.3a Added mission reset options.
 //============================================================
 
 prontera,152,187,6	script	Hunting Missions	951,{
@@ -72,10 +79,24 @@ function Chk; function Cm;
 		mes "[Hunting Missions]";
 		mes "Do you really want to";
 		mes "abandon your mission?";
-		if (.Delay) mes "Your delay time will not be reset.";
+		if (.Reset < 0 && .Delay)
+			mes "Your delay time will not be reset.";
+		else if (.Reset > 0)
+			mes "It will cost "+Cm(.Reset)+" Zeny.";
 		next;
 		switch(select(" ~ Abandon...: ~ ^777777Cancel^000000")) {
 		case 1:
+			if (.Reset > 0) {
+				if (Zeny < .Reset) {
+					mes "[Hunting Missions]";
+					mes "You don't have enough";
+					mes "Zeny to drop this mission.";
+					emotion e_sry;
+					close;
+				}
+				set Zeny, Zeny-.Reset;
+				emotion e_cash;
+			}
 			mes "[Hunting Missions]";
 			mes "Alright, I've dropped";
 			mes "your current mission.";
@@ -85,7 +106,7 @@ function Chk; function Cm;
 				setd "Mission"+.@i+"_",0;
 			}
 			set #Mission_Count,0;
-			if (.Delay) set #Mission_Delay, gettimetick(2)+(.Delay*3600);
+			if (.Reset < 0 && .Delay) set #Mission_Delay, gettimetick(2)+(.Delay*3600);
 			close;
 		case 2:
 			mes "[Hunting Missions]";
@@ -262,6 +283,7 @@ OnInit:
 	set .Delay,12;		// Quest delay, in hours (0 to disable).
 	set .Quests,4;		// Number of subquests per mission (increases rewards).
 	set .Party,3;		// Party options: 0 (exclude party kills), 1 (include party kills), 2 (same map only), 3 (screen area only)
+	set .Reset,-1;		// Reset options: -1 (abandoning mission sets delay time), 0 (no delay time), [Zeny] (cost to abandon mission, no delay time)
 	setarray .Count[0],	// Min and max monsters per subquest (increases rewards).
 		40,70;
 	setarray .Modifier[0],	// Multipliers for Base Exp, Job Exp, and Zeny rewards.
@@ -280,4 +302,4 @@ OnInit:
 		npcshopadditem "mission_shop", .Shop[.@i], .Shop[.@i+1];
 	end;
 }
--	shop	mission_shop	-1,512:-1
+-	shop	mission_shop	-1,512:-1

+ 1 - 1
npc/instances/EndlessTower.txt

@@ -2210,4 +2210,4 @@ OnTimer1000:
 	stopnpctimer;
 	donpcevent instance_npcname("#Effect30")+"::OnEnable";
 	end;
-}
+}

+ 5 - 2
npc/instances/NydhoggsNest.txt

@@ -1659,6 +1659,10 @@ OnTouch:
 		close;
 	}
 	end;
+
+OnInstanceInit: // Temporary fix for @reloadscript.
+	set 'ins_nyd2,0;
+	end;
 }
 
 1@nyd,1,1,0	script	nyd_call_mon_1	-1,{
@@ -2147,7 +2151,6 @@ OnTouch:
 
 2@nyd,1,1,0	script	ins_nyd2_spawn_mobs	-1,{
 OnInstanceInit:
-	set 'ins_nyd2, 0;
 	set .@map$, instance_mapname("2@nyd");
 	areamonster .@map$,200,92,180,80,"Rhyncho",2020,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyRhynDead";
 	areamonster .@map$,200,92,180,80,"Phylla",2021,40,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPhyDead";
@@ -2170,4 +2173,4 @@ OnMyDarkshaDead:
 OnMyPingDead:
 	areamonster instance_mapname("2@nyd"),200,92,180,80,"Dark Pinguicula",2015,1,instance_npcname("ins_nyd2_spawn_mobs")+"::OnMyPingDead";
 	end;
-}
+}

+ 1 - 1
npc/instances/OrcsMemory.txt

@@ -921,4 +921,4 @@ OnMyMobDead2:
 OnMyMobDead3:
 	donpcevent instance_npcname("#Warp2-3")+"::OnContinue";
 	end;
-}
+}

+ 5 - 2
npc/instances/SealedShrine.txt

@@ -575,6 +575,10 @@ OnTouch:
 		close;
 	}
 	end;
+
+OnInstanceInit: // Temporary fix for @reloadscript.
+	set 'ins_baphomet,0;
+	end;
 }
 
 1@cata,176,119,4	script	Ancient Hero's Soul#1F	411,{
@@ -1442,7 +1446,6 @@ OnTimer70000:
 
 1@cata,1,1,0	script	ins_1f_spawn_mobs	-1,{
 OnInstanceInit:
-	set 'ins_baphomet, 0;
 	set .@map$, instance_mapname("1@cata");
 	monster .@map$,0,0,"Zombie Master",1298,10;
 	monster .@map$,0,0,"Wraith Dead",1291,10;
@@ -1477,4 +1480,4 @@ OnInstanceInit:
 	monster .@map$,0,0,"Dark Illusion",1302,1;
 	disablenpc instance_npcname("ins_1f_spawn_mobs");
 	end;
-}
+}

+ 1 - 1
npc/re/instances/HazyForest.txt

@@ -1161,4 +1161,4 @@ OnInstanceInit:
 1@mist,95,287,0	warp	c1_c13-1	1,1,1@mist,323,276	//Tito
 1@mist,324,325,0	warp	c13-3_c4	1,1,1@mist,49,316	//Pumba
 1@mist,280,344,0	warp	c19_c4	1,1,1@mist,49,316	//Tete
-1@mist,345,186,0	warp	#to_bif02	1,1,bif_fild02,151,121	//The Gardeners' Tree
+1@mist,345,186,0	warp	#to_bif02	1,1,bif_fild02,151,121	//The Gardeners' Tree

+ 1 - 1
npc/re/instances/MalangdoCulvert.txt

@@ -1041,4 +1041,4 @@ OnTouch:
 2@pump,38,100,0	duplicate(Culvert Entrance#n)	Culvert Entrance#h	45,3,3
 
 //MD_Putmob "2@pump" 0 0 0 0 20 HYDRA 0 0 2
-2@pump,1,1,4	duplicate(Hydra#n)	Hydra#h	-1
+2@pump,1,1,4	duplicate(Hydra#n)	Hydra#h	-1

+ 1 - 1
npc/re/instances/OctopusCave.txt

@@ -706,4 +706,4 @@ OnTouch:
 1@cash,209,100,0	warp	oct_door5	2,2,1@cash,250,111
 1@cash,244,118,0	warp	oct_door6	2,2,1@cash,199,100
 1@cash,209,83,0	warp	oct_door7	2,2,1@cash,252,46
-1@cash,246,53,0	warp	oct_door8	2,2,1@cash,203,83
+1@cash,246,53,0	warp	oct_door8	2,2,1@cash,203,83

+ 10 - 8
npc/re/merchants/enchan_mora.txt

@@ -3,7 +3,7 @@
 //===== By: ================================================== 
 //= Euphy
 //===== Current Version: ===================================== 
-//= 1.1a
+//= 1.1b
 //===== Compatible With: ===================================== 
 //= rAthena SVN
 //===== Description: ========================================= 
@@ -14,6 +14,7 @@
 //= 1.0 First Version. [Euphy]
 //= 1.1 Optimized. [Euphy]
 //= 1.1a Bug fixes. [Lemongrass]
+//= 1.1b Added missing items to Guardian of Power. [Euphy]
 //============================================================ 
 
 // Arch Bishop Enchants :: coin_arc
@@ -560,20 +561,21 @@ mora,152,97,5	script	Guardian of Power#pa082	515,{
 		close;
 	}
 	mes "[Guardian of Power]";
-	mes .@jobs$[.@job]+"~ which artifact do you want?";
+	mes .@jobs$[.@job]+"?";
+	mes "Which artifact do you want?";
 	next;
 	switch(.@job) {
 	case 0: // Rune Knight
-		setarray .@items[0],2475,2476,2574,2575;
-		set .@i, select("Cancel:Ur's Greaves (Shoes):Peuz Greaves (Shoes):Ur's Manteau (Garment):Peuz Manteau (Garment)")-2;
+		setarray .@items[0],2475,2476,2574,2575,15036,15037,2883,2884;
+		set .@i, select("Cancel:Ur's Greaves (Shoes):Peuz's Greaves (Shoes):Ur's Manteau (Garment):Peuz's Manteau (Garment):Ur's Plate (Armor):Peuz Plate (Armor):Ur's Seal (Accessory):Peuz's Seal (Accessory)")-2;
 		break;
 	case 1: // Guillotine Cross
-		setarray .@items[0],2477,2478,2577,2578;
-		set .@i, select("Cancel:Sapha Shoes (Shoes):Nab Shoes (Shoes):Sapha Hood (Garment):Nab Hood (Garment)")-2;
+		setarray .@items[0],2477,2478,2577,2578,15038,15039,2886,2887;
+		set .@i, select("Cancel:Sapha Shoes (Shoes):Nab Shoes (Shoes):Sapha Hood (Garment):Nab Hood (Garment):Sapha's Cloth (Armor):Nab's Cloth (Armor):Sapha Ring (Accessory):Nab Ring (Accessory)")-2;
 		break;
 	case 2: // Ranger
-		setarray .@items[0],2479,2480,2580,2581;
-		set .@i, select("Cancel:White Wing Boots (Shoes):Black Wing Boots (Shoes):White Wing Manteau (Garment):Black Wing Manteau (Garment)")-2;
+		setarray .@items[0],2479,2480,2580,2581,15042,15043,2890,2891;
+		set .@i, select("Cancel:White Wing Boots (Shoes):Black Wing Boots (Shoes):White Wing Manteau (Garment):Black Wing Manteau (Garment):White Wing Suit (Armor):Black Wing Suit (Armor):White Wing Brooch (Accessory):Black Wing Brooch (Accessory)")-2;
 		break;
 	}
 	if (.@i == -1) {

+ 14 - 17
npc/re/quests/quests_morocc.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= Euphy
 //===== Current Version: =====================================
-//= 1.0
+//= 1.0a
 //===== Compatible With: =====================================
 //= rAthena SVN
 //===== Description: =========================================
@@ -11,6 +11,7 @@
 //= Quest NPCs related to Morroc.
 //===== Additional Comments: =================================
 //= 1.0 First Version.
+//= 1.0a Gathered remaining dialogues. [Euphy]
 //============================================================
 
 // Pyramids Nightmare Mode
@@ -124,26 +125,24 @@ moc_prydn1,94,98,3	script	Suspicious Cat#night2	547,{
 				close;
 			}
 		} else if (.@hunting == 0 || .@hunting == 1) {
-			//Custom Translation
 			mes "[Suspicious Cat]";
-			mes "Hunting Verit is going well?";
+			mes "Is Verit's training going well?";
 			next;
-			switch(select("Of course.:I quit.")) {
+			switch(select("Sure.:I want to stop.")) {
 			case 1:
 				mes "[Suspicious Cat]";
-				mes "Good. Keep it up.";
+				mes "Good. Keep up the good work!";
 				close;
 			case 2:
 				mes "[Suspicious Cat]";
-				mes "What? Irresponsible bastard!";
+				mes "What? You're so irresponsible!";
 				erasequest 2289;
 				close;
 			}
 		} else if (.@hunting == 2) {
-			//Custom Translation
 			mes "[Suspicious Cat]";
-			mes "See, this is better! Good one!";
-			mes "Think for a while before coming back here, won't you? Haha!";
+			mes "Hey, you're actually useful! Good job!";
+			mes "That Verit wouldn't dare come around here for a while, right? Muhahah!";
 			changequest 2289,2290;
 			getexp 300000,100000;
 			close;
@@ -186,26 +185,24 @@ moc_prydn1,94,98,3	script	Suspicious Cat#night2	547,{
 				close;
 			}
 		} else if (.@hunting == 0 || .@hunting == 1) {
-			//Custom Translation
 			mes "[Suspicious Cat]";
-			mes "Hunting Verit is going well?";
+			mes "Is fighting Ancient Mummies going well?";
 			next;
-			switch(select("Of course.:I quit.")) {
+			switch(select("Sure.:I want to stop.")) {
 			case 1:
 				mes "[Suspicious Cat]";
-				mes "Good. Keep it up.";
+				mes "Good. Keep up the good work!";
 				close;
 			case 2:
 				mes "[Suspicious Cat]";
-				mes "What? Irresponsible bastard!";
+				mes "What? You're so irresponsible!";
 				erasequest 2292;
 				close;
 			}
 		} else if (.@hunting == 2) {
-			//Custom Translation
 			mes "[Suspicious Cat]";
-			mes "See, this is better! Good one!";
-			mes "Think for a while before coming back here, won't you? Haha!";
+			mes "Hey, you're actually useful! Good job!";
+			mes "That Ancient Mummy wouldn't dare come around here for a while, right? Muhahah!";
 			changequest 2292,2291;
 			getexp 600000,200000;
 			close;

+ 9 - 9
src/map/instance.c

@@ -256,7 +256,7 @@ void instance_addnpc(struct instance_data *im)
 /*--------------------------------------
  * name : instance name
  * Return value could be
- * -4 = already exists | -3 = no free instances | -2 = party not found | -1 = invalid type
+ * -4 = no free instances | -3 = already exists | -2 = party not found | -1 = invalid type
  * On success return instance_id
  *--------------------------------------*/
 int instance_create(int party_id, const char *name)
@@ -300,7 +300,7 @@ int instance_create(int party_id, const char *name)
 
 	ShowInfo("[Instance] Created: %s.\n", name);
 
-	return 0;
+	return i;
 }
 
 /*--------------------------------------
@@ -490,17 +490,17 @@ int instance_enter(struct map_session_data *sd, const char *name)
 
 	nullpo_retr(-1, sd);
 
-	if(db == NULL)
-		return 1;
-
 	// Character must be in instance party
 	if(sd->status.party_id == 0)
-		return 2;
+		return 1;
 	if((p = party_search(sd->status.party_id)) == NULL)
-		return 2;
+		return 1;
 
 	// Party must have an instance
 	if(p->instance_id == 0)
+		return 2;
+
+	if(db == NULL)
 		return 3;
 
 	im = &instance_data[p->instance_id];
@@ -513,10 +513,10 @@ int instance_enter(struct map_session_data *sd, const char *name)
 
 	// Does the instance match?
 	if((m = instance_mapname2mapid(db->enter.mapname, p->instance_id)) < 0)
-		return 4;
+		return 3;
 
 	if(pc_setpos(sd, m, db->enter.x, db->enter.y, 0))
-		return 4;
+		return 3;
 
 	// If there was an idle timer, let's stop it
 	instance_stopidletimer(im);

+ 7 - 27
src/map/script.c

@@ -16464,31 +16464,12 @@ int script_instancegetid(struct script_state* st)
  *------------------------------------------*/
 BUILDIN_FUNC(instance_create)
 {
-
 	struct map_session_data *sd;
-	int res;
 
 	if((sd = script_rid2sd(st)) == NULL)
 		return -1;
 
-	if(!sd->status.party_id) {
-		ShowError("script:instance_create: attempting to start an instance with no attached party.\n");
-		return -1;
-	}
-
-	res = instance_create(sd->status.party_id, script_getstr(st, 2));
-	if( res < 0 ) {
-		const char *err;
-		switch(res) {
-			case -4: err = "No free instances"; break;
-			case -2: err = "Invalid party ID"; break;
-			case -1: err = "Invalid type"; break;
-			default: err = "Unknown"; break;
-		}
-		ShowError("script:instance_create: %s [%d].\n", err, res);
-	}
-
-	script_pushint(st, res);
+	script_pushint(st,instance_create(sd->status.party_id, script_getstr(st, 2)));
 	return 0;
 }
 
@@ -16520,10 +16501,9 @@ BUILDIN_FUNC(instance_destroy)
  * Warps player to instance
  * Results:
  *	0: Success
- *	1: Instance not in DB
- *	2: Character not in party
- *	3: Party doesn't have instance
- *	4: Instance doesn't match with party
+ *	1: Character not in party
+ *	2: Party doesn't have instance
+ *	3: Other errors (instance not in DB, instance doesn't match with party, etc.)
  *------------------------------------------*/
 BUILDIN_FUNC(instance_enter)
 {
@@ -16540,8 +16520,8 @@ BUILDIN_FUNC(instance_enter)
 /*==========================================
  * Returns the name of a duplicated NPC
  *
- * instance_npcname <npc_name>{,<instance_id};
- * <npc_name> is the full name of an NPC
+ * instance_npcname <npc_name>{,<instance_id>};
+ * <npc_name> is the full name of an NPC.
  *------------------------------------------*/
 BUILDIN_FUNC(instance_npcname)
 {
@@ -16572,7 +16552,7 @@ BUILDIN_FUNC(instance_npcname)
 /*==========================================
  * Returns the name of a duplicated map
  *
- * instance_mapname <map_name>{,<instance_id};
+ * instance_mapname <map_name>{,<instance_id>};
  *------------------------------------------*/
 BUILDIN_FUNC(instance_mapname)
 {