Jump to content
  • 0

H> SRC error on Headgear to costume.


realRO

Question


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

Hi rA. I'm having a problem regarding the "Headgear to Costume SRC".

I am manually patching this: https://github.com/Sehrentos/rathena/commit/21a1a32203b6a48664c97bfd93b0ae09de80d06e#commitcomment-8900107

My rA is 17454.

 

Here's the error: 

make[1]: Entering directory `/root/trunk/3rdparty/mt19937ar'
	CC	mt19937ar.c
make[1]: Leaving directory `/root/trunk/3rdparty/mt19937ar'
make[1]: Entering directory `/root/trunk/3rdparty/libconfig'
	CC	libconfig.c
	CC	grammar.c
	CC	scanctx.c
	CC	scanner.c
	CC	strbuf.c
make[1]: Leaving directory `/root/trunk/3rdparty/libconfig'
make[1]: Entering directory `/root/trunk/src/common'
	MKDIR	obj_all
	CC	core.c
	CC	socket.c
	CC	timer.c
	CC	db.c
	CC	nullpo.c
	CC	malloc.c
	CC	showmsg.c
	CC	strlib.c
	CC	utils.c
	CC	grfio.c
	CC	mapindex.c
	CC	ers.c
	CC	md5calc.c
	CC	core.c
	CC	socket.c
	CC	malloc.c
	CC	random.c
	CC	des.c
	CC	conf.c
	CC	thread.c
	CC	mutex.c
	CC	raconf.c
	CC	mempool.c
	CC	msg_conf.c
	CC	cli.c
	AR	obj_all/common.a
	MKDIR	obj_sql
	CC	sql.c
	AR	obj_sql/common_sql.a
make[1]: Leaving directory `/root/trunk/src/common'
make[1]: Entering directory `/root/trunk/src/login'
	MKDIR	obj_sql
	CC	login.c
	CC	account_sql.c
	CC	ipban_sql.c
	CC	loginlog_sql.c
	LD	login-server_sql
make[1]: Leaving directory `/root/trunk/src/login'
make[1]: Entering directory `/root/trunk/src/char'
	MKDIR	obj_sql
	CC	char.c
char.c:5356:2: warning: no newline at end of file
	CC	inter.c
	CC	int_party.c
	CC	int_guild.c
	CC	int_storage.c
	CC	int_pet.c
	CC	int_homun.c
	CC	int_mail.c
	CC	int_auction.c
	CC	int_quest.c
	CC	int_mercenary.c
	CC	int_elemental.c
	LD	char-server_sql
make[1]: Leaving directory `/root/trunk/src/char'
make[1]: Entering directory `/root/trunk/src/map'
	MKDIR	obj_sql
	CC	map.c
In file included from pc.h:12,
                 from map.c:25:
itemdb.h:240:24: warning: no newline at end of file
	CC	chrif.c
In file included from pc.h:12,
                 from chrif.c:18:
itemdb.h:240:24: warning: no newline at end of file
	CC	clif.c
In file included from pc.h:12,
                 from clif.c:19:
itemdb.h:240:24: warning: no newline at end of file
	CC	pc.c
In file included from pc.h:12,
                 from channel.h:7,
                 from pc.c:19:
itemdb.h:240:24: warning: no newline at end of file
pc.c:70: error: ‘EQP_SHADOW_ARMOR’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c:70: error: ‘EQP_SHADOW_WEAPON’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c:70: error: ‘EQP_SHADOW_SHIELD’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c:70: error: ‘EQP_SHADOW_SHOES’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c:70: error: ‘EQP_SHADOW_ACC_R’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c:70: error: ‘EQP_SHADOW_ACC_L’ undeclared here (not in a function)
pc.c:70: warning: excess elements in array initializer
pc.c:70: warning: (near initialization for ‘equip_pos’)
pc.c: In function ‘pc_getitem_map’:
pc.c:4151: warning: suggest parentheses around assignment used as truth value
make[1]: *** [obj_sql/pc.o] Error 1
make[1]: Leaving directory `/root/trunk/src/map'
make: *** [map_sql] Error 2

 

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Maybe your current trunk doesn't support Shadow equipments.

If you're not willing to update it to the latest rAthena git. Try to remove the shadow equipments in this part https://github.com/Sehrentos/rathena/commit/21a1a32203b6a48664c97bfd93b0ae09de80d06e#diff-08420bab8271f3965304fee42cf4b865R76

replace it with this code

