Jump to content
  • 0
Sign in to follow this  
Neferpitou

HELP! My old 3ceam src to latest Hercules

Question

Hello everyone im new here in hercules and i have a ragnarok server last 2 years and i want to try to make a new 1 again using hercules and i really want to apply my old src file from 3ceam r650 to latest hercules revision anyone can edit my patch file so that i can use this to patch in hercules without any problem. i really appreciate all the help thanks in advance and thank you and also sorry for my bad english :(


chatroomBGCmds.patch

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

I did convert by hand but not test .... good luck :)
 

Index: chat.c===================================================================--- chat.c	(revision 14682)+++ chat.c	(working copy)@@ -377,3 +377,17 @@  	return 0; }++/// Kicks a user from the chat room.+int chat_npckickchat(struct chat_data* cd, const char* kickusername)+{+	int i;+	nullpo_ret(cd);++	ARR_FIND( 0, cd->users, i, strncmp(cd->usersd[i]->status.name, kickusername, NAME_LENGTH) == 0 );+	if( i == cd->users )+		return -1;++	chat->leave(cd->usersd[i],1);+	return 0;+} No newline at end of fileIndex: chat.h===================================================================--- chat.h	(revision 14682)+++ chat.h	(working copy)@@ -36,4 +36,5 @@ int chat_disableevent(struct chat_data* cd); int chat->npc_kick_all(struct chat_data* cd); +int chat_npckickchat(struct chat_data* cd, const char* kickusername); #endif /* _CHAT_H_ */Index: script.c===================================================================--- script.c	(revision 14682)+++ script.c	(working copy)@@ -3461,6 +3461,10 @@ 		} 	} +	+	++ 	if(st->sleep.tick > 0) { 		//Restore previous script 		script->detach_state(st, false);@@ -9300,6 +9304,51 @@ 	return 0; } +/// Kick the specified player from the waiting room of the target npc.+///+/// kickwaitingroomall "<npc_name>", <char_name>;+BUILDIN(waitingroomkick)+{+	struct npc_data* nd;+	struct chat_data* cd;+	const char* char_name;++	nd = npc->name2id(script_getstr(st,2));+	char_name = script_getstr(st,3);++	if( nd != NULL && (cd=(struct chat_data *)map->id2bl(nd->chat_id)) != NULL )+		chat_npckickchat(cd, char_name);+	return 0;+}+++/// Get Users in waiting room and stores gids in .@waitingroom_users[]+/// Num users stored in .@waitingroom_usercount+///+/// getwaitingroomusers "<npc_name>";+BUILDIN(getwaitingroomusers)+{+	struct npc_data* nd;+	struct chat_data* cd;++	int i, j=0;++	if( script_hasdata(st,2) )+		nd = npc->name2id(script_getstr(st,2));+	else+		nd = (struct npc_data *)map->id2bl(st->oid);++	if( nd != NULL && (cd=(struct chat_data *)map->id2bl(nd->chat_id)) != NULL ) {+		for(i = 0; i < cd->users; ++i) {+			script->setd_sub(st, NULL, ".@waitingroom_users", j, (void *)cd->usersd[i]->status.account_id, NULL);+			j++;+		}++		script->setd_sub(st, NULL, ".@waitingroom_usercount", 0, (void *)j, NULL);+	}+	return 0;+}+ /// Enables the waiting room event of the current or target npc. /// /// enablewaitingroomevent "<npc_name>";@@ -14254,6 +14303,28 @@ 	return 0; } +BUILDIN(getbgmembers)+{+	struct battleground_data *bg = NULL;+	struct map_session_data *sd;+	int bg_id, i, j=0;++	bg_id = script_getnum(st,2);+	if( (bg = bg->team_search(bg_id)) == NULL) {+		script_pushint(st,0);+		return 0;+	}+	for( i = 0; i < MAX_BG_MEMBERS; i++ ) {+		if( (sd = bg->members[i].sd) == NULL )+			continue;+		script->setd_sub(st, NULL, ".@bg_members", j, (void *)sd->status.account_id, NULL);+		j++;+	}+	script->setd_sub(st, NULL, ".@bg_membercount", 0, (void *)j, NULL);++	return 0;+}+ BUILDIN(bg_updatescore) { 	const char *str;@@ -14924,6 +14995,8 @@ 	BUILDIN_DEF(waitingroom,"si??"), 	BUILDIN_DEF(delwaitingroom,"?"), 	BUILDIN_DEF2(waitingroomkickall,"kickwaitingroomall","?"),+	BUILDIN_DEF(waitingroomkick,"ss"),+	BUILDIN_DEF(getwaitingroomusers, "?"), 	BUILDIN_DEF(enablewaitingroomevent,"?"), 	BUILDIN_DEF(disablewaitingroomevent,"?"), 	BUILDIN_DEF2(enablewaitingroomevent,"enablearena",""),		// Added by RoVeRT@@ -15134,7 +15207,7 @@ 	BUILDIN_DEF(bg_get_data,"ii"), 	BUILDIN_DEF(bg_getareausers,"isiiii"), 	BUILDIN_DEF(bg_updatescore,"sii"),-+	BUILDIN_DEF(getbgmembers, "i"), 	// Instancing 	BUILDIN_DEF(instance->create,"si"), 	BUILDIN_DEF(instance->destroy,"?"),

 

Share this post


Link to post
Share on other sites
  • 0

thank you very much but i have errors when i try to apply patch using tortoise
script.c
 

