67 lines
2.3 KiB
Plaintext
67 lines
2.3 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Dumapic (Clarity)
|
||
|
//:: dumapic.nss
|
||
|
//:: Copyright (c) 2025 WizardryEE Project
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Identifies the location of the party in the dungeon.
|
||
|
Level 1 Mage spell.
|
||
|
|
||
|
In Wizardry: Proving Grounds of the Mad Overlord,
|
||
|
this is a Level 1 Mage field spell that helps
|
||
|
with dungeon navigation.
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: WizardryEE Project
|
||
|
//:: Created On: April 26, 2025
|
||
|
//:://////////////////////////////////////////////
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
// Spell implementation for WizardryEE
|
||
|
// Core functionality: Show party location
|
||
|
|
||
|
// 1. Get caster information
|
||
|
object oCaster = OBJECT_SELF;
|
||
|
|
||
|
// 2. Create the divination effect
|
||
|
effect eVis = EffectVisualEffect(14); // Divination visual effect
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster);
|
||
|
|
||
|
// 3. Get current dungeon information
|
||
|
object oArea = GetArea(oCaster);
|
||
|
int nLevel = GetLocalInt(oArea, "DUNGEON_LEVEL");
|
||
|
vector vPos = GetPosition(oCaster);
|
||
|
|
||
|
// Convert position to grid coordinates (assuming 10-foot squares)
|
||
|
int nGridX = FloatToInt(vPos.x / 10.0);
|
||
|
int nGridY = FloatToInt(vPos.y / 10.0);
|
||
|
|
||
|
// Get facing direction
|
||
|
float fFacing = GetFacing(oCaster);
|
||
|
string sFacing = "";
|
||
|
|
||
|
// Convert facing angle to cardinal direction
|
||
|
if (fFacing >= 315.0 || fFacing < 45.0) sFacing = "North";
|
||
|
else if (fFacing >= 45.0 && fFacing < 135.0) sFacing = "East";
|
||
|
else if (fFacing >= 135.0 && fFacing < 225.0) sFacing = "South";
|
||
|
else sFacing = "West";
|
||
|
|
||
|
// 4. Build location description
|
||
|
string sLocation = "Location:\n";
|
||
|
sLocation += "Level: " + IntToString(nLevel) + "\n";
|
||
|
sLocation += "Position: " + IntToString(nGridX) + " East, " +
|
||
|
IntToString(nGridY) + " North\n";
|
||
|
sLocation += "Facing: " + sFacing;
|
||
|
|
||
|
// 5. Check for special areas
|
||
|
if (GetLocalInt(oArea, "IS_DARKNESS_ZONE"))
|
||
|
sLocation += "\nIn Darkness Zone";
|
||
|
if (GetLocalInt(oArea, "IS_ANTIMAGIC_ZONE"))
|
||
|
sLocation += "\nIn Anti-Magic Zone";
|
||
|
if (GetLocalInt(oArea, "IS_TRAP_ZONE"))
|
||
|
sLocation += "\nDanger: Trap Zone";
|
||
|
|
||
|
// 6. Display the location information
|
||
|
FloatingTextStringOnCreature(sLocation, oCaster, FALSE);
|
||
|
}
|