|
You last visited: Today at 19:01
Advertisement
KO Count on player spawn
Discussion on KO Count on player spawn within the CO2 Private Server forum part of the Conquer Online 2 category.
11/07/2014, 10:12
|
#1
|
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
|
KO Count on player spawn
Ok, so KO count shows correctly if another player kills a mob while it's in your view, but on spawn, the KO count is initially showed as zero.
Does entity spawn packet presents some way so I can set the KO count to be displayed? Or what's the usual way to do this.
|
|
|
11/07/2014, 11:22
|
#2
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 706
|
As far as I know it is part of the kill packet. If you are using the projectx source, the data value is hardcoded 0 or should be. Simply change that value to kill count and it should work.
|
|
|
11/07/2014, 11:57
|
#3
|
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
|
I changed that. And, as I said, it works if the other kills while you're seeing it. But, when the other enters your screen, initial KO count above his head is 0. Only after killing another mob that one is updated (naturally, since a new kill packet is send).
I just wonder how to see the KO count above the other player head with the current value right from spawn. Maybe sending a fake kill packet?
|
|
|
11/07/2014, 12:07
|
#4
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 706
|
It should just work by sending the kill packet. Can you show me what you have?
This is what I have:
In ProjectX_V3_Game\Entities\GameClient.cs
Code:
/// <summary>
/// The XP kills holder
/// </summary>
private int _xpkills;
/// <summary>
/// Gets or sets the XP kills
/// </summary>
public int XPKills
{
get { return _xpkills; }
set { _xpkills = value; }
}
In ProjectX_V3_Game\Packets\Interaction\Battle\Combat .cs
public static void Kill(Entities.IEntity attacker, Entities.IEntity attacked, uint damage = 0)
Code:
using (var killpacket = new Packets.InteractionPacket())
{
killpacket.Action = Enums.InteractAction.Kill;
killpacket.TargetUID = attacked.EntityUID;
killpacket.X = attacked.X;
killpacket.Y = attacked.Y;
if (attacker != null)
{
killpacket.EntityUID = attacker.EntityUID;
// Possible flag check can be added here. Depends on how you have your XP system build.
killpacket.KoCount = (ushort)(attacker as Entities.GameClient).XPKills;
attacker.Screen.UpdateScreen(killpacket);
if (attacker is Entities.GameClient)
(attacker as Entities.GameClient).Send(killpacket);
}
else
{
killpacket.EntityUID = 0;
attacked.Screen.UpdateScreen(killpacket);
if (attacked is Entities.GameClient)
(attacked as Entities.GameClient).Send(killpacket);
}
}
|
|
|
11/07/2014, 12:33
|
#5
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Check Redux, there is a working KO count in there.
|
|
|
11/07/2014, 14:17
|
#6
|
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
|
I have something similar;
In GameClient.cs
Code:
/// <summary>
/// Gets or sets the KOCount
/// </summary>
private ushort _kocount;
/// <summary>
/// Gets or sets the KO Task
/// </summary>
private uint _kotask;
/// <summary>
/// Gets or sets the KOCount
/// </summary>
/// <param name="KOCount"></param>
/// <returns></returns>
public ushort KOCount
{
get { return _kocount; }
set
{
_kocount = value;
}
}
/// <summary>
/// Gets or sets the KOTask
/// </summary>
/// <param name="KOTask"></param>
/// <returns></returns>
public uint KOTask
{
get { return _kotask; }
set
{
_kotask = value;
}
}
/// <summary>
/// Gets or sets the XPPct
/// </summary>
private byte _xppct;
/// <summary>
/// Gets or sets the XPPct
/// </summary>
/// <param name="XPPct"></param>
/// <returns></returns>
public byte XPPct
{
get { return _xppct; }
set
{
_xppct = (byte)(value > Core.NumericConst.MaxXPPct ? Core.NumericConst.MaxXPPct : value);
}
}
/// <summary>
/// Gets OnXP status.
/// </summary>
public bool OnXP
{
get {
return
ContainsFlag1(Enums.Effect1.Cyclone) ||
ContainsFlag1(Enums.Effect1.Superman) ||
ContainsFlag1(Enums.Effect1.FatalStrike);
}
}
In Combat.cs
Code:
using (var killpacket = new Packets.InteractionPacket())
{
killpacket.Action = Enums.InteractAction.Kill;
killpacket.TargetUID = attacked.EntityUID;
killpacket.X = attacked.X;
killpacket.Y = attacked.Y;
killpacket.Data = 1;
if (attacker != null)
{
killpacket.EntityUID = attacker.EntityUID;
attacker.Screen.UpdateScreen(killpacket);
if (attacker is Entities.GameClient)
{
(attacker as Entities.GameClient).XPPct += 1;
if ((attacker as Entities.GameClient).OnXP)
{
(attacker as Entities.GameClient).KOCount += 1;
ProjectX_V3_Lib.Threading.DelayedTask.Postpone((attacker as Entities.GameClient).KOTask, 1000);
killpacket.KoCount = (attacker as Entities.GameClient).KOCount;
}
//(attacker as Entities.GameClient).Send(killpacket);
(attacker as Entities.GameClient).SendToScreen(killpacket,true);
}
}
else
{
killpacket.EntityUID = 0;
attacked.Screen.UpdateScreen(killpacket);
if (attacked is Entities.GameClient)
(attacked as Entities.GameClient).Send(killpacket);
}
}
I've changed
Code:
(attacker as Entities.GameClient).Send(killpacket);
to
Code:
(attacker as Entities.GameClient).SendToScreen(killpacket,true);
so the others can see your KO count, when you're killing a mob.
Aceking, I'll check Redux, thanks. Or I'll see what I can do in spawn packet, to send a fake interact packet with the KO count from there, if the spawned client is OnXP.
|
|
|
11/07/2014, 16:55
|
#7
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Quote:
Originally Posted by donn
I have something similar;
In GameClient.cs
Code:
/// <summary>
/// Gets or sets the KOCount
/// </summary>
private ushort _kocount;
/// <summary>
/// Gets or sets the KO Task
/// </summary>
private uint _kotask;
/// <summary>
/// Gets or sets the KOCount
/// </summary>
/// <param name="KOCount"></param>
/// <returns></returns>
public ushort KOCount
{
get { return _kocount; }
set
{
_kocount = value;
}
}
/// <summary>
/// Gets or sets the KOTask
/// </summary>
/// <param name="KOTask"></param>
/// <returns></returns>
public uint KOTask
{
get { return _kotask; }
set
{
_kotask = value;
}
}
/// <summary>
/// Gets or sets the XPPct
/// </summary>
private byte _xppct;
/// <summary>
/// Gets or sets the XPPct
/// </summary>
/// <param name="XPPct"></param>
/// <returns></returns>
public byte XPPct
{
get { return _xppct; }
set
{
_xppct = (byte)(value > Core.NumericConst.MaxXPPct ? Core.NumericConst.MaxXPPct : value);
}
}
/// <summary>
/// Gets OnXP status.
/// </summary>
public bool OnXP
{
get {
return
ContainsFlag1(Enums.Effect1.Cyclone) ||
ContainsFlag1(Enums.Effect1.Superman) ||
ContainsFlag1(Enums.Effect1.FatalStrike);
}
}
In Combat.cs
Code:
using (var killpacket = new Packets.InteractionPacket())
{
killpacket.Action = Enums.InteractAction.Kill;
killpacket.TargetUID = attacked.EntityUID;
killpacket.X = attacked.X;
killpacket.Y = attacked.Y;
killpacket.Data = 1;
if (attacker != null)
{
killpacket.EntityUID = attacker.EntityUID;
attacker.Screen.UpdateScreen(killpacket);
if (attacker is Entities.GameClient)
{
(attacker as Entities.GameClient).XPPct += 1;
if ((attacker as Entities.GameClient).OnXP)
{
(attacker as Entities.GameClient).KOCount += 1;
ProjectX_V3_Lib.Threading.DelayedTask.Postpone((attacker as Entities.GameClient).KOTask, 1000);
killpacket.KoCount = (attacker as Entities.GameClient).KOCount;
}
//(attacker as Entities.GameClient).Send(killpacket);
(attacker as Entities.GameClient).SendToScreen(killpacket,true);
}
}
else
{
killpacket.EntityUID = 0;
attacked.Screen.UpdateScreen(killpacket);
if (attacked is Entities.GameClient)
(attacked as Entities.GameClient).Send(killpacket);
}
}
I've changed
Code:
(attacker as Entities.GameClient).Send(killpacket);
to
Code:
(attacker as Entities.GameClient).SendToScreen(killpacket,true);
so the others can see your KO count, when you're killing a mob.
Aceking, I'll check Redux, thanks. Or I'll see what I can do in spawn packet, to send a fake interact packet with the KO count from there, if the spawned client is OnXP.
|
That's what happens on official conquer. If you first go on screen of someone with a KO count it shows as 0 till they kill something IIRC.
The client only knows your KO count when you actually kill a monster and the kill packet is sent (to screen)
|
|
|
11/07/2014, 17:48
|
#8
|
elite*gold: 0
Join Date: Jan 2007
Posts: 485
Received Thanks: 272
|
Looks like I tend to think further then TQ does then.
|
|
|
 |
