118 lines
3.5 KiB
Plaintext
118 lines
3.5 KiB
Plaintext
|
|
int StartingConditional()
|
|
{
|
|
int iResult = FALSE;
|
|
object oPC = GetPCSpeaker();
|
|
// get Lecturn
|
|
string sPower;
|
|
string sClass;
|
|
string sLevel;
|
|
string sGold;
|
|
string sChest;
|
|
string sBluePrint;
|
|
string sTag;
|
|
string sName;
|
|
string sText;
|
|
int iPass = FALSE;
|
|
// ** Search Area for Magical Focus
|
|
object oFocusLevel = GetNearestObjectByTag("asg_magicfocus_1",OBJECT_SELF);
|
|
int iFmod = 0;
|
|
if (GetIsObjectValid(oFocusLevel))
|
|
{
|
|
iFmod = 5;
|
|
}
|
|
else
|
|
{
|
|
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_2",OBJECT_SELF);
|
|
if (GetIsObjectValid(oFocusLevel))
|
|
{
|
|
iFmod = 10;
|
|
}
|
|
else
|
|
{
|
|
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_3",OBJECT_SELF);
|
|
if (GetIsObjectValid(oFocusLevel))
|
|
{
|
|
iFmod = 20;
|
|
}
|
|
else
|
|
{
|
|
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_4",OBJECT_SELF);
|
|
if (GetIsObjectValid(oFocusLevel))
|
|
{
|
|
iFmod = 100;
|
|
}
|
|
else
|
|
{
|
|
oFocusLevel = GetNearestObjectByTag("asg_magicfocus_5",OBJECT_SELF);
|
|
if (GetIsObjectValid(oFocusLevel))
|
|
{
|
|
iFmod = -20;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// **
|
|
float vDist = 1.0; // old varible
|
|
if (vDist<=15.0)
|
|
{
|
|
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
|
|
vDist = GetDistanceBetween(oCChest,OBJECT_SELF);
|
|
int vItem;
|
|
string sName;
|
|
if (vDist<=30.0)
|
|
{
|
|
object oItem = GetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM");
|
|
if (GetIsObjectValid(oItem))
|
|
{
|
|
SetCustomToken(1970000,GetName(oItem));
|
|
sName = GetName(oItem);
|
|
iPass = TRUE;
|
|
}
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature("Anvil/Alter Not ready, please use Research Desk First.",oPC,FALSE);
|
|
}
|
|
if (iPass==TRUE)
|
|
{
|
|
|
|
int iRLevel = GetLocalInt(OBJECT_SELF,"ASG_EFORGELEVELRSET");
|
|
if (iFmod<0) iRLevel = iRLevel + (iFmod*-1);
|
|
else
|
|
{
|
|
iRLevel = iRLevel - iFmod;
|
|
}
|
|
sLevel = IntToString(iRLevel);
|
|
string sArDiv = GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE");
|
|
int iClass;
|
|
int iPassLevel = FALSE;
|
|
if (sArDiv == "D")
|
|
{
|
|
iPassLevel=TRUE;
|
|
}
|
|
else
|
|
{
|
|
iPassLevel=TRUE;
|
|
}
|
|
int iGPValue=GetGoldPieceValue(oItem)/2;
|
|
SetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_MATERIALCOST",iGPValue);
|
|
int iXPloss = iGPValue/25;if (iXPloss<1) iXPloss = 1;
|
|
SetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_XPLOSS",iXPloss);
|
|
SetLocalString(OBJECT_SELF,"ASG_BUILDITEM_BLUEPRINT",sBluePrint);
|
|
SetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_OBJECT",oItem);
|
|
if (iPassLevel==TRUE)
|
|
{
|
|
iResult = TRUE;
|
|
}
|
|
else
|
|
{
|
|
iResult = FALSE;
|
|
}
|
|
}
|
|
}
|
|
// get Componant Chest
|
|
}
|
|
return iResult;
|
|
}
|