The combat context changes how much experience a death costs.
Dying to a member of a clan on which your clan declared war costs one quarter of normal death XP, including an unreturned declaration. Academy members are an exception; see the clan guide.
Registered attackers and defenders lose one quarter of normal death XP inside or outside the battlefield during the siege. Unregistered players get this reduction only inside.
Festival of Darkness deaths cost one quarter of normal death XP. Resurrection is unavailable inside the Oracle.
A normal formal duel defeat has no death XP penalty.
For a hypothetical normal loss of 4,000 XP, a qualifying castle-siege death at one quarter of normal costs 1,000 XP. That reduction concerns the death itself. A later Resurrection calculation concerns recovery of the resulting recoverable loss. Do not subtract “one quarter” directly from the entire level bar.