Initial commit

Adding all of the current content for Anphillia Unlimited.
This commit is contained in:
Jaysyn904
2024-01-04 07:49:38 -05:00
parent df18cd54c8
commit 28cdb617b3
12943 changed files with 9727121 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
#include "hc_text_traps"
#include "prc_inc_spells"
void triggerTrap(object oTrap, object oVictim);
void main()
{
object oPC = GetPCSpeaker();
SendMessageToPC(oPC, DISARMING);
if (oPC != OBJECT_INVALID)
{
int nRogueLevel = GetLevelByClass(CLASS_TYPE_ROGUE, oPC)
+ GetLevelByClass(CLASS_TYPE_SCOUT, oPC)
+ GetLevelByClass(CLASS_TYPE_NINJA, oPC)
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER, oPC)
+ GetLevelByClass(CLASS_TYPE_PSYCHIC_ROGUE, oPC);
int nSkillMod = GetLocalInt(oPC, "nSkillMod");
object oTrappedItem = GetLocalObject(oPC, "oToolTarget");
int iTrapDC = GetTrapDisarmDC(oTrappedItem) - 100;
int bCanDisarmTrap = FALSE; // Assume that the person cannot spot a trap.
// Determine spotting capability
if ((iTrapDC <= 20) || ((iTrapDC > 20) && (nRogueLevel >= 1)))
bCanDisarmTrap = TRUE;
// Only check to see if detected if not previously detected
// and the PC has the ability to do detect it.
if (bCanDisarmTrap)
{
int nDisarm = GetSkillRank(SKILL_DISABLE_TRAP, oPC);
int nDCCheck = d20() + nDisarm + nSkillMod;
if (nDCCheck >= iTrapDC && nDisarm >= 1) // Trap disarmed
{
SetTrapDisabled(oTrappedItem);
SendMessageToPC(oPC, DISARMED);
}
else if ((nDCCheck - iTrapDC) < -4)
{
SendMessageToPC(oPC, TRAPTRIGGERED);
triggerTrap(oTrappedItem, oPC);
}
else
SendMessageToPC(oPC, FAILDISARM);
}
else
{
triggerTrap(oTrappedItem, oPC);
}
DeleteLocalObject(oPC, "oToolTarget");
DeleteLocalInt(oPC, "nSkillMod");
}
}
void triggerTrap(object oTrappedObject, object oVictim)
{
switch (GetObjectType(oTrappedObject))
{
case OBJECT_TYPE_DOOR:
AssignCommand(oVictim, ActionDoCommand(SetLocked(oTrappedObject, FALSE)));
AssignCommand(oVictim, ActionOpenDoor(oTrappedObject));
AssignCommand(oVictim, ActionDoCommand(SetLocked(oTrappedObject, TRUE)));
break;
case OBJECT_TYPE_PLACEABLE:
AssignCommand(oVictim, ActionInteractObject(oTrappedObject));
break;
case OBJECT_TYPE_TRIGGER:
AssignCommand(oVictim, ActionForceMoveToLocation(GetLocation(oTrappedObject)));
break;
}
}