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.
85 lines
3.7 KiB
Plaintext
85 lines
3.7 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: satchmogold's VFX Tool library
|
|
//:: sc_inc_mytmagic
|
|
//:://////////////////////////////////////////////
|
|
//* ***************************** INTERFACE *************************************
|
|
const int X2_TL_GROUNDTILE_ICE = 426;
|
|
const int X2_TL_GROUNDTILE_WATER = 401;
|
|
const int X2_TL_GROUNDTILE_GRASS = 402;
|
|
const int X2_TL_GROUNDTILE_LAVA_FOUNTAIN = 349; // ugly
|
|
const int X2_TL_GROUNDTILE_LAVA = 350;
|
|
const int X2_TL_GROUNDTILE_CAVEFLOOR = 406;
|
|
const int X2_TL_GROUNDTILE_SEWER_WATER = 461;
|
|
//These functions have the same parameters as the original tile magic functions.
|
|
//The only difference is that the row and column parameters specify the one tile to be effected,
|
|
//instead of a range of the area to effect.
|
|
// change the type of the ground or (by default) sub ground tiles (i.e. water) to the specified type
|
|
// Valid values are
|
|
// const int X2_TL_GROUNDTILE_ICE = 426;
|
|
// const int X2_TL_GROUNDTILE_WATER = 401;
|
|
// const int X2_TL_GROUNDTILE_GRASS = 402;
|
|
// const int X2_TL_GROUNDTILE_LAVA_FOUNTAIN = 349; // ugly
|
|
// const int X2_TL_GROUNDTILE_LAVA = 350;
|
|
// const int X2_TL_GROUNDTILE_CAVEFLOOR = 406;
|
|
// const int X2_TL_GROUNDTILE_SEWER_WATER = 461;
|
|
//(object oArea, int nColumn, int nRow);
|
|
void JWChangeSpecificAreaGroundTile(object oArea, int nGroundTileConst, int nColumn, int nRow, float fZOffset = -0.4f );
|
|
// Valid values are
|
|
// const int X2_TL_GROUNDTILE_ICE = 426;
|
|
// const int X2_TL_GROUNDTILE_WATER = 401;
|
|
// const int X2_TL_GROUNDTILE_GRASS = 402;
|
|
// const int X2_TL_GROUNDTILE_LAVA_FOUNTAIN = 349; // ugly
|
|
// const int X2_TL_GROUNDTILE_LAVA = 350;
|
|
// const int X2_TL_GROUNDTILE_CAVEFLOOR = 406;
|
|
// const int X2_TL_GROUNDTILE_SEWER_WATER = 461;
|
|
//(object oArea, int nColumn, int nRow);
|
|
// lLocation is the place to do it, fDelay is how long it lasts, fZOffset shouldn't need changing
|
|
void JWChangeoneAreaGroundTileOnly(location lLocation, int nGroundTileConst, float fDelay = 12.0, float fZOffset = -0.4f );
|
|
void JWResetSpecificAreaGroundTile(object oArea, int nColumn, int nRow);
|
|
|
|
//* ***************************** IMPLEMENTATION *************************************
|
|
void JWResetSpecificAreaGroundTile(object oArea, int nColumn, int nRow)
|
|
{
|
|
object oTile = GetFirstObjectInArea(oArea);
|
|
float x = 5.0 + ( 10.0 * nRow );
|
|
float y = 5.0 + ( 10.0 * nColumn );
|
|
vector vPos;
|
|
while (GetIsObjectValid(oTile))
|
|
{
|
|
if (GetObjectType(oTile) == OBJECT_TYPE_PLACEABLE && GetTag(oTile) == "x2_tmp_tile")
|
|
{
|
|
vPos = GetPosition( oTile );
|
|
if ( vPos.x == x && vPos.y == y )
|
|
{
|
|
SetPlotFlag(oTile,FALSE);
|
|
DestroyObject (oTile);
|
|
}
|
|
}
|
|
oTile = GetNextObjectInArea(oArea);
|
|
}
|
|
}
|
|
void JWChangeSpecificAreaGroundTile(object oArea, int nGroundTileConst, int nColumn, int nRow, float fZOffset = -0.4f )
|
|
{
|
|
object oTile;
|
|
vector vPos;
|
|
vPos.x = 5.0 + ( 10.0 * nRow );
|
|
vPos.y = 5.0 + ( 10.0 * nColumn );
|
|
vPos.z = fZOffset;
|
|
float fFace = 0.0;
|
|
location lLoc = Location(oArea, vPos, fFace);
|
|
oTile = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLoc,FALSE, "x2_tmp_tile");
|
|
SetPlotFlag(oTile,TRUE);
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(nGroundTileConst), oTile);
|
|
}
|
|
|
|
void JWChangeoneAreaGroundTileOnly(location lLocation, int nGroundTileConst, float fDelay = 12.0, float fZOffset = -0.4f )
|
|
{
|
|
vector vVector=GetPositionFromLocation(lLocation);
|
|
vVector.z=vVector.z-fZOffset;
|
|
lLocation=Location(GetArea(OBJECT_SELF),vVector,180.0);
|
|
object oTile = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation,FALSE, "x2_tmp_tile");
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(nGroundTileConst), oTile);
|
|
DelayCommand(fDelay,(DestroyObject(oTile)));
|
|
}
|
|
|