|
You last visited: Today at 01:42
Advertisement
[Relase] Guilds for CoEmuv2
Discussion on [Relase] Guilds for CoEmuv2 within the CO2 Private Server forum part of the Conquer Online 2 category.
08/16/2009, 16:48
|
#16
|
elite*gold: 0
Join Date: Aug 2005
Posts: 44
Received Thanks: 69
|
Quote:
Originally Posted by 12tails
thankx for it ^^
and put it into you first post to become more complete ^^
|
I already did that^^
|
|
|
08/16/2009, 20:10
|
#17
|
elite*gold: 0
Join Date: Nov 2006
Posts: 65
Received Thanks: 2
|
ok. i got this error. how can i fix it.
No overload for method 'NpcTalk' takes '3' arguments
FIXED...........it was this code that i misplace.
case 2031: //Initial NPC talk
{
int ID = ReadLong(Data, 4);
Handler.NpcTalk(CSocket, ID, 0,data);
break;
}
case 2032: //Reply NPC Talk
{
int ID = CSocket.Client.LastNPC;
int LinkBack = Data[10];
if(LinkBack != 255)
Handler.NpcTalk(CSocket, ID, LinkBack,data);
break;
}
|
|
|
08/16/2009, 20:20
|
#18
|
elite*gold: 0
Join Date: Aug 2005
Posts: 44
Received Thanks: 69
|
Quote:
Originally Posted by killerbee
ok. i got this error. how can i fix it.
No overload for method 'NpcTalk' takes '3' arguments
|
It is in my release. To get string from input (like guild name when you create), You need to find a way to pass data back to npctalk.cs. So i added fourth variable to public static void NpcTalk. Anyway go to GS>Handlers>NpcTalk.cs and change
Code:
public static void NpcTalk(ClientSocket CSocket, int ID, int LinkBack)
to:
Code:
public static void NpcTalk(ClientSocket CSocket, int ID, int LinkBack,byte[] data)
|
|
|
08/16/2009, 21:35
|
#19
|
elite*gold: 0
Join Date: Sep 2008
Posts: 348
Received Thanks: 141
|
bisiol Welcome back did u remmber me add me There
|
|
|
08/17/2009, 10:59
|
#20
|
elite*gold: 0
Join Date: Oct 2006
Posts: 75
Received Thanks: 17
|
Code:
case 10003: // Guild Controler
{
if (LinkBack == 0)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Create a Guild.", 1, CSocket);
Link("Deputize.", 2, CSocket);
Link("Remove from Office.", 7, CSocket);
Link("Disband.", 3, CSocket);
Link("More.", 9, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (!CSocket.Client.InGuild)
{
Text("It will cost you 1,000,000 silvers, and you need to be level 95 at least.", CSocket);
Input(4, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. You in a Guild.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.gpo == 100)
{
int dlcount = 0;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.isDL)
dlcount++;
if (dlcount < 6)
{
Text("Enter the name of your guildmate you want to deputize.", CSocket);
Input(5, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Your guild already have 6 DLs", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else
{
Text("Sorry. Only GuildLeader can promote members.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
if (CSocket.Client.gpo == 100)
{
if (Nano.Guilds[CSocket.Client.gid].Members.Count == 0)
{
Text("Are you sure you want to disband your guild?", CSocket);
Link("Yes.", 6, CSocket);
Link("No, actually.", 255, CSocket);
End(CSocket);
}
else
{
Text("You Cant Disband your guild until you have members in.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
else
{
Text("Only guild leader can disband his/her guild.", CSocket);
Link("Ok.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 4)
{
if (!CSocket.Client.InGuild)
{
if (CSocket.Client.Money >= 1000000)
{
if (CSocket.Client.Level >= 95)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool chk = true;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
{
if (gd.Value.Name == str)
chk = false;
}
if (chk)
{
int ngid;
do
{
ngid = Nano.Rand.Next(100, 33333);
} while (Nano.Guilds.ContainsKey(ngid));
Money(-1000000, CSocket);
Guild GD = new Guild();
GD.Bulletin = "Enter Bulletin Here";
GD.Fund = 1000000;
GD.ID = (ushort)ngid;
GD.Leader = new member();
GD.Leader.ID = CSocket.Client.ID;
GD.Leader.lvl = CSocket.Client.Level;
GD.Leader.Name = CSocket.Client.Name;
GD.Name = str;
GD.MembersCount++;
Nano.Guilds.Add(ngid, GD);
CSocket.Client.gid = GD.ID;
CSocket.Client.gna = str;
CSocket.Client.gpo = 100;
CSocket.Client.InGuild = true;
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> C in Nano.ClientPool)
C.Value.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", "Congratulations " + CSocket.Client.Name + " has set up " + str + " successfully!", Struct.ChatType.Talk));
Database.Database.NewGuild(GD, CSocket.Client);
}
else
Text("Guild name are taken.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
else
Text("You aren't high level enough.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
Text("You don't have enough silvers.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
Text("Congratulations You have set up a guild.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
else if (LinkBack == 5)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool t = false;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.Name == str)
{
t = true;
m.Value.isDL = true;
if (Nano.ClientPool.ContainsKey(m.Key))
{
Nano.ClientPool[m.Value.ID].Client.gpo = 90;
Guild.refresh(Nano.ClientPool[m.Value.ID]);
Spawn.All(CSocket);
break;
}
else
{
Text("The player you want to deputize must be in your guild and online.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
}
if (!t)
{
Text("You do not have that member.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 6)
{
foreach (KeyValuePair<int, ClientSocket> C in Nano.ClientPool)
C.Value.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", CSocket.Client.gna + " has been disbanded.", Struct.ChatType.Talk));
Database.Database.DeleteGuild(CSocket.Client.gid);
CSocket.Send(ConquerPacket.GSend(CSocket.Client.gid, 19));
CSocket.Client.gid = 0;
CSocket.Client.gna = "";
CSocket.Client.gpo = 50;
Nano.Guilds.Remove(CSocket.Client.gid);
}
else if (LinkBack == 7)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter the name of your guildmate with you want remove from office.", CSocket);
Input(8, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can remove DLs.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 8)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool t = false;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.Name == str)
{
t = true;
m.Value.isDL = false;
if (Nano.ClientPool.ContainsKey(m.Key))
{
Nano.ClientPool[m.Value.ID].Client.gpo = 50;
Guild.refresh(Nano.ClientPool[m.Value.ID]);
Spawn.All(CSocket);
break;
}
else
{
Text("The player you want to remove DL must be online.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
}
if (!t)
{
Text("You do not have that member.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
if (LinkBack == 9)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Make Allay.", 10, CSocket);
Link("Make Enemy.", 14, CSocket);
Link("Cancel Allay.", 12, CSocket);
Link("Cancel Enemy.", 16, CSocket);
Link("Back.", 0, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 10)
{
if (CSocket.Client.gpo == 100)
{
Text("Team Up with other Guild Leader and Press OK when ready.", CSocket);
Link("OK.", 11, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only Guild Leader can make alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 11)
{
if (CSocket.Client.gpo == 100)
{
if (CSocket.Client.Team != null && CSocket.Client.Team.Members.Count >= 2)
foreach (KeyValuePair<int, ClientSocket> OL in CSocket.Client.Team.Members)
if (OL.Value.Client.gpo == 100 && OL.Value.Client.ID != CSocket.Client.ID)
if (Nano.Guilds[CSocket.Client.gid].Allies.Count < 5 && Nano.Guilds[OL.Value.Client.gid].Allies.Count < 5)
if (!Nano.Guilds[CSocket.Client.gid].Allies.Contains(OL.Value.Client.gid) && !Nano.Guilds[OL.Value.Client.gid].Allies.Contains(CSocket.Client.gid))
{
Nano.Guilds[CSocket.Client.gid].Allies.Add((int)OL.Value.Client.gid);
Nano.Guilds[OL.Value.Client.gid].Allies.Add((int)CSocket.Client.gid);
if (Nano.Guilds[CSocket.Client.gid].Enemy.Contains(OL.Value.Client.gid))
Nano.Guilds[CSocket.Client.gid].Enemy.Remove(OL.Value.Client.gid);
if (Nano.Guilds[OL.Value.Client.gid].Enemy.Contains(CSocket.Client.gid))
Nano.Guilds[OL.Value.Client.gid].Enemy.Remove(CSocket.Client.gid);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[OL.Value.Client.gid]);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == OL.Value.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 7));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(OL.Value.Client.gid, 7));
Guild.refresh(cs.Value);
}
}
}
}
}
else if (LinkBack == 12)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want cancel alliance.", CSocket);
Input(13, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can cancel alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 13)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Allies.Contains(id))
Nano.Guilds[CSocket.Client.gid].Allies.Remove(id);
if (Nano.Guilds[id].Allies.Contains(CSocket.Client.gid))
Nano.Guilds[id].Allies.Remove(CSocket.Client.gid);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[id]);
CSocket.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == id && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 8));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(cs.Value);
}
}
}
}
else if (LinkBack == 14)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want to make enemy.", CSocket);
Input(15, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can make enemy guild.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 15)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Allies.Contains(id))
Nano.Guilds[CSocket.Client.gid].Allies.Remove(id);
if (Nano.Guilds[id].Allies.Contains(CSocket.Client.gid))
Nano.Guilds[id].Allies.Remove(CSocket.Client.gid);
Nano.Guilds[CSocket.Client.gid].Enemy.Add(id);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[id]);
CSocket.Send(ConquerPacket.GSend(id, 9));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == id && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 8));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 9));
Guild.refresh(cs.Value);
}
}
}
}
else if (LinkBack == 16)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want cancel enemy.", CSocket);
Input(17, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can cancel alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 17)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Enemy.Contains(id))
Nano.Guilds[CSocket.Client.gid].Enemy.Remove(id);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
CSocket.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(cs.Value);
}
}
}
}
break;
}
is this how it should look???
|
|
|
08/17/2009, 15:46
|
#21
|
elite*gold: 0
Join Date: Aug 2005
Posts: 44
Received Thanks: 69
|
Quote:
Originally Posted by gad-legion
is this how it should look???
|
Yes its look good.
|
|
|
Similar Threads
|
Guilds-Recruiting Thread (Join/Announce Guilds Here!!)
07/13/2011 - Silkroad Online - 95 Replies
Guilds-Recruiting
===
=====
=======
=========
===========
=============
|
[HELP] with Guilds
06/11/2010 - Shaiya - 6 Replies
Ok guilds dont store in database.
We can make a guild in game. but it doesnt store in database and it doesnt store the guildchars either.
When we restart server it disappears.
yes i have tried the forums and ran the sql scripts that are release but still didnt fix problem
SO im asking if anyone know why this is happening.
|
Guilds
05/26/2010 - Shaiya Private Server - 2 Replies
Ok just a quick question i had jus re-released my Shaiya Private server and i had noticed in game that there were numerous guilds i went an looked in the database an the guilds were not registered in the database how can i go about fixing that so i can actually see that and kno that if i were to restart the server it doesnt delete the guilds
|
All times are GMT +2. The time now is 01:42.
|
|