I know EXACTLY where I'm looking but not sure what I'm looking for, ranged/magic works fine so I looked through that code to see if I could figure what was the major difference between that and melee but I don't see it >.<
The character attacks but gives no damage, yes I've had a check to see if it recognises damage which it seems to. Using a breakpoint gets all the way to where I have commented //Add here but nothing after that?
Code:
#region Melee
else if (attack.AttackType == Attack.Melee)
{
if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
{
CheckForExtraWeaponPowers(attacker.Owner, attacked);
if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee)) return;
pass = true;
if (attacker.OnFatalStrike())
{
if (attacked.EntityFlag == EntityFlag.Monster)
{
pass = true;
}
}
ushort range = attacker.AttackRange;
if (attacker.Transformed)
range = (ushort)attacker.TransformationAttackRange;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
{
attack.Effect = Attack.AttackEffects1.None;
#region 11960
if (attacker.EpicTrojan())
{
if (attacker.Owner.Spells.ContainsKey(11960))
{
var spell = Database.SpellTable.GetSpell(11960, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(32))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attacked1, attack, damages, spell);
suse.AddTarget(attacked1.UID, damages, attack);
byte num = 0;
switch (spell.Level)
{
case 0: num = 5; break;
case 1: num = 6; break;
case 2: num = 7; break;
case 3: num = 8; break;
case 4: num = 9; break;
case 5: num = 10; break;
case 6: num = 11; break;
case 7: num = 12; break;
case 8: num = 14; break;
case 9: num = 20; break;
}
if (attacker.Stamina <= 150)
{
attacker.Stamina += num;
attacker.Owner.Send(new Message("the~caster~has~a~100%~chance~to~recover~Stamina~by~" + num + ".", System.Drawing.Color.Red, Message.TopLeft));
}
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
{
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
suse.AddTarget(attackedsob.UID, damages, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
}
#endregion
#region 11990
if (attacker.EpicTrojan())
{
if (attacker.Owner.Spells.ContainsKey(11990))
{
var spell = Database.SpellTable.GetSpell(11990, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
if (Handle.CanAttack(attacker, attacked, spell, false))
{
lastAttacked = attacked;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
suse.Effect1 = attack.Effect1;
Handle.ReceiveAttack(attacker, attacked, attack, damages, spell);
suse.AddTarget(attacked.UID, damages, attack);
}
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attacked1, attack, damages, spell);
suse.AddTarget(attacked1.UID, damages, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
{
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) / 6;
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
suse.AddTarget(attackedsob.UID, damages, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
}
#endregion
#region 12110
if (attacker.EpicNinja())
{
if (attacker.Owner.Spells.ContainsKey(12110))
{
var spell = Database.SpellTable.GetSpell(12110, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
if (Handle.CanAttack(attacker, attacked, spell, false))
{
lastAttacked = attacked;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
suse.Effect1 = attack.Effect1;
Handle.ReceiveAttack(attacker, attacked, attack, damages, spell);
suse.AddTarget(attacked.UID, damages, attack);
}
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 1)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attacked1, attack, damages, spell);
suse.AddTarget(attacked1.UID, damages, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 1)
{
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
suse.AddTarget(attackedsob.UID, damages, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
}
#endregion
#region KungFu
if (attacker.OshaPashaa())
{
if (attacker.Owner.Spells.ContainsKey(12240))
{
var spell = Database.SpellTable.GetSpell(12240, attacker.Owner);
if (spell != null)
{
spell.CanKill = true;
if (Kernel.Rate(spell.Percent))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacker.X;
suse.Y = attacker.Y;
IMapObject lastAttacked = attacker;
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
continue;
attack.Effect1 = Attack.AttackEffects1.None;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
suse.Effect1 = attack.Effect1;
attack.Damage = damages;
ReceiveAttack(attacker, attacked, attack, damages, spell);
suse.AddTarget(attacked.UID, damages, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.Player)
{
if (_obj.UID == attacked.UID) continue;
var attacked1 = _obj as Entity;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
{
if (Handle.CanAttack(attacker, attacked1, spell, false))
{
lastAttacked = attacked1;
uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, spell, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attacked1, attack, damages, spell);
suse.AddTarget(attacked1.UID, damages, attack);
}
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
{
if (Handle.CanAttack(attacker, attackedsob, spell))
{
lastAttacked = attackedsob;
uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
suse.Effect1 = attack.Effect1;
if (damages == 0) break;
Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
suse.AddTarget(attackedsob.UID, damages, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
return;
}
}
}
}
#endregion
uint damage = 0;
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
attack.Damage = damage;
#region FatalLag
if (attacker.OnFatalStrike())
{
if (attacked.EntityFlag == EntityFlag.Monster)
{
var weaps = attacker.Owner.Weapons;
bool can = false;
if (weaps.Item1 != null)
if (weaps.Item1.ID / 1000 == 601)
can = true;
if (weaps.Item2 != null)
if (weaps.Item2.ID / 1000 == 601)
can = true;
if (!can)
return;
ushort x = attacked.X;
ushort y = attacked.Y;
Map.UpdateCoordonatesForAngle(ref x, ref y, Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
attacker.Shift(x, y);
attack.X = x;
attack.Y = y;
damage = damage / 5;
attack.Damage = damage;
attack.AttackType = Attack.FatalStrike;
}
}
//over:
#endregion
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 != null)
{
ConquerItem rightweapon = weapons.Item1;
ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
bool wep1bs = false, wep2bs = false;
if (wep1subyte == 421)
{
wep1bs = true;
wep1subyte--;
}
ushort wep1spellid = 0, wep2spellid = 0;
if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
Database.SpellInformation wep1spell = null, wep2spell = null;
if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
{
wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
doWep1Spell = Kernel.Rate(wep1spell.Percent);
if (attacked.EntityFlag == EntityFlag.Player && wep1spellid == 10490)
doWep1Spell = Kernel.Rate(5);
}
if (!doWep1Spell)
{
if (weapons.Item2 != null)
{
ConquerItem leftweapon = weapons.Item2;
wep2subyte = (ushort)(leftweapon.ID / 1000);
if (wep2subyte == 421)
{
wep2bs = true;
wep2subyte--;
}
if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
{
wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
doWep2Spell = Kernel.Rate(wep2spell.Percent);
if (attacked.EntityFlag == EntityFlag.Player && wep2spellid == 10490)
doWep2Spell = Kernel.Rate(5);
}
}
}
if (!attacker.Transformed)
{
if (doWep1Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.CheakWeponSpell = true;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Attacked = attacked.UID;
attack.Damage = wep1spell.ID;
goto restart;
}
if (doWep2Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Attacked = attacked.UID;
attack.Damage = wep2spell.ID;
goto restart;
}
if (wep1bs)
wep1subyte++;
if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
if (damage > attacked.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
}
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
}
}
}
}
else
{
if (!attacker.Transformed)
{
if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
if (damage > attacked.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, 0);
}
}
}
ReceiveAttack(attacker, attacked, attack, damage, null);
attack.AttackType = Attack.Melee;
//Add here!!!!!!!!!!!!!!
}
else
{
attacker.AttackPacket = null;
}
}
else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
{
CheckForExtraWeaponPowers(attacker.Owner, null);
if (CanAttack(attacker, attackedsob, null))
{
ushort range = attacker.AttackRange;
if (attacker.Transformed)
range = (ushort)attacker.TransformationAttackRange;
if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= range)
{
attack.Effect = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
var weapons = attacker.Owner.Weapons;
if (weapons.Item1 != null)
{
ConquerItem rightweapon = weapons.Item1;
ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
bool wep1bs = false, wep2bs = false;
if (wep1subyte == 421)
{
wep1bs = true;
wep1subyte--;
}
ushort wep1spellid = 0, wep2spellid = 0;
if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
Database.SpellInformation wep1spell = null, wep2spell = null;
if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
{
wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
doWep1Spell = Kernel.Rate(wep1spell.Percent);
}
if (!doWep1Spell)
{
if (weapons.Item2 != null)
{
ConquerItem leftweapon = weapons.Item2;
wep2subyte = (ushort)(leftweapon.ID / 1000);
if (wep2subyte == 421)
{
wep2bs = true;
wep2subyte--;
}
if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
{
wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
doWep2Spell = Kernel.Rate(wep2spell.Percent);
}
}
}
if (!attacker.Transformed)
{
if (doWep1Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.CheakWeponSpell = true;
attack.X = attackedsob.X;
attack.Y = attackedsob.Y;
attack.Attacked = attackedsob.UID;
attack.Damage = wep1spell.ID;
goto restart;
}
if (doWep2Spell)
{
attack.AttackType = Attack.Magic;
attack.Decoded = true;
attack.X = attackedsob.X;
attack.Y = attackedsob.Y;
attack.Attacked = attackedsob.UID;
attack.Damage = wep2spell.ID;
goto restart;
}
if (attacker.MapID == 1039)
{
if (wep1bs)
wep1subyte++;
if (attacker.EntityFlag == EntityFlag.Player)
if (damage > attackedsob.Hitpoints)
{
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
}
}
else
{
attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
if (wep2subyte != 0)
{
if (wep2bs)
wep2subyte++;
attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
}
}
}
}
}
attack.Damage = damage;
ReceiveAttack(attacker, attackedsob, attack, damage, null);
}
else
{
attacker.AttackPacket = null;
}
}
}
else
{
attacker.AttackPacket = null;
}
}
#endregion
Okay well it attacks player vs player it attacks Guards whilst on PK, it even uses the weapons skills which also gives no damage. Melee does not give damage, ranged/magic attack does give damage though.
On a side note the skills are lvling even though they don't damage lol
Actually i think you should use Breakpoints to track where it is setting the damage back to 0.
I am at work, so I cannot see the code, Notepad makes it hard lol, also I can't connect to internet at home for a while.
It's an old trinity source. stop slating it if that's all you're here to do. Anyway on topic I managed to get the thing to actually hit the creatures now, just that it hits on 1s and 3s. Turns out it was in calculations where part of the problem lays.
Well I thought. 12/10/2010 - Grand Chase - 20 Replies I thought pvp hacks were banned from this forum but yet he deliberately handed out pvp hacks to few and/or many gcph players. If im not mistaken its IN THE RULES that no pvp hacks are to be released. He broke pne of the major rules.
i thought I'd say hi to everyone 12/06/2008 - Dekaron - 3 Replies well I've decided to try 2moons again and hopefully i can make something out of it. Lately I've been pretty busy with college and life but now I'm back and ready to rampage on trieste again.
Just a thought 08/03/2007 - Eudemons Online - 0 Replies Is it possible that pathfinding be client-side? If so, we might be able to edit the coordinates they lead to and change them into something useful like boss coordinates or something.
Does anyone know the memory address for map id? Or better yet, does anyone know what radar.ini is used for? And what about MapDestination.dat and MapDestination.ini?
Just a thought tell me what you think 08/01/2007 - Conquer Online 2 - 2 Replies Since sv 1.15 will only work with patch 51 what if you have 2 hard drives and you install CO on both 1 with patch 51 and 1 with patch 52 because if you have patch 51 multiclient won't work..(correct me if im wrong) so you can only have 1 client running with patch 51 so if you have both versions but on diff hard drive you can still multiclient and use sv right..? Just a thought feedback is welcome
Has anyone thought of or working on... 01/10/2006 - Conquer Online 2 - 5 Replies Has anyone thought of or working on a stamina hack similar to the one on CO1 or a way to jump the guild wars gate/walls?