Similar Threads
|
[Mini-Release] Player Count & Guild Identifier
10/13/2014 - Flyff PServer Guides & Releases - 22 Replies
Channel Player Count
Look for this void CWndSelectServer::OnInitialUpdate()
do this one:
if( g_dpCertified.m_aServerset.dwParent == pServerDesc->dwID )
{
lCount = g_dpCertified.m_aServerset.lCount;
lMax = g_dpCertified.m_aServerset.lMax;
|
Getting player count out of gamelist
02/09/2013 - Diablo 2 Programming - 0 Replies
hi all,
is there any possibility to get the players count out of the gamelist (before joining random game)?
http://i.epvpimg.com/Fc6Wg.jpg
thx for your help :)
|
[Question] About Ctf / Ba player count
12/31/2012 - SRO Private Server - 4 Replies
How to make it from 8 vs 8 to another number , eg :3 vs 3 , does anybody know .
|
Single spawn / group spawn player problem
11/05/2012 - SRO Coding Corner - 15 Replies
Hey guys,
I try to parse the player spawn packets so i can get the playerames / guildnames and items.
Now im almost got all the information more sometimes my parser fails when ppl teleported.
Is there something that i missed after a player teleported ?
My parse code: public static void ParseChar(PacketReader packet, uint model) { - Pastebin.com
|
how to change max player count in sea emu?
05/21/2010 - SRO Private Server - 4 Replies
^
|
All times are GMT +1. The time now is 19:01.
|
|