|
You last visited: Today at 02:20
Advertisement
[Question]BattlePower
Discussion on [Question]BattlePower within the CO2 Private Server forum part of the Conquer Online 2 category.
02/16/2012, 11:16
|
#1
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
[Help]PkPoints
i have pkpoints sorta working when i kill someone it increases the pkpoints but it doesnt show on the status window of the character but when u go into the friends list it shows there pk points.

-----------------------------------------------------------------------

|
|
|
02/16/2012, 11:18
|
#2
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
1 - BattlePower?
Why o.o
|
|
|
02/16/2012, 11:22
|
#3
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
because its part of the source
|
|
|
02/16/2012, 11:24
|
#4
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
I meant, why 1 and then - it with battlepower o.o
|
|
|
02/16/2012, 11:26
|
#5
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
i dont know i was trying to use the other stuff in the code as a template thats why i made this topic
|
|
|
02/16/2012, 11:38
|
#6
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
damage *= 1
Is the same as damage, but you always calculate on the right side of the equal sign, so it would be 1 - battlepower. I assume you already know that as it's common math.
However it would be like this (1 - battlepower) it would give a negative result, but 1 above than the actual battlepower result. It would be more reasonable to do it like below.
Code:
damage *= (0 - battlepower);
The 1 is not needed at all. It t's because you needed a negative value, you could just used 0.
|
|
|
02/16/2012, 14:34
|
#7
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
#edited
|
|
|
02/17/2012, 15:30
|
#8
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
Seriously not a soul on this forum can help me with this problem
|
|
|
02/17/2012, 15:36
|
#9
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
Something like this.
Code:
private ushort pkpoints;
public ushort PkPoints
{
get
{
return pkpoints;
}
set
{
value = (ushort)((value >= 1000) ? 1000 : value);
if (value > 29 && value < 100)
{
this.RemoveFlag1(Effect1.BlackName);
this.AddFlag1(Effect1.RedName);
}
else if (value >= 100)
{
this.RemoveFlag1(Effect1.RedName);
this.AddFlag1(Effect1.BlackName);
}
else if (value >= 0 && value < 30)
{
this.RemoveFlag1(Effect1.RedName);
this.RemoveFlag1(Effect1.BlackName);
}
pkpoints = value;
DB.Update(DBUpdate.PKPoints, pkpoints);
Send(Packet.UpdatePacket.Create(UID, UpdateType.PkPt, pkpoints));//This is the line you need. All you need is sending an update packet with the PKPoints type to the user.
}
}
|
|
|
02/20/2012, 05:24
|
#10
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
Quote:
Originally Posted by I don't have a username
Something like this.
Code:
private ushort pkpoints;
public ushort PkPoints
{
get
{
return pkpoints;
}
set
{
value = (ushort)((value >= 1000) ? 1000 : value);
if (value > 29 && value < 100)
{
this.RemoveFlag1(Effect1.BlackName);
this.AddFlag1(Effect1.RedName);
}
else if (value >= 100)
{
this.RemoveFlag1(Effect1.RedName);
this.AddFlag1(Effect1.BlackName);
}
else if (value >= 0 && value < 30)
{
this.RemoveFlag1(Effect1.RedName);
this.RemoveFlag1(Effect1.BlackName);
}
pkpoints = value;
DB.Update(DBUpdate.PKPoints, pkpoints);
Send(Packet.UpdatePacket.Create(UID, UpdateType.PkPt, pkpoints));//This is the line you need. All you need is sending an update packet with the PKPoints type to the user.
}
}
|
it works but when u logout then back on again it stops showing
|
|
|
02/20/2012, 10:06
|
#11
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
Are you sure you save PKPoints or load them proper?
|
|
|
02/20/2012, 14:53
|
#12
|
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
|
yes
Logout
Code:
public static void Logout(Player player)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
command.Update("Characters")
.Set("X", player.X)
.Set("Y", player.Y)
.Set("Map", player.MapID)
.Set("Profession1", player.Profession)
.Set("Level", player.Level)
.Set("Health", player.Health)
.Set("Mana", player.Mana)
.Set("Strength", player.Strength)
.Set("StatPoints", player.StatPoint)
.Set("Agility", player.Agility)
.Set("Spirit", player.Spirit)
.Set("Vitality", player.Vitality)
[B].Set("Pk", player.PkPts)[/B]
.Set("Mesh", player.Body)
.Set("Avatar", player.Face)
.Set("Hair", player.Hair)
.Set("Name", player.Name)
.Set("Money", player.Money)
.Set("Experience", player.Experience)
.Set("Cp", player.CP)
.Set("Title", (byte)player.Title)
.Where("UID", player.UID)
.Execute();
}
Login
Code:
public static bool PullLogin(Player user)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.SELECT);
command.Select("Characters").Where("UID", user.UID);
MySqlReader reader = new MySqlReader(command);
if (reader.Read())
{
user.Spouse = reader.ReadString("Spouse");
user.Name = reader.ReadString("Name");
user.Experience = reader.ReadUInt64("Experience");
user.Profession = reader.ReadByte("Profession1");
user.Level = reader.ReadByte("Level");
user.Strength = reader.ReadUInt16("Strength");
user.Agility = reader.ReadUInt16("Agility");
user.Vitality = reader.ReadUInt16("Vitality");
user.Spirit = reader.ReadUInt16("Spirit");
user.StatPoint = reader.ReadUInt16("StatPoints");
user.Health = reader.ReadUInt16("Health");
user.Mana = reader.ReadUInt16("Mana");
Enum.TryParse(reader.ReadString("Language"), out user.Lang);
user.MapID = reader.ReadUInt32("Map");
user.PreviousMap = reader.ReadUInt32("PreviousMap");
user.X = reader.ReadUInt16("X");
user.Y = reader.ReadUInt16("Y");
[B]user.PkPts = reader.ReadInt16("Pk");[/B]
user.Money = reader.ReadUInt32("Money");
user.WarehouseMoney = reader.ReadUInt32("WhMoney");
user.CP = reader.ReadUInt32("Cp");
user.VirtuePoints = reader.ReadUInt32("VirtuePoints");
user.Body = reader.ReadUInt16("Mesh");
user.Face = reader.ReadUInt16("Avatar");
user.Hair = reader.ReadUInt16("Hair");
user.Title = (PlayerTitle) reader.ReadByte("Title");
user.LastPatch = reader.ReadUInt16("LastPatch");
user.NobilityDonation = reader.ReadInt64("Donation");
try
{
user.ExpBoostEnds = DateTime.Parse(reader.ReadString("ExpTimeExpires"));
user.LuckyTimeEnds = DateTime.Parse(reader.ReadString("LuckyTimeExpires"));
user.BlessingEnds = DateTime.Parse(reader.ReadString("HeavenBlessExpires"));
}
catch { }
PullArenaStatistics(user);
}
return !string.IsNullOrEmpty(user.Name);
}
|
|
|
Similar Threads
|
battlepower question
05/18/2009 - CO2 Private Server - 3 Replies
is it possable to remove the damage cap potency gives and prehaps change it to a damage bonus? if so how would you go about doing this?
|
All times are GMT +1. The time now is 02:21.
|
|