static unsigned int equip_pos[EQI_MAX] = { EQP_ACC_L, EQP_ACC_R, EQP_SHOES, EQP_GARMENT, EQP_HEAD_LOW, EQP_HEAD_MID, EQP_HEAD_TOP, EQP_ARMOR, EQP_HAND_L, EQP_HAND_R, EQP_COSTUME_HEAD_TOP, EQP_COSTUME_HEAD_MID, EQP_COSTUME_HEAD_LOW, EQP_COSTUME_GARMENT, EQP_AMMO };

But still I would recommend updating it to the latest git hash since you won't have enough support for svn revisions.

  • 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:  

17454 is not a git hash. The errors tell you what is wrong.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

11 minutes ago, Technoken said:

Maybe your current trunk doesn't support Shadow equipments.

If you're not willing to update it to the latest rAthena git. Try to remove the shadow equipments in this part https://github.com/Sehrentos/rathena/commit/21a1a32203b6a48664c97bfd93b0ae09de80d06e#diff-08420bab8271f3965304fee42cf4b865R76

replace it with this code


static unsigned int equip_pos[EQI_MAX] = { EQP_ACC_L, EQP_ACC_R, EQP_SHOES, EQP_GARMENT, EQP_HEAD_LOW, EQP_HEAD_MID, EQP_HEAD_TOP, EQP_ARMOR, EQP_HAND_L, EQP_HAND_R, EQP_COSTUME_HEAD_TOP, EQP_COSTUME_HEAD_MID, EQP_COSTUME_HEAD_LOW, EQP_COSTUME_GARMENT, EQP_AMMO };

But still I would recommend updating it to the latest git hash since you won't have enough support for svn revisions.

I will try replacing the code now sir, give me a minute to see what will happen.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

19 minutes ago, Akkarin said:

17454 is not a git hash. The errors tell you what is wrong.

I'm very sorry sir, I'm new in srcs. I thought you can manually patch things even in old versions. 

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:  

1 minute ago, realRO said:

I thought you can manually patch things even in old versions.

You can, but it's a very bad idea. Patching something custom against an older rA revision will almost 100% of the time scream with errors.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

Okay sir @Akkarin, I will try my best to do what @Technoken suggests, hoping I can make the costume-converter run. :) 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Let's see if that works. Anyway, if you don't have much src mods, you can use the latest git hash instead of using your current revision. It would be easier if you use the latest one. I would also recommend it since it's better in terms of stability, support, features, and compatibility. 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

33 minutes ago, Technoken said:

Let's see if that works. Anyway, if you don't have much src mods, you can use the latest git hash instead of using your current revision. It would be easier if you use the latest one. I would also recommend it since it's better in terms of stability, support, features, and compatibility. 

