| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Server.MirDatabase;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- public class BlockingObject : MonsterObject
- {
- public MonsterObject Parent;
- public bool Visible;
- protected internal BlockingObject(MonsterObject parent, MonsterInfo info) : base(info)
- {
- Parent = parent;
- Visible = true;
- }
- public override bool Blocking
- {
- get
- {
- return Parent.Blocking;
- }
- }
- public override bool Walk(MirDirection dir) { return false; }
- public override bool IsAttackTarget(MonsterObject attacker)
- {
- return Parent.IsAttackTarget(attacker);
- }
- public override bool IsAttackTarget(HumanObject attacker)
- {
- return Parent.IsAttackTarget(attacker);
- }
- protected override void ProcessRoam() { }
- protected override void ProcessSearch() { }
- public override int Attacked(HumanObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
- {
- return Parent.Attacked(attacker, damage, type, damageWeapon);
- }
- public override void Spawned()
- {
- base.Spawned();
- }
- public override Packet GetInfo()
- {
- if (!Visible) return null;
- return base.GetInfo();
- }
- public void Hide()
- {
- Visible = false;
- if (CurrentMap == null) return;
- CurrentMap.Broadcast(new S.ObjectRemove { ObjectID = ObjectID }, CurrentLocation);
- }
- public void Show()
- {
- Visible = true;
- if (CurrentMap == null) return;
- Broadcast(GetInfo());
- }
- }
- }
|