HiddenTradition_PRC8/_module/nss/ro_m_cheat_enter.nss

122 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

#include "nw_i0_plot"
// -----------------------------------------------
// This code goes in the Module OnClientEnter script.
// When a PC joins the game this code looks for the item "death".
//
// If the item is not found no penalty is applied.
// If the item is found, a Gold and XP penalty is applied.
//Penalty applied for having a Death Amulet
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
// The XP penalty is currently set to the PC's level x 100 - it is
// a harsh penalty, but they were trying to cheat so... :)
//
// If you wish to reduce the amount taken, reduce the 100 in the line below.
// Note that this script will never cause a PC to lose a level.
int nPenalty = 100 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
// The gold penalty is currently set to 20% of their gold - it is
// a very harsh penalty, but they were trying to cheat so... :)
//
// If you wish to reduce the amount taken, reduce the .20 in the line below.
// Note that this script will never take more then 10,000 gold.
int nGoldToTake = FloatToInt(0.20 * GetGold(oDead));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 20000)
{
nGoldToTake = 20000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
// This section is still part of the Module OnClientEnter Script.
void main()
{
// Death Amulet Activities
object oPC = GetEnteringObject();
if(HasItem(oPC, "Death"))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPC)), oPC);
RemoveEffects(oPC);
object oItemToTake;
oItemToTake = GetItemPossessedBy(oPC, "Death");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
ApplyPenalty(oPC);
}
//Temporary Boots of Speed remover
if (GetItemPossessedBy(oPC, "NW_IT_MBOOTS005")== OBJECT_INVALID)return;
object oBoots;
oBoots = GetItemPossessedBy(oPC, "NW_IT_MBOOTS005");
if (GetIsObjectValid(oBoots)) DestroyObject(oBoots);
//Trial Factionalising SCript
//if (!(GetRacialType(oPC) == RACIAL_TYPE_HUMAN))
// return;
//if (!(GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL))
// return;
//if (!(GetDeity(oPC) == "Jesus"))
// return;
// object oTarget;
// oTarget = GetObjectByTag("ct_InquisitionSoldier");
// AdjustReputation(oPC, oTarget, 99);
}