Example #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));
 }
Example #2
0
 public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item)
 {
     Entity = collectibleEntity;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(item);
 }
Example #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);
 }
Example #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;
        }
Example #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;
 }
Example #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);
            }
        }
Example #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));

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

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));
        }
Example #20
0
 public SyringeUseEvent(MedicalTool syringe, BasePlayer owner, BasePlayer target)
 {
     Syringe = syringe;
     User = Server.GetPlayer(owner);
     Receiver = Server.GetPlayer(target);
 }
Example #21
0
 public DoorUseEvent(Door door, BaseEntity.RPCMessage msg, bool open)
 {
     Door = new Entity(door);
     Player = Server.GetPlayer(msg.player);
     Open = open;
 }
Example #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);
        }
Example #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);
 }
Example #27
0
 public ThrowEvent(ThrownWeapon thrownWeapon, BaseEntity.RPCMessage msg)
 {
     Projectile = thrownWeapon;
     Player = Server.GetPlayer(msg.player);
     ProjectileName = ExplosiveNames[thrownWeapon.ShortPrefabName];
 }
Example #28
0
 public LootEvent(PlayerLoot playerLoot, Player looter)
 {
     Looter = looter;
     pLoot = playerLoot;
 }
Example #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);
 }