示例#1
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            switch (menu.Menu)
            {
            case 15:     // Close the loot
                return;

            case 13:     // Retrieve all items
                TakeAll(player);
                break;

            case 12:     // Retrieve an item
                TakeLoot(player);
                break;
            }

            GoldBag bag;

            if (_lootBags.TryGetValue(player.CharacterId, out bag))
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE, 32);
                Out.WriteByte(4);
                Out.WriteByte(1);
                Out.WriteByte(1);
                Item.BuildItem(ref Out, null, ItemService.GetItem_Info(bag.bagWon), null, 0, 1);
                player.SendPacket(Out);
            }
            else
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE, 32);
                Out.WriteByte(4);
                Out.WriteByte(0);
                player.SendPacket(Out);
            }
        }
示例#2
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (_captureCheck != null && !_captureCheck.Invoke(player))
            {
                return;
            }

            if (Locked)
            {
                player.SendClientMessage("This point is locked down.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }
            if (OwningRealm == player.Realm)
            {
                player.SendClientMessage("Your realm already owns this point.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (player.StealthLevel > 0)
            {
                player.SendClientMessage("You can't interact with objects while in stealth.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (CaptureDuration == 0)
            {
                player.SendClientMessage("Capture duration is 0!");
                return;
            }

            BeginInteraction(player);
        }
示例#3
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (HeldState == EHeldState.Inactive || HeldState == EHeldState.Carried || (RealmCapturableFor != 0 && player.Realm != RealmCapturableFor))
            {
                return;
            }

            if (player.StealthLevel > 0)
            {
                player.SendClientMessage("You can't interact with objects while in stealth", ChatLogFilters.CHATLOGFILTERS_C_ABILITY_ERROR);
                return;
            }

            if (player.HeldObject != null)
            {
                player.SendClientMessage("You can't carry more than one object", ChatLogFilters.CHATLOGFILTERS_C_ABILITY_ERROR);
                return;
            }

            if (HeldState == EHeldState.Ground)
            {
                _evtInterface.RemoveEvent(ResetFromGround);
            }

            BeginInteraction(player);
        }
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (player.CbtInterface.IsInCombat)
            {
                player.SendClientMessage("Can't use this portal while in combat.", ChatLogFilters.CHATLOGFILTERS_SAY);
                return;
            }

            // Gets the port target
            BattlefrontObject target;
            Point3D           targetPos;

            if (player.Realm == Realms.REALMS_REALM_ORDER)
            {
                target    = _orderTarget;
                targetPos = _orderTargetPos;
            }
            else
            {
                target    = _destroTarget;
                targetPos = _destroTargetPos;
            }

            Teleport(player, target, targetPos);
        }
        public override void Interact(GameObject obj, Player plr, InteractMenu menu)
        {
            base.Interact(obj, plr, menu);

            if ((obj == _destroGunPowder && plr.Realm == Realms.REALMS_REALM_ORDER && plr == _carrier) ||
                (obj == _orderGunPowder && plr.Realm == Realms.REALMS_REALM_DESTRUCTION && plr == _carrier))
            {
                //drop part
                PutPartInCart(plr, obj);
            }
            else if (_carrier == null && obj.Name == _bomb.Name)
            {
                if (plr.StealthLevel > 0)
                {
                    plr.SendClientMessage("You can't interact with objects while in stealth.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                    return;
                }


                if (_carrier == null)
                {
                    _bomb.BeginPickup(plr);
                }
            }
        }
示例#6
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            Vector2 toPlayerVec = new Vector2(player.WorldPosition.X - WorldPosition.X, player.WorldPosition.Y - WorldPosition.Y);

            float dist = Vector2.DotProduct2D(toPlayerVec, _unitDirVec);

            if (Math.Abs(dist) * 0.083f > _info.MaxInteractionDist)
            {
                player.SendClientMessage("Too far from palisade", ChatLogFilters.CHATLOGFILTERS_C_ABILITY_ERROR);
                player.SendClientMessage("Too far away from the " + _info.Name);
                return;
            }

            if (player.Palisade != null && player.Palisade != this)
            {
                player.SendClientMessage("Already in cover", ChatLogFilters.CHATLOGFILTERS_C_ABILITY_ERROR);
                player.SendClientMessage("Already interacting with another palisade.");
                return;
            }

            switch (_buildState)
            {
            case EConstructionState.Constructing:
                BeginInteraction(player);
                break;

            case EConstructionState.Active:
                HandleUser(player);
                break;
            }

            // _logger.Debug($"RVRStructure Sendinteract Oid={Oid} {IsActive} {_buildState} {Faction} {Realm} {Level} {X} {Y} {Z} {XOffset} {YOffset} ");
        }
示例#7
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (_captureCheck != null && !_captureCheck(player))
            {
                return;
            }

            if (CaptureDuration > 0)
            {
                BeginInteraction(player);
            }

            else
            {
                HandleInteractionEvents(player);

                TryLoot(player, menu);

                switch (Spawn.Entry)
                {
                case 242:
                case 511:           // Inside hunters vale portal  // vale vine
                case 99891:         // Hardcoded portal for Thanquil's incursion
                case 100132:
                case 99667:
                case 98845:
                case 344:
                case 100575:
                case 100576:
                case 100577:
                case 100578:
                case 99644:
                case 100610:
                case 100611:
                case 100612:
                    ZoneJump(player);
                    return;

                case 98878:         // Hardcoded portal for Gunbad
                    ZoneJump(player, 60);
                    return;
                }

                if (Spawn.DoorId != 0)
                {
                    if (VfxState == 0)
                    {
                        OpenDoor(true);
                    }
                }

                else
                {
                    Region?.Scenario?.Interact(this, player, menu);

                    base.SendInteract(player, menu);
                }
            }
        }
 public override void Interact(GameObject obj, Player player, InteractMenu menu)
 {
     if (HasStarted)
     {
         int shift = (((int)player.Realm) + _potralShift) % 3;
         player.Teleport(172, _portals[shift].Item1, _portals[shift].Item2, _portals[shift].Item3, _portals[shift].Item4);
     }
 }
示例#9
0
        public void OnInteract(Object Obj, Player Target, InteractMenu Menu)
        {
            //Log.Info("ScriptsInterface", "OnInteract Scripts : " + Scripts.Count);

            for (int i = 0; i < Scripts.Count; ++i)
            {
                Scripts[i].OnInteract(Obj, Target, Menu);
            }
        }
 public override void Interact(GameObject obj, Player plr, InteractMenu menu)
 {
     if (obj == _flagBases[0] || obj == _flagBases[1])
     {
         CheckCapture(obj, plr);
     }
     else if (obj == _flagDrops[0] || obj == _flagDrops[1])
     {
         CheckDropOff(obj, plr);
     }
 }
示例#11
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            uint itemid = 0;

            switch (Bannertyp)
            {
            case 0: itemid = (uint)(RealmStandard == Realms.REALMS_REALM_DESTRUCTION ? 187704 : 187701); break;

            case 1: itemid = (uint)(RealmStandard == Realms.REALMS_REALM_DESTRUCTION ? 187705 : 187702); break;

            case 2: itemid = (uint)(RealmStandard == Realms.REALMS_REALM_DESTRUCTION ? 187706 : 187703); break;
            }


            if (player == Owner)
            {
                if (player.ItmInterface.GetItemInSlot(14) == null)
                {
                    player.ItmInterface.CreateItem(ItemService.GetItem_Info(itemid), 1, 14);
                    player.ItmInterface.SendEquipped(player);
                    player.ItmInterface.SendEquipped(null);
                }
                else
                {
                    player.ItmInterface.CreateItem(ItemService.GetItem_Info(itemid), 1);
                }
            }
            else if (player.Realm == RealmStandard)
            {
                Character_mail Mail = new Character_mail();
                Mail.Guid              = CharMgr.GenerateMailGuid();
                Mail.CharacterId       = Owner.CharacterId;
                Mail.CharacterIdSender = player.CharacterId;
                Mail.SenderName        = player.Name;
                Mail.ReceiverName      = Owner.Name;
                Mail.SendDate          = (uint)TCPManager.GetTimeStamp();
                Mail.Title             = "Guild Standard";
                Mail.Content           = "Found your Guild Standard";
                Mail.Money             = 0;
                Mail.Opened            = false;
                Mail.Items.Add(new MailItem(itemid, 1));
                CharMgr.AddMail(Mail);
            }
            else
            {
                player.AddRenown(600, false);
            }


            player.PlantedStandard = null;
            Dispose();
        }
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (OwningRealm == player.Realm && AssaultingRealm == Realms.REALMS_REALM_NEUTRAL)
            {
                player.SendClientMessage("Your realm already owns this flag.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (OwningRealm != player.Realm && OwningRealm == player.Realm)
            {
                player.SendClientMessage("Your realm is already assaulting this flag.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (!player.CbtInterface.IsPvp)
            {
                player.SendClientMessage("You must be flagged to cap.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (player.StealthLevel > 0)
            {
                player.SendClientMessage("You can't interact with objects while in stealth.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            foreach (var guard in Guards)
            {
                if (guard.Creature != null && !guard.Creature.IsDead && GetDistanceTo(guard.Creature) < 100)
                {
                    player.SendClientMessage("Can't capture while a guard (" + guard.Creature.Name + ") is still alive.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                    return;
                }
            }

            if (AllowInteract(player) && InteractableFor(player))
            {
                if (_captureInProgress)  // cross realm fires here
                {
                    player.SendClientMessage(CapturingPlayer?.Name + " is already interacting with this object.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                }
                else
                {
                    CapturingPlayer    = null;
                    _captureInProgress = true;
                    BeginInteraction(player);

                    _secureProgress = Math.Abs(_captureProgress) * MAX_SECURE_PROGRESS / MAX_CONTROL_GAUGE;
                }
            }
        }
示例#13
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            long now = TCPManager.GetTimeStampMS();

            if (now < _nextAvailableTimestamp)
            {
                player.SendClientMessage("This portal is still unstable. Please wait a moment before trying again.", ChatLogFilters.CHATLOGFILTERS_SAY);
                return;
            }

            _nextAvailableTimestamp = now + BattleFrontConstants.PORTAL_DELAY;

            Teleport(player, (int)targetPortal.ZoneId, targetPosition);
        }
        public override void OnInteract(Object Obj, Player Target, InteractMenu Menu)
        {
            // Make sure the player has the quest and hasn't already finished the objectives.
            if (!Target.GetPlayer().QtsInterface.HasQuest(30001) || Target.GetPlayer().QtsInterface.HasFinishQuest(30001))
            {
                return;
            }

            Target.GetPlayer().QtsInterface.HandleEvent(Objective_Type.QUEST_UNKNOWN, 1314, 1, true);

            Creature c    = Obj.GetCreature();
            Random   rand = new Random();

            //  Make the villager say something
            Double chance = rand.NextDouble();

            if (chance >= 0.8)
            {
                c.Say("Thanks for saving me!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            }
            else if (chance >= 0.6)
            {
                c.Say("Phew, that was close!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            }
            else if (chance >= 0.4)
            {
                c.Say("Ahh, run for your life!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            }
            else if (chance >= 0.2)
            {
                c.Say("I could have taken him myself!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            }
            else
            {
                c.Say("Please help my friend!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY);
            }


            //  Make the villager run to either the start or the village
            chance = rand.NextDouble();
            if (chance >= 0.5)
            {
                c.GetCreature().MvtInterface.Move(22347, 53688, 7425);
            }
            else
            {
                c.GetCreature().MvtInterface.Move(15548, 51104, 7228);
            }
        }
示例#15
0
        public override void TryLoot(Player player, InteractMenu menu)
        {
            LootContainer lootsContainer = LootsMgr.GenerateLoot(this, player, 1);

            if (lootsContainer != null)
            {
                lootsContainer.SendInteract(player, menu);
                // If object has been looted, make it unlootable
                // and then Reset its lootable staus in XX seconds
                if (!lootsContainer.IsLootable())
                {
                    Looted = true;
                    EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1);
                }
            }
        }
示例#16
0
        public override void TryLoot(Player player, InteractMenu menu)
        {
            if (lootContainer != null && lootContainer.IsLootable())
            {
                List <Player> subGroup = new List <Player>();

                if (player.PriorityGroup != null)
                {
                    foreach (Player member in player.PriorityGroup.Members)
                    {
                        if (!member.HasLockout((ushort)ZoneId, BossId))
                        {
                            subGroup.Add(member);
                        }
                    }
                    // used to only have items of careers in group in the lootcontainer
                    //player.PriorityGroup.SubGroupLoot(player, lootContainer, subGroup);
                    player.PriorityGroup.GroupLoot(player, lootContainer);
                }

                if (menu.Menu == 12 || menu.Menu == 13) // on looting
                {
                    if (player.PriorityGroup == null &&
                        player.Zone != null &&
                        player.Zone.Info != null &&
                        (player.Zone.Info.Type == 4 || player.Zone.Info.Type == 5 || player.Zone.Info.Type == 6))
                    {
                        if (!player.HasLockout((ushort)ZoneId, BossId))
                        {
                            lootContainer.SendInteract(player, menu);
                        }
                    }
                }
                else
                {
                    lootContainer.SendInteract(player, menu);
                }

                if (!lootContainer.IsLootable())
                {
                    SetLootable(false, player);
                }
            }
        }
示例#17
0
        public override void OnInteract(Object Obj, Player Target, InteractMenu Menu)
        {
            Objects.GameObject go = Obj.GetGameObject();

            float dx = go.Spawn.WorldX - Target._Value.WorldX;
            float dy = go.Spawn.WorldY - Target._Value.WorldY;

            double heading = Math.Atan2(-dx, dy);

            if (heading < 0)
            {
                heading += 4096;
            }

            const int distance = (int)((float)5 * 13.2f);
            double    angle    = heading;
            double    targetX  = go.Spawn.WorldX - (Math.Sin(angle) * distance);
            double    targetY  = go.Spawn.WorldY + (Math.Cos(angle) * distance);

            int newX;
            int newY;

            if (targetX > 0)
            {
                newX = (int)targetX;
            }
            else
            {
                newX = 0;
            }

            if (targetY > 0)
            {
                newY = (int)targetY;
            }
            else
            {
                newY = 0;
            }

            Target.IntraRegionTeleport((uint)newX, (uint)newY, (ushort)go.Spawn.WorldZ, (ushort)Target._Value.WorldO);
        }
        public override void SendInteract(Player player, InteractMenu menu)
        {
            lock (_capturing)
            {
                if (!_capturing.Contains(player))
                {
                    _capturing.Add(player);
                }
            }

            BuffInfo b = AbilityMgr.GetBuffInfo((ushort)GameBuffs.Interaction);

            b.Duration = CaptureCastTime;
            player.BuffInterface.QueueBuff(new BuffQueueInfo(player, player.Level, b, InteractionBuff.GetNew, LinkToCaptureBuff));

            if (player.IsMounted)
            {
                player.Dismount();
            }
        }
示例#19
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (player.StealthLevel > 0)
            {
                player.SendClientMessage("You can't interact with objects while in stealth.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }


            try
            {
                if (_onInteractWithPowder != null)
                {
                    _onInteractWithPowder(this, player);
                }
            }
            finally
            {
            }
        }
示例#20
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            switch (menu.Menu)
            {
            case 15:     // Close the loot
                return;

            case 13:     // Retrieve all items
                TakeAll(player);
                break;

            case 12:     // Retrieve an item
                TakeLoot(player);
                break;
            }

            // Unknown if needed TODO
            //GoldBag bag;


            if (this.LootBags.ContainsKey(player.CharacterId))
            {
                KeyValuePair <Item_Info, List <Talisman> > lootBag;
                this.LootBags.TryGetValue(player.CharacterId, out lootBag);

                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE, 32);
                Out.WriteByte(4);
                Out.WriteByte(1);
                Out.WriteByte(1);
                Item.BuildItem(ref Out, null, lootBag.Key, null, 0, 1);
                player.SendPacket(Out);
            }
            else
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE, 32);
                Out.WriteByte(4);
                Out.WriteByte(0);
                player.SendPacket(Out);
            }
        }
示例#21
0
        public override void OnInteract(Object Obj, Player Target, InteractMenu Menu)
        {
            // Make sure the player has the quest and hasn't already finished the objectives.
            if (!Target.GetPlayer().QtsInterface.HasQuest(30003) || Target.GetPlayer().QtsInterface.HasFinishQuest(30003))
            {
                return;
            }

            // Spawn the bad npc
            Creature_proto Proto = CreatureService.GetCreatureProto((uint)31);

            if (Proto == null)
            {
                return;
            }

            Obj.UpdateWorldPosition();

            Creature_spawn Spawn = new Creature_spawn();

            Spawn.Guid   = (uint)CreatureService.GenerateCreatureSpawnGUID();
            Proto.Model1 = Obj.GetCreature().Spawn.Proto.Model1;
            Spawn.BuildFromProto(Proto);
            Spawn.WorldO = Obj.Heading;
            Spawn.WorldY = Obj.WorldPosition.Y;
            Spawn.WorldZ = Obj.WorldPosition.Z;
            Spawn.WorldX = Obj.WorldPosition.X;
            Spawn.ZoneId = Obj.Zone.ZoneId;
            //Spawn.Faction = 129;

            Creature c = Obj.Region.CreateCreature(Spawn);

            c.EvtInterface.AddEventNotify(EventName.OnDie, RemoveAdds);

            // Remove the old npc
            Obj.Destroy();

            return;
        }
示例#22
0
        public override void SendInteract(Player player, InteractMenu menu)
        {
            if (player.GldInterface == null)
            {
                player.SendClientMessage("Only guild members can claim a keep", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (!player.GldInterface.IsInGuild())
            {
                player.SendClientMessage("Only guild members can claim a keep", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (player.GldInterface.Guild == null)
            {
                player.SendClientMessage("Only guild members can claim a keep", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (this.Keep.KeepStatus != KeepStatus.KEEPSTATUS_SEIZED)
            {
                player.SendClientMessage("You can only claim a keep when it's lord has been killed", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (!CanClaim(player))
            {
                player.SendClientMessage("You are not senior enough in your guild to claim this keep", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (OwningRealm == player.Realm)
            {
                player.SendClientMessage("Your realm already owns this keep.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (!player.CbtInterface.IsPvp)
            {
                player.SendClientMessage("You must be flagged to cap.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }

            if (player.StealthLevel > 0)
            {
                player.SendClientMessage("You can't interact with objects while in stealth.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                return;
            }


            if (AllowInteract(player) && InteractableFor(player))
            {
                if (_captureInProgress)  // cross realm fires here
                {
                    player.SendClientMessage(CapturingPlayer?.Name + " is already interacting with this object.", ChatLogFilters.CHATLOGFILTERS_USER_ERROR);
                }
                else
                {
                    CapturingPlayer    = null;
                    _captureInProgress = true;
                    BeginInteraction(player);

                    _secureProgress = Math.Abs(_captureProgress) * MAX_SECURE_PROGRESS / MAX_CONTROL_GAUGE;
                }
            }
        }
示例#23
0
            public override void SendInteract(Player player, InteractMenu menu)
            {
                if (VfxState == 1)
                {
                    return;
                }

                if (_keep.Realm != player.Realm)
                {
                    if (_keepDoor.Info.GameObjectId != 72)
                    {
                        player.SendClientMessage("This main door is barricaded and requires a ram to open.");
                        return;
                    }

                    if (player.BuffInterface.GetBuff(14423, null) == null && player.BuffInterface.GetBuff(14427, null) == null && !_keep.AttackerCanUsePostern(_keepDoor.Info.Number))
                    {
                        //player.SendClientMessage("This postern door is barred. To gain access, you must bypass it with an ability, or destroy the associated main door and lower the keep's rank to zero.");
                        player.SendClientMessage("This postern door is barred. To gain access, you must bypass it with an ability, or destroy the associated main door and lower the keep's rank to three.");
                        return;
                    }

                    if (player.CurrentSiege != null)
                    {
                        player.SendClientMessage("You can't take siege weapons through a postern door!");
                        return;
                    }
                }

                if (_keepDoor.Info.TeleportX1 != 0) //new coodinates defined
                {
                    var d1 = player.GetDistanceToWorldPoint(_enterExitPoints[0]);
                    var d2 = player.GetDistanceToWorldPoint(_enterExitPoints[1]);
                    if (d1 > d2)
                    {
                        player.IntraRegionTeleport((uint)_enterExitPoints[0].X, (uint)_enterExitPoints[0].Y, (ushort)_enterExitPoints[0].Z, (ushort)_keepDoor.Info.TeleportO1);
                    }
                    else
                    {
                        player.IntraRegionTeleport((uint)_enterExitPoints[1].X, (uint)_enterExitPoints[1].Y, (ushort)_enterExitPoints[1].Z, (ushort)_keepDoor.Info.TeleportO2);
                    }
                }
                else //use legacy jump formula
                {
                    var   x  = _keep.Doors[0].Info.TeleportX1;
                    float dx = Spawn.WorldX - player._Value.WorldX;
                    float dy = Spawn.WorldY - player._Value.WorldY;

                    double heading = Math.Atan2(-dx, dy);

                    if (heading < 0)
                    {
                        heading += 4096;
                    }

                    int distanceToMove = 15;

                    if (_keepDoor.Info.Number == (int)KeepDoorType.None)
                    {
                        distanceToMove = 25;
                    }

                    int    distance = (int)(distanceToMove * 13.2f);
                    double angle    = heading;
                    double targetX  = Spawn.WorldX - (Math.Sin(angle) * distance);
                    double targetY  = Spawn.WorldY + (Math.Cos(angle) * distance);

                    int newX;
                    int newY;

                    if (targetX > 0)
                    {
                        newX = (int)targetX;
                    }
                    else
                    {
                        newX = 0;
                    }

                    if (targetY > 0)
                    {
                        newY = (int)targetY;
                    }
                    else
                    {
                        newY = 0;
                    }

                    player.IntraRegionTeleport((uint)newX, (uint)newY, (ushort)Spawn.WorldZ, (ushort)player._Value.WorldO);
                }
            }
示例#24
0
        public override void OnInteract(Object Obj, Player Target, InteractMenu Menu)
        {
            Log.Debug("MailBox", "OnInteract " + Target);

            Target.MlInterface.SendMailBox();
        }
示例#25
0
        public void SendInteract(Player player, InteractMenu menu, Creature crea = null)
        {
            if (Money > 0)
            {
                if (player.PriorityGroup == null)
                {
                    if (player.GldInterface.IsInGuild())
                    {
                        player.GldInterface.ApplyTaxTithe(ref Money);
                    }

                    player.AddMoney(Money);
                }
                else
                {
                    player.PriorityGroup.AddMoney(player, Money);
                }
                Money = 0;
            }

            switch (menu.Menu)
            {
            case 15:     // Closing loot window.
                return;

            case 13:
                TakeAll(player, false);
                if (crea != null && crea.Spawn.Proto.LairBoss == false)
                {
                    crea.IsActive = false;
                }
                break;

            case 12:
                if (TakeLoot(player, menu.Num))
                {
                    ClientUpdateLoot(player);
                }

                if (crea != null && LootCount < 1)
                {
                    if (crea != null && crea.Spawn.Proto.LairBoss == false)
                    {
                        crea.IsActive = false;
                    }
                }
                break;

            default:
                ClientUpdateLoot(player);

                if (crea != null && LootCount < 1)
                {
                    if (crea != null && crea.Spawn.Proto.LairBoss == false)
                    {
                        crea.IsActive = false;
                    }
                }
                break;
            }
        }
示例#26
0
 public virtual void OnInteract(Object Obj, Player Target, InteractMenu Menu)
 {
 }
示例#27
0
 public virtual void SendInteract(Player player, InteractMenu menu)
 {
     ScrInterface.OnInteract(this, player, menu);
     WorldMgr.GeneralScripts.OnWorldPlayerEvent("INTERACT", player, this);
 }