You last visited: Today at 15:11
Advertisement
[HELP]HP problem in source
Discussion on [HELP]HP problem in source within the CO2 Private Server forum part of the Conquer Online 2 category.
07/26/2013, 10:14
#1
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
[HELP]HP problem in source
i have problem with Hitpoints as you can see in the screen shot. i have a maxHP of 2.2k but in the red circle i have 3.4k maxhp. how can i make it the same as my status HP i mean same as the original MaxHP? cuz i tried using potion it wont pass 2.2k.
one more thing. when i RELOG the game. my HP Goes to 1. anyone can help me?
Attached Images
Untitled.jpg
(463.5 KB, 93 views)
07/26/2013, 10:33
#2
elite*gold: 0
Join Date: Mar 2013
Posts: 12
Received Thanks: 2
this problem in your
LoadItemStats in Gamestate
07/27/2013, 10:09
#3
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
same to my problem
same to my problem
07/27/2013, 16:25
#4
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
Quote:
Originally Posted by
The.Goblin
this problem in your
LoadItemStats in Gamestate
i think not
07/27/2013, 16:39
#5
elite*gold: 0
Join Date: Mar 2013
Posts: 12
Received Thanks: 2
Quote:
Originally Posted by
pounder
i think not
try this
PHP Code:
#region Items
private int StatHP ;
public void CalculateHPBonus ()
{
switch ( Entity .Class)
{
case 11 : Entity . MaxHitpoints = ( uint )( StatHP * 1.05F ); break;
case 12 : Entity . MaxHitpoints = ( uint )( StatHP * 1.08F ); break;
case 13 : Entity . MaxHitpoints = ( uint )( StatHP * 1.10F ); break;
case 14 : Entity . MaxHitpoints = ( uint )( StatHP * 1.12F ); break;
case 15 : Entity . MaxHitpoints = ( uint )( StatHP * 1.15F ); break;
default: Entity . MaxHitpoints = ( uint ) StatHP ; break;
}
this . Entity . MaxHitpoints += this . Entity . ItemHP ;
Entity . MaxHitpoints += Entity . ItemHP ;
Entity . Hitpoints = Math . Min ( Entity . Hitpoints , Entity . MaxHitpoints );
}
public void CalculateStatBonus ()
{
byte ManaBoost = 5 ;
const byte HitpointBoost = 24 ;
sbyte Class = ( sbyte )( Entity .Class / 10 );
if (Class == 13 || Class == 14 )
ManaBoost += ( byte )( 5 * ( Entity .Class - (Class * 10 )));
StatHP = ( ushort )(( Entity . Strength * 3 ) +
( Entity . Agility * 3 ) +
( Entity . Spirit * 3 ) +
( Entity . Vitality * HitpointBoost ));
Entity . MaxMana = ( ushort )(( Entity . Spirit * ManaBoost ) + Entity . ItemMP );
Entity . Mana = Math . Min ( Entity . Mana , Entity . MaxMana );
}
public void SendStatMessage ()
{
this . ReviewMentor ();
Network . GamePackets . Message Msg = new AhmedFox . Network . GamePackets . Message ( " Your status has been changed" , System . Drawing . Color . DarkGoldenrod
, Network . GamePackets . Message . TopLeft );
Msg . __Message = string . Format ( Msg . __Message ,
new object [] { Entity . MinAttack , Entity . MaxAttack , Entity . MagicAttack , Entity . Defence , ( Entity . MagicDefence + Entity . MagicDefence ), Entity . Dodge , Entity . PhysicalDamageDecrease , Entity . MagicDamageDecrease , Entity . PhysicalDamageIncrease , Entity . MagicDamageIncrease , Entity . Hitpoints , Entity . MaxHitpoints , Entity . Mana , Entity . MaxMana , Entity . BattlePower });
this . Send ( Msg );
}
public void LoadItemStats2 ( Game . Entity e )
{
#region Set Every Variable to Zero
Entity . Defence = 0 ;
Entity . MagicDefence = 0 ;
Entity . Dodge = 0 ;
Entity . BaseMagicAttack = 0 ;
Entity . WoodResistance = 0 ;
Entity . MetalResistance = 0 ;
Entity . FireResistance = 0 ;
Entity . WaterResistance = 0 ;
Entity . EarthResistance = 0 ;
Entity . Breaktrough = 0 ;
Entity . CriticalStrike = 0 ;
Entity . Immunity = 0 ;
Entity . Penetration = 0 ;
Entity . Counteraction = 0 ;
Entity . Block = 0 ;
Entity . Detoxication = 0 ;
Entity . Intensification = 0 ;
Entity . Penetration = 0 ;
Entity . SkillCStrike = 0 ;
Entity . MaxAttack = 0 ;
Entity . MinAttack = 0 ;
Entity . PhysicalDamageDecrease = 0 ;
Entity . MagicDamageDecrease = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . PhysicalDamageIncrease = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . ItemHP = 0 ;
Entity . ItemMP = 0 ;
Entity . ItemBless = 0 ;
Entity . AttackRange = 0 ;
Entity . BaseMinAttack = 0 ;
Entity . BaseMaxAttack = 0 ;
Entity . BaseMagicDefence = 0 ;
Entity . BaseDefence = 0 ;
Entity . MagicAttack = 0 ;
Entity . MagicDefence = 0 ;
Entity . DragonGem = 0 ;
Entity . PhoenixGem = 0 ;
Entity . TortisGem = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . Gems = new UInt16 [ 10 ];
#endregion
foreach ( IConquerItem i in Equipment . Objects )
{
if ( i != null )
{
if ( i . Durability != 0 && i . Position > 9 )
{
if ( i . Position != ConquerItem . AltGarment && i . Position != ConquerItem . LeftWeaponAccessory && i . Position != ConquerItem . RightWeaponAccessory )
{
if ( i . Position != ConquerItem . SteedArmor )
{
Database . ConquerItemInformation dbi = new Database . ConquerItemInformation ( i . ID , i . Plus );
if ( dbi != null )
{
/*if (i.ID == 0x493e0)
{
byte r = 0;
byte g = 0;
byte b = 0;
r = (byte)i.Hema1;
g = (byte)i.Hema2;
b = (byte)i.Hema3;
i.Color = (AhmedFox.Game.Enums.Color)b;
i.Bless = g;
i.Unknown40 = r;
}*/
#region Give Stats.
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( i . Purification . PurificationItemID , 0 );
if ( i . RefineItem != 0 )
refine = i . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) soulDB . BaseInformation . Dodge ;
//Entity.Hitpoints += Infos.ItemHP;
Entity . AssassinColor = ( uint ) Entity . BattlePower ;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . BaseMinAttack += soulDB . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += soulDB . BaseInformation . MaxAttack ;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . ItemHP += soulDB . BaseInformation . ItemHP ;
Entity . ItemMP += soulDB . BaseInformation . ItemMP ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += dbi . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += dbi . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) dbi . BaseInformation . Dodge ;
if ( i . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += dbi . BaseInformation . MagicAttack ;
}
Entity . ItemHP += dbi . BaseInformation . ItemHP ;
Entity . ItemMP += dbi . BaseInformation . ItemMP ;
if ( i . ID != 0x493e0 )
{
Entity . ItemBless += i . Bless ;
}
if ( i . Position == ConquerItem . AltRightHand )
{
Entity . AttackRange += dbi . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( dbi . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( i . Position == ConquerItem . AltLeftHand )
{
Entity . BaseMinAttack += ( uint )( dbi . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( dbi . BaseInformation . MaxAttack * 0.5F );
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += dbi . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += dbi . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . BaseInformation . MaxAttack ;
}
if ( i . Plus != 0 )
{
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) dbi . PlusInformation . MagicDefence ;
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) dbi . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) dbi . PlusInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += dbi . PlusInformation . MagicAttack ;
Entity . Defence += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += dbi . PlusInformation . MagicDefence ;
Entity . ItemHP += dbi . PlusInformation . ItemHP ;
if ( i . Position == ConquerItem . AltBoots )
{
Entity . Dodge += ( byte ) dbi . PlusInformation . Dodge ;
}
if ( i . Position == ConquerItem . Steed )
{
Entity . ExtraVigor += dbi . PlusInformation . Agility ;
}
}
}
byte socketone = ( byte ) i . SocketOne ;
byte sockettwo = ( byte ) i . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
Entity . ItemHP += i . Enchant ;
GemAlgorithm ();
#endregion
}
}
}
}
}
}
}
public void LoadItemStats ( Game . Entity e )
{
#region Set Every Variable to Zero
Entity . Defence = 0 ;
Entity . MagicDefence = 0 ;
Entity . Dodge = 0 ;
Entity . BaseMagicAttack = 0 ;
Entity . WoodResistance = 0 ;
Entity . FireResistance = 0 ;
Entity . WaterResistance = 0 ;
Entity . EarthResistance = 0 ;
Entity . MetalResistance = 0 ;
Entity . Breaktrough = 0 ;
Entity . CriticalStrike = 0 ;
Entity . Immunity = 0 ;
Entity . Penetration = 0 ;
Entity . Counteraction = 0 ;
Entity . Block = 0 ;
Entity . Detoxication = 0 ;
Entity . Intensification = 0 ;
Entity . Penetration = 0 ;
Entity . SkillCStrike = 0 ;
Entity . MaxAttack = 0 ;
Entity . MinAttack = 0 ;
Entity . PhysicalDamageDecrease = 0 ;
Entity . MagicDamageDecrease = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . PhysicalDamageIncrease = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . ItemHP = 0 ;
Entity . ItemMP = 0 ;
Entity . ItemBless = 0 ;
Entity . AttackRange = 0 ;
Entity . BaseMinAttack = 0 ;
Entity . BaseMaxAttack = 0 ;
Entity . BaseMagicDefence = 0 ;
Entity . BaseDefence = 0 ;
Entity . MagicAttack = 0 ;
Entity . MagicDefence = 0 ;
Entity . DragonGem = 0 ;
Entity . PhoenixGem = 0 ;
Entity . TortisGem = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . Gems = new UInt16 [ 10 ];
#endregion
foreach ( IConquerItem i in Equipment . Objects )
{
if ( i != null )
{
if ( i . Durability != 0 && i . Position < 20 )
{
if ( i . Position != ConquerItem . Garment && i . Position != ConquerItem . LeftWeaponAccessory && i . Position != ConquerItem . RightWeaponAccessory )
{
if ( i . Position != ConquerItem . SteedArmor )
{
Database . ConquerItemInformation dbi = new Database . ConquerItemInformation ( i . ID , i . Plus );
if ( dbi != null )
{
if ( i . ID == 0x493e0 )
{
byte r = 0 ;
byte g = 0 ;
byte b = 0 ;
r = ( byte ) i . Fox1 ;
g = ( byte ) i . Fox2 ;
b = ( byte ) i . Fox3 ;
i . Color = ( AhmedFox . Game . Enums . Color ) b ;
i . Bless = g ;
i . Unknown40 = r ;
//i.Send(e.Owner);
}
#region Give Stats.
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( i . Purification . PurificationItemID , 0 );
if ( i . RefineItem != 0 )
refine = i . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) soulDB . BaseInformation . Dodge ;
Entity . AssassinColor = ( uint ) Entity . BattlePower ;
//Entity.Hitpoints += Infos.ItemHP;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . BaseMinAttack += soulDB . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += soulDB . BaseInformation . MaxAttack ;
// Entity.MetalResistance += soulDB.BaseInformation.me;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . ItemHP += soulDB . BaseInformation . ItemHP ;
Entity . ItemMP += soulDB . BaseInformation . ItemMP ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += dbi . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += dbi . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) dbi . BaseInformation . Dodge ;
if ( i . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += dbi . BaseInformation . MagicAttack ;
}
Entity . ItemHP += dbi . BaseInformation . ItemHP ;
Entity . ItemMP += dbi . BaseInformation . ItemMP ;
if ( i . ID != 0x493e0 )
{
Entity . ItemBless += i . Bless ;
}
if ( i . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange += dbi . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( dbi . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( i . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack += ( uint )( dbi . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( dbi . BaseInformation . MaxAttack * 0.5F );
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += dbi . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += dbi . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . BaseInformation . MaxAttack ;
}
if ( i . Plus != 0 )
{
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) dbi . PlusInformation . MagicDefence ;
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) dbi . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) dbi . PlusInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += dbi . PlusInformation . MagicAttack ;
Entity . Defence += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += dbi . PlusInformation . MagicDefence ;
Entity . ItemHP += dbi . PlusInformation . ItemHP ;
if ( i . Position == ConquerItem . Boots )
{
Entity . Dodge += ( byte ) dbi . PlusInformation . Dodge ;
}
if ( i . Position == ConquerItem . Steed )
{
Entity . ExtraVigor += dbi . PlusInformation . Agility ;
}
}
}
byte socketone = ( byte ) i . SocketOne ;
byte sockettwo = ( byte ) i . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
Entity . ItemHP += i . Enchant ;
GemAlgorithm ();
#endregion
}
}
}
}
}
}
}
#region OLD LOADITEMSTATS
public void LoadItemStats ( Interfaces . IConquerItem item ) //Use to load every item
{
if ( item == null )
return;
if ( item . Durability == 0 )
return;
if ( item . Position == ConquerItem . Garment )
return;
Database . ConquerItemInformation Infos = new AhmedFox . Database . ConquerItemInformation ( item . ID , item . Plus );
if ( Infos . BaseInformation == null )
return;
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( item . Purification . PurificationItemID , 0 );
if ( item . RefineItem != 0 )
refine = item . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += soulDB . BaseInformation . Dodge ;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += Infos . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += Infos . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) Infos . BaseInformation . Dodge ;
if ( item . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += Infos . BaseInformation . MagicAttack ;
}
Entity . ItemHP += Infos . BaseInformation . ItemHP ;
Entity . ItemMP += Infos . BaseInformation . ItemMP ;
Entity . ItemBless += item . Bless ;
if ( item . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange += Infos . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( Infos . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( item . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack += ( uint )( Infos . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( Infos . BaseInformation . MaxAttack * 0.5F );
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += Infos . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += Infos . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += Infos . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += Infos . BaseInformation . MaxAttack ;
}
if ( item . Plus != 0 )
{
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) Infos . PlusInformation . MagicDefence ;
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) Infos . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) Infos . PlusInformation . MagicAttack ;
}
else
{
if ( item . Position == ConquerItem . Steed )
Entity . ExtraVigor += Infos . PlusInformation . Agility ;
Entity . BaseMinAttack += Infos . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += Infos . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += Infos . PlusInformation . MagicAttack ;
Entity . Defence += Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += Infos . PlusInformation . MagicDefence ;
Entity . ItemHP += Infos . PlusInformation . ItemHP ;
if ( item . Position == ConquerItem . Boots )
Entity . Dodge += ( byte ) Infos . PlusInformation . Dodge ;
}
}
byte socketone = ( byte ) item . SocketOne ;
byte sockettwo = ( byte ) item . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle )
{
Entity . ItemHP += item . Enchant ;
GemAlgorithm ();
}
}
public void UnloadItemStats ( Interfaces . IConquerItem item , bool onPurpose )
{
if ( item == null ) return;
if ( item . Durability == 0 && ! onPurpose )
return;
if ( item . Position == ConquerItem . Garment )
return;
Database . ConquerItemInformation Infos = new AhmedFox . Database . ConquerItemInformation ( item . ID , item . Plus );
if ( Infos . BaseInformation == null )
return;
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( item . Purification . PurificationItemID , 0 );
if ( item . RefineItem != 0 )
refine = item . RefineStats ;
if ( soulDB != null )
{
Entity . Defence -= soulDB . BaseInformation . PhysicalDefence ;
Entity . MagicDefence -= soulDB . BaseInformation . MagicDefence ;
Entity . Dodge -= soulDB . BaseInformation . Dodge ;
Entity . BaseMagicAttack -= soulDB . BaseInformation . MagicAttack ;
Entity . WoodResistance -= soulDB . BaseInformation . WoodResist ;
Entity . FireResistance -= soulDB . BaseInformation . FireResist ;
Entity . WaterResistance -= soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance -= soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough -= soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike -= soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity -= soulDB . BaseInformation . Immunity ;
Entity . Penetration -= soulDB . BaseInformation . Penetration ;
Entity . Counteraction -= soulDB . BaseInformation . CounterAction ;
Entity . Block -= soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction -= ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication -= ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification -= ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike -= ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease -= Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease -= Infos . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence -= Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent -= Infos . BaseInformation . MagicDefence ;
Entity . Dodge -= ( byte ) Infos . BaseInformation . Dodge ;
if ( item . Position != ConquerItem . Fan )
Entity . BaseMagicAttack -= Infos . BaseInformation . MagicAttack ;
}
Entity . ItemHP -= Infos . BaseInformation . ItemHP ;
Entity . ItemMP -= Infos . BaseInformation . ItemMP ;
Entity . ItemBless -= item . Bless ;
if ( item . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange -= Infos . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( Infos . BaseInformation . ID ))
Entity . AttackRange -= 2 ;
}
if ( item . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack -= ( uint )( Infos . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack -= ( uint )( Infos . BaseInformation . MaxAttack * 0.5F );
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease -= Infos . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease -= Infos . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack -= Infos . BaseInformation . MinAttack ;
Entity . BaseMaxAttack -= Infos . BaseInformation . MaxAttack ;
}
if ( item . Plus != 0 )
{
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease -= Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease -= ( ushort ) Infos . PlusInformation . MagicDefence ;
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease -= ( ushort ) Infos . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease -= ( ushort ) Infos . PlusInformation . MagicAttack ;
}
else
{
if ( item . Position == ConquerItem . Steed )
Entity . ExtraVigor -= Infos . PlusInformation . Agility ;
Entity . BaseMinAttack -= Infos . PlusInformation . MinAttack ;
Entity . BaseMaxAttack -= Infos . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack -= Infos . PlusInformation . MagicAttack ;
Entity . Defence -= Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDefence -= Infos . PlusInformation . MagicDefence ;
Entity . ItemHP -= Infos . PlusInformation . ItemHP ;
if ( item . Position == ConquerItem . Boots )
Entity . Dodge -= ( byte ) Infos . PlusInformation . Dodge ;
}
}
byte socketone = ( byte ) item . SocketOne ;
byte sockettwo = ( byte ) item . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease -= dadd ;
Entity . MagicDamageDecrease -= madd ;
Entity . PhysicalDamageIncrease -= aatk ;
Entity . MagicDamageIncrease -= matk ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle )
{
Entity . ItemHP -= item . Enchant ;
GemAlgorithm ();
}
}
#endregion
public void LoadSoulStats ( uint ID )
{
var Infos = AhmedFox . Database . ConquerItemInformation . BaseInformations [ ID ];
Entity . Defence += Infos . PhysicalDefence ;
Entity . MagicDefence += Infos . MagicDefence ;
Entity . Dodge += ( byte ) Infos . Dodge ;
//Entity.max += Infos.ItemHP;
Entity . BaseMagicAttack += Infos . MagicAttack ;
Entity . BaseMinAttack += Infos . MinAttack ;
Entity . BaseMaxAttack += Infos . MaxAttack ;
}
public void UnloadSoulStats ( uint ID )
{
var Infos = AhmedFox . Database . ConquerItemInformation . BaseInformations [ ID ];
Entity . Defence -= Infos . PhysicalDefence ;
Entity . MagicDefence -= Infos . MagicDefence ;
Entity . Dodge -= ( byte ) Infos . Dodge ;
//Entity.Hitpoints -= Infos.ItemHP;
Entity . BaseMagicAttack -= Infos . MagicAttack ;
Entity . BaseMinAttack -= Infos . MinAttack ;
Entity . BaseMaxAttack -= Infos . MaxAttack ;
}
public void GemAlgorithm ()
{
Entity . MaxAttack = Entity . Strength + Entity . BaseMaxAttack ;
Entity . MinAttack = Entity . Strength + Entity . BaseMinAttack ;
Entity . MagicAttack = Entity . BaseMagicAttack ;
if ( Entity . PhoenixGem != 0 )
{
Entity . MagicAttack += ( uint ) Math . Floor ( Entity . MagicAttack * (double)( Entity . PhoenixGem * 0.01 ));
}
if ( Entity . DragonGem != 0 )
{
Entity . MaxAttack += ( uint ) Math . Floor ( Entity . MaxAttack * (double)( Entity . DragonGem * 0.01 ));
Entity . MinAttack += ( uint ) Math . Floor ( Entity . MinAttack * (double)( Entity . DragonGem * 0.01 ));
}
/*if (Entity.TortisGem != 0)
{
Entity.Defence += (ushort)Math.Floor(Entity.Defence * (double)(Entity.TortisGem * 0.01));
Entity.MagicDefence += (ushort)Math.Floor(Entity.MagicDefence * (double)(Entity.TortisGem * 0.01));
}*/
}
#endregion
07/27/2013, 17:14
#6
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
Quote:
Originally Posted by
The.Goblin
try this
PHP Code:
#region Items
private int StatHP ;
public void CalculateHPBonus ()
{
switch ( Entity .Class)
{
case 11 : Entity . MaxHitpoints = ( uint )( StatHP * 1.05F ); break;
case 12 : Entity . MaxHitpoints = ( uint )( StatHP * 1.08F ); break;
case 13 : Entity . MaxHitpoints = ( uint )( StatHP * 1.10F ); break;
case 14 : Entity . MaxHitpoints = ( uint )( StatHP * 1.12F ); break;
case 15 : Entity . MaxHitpoints = ( uint )( StatHP * 1.15F ); break;
default: Entity . MaxHitpoints = ( uint ) StatHP ; break;
}
this . Entity . MaxHitpoints += this . Entity . ItemHP ;
Entity . MaxHitpoints += Entity . ItemHP ;
Entity . Hitpoints = Math . Min ( Entity . Hitpoints , Entity . MaxHitpoints );
}
public void CalculateStatBonus ()
{
byte ManaBoost = 5 ;
const byte HitpointBoost = 24 ;
sbyte Class = ( sbyte )( Entity .Class / 10 );
if (Class == 13 || Class == 14 )
ManaBoost += ( byte )( 5 * ( Entity .Class - (Class * 10 )));
StatHP = ( ushort )(( Entity . Strength * 3 ) +
( Entity . Agility * 3 ) +
( Entity . Spirit * 3 ) +
( Entity . Vitality * HitpointBoost ));
Entity . MaxMana = ( ushort )(( Entity . Spirit * ManaBoost ) + Entity . ItemMP );
Entity . Mana = Math . Min ( Entity . Mana , Entity . MaxMana );
}
public void SendStatMessage ()
{
this . ReviewMentor ();
Network . GamePackets . Message Msg = new AhmedFox . Network . GamePackets . Message ( " Your status has been changed" , System . Drawing . Color . DarkGoldenrod
, Network . GamePackets . Message . TopLeft );
Msg . __Message = string . Format ( Msg . __Message ,
new object [] { Entity . MinAttack , Entity . MaxAttack , Entity . MagicAttack , Entity . Defence , ( Entity . MagicDefence + Entity . MagicDefence ), Entity . Dodge , Entity . PhysicalDamageDecrease , Entity . MagicDamageDecrease , Entity . PhysicalDamageIncrease , Entity . MagicDamageIncrease , Entity . Hitpoints , Entity . MaxHitpoints , Entity . Mana , Entity . MaxMana , Entity . BattlePower });
this . Send ( Msg );
}
public void LoadItemStats2 ( Game . Entity e )
{
#region Set Every Variable to Zero
Entity . Defence = 0 ;
Entity . MagicDefence = 0 ;
Entity . Dodge = 0 ;
Entity . BaseMagicAttack = 0 ;
Entity . WoodResistance = 0 ;
Entity . MetalResistance = 0 ;
Entity . FireResistance = 0 ;
Entity . WaterResistance = 0 ;
Entity . EarthResistance = 0 ;
Entity . Breaktrough = 0 ;
Entity . CriticalStrike = 0 ;
Entity . Immunity = 0 ;
Entity . Penetration = 0 ;
Entity . Counteraction = 0 ;
Entity . Block = 0 ;
Entity . Detoxication = 0 ;
Entity . Intensification = 0 ;
Entity . Penetration = 0 ;
Entity . SkillCStrike = 0 ;
Entity . MaxAttack = 0 ;
Entity . MinAttack = 0 ;
Entity . PhysicalDamageDecrease = 0 ;
Entity . MagicDamageDecrease = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . PhysicalDamageIncrease = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . ItemHP = 0 ;
Entity . ItemMP = 0 ;
Entity . ItemBless = 0 ;
Entity . AttackRange = 0 ;
Entity . BaseMinAttack = 0 ;
Entity . BaseMaxAttack = 0 ;
Entity . BaseMagicDefence = 0 ;
Entity . BaseDefence = 0 ;
Entity . MagicAttack = 0 ;
Entity . MagicDefence = 0 ;
Entity . DragonGem = 0 ;
Entity . PhoenixGem = 0 ;
Entity . TortisGem = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . Gems = new UInt16 [ 10 ];
#endregion
foreach ( IConquerItem i in Equipment . Objects )
{
if ( i != null )
{
if ( i . Durability != 0 && i . Position > 9 )
{
if ( i . Position != ConquerItem . AltGarment && i . Position != ConquerItem . LeftWeaponAccessory && i . Position != ConquerItem . RightWeaponAccessory )
{
if ( i . Position != ConquerItem . SteedArmor )
{
Database . ConquerItemInformation dbi = new Database . ConquerItemInformation ( i . ID , i . Plus );
if ( dbi != null )
{
/*if (i.ID == 0x493e0)
{
byte r = 0;
byte g = 0;
byte b = 0;
r = (byte)i.Hema1;
g = (byte)i.Hema2;
b = (byte)i.Hema3;
i.Color = (AhmedFox.Game.Enums.Color)b;
i.Bless = g;
i.Unknown40 = r;
}*/
#region Give Stats.
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( i . Purification . PurificationItemID , 0 );
if ( i . RefineItem != 0 )
refine = i . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) soulDB . BaseInformation . Dodge ;
//Entity.Hitpoints += Infos.ItemHP;
Entity . AssassinColor = ( uint ) Entity . BattlePower ;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . BaseMinAttack += soulDB . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += soulDB . BaseInformation . MaxAttack ;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . ItemHP += soulDB . BaseInformation . ItemHP ;
Entity . ItemMP += soulDB . BaseInformation . ItemMP ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += dbi . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += dbi . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) dbi . BaseInformation . Dodge ;
if ( i . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += dbi . BaseInformation . MagicAttack ;
}
Entity . ItemHP += dbi . BaseInformation . ItemHP ;
Entity . ItemMP += dbi . BaseInformation . ItemMP ;
if ( i . ID != 0x493e0 )
{
Entity . ItemBless += i . Bless ;
}
if ( i . Position == ConquerItem . AltRightHand )
{
Entity . AttackRange += dbi . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( dbi . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( i . Position == ConquerItem . AltLeftHand )
{
Entity . BaseMinAttack += ( uint )( dbi . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( dbi . BaseInformation . MaxAttack * 0.5F );
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += dbi . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += dbi . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . BaseInformation . MaxAttack ;
}
if ( i . Plus != 0 )
{
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) dbi . PlusInformation . MagicDefence ;
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) dbi . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) dbi . PlusInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += dbi . PlusInformation . MagicAttack ;
Entity . Defence += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += dbi . PlusInformation . MagicDefence ;
Entity . ItemHP += dbi . PlusInformation . ItemHP ;
if ( i . Position == ConquerItem . AltBoots )
{
Entity . Dodge += ( byte ) dbi . PlusInformation . Dodge ;
}
if ( i . Position == ConquerItem . Steed )
{
Entity . ExtraVigor += dbi . PlusInformation . Agility ;
}
}
}
byte socketone = ( byte ) i . SocketOne ;
byte sockettwo = ( byte ) i . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
Entity . ItemHP += i . Enchant ;
GemAlgorithm ();
#endregion
}
}
}
}
}
}
}
public void LoadItemStats ( Game . Entity e )
{
#region Set Every Variable to Zero
Entity . Defence = 0 ;
Entity . MagicDefence = 0 ;
Entity . Dodge = 0 ;
Entity . BaseMagicAttack = 0 ;
Entity . WoodResistance = 0 ;
Entity . FireResistance = 0 ;
Entity . WaterResistance = 0 ;
Entity . EarthResistance = 0 ;
Entity . MetalResistance = 0 ;
Entity . Breaktrough = 0 ;
Entity . CriticalStrike = 0 ;
Entity . Immunity = 0 ;
Entity . Penetration = 0 ;
Entity . Counteraction = 0 ;
Entity . Block = 0 ;
Entity . Detoxication = 0 ;
Entity . Intensification = 0 ;
Entity . Penetration = 0 ;
Entity . SkillCStrike = 0 ;
Entity . MaxAttack = 0 ;
Entity . MinAttack = 0 ;
Entity . PhysicalDamageDecrease = 0 ;
Entity . MagicDamageDecrease = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . PhysicalDamageIncrease = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . ItemHP = 0 ;
Entity . ItemMP = 0 ;
Entity . ItemBless = 0 ;
Entity . AttackRange = 0 ;
Entity . BaseMinAttack = 0 ;
Entity . BaseMaxAttack = 0 ;
Entity . BaseMagicDefence = 0 ;
Entity . BaseDefence = 0 ;
Entity . MagicAttack = 0 ;
Entity . MagicDefence = 0 ;
Entity . DragonGem = 0 ;
Entity . PhoenixGem = 0 ;
Entity . TortisGem = 0 ;
Entity . MagicDefencePercent = 0 ;
Entity . MagicDamageIncrease = 0 ;
Entity . Gems = new UInt16 [ 10 ];
#endregion
foreach ( IConquerItem i in Equipment . Objects )
{
if ( i != null )
{
if ( i . Durability != 0 && i . Position < 20 )
{
if ( i . Position != ConquerItem . Garment && i . Position != ConquerItem . LeftWeaponAccessory && i . Position != ConquerItem . RightWeaponAccessory )
{
if ( i . Position != ConquerItem . SteedArmor )
{
Database . ConquerItemInformation dbi = new Database . ConquerItemInformation ( i . ID , i . Plus );
if ( dbi != null )
{
if ( i . ID == 0x493e0 )
{
byte r = 0 ;
byte g = 0 ;
byte b = 0 ;
r = ( byte ) i . Fox1 ;
g = ( byte ) i . Fox2 ;
b = ( byte ) i . Fox3 ;
i . Color = ( AhmedFox . Game . Enums . Color ) b ;
i . Bless = g ;
i . Unknown40 = r ;
//i.Send(e.Owner);
}
#region Give Stats.
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( i . Purification . PurificationItemID , 0 );
if ( i . RefineItem != 0 )
refine = i . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
//Entity.Defence += soulDB.BaseInformation.PhysicalDefence;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) soulDB . BaseInformation . Dodge ;
Entity . AssassinColor = ( uint ) Entity . BattlePower ;
//Entity.Hitpoints += Infos.ItemHP;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . BaseMinAttack += soulDB . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += soulDB . BaseInformation . MaxAttack ;
// Entity.MetalResistance += soulDB.BaseInformation.me;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . ItemHP += soulDB . BaseInformation . ItemHP ;
Entity . ItemMP += soulDB . BaseInformation . ItemMP ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += dbi . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += dbi . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += dbi . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) dbi . BaseInformation . Dodge ;
if ( i . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += dbi . BaseInformation . MagicAttack ;
}
Entity . ItemHP += dbi . BaseInformation . ItemHP ;
Entity . ItemMP += dbi . BaseInformation . ItemMP ;
if ( i . ID != 0x493e0 )
{
Entity . ItemBless += i . Bless ;
}
if ( i . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange += dbi . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( dbi . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( i . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack += ( uint )( dbi . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( dbi . BaseInformation . MaxAttack * 0.5F );
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += dbi . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += dbi . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . BaseInformation . MaxAttack ;
}
if ( i . Plus != 0 )
{
if ( i . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) dbi . PlusInformation . MagicDefence ;
}
else if ( i . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) dbi . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) dbi . PlusInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += dbi . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += dbi . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += dbi . PlusInformation . MagicAttack ;
Entity . Defence += dbi . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += dbi . PlusInformation . MagicDefence ;
Entity . ItemHP += dbi . PlusInformation . ItemHP ;
if ( i . Position == ConquerItem . Boots )
{
Entity . Dodge += ( byte ) dbi . PlusInformation . Dodge ;
}
if ( i . Position == ConquerItem . Steed )
{
Entity . ExtraVigor += dbi . PlusInformation . Agility ;
}
}
}
byte socketone = ( byte ) i . SocketOne ;
byte sockettwo = ( byte ) i . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
Entity . ItemHP += i . Enchant ;
GemAlgorithm ();
#endregion
}
}
}
}
}
}
}
#region OLD LOADITEMSTATS
public void LoadItemStats ( Interfaces . IConquerItem item ) //Use to load every item
{
if ( item == null )
return;
if ( item . Durability == 0 )
return;
if ( item . Position == ConquerItem . Garment )
return;
Database . ConquerItemInformation Infos = new AhmedFox . Database . ConquerItemInformation ( item . ID , item . Plus );
if ( Infos . BaseInformation == null )
return;
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( item . Purification . PurificationItemID , 0 );
if ( item . RefineItem != 0 )
refine = item . RefineStats ;
if ( soulDB != null )
{
Entity . Defence += soulDB . BaseInformation . PhysicalDefence ;
Entity . MagicDefence += soulDB . BaseInformation . MagicDefence ;
Entity . Dodge += soulDB . BaseInformation . Dodge ;
Entity . BaseMagicAttack += soulDB . BaseInformation . MagicAttack ;
Entity . WoodResistance += soulDB . BaseInformation . WoodResist ;
Entity . FireResistance += soulDB . BaseInformation . FireResist ;
Entity . WaterResistance += soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance += soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough += soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike += soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity += soulDB . BaseInformation . Immunity ;
Entity . Penetration += soulDB . BaseInformation . Penetration ;
Entity . Counteraction += soulDB . BaseInformation . CounterAction ;
Entity . Block += soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough += ( UInt16 )(( refine . Percent * 10 ) + 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction += ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike += ( UInt16 )(( refine . Percent * 100 ) + 1000 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification += ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration += ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike += ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += Infos . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence += Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent += Infos . BaseInformation . MagicDefence ;
Entity . Dodge += ( byte ) Infos . BaseInformation . Dodge ;
if ( item . Position != ConquerItem . Fan )
Entity . BaseMagicAttack += Infos . BaseInformation . MagicAttack ;
}
Entity . ItemHP += Infos . BaseInformation . ItemHP ;
Entity . ItemMP += Infos . BaseInformation . ItemMP ;
Entity . ItemBless += item . Bless ;
if ( item . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange += Infos . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( Infos . BaseInformation . ID ))
Entity . AttackRange += 3 ;
else
{
Entity . AttackRange += 2 ;
}
}
if ( item . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack += ( uint )( Infos . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack += ( uint )( Infos . BaseInformation . MaxAttack * 0.5F );
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += Infos . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease += Infos . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack += Infos . BaseInformation . MinAttack ;
Entity . BaseMaxAttack += Infos . BaseInformation . MaxAttack ;
}
if ( item . Plus != 0 )
{
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease += Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease += ( ushort ) Infos . PlusInformation . MagicDefence ;
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease += ( ushort ) Infos . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease += ( ushort ) Infos . PlusInformation . MagicAttack ;
}
else
{
if ( item . Position == ConquerItem . Steed )
Entity . ExtraVigor += Infos . PlusInformation . Agility ;
Entity . BaseMinAttack += Infos . PlusInformation . MinAttack ;
Entity . BaseMaxAttack += Infos . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack += Infos . PlusInformation . MagicAttack ;
Entity . Defence += Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDefence += Infos . PlusInformation . MagicDefence ;
Entity . ItemHP += Infos . PlusInformation . ItemHP ;
if ( item . Position == ConquerItem . Boots )
Entity . Dodge += ( byte ) Infos . PlusInformation . Dodge ;
}
}
byte socketone = ( byte ) item . SocketOne ;
byte sockettwo = ( byte ) item . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease += dadd ;
Entity . MagicDamageDecrease += madd ;
Entity . PhysicalDamageIncrease += aatk ;
Entity . MagicDamageIncrease += matk ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle )
{
Entity . ItemHP += item . Enchant ;
GemAlgorithm ();
}
}
public void UnloadItemStats ( Interfaces . IConquerItem item , bool onPurpose )
{
if ( item == null ) return;
if ( item . Durability == 0 && ! onPurpose )
return;
if ( item . Position == ConquerItem . Garment )
return;
Database . ConquerItemInformation Infos = new AhmedFox . Database . ConquerItemInformation ( item . ID , item . Plus );
if ( Infos . BaseInformation == null )
return;
Refinery . RefineryItem refine = null ;
Database . ConquerItemInformation soulDB = new AhmedFox . Database . ConquerItemInformation ( item . Purification . PurificationItemID , 0 );
if ( item . RefineItem != 0 )
refine = item . RefineStats ;
if ( soulDB != null )
{
Entity . Defence -= soulDB . BaseInformation . PhysicalDefence ;
Entity . MagicDefence -= soulDB . BaseInformation . MagicDefence ;
Entity . Dodge -= soulDB . BaseInformation . Dodge ;
Entity . BaseMagicAttack -= soulDB . BaseInformation . MagicAttack ;
Entity . WoodResistance -= soulDB . BaseInformation . WoodResist ;
Entity . FireResistance -= soulDB . BaseInformation . FireResist ;
Entity . WaterResistance -= soulDB . BaseInformation . WaterResist ;
Entity . EarthResistance -= soulDB . BaseInformation . EarthResist ;
Entity . Breaktrough -= soulDB . BaseInformation . BreakThrough ;
Entity . CriticalStrike -= soulDB . BaseInformation . CriticalStrike ;
Entity . Immunity -= soulDB . BaseInformation . Immunity ;
Entity . Penetration -= soulDB . BaseInformation . Penetration ;
Entity . Counteraction -= soulDB . BaseInformation . CounterAction ;
Entity . Block -= soulDB . BaseInformation . Block ;
}
if ( refine != null )
{
switch ( refine . Type )
{
case Refinery . RefineryItem . RefineryType . Block :
Entity . Block -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . BreakThrough :
Entity . Breaktrough -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Counteraction :
Entity . Counteraction -= ( UInt16 )( refine . Percent * 10 );
break;
case Refinery . RefineryItem . RefineryType . Critical :
Entity . CriticalStrike -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Detoxication :
Entity . Detoxication -= ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Immunity :
Entity . Immunity -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . Intensification :
Entity . Intensification -= ( UInt16 )( refine . Percent );
break;
case Refinery . RefineryItem . RefineryType . Penetration :
Entity . Penetration -= ( UInt16 )( refine . Percent * 100 );
break;
case Refinery . RefineryItem . RefineryType . SCritical :
Entity . SkillCStrike -= ( UInt16 )( refine . Percent * 100 );
break;
}
}
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease -= Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDamageDecrease -= Infos . BaseInformation . MagicDefence ;
}
else
{
Entity . Defence -= Infos . BaseInformation . PhysicalDefence ;
Entity . MagicDefencePercent -= Infos . BaseInformation . MagicDefence ;
Entity . Dodge -= ( byte ) Infos . BaseInformation . Dodge ;
if ( item . Position != ConquerItem . Fan )
Entity . BaseMagicAttack -= Infos . BaseInformation . MagicAttack ;
}
Entity . ItemHP -= Infos . BaseInformation . ItemHP ;
Entity . ItemMP -= Infos . BaseInformation . ItemMP ;
Entity . ItemBless -= item . Bless ;
if ( item . Position == ConquerItem . RightWeapon )
{
Entity . AttackRange -= Infos . BaseInformation . AttackRange ;
if ( Network . Packets . IsTwoHand ( Infos . BaseInformation . ID ))
Entity . AttackRange -= 2 ;
}
if ( item . Position == ConquerItem . LeftWeapon )
{
Entity . BaseMinAttack -= ( uint )( Infos . BaseInformation . MinAttack * 0.5F );
Entity . BaseMaxAttack -= ( uint )( Infos . BaseInformation . MaxAttack * 0.5F );
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease -= Infos . BaseInformation . MinAttack ;
Entity . MagicDamageIncrease -= Infos . BaseInformation . MagicAttack ;
}
else
{
Entity . BaseMinAttack -= Infos . BaseInformation . MinAttack ;
Entity . BaseMaxAttack -= Infos . BaseInformation . MaxAttack ;
}
if ( item . Plus != 0 )
{
if ( item . Position == ConquerItem . Tower )
{
Entity . PhysicalDamageDecrease -= Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDamageDecrease -= ( ushort ) Infos . PlusInformation . MagicDefence ;
}
else if ( item . Position == ConquerItem . Fan )
{
Entity . PhysicalDamageIncrease -= ( ushort ) Infos . PlusInformation . MinAttack ;
Entity . MagicDamageIncrease -= ( ushort ) Infos . PlusInformation . MagicAttack ;
}
else
{
if ( item . Position == ConquerItem . Steed )
Entity . ExtraVigor -= Infos . PlusInformation . Agility ;
Entity . BaseMinAttack -= Infos . PlusInformation . MinAttack ;
Entity . BaseMaxAttack -= Infos . PlusInformation . MaxAttack ;
Entity . BaseMagicAttack -= Infos . PlusInformation . MagicAttack ;
Entity . Defence -= Infos . PlusInformation . PhysicalDefence ;
Entity . MagicDefence -= Infos . PlusInformation . MagicDefence ;
Entity . ItemHP -= Infos . PlusInformation . ItemHP ;
if ( item . Position == ConquerItem . Boots )
Entity . Dodge -= ( byte ) Infos . PlusInformation . Dodge ;
}
}
byte socketone = ( byte ) item . SocketOne ;
byte sockettwo = ( byte ) item . SocketTwo ;
ushort madd = 0 , dadd = 0 , aatk = 0 , matk = 0 ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( socketone )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle &&
item . Position != ConquerItem . Steed )
switch ( sockettwo )
{
case 1 : Entity . PhoenixGem += 5 ; break;
case 2 : Entity . PhoenixGem += 10 ; break;
case 3 : Entity . PhoenixGem += 15 ; break;
case 11 : Entity . DragonGem += 5 ; break;
case 12 : Entity . DragonGem += 10 ; break;
case 13 : Entity . DragonGem += 15 ; break;
case 71 : Entity . TortisGem += 15 ; break;
case 72 : Entity . TortisGem += 30 ; break;
case 73 : Entity . TortisGem += 50 ; break;
case 101 : aatk = matk += 100 ; break;
case 102 : aatk = matk += 300 ; break;
case 103 : aatk = matk += 500 ; break;
case 121 : madd = dadd += 100 ; break;
case 122 : madd = dadd += 300 ; break;
case 123 : madd = dadd += 500 ; break;
}
Entity . PhysicalDamageDecrease -= dadd ;
Entity . MagicDamageDecrease -= madd ;
Entity . PhysicalDamageIncrease -= aatk ;
Entity . MagicDamageIncrease -= matk ;
if ( item . Position != ConquerItem . Garment &&
item . Position != ConquerItem . Bottle )
{
Entity . ItemHP -= item . Enchant ;
GemAlgorithm ();
}
}
#endregion
public void LoadSoulStats ( uint ID )
{
var Infos = AhmedFox . Database . ConquerItemInformation . BaseInformations [ ID ];
Entity . Defence += Infos . PhysicalDefence ;
Entity . MagicDefence += Infos . MagicDefence ;
Entity . Dodge += ( byte ) Infos . Dodge ;
//Entity.max += Infos.ItemHP;
Entity . BaseMagicAttack += Infos . MagicAttack ;
Entity . BaseMinAttack += Infos . MinAttack ;
Entity . BaseMaxAttack += Infos . MaxAttack ;
}
public void UnloadSoulStats ( uint ID )
{
var Infos = AhmedFox . Database . ConquerItemInformation . BaseInformations [ ID ];
Entity . Defence -= Infos . PhysicalDefence ;
Entity . MagicDefence -= Infos . MagicDefence ;
Entity . Dodge -= ( byte ) Infos . Dodge ;
//Entity.Hitpoints -= Infos.ItemHP;
Entity . BaseMagicAttack -= Infos . MagicAttack ;
Entity . BaseMinAttack -= Infos . MinAttack ;
Entity . BaseMaxAttack -= Infos . MaxAttack ;
}
public void GemAlgorithm ()
{
Entity . MaxAttack = Entity . Strength + Entity . BaseMaxAttack ;
Entity . MinAttack = Entity . Strength + Entity . BaseMinAttack ;
Entity . MagicAttack = Entity . BaseMagicAttack ;
if ( Entity . PhoenixGem != 0 )
{
Entity . MagicAttack += ( uint ) Math . Floor ( Entity . MagicAttack * (double)( Entity . PhoenixGem * 0.01 ));
}
if ( Entity . DragonGem != 0 )
{
Entity . MaxAttack += ( uint ) Math . Floor ( Entity . MaxAttack * (double)( Entity . DragonGem * 0.01 ));
Entity . MinAttack += ( uint ) Math . Floor ( Entity . MinAttack * (double)( Entity . DragonGem * 0.01 ));
}
/*if (Entity.TortisGem != 0)
{
Entity.Defence += (ushort)Math.Floor(Entity.Defence * (double)(Entity.TortisGem * 0.01));
Entity.MagicDefence += (ushort)Math.Floor(Entity.MagicDefence * (double)(Entity.TortisGem * 0.01));
}*/
}
#endregion
its kinda similar to mine. ok imma try this
07/28/2013, 01:40
#7
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
same probs
07/28/2013, 05:51
#8
elite*gold: 0
Join Date: Oct 2007
Posts: 21
Received Thanks: 0
Quote:
Originally Posted by
marcbacor6666
same probs
remove the all codes from #region chi then your good.
07/28/2013, 09:01
#9
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
any other solution?
07/29/2013, 23:01
#10
elite*gold: 0
Join Date: Feb 2013
Posts: 51
Received Thanks: 22
the client calculates the MaxHp by receiving the data sent from server , it has many resources
1-the character state points
2-items
3-Subclasses
4-Chi Points
so you need first to check what is causing the problem ,you need to stop sending each one of this four data one by one and check the hp each time to figure out which system needs to be fixed , then you where to look and fix what is needed
and start with stopping Subclass and Chi , if everything went fine activate Chi and check again
07/30/2013, 03:18
#11
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
everything is in chi and subclass calculation, if u activate subclass, the maxhitpoints rises but it wont fill up the hitpoints if you use any lifefruit or any life items.
same with the chi
any idea why it wont fill the maxhitpoints??
07/30/2013, 05:16
#12
elite*gold: 0
Join Date: Feb 2013
Posts: 51
Received Thanks: 22
Quote:
Originally Posted by
marcbacor6666
everything is in chi and subclass calculation, if u activate subclass, the maxhitpoints rises but it wont fill up the hitpoints if you use any lifefruit or any life items.
same with the chi
any idea why it wont fill the maxhitpoints??
it wont fill the maxhp coz u sent the subclass data and Chi data to the client (the client calculated them client side) and ddnt add them to the maxhp server side
so u need to add the r8 calculation for them just after the itemstate calculation
and if u want some organized codes then u need to create a void or function for each one and call them from a single update state void
calculate state points (you have that)
calculate items ------ (you have that)
calculate Subclass --- (MaxHp+= Points)
Calculate Chi -------- (MaxHp+= Points)
07/30/2013, 08:41
#13
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
thank you for the answer egyptian, if u dont mind, can u show us what you did to yours.
07/30/2013, 10:24
#14
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Well actually thanks for something. Didn't know subclasses calculated HP clientside. Does anyone know the actual calculation for sublcasses HP.
07/30/2013, 10:32
#15
elite*gold: 0
Join Date: Oct 2006
Posts: 557
Received Thanks: 76
yes i want to know also
Similar Threads
Problem in my source updated to version 5620+ *Impulse Source*
08/15/2012 - CO2 Private Server - 11 Replies
I updated my source to version 5620+
1) I open my account with any password.
2) Can I log into an account without having a registered account.
3) I cannot see the monsters or other players
Any help or hint is welcome.....
[Problem] Can you guys tell me about this problem with my source
12/08/2011 - CO2 Private Server - 5 Replies
Look at this:
CAN YOU HELP ME?
how i fix this problem at my source 5525>>no one say change source
10/28/2011 - CO2 Private Server - 5 Replies
my source close after like 2 hours or 3 hours and may after 5 hours
befor i close i see this errors o consol
i taked up this pic befor it clos by 1 second
http://www.m5zny.com/upfiles/j4o37683.jpg
http://www.m5zny.com/upfiles/b8q37683.jpg
[Source] Problem mit der Source
05/29/2011 - Flyff Private Server - 0 Replies
Hallo Leutz,
ich habe folgendes Problem ich habe meine source Compilet was vorher nie ein problem war jetz habe ich es wider gemacht und es kamen keine errors wie immer nur waren diesmal keine .exen im output ordner woran kann das liegen ich würde mich sehr über eine antwort freuen
mfg
[Source Problem] Source auf LANG 6 compilien [D-Flyff Font]
04/13/2011 - Flyff Private Server - 10 Replies
Hey Leutz,
ich komme da mal mit nem mehr oder weniger kleinen Problem.
Aufgrund der Misserfolge nur die Neuz in LANG 6 zu compilien, hat man mir geraten die kompletten Bins auf LANG 6 zu setzen.
Seitdem funktioniert die D-Flyff Schrift super, es ist nichts verrutscht, Login klappt auch etc.
Problem ist jetzt nur das ich keine inGame Rechte mehr habe.
Habe extra neuen acc erstellt, neuen char bin sämtliche Operatoren ( L, M, N, O, P, Z) durchgegangen nur leider habe ich immer noch...
All times are GMT +1. The time now is 15:12 .