I took a look at the NPCs and it annoyed me so this is to make the system simpler.
Add this in packethandling/npcdialog.cs
Code:
public static void Text(string value, Main.GameClient GC)
{
GC.AddSend(Packets.NPCSay(value));
}
public static void Link(string value, byte linkback, Main.GameClient GC)
{
GC.AddSend(Packets.NPCLink(value, linkback));
}
public static void Face(ushort face, Main.GameClient GC)
{
GC.AddSend(Packets.NPCSetFace(face));
}
public static void End(Main.GameClient GC)
{
GC.AddSend(Packets.NPCFinish());
}
public static void Teleport(ushort map, ushort x, ushort y, Main.GameClient GC)
{
GC.MyChar.Teleport(map, x, y);
}
Example:
Code:
#region Leave TG
case 600075:
{
if (Control == 0)
{
Text("Do you want to leave this place?", GC);
Link("Yeah.", 1, GC);
Link("No, I'll stay here.", 255, GC);
Face(N.Avatar, GC);
End(GC);
}
else if (Control == 1)
{
Game.Vector2 V = (Game.Vector2)Database.DefaultCoords[GC.MyChar.Loc.PreviousMap];
Teleport(GC.MyChar.Loc.PreviousMap, V.X, V.Y, GC);
}
break;
}
#endregion
instead of
Code:
#region Leave TG
case 600075:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you want to leave this place?"));
GC.AddSend(Packets.NPCLink("Yeah.", 1));
GC.AddSend(Packets.NPCLink("No, I'll stay here.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
Game.Vector2 V = (Game.Vector2)Database.DefaultCoords[GC.MyChar.Loc.PreviousMap];
GC.MyChar.Teleport(GC.MyChar.Loc.PreviousMap, V.X, V.Y);
}
break;
}
#endregion
I did not test this a lot though, the example provided is the only NPC I tested it on.
//edit Added Teleport.
Uhm I kinda released this already.
Only thing different about yours is the Teleport.
And you need to be specific on where to add the code.
Because it won't work just anywhere in the packethandler.
Please test stuff before you release it.
Uhm I kinda released this already.
Only thing different about yours is the Teleport.
And you need to be specific on where to add the code.
Because it won't work just anywhere in the packethandler.
Please test stuff before you release it.
I didn't knew that you also released something like this.
well, this is not really useful, if you can't use all methode types
like other statements instead of teleport, cps and silvers only
But also peoples get sone work then, to add them by them selves, but most peoples is just Copy + paste xD
well, this is not really useful, if you can't use all methode types
like other statements instead of teleport, cps and silvers only
But also peoples get sone work then, to add them by them selves, but most peoples is just Copy + paste xD
[Release] 5165 Warehouses Auth System 04/01/2011 - CO2 PServer Guides & Releases - 18 Replies this is just a simple Auth system for warehouses. It will ask for password (set from WHGuardian) each time players will open their warehouse. Attempt limit is not included in this release... btw; with this release, warehouseGuardian will now save the password in Character file.
here are the screenshots:
http://img408.imageshack.us/img408/6986/98867182. jpg
Click The Image to see more screen shots
1. Go to NPCDialog.cs and search for this code:
public static void...
[Release] Flower System (5165) 09/25/2010 - CO2 PServer Guides & Releases - 71 Replies Heya!
Mostly complete... just figure a way to save it on your server....
ScreenShots:
http://img98.imageshack.us/img98/1949/164947279.j pg
http://img714.imageshack.us/img714/5372/64922998. jpg
http://img59.imageshack.us/img59/1025/64930238.jp g
[Release]Make the threading system better.[5165 NewestCOServer] 09/13/2010 - CO2 PServer Guides & Releases - 10 Replies Okay so,
I was bored so I thought I would release some easy shiz. Credits to Impulse for his Thread.cs :)
Goto Program.cs find
Console.WriteLine("The server is ready for connections.");
abit under that is the threading system. It's like
[RELEASE]Anti bot system 5165 06/15/2010 - CO2 PServer Guides & Releases - 15 Replies Here is an simple anti bot system.
Credits goes to Arco for the npc send thing :)
First go to MyThreads.cs and find:
interval = Interval;
T = new Thread(new ThreadStart(Run));
T.Start();
[RELEASE]Fully Working AFK System 5165 05/16/2010 - CO2 PServer Guides & Releases - 9 Replies Hello Elitepvpers.
I will start release things again.
I released a tdm for not long time ago, but
now i will release a fully working afk system.
If you are smart enough you can convert it with my anti bot thing.
First go to Character.cs and search for: public ulong VP;
under it put:
public bool AFK;