Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 21:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Extremely basic (but working/bugless) C# Source

Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old 04/26/2009, 19:36   #76
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by alexbigfoot View Post
why would I? I mean its not a big difference. It works the same...
anyway as you wish
Switches are quicker and less resource using since they don't carry out each argument, they go straight to the case.
kinshi88 is offline  
Thanks
1 User
Old 04/26/2009, 23:31   #77
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Quote:
Originally Posted by kinshi88 View Post
Switches are quicker and less resource using since they don't carry out each argument, they go straight to the case.
That's not strictly true. The code needs to fall through each case and check its value before deciding whether or not to execute it's contents. It will though, stop falling through each after executing your code when you put a break in there. To the machine though, the difference between using a switch and if/else statements is negligible

The real difference between the two is from the programmers point of view. swicthes are more self-descriptive when used properly. It's easier to read and follow through compared with if/elses. It's easier to write the code as a switch, and mainly, it's much easier to maintain (ie, by changing values, adding additional cases etc).
unknownone is offline  
Old 04/27/2009, 00:27   #78
 
Ultimatum's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 277
Received Thanks: 52
Quote:
Originally Posted by unknownone View Post
The real difference between the two is from the programmers point of view. swicthes are more self-descriptive when used properly. It's easier to read and follow through compared with if/elses. It's easier to write the code as a switch, and mainly, it's much easier to maintain (ie, by changing values, adding additional cases etc).
I agree with the fact that switches are more cleaner in a script. I allways use switches in my scripts, and only use if/else statements if the varible's im using are say 2 or below.

Also theres another point about switches. If you do use switches the compiler will optimize it to a look up table, and with if/else statements cannot. The only downside to switches is the fact that you can't use a single varible to define as the case. You have to use the constant value.
Ultimatum is offline  
Old 04/27/2009, 00:44   #79
 
LordSesshomaru's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 48
Received Thanks: 15
Quote:
Originally Posted by ElDeRnEcRo View Post
Here`s a very minor release, a GM-Broadcast-thing command. I know that it`s not much but I just started working on the source XD.

@announce command

// change the color if you wish

Usage : @announce Your~text~goes~here
For you code it is only Client Sided that way to make it so other players will see it you would have to add something like this

Code:
foreach (GameClient Cli in Kernel.GamePool.Values)
                            { Cli.Send(new MessagePacket(Message, Client.Entity.Name, 0xFFFFFFF, MessagePacket.Center)); }
Thanks to Alexbigfoot for that one
LordSesshomaru is offline  
Old 04/27/2009, 10:47   #80
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Quote:
Originally Posted by ElDeRnEcRo View Post
case "@announce":
{
string msg = args[1];
string Message = msg.Replace("~", " ");
Client.Send(new MessagePacket(Message, 0x00FF0000, MessagePacket.Center));
break;
}
Code:
case "@announce":
{
string Message = args[1];
for(int x = 2; x < args.Lenght; x ++)
Message += args[x];
foreach (GameClient Cli in Kernel.GamePool.Values)
{ Cli.Send(new MessagePacket(Message, Client.Entity.Name, 0xFFFFFFF, MessagePacket.Center)); }
break;
}
^ The code I use in my server.
alexbigfoot is offline  
Old 04/28/2009, 02:51   #81
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Here's my noobie attacking.
Its not finished yet, but I guess its a start.
If anyone wants to help me improve/finish it, that would be great =P
Attached Files
File Type: txt NoobyAttacking.kin.txt (7.0 KB, 92 views)
kinshi88 is offline  
Thanks
1 User
Old 04/30/2009, 23:59   #82
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by felipeboladao View Post
InfamousNoone, To make the Sell Shop and Shopping Mall ,i need of?

Tranks ;D
case 1009 in the Packet Processor.
Use ItemUsagePacket.BuyFromNPC.

Attached is the script to buy items from NPCs
Attached Files
File Type: txt Buy From Npc.cs.txt (3.5 KB, 79 views)
kinshi88 is offline  
Old 05/04/2009, 23:38   #83
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
#Thread Cleaned

(It may look like I'm triple posting, but technically I'm not..)
kinshi88 is offline  
Old 05/05/2009, 14:31   #84
 
