74 lines
2.5 KiB
Plaintext
74 lines
2.5 KiB
Plaintext
string InitializeRandomCombination()
|
|
{
|
|
object Store = GetObjectByTag("SHA_COMBINATION_STORE");
|
|
if(GetLocalString(Store, "LIGHT_COMB") != "")
|
|
{ return GetLocalString(Store, "LIGHT_COMB"); }
|
|
|
|
string Combo = "";
|
|
switch(d4())
|
|
{
|
|
case 1: Combo = "12345678"; break;
|
|
case 2: Combo = "87654321"; break;
|
|
case 3: Combo = "11223344"; break;
|
|
case 4: Combo = "55667788"; break;
|
|
default: Combo = "12345678"; break;
|
|
}
|
|
SetLocalString(Store, "LIGHT_COMB", Combo);
|
|
return Combo;
|
|
}
|
|
void StoreCombinationTyper(object oPC)
|
|
{
|
|
object Store = GetObjectByTag("SHA_COMBINATION_STORE");
|
|
SetLocalObject(Store, "LIGHT_COMBO_TYPER", oPC);
|
|
}
|
|
void VoidCreateObject(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation = FALSE, string sNewTag = "")
|
|
{
|
|
CreateObject(nObjectType, sTemplate, lLocation, bUseAppearAnimation, sNewTag);
|
|
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object toucher = GetLastUsedBy();
|
|
if(!GetIsPC(toucher))
|
|
{
|
|
return;
|
|
}
|
|
string localnum = GetLocalString(OBJECT_SELF, "number");
|
|
string numOnPC = GetLocalString(toucher, "lightnumber");
|
|
string Combination = InitializeRandomCombination();
|
|
|
|
string PCComb = numOnPC + localnum;
|
|
SetLocalString(toucher, "lightnumber", PCComb);
|
|
if(FindSubString(Combination, PCComb) == 0)
|
|
{
|
|
if(Combination == PCComb)
|
|
{
|
|
object oTarget;
|
|
object oSpawn;
|
|
location lTarget;
|
|
oTarget = GetWaypointByTag("PT_mamaluen_portUn");
|
|
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_FNF_UNDEAD_DRAGON), lTarget);
|
|
DelayCommand(4.0, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lTarget));
|
|
DelayCommand(7.0, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lTarget));
|
|
DelayCommand(10.0, ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lTarget));
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), oTarget);
|
|
DelayCommand(10.0, VoidCreateObject(OBJECT_TYPE_CREATURE, "sha_underw_guard", lTarget));
|
|
StoreCombinationTyper(toucher);
|
|
DeleteLocalString(toucher, "lightnumber");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
DeleteLocalString(toucher, "lightnumber");
|
|
effect eEffect;
|
|
eEffect = EffectDamage(d6(8), DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_NORMAL);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, toucher);
|
|
}
|
|
FloatingTextStringOnCreature(PCComb, toucher, TRUE);
|
|
|
|
}
|