예제 #1
0
        public void OnTeleportRequest(CM_TELEPORT_REQUEST p)
        {
            if (chara.Locations.Contains(p.Location))
            {
                Dictionary <Common.Item.Item, ushort> items = new Dictionary <Common.Item.Item, ushort>();
                Common.Item.Item add;
                ushort           total = 0;
                foreach (KeyValuePair <ushort, ushort> i in p.ExchangeItems)
                {
                    add = Character.Inventory.Container[Common.Item.Containers.Inventory][i.Key];
                    if (add != null)
                    {
                        if (add.Count >= i.Value && add.ItemID == 65000)
                        {
                            items.Add(add, i.Value);
                            total += i.Value;
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                if (total > 0 && total < 30)
                {
                    SM_TELEPORT_REQUEST r = new SM_TELEPORT_REQUEST()
                    {
                        Location = p.Location,
                        Time     = 100
                    };
                    Network.SendPacket(r);

                    Teleport teleport = new Teleport();
                    SkillArg arg      = new SkillArg()
                    {
                        Caster = chara,
                        Dir    = p.Location
                    };
                    teleport.HandleSkillActivate(arg, items);
                }
            }
        }