Пример #1
0
 public ItemRepairEvent(RepairBench repairBench, BaseEntity.RPCMessage msg)
 {
     RepairBench = repairBench;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(repairBench.inventory.GetSlot(0));
 }
Пример #2
0
 public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item)
 {
     Entity = collectibleEntity;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(item);
 }
Пример #3
0
 public CommandEvent(Player player, string[] command)
 {
     User = player;
     Args = new string[command.Length - 1];
     Cmd = command[0];
     Reply = string.Format("/{0} executed!", string.Join(" ", command));
     Array.Copy(command, 1, Args, 0, command.Length - 1);
 }
Пример #4
0
        public WeaponThrowEvent(BaseMelee weapon, BasePlayer basePlayer, ProjectileShoot projectileShoot, ProjectileShoot.Projectile projectile)
        {
            Weapon = weapon;
            Player = Server.GetPlayer(basePlayer);
            ProjectileShoot = projectileShoot;
            Projectile = projectile;

            Magnitude = projectile.startVel.magnitude;
        }
Пример #5
0
 public BuildingEvent(Construction construction,
                      Construction.Target target,
                      BuildingBlock buildingBlock,
                      bool needsValidPlacement)
 {
     Construction = construction;
     Target = target;
     BuildingPart = new BuildingPart(buildingBlock);
     Builder = Server.GetPlayer(target.player);
     NeedsValidPlacement = needsValidPlacement;
 }
Пример #6
0
        public ItemConditionEvent(Item item, float amount)
        {
            Item = new InvItem(item);
            Amount = amount;

            BasePlayer ownerPlayer = item.GetOwnerPlayer();

            if (ownerPlayer != null) {
                Player = Server.GetPlayer(ownerPlayer);
            }
        }
Пример #7
0
        public void AddValidDeathKnight()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));

            p.Characters.First().Level = 55;

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.DeathKnight));

        }
Пример #8
0
        public InventoryModEvent(ItemContainer itemContainer, Item item)
        {
            ItemContainer = itemContainer;
            Item = new InvItem(item);

            if (itemContainer.playerOwner != null)
                Player = Server.GetPlayer(itemContainer.playerOwner);

            if (itemContainer.entityOwner != null)
                Entity = new Entity(itemContainer.entityOwner);
        }
Пример #9
0
        public PlayerTakeRadsEvent(BasePlayer basePlayer, float current, float amount)
        {
            Victim = Server.GetPlayer(basePlayer);
            Current = current;
            RadAmount = amount;

            float next = Mathf.Clamp(amount,
                                     basePlayer.metabolism.radiation_level.min,
                                     basePlayer.metabolism.radiation_level.max);
            Next = Mathf.Max(current, next);
        }
Пример #10
0
 public GatherEvent(ResourceDispenser resourceDispenser,
                    BaseEntity from,
                    BaseEntity to,
                    ItemAmount itemAmount,
                    int amount)
 {
     if (to is BasePlayer) {
         ResourceDispenser = resourceDispenser;
         Resource = new Entity(from);
         Gatherer = Server.GetPlayer(to as BasePlayer);
         ItemAmount = itemAmount;
         Amount = (int)(amount * World.GetInstance().ResourceGatherMultiplier);
     }
 }
Пример #11
0
 public CraftEvent(ItemCrafter itemCrafter,
                   ItemBlueprint itemBlueprint,
                   BasePlayer owner,
                   ProtoBuf.Item.InstanceData instanceData,
                   int amount,
                   int skinid)
 {
     this.itemCrafter = itemCrafter;
     bluePrint = itemBlueprint;
     Crafter = Server.GetPlayer(owner);
     Target = itemBlueprint.targetItem;
     Amount = amount;
     SkinID = skinid;
 }
Пример #12
0
        public ChatEvent(Player player, ConsoleSystem.Arg args)
        {
            Arg = args;
            OriginalText = args.ArgsStr.Substring(1, args.ArgsStr.Length - 2).Replace("\\", "");
            User = player;

            if (args.connection != null)
                BroadcastName = args.connection.username.Replace('<', '[').Replace('>', ']');
            else
                BroadcastName = Server.server_message_name;

            FinalText = OriginalText;
            Reply = "";
        }
