Skip to content

Commit

Permalink
Remove treasuremap chest collision
Browse files Browse the repository at this point in the history
  • Loading branch information
Logg-y committed Nov 18, 2024
1 parent c59a418 commit f4cdbde
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/nss/tmap_complete.nss
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ void main()
{
sTreasureName = "Hidden Treasure";
}

object oReward = CreateObject(OBJECT_TYPE_PLACEABLE, "treasuremap_loot", GetLocation(oOwner));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectCutsceneGhost()), oReward);
// Lower the real treasure by 5 units, so it is noncollidable
// And then visual transform it back up so it looks normal
// EffectCutsceneGhost doesn't work on placeables!
location lSpawn = GetLocation(oOwner);
vector vPos = GetPositionFromLocation(lSpawn);
vPos.z -= 5.0;
lSpawn = Location(GetArea(oOwner), vPos, GetFacing(oOwner));
object oReward = CreateObject(OBJECT_TYPE_PLACEABLE, "treasuremap_loot", lSpawn);
SetName(oReward, sTreasureName);
SetObjectVisualTransform(oReward, OBJECT_VISUAL_TRANSFORM_SCALE, 0.5);
SetObjectVisualTransform(oReward, OBJECT_VISUAL_TRANSFORM_TRANSLATE_Z, 5.0);

SetLocalString(oReward, "owner", GetPCPublicCDKey(oOwner));
int nLootLevel = GetLocalInt(oMap, "acr");
SetLocalInt(oReward, "cr", nLootLevel);
Expand Down

0 comments on commit f4cdbde

Please sign in to comment.