Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
171
_module/nss/mod_death.nss
Normal file
171
_module/nss/mod_death.nss
Normal file
@@ -0,0 +1,171 @@
|
||||
//// Hardcore Death - Creates Death Amulet on player to prevent quit and return
|
||||
// Also pops up Death GUI where respawn is now pray
|
||||
// Archaegeo
|
||||
// 2002 Jun 24
|
||||
|
||||
// This script sets the PlayerState to DEAD once they hit -10 hitpoits and
|
||||
// displays one GUI if they have a deity, and another if they do not.
|
||||
// Respawn buttor prays for ressurection on the one, and does nothing on other.
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "nw_i0_plot"
|
||||
#include "rpo_inc"
|
||||
|
||||
|
||||
|
||||
void strip_equiped(object oPlayer, object oDeathCorpse, object oEquip)
|
||||
{
|
||||
if(GetIsObjectValid(oEquip))
|
||||
AssignCommand(oDeathCorpse, ActionTakeItem(oEquip, oPlayer));
|
||||
}
|
||||
|
||||
|
||||
void cantres (object oPlayer)
|
||||
{
|
||||
CreateItemOnObject("deathamulet", oPlayer);
|
||||
PopUpDeathGUIPanel(oPlayer,FALSE,TRUE,0,"You have died but are unable to respawn at the temple.");
|
||||
}
|
||||
|
||||
void Frost_Ressurect(object oPlayer)
|
||||
{
|
||||
AssignCommand(oPlayer,ClearAllActions());
|
||||
|
||||
{
|
||||
AssignCommand(oPlayer, ActionPlayAnimation( ANIMATION_LOOPING_DEAD_FRONT, 1.0, 1000.0));
|
||||
}
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
|
||||
AssignCommand(oPlayer, JumpToLocation(GetLocation(GetWaypointByTag("frost_prisoncell"))));
|
||||
RemoveEffects(oPlayer);
|
||||
UnequipPlayer (oPlayer, TRUE);
|
||||
AssignCommand(oPlayer,PlayVoiceChat(VOICE_CHAT_PAIN1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void pvp_Ressurect(object oPlayer)
|
||||
{
|
||||
AssignCommand(oPlayer,ClearAllActions());
|
||||
object oSit=GetObjectByTag("jw_pvp_chair");
|
||||
|
||||
if (GetIsObjectValid(GetSittingCreature(oSit)) == FALSE)
|
||||
{
|
||||
AssignCommand(oPlayer,ActionSit(oSit));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oPlayer, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 1000.0));
|
||||
}
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
|
||||
AssignCommand(oPlayer, JumpToLocation(GetLocation(GetWaypointByTag("jw_pvp_spawn"))));
|
||||
RemoveEffects(oPlayer);
|
||||
UnequipPlayer (oPlayer, TRUE);
|
||||
AssignCommand(oPlayer,PlayVoiceChat(VOICE_CHAT_PAIN2));
|
||||
SendMessageToPC(oPlayer,"You are not seriously injured, but need some time to recover from the fight");
|
||||
effect eCursed=EffectCurse(3,3,3,3,3,3);
|
||||
eCursed=ExtraordinaryEffect(eCursed);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eCursed,oPlayer,120.0);
|
||||
//ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_COM_BLOOD_REG_RED),oPlayer,30.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Ressurect(object oRespawner)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
|
||||
RemoveEffects(oRespawner);
|
||||
UnequipPlayer (oRespawner, TRUE);
|
||||
SendMessageToPC(oRespawner, "You awake with blurred vision, as your sight begins to clear you can make out your surroundings.");
|
||||
SetLocalInt(oRespawner, "PlayerState",PWS_PLAYER_STATE_ALIVE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPlayer = GetLastPlayerDied();
|
||||
|
||||
|
||||
|
||||
if (GetTag(GetArea(oPlayer))=="jw_pvp_area")
|
||||
{
|
||||
pvp_Ressurect(oPlayer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (GetLocalInt(oPlayer,"cantres"))
|
||||
{
|
||||
cantres(oPlayer);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//if (GetStringLeft(GetTag(GetArea(oPlayer)),10)=="Frost_area")
|
||||
|
||||
//{
|
||||
//Frost_Ressurect(oPlayer);
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
// Set Players to Dead State
|
||||
//if(LOOTSYSTEM)
|
||||
if (FALSE)
|
||||
{
|
||||
object oDeathCorpse=GetLocalObject(oPlayer,"DeathCorpse");
|
||||
if(GetIsObjectValid(oDeathCorpse) == FALSE)
|
||||
{
|
||||
location lDiedHere=GetLocation(oPlayer);
|
||||
object oDeathCorpse=CreateObject(OBJECT_TYPE_PLACEABLE, "DeathCorpse", lDiedHere);
|
||||
SetLocalString(oDeathCorpse,"Owner",GetName(oPlayer));
|
||||
object oEquip = GetFirstItemInInventory(oPlayer);
|
||||
while(GetIsObjectValid(oEquip))
|
||||
{
|
||||
AssignCommand(oDeathCorpse, ActionTakeItem(oEquip, oPlayer));
|
||||
oEquip = GetNextItemInInventory(oPlayer);
|
||||
}
|
||||
}
|
||||
// object oDeadMan=CreateItemOnObject("PlayerCorpse", oDeathCorpse);
|
||||
// SetLocalObject(oDeadMan,"Owner",oPlayer);
|
||||
// SetLocalObject(oPlayer, "DeadMan", oDeadMan);
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_ARMS, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_ARROWS, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_BELT, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_BOLTS, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_BOOTS, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_BULLETS, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_CHEST, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_CLOAK, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_HEAD, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_NECK, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPlayer));
|
||||
strip_equiped(oPlayer, oDeathCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPlayer));
|
||||
}
|
||||
|
||||
if(BLEEDSYSTEM)
|
||||
{
|
||||
if (!GetIsObjectValid(GetLocalObject(oPlayer, "Prisoner")))
|
||||
{
|
||||
CreateItemOnObject("deathamulet", oPlayer);
|
||||
SetLocalInt(oPlayer, "PlayerState", PWS_PLAYER_STATE_DEAD);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetLocalInt(oPlayer, "GRD_ATTACK"))
|
||||
{
|
||||
//Imprison(oPlayer, GetLastAttacker(oPlayer), "GuardPrison");
|
||||
//SetLocalInt(oPlayer, "GRD_ATTACK", FALSE);
|
||||
//SetLocalInt(oPlayer, "PC_IN_PRISON", TRUE);
|
||||
}
|
||||
else
|
||||
CreateItemOnObject("deathamulet", oPlayer);
|
||||
PopUpDeathGUIPanel(oPlayer,TRUE,TRUE,0,"You may wait for help or respawn at a penalty of 50 xp per level. Penalty is reduced for first level characters.");
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user