|
You last visited: Today at 00:18
Advertisement
ProjectX V3.2 Source
Discussion on ProjectX V3.2 Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
12/17/2013, 22:36
|
#61
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Won't be posting anymore updates, bug fixes for the source, but I will still be available to help and answer questions. The reason is simply that I am coding a server for someone using this source, so I won't have time to adapt fixes for both as the source I'm writing for the specific server has a lot of new things implemented which may not be compatible with this source, as well a lot of optimization.
First of all the threading needs some optimization.
Here is a preview of how it can be done better.
Code:
//Project by BaussHacker aka. L33TS
using System;
using ProjectX_V3_Lib.Threading;
namespace ProjectX_V3_Game.Threads
{
/// <summary>
/// Handling all threads.
/// </summary>
public class GlobalThreads
{
public static void Start()
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Starting the global threads...");
new QueueThread(BroadcastThread.Handle, Core.TimeIntervals.BroadcastWaitTime, "BroadcastThread").Start();
MonsterThread.StartThreads();
new QueueThread(Thread100, 100, "100MS Thread").Start();
new QueueThread(Thread500, 500, "500MS Thread").Start();
new QueueThread(Thread12000, 12000, "12000MS Thread").Start();
Core.TimedActions.Load();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Started global threads...");
Console.ResetColor();
}
static void Thread100()
{
PlayerThread.Handle();
ActionThread.Handle();
}
static void Thread500()
{
BotThread.Handle();
}
static void Thread12000()
{
TimeThread.Handle();
NPCDBThread.Handle();
DynamicMapThread.Handle();
}
}
}
I will let you know a few bugs tho that I can remember.
In the screen handler, it will send removeentity even if there is no entities in the screen, but is in the map. Just remove the "else { ... }" from the 2nd loop in the UpdateScreen() method.
The market vending is a little bugged, you can't make vendings if there is multiple players around (not sure what is actually causing this bug.)
It works if there is no players in the market and you create a booth.
Replace Calculations\Battle.cs with this for fixing damage calculations.
Code:
//Project by BaussHacker aka. L33TS
using System;
namespace ProjectX_V3_Game.Calculations
{
/// <summary>
/// Calculations used for battle / combat.
/// </summary>
public class Battle
{
/// <summary>
/// Returns a boolean defining whether the attack is a success. [Unused atm.]
/// </summary>
/// <param name="Percentage">The percentage.</param>
/// <returns>Returns true if the attack is a success.</returns>
public static bool AttackSuccess(double Percentage)
{
return false;
}
/// <summary>
/// Getting a boolean defining whether or not defense dura can be lost.
/// </summary>
/// <returns>Returns true if the chance is success.</returns>
public static bool LoseDuraDefense()
{
return false;
//return BasicCalculations.ChanceSuccess(2); // 10 % chance
}
/// <summary>
/// Getting a boolean defining whether or not attack dura can be lost.
/// </summary>
/// <returns>Returns true if the chance is success.</returns>
public static bool LoseDuraAttack()
{
return false;
//return BasicCalculations.ChanceSuccess(1); // 3 % chance
}
#region Physical
/// <summary>
/// Gets the physical damage.
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
public static uint GetPhysicalDamage(Entities.IEntity attacker, Entities.IEntity attacked)
{
double damage = 0;
if (attacker is Entities.GameClient)
{
if (attacked is Entities.GameClient)
damage = GetPhysicalDamage_PVP((attacker as Entities.GameClient), (attacked as Entities.GameClient));
else if (attacked is Entities.Monster)
damage = GetPhysicalDamage_PVM((attacker as Entities.GameClient), (attacked as Entities.Monster));
else if (attacked is Entities.Sob)
damage = GetPhysicalDamage_PVS((attacker as Entities.GameClient));
}
if (attacker is Entities.Monster)
{
if (attacked is Entities.GameClient)
damage = GetPhysicalDamage_MVP((attacker as Entities.Monster), (attacked as Entities.GameClient));
else if (attacked is Entities.Monster)
damage = GetPhysicalDamage_MVM((attacker as Entities.Monster), (attacked as Entities.Monster));
}
if (damage > 1)
{
if (attacker.Level > (attacked.Level + 10))
damage *= 1.25;
else if ((attacker.Level + 10) < attacked.Level)
damage = (damage * 0.75);
}
if (damage > 1)
{
double perc = (damage / 100);
perc *= (attacker.Reborns * 10);
damage += perc;
perc = (damage / 100);
perc *= (attacked.Reborns * 10);
damage -= perc;
}
damage = (damage >= 1 ? damage : 1);
return (uint)damage;
}
/// <summary>
/// Gets the physical damage (PVP).
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalDamage_PVP(Entities.GameClient attacker, Entities.GameClient attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 1 + attacker.DragonGemPercentage;
damage -= attacked.Defense;
if (attacked.ContainsFlag1(Enums.Effect1.Shield))
damage *= 0.5;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
double damage_perc = damage;
damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
damage -= damage_perc;
damage_perc = (damage / 100) * attacked.Bless;
damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical damage (PVM).
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalDamage_PVM(Entities.GameClient attacker, Entities.Monster attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 1 + attacker.DragonGemPercentage;
damage -= attacked.Defense;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
//double damage_perc = damage;
//damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
//damage -= damage_perc;
//damage_perc = (damage / 100) * attacked.Bless;
//damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical damage (PVS).
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalDamage_PVS(Entities.GameClient attacker)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 1 + attacker.DragonGemPercentage;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
//double damage_perc = damage;
//damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
//damage -= damage_perc;
//damage_perc = (damage / 100) * attacked.Bless;
//damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical damage (MVP).
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalDamage_MVP(Entities.Monster attacker, Entities.GameClient attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next((int)attacker.MinAttack, (int)attacker.MaxAttack);
//damage *= 1 + attacker.DragonGemPercentage;
damage -= attacked.Defense;
if (attacked.ContainsFlag1(Enums.Effect1.Shield))
damage *= 0.5;
double damage_perc = damage;
damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
damage -= damage_perc;
damage_perc = (damage / 100) * attacked.Bless;
damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the physical damage (MVM).
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalDamage_MVM(Entities.Monster attacker, Entities.Monster attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next((int)attacker.MinAttack, (int)attacker.MaxAttack);
//damage *= 1 + attacker.DragonGemPercentage;
damage -= attacked.Defense;
//double damage_perc = damage;
//damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
//damage -= damage_perc;
//damage_perc = (damage / 100) * attacked.Bless;
//damage -= damage_perc;
return damage;
}
#endregion
#region Ranged
/// <summary>
/// Gets the ranged damage.
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
public static uint GetRangedDamage(Entities.IEntity attacker, Entities.IEntity attacked)
{
double damage = 0;
if (attacker is Entities.GameClient)
{
if (attacked is Entities.GameClient)
damage = GetRangedDamage_PVP((attacker as Entities.GameClient), (attacked as Entities.GameClient));
if (attacked is Entities.Monster)
damage = GetRangedDamage_PVM((attacker as Entities.GameClient), (attacked as Entities.Monster));
if (attacked is Entities.Sob)
damage = GetRangedDamage_PVS((attacker as Entities.GameClient));
}
if (damage > 1)
{
if (attacker.Level > (attacked.Level + 10))
damage *= 1.25;
else if ((attacker.Level + 10) < attacked.Level)
damage = (damage * 0.75);
}
if (damage > 1)
{
double perc = (damage / 100);
perc *= (attacker.Reborns * 10);
damage += perc;
perc = (damage / 100);
perc *= (attacked.Reborns * 10);
damage -= perc;
}
damage = (damage >= 1 ? damage : 1);
return (uint)damage;
}
/// <summary>
/// Gets the ranged damage. (PVP)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetRangedDamage_PVP(Entities.GameClient attacker, Entities.GameClient attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 1 - (attacked.Dodge * 0.01);
damage *= 0.45;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
damage *= 1 + attacker.DragonGemPercentage;
double damage_perc = damage;
damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
damage -= damage_perc;
damage_perc = (damage / 100) * attacked.Bless;
damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the ranged damage. (PVM)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <returns>Returns the damage.</returns>
private static double GetRangedDamage_PVM(Entities.GameClient attacker, Entities.Monster attacked)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 1 - (attacked.Dodge * 0.01);
damage *= 0.45;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
damage *= 1 + attacker.DragonGemPercentage;
//double damage_perc = damage;
//damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
//damage -= damage_perc;
//damage_perc = (damage / 100) * attacked.Bless;
//damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the ranged damage. (PVS)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <returns>Returns the damage.</returns>
private static double GetRangedDamage_PVS(Entities.GameClient attacker)
{
double damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack);
damage *= 0.45;
if (attacker.ContainsFlag1(Enums.Effect1.Stig))
damage *= 1.75;
damage *= 1 + attacker.DragonGemPercentage;
//double damage_perc = damage;
//damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
//damage -= damage_perc;
//damage_perc = (damage / 100) * attacked.Bless;
//damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
#endregion
#region Magic
/// <summary>
/// Gets the magic damage.
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
public static uint GetMagicDamage(Entities.IEntity attacker, Entities.IEntity attacked, Data.Spell spell)
{
double damage = 0;
if (attacker is Entities.GameClient)
{
if (attacked is Entities.GameClient)
damage = GetMagicDamage_PVP((attacker as Entities.GameClient), (attacked as Entities.GameClient), spell);
else if (attacked is Entities.Monster)
damage = GetMagicDamage_PVM((attacker as Entities.GameClient), (attacked as Entities.Monster), spell);
else if (attacked is Entities.Sob)
damage = GetMagicDamage_PVS((attacker as Entities.GameClient), spell);
}
if (attacker is Entities.Monster)
{
if (attacked is Entities.GameClient)
damage = GetMagicDamage_MVP((attacker as Entities.Monster), (attacked as Entities.GameClient), spell);
else if (attacked is Entities.Monster)
damage = GetMagicDamage_MVM((attacker as Entities.Monster), (attacked as Entities.Monster), spell);
}
if (damage > 1)
{
if (attacker.Level > (attacked.Level + 10))
damage *= 1.25;
else if ((attacker.Level + 10) < attacked.Level)
damage = (damage * 0.75);
}
if (damage > 1)
{
double perc = (damage / 100);
perc *= (attacker.Reborns * 10);
damage += perc;
perc = (damage / 100);
perc *= (attacked.Reborns * 10);
damage -= perc;
}
damage = (damage >= 1 ? damage : 1);
return (uint)damage;
}
/// <summary>
/// Gets the magic damage. (PVP)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetMagicDamage_PVP(Entities.GameClient attacker, Entities.GameClient attacked, Data.Spell spell)
{
double damage = (double)attacker.MagicAttack;
damage -= attacked.MagicDefense;
damage *= 0.65;
damage += spell.Power;
damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
double damage_perc = damage;
damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
damage -= damage_perc;
damage_perc = (damage / 100) * attacked.Bless;
damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the magic damage. (PVM)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetMagicDamage_PVM(Entities.GameClient attacker, Entities.Monster attacked, Data.Spell spell)
{
double damage = (double)attacker.MagicAttack;
damage -= attacked.MagicDefense;
damage *= 0.65;
damage += spell.Power;
damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the magic damage. (PVS)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetMagicDamage_PVS(Entities.GameClient attacker, Data.Spell spell)
{
double damage = (double)attacker.MagicAttack;
damage *= 0.65;
damage += spell.Power;
damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the magic damage. (MVP)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetMagicDamage_MVP(Entities.Monster attacker, Entities.GameClient attacked, Data.Spell spell)
{
double damage = (double)attacker.MaxAttack;
damage -= attacked.MagicDefense;
damage *= 0.65;
damage += spell.Power;
//damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the magic damage. (MVM)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetMagicDamage_MVM(Entities.Monster attacker, Entities.Monster attacked, Data.Spell spell)
{
double damage = attacker.MaxAttack;
damage -= attacked.MagicDefense;
damage *= 0.65;
damage += spell.Power;
// damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
#endregion
#region PhysicalMagic
/// <summary>
/// Gets the physical magic damage.
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
public static uint GetPhysicalMagicDamage(Entities.IEntity attacker, Entities.IEntity attacked, Data.Spell spell)
{
double damage = 0;
if (attacker is Entities.GameClient)
{
if (attacked is Entities.GameClient)
damage = GetPhysicalMagicDamage_PVP((attacker as Entities.GameClient), (attacked as Entities.GameClient), spell);
else if (attacked is Entities.Monster)
damage = GetPhysicalMagicDamage_PVM((attacker as Entities.GameClient), (attacked as Entities.Monster), spell);
else if (attacked is Entities.Sob)
damage = GetPhysicalMagicDamage_PVS((attacker as Entities.GameClient), spell);
}
if (attacker is Entities.Monster)
{
if (attacked is Entities.GameClient)
damage = GetPhysicalMagicDamage_MVP((attacker as Entities.Monster), (attacked as Entities.GameClient), spell);
else if (attacked is Entities.Monster)
damage = GetPhysicalMagicDamage_MVM((attacker as Entities.Monster), (attacked as Entities.Monster), spell);
}
if (damage > 1)
{
if (attacker.Level > (attacked.Level + 10))
damage *= 1.25;
else if ((attacker.Level + 10) < attacked.Level)
damage = (damage * 0.75);
}
if (damage > 1)
{
double perc = (damage / 100);
perc *= (attacker.Reborns * 10);
damage += perc;
perc = (damage / 100);
perc *= (attacked.Reborns * 10);
damage -= perc;
}
damage = (damage >= 1 ? damage : 1);
return (uint)damage;
}
/// <summary>
/// Gets the magic damage. (PVP)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalMagicDamage_PVP(Entities.GameClient attacker, Entities.GameClient attacked, Data.Spell spell)
{
double damage = (double) ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack * 2);
damage -= attacked.Defense;
damage *= 0.65;
// penetration extra damage
if (spell.SpellID == 1290 && damage > 0)
{
double hunperc = (double)((damage / 100) * 26.6);
damage += (hunperc * spell.Level);
}
if (spell.SpellID == 1115 && damage > 0)
{
damage /= 3;
}
// damage += spell.Power;
damage *= 1 + attacker.DragonGemPercentage;
if (attacked.ContainsFlag1(Enums.Effect1.Shield))
damage *= 0.5;
// damage -= attacked.Defense;
double damage_perc = damage;
damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
damage -= damage_perc;
damage_perc = (damage / 100) * attacked.Bless;
damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical magic damage. (PVM)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalMagicDamage_PVM(Entities.GameClient attacker, Entities.Monster attacked, Data.Spell spell)
{
double damage = (double) ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack * 2);
damage -= attacked.Defense;
damage *= 0.65;
// penetration extra damage
if (spell.SpellID == 1290 && damage > 0)
{
double hunperc = (double)((damage / 100) * 26.6);
damage += (hunperc * spell.Level);
}
if (spell.SpellID == 1115 && damage > 0)
{
damage /= 3;
}
//damage += spell.Power;
damage *= 1 + attacker.DragonGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical magic damage. (PVS)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalMagicDamage_PVS(Entities.GameClient attacker, Data.Spell spell)
{
double damage = (double) ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(attacker.MinAttack, attacker.MaxAttack * 2);
damage *= 0.65;
// penetration extra damage
if (spell.SpellID == 1290 && damage > 0)
{
double hunperc = (double)((damage / 100) * 26.6);
damage += (hunperc * spell.Level);
}
if (spell.SpellID == 1115 && damage > 0)
{
damage /= 3;
}
//damage += spell.Power;
damage *= 1 + attacker.DragonGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
attacker.SetProfDamage(ref damage);
return damage;
}
/// <summary>
/// Gets the physical magic damage. (MVP)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalMagicDamage_MVP(Entities.Monster attacker, Entities.GameClient attacked, Data.Spell spell)
{
double damage = (double) ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next((int)attacker.MaxAttack, (int)attacker.MaxAttack * 2);
damage -= attacked.Defense;
damage *= 0.65;
// penetration extra damage
if (spell.SpellID == 1290 && damage > 0)
{
double hunperc = (double)((damage / 100) * 26.6);
damage += (hunperc * spell.Level);
}
if (spell.SpellID == 1115 && damage > 0)
{
damage /= 3;
}
if (attacked.ContainsFlag1(Enums.Effect1.Shield))
damage *= 0.5;
// damage += spell.Power;
//damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
/// <summary>
/// Gets the physical magic damage. (MVM)
/// </summary>
/// <param name="attacker">The attacker.</param>
/// <param name="attacked">The attacked.</param>
/// <param name="spell">The spell.</param>
/// <returns>Returns the damage.</returns>
private static double GetPhysicalMagicDamage_MVM(Entities.Monster attacker, Entities.Monster attacked, Data.Spell spell)
{
double damage = (double) ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next((int)attacker.MaxAttack, (int)attacker.MaxAttack * 2);
damage -= attacked.Defense;
damage *= 0.65;
// penetration extra damage
if (spell.SpellID == 1290 && damage > 0)
{
double hunperc = (double)((damage / 100) * 26.6);
damage += (hunperc * spell.Level);
}
if (spell.SpellID == 1115 && damage > 0)
{
damage /= 3;
}
//damage += spell.Power;
// damage *= 1 + attacker.PhoenixGemPercentage;
// damage -= attacked.Defense;
// double damage_perc = damage;
// damage_perc = (damage / 100) * attacked.TortoiseGemPercentage;
// damage -= damage_perc;
// damage_perc = (damage / 100) * attacked.Bless;
// damage -= damage_perc;
return damage;
}
#endregion
}
}
Quote:
Originally Posted by nushizu
I've never used MS SQL ever. so for bringin up the tables you made how would one do that, double clicking doesnt seem to do the trick, any ideas? (everything else went off without a hitch so far though ha ha...
Edit: I found a way to open it but deleting all the accounts and adding my own when I try and log in the client says error in database(54) any ideas?
Edit: nvm I got it, thanks though ^^
|
Sorry for the late response, glad you got it.
In case other people comes around this issue.
You right click the table and chooses the top 200.
If you have a table with more than 200 entries and the row you want to edit doesn't show up there, then you would need to either make your own kinda panel that can retrieve and edit a specific row based on ex. id or you can an sql query.
|
|
|
12/18/2013, 00:39
|
#62
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Quote:
Originally Posted by Super Aids
Sorry for the late response, glad you got it.
In case other people comes around this issue.
You right click the table and chooses the top 200.
If you have a table with more than 200 entries and the row you want to edit doesn't show up there, then you would need to either make your own kinda panel that can retrieve and edit a specific row based on ex. id or you can an sql query.
|
If you are using Microsoft SQL Management Studio, after you click on edit top 200, in the ribbon above, right of the execute button, is a SQL button.
Clicking on that will bring up the SQL query that is used for the top 200, and you can change it to top 1000 or higher, or you can even add a where clause to refine your search.
You can see what it does here...
I love the fact you use MSSQL in this source....
|
|
|
12/18/2013, 00:49
|
#63
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Quote:
Originally Posted by Aceking
If you are using Microsoft SQL Management Studio, after you click on edit top 200, in the ribbon above, right of the execute button, is a SQL button.
Clicking on that will bring up the SQL query that is used for the top 200, and you can change it to top 1000 or higher, or you can even add a where clause to refine your search.
You can see what it does here...
I love the fact you use MSSQL in this source....
|
Never knew that actually, thanks.
|
|
|
12/18/2013, 00:59
|
#64
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Quote:
Originally Posted by Super Aids
Never knew that actually, thanks.
|
Your welcome
I love MSSQL, combined with the management studio and you can do just about anything.
Great thing about it in a conquer source is if you write the correct sql query, you should almost never have to sort the data or pick through what data you actually want from your queries, you can get exactly what you are looking for. Makes it quite efficient. Not saying others don't have this versatility, but MSSQL definitely does.
|
|
|
12/18/2013, 01:29
|
#65
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Quote:
Originally Posted by Aceking
Your welcome
I love MSSQL, combined with the management studio and you can do just about anything.
Great thing about it in a conquer source is if you write the correct sql query, you should almost never have to sort the data or pick through what data you actually want from your queries, you can get exactly what you are looking for. Makes it quite efficient. Not saying others don't have this versatility, but MSSQL definitely does.

|
Datasets & Tableadapters = Best management ever. I'm not using Visual Studio tho, which is why I didn't choose to use it for this, but basically it writes out the methods etc. for you and they're pretty much safe to use as well.
|
|
|
12/18/2013, 01:46
|
#66
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Quote:
Originally Posted by Super Aids
Datasets & Tableadapters = Best management ever. I'm not using Visual Studio tho, which is why I didn't choose to use it for this, but basically it writes out the methods etc. for you and they're pretty much safe to use as well.
|
The majority of my work with MSSQL is with multiple databases with hundreds of millions of rows. And generally only need to pull a few fields from the results. Therefore I tend to use datareaders to reduce the amount of data stored in memory.
Either way can give you the results, it just depends on what you need specifically for the operation you are doing.
|
|
|
12/18/2013, 23:29
|
#67
|
elite*gold: 0
Join Date: Oct 2005
Posts: 72
Received Thanks: 7
|
Issue lies in the game server, that code snippet you gave me up top is that directed at my issue or just a bug in general?
|
|
|
12/18/2013, 23:34
|
#68
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
It was in general
|
|
|
12/19/2013, 00:01
|
#69
|
elite*gold: 0
Join Date: Oct 2005
Posts: 72
Received Thanks: 7
|
Oh a part I never mentioned (before I deleted them) I could log in and play on the other accounts, but new ones are like bleh no work
|
|
|
12/19/2013, 01:18
|
#70
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Yeah, it's due to some missing things in the character creation. Forgot to change that in the released version.
Make sure LoadCharacter and CreateCharacter matches each other with the columns.
|
|
|
12/19/2013, 06:33
|
#71
|
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
|
i like how you have
/// <summary> for all of them, ty that helps understand the code better
|
|
|
12/21/2013, 20:30
|
#72
|
elite*gold: 0
Join Date: Oct 2005
Posts: 72
Received Thanks: 7
|
anyone willing to TV my problem? I can't figure it out ^^;; I'm on atlantic time zone, so if you're willing to help a brother out I'm sure I can find a thank you lying around here somewhere
|
|
|
12/22/2013, 05:09
|
#73
|
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
|
im too lazy now , hmmm is this a classic base source? there is no fan/tower something like that? cuz im planning to make a classic server using this as base, this will become my 2nd server classic .
|
|
|
12/22/2013, 10:05
|
#74
|
elite*gold: 0
Join Date: Feb 2013
Posts: 5
Received Thanks: 0
|
thx very much
|
|
|
12/22/2013, 11:02
|
#75
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Quote:
Originally Posted by nushizu
anyone willing to TV my problem? I can't figure it out ^^;; I'm on atlantic time zone, so if you're willing to help a brother out I'm sure I can find a thank you lying around here somewhere
|
What is your issue? [checking your pm now]
Quote:
Originally Posted by marcbacor6666
im too lazy now , hmmm is this a classic base source? there is no fan/tower something like that? cuz im planning to make a classic server using this as base, this will become my 2nd server classic .
|
Fan/Tower is disabled, but can be enabled if wanted. It's not really a base, as it has a lot of things completed. However it's not completed either.
|
|
|
 |
|
Similar Threads
|
ProjectX Source
10/28/2018 - CO2 PServer Guides & Releases - 167 Replies
Well I will not develope Conquer anymore and I have decided to close down ProjectX, but I have not talked with any of my partners, because they haven't been on, but they know it's due to lack of players and activity.
The reason I will release it is because I won't develope any server more. I was working on a new source based on Project Manifesto, but I quitted that to. I will keep that for my self, if I ever go back to developing, but mostly not.
I will not be as much active here neither,...
|
ProjectX V3 Source
03/28/2013 - CO2 PServer Guides & Releases - 40 Replies
Quitting CO again, don't really got time to work enough on this, so I will just release the whole project.
Source (View):
ProjectX V3
Source (Download):
Source
Database (Download):
Database
|
ProjectX Source
02/07/2012 - CO2 PServer Guides & Releases - 2 Replies
This is just a reupload, not our current source, because the other link seems to be dead and I'm tired of people asking me all the time if I could reupload it, so here it is. Do not ask if you can get our current source, because it will NEVER be public nor for sale.
ProjectXFull.rar
Original thread:
http://www.elitepvpers.com/forum/co2-pserver-guid es-releases/990423-projectx-source.html
|
Need help with projectx source.
09/29/2011 - CO2 Private Server - 5 Replies
Hello everyone i've download all files for projectx source and also i putted the right files in C:/ Driver and when i start the projectx console there comes a error like this>>> ImageShack® - Online Photo and Video Hosting <<<
And also i'm using windows 7 64bit
|
need help in ProjectX source
07/30/2011 - CO2 Private Server - 4 Replies
Can some1 tell me how can i delite a skill for example hercules..
|
All times are GMT +1. The time now is 00:20.
|
|