|
Originally Posted by gtfo
Go to Character.cs and search for:
Code:
public bool Ghost = false;
Above that add:
Code:
public uint InteractionType = 0;
public uint InteractionWith = 0;
public bool InteractionInProgress = false;
public ushort InteractionX = 0;
public ushort InteractionY = 0;
public bool InteractionSet = false;
Go to world.cs and search for:
Code:
if (CC != C && CC.Loc.Map == C.Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, CC.Loc.X, CC.Loc.Y, 17) && !MyMath.InBox(C.Loc.PreviousX, C.Loc.PreviousY, CC.Loc.X, CC.Loc.Y, 17) || !Check)
{
C.MyClient.AddSend(Packets.SpawnEntity(CC));
if (CC.MyGuild != null)
C.MyClient.AddSend(Packets.String(CC.MyGuild.Guild ID, (byte)StringType.GuildName, CC.MyGuild.GuildName));
CC.MyClient.AddSend(CSpawn);
if (C.MyGuild != null)
CC.MyClient.AddSend(Packets.String(C.MyGuild.Guild ID, (byte)StringType.GuildName, C.MyGuild.GuildName));
}
Under that add:
Code:
if (CC.InteractionInProgress && CC.InteractionWith != C.EntityID && CC.InteractionSet)
{
if (CC.Body == 1003 || CC.Body == 1004)
{
if (CC.InteractionX == CC.Loc.X && CC.Loc.Y == CC.InteractionY)
{
C.MyClient.AddSend(Packets.AttackPacket(CC.EntityI D, CC.InteractionWith, CC.Loc.X, CC.Loc.Y, CC.InteractionType, 49));
}
}
else
{
if (Game.World.H_Chars.ContainsKey(CC.InteractionWith ))
{
Character Cs = Game.World.H_Chars[CC.InteractionWith] as Character;
if (Cs.Loc.X == CC.InteractionX && Cs.Loc.Y == CC.InteractionY)
{
C.MyClient.AddSend(Packets.AttackPacket(CC.EntityI D, CC.InteractionWith, CC.Loc.X, CC.Loc.Y, CC.InteractionType, 49));
}
}
}
}
Go to PacketHandler.cs and search for:
Code:
case 41:
GC.AddSend(Packets.Status(GC.MyChar.EntityID, NewestCOServer.Game.Status.Merchant, 0));
GC.MyChar.Merchant = NewestCOServer.Game.MerchantTypes.Not;
GC.AddSend(Data);
break;
Under that add:
Code:
#region Interact
case 46:
{
uint TargetUID = BitConverter.ToUInt32(Data, 12);
GC.MyChar.InteractionInProgress = false;
GC.MyChar.InteractionWith = TargetUID;
GC.MyChar.InteractionType = 0;
if (Game.World.H_Chars.ContainsKey(TargetUID))
{
Game.Character d = Game.World.H_Chars[TargetUID] as Character;
d.InteractionInProgress = false;
d.InteractionWith = GC.MyChar.EntityID;
d.InteractionType = 0;
d.MyClient.AddSend(Packets.AttackPacket(GC.MyChar. EntityID, TargetUID, d.Loc.X, d.Loc.Y, dmg, 46));
}
break;
}
case 47:
{
GC.MyChar.StatEff.Remove(StatusEffectEn.Ride);
uint TargetUID = BitConverter.ToUInt32(Data, 12);
if (GC.MyChar.InteractionWith != TargetUID)
return;
GC.MyChar.InteractionSet = false;
if (Game.World.H_Chars.ContainsKey(TargetUID))
{
Game.Character d = Game.World.H_Chars[TargetUID] as Character;
d.StatEff.Remove(StatusEffectEn.Ride);
d.InteractionSet = false;
if (d.InteractionWith != GC.MyChar.EntityID)
return;
if (d.Body == 1003 || d.Body == 1004)
{
d.MyClient.AddSend(Packets.AttackPacket(GC.MyChar. EntityID, TargetUID, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, dmg, 47));
d.InteractionInProgress = true;
GC.MyChar.InteractionInProgress = true;
d.InteractionType = dmg;
d.InteractionX = GC.MyChar.Loc.X;//Almost done kk
d.InteractionY = GC.MyChar.Loc.Y;
GC.MyChar.InteractionType = dmg;
GC.MyChar.InteractionX = GC.MyChar.Loc.X;
GC.MyChar.InteractionY = GC.MyChar.Loc.Y;
if (d.Loc.X == GC.MyChar.Loc.X && d.Loc.Y == GC.MyChar.Loc.Y)
{
d.InteractionSet = true;
GC.MyChar.InteractionSet = true;
d.MyClient.AddSend(Packets.AttackPacket(d.EntityID , GC.MyChar.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 47));
GC.MyChar.SendScreen(Packets.AttackPacket(GC.MyCha r.EntityID, d.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 49));
GC.MyChar.SendScreen(Packets.AttackPacket(d.Entity ID, GC.MyChar.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 49));
}
}
else
{
GC.AddSend(Packets.AttackPacket(TargetUID, GC.MyChar.EntityID, d.Loc.X, d.Loc.Y, dmg, 47));
d.InteractionInProgress = true;
GC.MyChar.InteractionInProgress = true;
d.InteractionType = dmg;
d.InteractionX = d.Loc.X;
d.InteractionY = d.Loc.Y;
GC.MyChar.InteractionType = dmg;
GC.MyChar.InteractionX = d.Loc.X;
GC.MyChar.InteractionY = d.Loc.Y;
if (d.Loc.X == GC.MyChar.Loc.X && d.Loc.Y == GC.MyChar.Loc.Y)
{
d.InteractionSet = true;
GC.MyChar.InteractionSet = true;
d.MyClient.AddSend(Packets.AttackPacket(d.EntityID , GC.MyChar.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 47));
GC.MyChar.SendScreen(Packets.AttackPacket(GC.MyCha r.EntityID, d.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 49));
GC.MyChar.SendScreen(Packets.AttackPacket(d.Entity ID, GC.MyChar.EntityID, d.Loc.X, d.Loc.Y, GC.MyChar.InteractionType, 49));
}
}
}
break;
}
case 48:
{
uint TargetUID = BitConverter.ToUInt32(Data, 12);
GC.MyChar.InteractionType = 0;
GC.MyChar.InteractionWith = 0;
GC.MyChar.InteractionInProgress = false;
if (Game.World.H_Chars.ContainsKey(TargetUID))
{
Character d = Game.World.H_Chars[TargetUID] as Character;
d.InteractionType = 0;
d.InteractionWith = 0;
d.InteractionInProgress = false;
}
break;
}
case 50:
{
uint TargetUID = BitConverter.ToUInt32(Data, 12);
uint Attacker = BitConverter.ToUInt32(Data, 8);
GC.MyChar.InteractionType = 0;
GC.MyChar.InteractionWith = 0;
GC.MyChar.InteractionInProgress = false;
if (Game.World.H_Chars.ContainsKey(TargetUID))
{
Game.Character d = Game.World.H_Chars[TargetUID] as Character;
d.InteractionType = 0;
d.InteractionWith = 0;
d.InteractionInProgress = false;
}
GC.MyChar.SendScreen(Packets.AttackPacket(GC.MyCha r.EntityID, TargetUID, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0, 50));
GC.MyChar.SendScreen(Packets.AttackPacket(TargetUI D, GC.MyChar.EntityID, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0, 50));
break;
}
#endregion
Go to Jump.cs and search for:
Code:
if (GC.MyChar.StatEff.Contains(NewestCOServer.Game.St atusEffectEn.Ride))
{
if (GC.MyChar.Vigor >= 5)
GC.MyChar.Vigor -= 5;
else return;
}
Under that add:
Code:
if (GC.MyChar.InteractionInProgress && GC.MyChar.InteractionSet)
{
if (GC.MyChar.Body == 1003 || GC.MyChar.Body == 1004)
{
if (Game.World.H_Chars.ContainsKey(GC.MyChar.Interact ionWith))
{
Game.Character character = Game.World.H_Chars[GC.MyChar.InteractionWith] as Character;
character.MyClient.AddSend(Packets.GeneralData(cha racter.EntityID, 0, BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10), 0x9c));
character.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10));
Game.World.Spawns(character, true);
}
}
}
Go to WalkRun.cs and search for:
Code:
Game.World.Spawns(GC.MyChar, true);
Under it add:
Code:
#region Hold Hands Check
if (GC.MyChar.InteractionInProgress)
{
if (!GC.MyChar.InteractionSet)
{
if (Game.World.H_Chars.ContainsKey(GC.MyChar.Interact ionWith))
{
Game.Character ch = Game.World.H_Chars[GC.MyChar.InteractionWith] as Character;
if (ch.InteractionInProgress && ch.InteractionWith == GC.MyChar.EntityID)
{
if (GC.MyChar.InteractionX == GC.MyChar.Loc.X && GC.MyChar.Loc.Y == GC.MyChar.InteractionY)
{
if (GC.MyChar.Loc.X == ch.Loc.X && GC.MyChar.Loc.Y == ch.Loc.Y)
{
ch.MyClient.AddSend(Packets.AttackPacket(ch.Entity ID, GC.MyChar.EntityID, ch.Loc.X, ch.Loc.Y, GC.MyChar.InteractionType, 47));
GC.MyChar.SendScreen(Packets.AttackPacket(GC.MyCha r.EntityID, ch.EntityID, ch.Loc.X, ch.Loc.Y, GC.MyChar.InteractionType, 49));
GC.MyChar.SendScreen(Packets.AttackPacket(ch.Entit yID, GC.MyChar.EntityID, ch.Loc.X, ch.Loc.Y, GC.MyChar.InteractionType, 49));
GC.MyChar.InteractionSet = true;
ch.InteractionSet = true;
}
}
}
}
}
else
{
if (GC.MyChar.Body == 1003 || GC.MyChar.Body == 1004)
{
if (Game.World.H_Chars.ContainsKey(GC.MyChar.Interact ionWith))
{
Character ch = Game.World.H_Chars[GC.MyChar.InteractionWith] as Character;
ch.Direction = (byte)(Data[4] % 8);
ch.Loc.Walk((byte)(Data[4] % 8));
ch.MyClient.AddSend(Packets.GeneralData(ch.EntityI D, 0, ch.Loc.X, ch.Loc.Y, 0x9c));
World.Spawns(ch, true);
}
}
}
}
#endregion
|