elite*gold: 0
Join Date: Jul 2006
Posts: 46
Received Thanks: 3
Yo can someone help me?
I'm trying to add prof's i saw Alex's Prof class and I downloaded Tao's 3.1 Rev.
I see that Alex's prof class looks like the ProfPacket class from Tao's 3.1 Rev.
But I don't really know how to use Tao's class I think its sorta same as Alex's
I guess: ProfPacket club = new ProfPacket(); club.ID = 480; club.Level = 19; club.Experience = 192321; Client.Send(club.Serialize());

Thats how I think its used, but I need a bit more info :P
Where do I need to code something that will add the prof to the client?
Like when i use @prof 480 20 it has to give me prof level 20 of Club :P
I have a feeling its done with Client.Send(club.Serialize()); but I dont really know.

Uhm about saving in in the database I think I need to make an Array of Prof's
like its done with Items and then make a folder like Inventory but then I name it Profiency. And loading it from the database is sorta same as loading Inventory I think?

Please help me
Thnx in advance,
Taus
taushif is offline  
Old 05/05/2009, 16:55   #85
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
this goes to commands class:
Code:
#region Proficiency
case "@prof":
{
Client.SetProficiency(new Proficiency(ushort.Parse(args[1]), ushort.Parse(args[2]), 0);
break;
}
#endregion
But be sure you`ve got in your gameclient class SetProficiency(Proficiency prof)

if you dont use this:
Code:
public bool SetProficiency(Proficiency prof)
{
lock(Proficiencys)
{
if(Proficiencys.ContainsKey(prof.ID)
Proficiencys[prof.ID] = prof;
else
Proficiencys.Add(prof.ID, prof);
Send(prof.Serialize());
}
}
Also you may need the proficiencys dictionary.
Code:
public Dictionary<ushort, Proficiency> Proficiency = new Dictinary<ushort, Proficiency>(50);
Usage: @prof 480 20

You`ve got to do the save part by your own. Good luck!
alexbigfoot is offline  
Old 05/05/2009, 22:05   #86
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
If you just use my rev it has a method called Client.LearnProf, which either updates or completely learns a proficiency.
tao4229 is offline  
Old 05/06/2009, 17:47   #87
 
elite*gold: 0
Join Date: Jul 2006
Posts: 46
Received Thanks: 3
Thnx very much for responding and for ur information both Alex and tao.
I got another question :P If i use the command @prof 480 2 or any numer :P it doesn't show anything in the prof list in the client. I think its because there isn't coded which Prof ID is which Prof like Prof 480 is club and it doesn't do anything I think. If its true what I say can you tell me where to code that and maybe give me 1 example how you coded 1 prof? I learned Java and thats very similar to C++ so its not hard to understand code for me :P
taushif is offline  
Old 05/06/2009, 23:54   #88
 
hok30's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 1,366
Received Thanks: 256
Quote:
Originally Posted by taushif View Post
I learned Java and thats very similar to C++ so its not hard to understand code for me :P
That's good, but this is C#.

btw, I hate Java. And JavaScript. and HTML. If that even counts as a scripting language.
hok30 is offline  
Old 05/07/2009, 00:33   #89
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
ooo wonder when rev4 will come out lol..Im having trouble with rev3
PeTe Ninja is offline  
Old 05/07/2009, 01:36   #90
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by PeTe Ninja View Post
ooo wonder when rev4 will come out lol..Im having trouble with rev3
Won't be one (at least not from Hybrid).
Hybrid has stopped development on this.
kinshi88 is offline  
Closed Thread


Similar Threads Similar Threads
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source!
02/19/2010 - CO2 PServer Guides & Releases - 30 Replies
Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY! NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE! 1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...) #region BirthOldGeneralYang case 425: {
[FINAL RELEASE]HuB- Source (BASIC) (Original LOTF easier workable)
11/14/2009 - CO2 PServer Guides & Releases - 25 Replies
#REMOVED
[RELEASE] Basic LOTF Source
09/03/2009 - CO2 PServer Guides & Releases - 17 Replies
hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame What it has... - LuckyTime - Guard - 24/7 GW



All times are GMT +1. The time now is 21:02.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.