//hc_fugue_enter #include "hc_inc_htf" #include "hc_inc" #include "hc_inc_remeff" #include "chr_inc" #include "dbg_inc" #include "faction_inc" #include "util_inc" void CreateCorpse (object oPlayer) { string sName = GetName (oPlayer); string sCDK = GetPCPublicCDKey (oPlayer); string sID = sName + sCDK; location lDiedHere; lDiedHere = GetLocalLocation (oPlayer, "DeathLocation"); WriteTimestampedLogEntry ("Creating corpse for player " + sName); object oDeathCorpse = CreateObject (OBJECT_TYPE_PLACEABLE, "DeathCorpse", lDiedHere); object oDeadMan = CreateItemOnObject ("playercorpse", oDeathCorpse); SetLocalObject (oDeathCorpse, "Owner", oPlayer); SetLocalString (oDeathCorpse, "Name", sName); SetLocalString (oDeathCorpse, "Key", sCDK); SetLocalObject (oDeathCorpse, "PlayerCorpse", oDeadMan); SetLocalObject (oDeadMan, "Owner", oPlayer); SetLocalObject (oDeadMan, "DeathCorpse", oDeathCorpse); SetLocalString (oDeadMan, "Name", sName); SetLocalString (oDeadMan, "Key", sCDK); SetLocalInt (oDeadMan, "Alignment", GetAlignmentGoodEvil(oPlayer)); SetLocalString (oDeadMan, "Deity", GetDeity (oPlayer)); SetLocalObject (oMod, "PlayerCorpse" + sID, oDeadMan); SetLocalObject (oMod, "DeathCorpse" + sID, oDeathCorpse); } void main() { object oPC = GetEnteringObject(); if (!GetIsPC(oPC)) return; ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectResurrection(), oPC); int nPCID = chr_GetPCID(oPC); if (!sql_GetPCDead(nPCID) && !GetIsDM(oPC)) { dbg_ReportBug("PC in fugue but not marked as dead. How did you get here?", oPC); } CreateCorpse (oPC); fctn_UpdateReputation(oPC); DelayCommand(5.0, DeleteLocalInt (oPC, "DiedButNotInFugue")); DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal( GetMaxHitPoints(oPC)), oPC)); RemoveEffects(oPC); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,SupernaturalEffect(EffectKnockdown()),oPC,1.0); SetPlotFlag(oPC, TRUE); if (!GetIsDM(oPC)) { DelayCommand(4.0, util_PopUp(oPC, "You have died", "You have died and entered the Fugue Plane. You have suffered one half of the experience loss from death.\n\n" + "If you were not alone, your allies may revive you and bring you back avoiding the other half. Or they may bury you to ease your XP loss.\n\n" + "If there is no one coming for you, you may speak with the glowing Orb to return you to your starting location for a second XP penalty. Only do this as a last resort")); } }