121 lines
4.4 KiB
Plaintext
121 lines
4.4 KiB
Plaintext
|
|
#include "nw_i0_plot"
|
|
|
|
// * Applies an XP and GP penalty
|
|
// * to the player respawning
|
|
void ApplyPenalty(object oDead)
|
|
{
|
|
int nXP = GetXP(oDead);
|
|
int nPenalty = 75 * 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);
|
|
int nGoldToTake = FloatToInt(0.15 * GetGold(oDead));
|
|
// * a cap of 10 000gp taken from you
|
|
if (nGoldToTake > 1000000)
|
|
{
|
|
nGoldToTake = 1000000;
|
|
}
|
|
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
|
|
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
|
|
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
|
|
|
|
}
|
|
|
|
void main()
|
|
{
|
|
|
|
object oRespawner = GetLocalObject(OBJECT_SELF, "respawn");
|
|
object oPC = oRespawner;
|
|
if (GetCampaignInt("PoA", "immortalname", oRespawner) == 2){
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Define who respawned and ressurect them, clear effects
|
|
|
|
|
|
|
|
int hd = GetHitDice(oRespawner);
|
|
int looted = (d8());
|
|
|
|
if (looted == 1 || looted == 2){
|
|
switch (d20()) {
|
|
case 1: DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS, oRespawner)); break;
|
|
case 2: DestroyObject( GetItemInSlot(INVENTORY_SLOT_ARROWS, oRespawner)); break;
|
|
case 3: DestroyObject( GetItemInSlot(INVENTORY_SLOT_BELT, oRespawner)); break;
|
|
case 4: DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS, oRespawner)); break;
|
|
case 5: DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS, oRespawner)); break;
|
|
case 6: DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS, oRespawner)); break;
|
|
case 7: DestroyObject( GetItemInSlot(INVENTORY_SLOT_CHEST, oRespawner)); break;
|
|
case 8: DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK, oRespawner)); break;
|
|
case 9: DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD, oRespawner)); break;
|
|
case 10: DestroyObject( GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oRespawner)); break;
|
|
case 11: DestroyObject( GetItemInSlot(INVENTORY_SLOT_LEFTRING, oRespawner)); break;
|
|
case 12: DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK, oRespawner)); break;
|
|
case 13: DestroyObject( GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oRespawner)); break;
|
|
case 14: DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oRespawner)); break;
|
|
case 15:DestroyObject( GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oRespawner)); break;
|
|
case 16: DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD, oRespawner)); break;
|
|
case 17: DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST, oRespawner)); break;
|
|
case 18: DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK, oRespawner)); break;
|
|
case 19: DestroyObject( GetItemInSlot(INVENTORY_SLOT_NECK, oRespawner)); break;
|
|
case 20: DestroyObject( GetItemInSlot(INVENTORY_SLOT_BELT, oRespawner));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
SendMessageToPC(oRespawner, "Someone or Something has looted your corpse!");
|
|
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
|
|
RemoveEffects(oRespawner);
|
|
|
|
// Take 10% gold and 10% xp
|
|
|
|
ApplyPenalty(oRespawner);
|
|
if(GetGold(oRespawner)>= 750000){
|
|
int gold = GetGold(oRespawner) - 750000;
|
|
AssignCommand(oRespawner, TakeGoldFromCreature(gold, oRespawner, TRUE));
|
|
|
|
|
|
|
|
// Set the Local Integers that the NPC that teleports looks for
|
|
// conversation purposes and to define the area that he teleports
|
|
// the group to
|
|
if ((GetArea(oRespawner)) == (GetArea(GetObjectByTag("Satan"))))
|
|
{
|
|
string sDestTag = "torture";
|
|
object oSpawnPoint = GetObjectByTag(sDestTag);
|
|
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
|
|
}
|
|
|
|
|
|
|
|
}
|
|
if ((GetArea(oRespawner)) != (GetArea(GetObjectByTag("Satan"))))
|
|
{
|
|
object death = GetWaypointByTag("DEATH");
|
|
location loc = GetLocation(death);
|
|
AssignCommand(oRespawner,JumpToLocation(loc));
|
|
PopUpDeathGUIPanel(oRespawner, FALSE, TRUE, 0,"");
|
|
}
|
|
}
|
|
|