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