Initial Upload
Initial Upload
This commit is contained in:
173
_module/nss/asg_rul_rescast.nss
Normal file
173
_module/nss/asg_rul_rescast.nss
Normal file
@@ -0,0 +1,173 @@
|
||||
#include "asg_include_mics"
|
||||
|
||||
void ASG_LightUpForge(object oTarget)
|
||||
{
|
||||
// ** Search Area for Magical Focus
|
||||
object oFocusLevel = GetNearestObjectByTag("asg_magicfocus_5",OBJECT_SELF);
|
||||
object oLightShow;
|
||||
PlaySound("as_mg_frstmagic1");
|
||||
string sArDiv = GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE");
|
||||
string sTag;
|
||||
if (GetIsObjectValid(oFocusLevel))
|
||||
{
|
||||
}
|
||||
else
|
||||
{ //plc_solpurple
|
||||
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_4",OBJECT_SELF);
|
||||
if (GetIsObjectValid(oFocusLevel))
|
||||
{
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
object oFOUR = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicblue",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX4",oFOUR);
|
||||
object oTHREE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicgreen",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oTHREE);
|
||||
object oTWO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicyellow",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX2",oTWO);
|
||||
object oONE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicred",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX1",oONE);
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX0",oZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oFOUR = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solwhite",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX4",oFOUR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_3",OBJECT_SELF);
|
||||
if (GetIsObjectValid(oFocusLevel))
|
||||
{
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
object oTHREE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicgreen",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oTHREE);
|
||||
object oTWO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicyellow",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX2",oTWO);
|
||||
object oONE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicred",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX1",oONE);
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX0",oZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oTHREE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solblue",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oTHREE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_2",OBJECT_SELF);
|
||||
if (GetIsObjectValid(oFocusLevel))
|
||||
{
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
object oTWO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicyellow",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX2",oTWO);
|
||||
object oONE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicred",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX1",oONE);
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX0",oZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oTWO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solorange",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oTWO);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_1",OBJECT_SELF);
|
||||
if (GetIsObjectValid(oFocusLevel))
|
||||
{
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
object oONE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicred",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX1",oONE);
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX0",oZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oONE = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solred",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oONE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_magicpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX0",oZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oZERO = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solpurple",GetLocation(oTarget),TRUE);
|
||||
SetLocalObject(oTarget,"MICS_FX3",oZERO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// **
|
||||
void Emissle()
|
||||
{
|
||||
string sArDiv = GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE");
|
||||
string sTag;
|
||||
if (sArDiv=="A")
|
||||
{
|
||||
sTag="ASG_ENANVIL";
|
||||
}
|
||||
else
|
||||
{
|
||||
sTag="ASG_ENALTER";
|
||||
}
|
||||
object oTarget = GetNearestObjectByTag(sTag,OBJECT_SELF);
|
||||
object oPC = GetPCSpeaker();
|
||||
SetLocalObject(oTarget,"ASG_BUILDITEM_ITEM",GetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM"));
|
||||
// Debug
|
||||
object oItem = GetLocalObject(oTarget,"ASG_BUILDITEM_ITEM");
|
||||
if (GetIsObjectValid(oItem)==FALSE)
|
||||
{
|
||||
FloatingTextStringOnCreature("Anvil/Alter Not Primed. Can not Continue.",oPC,FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetIsObjectValid(oTarget))
|
||||
{
|
||||
location lTarget = GetLocation(oTarget);
|
||||
effect eMissile = EffectVisualEffect(VFX_IMP_MIRV);
|
||||
int nMissiles = 1;
|
||||
float fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
|
||||
float fDelay = fDist/(3.0 * log(fDist) + 2.0);
|
||||
float fDelay2, fTime;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE);
|
||||
fTime = fDelay;
|
||||
fDelay2 += 0.1;
|
||||
fTime += fDelay2;
|
||||
DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget));
|
||||
DelayCommand(fDelay2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget));
|
||||
DelayCommand(fDelay2, FloatingTextStringOnCreature("Anvil/Alter Primed - Go To Anvil/Alter to make item.",oPC,FALSE));
|
||||
int iGPValue= GetGoldPieceValue(oItem);
|
||||
int iMlevel = FindItemLevel(oItem);
|
||||
SetLocalInt(oTarget,"ASG_EFORGELEVELRSET",iMlevel);
|
||||
SetLocalString(oTarget,"ASG_MIC_MAGICTYPE",GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE"));
|
||||
|
||||
DelayCommand(fDelay2,ASG_LightUpForge(oTarget));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStringOnCreature("No Enchanted Anvil or Alter Found. Error Can not Continue.",oPC,FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
void main()
|
||||
{
|
||||
Emissle();
|
||||
}
|
Reference in New Issue
Block a user