public void OnActorAppears(Actor actor) { if (actor.type == ActorType.PC) { ActorPC aActor = (ActorPC)actor; Weapon activeweapon = null; //send actorPCInfo Packets.Server.ActorPCInfo p1 = new SagaMap.Packets.Server.ActorPCInfo(); p1.SetActorID(aActor.id); p1.SetGender(aActor.sex); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetName(aActor.name); p1.SetRace(aActor.race); p1.SetFace(aActor.face); p1.SetDetails(aActor.details); foreach (Weapon i in aActor.Weapons) { if (i.active == 1) { activeweapon = i; } } p1.SetEquip(aActor.inv.GetEquipIDs(), aActor.inv.GetEquipDyes(), activeweapon); p1.SetJob(aActor.job); C.netIO.SendPacket(p1, C.SessionID); } else if (actor.type == ActorType.NPC) { ActorNPC aActor = (ActorNPC)actor; if (aActor.npcType >= 10000) { aActor.aStats = new int[0]; } else { try { Npc npc = (Npc)aActor.e; aActor.aStats[0] = Quest.QuestsManager.GetNPCIcon(this.I, npc); } catch (Exception) { } } Packets.Server.ActorNPCInfo p1 = new SagaMap.Packets.Server.ActorNPCInfo((byte)aActor.aStats.Length); p1.SetActorID(aActor.id); p1.SetNPCID(aActor.npcType); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetAdditionalStatus(aActor.aStats); C.netIO.SendPacket(p1, C.SessionID); if (aActor.npcType >= 50000) { Ship ship = (Ship)aActor.e; ship.Map.MoveActor(Map.MOVE_TYPE.START, ship.Actor, null, 0, null, 0, ship.Speed); } } else if (actor.type == ActorType.Item) { ActorItem aActor = (ActorItem)actor; Packets.Server.ActorItemInfo p1 = new SagaMap.Packets.Server.ActorItemInfo(); p1.SetActorID(aActor.id); p1.SetNPCID(aActor.itemtype); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetActive(1); p1.SetU1(1); p1.SetU2(1); C.netIO.SendPacket(p1, C.SessionID); } SkillHandler.SendAllStatusIcons(this.I, actor); }
private void ProcessTest2(MapClient client, string args) { ActorPC aActor = MapServer.charDB.GetChar(client.Char.charID); Weapon activeweapon = null; Packets.Server.ActorPCInfo p1 = new SagaMap.Packets.Server.ActorPCInfo(); p1.SetActorID((uint)Global.Random.Next(0x000100, 0x0000200)); p1.SetGender(aActor.sex); p1.SetLocation(client.Char.x, client.Char.y, client.Char.z + 500); p1.SetYaw(aActor.yaw); p1.SetName(aActor.name); p1.SetRace(aActor.race); p1.SetFace(aActor.face); p1.SetDetails(aActor.details); foreach (Weapon i in aActor.Weapons) { if (i.active == 1) activeweapon = i; } p1.SetEquip(aActor.inv.GetEquipIDs(), aActor.inv.GetEquipDyes(), activeweapon); p1.SetJob(aActor.job); client.netIO.SendPacket(p1, client.SessionID); }
public void OnActorAppears(Actor actor) { if (actor.type == ActorType.PC) { ActorPC aActor = (ActorPC)actor; Weapon activeweapon=null; //send actorPCInfo Packets.Server.ActorPCInfo p1 = new SagaMap.Packets.Server.ActorPCInfo(); p1.SetActorID(aActor.id); p1.SetGender(aActor.sex); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetName(aActor.name); p1.SetRace(aActor.race); p1.SetFace(aActor.face); p1.SetDetails(aActor.details); foreach (Weapon i in aActor.Weapons) { if (i.active == 1) activeweapon = i; } p1.SetEquip(aActor.inv.GetEquipIDs(),aActor.inv.GetEquipDyes(),activeweapon); p1.SetJob(aActor.job); C.netIO.SendPacket(p1, C.SessionID); } else if (actor.type == ActorType.NPC) { ActorNPC aActor = (ActorNPC)actor; if (aActor.npcType >= 10000) aActor.aStats = new int[0]; else { try { Npc npc = (Npc)aActor.e; aActor.aStats[0] = Quest.QuestsManager.GetNPCIcon(this.I, npc); } catch (Exception) { } } Packets.Server.ActorNPCInfo p1 = new SagaMap.Packets.Server.ActorNPCInfo((byte)aActor.aStats.Length); p1.SetActorID(aActor.id); p1.SetNPCID(aActor.npcType); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetAdditionalStatus(aActor.aStats); C.netIO.SendPacket(p1, C.SessionID); if (aActor.npcType >= 50000) { Ship ship = (Ship)aActor.e; ship.Map.MoveActor(Map.MOVE_TYPE.START, ship.Actor, null, 0, null, 0, ship.Speed); } } else if (actor.type == ActorType.Item) { ActorItem aActor = (ActorItem)actor; Packets.Server.ActorItemInfo p1 = new SagaMap.Packets.Server.ActorItemInfo(); p1.SetActorID(aActor.id); p1.SetNPCID(aActor.itemtype); p1.SetLocation(aActor.x, aActor.y, aActor.z); p1.SetYaw(aActor.yaw); p1.SetActive(1); p1.SetU1(1); p1.SetU2(1); C.netIO.SendPacket(p1, C.SessionID); } SkillHandler.SendAllStatusIcons(this.I, actor); }