--- script.c+++ script.c@@ -14254,6 +14303,28 @@ 	return 0; } +BUILDIN_FUNC(getbgmembers)+{+	struct battleground_data *bg = NULL;+	struct map_session_data *sd;+	int bg_id, i, j=0;++	bg_id = script_getnum(st,2);+	if( (bg = bg_team_search(bg_id)) == NULL) {+		script_pushint(st,0);+		return 0;+	}+	for( i = 0; i < MAX_BG_MEMBERS; i++ ) {+		if( (sd = bg->members[i].sd) == NULL )+			continue;+		setd_sub(st, NULL, ".@bg_members", j, (void *)sd->status.account_id, NULL);+		j++;+	}+	setd_sub(st, NULL, ".@bg_membercount", 0, (void *)j, NULL);++	return 0;+}+ BUILDIN_FUNC(bg_updatescore) { 	const char *str;@@ -14924,6 +14995,8 @@ 	BUILDIN_DEF(waitingroom,"si??"), 	BUILDIN_DEF(delwaitingroom,"?"), 	BUILDIN_DEF2(waitingroomkickall,"kickwaitingroomall","?"),+	BUILDIN_DEF(waitingroomkick,"ss"),+	BUILDIN_DEF(getwaitingroomusers, "?"), 	BUILDIN_DEF(enablewaitingroomevent,"?"), 	BUILDIN_DEF(disablewaitingroomevent,"?"), 	BUILDIN_DEF2(enablewaitingroomevent,"enablearena",""),		// Added by RoVeRT@@ -15134,7 +15207,7 @@ 	BUILDIN_DEF(bg_get_data,"ii"), 	BUILDIN_DEF(bg_getareausers,"isiiii"), 	BUILDIN_DEF(bg_updatescore,"sii"),-+	BUILDIN_DEF(getbgmembers, "i"), 	// Instancing 	BUILDIN_DEF(instance_create,"si"), 	BUILDIN_DEF(instance_destroy,"?"),

chat.h
 

--- chat.h+++ chat.h@@ -36,4 +36,5 @@ int chat_disableevent(struct chat_data* cd); int chat_npckickall(struct chat_data* cd); +int chat_npckickchat(struct chat_data* cd, const char* kickusername); #endif /* _CHAT_H_ */

thank you i really appreciate your help thank you very much

Share this post


Link to post
Share on other sites
  • 0

2>  chat.c2>..srcmapchat.c(198): error C2143: syntax error : missing ';' before 'type'2>..srcmapchat.c(203): error C2065: 'kickusername' : undeclared identifier2>..srcmapchat.c(203): warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'2>..srcmapchat.c(203): warning C4024: 'strncmp' : different types for formal and actual parameter 22>..srcmapchat.c(211): error C2143: syntax error : missing '{' before '->'2>..srcmapchat.c(211): error C2059: syntax error : '->'2>..srcmapchat.c(212): error C2143: syntax error : missing ')' before '->'2>..srcmapchat.c(212): error C2143: syntax error : missing '{' before '->'2>..srcmapchat.c(212): error C2059: syntax error : '->'2>..srcmapchat.c(212): error C2059: syntax error : ')'2>..srcmapchat.c(213): error C2143: syntax error : missing '{' before '->'2>..srcmapchat.c(213): error C2059: syntax error : '->'2>..srcmapchat.c(215): error C2065: 'i' : undeclared identifier2>..srcmapchat.c(215): error C2099: initializer is not a constant2>..srcmapchat.c(217): error C2059: syntax error : 'for'2>..srcmapchat.c(217): error C2143: syntax error : missing '{' before '<'2>..srcmapchat.c(217): error C2059: syntax error : '<'2>..srcmapchat.c(217): error C2143: syntax error : missing '{' before '++'2>..srcmapchat.c(217): error C2059: syntax error : '++'2>..srcmapchat.c(217): error C2059: syntax error : ')'2>..srcmapchat.c(221): error C2059: syntax error : 'if'2>..srcmapchat.c(239): error C2059: syntax error : 'if'2>..srcmapchat.c(254): error C2143: syntax error : missing '{' before '->'2>..srcmapchat.c(254): error C2059: syntax error : '->'2>..srcmapchat.c(256): error C2059: syntax error : 'return'2>..srcmapchat.c(257): error C2059: syntax error : '}'2>..srcmapchat.c(474): error C2065: 'chat_changechatowner' : undeclared identifier2>..srcmapchat.c(474): warning C4047: '=' : 'bool (__cdecl *)(map_session_data *,const char *)' differs in levels of indirection from 'int' 

 

oh thank you i already apply all the patch manually but i have a problem kindly help me i really need this how to fix this error i really dont have any idea thank you

 

Recompile error

Edited by Neferpitou

Share this post


Link to post
Share on other sites
  • 0

Wow thats quite a old revision of 3CeAM your using. That code your trying to use may need most of it redone since Hercules is a different beast when compared to older eA codings. Some of the functions and structures have changed a lot, making some of the code no longer compadable. If your using Visual C++ you can see where the issues are and hopefully learn which parts of the code needs updating.

Share this post


Link to post
Share on other sites
  • 0

wow hi master Rytech the founder of 3ceam :) i already applied all the patch without any errors but my script its not working anymore when i load it to my test server no error in compiling and no error also in script load but the npc dont have space for pub i mean i cant enter his pub to join the battle grounds that this is the old battle grounds i have but i cant enter in the NPC PUB...

Edited by Neferpitou

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.