public ItemRepairEvent(RepairBench repairBench, BaseEntity.RPCMessage msg)
 {
     RepairBench = repairBench;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(repairBench.inventory.GetSlot(0));
 }
 public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item)
 {
     Entity = collectibleEntity;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(item);
 }
Exemple #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);
 }
        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;
        }
Exemple #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;
 }
        public ItemConditionEvent(Item item, float amount)
        {
            Item = new InvItem(item);
            Amount = amount;

            BasePlayer ownerPlayer = item.GetOwnerPlayer();

            if (ownerPlayer != null) {
                Player = Server.GetPlayer(ownerPlayer);
            }
        }
Exemple #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));

        }
        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);
        }
        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);
        }
Exemple #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);
     }
 }
Exemple #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;
 }
Exemple #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 = "";
        }
 public MetabolismTickEvent(BasePlayer basePlayer)
 {
     Victim = Server.GetPlayer(basePlayer);
 }
 public ShootRocketEvent(BaseLauncher baseLauncher, BaseEntity.RPCMessage msg, BaseEntity baseEntity)
 {
     BaseLauncher = baseLauncher;
     Entity = new Entity(baseEntity);
     Player = Server.GetPlayer(msg.player);
 }
Exemple #15
0
 public RespawnEvent(Player player, Vector3 position, Quaternion quaternion)
 {
     Player = player;
     SpawnPos = position;
     SpawnRot = quaternion;
 }
 public PlayerClothingEvent(PlayerInventory playerInventory, Item item)
 {
     Player = Server.GetPlayer(playerInventory.containerMain.playerOwner);
     Item = new InvItem(item);
 }
Exemple #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");
            }
        }
Exemple #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");
            }
        }
Exemple #19
0
        public void AddCharater()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));
        }
Exemple #20
0
 public SyringeUseEvent(MedicalTool syringe, BasePlayer owner, BasePlayer target)
 {
     Syringe = syringe;
     User = Server.GetPlayer(owner);
     Receiver = Server.GetPlayer(target);
 }
Exemple #21
0
 public DoorUseEvent(Door door, BaseEntity.RPCMessage msg, bool open)
 {
     Door = new Entity(door);
     Player = Server.GetPlayer(msg.player);
     Open = open;
 }
Exemple #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);
        }
Exemple #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");
            }
            
        }
 public MetabolismDamageEvent(BasePlayer player)
 {
     Victim = Server.GetPlayer(player);
 }
 public PlayerHealthChangeEvent(BasePlayer basePlayer, float oldHealth, float newHealth)
 {
     Player = Server.GetPlayer(basePlayer);
     OldHealth = oldHealth;
     NewHealth = newHealth;
 }
 public BuildingUpgradeEvent(BuildingBlock buildingBlock, BuildingGrade.Enum buildingGrade, BasePlayer basePlayer)
 {
     BuildingPart = new BuildingPart(buildingBlock);
     Grade = buildingGrade;
     Player = Server.GetPlayer(basePlayer);
 }
Exemple #27
0
 public ThrowEvent(ThrownWeapon thrownWeapon, BaseEntity.RPCMessage msg)
 {
     Projectile = thrownWeapon;
     Player = Server.GetPlayer(msg.player);
     ProjectileName = ExplosiveNames[thrownWeapon.ShortPrefabName];
 }
Exemple #28
0
 public LootEvent(PlayerLoot playerLoot, Player looter)
 {
     Looter = looter;
     pLoot = playerLoot;
 }
Exemple #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);
 }