//09 0A public void OnItemToggle(SagaMap.Packets.Client.ItemToggle p) { if (this.state != SESSION_STATE.MAP_LOADED) return; Actor target; Map.SkillArgs args; Actor sActor = (Actor)this.Char; int id; byte index = p.GetIndex(); target = this.map.GetActor(p.GetTargetID()); args = new Map.SkillArgs(p.GetSkillType(), 0, p.GetSkillID(), p.GetTargetID(), 0); SkillHandler.CastSkill(ref sActor, ref target, ref args); Packets.Server.ItemActive packet = new SagaMap.Packets.Server.ItemActive(); packet.SetSkillType(p.GetSkillType()); packet.SetContainer(p.GetContainer()); packet.SetIndex(p.GetIndex()); packet.SetSkillID(p.GetSkillID()); packet.SetSActor(this.Char.id); packet.SetDActor(p.GetTargetID()); packet.SetValue(args.damage); this.netIO.SendPacket(packet, this.SessionID); ; this.SendCharStatus(0); Item item = this.Char.inv.GetItem((CONTAINER_TYPE)p.GetContainer(), index); id = item.id; this.map.RemoveItemFromActorPC(this.Char, index, id, 1, ITEM_UPDATE_REASON.PURCHASED); }
//09 0A public void OnItemToggle(SagaMap.Packets.Client.ItemToggle p) { if (this.state != SESSION_STATE.MAP_LOADED) { return; } Actor target; Map.SkillArgs args; Actor sActor = (Actor)this.Char; int id; byte index = p.GetIndex(); target = this.map.GetActor(p.GetTargetID()); args = new Map.SkillArgs(p.GetSkillType(), 0, p.GetSkillID(), p.GetTargetID(), 0); SkillHandler.CastSkill(ref sActor, ref target, ref args); Packets.Server.ItemActive packet = new SagaMap.Packets.Server.ItemActive(); packet.SetSkillType(p.GetSkillType()); packet.SetContainer(p.GetContainer()); packet.SetIndex(p.GetIndex()); packet.SetSkillID(p.GetSkillID()); packet.SetSActor(this.Char.id); packet.SetDActor(p.GetTargetID()); packet.SetValue(args.damage); this.netIO.SendPacket(packet, this.SessionID);; this.SendCharStatus(0); Item item = this.Char.inv.GetItem((CONTAINER_TYPE)p.GetContainer(), index); id = item.id; this.map.RemoveItemFromActorPC(this.Char, index, id, 1, ITEM_UPDATE_REASON.PURCHASED); }
private void SendResult(ActorPC pc, Map.SkillArgs args) { SagaMap.ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e; Packets.Server.ItemActive packet = new SagaMap.Packets.Server.ItemActive(); packet.SetSkillType(args.skillType); packet.SetContainer(0); packet.SetIndex(0); packet.SetSkillID((uint)args.skillID); packet.SetSActor(pc.id); packet.SetDActor(pc.id); packet.SetValue(args.damage); eh.C.netIO.SendPacket(packet, eh.C.SessionID); eh.C.SendCharStatus(0); }
private void SendResult(ActorPC pc,Map.SkillArgs args) { SagaMap.ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e; Packets.Server.ItemActive packet = new SagaMap.Packets.Server.ItemActive(); packet.SetSkillType(args.skillType); packet.SetContainer(0); packet.SetIndex(0); packet.SetSkillID((uint)args.skillID ); packet.SetSActor(pc.id); packet.SetDActor(pc.id ); packet.SetValue(args.damage); eh.C.netIO.SendPacket(packet, eh.C.SessionID); eh.C.SendCharStatus(0); }