[All-in-one]Everything You need For CoEmu V.2 Source

07/05/2009 21:05 mihai_v13#31
Quote:
Originally Posted by pro4never View Post
Thanked cause I use this thread alot, hard to find some of these sometimes cause they all move around so nice to have them all on one page. Great reference for ppl to learn some basics and see examples of codes.


Ps: If you are still updating, some ppl might find this useful.

[Only registered and activated users can see links. Click Here To Register...]

Very simple script but hey, someone might find it useful :P


I may post some more scripts I have done later, although I'm afraid most of them are very messy and most of them rather poorly coded lol
Thanks coz u like it^^

#updated
Added: [Only registered and activated users can see links. Click Here To Register...]
07/05/2009 21:22 pro4never#32
Quote:
Originally Posted by mihai_v13 View Post
Thanks coz u like it^^

#updated
Added: [Only registered and activated users can see links. Click Here To Register...]
Another small release, this one bit more useful as a code example (at least imo)


[Only registered and activated users can see links. Click Here To Register...]
07/05/2009 21:23 mihai_v13#33
Quote:
Originally Posted by pro4never View Post
Another small release, this one bit more useful as a code example (at least imo)


[Only registered and activated users can see links. Click Here To Register...]
allready added..lol:D
07/05/2009 21:25 pro4never#34
Quote:
Originally Posted by mihai_v13 View Post
allready added..lol:D
well, you sure are productive today lol.


Yes... I'm wasting time on forums to procrastinate actually starting to code today... I've been putting it off for 2-3 days. Although "putting it off" Isn't really the right word when my internet has been out lol, that part can't be blamed on me.
07/05/2009 21:29 mihai_v13#35
Quote:
Originally Posted by pro4never View Post
well, you sure are productive today lol.


