119 lines
4.2 KiB
Plaintext
119 lines
4.2 KiB
Plaintext
void main()
|
|
{
|
|
// Variable Definitions
|
|
object oPC = GetLastUsedBy();
|
|
object oWayPointWest = GetObjectByTag("PortalWaypointW");
|
|
object oWayPointEast = GetObjectByTag("PortalWaypointE");
|
|
location lEast = GetLocation(oWayPointEast);
|
|
object oStore = GetObjectByTag("ElemPortStore");
|
|
string sPillar = GetTag(OBJECT_SELF);
|
|
|
|
if (sPillar == "AirPedestal")
|
|
{
|
|
if (GetLocalInt(oStore, "air") == 0)
|
|
{
|
|
object sStone = GetItemPossessedBy(oPC, "stoneofair");
|
|
if (sStone != OBJECT_INVALID)
|
|
{
|
|
// Activate Air Column
|
|
// PlaySound
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofair", GetLocation(GetNearestObjectByTag(sPillar, oWayPointWest)));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofair", GetLocation(GetNearestObjectByTag(sPillar, oWayPointEast)));
|
|
SetLocalInt(oStore, "air", 1);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "You must be doing something wrong");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "The stone is already attached to the pedestal");
|
|
}
|
|
}
|
|
else if (sPillar == "EarthPedestal")
|
|
{
|
|
if (GetLocalInt(oStore, "earth") == 0)
|
|
{
|
|
object sStone = GetItemPossessedBy(oPC, "stoneofearth");
|
|
if (sStone != OBJECT_INVALID)
|
|
{
|
|
// Activate Air Column
|
|
// PlaySound
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofearth", GetLocation(GetNearestObjectByTag(sPillar, oWayPointWest)));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofearth", GetLocation(GetNearestObjectByTag(sPillar, oWayPointEast)));
|
|
SetLocalInt(oStore, "earth", 1);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "You must be doing something wrong");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "The stone is already attached to the pedestal");
|
|
}
|
|
}
|
|
else if (sPillar == "FirePedestal")
|
|
{
|
|
if (GetLocalInt(oStore, "fire") == 0)
|
|
{
|
|
object sStone = GetItemPossessedBy(oPC, "stoneoffire");
|
|
if (sStone != OBJECT_INVALID)
|
|
{
|
|
// Activate Air Column
|
|
// PlaySound
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftoffire", GetLocation(GetNearestObjectByTag(sPillar, oWayPointWest)));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftoffire", GetLocation(GetNearestObjectByTag(sPillar, oWayPointEast)));
|
|
SetLocalInt(oStore, "fire", 1);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "You must be doing something wrong");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "The stone is already attached to the pedestal");
|
|
}
|
|
}
|
|
else if (sPillar == "WaterPedestal")
|
|
{
|
|
if (GetLocalInt(oStore, "water") == 0)
|
|
{
|
|
object sStone = GetItemPossessedBy(oPC, "stoneofwater");
|
|
if (sStone != OBJECT_INVALID)
|
|
{
|
|
// Activate Air Column
|
|
// PlaySound
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofwater", GetLocation(GetNearestObjectByTag(sPillar, oWayPointWest)));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "shaftofwater", GetLocation(GetNearestObjectByTag(sPillar, oWayPointEast)));
|
|
SetLocalInt(oStore, "water", 1);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "You must be doing something wrong");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oPC, "The stone is already attached to the pedestal");
|
|
}
|
|
}
|
|
|
|
// now check if all pillar's are activated
|
|
if (GetLocalInt(oStore, "air") == 1 &&
|
|
GetLocalInt(oStore, "fire") == 1 &&
|
|
GetLocalInt(oStore, "water") == 1 &&
|
|
GetLocalInt(oStore, "earth") == 1)
|
|
{
|
|
// Activate Portal
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "elemporteast", GetLocation(GetNearestObjectByTag("PortalWaypointE")));
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, "elemportwest", GetLocation(GetNearestObjectByTag("PortalWaypointW")));
|
|
// ActionCastFakeSpellAtObject(SPELL_HEAL, oPortalWest));
|
|
// ActionCastFakeSpellAtObject(SPELL_HEAL, oPortalEast));
|
|
// SignalEvent(oPortalWest, EventUserDefined(5555));
|
|
// SignalEvent(oPortalEast, EventUserDefined(5555));
|
|
}
|
|
}
|