Initial Upload
Initial Upload
This commit is contained in:
186
_module/nss/asg_rul_testsmcl.nss
Normal file
186
_module/nss/asg_rul_testsmcl.nss
Normal file
@@ -0,0 +1,186 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name(ASG_RULE) Summong Circle Proccessing
|
||||
//:: FileName
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Used for summoning circle processing step 1
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Donny Wilbanks
|
||||
//:: Created On: 09/07/02
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
// asg_REQ1(object oPC,int vREQ, int vNUM);
|
||||
#include "nw_i0_plot"
|
||||
int asg_REQ1(object oPC,string sTag,int vNUM)
|
||||
{
|
||||
int TRUEFALSE = FALSE;
|
||||
if (sTag=="")
|
||||
{
|
||||
ActionSpeakString("ERROR: Test Resource Script Error NO VALID sTag.");
|
||||
return TRUEFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int vITEMTOBUILD = GetLocalInt(oPC,"ITEMTOBUILD");
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
int vCount;
|
||||
|
||||
|
||||
vCount = GetNumItems(oPC,sTag);
|
||||
ActionSpeakString("Test: Resource ("+sTag+") Found ["+IntToString(vCount)+"]");
|
||||
if (vCount>=vNUM)
|
||||
{
|
||||
TRUEFALSE=TRUE;
|
||||
ActionSpeakString("Test: Found Required Resources found.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString("Test: Resources not found Required ["+IntToString(vNUM)+"].");
|
||||
}
|
||||
return TRUEFALSE;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
int iResult = FALSE;
|
||||
object oPC = GetPCSpeaker();
|
||||
// general religous stuff.
|
||||
int vGoodEvil = GetLocalInt(oPC,"GoodEvil");
|
||||
int vLawChaos = GetLocalInt(oPC,"LawChaos");
|
||||
string sDeity=GetLocalString(oPC,"INGAMEDEITY");
|
||||
string sName;
|
||||
// Set Shrine properties based on alignment
|
||||
if (sDeity=="")
|
||||
{
|
||||
SetLocalInt(oPC,"DeityOVERIDE",TRUE);
|
||||
sDeity = "Baccob";
|
||||
vGoodEvil = ALIGNMENT_NEUTRAL;
|
||||
vLawChaos = ALIGNMENT_NEUTRAL;
|
||||
SetLocalString(oPC,"INGAMEDEITY",sDeity);
|
||||
SetLocalInt(oPC,"GoodEvil",vGoodEvil);
|
||||
SetLocalInt(oPC,"LawChaos",vLawChaos);
|
||||
}
|
||||
|
||||
// return to other stuff
|
||||
int vITEMTOBUILD = GetLocalInt(oPC,"ITEMTOBUILD");
|
||||
int vNUMBERGIVEN =1;
|
||||
string sREQ1;
|
||||
string sREQ2;
|
||||
string sREQ3;
|
||||
string sREQ4;
|
||||
int vNUM1 = 0;
|
||||
int vNUM2 = 0;
|
||||
int vNUM3 = 0;
|
||||
int vNUM4 = 0;
|
||||
int vNOERROR = TRUE;
|
||||
int vNEEDED = 0;
|
||||
int vTRUE = FALSE;
|
||||
int vREQUIRED = 0;
|
||||
string sItem;
|
||||
string sBluePrint;
|
||||
int vPLACE; // (1) = ITEM, goes on pc's inventory, (2) PLACEABLE, goes on ground at PC's FEET.
|
||||
// (3) PLACEABLE, goes near another object.
|
||||
// (4) Item is a Creature - needs a summoning point = again with the sDist_What
|
||||
// (6) magical attune_ment.
|
||||
string sDIST_WHAT; // If option 3 is selected then search for this object. Look for
|
||||
// this TAG.
|
||||
float vDIST; // (0) if option 3 is selected this tells us how far from this object
|
||||
// that this item can be built.
|
||||
|
||||
switch(vITEMTOBUILD)
|
||||
{
|
||||
case(1): // Build Camp Fire (unlit).
|
||||
{
|
||||
sItem = "Attuning";
|
||||
vPLACE = 6;
|
||||
// Items Required.
|
||||
sREQ1="MagicPowder";
|
||||
vNUM1 = 1;
|
||||
// tells the true/false that there are "x" number of trues
|
||||
}
|
||||
break;
|
||||
default:;
|
||||
ActionSpeakString("ERROR in ''asg_rul_testbsel'' script on finding item:"+IntToString(vITEMTOBUILD));
|
||||
}
|
||||
vNEEDED=0;
|
||||
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
|
||||
if (vNOERROR==TRUE)
|
||||
{
|
||||
int vK;vTRUE=FALSE;
|
||||
if (vNUM1>0)
|
||||
{
|
||||
vTRUE = asg_REQ1(oPC,sREQ1,vNUM1);
|
||||
vNEEDED++;
|
||||
}
|
||||
if (vTRUE==TRUE) vREQUIRED++;
|
||||
vTRUE=FALSE;
|
||||
if (vNUM2>0)
|
||||
{
|
||||
vTRUE = asg_REQ1(oPC,sREQ2,vNUM2);
|
||||
vNEEDED++;
|
||||
}
|
||||
if (vTRUE==TRUE)vREQUIRED++;
|
||||
vTRUE=FALSE;
|
||||
if (vNUM3>0)
|
||||
{
|
||||
vTRUE = asg_REQ1(oPC,sREQ3,vNUM3);
|
||||
vNEEDED++;
|
||||
}
|
||||
if (vTRUE==TRUE) vREQUIRED++;
|
||||
vTRUE=FALSE;
|
||||
if (vNUM4>0)
|
||||
{
|
||||
vTRUE = asg_REQ1(oPC,sREQ4,vNUM4);
|
||||
vNEEDED++;
|
||||
}
|
||||
if (vTRUE==TRUE) vREQUIRED++;
|
||||
}
|
||||
if (vREQUIRED>=vNEEDED)
|
||||
{
|
||||
// last check for placement requirements
|
||||
int vResult = TRUE;
|
||||
if (vPLACE==5 || vPLACE==3)
|
||||
{
|
||||
object oPlace = GetNearestObjectByTag(sDIST_WHAT,oPC);
|
||||
float vHOWFAR = GetDistanceBetween(oPlace,oPC);
|
||||
if (vHOWFAR<=vDIST)
|
||||
{
|
||||
vResult=TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString("ERROR: To Far from closest ["+GetName(oPlace)+"] Distance ["+FloatToString(vHOWFAR)+"]");
|
||||
vResult=FALSE;
|
||||
}
|
||||
}
|
||||
if (vResult==TRUE)
|
||||
{
|
||||
ActionSpeakString("All items for the "+sItem+" have been found.");
|
||||
SetLocalString(oPC,"BLUEPRINT",sBluePrint);
|
||||
SetLocalInt(oPC,"NUMBERGIVEN",vNUMBERGIVEN);
|
||||
object oPC = GetPCSpeaker();
|
||||
SetLocalString(oPC,"REQ1",sREQ1);
|
||||
SetLocalString(oPC,"REQ2",sREQ2);
|
||||
SetLocalString(oPC,"REQ3",sREQ3);
|
||||
SetLocalString(oPC,"REQ4",sREQ4);
|
||||
SetLocalInt(oPC,"NUM1",vNUM1);
|
||||
SetLocalInt(oPC,"NUM2",vNUM2);
|
||||
SetLocalInt(oPC,"NUM3",vNUM3);
|
||||
SetLocalInt(oPC,"NUM4",vNUM4);
|
||||
SetLocalInt(oPC,"PLACE",vPLACE);
|
||||
SetLocalString(oPC,"DIST_WHAT",sDIST_WHAT);
|
||||
iResult=TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString("TEST: Requirement have for the "+sItem+" have not been met.");
|
||||
|
||||
}
|
||||
return iResult;
|
||||
}
|
Reference in New Issue
Block a user