make[1]: Entering directory `/root/trunk/3rdparty/mt19937ar'
	CC	mt19937ar.c
make[1]: Leaving directory `/root/trunk/3rdparty/mt19937ar'
make[1]: Entering directory `/root/trunk/3rdparty/libconfig'
	CC	libconfig.c
	CC	grammar.c
	CC	scanctx.c
	CC	scanner.c
	CC	strbuf.c
make[1]: Leaving directory `/root/trunk/3rdparty/libconfig'
make[1]: Entering directory `/root/trunk/src/common'
	MKDIR	obj_all
	CC	core.c
	CC	socket.c
	CC	timer.c
	CC	db.c
	CC	nullpo.c
	CC	malloc.c
	CC	showmsg.c
	CC	strlib.c
	CC	utils.c
	CC	grfio.c
	CC	mapindex.c
	CC	ers.c
	CC	md5calc.c
	CC	core.c
	CC	socket.c
	CC	malloc.c
	CC	random.c
	CC	des.c
	CC	conf.c
	CC	thread.c
	CC	mutex.c
	CC	raconf.c
	CC	mempool.c
	CC	msg_conf.c
	CC	cli.c
	AR	obj_all/common.a
	MKDIR	obj_sql
	CC	sql.c
	AR	obj_sql/common_sql.a
make[1]: Leaving directory `/root/trunk/src/common'
make[1]: Entering directory `/root/trunk/src/login'
	MKDIR	obj_sql
	CC	login.c
	CC	account_sql.c
	CC	ipban_sql.c
	CC	loginlog_sql.c
	LD	login-server_sql
make[1]: Leaving directory `/root/trunk/src/login'
make[1]: Entering directory `/root/trunk/src/char'
	MKDIR	obj_sql
	CC	char.c
char.c:5356:2: warning: no newline at end of file
	CC	inter.c
	CC	int_party.c
	CC	int_guild.c
	CC	int_storage.c
	CC	int_pet.c
	CC	int_homun.c
	CC	int_mail.c
	CC	int_auction.c
	CC	int_quest.c
	CC	int_mercenary.c
	CC	int_elemental.c
	LD	char-server_sql
make[1]: Leaving directory `/root/trunk/src/char'
make[1]: Entering directory `/root/trunk/src/map'
	MKDIR	obj_sql
	CC	map.c
In file included from pc.h:12,
                 from map.c:25:
itemdb.h:240:24: warning: no newline at end of file
	CC	chrif.c
In file included from pc.h:12,
                 from chrif.c:18:
itemdb.h:240:24: warning: no newline at end of file
	CC	clif.c
In file included from pc.h:12,
                 from clif.c:19:
itemdb.h:240:24: warning: no newline at end of file
	CC	pc.c
In file included from pc.h:12,
                 from channel.h:7,
                 from pc.c:19:
itemdb.h:240:24: warning: no newline at end of file
pc.c: In function ‘pc_getitem_map’:
pc.c:4153: warning: suggest parentheses around assignment used as truth value
	CC	status.c
In file included from pc.h:12,
                 from status.c:16:
itemdb.h:240:24: warning: no newline at end of file
	CC	npc.c
In file included from pc.h:12,
                 from npc.c:18:
itemdb.h:240:24: warning: no newline at end of file
	CC	npc_chat.c
In file included from pc.h:12,
                 from npc_chat.c:14:
itemdb.h:240:24: warning: no newline at end of file
	CC	chat.c
In file included from pc.h:12,
                 from chat.c:15:
itemdb.h:240:24: warning: no newline at end of file
	CC	path.c
	CC	itemdb.c
In file included from itemdb.c:10:
itemdb.h:240:24: warning: no newline at end of file
	CC	mob.c
In file included from pc.h:12,
                 from mob.c:20:
itemdb.h:240:24: warning: no newline at end of file
mob.c:4632:2: warning: no newline at end of file
	CC	script.c
In file included from script.c:25:
itemdb.h:240:24: warning: no newline at end of file
script.c: In function ‘buildin_getitem_map_sub’:
script.c:6476: warning: unused variable ‘p’
script.c:6475: warning: unused variable ‘g’
script.c: In function ‘buildin_addtimer’:
script.c:9269: warning: control reaches end of non-void function
	CC	storage.c
In file included from storage.c:13:
itemdb.h:240:24: warning: no newline at end of file
	CC	skill.c
In file included from pc.h:12,
                 from skill.c:17:
itemdb.h:240:24: warning: no newline at end of file
	CC	atcommand.c
In file included from pc.h:12,
                 from channel.h:7,
                 from atcommand.c:20:
itemdb.h:240:24: warning: no newline at end of file
atcommand.c: In function ‘atcommand_item’:
atcommand.c:1169: error: ‘j’ undeclared (first use in this function)
atcommand.c:1169: error: (Each undeclared identifier is reported only once
atcommand.c:1169: error: for each function it appears in.)
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/root/trunk/src/map'
make: *** [map_sql] Error 2

Hi, I've tried it and this is what happened. ( I really not familiar with the errors on src ) i'm sorry 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

This topic is solved via pm. A very big thanks to @Technoken

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  745
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

15 hours ago, realRO said:

This topic is solved via pm. A very big thanks to @Technoken

do you mind share it ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

2 hours ago, Bringer said:

do you mind share it ?

Are you using an old revision of rAthena?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  745
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

3 hours ago, Technoken said:

Are you using an old revision of rAthena?

yes old

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

2 minutes ago, Bringer said:

yes old

Try this

Index: atcommand.c
===================================================================
--- atcommand.c	(revision 17454)
+++ atcommand.c	(working copy)
@@ -1117,7 +1117,7 @@
 ACMD_FUNC(item)
 {
 	char item_name[100];
-	int number = 0, item_id, flag = 0;
+	int number = 0, item_id, flag = 0, costume = 0;
 	struct item item_tmp;
 	struct item_data *item_data;
 	int get_count, i;
@@ -1142,7 +1142,27 @@
 		clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name.
 		return -1;
 	}
-
+	
+	if( !strcmpi(command+1,"costumeitem") )
+	{
+		if( !battle_config.reserved_costume_id )
+		{
+			clif_displaymessage(fd, "Costume convertion is disable. Set a value for reserved_cosutme_id on your battle.conf file.");
+			return -1;
+		}
+		if( !(item_data->equip&EQP_HEAD_LOW) &&
+			!(item_data->equip&EQP_HEAD_MID) &&
+			!(item_data->equip&EQP_HEAD_TOP) &&
+			!(item_data->equip&EQP_COSTUME_HEAD_LOW) &&
+			!(item_data->equip&EQP_COSTUME_HEAD_MID) &&
+			!(item_data->equip&EQP_COSTUME_HEAD_TOP) )
+		{
+			clif_displaymessage(fd, "You cannot costume this item. Costume only work for headgears.");
+			return -1;
+		}
+		costume = 1;
+	}
+	
 	item_id = item_data->nameid;
 	get_count = number;
 	//Check if it's stackable.
@@ -1155,7 +1175,13 @@
 			memset(&item_tmp, 0, sizeof(item_tmp));
 			item_tmp.nameid = item_id;
 			item_tmp.identify = 1;
-
+			if( costume == 1 )
+			{ // Costume Item
+				item_tmp.card[0] = CARD0_CREATE;
+				item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0);
+				item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1);
+			}
+			
 			if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
 				clif_additem(sd, 0, 0, flag);
 		}
@@ -9251,7 +9277,9 @@
 		ACMD_DEF(channel),
 		ACMD_DEF(fontcolor),
 		ACMD_DEF(langtype),
-		ACMD_DEF(reloadmsgconf)
+		ACMD_DEF(reloadmsgconf),
+		ACMD_DEF2("costumeitem", item)
+		
 	};
 	AtCommandInfo* atcommand;
 	int i;
Index: battle.c
===================================================================
--- battle.c	(revision 17454)
+++ battle.c	(working copy)
@@ -5939,6 +5939,7 @@
 	{ "item_enabled_npc",                   &battle_config.item_enabled_npc,                1,      0,      1,              },
 	{ "item_flooritem_check",               &battle_config.item_onfloor,                    1,      0,      1,              },
 	{ "bowling_bash_area",                  &battle_config.bowling_bash_area,               0,      0,      20,             },
+	{ "reserved_costume_id",                &battle_config.reserved_costume_id,             999998, 0,      INT_MAX,        },
 };
 #ifndef STATS_OPT_OUT
 /**
Index: battle.h
===================================================================
--- battle.h	(revision 17454)
+++ battle.h	(working copy)
@@ -488,6 +488,10 @@
 	int item_enabled_npc;
 	int item_onfloor; // Whether to drop an undroppable item on the map or destroy it if inventory is full.
 	int bowling_bash_area;
+	
+	// Costume System
+	int reserved_costume_id;
+	
 	} battle_config;
 
 void do_init_battle(void);
Index: map.c
===================================================================
--- map.c	(revision 17454)
+++ map.c	(working copy)
@@ -1537,7 +1537,13 @@
 	struct map_session_data* tsd;
 
 	nullpo_retv(sd);
-
+	
+	if( battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid )
+	{
+		clif_solved_charname(sd->fd, charid, "Costume");
+		return;
+	}
+	
 	tsd = map_charid2sd(charid);
 	if( tsd )
 	{
Index: pc.c
===================================================================
--- pc.c	(revision 17454)
+++ pc.c	(working copy)
@@ -66,8 +66,7 @@
 struct fame_list chemist_fame_list[MAX_FAME_LIST];
 struct fame_list taekwon_fame_list[MAX_FAME_LIST];
 
-static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_GARMENT,EQP_AMMO};
-
+static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_AMMO,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_GARMENT};
 #define MOTD_LINE_SIZE 128
 static char motd_text[MOTD_LINE_SIZE][CHAT_SIZE_MAX]; // Message of the day buffer [Valaris]
 
@@ -586,7 +585,7 @@
 
 int pc_equippoint(struct map_session_data *sd,int n)
 {
-	int ep = 0;
+	int ep = 0, char_id = 0;
 
 	nullpo_ret(sd);
 
@@ -604,6 +603,15 @@
 			(sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
 			return EQP_ARMS;
 	}
+	
+	if( battle_config.reserved_costume_id &&
+		sd->status.inventory[n].card[0] == CARD0_CREATE &&
+		(char_id = MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3])) == battle_config.reserved_costume_id )
+	{ // Costume Item - Converted
+		if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; }
+		if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; }
+		if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; }
+	}
 	return ep;
 }
 
@@ -1910,8 +1918,8 @@
 				if( autobonus[i].bonus_script )
 				{
 					int j;
-					ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos );
-					if( j < EQI_MAX-1 )
+					ARR_FIND( 0, EQI_MAX_BONUS, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos );
+					if( j < EQI_MAX_BONUS )
 						script_run_autobonus(autobonus[i].bonus_script,sd->bl.id,sd->equip_index[j]);
 				}
 				continue;
@@ -1941,8 +1949,8 @@
 	if( autobonus->other_script )
 	{
 		int j;
-		ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos );
-		if( j < EQI_MAX-1 )
+		ARR_FIND( 0, EQI_MAX_BONUS, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos );
+		if( j < EQI_MAX_BONUS )
 			script_run_autobonus(autobonus->other_script,sd->bl.id,sd->equip_index[j]);
 	}
 
Index: pc.h
===================================================================
--- pc.h	(revision 17454)
+++ pc.h	(working copy)
@@ -37,11 +37,12 @@
 	EQI_ARMOR,
 	EQI_HAND_L,
 	EQI_HAND_R,
+	EQI_AMMO,
+	EQI_MAX_BONUS = 10,
 	EQI_COSTUME_TOP,
 	EQI_COSTUME_MID,
 	EQI_COSTUME_LOW,
 	EQI_COSTUME_GARMENT,
-	EQI_AMMO,
 	EQI_MAX
 };
 
Index: script.c
===================================================================
--- script.c	(revision 17454)
+++ script.c	(working copy)
@@ -17596,6 +17596,52 @@
 	return 0;
 }
 
+/*==========================================
+ * Costume Items
+ *------------------------------------------*/
+BUILDIN_FUNC(costume)
+{
+	int i = -1, num, ep;
+	TBL_PC *sd;
+
+	num = script_getnum(st,2); // Equip Slot
+	sd = script_rid2sd(st);
+
+	if( sd == NULL )
+		return 0;
+	if( num > 0 && num <= ARRAYLENGTH(equip) )
+		i = pc_checkequip(sd, equip[num - 1]);
+	if( i < 0 )
+		return 0;
+
+	ep = sd->status.inventory[i].equip;
+	if( !(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP) )
+		return 0;
+
+	log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
+	pc_unequipitem(sd,i,2);
+	clif_delitem(sd,i,1,3);
+	// --------------------------------------------------------------------
+	sd->status.inventory[i].refine = 0;
+	sd->status.inventory[i].attribute = 0;
+	sd->status.inventory[i].card[0] = CARD0_CREATE;
+	sd->status.inventory[i].card[1] = 0;
+	sd->status.inventory[i].card[2] = GetWord(battle_config.reserved_costume_id, 0);
+	sd->status.inventory[i].card[3] = GetWord(battle_config.reserved_costume_id, 1);
+
+	if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; }
+	if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; }
+	if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; }
+	// --------------------------------------------------------------------
+	log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
+
+	clif_additem(sd,i,1,0);
+	pc_equipitem(sd,i,ep);
+	clif_misceffect(&sd->bl,3);
+
+	return 0;
+}
+
 // declarations that were supposed to be exported from npc_chat.c
 #ifdef PCRE_SUPPORT
 BUILDIN_FUNC(defpattern);
@@ -18060,5 +18106,9 @@
 	BUILDIN_DEF(checkquest, "i?"),
 	BUILDIN_DEF(changequest, "ii"),
 	BUILDIN_DEF(showevent, "ii"),
+	
+	// Costume System
+	BUILDIN_DEF(costume,"i"),
+	
 	{NULL,NULL,NULL},
 };
Index: status.c
===================================================================
--- status.c	(revision 17454)
+++ status.c	(working copy)
@@ -2455,7 +2455,7 @@
 	pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true);
 
 	// Parse equipment.
-	for(i=0;i<EQI_MAX-1;i++) {
+	for(i=0;i<EQI_MAX_BONUS;i++) {
 		current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus]
 		if(index < 0)
 			continue;
Index: battle.conf
===================================================================
--- battle.conf	(revision 17454)
+++ battle.conf	(working copy)
@@ -141,3 +141,9 @@
 // range. For example, Sonic Blow requires a 2 cell distance before autocasting is allowed.
 // This setting also affects autospellwhenhit.
 autospell_check_range: no
+
+// ****************************************
+// Reserved Costume ID's
+// ****************************************
+// Reserved Char ID for costume converted items.
+reserved_costume_id: 999998

 

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