|
You last visited: Today at 16:08
Advertisement
[Release]My source...
Discussion on [Release]My source... within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
05/13/2010, 21:03
|
#76
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Did you rebuild the NpcDialog project? Right click on the project in C# -> Solution explorer and hit Rebuild project. It should work fine.
|
|
|
05/13/2010, 21:15
|
#77
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Ah thanks.
|
|
|
05/13/2010, 21:17
|
#78
|
elite*gold: 40
Join Date: Sep 2006
Posts: 1,890
Received Thanks: 805
|
Quote:
Originally Posted by MonstersAbroad
What is wrong with this NPC ?
Code:
#region Leave market
case 11181:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Would you like to leave the Market ? It's free!");
dialog.Option("Yes.", 1);
dialog.Option("No.", 255);
dialog.Send();
break;
}
case 1:
{
if (client.Entity.PreviousMapID == 1002) //Twincity
{
client.Entity.Teleport(1002, 400, 400);
}
if (client.Entity.PreviousMapID == 1020) // Ape mountian
{
client.Entity.Teleport(1020, 567, 576);
}
if (client.Entity.PreviousMapID == 1000) // Desert City
{
client.Entity.Teleport(1000, 500, 650);
}
if (client.Entity.PreviousMapID == 1001) //Mystic castle
{
client.Entity.Teleport(1001, 316, 642);
}
if (client.Entity.PreviousMapID == 1015) //Bird Island
{
client.Entity.Teleport(1015, 723, 573);
}
if (client.Entity.PreviousMapID == 1011) //Phoenix Castle
{
client.Entity.Teleport(1011, 190, 271);
}
else
{
client.Entity.Teleport(1002, 400, 400);
}
}
break;
}
break;
}
#endregion
EDIT:
Every npc I add does not work.
|
This could work better....
Code:
case 1: // NPC ID -- Yours may be different
ushort Map, X, Y; // Define 3 Variables as UInt16
switch (client.Entity.PreviousMapID) // Search through Previous Map
{
default: // UnDefined Map
case 1002: // Twin City
Map = 1020; X = 567; Y = 576;
break;
case 1020: // Ape Mountain
Map = 1002; X = 400; Y = 400;
break;
case 1000: // Desert City
Map = 1000; X = 500; Y = 650;
break;
case 1001: // Mystic Castle
Map = 1001; X = 316; Y = 642;
break;
case 1015: // Bird Island
Map = 1015; X = 723; Y = 573;
break;
case 1011: // Phoenix Castle
Map = 1011; X = 190; Y = 271;
break;
}
client.Entity.Teleport(Map, X, Y); // Teleport the Entity to the defined position
break;
Remember to Build Project (right click..Rebuild)
|
|
|
05/13/2010, 21:26
|
#79
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Ok thanks another question
Say I had this packet and I needed to add it where would I add it and how would the packet format be ?
Code:
public static COPacket Weather(Features.WeatherType Type, uint Intensity, uint Appearence, uint Direction)
{
byte[] Packet = new byte[8 + 20];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)0x3f8);
P.WriteInt32((byte)Type);
P.WriteInt32(Intensity);
P.WriteInt32(Direction);
P.WriteInt32(Appearence);
return P;
}
Not Packets.cs :S
|
|
|
05/13/2010, 22:05
|
#80
|
elite*gold: 0
Join Date: Apr 2010
Posts: 116
Received Thanks: 12
|
Quote:
Originally Posted by MonstersAbroad
Ok thanks another question
Say I had this packet and I needed to add it where would I add it and how would the packet format be ?
Code:
public static COPacket Weather(Features.WeatherType Type, uint Intensity, uint Appearence, uint Direction)
{
byte[] Packet = new byte[8 + 20];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)0x3f8);
P.WriteInt32((byte)Type);
P.WriteInt32(Intensity);
P.WriteInt32(Direction);
P.WriteInt32(Appearence);
return P;
}
Not Packets.cs :S
|
I think it goes in EntityTable.cs Or PacketHandler.cs
|
|
|
05/13/2010, 22:31
|
#81
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
ok so I got this errors marked in red:
Code:
#region WeatherPacket (1016)
case 0x3f8:
{
if (client.Action != 2)
return;
[COLOR="Red"][B]P[/B][/COLOR].WriteInt16((ushort)([B][COLOR="Red"]Packet[/COLOR][/B].Length - 8));
[COLOR="Red"][B]P[/B][/COLOR].WriteInt16((ushort)0x3f8);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32((byte)[COLOR="Red"][B]Type[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Intensity[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Direction[/B][/COLOR]);
[COLOR="Red"][B]P[/B][/COLOR].WriteInt32([COLOR="Red"][B]Appearence[/B][/COLOR]);
break;
}
#endregion
Sorry if it is nooby I am a NOOB at packets but am trying hard!
|
|
|
05/13/2010, 22:47
|
#82
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Network.GamePackets
{
public class Weather : Writer, Interfaces.IPacket
{
public const uint Nothing = 0x1,
Rain = 0x2,
Snow = 0x3,
RainWind = 0x4,
AutumnLeaves = 0x5,
CherryBlossomPetals = 0x7,
CherryBlossomPetalsWind = 0x8,
BlowingCotten = 0x9,
Atoms = 0xa;
byte[] Buffer;
public Weather(bool Create)
{
if (Create)
{
Buffer = new byte[20 + 8];
WriteUInt16(20, 0, Buffer);
WriteUInt16(1016, 2, Buffer);
}
}
public uint WeatherType
{
get { return BitConverter.ToUInt32(Buffer, 4); }
set { WriteUInt32(value, 4, Buffer); }
}
public uint Intensity
{
get { return BitConverter.ToUInt32(Buffer, 8); }
set { WriteUInt32(value, 8, Buffer); }
}
public uint Direction
{
get { return BitConverter.ToUInt32(Buffer, 12); }
set { WriteUInt32(value, 12, Buffer); }
}
public uint Appearance
{
get { return BitConverter.ToUInt32(Buffer, 16); }
set { WriteUInt32(value, 16, Buffer); }
}
public void Send(Client.GameState client)
{
client.Send(Buffer);
}
public byte[] ToArray()
{
return Buffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
}
}
Command:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = Weather.Rain;
weather.Direction = 255;
weather.Send(client);
break;
}
|
|
|
05/13/2010, 22:54
|
#83
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
THANKS!
|
|
|
05/13/2010, 23:00
|
#84
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Yep
|
|
|
05/13/2010, 23:05
|
#85
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
I more or less had the same packet (didn't had the "type = 0x?" part) and I used this command:
Code:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = uint.Parse(Data[1]);
weather.Intensity = uint.Parse(Data[2]);
weather.Appearance = uint.Parse(Data[3]);
weather.Direction = uint.Parse(Data[4]);
weather.Send(client);
break;
}
|
|
|
05/13/2010, 23:14
|
#86
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Nice work!
P.S: I managed to make DMaps load fully.
|
|
|
05/13/2010, 23:20
|
#87
|
elite*gold: 0
Join Date: Apr 2010
Posts: 116
Received Thanks: 12
|
Quote:
Originally Posted by -impulse-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Conquer_Online_Server.Network.GamePackets
{
public class Weather : Writer, Interfaces.IPacket
{
public const uint Nothing = 0x1,
Rain = 0x2,
Snow = 0x3,
RainWind = 0x4,
AutumnLeaves = 0x5,
CherryBlossomPetals = 0x7,
CherryBlossomPetalsWind = 0x8,
BlowingCotten = 0x9,
Atoms = 0xa;
byte[] Buffer;
public Weather(bool Create)
{
if (Create)
{
Buffer = new byte[20 + 8];
WriteUInt16(20, 0, Buffer);
WriteUInt16(1016, 2, Buffer);
}
}
public uint WeatherType
{
get { return BitConverter.ToUInt32(Buffer, 4); }
set { WriteUInt32(value, 4, Buffer); }
}
public uint Intensity
{
get { return BitConverter.ToUInt32(Buffer, 8); }
set { WriteUInt32(value, 8, Buffer); }
}
public uint Direction
{
get { return BitConverter.ToUInt32(Buffer, 12); }
set { WriteUInt32(value, 12, Buffer); }
}
public uint Appearance
{
get { return BitConverter.ToUInt32(Buffer, 16); }
set { WriteUInt32(value, 16, Buffer); }
}
public void Send(Client.GameState client)
{
client.Send(Buffer);
}
public byte[] ToArray()
{
return Buffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
}
}
Command:
case "weather":
{
Weather weather = new Weather(true);
weather.WeatherType = Weather.Rain;
weather.Direction = 255;
weather.Send(client);
break;
}
|
Awesome thanks
|
|
|
05/14/2010, 15:53
|
#88
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Your source is very bulky, it could be streamlined a hell of alot.
I would imagine the memory usage is pretty high aswell, the entire packethandler is surrounded by a try catch, not something you want to be doing.
Its fairly unique, ill give you that.
|
|
|
05/14/2010, 18:07
|
#89
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Jack,
Still bugless and very very stable.
|
|
|
05/14/2010, 19:42
|
#90
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Quote:
Originally Posted by MonstersAbroad
Jack,
Still bugless and very very stable.
|
I never said it wasnt, theres just plenty of room for improvement.
|
|
|
|
|
Similar Threads
|
[RELEASE] [OPEN SOURCE] CE 5.5 Pointer to AutoIt Source-Code
02/13/2011 - AutoIt - 6 Replies
Habe heute erst gemerkt, dass es hier eine AutoIt Sektion gibt xD also poste ich mal mein Programm mit rein.
Funktionsweise:
1. in CE Rechtsklick auf den Pointer und auf "Copy" klicken
2. in meinem Programm auf "Code generieren" klicken
3. In euer Scite gehen und einfügen
Hier ist der Source Code vom Programm:
|
[Release]How To Make Tq Source Work + Working Source + Server ByBass + Commands
12/08/2008 - CO2 PServer Guides & Releases - 15 Replies
1: How To Make The Server Work
In fact, before other people did not just let ACC now with hi EACC Columbia landing on the settlement of the issue, and the rest is our own how to improve the content of those interested can improve the next. MY MY set and the same. INI MAP INI files and MAP with the client-to-date coverage of the account. server.dat ! And then as long as the client will be able to modify server.dat!
127.0.0.1 192.168.0.1 192.168.1.1 IP。 Please do generally use...
|
All times are GMT +2. The time now is 16:08.
|
|