Пример #13
0
 public MetabolismTickEvent(BasePlayer basePlayer)
 {
     Victim = Server.GetPlayer(basePlayer);
 }
Пример #14
0
 public ShootRocketEvent(BaseLauncher baseLauncher, BaseEntity.RPCMessage msg, BaseEntity baseEntity)
 {
     BaseLauncher = baseLauncher;
     Entity = new Entity(baseEntity);
     Player = Server.GetPlayer(msg.player);
 }
Пример #15
0
 public RespawnEvent(Player player, Vector3 position, Quaternion quaternion)
 {
     Player = player;
     SpawnPos = position;
     SpawnRot = quaternion;
 }
Пример #16
0
 public PlayerClothingEvent(PlayerInventory playerInventory, Item item)
 {
     Player = Server.GetPlayer(playerInventory.containerMain.playerOwner);
     Item = new InvItem(item);
 }
Пример #17
0
        public void InvalidUndeleteNonexistant()
        {
            Player p = new Player("testName", "testPassword");

            try
            {
                p.Undelete(Guid.NewGuid());
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.AreEqual(ex.Message, "This Character does not exist");
            }
        }
Пример #18
0
        public void InvalidUndeleteAlreadyUndeleted()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));

            try
            {
                p.Undelete(p.Characters.First().Id);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.AreEqual(ex.Message, "This Character is already undeleted");
            }
        }
Пример #19
0
        public void AddCharater()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));
        }
Пример #20
0
 public SyringeUseEvent(MedicalTool syringe, BasePlayer owner, BasePlayer target)
 {
     Syringe = syringe;
     User = Server.GetPlayer(owner);
     Receiver = Server.GetPlayer(target);
 }
Пример #21
0
 public DoorUseEvent(Door door, BaseEntity.RPCMessage msg, bool open)
 {
     Door = new Entity(door);
     Player = Server.GetPlayer(msg.player);
     Open = open;
 }
Пример #22
0
        public void ValidUndelete()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));

            p.Characters.First().Active = false;

            p.Undelete(p.Characters.First().Id);
        }
Пример #23
0
        public void AddInvalidDeathKnight()
        {
            Player p = new Player("testName", "testPassword");

            try
            {
                p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.DeathKnight));
                Assert.Fail();
            }
            catch(Exception ex)
            {
                Assert.AreEqual(ex.Message, "Cannot create a Death Knight untill one of your Characters is at least level 55");
            }
            
        }
Пример #24
0
 public MetabolismDamageEvent(BasePlayer player)
 {
     Victim = Server.GetPlayer(player);
 }
Пример #25
0
 public PlayerHealthChangeEvent(BasePlayer basePlayer, float oldHealth, float newHealth)
 {
     Player = Server.GetPlayer(basePlayer);
     OldHealth = oldHealth;
     NewHealth = newHealth;
 }
Пример #26
0
 public BuildingUpgradeEvent(BuildingBlock buildingBlock, BuildingGrade.Enum buildingGrade, BasePlayer basePlayer)
 {
     BuildingPart = new BuildingPart(buildingBlock);
     Grade = buildingGrade;
     Player = Server.GetPlayer(basePlayer);
 }
Пример #27
0
 public ThrowEvent(ThrownWeapon thrownWeapon, BaseEntity.RPCMessage msg)
 {
     Projectile = thrownWeapon;
     Player = Server.GetPlayer(msg.player);
     ProjectileName = ExplosiveNames[thrownWeapon.ShortPrefabName];
 }
Пример #28
0
 public LootEvent(PlayerLoot playerLoot, Player looter)
 {
     Looter = looter;
     pLoot = playerLoot;
 }
Пример #29
0
 public ShootEvent(BaseProjectile baseProjectile, BaseEntity.RPCMessage msg)
 {
     BaseProjectile = baseProjectile;
     Player = Server.GetPlayer(msg.player);
 }
 public BuildingPartDemolishedEvent(BuildingBlock buildingBlock, BasePlayer basePlayer)
 {
     BuildingPart = new BuildingPart(buildingBlock);
     Player = Server.GetPlayer(basePlayer);
 }