Yes... I'm wasting time on forums to procrastinate actually starting to code today... I've been putting it off for 2-3 days. Although "putting it off" Isn't really the right word when my internet has been out lol, that part can't be blamed on me.
yup this is a productive day :cool:
good luck in codding:P i`ll add your threads if i`ll see them
07/05/2009 21:34 n0mansland#36
Everyone is productive today lol BrokeN with a new source more releases and I might release a source of my own (CoEmuV2) If i can get some more npcs done today..
07/05/2009 21:36 pro4never#37
Quote:
Originally Posted by n0mansland View Post
Everyone is productive today lol BrokeN with a new source more releases and I might release a source of my own (CoEmuV2) If i can get some more npcs done today..
Everyone except me :(


I've finished all of like 3 lines of code today (revamped my existing herocard code to add in the random 500 cp reward w/ broadcast)


What all you got done in the source you plan on releasing? :O.... I'm always interested in more code examples lol. Lemme know if you do decide to release it.

I plan on looking into xp skills and passive skills today... and I know if I start I'm gonna be up all night trying to struggle through them Q.Q
07/05/2009 21:39 n0mansland#38
Well I'm not gonna make it so that there's coding to be done (Not like there ever isn't) My goal is to get every NPC done take out some of the KEY NPCS that I can't do o.O like tinter and stuff... Besides most npcs I got some other crap done like the 3 in 1 bundle medicines work etc. Added a pk map system where you can go to TC and BI Pk Maps for 100k and get free pots there also.. Just little stuff like that
07/05/2009 21:45 pro4never#39
Quote:
Originally Posted by n0mansland View Post
Well I'm not gonna make it so that there's coding to be done (Not like there ever isn't) My goal is to get every NPC done take out some of the KEY NPCS that I can't do o.O like tinter and stuff... Besides most npcs I got some other crap done like the 3 in 1 bundle medicines work etc. Added a pk map system where you can go to TC and BI Pk Maps for 100k and get free pots there also.. Just little stuff like that
awww I was hoping maybe you had skills or other stuff like that done so I could see some examples lol.

Right now main things I really wanna get done are passive skills, xp skills, guilds, guild war and finish my socketing npc


Socketer I have is all coded, I just have to finish the actual socketing part of it (I remember kinda how to do it... I just haven't actually done it yet lol)
07/05/2009 21:47 n0mansland#40
Quote:
Originally Posted by pro4never View Post
awww I was hoping maybe you had skills or other stuff like that done so I could see some examples lol.

Right now main things I really wanna get done are passive skills, xp skills, guilds, guild war and finish my socketing npc


Socketer I have is all coded, I just have to finish the actual socketing part of it (I remember kinda how to do it... I just haven't actually done it yet lol)
Like ArtisanOu? I can't figure out how to make the NPC Check Items and Delete items but I do know how to make them add items though.. Think you could help me on that?

I'll help you try and figure out the socketing part.. I'm not sure what to put though but I'll try to figure it out..

Skills are too complicated :D
07/05/2009 22:07 pro4never#41
Quote:
Originally Posted by n0mansland View Post
Like ArtisanOu? I can't figure out how to make the NPC Check Items and Delete items but I do know how to make them add items though.. Think you could help me on that?

I'll help you try and figure out the socketing part.. I'm not sure what to put though but I'll try to figure it out..

Skills are too complicated :D
You don't know how to make it check and remove items?

Simple, just check how it's done in a met/db scroll maker or the met/db storage npc.


here's sample section of code I use for my met/db storage npc (it's modified from the one posted on here, it stores mets/db's as separate values in database and spits out how many you currently have stored

Code:
else if (LinkBack == 4)
                        {
                            int GMUID = 0;
                            int GMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 720028)
                                {
                                    GMUID = Item.UID;
                                    GMcount++;
                                }
                            }
                            if (GMcount >= 1)
                            {
                                DBPoint(+10, CSocket);
                                CSocket.Client.Inventory.Remove(GMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(GMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(GMUID);
                                Database.Database.SaveMetPoint(CSocket);
                                Text("You know have " + CSocket.Client.DbPoint + " DbPoints", CSocket);
                                Link("Thanks", 255, CSocket);
                                Link("I have more", 5, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You Dont have the item", CSocket);
                                Link("Ok", 255, CSocket);
                                End(CSocket);
                            }
                        }
so the check part is simply


Code:
 int GMUID = 0;
                            int GMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 720028)
                                {
                                    GMUID = Item.UID;
                                    GMcount++;
                                }
                            }
It's saying start with the id being 0 (so it gets the id during the foreach part) and count starts at 0

The item id is in there and it checks how many and counts them up.

The remove part of the code is simply

Code:
                            {                               
                                CSocket.Client.Inventory.Remove(GMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(GMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(GMUID);  
                                End(CSocket);
                            }
Notice it is still using the GMUID variable. You can have it set to whatever you need for the npc or add in if statements in the original, use a database, etc.
07/05/2009 22:13 n0mansland#42
Mmm ok I saw that before but didn't know what was needed and not needed.. So thanks :)
07/05/2009 22:23 pro4never#43
Quote:
Originally Posted by n0mansland View Post
Mmm ok I saw that before but didn't know what was needed and not needed.. So thanks :)
I'm sure sections of it can be cut out, I just know I've used lots of little sections from the met/db scroll scripts for different functions

(Just added some placeholder items to give players 10 random scrolls/magic gates/hero cards so they can test them instead of having to spawn them individually)

Those scripts are realllyy useful for all sorts of applications. The met/db packer, the met/db storage and the met/db use (under useitem.cs) get used all the time lol

PS: you have msn? add me [Only registered and activated users can see links. Click Here To Register...]
07/20/2009 13:43 gad-legion#44
idk if pk points remove was posted yet so ill release it here :
in Character.cs after code:
Quote:
public Timer FlashTimer;
add code:
Quote:
public Timer PkRemove;
In ClientSocket.cs after code :
Quote:
public void AddStam()
{
if(!Client.Dead)
{
if(Client.CurrentStam < 100)
{
if(Client.CurrentStam != 99)
{
Client.CurrentStam += 2;
Send(ConquerPacket.Status(this, 2, Client.CurrentStam, Struct.StatusTypes.Stamina));
}
else
{
Client.CurrentStam += 1;
Send(ConquerPacket.Status(this, 2, Client.CurrentStam, Struct.StatusTypes.Stamina));
}
}
}
}
add code :
Quote:
public void RemPKP()
{
if (Client.PkPoints > 0)
{
Client.PkPoints -= 1;
Send(ConquerPacket.Status(this, 2, Client.PkPoints, Struct.StatusTypes.PKPoints));
}
}
In PacketProcessor.cs after code :
Quote:
CSocket.Client.UpStam = new System.Timers.Timer();
CSocket.Client.UpStam.Interval = 850;
CSocket.Client.UpStam.Elapsed += delegate { CSocket.AddStam(); };
add code:
Quote:
CSocket.Client.PkRemove = new System.Timers.Timer();
CSocket.Client.PkRemove.Interval = (60000 * 6);
CSocket.Client.PkRemove.Elapsed += delegate { CSocket.RemPKP(); };
CSocket.Client.PkRemove.Enabled = true;
CSocket.Client.PkRemove.Start();
i think thats all
10/15/2009 18:39 edy1994#45
Very nice...thx :)