Initial Upload

Initial Upload
This commit is contained in:
Jaysyn904
2023-08-08 16:22:17 -04:00
parent 51a2a1286e
commit 22947ad4b6
6511 changed files with 6765205 additions and 0 deletions

147
_module/nss/062_npc_say.nss Normal file
View File

@@ -0,0 +1,147 @@
//::///////////////////////////////////////////////
//::
//:: FileName: 062_npc_say
//:: Descript: Makes NPC say something random from
//:: thier converstaion file when they
//:: percieve a PC and when clicked.
//:: requires: 062_npc_say_spawn
//:://////////////////////////////////////////////
/*
Description:
This script is used to make random greetings (or any text you
want) appear over the head of a NPC when they perceive a player
and when they are clicked on.
It is called from within a converstation file you create. You
can use it with 10 lines, 4 lines, or whatever, just change
the constant "N" at the top of the script, and call this script
in the text appears field of each line.
You can also include a dialogue as detailed below
The How-To is at the bottom
*/
//:://////////////////////////////////////////////
//:: Created By: Ranoulf
//:: Created On: 22 Aug. 02
//::
//:: Changed on: 28 Aug. 02
//:://////////////////////////////////////////////
int StartingConditional() {
int N = 10;
// match this to the number random sayings. If
// the NPC has 5 random greetings and a dialogue,
// set this to 5 (don't count the dialogue node)
int iHasDialogue = FALSE;
// Change this to True if you want the NPC to also
// engage in a normal dialogue, or FALSE if you just
// want a radom saying when you click on him
// let's track our nodes so we know when we're at the end
int iNodeNumber = GetLocalInt(OBJECT_SELF,"FS_FLAG_CONVERSATION_NODE");
// if the local doesn't exist yet, our if we have
// already been in a conversation, set our selves back to 1
// and RESET our Node Number variable.
if (! iNodeNumber || iNodeNumber > N) {
SetLocalInt(OBJECT_SELF,"FS_FLAG_CONVERSATION_NODE",1);
iNodeNumber = 1;
}
// If someone is clicking on us and we have a dialogue, we
// need to skip to the end of the conversation file.
int iSkipOnClick;
if(iHasDialogue && GetIsObjectValid(GetPCSpeaker()) )
iSkipOnClick = TRUE;
else
iSkipOnClick = FALSE;
// Now let's see if we should "Talk" by returning true
if( (! iSkipOnClick)
// if we're not skipping to the end
&&
// and our roll came up or this is the last random node
(Random(N) == N-1 || iNodeNumber >= N)
) {
// reset our node counter
SetLocalInt(OBJECT_SELF,"FS_FLAG_CONVERSATION_NODE",1);
// and return true, which makes the NPC speak this node
return TRUE;
} // end if
// Since we didn't talk, lets advance our node counter by one
else {
SetLocalInt(OBJECT_SELF,"FS_FLAG_CONVERSATION_NODE",iNodeNumber+1);
return FALSE;
}
} // end function
/*
How-To:
Create the conversation file for the NPCs:
In the toolset, go over to conversations at the left, right
click, and select new. In this new conversation, add a bunch of
nodes right at the top. These are what the NPC will randomly say.
Don't put any PC responses for them.
In the "Text Appears When" box of each node, call this script
(062_farmer_say).
Save the conversation file as generic_farmer (or some such).
To add a dialogue:
If you want the NPC to also have a normal dilogue, start it
after the last random node. DO NOT call this script in that
node or the NPC will say the entire dialogue.
In this script, change the iHasDialogue constant at the top
to TRUE.
Enable the NPCs:
To get your NPC to talk, you need to change two things.
1) Use the generic_farmer file as their converstaion.
2) In their Scripts section set the On Spawn field to
062_farmer_spawn.
Now all your farmers have something to say when they see a player!
Other things you should think about:
Other Sets of NPCs:
You might have farmers, hunters, ranchers and so on. You will
want to create different conversation files for these groups.
Unless all your conversation files are the same node length,
you'll need to save farmer_say as "hunter_say" (for example)
with a different N (node number). You can still use
famer_spawn with the new file, our you can create rename it
NPC_GenTalk_spwn file and use it on all of them.
Perception:
This script works like clockwork, as long as the NPC isn't moving.
As soon as you have them walking waypoints, they only 'see' you
about 1/3 of the time you think they should. Maybe its supposed to
be this way?
BTW - the OnPercieve event doesn't always work like you think it
should. If you start the game anywhere near the NPC, you have to
leave their perception (like go behind a building) and come back
to get it to fire.
The walk waypoint bug:
If you do have them walking around, don't forget about the walk
waypoints bug that makes NPCs stand still if you interrupt them
with a conversation. To fix this, go to the "root" node, look in
the the "current file" area, (it's onthe far middle-right ) and
in the "end conversation script" boxes put "nw_d2_walkways" for
both the "normal" and "aboted" boxes.
*/

View File

@@ -0,0 +1,16 @@
void main()
{
object oPC = GetEnteringObject();
object oArea = OBJECT_SELF;
if (!GetIsDM(oPC) && GetLocalInt(oArea,"Spawner") == 0)
{
object oLoc = GetNearestObjectByTag("WP_RESPAWN", oPC);
location lLoc = GetLocation(oLoc);
CreateObject(OBJECT_TYPE_PLACEABLE,"arearespawn",lLoc);
SetLocalInt(oArea,"Spawner",1);
}
// whatever else on enter you do
}

View File

@@ -0,0 +1,16 @@
void main()
{
object oPC = GetEnteringObject();
object oArea = OBJECT_SELF;
if (!GetIsDM(oPC) && GetLocalInt(oArea,"Spawner") == 0)
{
object oLoc = GetNearestObjectByTag("WP_RESPAWN", oPC);
location lLoc = GetLocation(oLoc);
CreateObject(OBJECT_TYPE_PLACEABLE,"arearespawn",lLoc);
SetLocalInt(oArea,"Spawner",1);
}
ExploreAreaForPlayer(oArea, oPC);
}

View File

@@ -0,0 +1,28 @@
/* onexit script:
This script is placed in the onexit event handler for each area.
Its purpose is to check for the presence of remaining pc's in
and area and if it finds none then it activates a delayed call
to an areacleanup script which cleans the area
*/
void main()
{
float cleanupdelay = 15.0; //if you change this it alters how long before
// the area cleans up, if you do change it INCLUDE THE DECIMAL, or it won't
// work
if(!GetIsPC(GetExitingObject()) ) {
return; }
object oPC = GetExitingObject();
if (!GetIsPC(oPC))
return;
oPC = GetFirstPC();
while (oPC != OBJECT_INVALID)
{
if (OBJECT_SELF == GetArea(oPC))
return;
else oPC = GetNextPC();
}
///wildmagic
SetLocalInt(GetArea(OBJECT_SELF), "X2_L_WILD_MAGIC", 0);
DelayCommand(cleanupdelay, ExecuteScript("areacleanup", OBJECT_SELF));
}

View File

@@ -0,0 +1,7 @@
void main()
{
object oPC = GetEnteringObject();
object oArea = OBJECT_SELF;
ExploreAreaForPlayer(oArea, oPC);
}

View File

@@ -0,0 +1,24 @@
void main()
{
/*
* Smart Teleport for GenericTrigger to Waypoint
* -------------------------
***************** By Zeke Xeno ********************
* This is attached to the OnEnter event of a GenericTrigger
* First, create a generic trigger and give it a tag like "Here2There_01"
* Second, create a destination Waypoint and name it AST_(+ the
* tag of your trigger, example "AST_Here2There_01"
*/
object oidUser;
object oidDest;
string sDest;
oidUser = GetEnteringObject();
string sTag = GetTag(OBJECT_SELF);
SetLocalString( (OBJECT_SELF), "Destination" , "AST_"+sTag );
sDest = GetLocalString(OBJECT_SELF,"Destination");
oidDest = GetObjectByTag(sDest);
AssignCommand(oidUser,ActionJumpToObject(oidDest,FALSE));
}

View File

@@ -0,0 +1,54 @@
void DeadMagicEnter(object oPC)
{
effect eFail = SupernaturalEffect(EffectSpellFailure());
effect eVis = EffectVisualEffect(VFX_IMP_KNOCK);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFail, oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis, oPC);
AssignCommand(oPC, PlaySound("sce_negative"));
effect eEffect = GetFirstEffect(oPC);
while(GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect)== EFFECT_TYPE_ABILITY_INCREASE ||
GetEffectType(eEffect)== EFFECT_TYPE_AC_INCREASE ||
GetEffectType(eEffect)== EFFECT_TYPE_DAMAGE_REDUCTION ||
GetEffectType(eEffect)== EFFECT_TYPE_DAMAGE_RESISTANCE ||
GetEffectType(eEffect)== EFFECT_TYPE_ELEMENTALSHIELD ||
GetEffectType(eEffect)== EFFECT_TYPE_HASTE ||
GetEffectType(eEffect)== EFFECT_TYPE_SAVING_THROW_INCREASE ||
GetEffectType(eEffect)== EFFECT_TYPE_SEEINVISIBLE ||
GetEffectType(eEffect)== EFFECT_TYPE_SKILL_INCREASE ||
GetEffectType(eEffect)== EFFECT_TYPE_SPELL_IMMUNITY ||
GetEffectType(eEffect)== EFFECT_TYPE_IMPROVEDINVISIBILITY ||
GetEffectType(eEffect)== EFFECT_TYPE_INVISIBILITY ||
GetEffectType(eEffect)== EFFECT_TYPE_SPELL_RESISTANCE_INCREASE ||
GetEffectType(eEffect)== EFFECT_TYPE_SPELLLEVELABSORPTION ||
GetEffectType(eEffect)== EFFECT_TYPE_TEMPORARY_HITPOINTS ||
GetEffectType(eEffect)== EFFECT_TYPE_TRUESEEING ||
GetEffectType(eEffect)== EFFECT_TYPE_POLYMORPH ||
GetEffectType(eEffect)== EFFECT_TYPE_IMMUNITY ||
GetEffectType(eEffect)== EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE)
{
RemoveEffect(oPC, eEffect);
}
eEffect = GetNextEffect(oPC);
}
}
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
DelayCommand(6.0, SendMessageToPC(oPC,"You sense a loss of magic in this area"));
DelayCommand(6.5, DeadMagicEnter(oPC));
}

View File

@@ -0,0 +1,21 @@
#include "nw_i0_spells"
void DeadMagicExit(object oPC)
{
effect eVis = EffectVisualEffect(VFX_IMP_DISPEL);
RemoveSpecificEffect(EFFECT_TYPE_SPELL_FAILURE, oPC);
RemoveSpecificEffect(EFFECT_TYPE_DISPELMAGICALL, oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis, oPC);
AssignCommand(oPC, PlaySound("sce_positive"));
}
void main()
{
object oPC = GetExitingObject();
ExecuteScript("_area_on_exit", OBJECT_SELF);
DelayCommand(8.0, SendMessageToPC(oPC,"You sense magic returning to you"));
DelayCommand(8.5, DeadMagicExit(oPC));
}

View File

@@ -0,0 +1,94 @@
///////////////////////////////////////////////////////
// Frostbite 1.0 - OnAreaEnter
// By Deva Bryson Winblood
// 11/25/2003
///////////////////////////////////////////////////////
////////////////////////////
// Prototypes
////////////////////////////
void fnHeatEffects(object oPC,object oArea);
//////////////////////////////////////////// MAIN
void main()
{
object oPC=GetEnteringObject();
object oIntensity=GetNearestObjectByTag("FB1_INTENSITY",oPC);
object oArea=GetArea(oPC);
int nIntensity=3;
if (oIntensity!=OBJECT_INVALID)
nIntensity=StringToInt(GetName(oIntensity));
SetLocalInt(oPC,"FB1_Intensity",nIntensity);
if (nIntensity<1) nIntensity=1;
if(GetIsDM(oPC)) return;
if (GetIsPC(oPC)==TRUE)
{ // is PC
DelayCommand(24.0,fnHeatEffects(oPC,oArea));
} // is PC
}
//////////////////////////////////////////// MAIN
///////////////////////////
// Functions
///////////////////////////
void fnHeatEffects(object oPC,object oArea)
{
int nTotalIntensity;
effect eDmg;
object oItem;
string sTag;
float fDist;
if (GetArea(oPC)==oArea)
{ // still in same area
nTotalIntensity=GetLocalInt(oPC,"FB1_Intensity");
oItem=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
sTag=GetTag(oItem);
if (GetIsNight()==TRUE) nTotalIntensity=nTotalIntensity+10;
if (GetWeather(oArea)==WEATHER_SNOW) nTotalIntensity=nTotalIntensity-3;
if (GetWeather(oArea)==WEATHER_RAIN) nTotalIntensity=nTotalIntensity+3;
if (oItem!=OBJECT_INVALID)
{ // check clothing
if (sTag=="NW_CLOTH027"||sTag=="NW_CLOTH015"||sTag=="NW_CLOTH021"||sTag=="NW_CLOTH022") nTotalIntensity=nTotalIntensity+2;
else if (sTag=="NW_CLOTH011"||sTag=="NW_CLOTH014"||sTag=="NW_CLOTH016"||sTag=="NW_CLOTH009") nTotalIntensity=nTotalIntensity+2;
else if (sTag=="NW_CLOTH023"||sTag=="NW_CLOTH001"||sTag=="FB1_WORTHLESS") nTotalIntensity=nTotalIntensity+2;
else if (sTag=="fb1_heavywinter") nTotalIntensity=nTotalIntensity-7;
} // check clothing
else
{ // no clothes
nTotalIntensity=nTotalIntensity+20;
} // no clothes
oItem=GetItemInSlot(INVENTORY_SLOT_CLOAK,oPC);
sTag=GetTag(oItem);
if (sTag=="fb1_wintercloak") nTotalIntensity=nTotalIntensity-7;
else if (oItem!=OBJECT_INVALID) nTotalIntensity=nTotalIntensity-1;
//boots
oItem=GetItemInSlot(INVENTORY_SLOT_BOOTS,oPC);
sTag=GetTag(oItem);
if (sTag=="fb1_winterboots") nTotalIntensity=nTotalIntensity-7;
else if (oItem!=OBJECT_INVALID) nTotalIntensity=nTotalIntensity-1;
//boots
oItem=GetNearestObjectByTag("fb1_campfire",oPC,1);
if (oItem!=OBJECT_INVALID)
{ // fire nearby
fDist=GetDistanceBetween(oItem,oPC);
if (fDist<3.1) nTotalIntensity=nTotalIntensity-9;
else if (fDist<5.1) nTotalIntensity=nTotalIntensity-6;
else if (fDist<8.1) nTotalIntensity=nTotalIntensity-3;
} // fire nearby
//oItem=GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
//if (GetTag(oItem)=="fb1_ringwarm") nTotalIntensity==0;
//oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
//if (GetTag(oItem)=="fb1_ringwarm") nTotalIntensity==0;
if (nTotalIntensity>0)
{ // do cold damage
eDmg=EffectDamage(nTotalIntensity,DAMAGE_TYPE_COLD);
effect eVis = EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION);
SendMessageToPC(oPC,"You are suffering from the cold.");
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oPC,1.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC);
} // do cold damage
DelayCommand(24.0,fnHeatEffects(oPC,oArea));
} // still in same area
} // fnHeatEffects()

View File

@@ -0,0 +1,190 @@
void main()
{
object oPC = GetEnteringObject();
if(!GetIsPC(oPC)) return; // pc or dm check
if(GetIsDM(oPC)==TRUE) return;
int iXP = GetXP(oPC);
if (iXP <1)
{
SetXP(oPC, 2);// set xp so script doesnt fire again on enter
///enter
object oArea = OBJECT_SELF;
AssignCommand(oPC, ClearAllActions());
ExploreAreaForPlayer(oArea, oPC);
//start
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
// SetPlotFlag(oItem,FALSE);
DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
///////////// equip players according to class
int iClass = GetClassByPosition (1, oPC);
if(iClass == CLASS_TYPE_BARBARIAN)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_waxgr001", oPC);
CreateItemOnObject("nw_waxhn001", oPC);
CreateItemOnObject("nw_aarcl008", oPC);
CreateItemOnObject("nw_it_medkit002", oPC);
CreateItemOnObject("nw_wthax001", oPC,9);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
SendMessageToPC(oPC, "Barbarian EQ");
}
if(iClass == CLASS_TYPE_BARD)
{
CreateItemOnObject("nw_aarcl009", oPC);
CreateItemOnObject("nw_it_sparscr312", oPC);
CreateItemOnObject("nw_it_sparscr202 ", oPC);
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wbwxl001", oPC);
CreateItemOnObject("nw_wambo001", oPC,25);
CreateItemOnObject("nw_wswdg001", oPC);
SendMessageToPC(oPC, "Bard EQ");
}
if(iClass == CLASS_TYPE_CLERIC)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wblml001", oPC);
CreateItemOnObject("nw_ashsw001", oPC);
CreateItemOnObject("nw_aarcl004", oPC);
CreateItemOnObject("x1_wmgrenade005", oPC,9);
SendMessageToPC(oPC, "Cleric EQ");
}
if(iClass == CLASS_TYPE_DRUID)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wspmsc002", oPC);
CreateItemOnObject("nw_aarcl001", oPC);
CreateItemOnObject("nw_it_medkit002", oPC);
CreateItemOnObject("x1_wmgrenade006", oPC,9);
SendMessageToPC(oPC, "Druid EQ");
}
if(iClass == CLASS_TYPE_FIGHTER)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wswls001", oPC);
CreateItemOnObject("nw_aarcl011", oPC);
CreateItemOnObject("nw_ashlw001", oPC);
CreateItemOnObject("nw_wswgs001", oPC);
CreateItemOnObject("nw_wswdg001", oPC);
SendMessageToPC(oPC, "Fighter EQ");
}
if(iClass == CLASS_TYPE_MONK)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wspka001", oPC);
CreateItemOnObject("nw_wthsh001", oPC,25);
CreateItemOnObject("nw_mcloth018", oPC);
CreateItemOnObject("nw_it_medkit002", oPC);
SendMessageToPC(oPC, "Monk EQ");
}
if(iClass == CLASS_TYPE_PALADIN)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wswls001", oPC);
CreateItemOnObject("nw_aarcl006", oPC);
CreateItemOnObject("nw_ashlw001", oPC);
CreateItemOnObject("nw_it_medkit002", oPC);
SendMessageToPC(oPC, "Paladin EQ");
}
if(iClass == CLASS_TYPE_RANGER)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_aarcl001", oPC);
CreateItemOnObject("nw_wbwsh001", oPC);
CreateItemOnObject("nw_wamar001", oPC,25);
CreateItemOnObject("nw_wswss001", oPC);
CreateItemOnObject("nw_wswdg001", oPC);
SendMessageToPC(oPC, "Ranger EQ");
}
if(iClass == CLASS_TYPE_ROGUE)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC,2);
CreateItemOnObject("x1_wmgrenade003", oPC,9);
CreateItemOnObject("nw_aarcl001", oPC);
CreateItemOnObject("nw_it_picks002", oPC);
CreateItemOnObject("nw_it_trap001", oPC);
CreateItemOnObject("nw_wswss001", oPC);
CreateItemOnObject("nw_wswdg001", oPC);
SendMessageToPC(oPC, "Rogue EQ");
}
if(iClass == CLASS_TYPE_SORCERER)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wswdg001", oPC);
CreateItemOnObject("nw_wthdt001", oPC,9);
CreateItemOnObject("nw_cloth008", oPC);//robe
CreateItemOnObject("nw_it_contain006", oPC);
CreateItemOnObject("x1_it_sparscr103", oPC);
CreateItemOnObject("nw_it_sparscr202", oPC);
SendMessageToPC(oPC, "Sorcerer EQ");
}
if(iClass == CLASS_TYPE_WIZARD)
{
CreateItemOnObject("nw_it_torch001", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_it_mpotion020", oPC);
CreateItemOnObject("nw_wdbqs001", oPC);
CreateItemOnObject("nw_cloth005", oPC);//robe
CreateItemOnObject("nw_it_contain006", oPC);
CreateItemOnObject("x1_it_sparscr103", oPC);
CreateItemOnObject("nw_it_sparscr202", oPC);
CreateItemOnObject("nw_it_sparscr107", oPC);
CreateItemOnObject("nw_it_sparscr106", oPC);
SendMessageToPC(oPC, "Wizard EQ");
}
}
//end of script
}

View File

@@ -0,0 +1,87 @@
void Login(object oPC)
{
object oPC = GetEnteringObject();
string sPrint;
sPrint = "Player Name: "+ GetName(oPC)+"\n";
sPrint =sPrint + "Player IP Address: "+ GetPCIPAddress(oPC)+"\n";
sPrint =sPrint + "Player Logon: "+ GetPCPlayerName(oPC)+"\n";
sPrint =sPrint + "Player CDKEY: "+ GetPCPublicCDKey(oPC)+"\n";
sPrint =sPrint + "\n";
PrintString(sPrint);
SendMessageToPC(oPC,"User details recorded");
if (GetLocalInt(oPC,"PCDead")==1)
{
effect eKill = EffectDeath(TRUE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oPC);
}
}
string sLevels;
int FindPreviousLevel( string sVar )
{
string sTmp;
int iPos = FindSubString( sLevels, sVar );
if ( iPos > -1 )
{
iPos += GetStringLength( sVar);
while ( GetSubString( sLevels, iPos, 1 ) != ";" )
sTmp += GetSubString( sLevels, iPos++, 1 );
if ( sTmp != "" )
{
return StringToInt( sTmp );
}
}
return -100;
}
void main()
{
int index, iLev, iCurLev;
object oPC = GetEnteringObject();
sLevels = GetCampaignString( "mycampaign", GetName( oPC ) + "Levels" );
if ( sLevels != "" )
{
iCurLev = GetCurrentHitPoints( oPC );
iLev = FindPreviousLevel( "HP=" );
if ( iLev > -100 && iCurLev > iLev )
{
effect eDamage = EffectDamage( iCurLev - iLev, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY );
ApplyEffectToObject( DURATION_TYPE_INSTANT, eDamage, oPC );
}
for( index = 0; index < 622; index++ )
{
iCurLev = GetHasSpell( index, oPC );
if ( iCurLev > 0 )
{
iLev = FindPreviousLevel( "S" + IntToString( index ) + "=" );
if ( iLev == -100 )
iLev = 0;
while ( iLev < iCurLev )
{
DecrementRemainingSpellUses( oPC, index );
iLev++;
}
}
}
for( index = 0; index < 480; index++ )
{
iCurLev = GetHasFeat( index, oPC );
if ( iCurLev > 0 )
{
iLev = FindPreviousLevel( "F" + IntToString( index ) + "=" );
if ( iLev == -100 )
iLev = 0;
while ( iLev < iCurLev )
{
DecrementRemainingFeatUses( oPC, index );
iLev++;
}
}
}
}
Login(oPC);
}

View File

@@ -0,0 +1,22 @@
void main()
{
int index, iLev;
string sLevels;
object oPC = GetExitingObject();
iLev = GetCurrentHitPoints( oPC );
sLevels = "HP=" + IntToString( iLev ) + ";";
for( index = 0; index < 622; index++ )
{
iLev = GetHasSpell( index, oPC );
if ( iLev > 0 )
sLevels += "S" + IntToString( index ) + "=" + IntToString( iLev ) + ";";
}
for( index = 0; index < 480; index++ )
{
iLev = GetHasFeat( index, oPC );
if ( iLev > 0 )
sLevels += "F" + IntToString( index ) + "=" + IntToString( iLev ) + ";";
}
SetCampaignString( "mycampaign", GetName( oPC ) + "Levels", sLevels );
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oItem=GetItemActivated();
object oPC = GetItemActivator();
if(GetStringLeft(GetTag(oItem),4)=="DH2_")
{
ExecuteScript("desertheat2",oPC);
}
else
{
ExecuteScript(GetTag(GetItemActivated()),OBJECT_SELF);
//SendMessageToPC(oPC,"on activate firing");
}
}

View File

@@ -0,0 +1,21 @@
object oPlayer = GetEnteringObject();
string sPrint;
void main()
{
sPrint = "Player Name: "+ GetName(oPlayer)+"\n";
sPrint =sPrint + "Player IP Address: "+ GetPCIPAddress(oPlayer)+"\n";
sPrint =sPrint + "Player Logon: "+ GetPCPlayerName(oPlayer)+"\n";
sPrint =sPrint + "Player PCDKEY: "+ GetPCPublicCDKey(oPlayer)+"\n";
sPrint =sPrint + "\n";
PrintString(sPrint);
object oPC = GetEnteringObject();
// log in/out
if (GetLocalInt(oPC,"PCDead")==1)
{
effect eKill = EffectDeath(TRUE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oPC);
}
}

View File

@@ -0,0 +1,90 @@
//::///////////////////////////////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:://///////////////////////////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November
//:://///////////////////////////////////////////
#include "nw_i0_plot"
// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nPenalty = 50 * GetHitDice(oDead);
int nXP = GetXP(oDead);
int nHD = GetHitDice(oDead);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
// * a cap of 100000gp taken from you
if (nGoldToTake > 100000)
{
nGoldToTake = 100000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
DeleteLocalInt(oRespawner,"PCDead");
//* Return PC to temple
string sDestTag = "NW_DEATH_TEMPLE";
string sArea = GetTag(GetArea(oRespawner));
int ispawn = GetCampaignInt("respawn_point",GetPCPlayerName(oRespawner),oRespawner);
if (GetIsObjectValid(GetObjectByTag(sDestTag)))
{
if (sArea != "TheStadium")
{
if(ispawn==1)
{
ApplyPenalty(oRespawner);
object oSpawnPoint = GetObjectByTag("deathtemple_nas");
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
}
if(GetHitDice(oRespawner)<=5)
{
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
SendMessageToPC(oRespawner,"You will suffer no XP or GP penalties until level 5");
}
else
{
ApplyPenalty(oRespawner);
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
}
}
else
//stadium respawn
if (sArea == "TheStadium")
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
}
}
}

View File

@@ -0,0 +1,87 @@
//::------------------------------------------------------------------------:://
//:: Script: dk_ouai :://
//:: Location: OnUncquiredItem :://
//:: Author: Darvin Kezar :://
//:: Created: 2002-12-16 :://
//::------------------------------------------------------------------------:://
#include "dk_handler"
void main()
{
object oObject = GetModuleItemLost();
object oPossessor = GetItemPossessor(oObject);
object oLoser = GetModuleItemLostBy();
if(!GetIsPC(oLoser))
return;
object oItem, oNew, oLost;
switch(GetObjectType(oPossessor))
{
case OBJECT_TYPE_CREATURE:
if(GetIsUnAcquirable(oObject))
return;
if(!GetIsPC(oPossessor))
return;
oNew = CreateItemOnObject(GetResRef(oObject), oLoser, GetNumStackedItems(oObject));
if(GetIdentified(oObject))
SetIdentified(oNew, TRUE);
oLost = GetFirstItemInInventory(oObject);
while(GetIsObjectValid(oLost))
{
oItem = CreateItemOnObject(GetResRef(oLost), oNew, GetNumStackedItems(oLost));
if(GetIdentified(oLost))
SetIdentified(oItem, TRUE);
DestroyObject(oLost);
oLost = GetNextItemInInventory(oObject);
}
DestroyObject(oObject);
SendMessageToPC(oPossessor, "You cannot barter these items.");
SendMessageToPC(oLoser, "You cannot barter these items.");
break;
case OBJECT_TYPE_STORE:
break;
case OBJECT_TYPE_PLACEABLE:
if(GetTag(oPossessor)=="Trashcan"&&GetIsDestroyable(oObject))
{
DestroyObject(oObject);
return;
}
if(GetIsUnAcquirable(oObject))
return;
oNew = CreateItemOnObject(GetResRef(oObject), oLoser, GetNumStackedItems(oObject));
if(GetIdentified(oObject))
SetIdentified(oNew, TRUE);
oLost = GetFirstItemInInventory(oObject);
while(GetIsObjectValid(oLost))
{
oItem = CreateItemOnObject(GetResRef(oLost), oNew, GetNumStackedItems(oLost));
if(GetIdentified(oLost))
SetIdentified(oItem, TRUE);
DestroyObject(oLost);
oLost = GetNextItemInInventory(oObject);
}
DestroyObject(oObject);
if(!GetIsDestroyable(oObject))
SendMessageToPC(oLoser, "You cannot remove this item.");
else
SendMessageToPC(oLoser, "You cannot drop these items.");
break;
default:
if(GetIsUnAcquirable(oObject))
return;
if(!GetIsObjectValid(GetAreaFromLocation(GetLocation(oObject))))
return;
oNew = CreateItemOnObject(GetResRef(oObject), oLoser, GetNumStackedItems(oObject));
if(GetIdentified(oObject))
SetIdentified(oNew, TRUE);
oLost = GetFirstItemInInventory(oObject);
while(GetIsObjectValid(oLost))
{
oItem = CreateItemOnObject(GetResRef(oLost), oNew, GetNumStackedItems(oLost));
if(GetIdentified(oLost))
SetIdentified(oItem, TRUE);
DestroyObject(oLost);
oLost = GetNextItemInInventory(oObject);
}
DestroyObject(oObject);
SendMessageToPC(oLoser, "You cannot drop these items.");
}
}

View File

@@ -0,0 +1,48 @@
//::------------------------------------------------------------------------:://
//:: Script: dk_oai :://
//:: Location: OnAcquiredItem :://
//:: Author: Darvin Kezar :://
//:: Created: 2002-12-16 :://
//::------------------------------------------------------------------------:://
#include "x2_inc_switches"
#include "dk_handler"
void main()
{
object oObject = GetModuleItemAcquired();
object oPossessor = GetItemPossessor(oObject);
object oPC = GetModuleItemAcquiredBy();
object oLoser = GetModuleItemLostBy();
int nEvent =GetUserDefinedItemEventNumber();
object oItem, oNew, oLost;
if(!GetIsPC(oPossessor))
return;
///skullball
if(oObject ==(GetObjectByTag("skullball")))
{
effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oPossessor,5.0);
}
///multiguild////////
ExecuteScript("multiguild",oPC);
////////////
if(GetIsPC(oLoser)&&!GetIsUnAcquirable(oObject)&&oLoser!=oPossessor)
return;
if(GetIsAcquirable(oObject, oPossessor))
return;
oNew = CreateObject(OBJECT_TYPE_ITEM,GetResRef(oObject),GetLocation(oPossessor));
if(GetIdentified(oObject))
SetIdentified(oNew, TRUE);
oLost = GetFirstItemInInventory(oObject);
while(GetIsObjectValid(oLost))
{
oItem = CreateItemOnObject(GetResRef(oLost), oNew, GetNumStackedItems(oLost));
if(GetIdentified(oLost))
SetIdentified(oItem, TRUE);
DestroyObject(oLost);
oLost = GetNextItemInInventory(oObject);
}
DestroyObject(oObject);
SendMessageToPC(oPossessor, "You already have this item!");
}

View File

@@ -0,0 +1,93 @@
void Login(object oPC)
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
string sPrint;
sPrint = "Player Name: "+ GetName(oPC)+"\n";
sPrint =sPrint + "Player IP Address: "+ GetPCIPAddress(oPC)+"\n";
sPrint =sPrint + "Player Logon: "+ GetPCPlayerName(oPC)+"\n";
sPrint =sPrint + "Player CDKEY: "+ GetPCPublicCDKey(oPC)+"\n";
sPrint =sPrint + "\n";
PrintString(sPrint);
SendMessageToPC(oPC,"User Details Recorded");
if (GetLocalInt(oPC,"PCDead")==1)
{
effect eKill = EffectDeath(TRUE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eKill,oPC);
}
//xp loss quest
int nInt = GetCampaignInt("deathquest","exp_loss",oPC);
if(nInt==1)
{
ExecuteScript("lose_xp_quest_oc",oPC);
}
}
string sLevels;
int FindPreviousLevel( string sVar )
{
string sTmp;
int iPos = FindSubString( sLevels, sVar );
if ( iPos > -1 )
{
iPos += GetStringLength( sVar);
while ( GetSubString( sLevels, iPos, 1 ) != ";" )
sTmp += GetSubString( sLevels, iPos++, 1 );
if ( sTmp != "" )
{
return StringToInt( sTmp );
}
}
return -100;
}
void main()
{
int index, iLev, iCurLev;
object oPC = GetEnteringObject();
sLevels = GetCampaignString( "mycampaign", GetName( oPC ) + "Levels" );
if ( sLevels != "" )
{
iCurLev = GetCurrentHitPoints( oPC );
iLev = FindPreviousLevel( "HP=" );
if ( iLev > -100 && iCurLev > iLev )
{
effect eDamage = EffectDamage( iCurLev - iLev, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY );
ApplyEffectToObject( DURATION_TYPE_INSTANT, eDamage, oPC );
}
for( index = 0; index < 622; index++ )
{
iCurLev = GetHasSpell( index, oPC );
if ( iCurLev > 0 )
{
iLev = FindPreviousLevel( "S" + IntToString( index ) + "=" );
if ( iLev == -100 )
iLev = 0;
while ( iLev < iCurLev )
{
DecrementRemainingSpellUses( oPC, index );
iLev++;
}
}
}
for( index = 0; index < 480; index++ )
{
iCurLev = GetHasFeat( index, oPC );
if ( iCurLev > 0 )
{
iLev = FindPreviousLevel( "F" + IntToString( index ) + "=" );
if ( iLev == -100 )
iLev = 0;
while ( iLev < iCurLev )
{
DecrementRemainingFeatUses( oPC, index );
iLev++;
}
}
}
}
Login(oPC);
}

62
_module/nss/_ondeath.nss Normal file
View File

@@ -0,0 +1,62 @@
void Stolen(object oPlayer)
{
object oStolen = GetFirstItemInInventory(oPlayer);
while (oStolen != OBJECT_INVALID)
{
if (GetStolenFlag(oStolen) == TRUE)
{
SetDroppableFlag(oStolen,TRUE);
}
oStolen = GetNextItemInInventory(oPlayer);
}
}
void Skull(object oPlayer)
{
object oPlayer = GetLastPlayerDied();
object oArea = GetArea(oPlayer);
vector vDead= GetPosition(oPlayer);
float fFace = GetFacing(oPlayer);
vector vNew;
vNew.x=vDead.x+1.0;
vNew.y=vDead.y+1.0;
vNew.z=vDead.z;
object oItem = GetItemPossessedBy(oPlayer, "skullball");
if (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
location lLoc = Location( oArea, vNew, fFace);
CreateObject(OBJECT_TYPE_ITEM,"skullball", lLoc);
}
}
#include "nw_i0_plot"
void main()
{
object oPlayer = GetLastPlayerDied();
SetLocalInt(oPlayer, "PCDead", 1);
string sArea = GetTag(GetArea(oPlayer));
if (sArea == "TheStadium") Skull(oPlayer);
if (sArea == "DrowDungeon")
{
SetLocalInt(oPlayer,"dungeon_died",1);
}
Stolen(oPlayer);
AssignCommand(oPlayer, ClearAllActions());
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 74, oPlayer);
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 74, oPlayer);
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 74, oPlayer);
if(HasItem(oPlayer,"fairy_bottle") == TRUE)
{
DelayCommand(3.0,ExecuteScript("fairy_rez_bottle",oPlayer));
}
else
{
DelayCommand(5.0, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
}
}

View File

@@ -0,0 +1,6 @@
void main()
{
SetCalendar(GetCalendarYear(),GetCalendarMonth(),GetCalendarDay());
SetTime(GetTimeHour(),GetTimeMinute(),GetTimeSecond(),GetTimeMillisecond());
}

View File

@@ -0,0 +1,61 @@
//:://////////////////////////////////////////////
//:: Created By: Eddie V. Pacheco
//:: Created On: July 31 2003
//:: Assisted and thanks to: YellowLab
//:: Edited my McDaggart: Jan 04
//:://////////////////////////////////////////////
void PlaceBedroll(object oPC)
{
location lLoc = GetLocation(oPC);
CreateObject(OBJECT_TYPE_PLACEABLE,"bedrolls001",lLoc,FALSE);
DestroyObject(GetItemPossessedBy(oPC,"bedroll"));
object oMyRoll = GetNearestObjectByTag("MyBedRoll",oPC);
location lRoll = GetLocation(oMyRoll);
AssignCommand(oPC,ActionMoveToLocation(lRoll,FALSE));
AssignCommand(oPC,ActionDoCommand(SetFacing(GetFacing(oMyRoll))));
}
void PickupBedroll(object oPC)
{
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,2.0f));
CreateItemOnObject("bedroll",oPC);
DestroyObject(GetNearestObjectByTag("MyBedRoll",oPC),1.0f);
}
#include "nw_i0_plot"
void main()
{
object oPC = GetLastPCRested();
ExportSingleCharacter(oPC);
SetLocalInt(oPC, "PCDead", 0);
string sRealApp = "realApp";
int nRealMe = GetLocalInt(oPC, sRealApp);
if (!GetIsPC(oPC)) return;
if(nRealMe>0)
{
SetCreatureAppearanceType(oPC, nRealMe - 1);
}
if (GetLastRestEventType()== REST_EVENTTYPE_REST_STARTED && HasItem(oPC,"bedroll"))
{
SetLocalInt(oPC, "bedroll", 1);
PlaceBedroll(oPC);
DelayCommand(2.5, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_SLEEP), oPC));
}
if (GetLastRestEventType()== REST_EVENTTYPE_REST_CANCELLED && GetLocalInt(oPC,"bedroll")==1)
{
PickupBedroll(oPC);
SetLocalInt(oPC, "bedroll", 0);
}
if (GetLastRestEventType()== REST_EVENTTYPE_REST_FINISHED && GetLocalInt(oPC,"bedroll")==1)
{
PickupBedroll(oPC);
SetLocalInt(oPC, "bedroll", 0);
}
}

View File

@@ -0,0 +1,50 @@
void main()
{
object oPC = GetPCLevellingUp();
int nLevel = GetHitDice(oPC);
if(GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DAGGER,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DART,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DIREMACE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DOUBLEAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DWAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATSWORD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HALBERD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HANDAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYCROSSBOW,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYFLAIL,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KAMA,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KATANA,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KUKRI,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTCROSSBOW,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTFLAIL,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTHAMMER,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTMACE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGBOW,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGSWORD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_MORNINGSTAR,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_QUARTERSTAFF,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_RAPIER,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCIMITAR,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCYTHE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTBOW,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSPEAR,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSWORD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHURIKEN,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SICKLE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SLING,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_THROWINGAXE,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_TWOBLADEDSWORD,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_UNARMED,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER,oPC)||
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_CLUB,oPC))
{
SendMessageToPC(oPC,"Devastating Critical is unavailable, please re-level without that feat");
int nNewXP = (( nLevel * ( nLevel - 1 )) / 2 * 1000 ) - 1;
SetXP( oPC, nNewXP );
}
else return;
}

69
_module/nss/_rg_ale.nss Normal file
View File

@@ -0,0 +1,69 @@
#include "nw_i0_plot"
void main()
{
object oDrunk = GetLastUsedBy();
object oEmptyWine = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC004");
object oEmptySpirits = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC003");
object oEmptyBottle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC001");
object oEmptyAle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC002");
if(HasItem(oDrunk, "NW_IT_THNMISC004") == TRUE)
{
DestroyObject (oEmptyWine, 0.0);
CreateItemOnObject("nw_it_mpotion021", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC003") == TRUE)
{
DestroyObject (oEmptySpirits, 0.0);
CreateItemOnObject("nw_it_mpotion021", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC002") == TRUE)
{
DestroyObject (oEmptyAle, 0.0);
CreateItemOnObject("nw_it_mpotion021", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC001") == TRUE)
{
DestroyObject (oEmptyBottle, 0.0);
CreateItemOnObject("nw_it_mpotion021", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
PlayVoiceChat(VOICE_CHAT_CUSS, oDrunk);
FloatingTextStringOnCreature("Hmmm...Wish I had an empty bottle of some kind.", oDrunk, FALSE);
}
}
}
}
}

View File

@@ -0,0 +1,69 @@
#include "nw_i0_plot"
void main()
{
object oDrunk = GetLastUsedBy();
object oEmptyWine = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC004");
object oEmptySpirits = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC003");
object oEmptyBottle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC001");
object oEmptyAle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC002");
if(HasItem(oDrunk, "NW_IT_THNMISC004") == TRUE)
{
DestroyObject (oEmptyWine, 0.0);
CreateItemOnObject("nw_it_mpotion022", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC003") == TRUE)
{
DestroyObject (oEmptySpirits, 0.0);
CreateItemOnObject("nw_it_mpotion022", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC002") == TRUE)
{
DestroyObject (oEmptyAle, 0.0);
CreateItemOnObject("nw_it_mpotion022", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC001") == TRUE)
{
DestroyObject (oEmptyBottle, 0.0);
CreateItemOnObject("nw_it_mpotion022", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
PlayVoiceChat(VOICE_CHAT_CUSS, oDrunk);
FloatingTextStringOnCreature("Hmmm...Wish I had an empty bottle of some kind.", oDrunk, FALSE);
}
}
}
}
}

69
_module/nss/_rg_wine.nss Normal file
View File

@@ -0,0 +1,69 @@
#include "nw_i0_plot"
void main()
{
object oDrunk = GetLastUsedBy();
object oEmptyWine = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC004");
object oEmptySpirits = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC003");
object oEmptyBottle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC001");
object oEmptyAle = GetItemPossessedBy(oDrunk, "NW_IT_THNMISC002");
if(HasItem(oDrunk, "NW_IT_THNMISC004") == TRUE)
{
DestroyObject (oEmptyWine, 0.0);
CreateItemOnObject("nw_it_mpotion023", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC003") == TRUE)
{
DestroyObject (oEmptySpirits, 0.0);
CreateItemOnObject("nw_it_mpotion023", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC002") == TRUE)
{
DestroyObject (oEmptyAle, 0.0);
CreateItemOnObject("nw_it_mpotion023", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
if(HasItem(oDrunk, "NW_IT_THNMISC001") == TRUE)
{
DestroyObject (oEmptyBottle, 0.0);
CreateItemOnObject("nw_it_mpotion023", oDrunk, 1);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
ActionWait(0.5);
PlaySound("it_potion");
}
else
{
PlayVoiceChat(VOICE_CHAT_CUSS, oDrunk);
FloatingTextStringOnCreature("Hmmm...Wish I had an empty bottle of some kind.", oDrunk, FALSE);
}
}
}
}
}

View File

@@ -0,0 +1,8 @@
void main()
{
location lHere = GetLocation(OBJECT_SELF);
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lHere, FALSE);
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_garbage", lHere, FALSE);
}

View File

@@ -0,0 +1,11 @@
#include "x2_inc_switches"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
SetModuleOverrideSpellscript("aa_wild_magic");
SetLocalInt(GetArea(OBJECT_SELF), "X2_L_WILD_MAGIC", 1);
}

View File

@@ -0,0 +1,526 @@
//:://////////////////////////////////////////////////
//:: X0_S2_RODWONDER
/*
Spell script for Rod of Wonder spell.
This spell produces a random spell effect.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 11/25/2002
//:://////////////////////////////////////////////////
#include "x0_i0_petrify"
//#include "x0_i0_spells"
#include "x0_i0_common"
#include "x0_i0_position"
#include "prc_inc_spells"
/**********************************************************************
* TEMPORARY CONSTANTS
**********************************************************************/
const int SPELL_GEM_SPRAY = 504;
const int SPELL_BUTTERFLY_SPRAY = 505;
/**********************************************************************
* FUNCTION PROTOTYPES
* These are generally custom variations on various spells.
**********************************************************************/
// Nothing happens message
void DoNothing(object oCaster);
// Windstorm-force gust of wind effect -- knocks down everyone in the area
void DoWindstorm(location lTarget);
// Give short-term premonition (d4 rounds & up to d4*5 hp damage absorbed)
void DoDetectThoughts(object oCaster);
// Summon a penguin, cow, or deer
void DoSillySummon(object oTarget);
// Do a blindness spell on all in the given radius of a cone for the given
// number of rounds in duration.
void DoBlindnessEffect(object oCaster, location lTarget, float fRadius, int nDuration);
/**********************************************************************
* MAIN FUNCTION DEFINITION
**********************************************************************/
void main()
{
object oCaster = OBJECT_SELF;
object oTarget = GetAttemptedSpellTarget();
if(oTarget == OBJECT_INVALID)
oTarget = oCaster;
location lTargetLoc = GetSpellTargetLocation();
// Create a placeable object to act as the caster
object oCastingObject = CreateObject(OBJECT_TYPE_PLACEABLE,
"aa_wild_magic",
GetLocation(oCaster));
int nRoll = d100();
// All the random effects
DBG_msg("Rod nRoll: " + IntToString(nRoll));
// 1 - 5
if (nRoll < 6) {
// stone hold target for 2 rounds
effect eHold = EffectMovementSpeedDecrease(99);
effect eVis = EffectVisualEffect(VFX_DUR_STONEHOLD);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eHold, oTarget, RoundsToSeconds(2));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, RoundsToSeconds(2));
// 6 - 10
} else if (nRoll < 11) {
// faerie fire on target, DC 11
// replace with polymorph target into chicken
if(GetMaster(oTarget) != OBJECT_INVALID)
return; // should not affect henchmen
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_CHICKEN);
effect eImp = EffectVisualEffect(VFX_IMP_POLYMORPH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
ePoly,
oTarget,
RoundsToSeconds(d4()));
// 11 - 15
} else if (nRoll < 16) {
// delude wielder into thinking it's another effect
int nFakeSpell;
effect eFakeEffect;
if (Random(2) == 0) {
nFakeSpell = SPELL_FIREBALL;
eFakeEffect = EffectVisualEffect(VFX_FNF_FIREBALL);
} else {
nFakeSpell = SPELL_LIGHTNING_BOLT;
eFakeEffect = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
}
AssignCommand(oCastingObject,
ActionCastFakeSpellAtObject(nFakeSpell, oTarget));
if (nFakeSpell == SPELL_LIGHTNING_BOLT) {
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING,
OBJECT_SELF,
BODY_NODE_HAND);
AssignCommand(oCastingObject,
ActionDoCommand(
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eLightning,
oTarget,
1.0)));
}
AssignCommand(oCastingObject,
ActionDoCommand(
ApplyEffectToObject(DURATION_TYPE_INSTANT,
eFakeEffect,
oTarget)));
// 16 - 20
} else if (nRoll < 21) {
// windstorm-force gust of wind
// knock down everyone in the area and play a wind sound
DoWindstorm(lTargetLoc);
// 21 - 25
} else if (nRoll < 26) {
// fireworks...
int nRand = Random(4) + 2;
int i;
float fDelay;
effect eVis = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);
for(i = 1; i <= nRand; i++)
{
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
fDelay += 3.0;
}
// 26 - 30
} else if (nRoll < 31) {
// chains sprout from caster to any nearby creature for a few rounds
int i = 1;
object oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oCaster, i);
float fDistance;
effect eChain = EffectBeam(VFX_BEAM_CHAIN, oCaster, BODY_NODE_CHEST);
effect eImp = EffectVisualEffect(VFX_COM_HIT_SONIC);
while(oCreature != OBJECT_INVALID)
{
fDistance = GetDistanceBetween(oCaster, oCreature);
if(fDistance >= 20.0)
return;
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eChain, oCreature, 18.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oCreature);
i++;
oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oCaster, i);
}
// 31 - 33
} else if (nRoll < 34) {
AssignCommand(oCastingObject,
ActionCastSpellAtObject(SPELL_STORM_OF_VENGEANCE, oCaster, METAMAGIC_ANY, TRUE, 0,
PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
// 34 - 36
} else if (nRoll < 37) {
// summon penguin, rat, or cow
DoSillySummon(oTarget);
// 37 - 43
} else if (nRoll < 44) {
// lightning bolt
int nDamage = d6(6);
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF,
SPELLABILITY_BOLT_LIGHTNING));
nDamage = GetReflexAdjustedDamage(nDamage,
oTarget,
13,
SAVING_THROW_TYPE_ELECTRICITY);
//Make a ranged touch attack
if (nDamage > 0 && TouchAttackRanged(oTarget) > 0) {
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING,
oCaster,
BODY_NODE_HAND);
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eLightning,
oTarget,
1.7);
}
// 44 - 46
} else if (nRoll < 47) {
// polymorph caster into a penguin
if(GetMaster(oCaster) != OBJECT_INVALID)
return; // should not affect henchmen
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_PENGUIN);
effect eImp = EffectVisualEffect(VFX_IMP_POLYMORPH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oCaster);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
ePoly,
oCaster,
RoundsToSeconds(d4()));
SetCustomToken(0, GetName(oCaster));
// 47 - 49 Butterflies
} else if (nRoll < 50) {
ActionCastSpellAtObject(505,
oTarget,
METAMAGIC_ANY, TRUE);
ActionDoCommand(SetCommandable(TRUE));
SetCommandable(FALSE);
// 50 - 53
} else if (nRoll < 54) {
// switch caster and target's places (if casting a spell on self then strike with holy strike)
location lLoc1 = GetLocation(oTarget);
location lLoc2 = GetLocation(oCaster);
if(oCaster == oTarget)
{
AssignCommand(oCastingObject,
ActionCastSpellAtObject(SPELL_HAMMER_OF_THE_GODS, oCaster, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
}
else
{
AssignCommand(oTarget, JumpToLocation(lLoc2));
AssignCommand(oCaster, JumpToLocation(lLoc1));
}
// 54 - 58
} else if (nRoll < 59) {
// timestop effect on target
effect eTimestop = EffectTimeStop();
effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP);
DelayCommand(0.75, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTimestop, oTarget, 6.0));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
// 59 - 62
} else if (nRoll < 63) {
// grass grows around caster
effect eAOE = EffectAreaOfEffect(AOE_PER_ENTANGLE);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,
eAOE,
GetLocation(oCaster),
RoundsToSeconds(d6()));
// 63 - 69
} else if (nRoll < 70) {
effect eVis = EffectVisualEffect(VFX_DUR_FLIES);
int nRand = Random(4) + 2;
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, RoundsToSeconds(nRand));
// 70 - 76
} else if (nRoll < 77) {
// fireball
AssignCommand(oCastingObject,
ActionCastSpellAtObject(SPELL_FIREBALL,
oTarget,
METAMAGIC_NONE,
TRUE,0,
PROJECTILE_PATH_TYPE_DEFAULT,
TRUE));
// 77 - 79
} else if (nRoll < 80) {
if(GetMaster(oTarget) != OBJECT_INVALID)
return; // should not affect henchmen
// polymorph target into a chicken
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_CHICKEN);
effect eImp = EffectVisualEffect(VFX_IMP_POLYMORPH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
ePoly,
oTarget,
RoundsToSeconds(d4()));
SetCustomToken(0, GetName(oTarget));
// 85 - 87
} else if (nRoll < 88) {
// leaves grow from target
// - long-term pixie dust visual effect on caster
int nEffectPixieDust = 321;
effect eDust = EffectVisualEffect(nEffectPixieDust);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eDust,
oCaster,
RoundsToSeconds(d10(3) + 10));
// 88 - 90
} else if (nRoll < 91) {
// Target explodes a fireball every round for a few rounds
int nDur = Random(2) + 2;
int i;
float fDelay;
for(i = 1; i <= nDur; i++)
{
DelayCommand(fDelay,
AssignCommand(oCastingObject,
ActionCastSpellAtObject(SPELL_FIREBALL, oTarget, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)));
fDelay += 6.0;
}
// 91 - 95
} else if (nRoll < 96) {
// shimmering colors blind
ActionCastFakeSpellAtObject(SPELL_PRISMATIC_SPRAY,
oTarget,
PROJECTILE_PATH_TYPE_DEFAULT);
DoBlindnessEffect(oCaster, lTargetLoc, 20.0, d4());
// 96 - 97
} else {
// target changes colors every round for 4-9 rounds
int nDur = Random(6) + 4;
int i;
float fDelay;
int nRand;
int nEffect;
effect eVis;
for(i = 1; i <= nDur; i++)
{
nRand = Random(7) + 1;
if(nRand == 1) nEffect = VFX_DUR_GLOW_PURPLE;
else if(nRand == 2) nEffect = VFX_DUR_GLOW_RED;
else if(nRand == 3) nEffect = VFX_DUR_GLOW_YELLOW;
else if(nRand == 4) nEffect = VFX_DUR_GLOW_GREEN;
else if(nRand == 5) nEffect = VFX_DUR_GLOW_ORANGE;
else if(nRand == 6) nEffect = VFX_DUR_GLOW_BROWN;
else if(nRand == 7) nEffect = VFX_DUR_GLOW_GREY;
eVis = EffectVisualEffect(nEffect);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 6.0));
fDelay += 6.0;
}
}
DestroyObject(oCastingObject, 60.0);
}
/**********************************************************************
* FUNCTION DEFINITIONS
* All the individual effect functions are below.
***********************************************************/
// Nothing happens message
void DoNothing(object oCaster)
{
FloatingTextStrRefOnCreature(8848,
oCaster);
}
// Windstorm-force gust of wind effect
void DoWindstorm(location lTarget)
{
// Play a low thundering sound
PlaySound("as_wt_thunderds4");
// Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE,
RADIUS_SIZE_HUGE,
lTarget, TRUE,
OBJECT_TYPE_CREATURE |
OBJECT_TYPE_DOOR |
OBJECT_TYPE_AREA_OF_EFFECT);
// Cycle through the targets within the spell shape
while (GetIsObjectValid(oTarget)) {
// Play a random sound
switch (Random(5)) {
case 0: AssignCommand(oTarget, PlaySound("as_wt_gustchasm1")); break;
case 1: AssignCommand(oTarget, PlaySound("as_wt_gustcavrn1")); break;
case 2: AssignCommand(oTarget, PlaySound("as_wt_gustgrass1")); break;
case 3: AssignCommand(oTarget, PlaySound("as_wt_guststrng1")); break;
case 4: AssignCommand(oTarget, PlaySound("fs_floatair")); break;
}
// Area-of-effect spells get blown away
if (GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT) {
DestroyObject(oTarget);
}
// * unlocked doors will reverse their open state
else if (GetObjectType(oTarget) == OBJECT_TYPE_DOOR) {
if (!GetLocked(oTarget)) {
if (GetIsOpen(oTarget) == FALSE)
AssignCommand(oTarget, ActionOpenDoor(oTarget));
else
AssignCommand(oTarget, ActionCloseDoor(oTarget));
}
}
// creatures will get knocked down, tough fort saving throw
// to resist.
else if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) {
if( !FortitudeSave(oTarget, 15) ) {
effect eKnockdown = EffectKnockdown();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eKnockdown,
oTarget,
RoundsToSeconds(1));
}
}
// Get the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE,
RADIUS_SIZE_HUGE,
lTarget, TRUE,
OBJECT_TYPE_CREATURE |
OBJECT_TYPE_DOOR |
OBJECT_TYPE_AREA_OF_EFFECT);
}
}
// Give premonition for a few rounds, up to d4*5 hp
void DoDetectThoughts(object oCaster)
{
int nRounds = d4();
int nLimit = nRounds * 5;
effect ePrem = EffectDamageReduction(30, DAMAGE_POWER_PLUS_FIVE, nLimit);
effect eVis = EffectVisualEffect(VFX_DUR_PROT_PREMONITION);
//Link the visual and the damage reduction effect
effect eLink = EffectLinkEffects(ePrem, eVis);
//Fire cast spell at event for the specified target
SignalEvent(oCaster, EventSpellCastAt(oCaster, SPELL_PREMONITION, FALSE));
//Apply the linked effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
eLink, oCaster, RoundsToSeconds(nRounds));
}
// Summon something extremely silly
void DoSillySummon(object oTarget)
{
location lTargetLoc = GetOppositeLocation(oTarget);
int nSummon = d100();
string sSummon = "";
if (nSummon < 26) {
sSummon = "x0_penguin001";
} else if (nSummon < 51) {
sSummon = "nw_cow";
} else {
sSummon = "nw_deer";
}
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),
lTargetLoc);
CreateObject(OBJECT_TYPE_CREATURE, sSummon, lTargetLoc, TRUE);
}
// Do a blindness spell on all in the given radius of a cone for the given
// number of rounds in duration.
void DoBlindnessEffect(object oCaster, location lTarget, float fRadius, int nDuration)
{
vector vOrigin = GetPosition(oCaster);
effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectBlindness();
eLink = EffectLinkEffects(eLink, eDur);
object oTarget = GetFirstObjectInShape(SHAPE_CONE,
fRadius,
lTarget,
TRUE,
OBJECT_TYPE_CREATURE,
vOrigin);
while (GetIsObjectValid(oTarget)) {
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF,
SPELL_BLINDNESS_AND_DEAFNESS));
//Do SR check
if ( !PRCDoResistSpell(OBJECT_SELF, oTarget)) {
// Make Fortitude save to negate
if (! PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 13)) {
//Apply visual and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget,
RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
oTarget = GetNextObjectInShape(SHAPE_CONE,
fRadius,
lTarget,
TRUE,
OBJECT_TYPE_CREATURE,
vOrigin);
}
}

View File

@@ -0,0 +1,19 @@
#include "x2_inc_switches"
#include "prc_inc_spells"
void main()
{
int nSpell = GetSpellId();
object oItem = PRCGetSpellCastItem();
if(GetBaseItemType(oItem) == BASE_ITEM_POTIONS) return;
if(nSpell == SPELL_RESURRECTION || nSpell == SPELL_RAISE_DEAD) return;
int nRand = Random(100);
if(nRand <= 50)
{
FloatingTextStrRefOnCreature(84829, OBJECT_SELF);
ExecuteScript("aa_rod_of_wonder", OBJECT_SELF);
SetModuleOverrideSpellScriptFinished();
}
}

View File

@@ -0,0 +1,48 @@
#include "x0_i0_spawncond"
#include "give_custom_exp"
void main()
{
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
// If we're a good/neutral commoner,
// adjust the killer's alignment evil
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
{
object oKiller = GetLastKiller();
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
}
// Call to allies to let them know we're dead
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
//Shout Attack my target, only works with the On Spawn In setup
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
// NOTE: the OnDeath user-defined event does not
// trigger reliably and should probably be removed
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
////////planar
object oKiller = GetLastKiller();
if(GetAlignmentGoodEvil(oKiller)== ALIGNMENT_EVIL)
{
AdjustAlignment(oKiller, ALIGNMENT_GOOD, 10);
}
//////////////////////////////////////////////////////////
if( !GetIsPC( OBJECT_SELF ) )
give_custom_exp( GetLastKiller(), OBJECT_SELF, 0 );
ExecuteScript("prc_npc_death", OBJECT_SELF);
}

View File

@@ -0,0 +1,18 @@
void main()
{
object oPC = GetClickingObject();
if (!GetIsPC(oPC)) return;
if (GetItemPossessedBy(oPC, "airgem")== OBJECT_INVALID)
return;
object oTarget;
oTarget = OBJECT_SELF;
SetLocked(oTarget, FALSE);
AssignCommand(oTarget, ActionOpenDoor(oTarget));
}

View File

@@ -0,0 +1,9 @@
//Put this on action taken in the conversation editor
void main()
{
object oPC = GetPCSpeaker();
AdjustAlignment(oPC, ALIGNMENT_GOOD, 50);
}

View File

@@ -0,0 +1,9 @@
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)) return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,13 @@
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD &&
GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL)) return FALSE;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD &&
GetAlignmentLawChaos(oPC) == ALIGNMENT_NEUTRAL)) return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,10 @@
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD &&
GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL)) return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,9 @@
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL)) return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,10 @@
int StartingConditional()
{
object oPC = GetPCSpeaker();
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD &&
GetAlignmentLawChaos(oPC) == ALIGNMENT_NEUTRAL)) return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,16 @@
#include "nw_i0_tool"
int StartingConditional()
{
object oPC = GetPCSpeaker();
// Make sure the PC speaker has these items in their inventory...
// can test for more no prob || means or && means and
if(!HasItem(oPC, "statueofjade") &&
!HasItem(oPC, "statueofgold") &&
!HasItem(oPC, "statueofwater") &&
!HasItem(oPC, "statueofdeath"))
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,9 @@
// PC has already spoken at least once with NPC
int StartingConditional()
{
int iResult;
iResult = GetLocalInt(OBJECT_SELF,"NW_L_TALKTIMES") >=1;
return iResult;
}

View File

@@ -0,0 +1,12 @@
void main()
{
object oPC = GetEnteringObject();
object oAlter = GetObjectByTag("DROWALTER");
effect eGlow = EffectVisualEffect(VFX_DUR_GLOW_RED);
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGlow, oAlter);
}

View File

@@ -0,0 +1,6 @@
#include "nw_i0_plot"
void main()
{
EscapeViaTeleport(OBJECT_SELF);
}

View File

@@ -0,0 +1,16 @@
//Put this on action taken in the conversation editor
void main()
{
object oPC = GetPCSpeaker();
object oWaypoint = GetWaypointByTag("WP_anthill_start");
location lTarget = GetLocation(oWaypoint);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, PlaySound("vs_chant_ench_hm"));
ActionCastFakeSpellAtObject(SPELL_BANISHMENT, oPC,PROJECTILE_PATH_TYPE_HOMING);
DelayCommand(2.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
}

12
_module/nss/anna_give.nss Normal file
View File

@@ -0,0 +1,12 @@
#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
effect eBless = SupernaturalEffect(EffectImmunity(IMMUNITY_TYPE_ABILITY_DECREASE));
effect eVis = EffectVisualEffect(VFX_IMP_AURA_HOLY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBless, oPC, 3600.0);
RewardPartyXP(10000,oPC,FALSE);
AdjustAlignment(oPC, ALIGNMENT_GOOD, 50);
}

View File

@@ -0,0 +1,27 @@
//::///////////////////////////////////////////////
//:: FileName anna_take_stat
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 18/07/2003 14:17:44
//:://////////////////////////////////////////////
void main()
{
// Remove items from the player's inventory
object oItemToTake;
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "statueofjade");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "statueofgold");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "statueofwater");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "statueofdeath");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
CreateItemOnObject("shame", GetPCSpeaker(), 1);
}

View File

@@ -0,0 +1,16 @@
void main()
{
object oPC = GetPCSpeaker();
object oItem1 = GetItemPossessedBy(oPC,"statueofjade");
object oItem2 = GetItemPossessedBy(oPC,"statueofgold");
object oItem3 = GetItemPossessedBy(oPC,"statueofwater");
object oItem4 = GetItemPossessedBy(oPC,"statueofdeath");
AssignCommand(OBJECT_SELF, ActionTakeItem(oItem1,oPC));
AssignCommand(OBJECT_SELF, ActionTakeItem(oItem2,oPC));
AssignCommand(OBJECT_SELF, ActionTakeItem(oItem3,oPC));
AssignCommand(OBJECT_SELF, ActionTakeItem(oItem4,oPC));
}

View File

@@ -0,0 +1,48 @@
void main()
{
object oAtt = GetLastDamager();
int iDmg = GetDamageDealtByType(DAMAGE_TYPE_BLUDGEONING) + GetDamageDealtByType(DAMAGE_TYPE_PIERCING) + GetDamageDealtByType(DAMAGE_TYPE_SLASHING) ;
iDmg += d10(1);
object oWp = GetItemInSlot (INVENTORY_SLOT_RIGHTHAND, oAtt);
if (GetBaseItemType(oWp) == BASE_ITEM_LIGHTCROSSBOW ||
GetBaseItemType(oWp) == BASE_ITEM_HEAVYCROSSBOW ||
GetBaseItemType(oWp) == BASE_ITEM_LONGBOW ||
GetBaseItemType(oWp) == BASE_ITEM_SHORTBOW ||
GetBaseItemType(oWp) == BASE_ITEM_DART ||
GetBaseItemType(oWp) == BASE_ITEM_SHURIKEN ||
GetBaseItemType(oWp) == BASE_ITEM_THROWINGAXE ||
GetBaseItemType(oWp) == BASE_ITEM_SLING)
{
if (iDmg == 0)
{
ActionSpeakString ("Miss ... Need Glasses?");
return;
}
else if (iDmg <= 5)
{
ActionSpeakString ("Hit ... Outer ring");
return;
}
else if (iDmg <= 10)
{
ActionSpeakString ("Hit ... Middle ring");
return;
}
else if (iDmg <= 15 )
{
ActionSpeakString ("Hit ... Nearly Bulls-Eye");
return;
}
else if (iDmg <25 )
{
ActionSpeakString ("Hit ... Bulls eye!!!");
return;
}
else
{
return;
}
}
}

View File

@@ -0,0 +1,8 @@
void Revive(int i, string s, location l)
{
CreateObject(i,s ,l );
}
void main()
{
DelayCommand(5.0f,Revive(OBJECT_TYPE_PLACEABLE,GetTag(OBJECT_SELF),GetLocation(OBJECT_SELF)));
}

View File

@@ -0,0 +1,48 @@
#include "x0_i0_spawncond"
#include "give_custom_exp"
void main()
{
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
// If we're a good/neutral commoner,
// adjust the killer's alignment evil
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
{
object oKiller = GetLastKiller();
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
}
// Call to allies to let them know we're dead
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
//Shout Attack my target, only works with the On Spawn In setup
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
// NOTE: the OnDeath user-defined event does not
// trigger reliably and should probably be removed
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
////////planar
object oKiller = GetLastKiller();
if(GetAlignmentGoodEvil(oKiller)== ALIGNMENT_NEUTRAL && GetAlignmentLawChaos(oKiller) == ALIGNMENT_NEUTRAL)
{
AdjustAlignment(oKiller, ALIGNMENT_CHAOTIC, 10);
}
//////////////////////////////////////////////////////////
if( !GetIsPC( OBJECT_SELF ) )
give_custom_exp( GetLastKiller(), OBJECT_SELF, 0 );
ExecuteScript("prc_npc_death", OBJECT_SELF);
}

View File

@@ -0,0 +1,80 @@
/////////////////////////////////////////////////////////////////
////:: Cold Frost Damage OnAreaEnter Script ///////////////
////:: Created By: Mathew Edwards - aka DCMage ///////////////
////:: Created On: 11 July 2003 ///////////////
/////////////////////////////////////////////////////////////////
// This script deals d2 of Positive Energy Damage OnEnter and 1 Damage every 10 seconds
// there after to any persons in the specified Area/Areas. The higher the level
// area the higher the damage will need to be to counter act any resistances a
// PC may have.
void RunColdFrost(int nSecondsRemaining, object oTarget);
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
if (!GetIsPC(oTarget)) return;
object oGear = GetItemPossessedBy(oTarget,"GemofWarming");
int nDamage;
effect eDam;
string sImmuneItem = "GemofWarming"; // Place ITEM ResRef here that negates effects
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_COLD);
int nDuration = GetHitDice(oTarget) / 5;
//figure out timing
float fDelay = 10.0f;
//Check that there is at least one payload damage
if (nDuration < 1)
{
nDuration = 1;
}
{
// Check to see if PC has said item in invo if so avoids effects of Cold Frost
if (GetItemPossessedBy(oTarget, "GemofWarming")!= OBJECT_INVALID)
{
SendMessageToPC(oTarget, "The cold does not effect you");
}
else
{
//Roll initial damage
nDamage = d2(); // CHANGE THIS FROM d2 TO WHAT EVER DICE ROLL YOU WANT FOR DAMAGE E.G d6(2) IS 2d6
//Set the initial damage effect
eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
//Apply the inital VFX impact and damage effect
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
//Apply the bonus damage
nDuration = nDuration * 6;
DelayCommand(6.0, RunColdFrost(nDuration, oTarget));
}
}
}
void RunColdFrost(int nSecondsRemaining, object oTarget)
{
object oTarget = GetEnteringObject();
if (GetIsDead(oTarget) == FALSE)
{
if (nSecondsRemaining % 6 == 0)
{
//Roll damage
int nDamage = 55; // CHANGE THIS FROM 1 DAM TO WHATEVER YOU NEED DO NOT USE DICE ROLLS ONLY NUMBERS
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
SendMessageToPC(oTarget, "You are slowly freezing to death");
}
--nSecondsRemaining;
if (nSecondsRemaining > 0)
{
DelayCommand(1.0f, RunColdFrost(nSecondsRemaining, oTarget));
}
}
}

2122
_module/nss/area_spawner.nss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
/* areacleanup script
checks the area that it was called for for the presence of pc's,
if there aren't any then it systematically cleans up the area
of extra encounters and loot
*/
void debug(string dstring)
{
int isdebug = 0;
if (isdebug == 1)
SendMessageToPC(GetFirstPC(), dstring);
}
void TrashObject(object oObject)
{
debug(GetTag(oObject) + " is in trashobject");
if (GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE) {
object oItem = GetFirstItemInInventory(oObject);
while (GetIsObjectValid(oItem))
{
debug(GetTag(oItem) + " is in trashobject");
TrashObject(oItem);
oItem = GetNextItemInInventory(oObject);
}
}
else
debug(GetTag(oObject) + " failed to pass as inventory type placeable is getting destroyed");
AssignCommand(oObject, SetIsDestroyable(TRUE, FALSE, FALSE));
DestroyObject(oObject);
}
void main()
{
object oPC;
oPC = GetFirstPC();
object tPC = oPC;
debug("We're starting area cleanup");
while (oPC != OBJECT_INVALID)
{
if (OBJECT_SELF == GetArea(oPC))
return;
else oPC = GetNextPC();
}
object oObject = GetFirstObjectInArea(OBJECT_SELF);
while (oObject != OBJECT_INVALID)
{
debug(GetTag(oObject));
if (GetIsEncounterCreature(oObject))
DestroyObject(oObject);
int iObjectType = GetObjectType(oObject);
switch (iObjectType) {
case OBJECT_TYPE_PLACEABLE:
if (GetTag(oObject) != "BodyBag") {
break; }
case OBJECT_TYPE_ITEM:
TrashObject(oObject); }
oObject = GetNextObjectInArea(OBJECT_SELF);
}
}

View File

@@ -0,0 +1,6 @@
void main()
{
location lSelf = GetLocation(OBJECT_SELF);
ActionCastFakeSpellAtLocation(SPELL_TRAP_ARROW,lSelf);
}

View File

@@ -0,0 +1,16 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Placeable Talk
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Use this to on the "onuse" to get item to talk.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void main()
{
ActionStartConversation (GetLastUsedBy());
}

View File

@@ -0,0 +1,27 @@
//::///////////////////////////////////////////////
//:: FileName resref
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 2/18/03 2:54:15 AM
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = TRUE;
object oLecturn = GetNearestObjectByTag("ASG_LECTURN",OBJECT_SELF);
if (GetIsObjectValid(oLecturn))
{
// Look for alchemy book
object oItem = GetFirstItemInInventory(oLecturn);
if (GetIsObjectValid(oItem))
{
string sTagLeft6 = GetStringLeft(GetTag(oItem),6);
if (sTagLeft6=="ASG_MT")
{
iResult = FALSE;
SetCustomToken(1970000,GetName(oItem));
}
}
}
return iResult;
}

View File

@@ -0,0 +1,215 @@
#include "nw_i0_plot"
#include "prc_inc_racial"
void main()
{
// Step 1 ) get Lecturn Infromation
object oLecturn = GetNearestObjectByTag("ASG_LECTURN",OBJECT_SELF);
if (GetIsObjectValid(oLecturn))
{
// Look for alchemy book
object oItem = GetFirstItemInInventory(oLecturn);
object oPC = GetPCSpeaker();
int iPass = FALSE;
if (GetIsObjectValid(oItem))
{
string sTag = GetTag(oItem);
string sTagLeft6 = GetStringLeft(sTag,6);
int iLen = GetStringLength(sTag)-9;
string sMatTag = GetStringRight(sTag,iLen);
string sBase = "ASG_MAT_";
string sMatChest = sBase+sMatTag;
object oMatChest;
object oCCHest;
object oItem;
if (sTagLeft6=="ASG_MT")
{
iPass = TRUE;
}
else
{
SetCustomToken(1970000,"No Valid Alchemy Book found in Lecturn.");
return;
}
// Step 3) Found Legal Alchemy Book, Check Material Chest
if (iPass==TRUE)
{
oMatChest = GetObjectByTag(sMatChest);
if (GetIsObjectValid(oMatChest)) iPass = TRUE;
else
{
SetCustomToken(1970000,"ERROR: No Valid Material Chest found - Report to Mod Builder. Looking for TAG :["+sMatChest+"]");
return;
}
}
// Step 4) Found Legal Material Chest, no check verse Componant Chest
if (iPass==TRUE)
{
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
if (GetIsObjectValid(oCChest)==FALSE)
{
SetCustomToken(1970000,"ERROR: No Valid Componant Chest found - Report to Builder.");
return;
}
object oCTStone = GetItemPossessedBy(oMatChest,"ASG_CatalystStone");
object oHWater = GetItemPossessedBy(oMatChest,"hc_holywater");
if (GetIsObjectValid(oCTStone))
{
int iArcane = GetLevelByClass(CLASS_TYPE_SORCERER,oPC)
+ GetLevelByClass(CLASS_TYPE_WIZARD,oPC)
+ GetLevelByClass(CLASS_TYPE_BEGUILER,oPC)
+ GetLevelByClass(CLASS_TYPE_DRAGONFIRE_ADEPT,oPC)
+ GetLevelByClass(CLASS_TYPE_DREAD_NECROMANCER,oPC)
+ GetLevelByClass(CLASS_TYPE_SHADOWCASTER,oPC)
+ GetLevelByClass(CLASS_TYPE_WARLOCK,oPC)
+ GetLevelByClass(CLASS_TYPE_WARMAGE,oPC)
+ GetLevelByClass(CLASS_TYPE_SUBLIME_CHORD,oPC);
if (iArcane < 1)
{
SetCustomToken(1970000,"This alchemy proccess requires an arcane spellcaster.");
return;
}
}
else if (GetIsObjectValid(oHWater))
{
int iDivine = GetLevelByClass(CLASS_TYPE_ARCHIVIST,oPC)
+ GetLevelByClass(CLASS_TYPE_BLIGHTER,oPC)
+ GetLevelByClass(CLASS_TYPE_CLERIC,oPC)
+ GetLevelByClass(CLASS_TYPE_DRUID,oPC)
+ GetLevelByClass(CLASS_TYPE_FAVOURED_SOUL,oPC)
+ GetLevelByClass(CLASS_TYPE_OCULAR,oPC)
+ GetLevelByClass(CLASS_TYPE_SHAMAN,oPC)
+ GetLevelByClass(CLASS_TYPE_UR_PRIEST,oPC);
if (iDivine < 1)
{
SetCustomToken(1970000,"This alchemy proccess requires a divine spellcaster.");
return;
}
}
// Create List of Items inside of Material Chest;
int iIndex = 0;
string sIndexTag;
int iMaxIndex;
int iTemp;
string sTemp;
oItem = GetFirstItemInInventory(oMatChest);
while(GetIsObjectValid(oItem))
{
sTag = GetTag(oItem);
iTemp = GetLocalInt(OBJECT_SELF,sTag);
if (iTemp==0)
{
// Update iIndex
iIndex++;
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
SetLocalString(OBJECT_SELF,"INDEX_"+sTemp+IntToString(iIndex),sTag);
SetLocalInt(OBJECT_SELF,sTag,1);
SendMessageToPC(oPC,"DEBUG: Creating Index "+IntToString(iIndex));
}
else
{
SetLocalInt(OBJECT_SELF,sTag,iTemp+1);
}
oItem = GetNextItemInInventory(oMatChest);
}
// Items found, now compair agains items inside the Componant Chest.
// Compair & Destroy Local Varibles.
iPass = FALSE;
if (iIndex>0)
{
iMaxIndex = iIndex;
int iNum,iReq,iArray;
for (iIndex=1;iIndex<=iMaxIndex;iIndex++)
{
sBase = "INDEX_";
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
sBase+=sTemp+IntToString(iIndex);
sTemp = GetLocalString(OBJECT_SELF,sBase);
DeleteLocalString(OBJECT_SELF,sBase);
iTemp = GetLocalInt(OBJECT_SELF,sTemp);
DeleteLocalInt(OBJECT_SELF,sTemp);
// Compair Chests info
iReq = iTemp;
iNum = GetNumItems(oCChest,sTemp);
if (iNum >= iReq)
{
iPass = TRUE;
oItem = GetFirstItemInInventory(oCChest);
while (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oCChest);
}
}
}
// Not Enough Materials in Chest
if (iPass == FALSE)
{
SetCustomToken(1970000,"You lack enough materials to make this magic powder.");
return;
}
}
else
{
SetCustomToken(1970000,"ERROR: No Materials found in Material Chest Report to Builder. Material Chest Tag ["+GetTag(oMatChest)+"]");
return;
}
}
// Last Step
if (iPass==TRUE)
{
string sGrade;
string sBluePrint = "";
oItem = GetFirstItemInInventory(oLecturn);
sTag = GetStringLeft(GetTag(oItem),8);
sGrade = GetStringRight(sTag,1);
if (sGrade == "A")
{
sBluePrint = "asg_magicpowdera";
SetCustomToken(1970000,"One bag of Grade A Magic Powder worth 10,000gp");
}
else if (sGrade == "B")
{
sBluePrint = "asg_magicpowderb";
SetCustomToken(1970000,"One bag of Grade B Magic Powder worth 1,000gp");
}
else if (sGrade == "C")
{
sBluePrint = "asg_magicpowderc";
SetCustomToken(1970000,"One bag of Grade C Magic Powder worth 100gp");
}
else
{
SetCustomToken(1970000,"ERROR: Could not identify Magic Powder Type. Report to Mod Builder.");
return;
}
oItem = CreateItemOnObject(sBluePrint,oPC,1);
}
}
}
else
{
SetCustomToken(1970000,"ERROR: No Lecturn Found.");
}
}

View File

@@ -0,0 +1,226 @@
//::///////////////////////////////////////////////
//:: Name MICS Config File
//:: FileName asg_cfg_mics
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This is the options file for the ASG MICS
project.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/26/03
//:://////////////////////////////////////////////
// Set Price for Items
void main()
{
// Item Level
int iLevel_1,iLevel_2,iLevel_3,iLevel_4,iLevel_5,iLevel_6,iLevel_7,iLevel_8;
int iLevel_9,iLevel_10,iLevel_11,iLevel_12,iLevel_13,iLevel_14,iLevel_15;
int iLevel_16,iLevel_17,iLevel_18,iLevel_19,iLevel_20,iLevel_Plus;
// Scroll & Potion Level
int iLevel_p1,iLevel_p2,iLevel_p3,iLevel_p4,iLevel_p5,iLevel_p6,iLevel_p7,iLevel_p8;
int iLevel_p9,iLevel_p10,iLevel_p11,iLevel_p12,iLevel_p13,iLevel_p14,iLevel_p15;
int iLevel_p16,iLevel_p17,iLevel_p18,iLevel_p19,iLevel_p20,iLevel_pPlus;
int rMISC_COPYOBJECT;
int rMICS_XPCOST;
float rMICS_MATERIALCOST;
int rMISC_BUILDTIME;
// ***************************
// **
// ** Material Cost
// **
// ** Standard Material Cost is equal to 1/2 the Base Gold Peice Cost of the
// ** item being made.
rMICS_MATERIALCOST = 0.5;
// ***************************
// **
// ** XP Cost
// **
// ** Standard 3e rules throws out the XP cost at 1/25 the cost of the
// ** material cost. You may change that here.
rMICS_XPCOST = 25;
// ***************************
// **
// ** CopyObject
// **
// ** This works by copying the object in the Item List Chest to the players
// ** inventory. Advantages to this is that you can make a number of
// ** modifications to the item without changing the blueprint and having to
// ** make a new item resref. Draw back is that many scripts that deal with
// ** inventory destroy & recreate the item. If this happens with a modified
// ** item that has been copied, it will return to it's original resref.
rMISC_COPYOBJECT = FALSE;
// ***************************
// **
// ** Build Time
// **
// ** Some DM's may wish to limit how often a player can build a new item
// ** this time is expressesd in game hours. Defualt is 0;
rMISC_BUILDTIME = 1;
// ***************************
// **
// ** Item Level Build Restriction -
// **
// ** Not happy with level restriction I placed on the build item requirement
// ** you can change that here. Each iLevel_X represents a character level
// ** with that particular class. Just Change the Number and that will change
// ** the gp value and level. Note there is a seperate Price List for
// ** Scrolls & Potions.
// *** Level 1
iLevel_1 = 1000;
// *** Level 2
iLevel_2 = 1500;
// *** Level 3
iLevel_3 = 2500;
// *** Level 4
iLevel_4 = 3500;
// *** Level 5
iLevel_5 = 5000;
// *** Level 6
iLevel_6 = 6500;
// *** Level 7
iLevel_7 = 9000;
// *** Level 8
iLevel_8 = 12000;
// *** Level 9
iLevel_9 = 15000;
// *** Level 10
iLevel_10 = 19500;
// *** Level 11
iLevel_11 = 25000;
// *** Level 12
iLevel_12 = 30000;
// *** Level 13
iLevel_13 = 35000;
// *** Level 14
iLevel_14 = 40000;
// *** Level 15
iLevel_15 = 50000;
// *** Level 16
iLevel_16 = 65000;
// *** Level 17
iLevel_17 = 75000;
// *** Level 18
iLevel_18 = 90000;
// *** Level 19
iLevel_19 = 110000;
// *** Level 20
iLevel_20 = 130000;
// *** Over 20th level - 1 level for each (iLevel_Plus) over 20+
// *** how is this possible? See The Enchanted Anvil & Holy Alter for detials.
iLevel_Plus = 20000;
// ***************************
// **
// ** Scroll & Potion Level Build Restriction -
// **
// ** Not happy with level restrictio I placed on the build item requirement
// ** you can change that here. Each iLevel_pX represents a character level
// ** with that particular class. Just Change the Number and that will change
// ** the gp value and level.
// *** Level 1
iLevel_p1 = 40;
// *** Level 2
iLevel_p2 = 80;
// *** Level 3
iLevel_p3 = 120;
// *** Level 4
iLevel_p4 = 210;
// *** Level 5
iLevel_p5 = 300;
// *** Level 6
iLevel_p6 = 430;
// *** Level 7
iLevel_p7 = 560;
// *** Level 8
iLevel_p8 = 730;
// *** Level 9
iLevel_p9 = 900;
// *** Level 10
iLevel_p10 = 1110;
// *** Level 11
iLevel_p11 = 1320;
// *** Level 12
iLevel_p12 = 1570;
// *** Level 13
iLevel_p13 = 1821;
// *** Level 14
iLevel_p14 = 2111;
// *** Level 15
iLevel_p15 = 2401;
// *** Level 16
iLevel_p16 = 2731;
// *** Level 17
iLevel_p17 = 3061;
// *** Level 18
iLevel_p18 = 3411;
// *** Level 19
iLevel_p19 = 3761;
// *** Level 20
iLevel_p20 = 4111;
// *** Over 20th level - 1 level for each (iLevel_Plus) over 20+
// *** how is this possible? See The Enchanted Anvil & Holy Alter for detials.
iLevel_pPlus = 500;
// ************************************************************************
// **
// ** Store Varibles to Mod.
// **
SetLocalInt(GetModule(),"ASG_MICS_COPYOBJECT",rMISC_COPYOBJECT);
SetLocalFloat(GetModule(),"ASG_MICS_MATERIALCOST",rMICS_MATERIALCOST);
SetLocalInt(GetModule(),"ASG_MICS_XPCOST",rMICS_XPCOST);
SetLocalInt(GetModule(),"ASG_MICS_BUILDTIME",rMISC_BUILDTIME);
// ** Store Item Level Restrictions
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_1",iLevel_1);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_2",iLevel_2);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_3",iLevel_3);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_4",iLevel_4);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_5",iLevel_5);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_6",iLevel_6);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_7",iLevel_7);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_8",iLevel_8);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_9",iLevel_9);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_10",iLevel_10);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_11",iLevel_11);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_12",iLevel_12);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_13",iLevel_13);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_14",iLevel_14);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_15",iLevel_15);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_16",iLevel_16);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_17",iLevel_17);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_18",iLevel_18);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_19",iLevel_19);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_20",iLevel_20);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_Plus",iLevel_Plus);
// Set Potion & Scroll Level Restrictions
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p1",iLevel_p1);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p2",iLevel_p2);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p3",iLevel_p3);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p4",iLevel_p4);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p5",iLevel_p5);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p6",iLevel_p6);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p7",iLevel_p7);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p8",iLevel_p8);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p9",iLevel_p9);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p10",iLevel_p10);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p11",iLevel_p11);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p12",iLevel_p12);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p13",iLevel_p13);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p14",iLevel_p14);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p15",iLevel_p15);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p16",iLevel_p16);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p17",iLevel_p17);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p18",iLevel_p18);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p19",iLevel_p19);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p20",iLevel_p20);
SetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_pPlus",iLevel_pPlus);
// Attempt to Scatter Books Across the Mod
ExecuteScript("asg_rseedbooks",GetModule());
}

View File

@@ -0,0 +1,112 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Setup Magic Items
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used for assembiling magic items Vol 1.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 02/17/03
//:://////////////////////////////////////////////
// asg_REQ1(object oPC,int vREQ, int vNUM);
#include "nw_i0_plot"
#include "asg_include_mics"
string sPower = GetLocalString(OBJECT_SELF,"ASG_BUILDITEM_ARCDIVALL");
int iClass = GetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_REQUIREDCLASS");
int iRclass = GetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_CREATORSLEVEL");
int iLevelR = GetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_LEVELREQUIRED");
int iGPCost = GetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_MATERIALCOST");
int iXPCost = GetLocalInt(OBJECT_SELF,"ASG_BUILDITEM_XPLOSS");
string sBluePrint = GetLocalString(OBJECT_SELF,"ASG_BUILDITEM_BLUEPRINT");
int StartingConditional()
{
int iResult = FALSE;
int iBBonus = 0;
int iBaseType;
object oPC = GetPCSpeaker();
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
if (GetIsObjectValid(oCChest))
{
string sGradeC = "MagicPowder";
string sGradeB = "MagicPowderGradeB";
string sGradeA = "MagicPowderGradeA";
string sTag;
int iGPTotal = 0;
object oItem = GetFirstItemInInventory(oCChest);
while (GetIsObjectValid(oItem))
{
sTag = GetTag(oItem);
if (sTag==sGradeC || sTag==sGradeB || sTag==sGradeA)
{
iGPTotal = iGPTotal + GetGoldPieceValue(oItem);
SetLocalInt(oItem,"ASG_SETTODESTROY",TRUE);
}
oItem = GetNextItemInInventory(oCChest);
}
// SendMessageToPC(oPC,"DEBUG: Cost = "+IntToString(iGPCost)+", Materials Supplied = "+IntToString(iGPTotal));
if (iGPTotal >= iGPCost) iResult = TRUE;
if (iResult==TRUE)
{
string sChestTag = "ASG_TTEMPSTORAGECHEST";
object oChest = GetObjectByTag(sChestTag);
string sBaseType;
int iGP2 = 0;
if (GetIsObjectValid(oChest))
{
object oItem = GetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM");
if (GetIsObjectValid(oItem))
{
iBaseType = GetBaseItemType(oItem);
iGP2 = GetGold(oItem);
SetLocalString(OBJECT_SELF,"ASG_BUILDITEM_BLUEPRINT",GetResRef(oItem));
}
else
{
iResult = FALSE;
SendMessageToPC(oPC,"(!) Construction Error, Item is not avaible to be built in module.");
}
if (iResult == TRUE)
{
object oItem2 = GetFirstItemInInventory(oCChest);
int iMlevel = 0;
iResult = FALSE;
while(GetIsObjectValid(oItem2) && iResult!=TRUE)
{
if (GetBaseItemType(oItem2)==iBaseType && GetPlotFlag(oItem2)!=TRUE)
{
iResult = TRUE;
iMlevel = FindItemLevel(oItem);
SetLocalInt(oItem2,"ASG_SETTODESTROY",TRUE);
}
oItem2 = GetNextItemInInventory(oCChest);
}
}
}
}
if (iResult==TRUE)
{
int nHD = GetHitDice(oPC);
int nXP = GetXP(oPC);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - iXPCost;
if (nNewXP < nMin)
{
iResult = FALSE;
SendMessageToPC(oPC,"(!)Warning: You need to gain more experince before building this item, you would lose a level if you did build it.");
PlaySound("as_cv_glasbreak2");
}
else
{
SetXP(oPC, nNewXP);
}
}
}
return iResult;
}

View File

@@ -0,0 +1,129 @@
// This is the ASG Custom Inlcude
// int FindItemLevel(object oItem);
int FindItemLevel(object oItem)
{
int iGoldValue;
int iBaseType;
// Scroll & Potion Level
// Load Values
// ** Store Item Level Restrictions
int iLevel_1 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_1");
int iLevel_2 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_2");
int iLevel_3 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_3");
int iLevel_4 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_4");
int iLevel_5 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_5");
int iLevel_6 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_6");
int iLevel_7 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_7");
int iLevel_8 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_8");
int iLevel_9 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_9");
int iLevel_10 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_10");
int iLevel_11 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_11");
int iLevel_12 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_12");
int iLevel_13 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_13");
int iLevel_14 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_14");
int iLevel_15 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_15");
int iLevel_16 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_16");
int iLevel_17 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_17");
int iLevel_18 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_18");
int iLevel_19 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_19");
int iLevel_20 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_20");
int iLevel_Plus = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_Plus");
// Set Potion & Scroll Level Restrictions
int iLevel_p1 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p1");
int iLevel_p2 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p2");
int iLevel_p3 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p3");
int iLevel_p4 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p4");
int iLevel_p5 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p5");
int iLevel_p6 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p6");
int iLevel_p7 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p7");
int iLevel_p8 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p8");
int iLevel_p9 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p9");
int iLevel_p10 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p10");
int iLevel_p11 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p11");
int iLevel_p12 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p12");
int iLevel_p13 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p13");
int iLevel_p14 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p14");
int iLevel_p15 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p15");
int iLevel_p16 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p16");
int iLevel_p17 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p17");
int iLevel_p18 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p18");
int iLevel_p19 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p19");
int iLevel_p20 = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_p20");
int iLevel_pPlus = GetLocalInt(GetModule(),"ASG_MICS_ITEM_LEVEL_pPlus");
int nIDd = GetIdentified(oItem);
if(nIDd == FALSE)
{
SetIdentified(oItem, TRUE);
iGoldValue = GetGoldPieceValue(oItem);
SetIdentified(oItem, FALSE);
} else {
iGoldValue = GetGoldPieceValue(oItem);
}
iBaseType = GetBaseItemType(oItem);
if (iBaseType == BASE_ITEM_POTIONS || iBaseType == BASE_ITEM_SPELLSCROLL || iBaseType == BASE_ITEM_SCROLL)
{
if(iGoldValue <= iLevel_p1) return 1;
if(iGoldValue > iLevel_p1 && iGoldValue <= iLevel_p2) return 2;
if(iGoldValue > iLevel_p2 && iGoldValue <= iLevel_p3) return 3;
if(iGoldValue > iLevel_p3 && iGoldValue <= iLevel_p4) return 4;
if(iGoldValue > iLevel_p4 && iGoldValue <= iLevel_p5) return 5;
if(iGoldValue > iLevel_p5 && iGoldValue <= iLevel_p6) return 6;
if(iGoldValue > iLevel_p6 && iGoldValue <= iLevel_p7) return 7;
if(iGoldValue > iLevel_p7 && iGoldValue <= iLevel_p8) return 8;
if(iGoldValue > iLevel_p8 && iGoldValue <= iLevel_p9) return 9;
if(iGoldValue > iLevel_p9 && iGoldValue <= iLevel_p10) return 10;
if(iGoldValue > iLevel_p10 && iGoldValue <= iLevel_p11) return 11;
if(iGoldValue > iLevel_p11 && iGoldValue <= iLevel_p12) return 12;
if(iGoldValue > iLevel_p12 && iGoldValue <= iLevel_p13) return 13;
if(iGoldValue > iLevel_p13 && iGoldValue <= iLevel_p14) return 14;
if(iGoldValue > iLevel_p14 && iGoldValue <= iLevel_p15) return 15;
if(iGoldValue > iLevel_p15 && iGoldValue <= iLevel_p16) return 16;
if(iGoldValue > iLevel_p16 && iGoldValue <= iLevel_p17) return 17;
if(iGoldValue > iLevel_p17 && iGoldValue <= iLevel_p18) return 18;
if(iGoldValue > iLevel_p18 && iGoldValue <= iLevel_p19) return 19;
if(iGoldValue > iLevel_p19 && iGoldValue <= iLevel_p20) return 20;
if(iGoldValue > iLevel_p20)
{
iGoldValue=iGoldValue-iLevel_p20;
iGoldValue=iGoldValue/iLevel_pPlus;
iGoldValue+=20;
return iGoldValue;
}
}
else
{
if(iGoldValue <= iLevel_1) return 1;
if(iGoldValue > iLevel_1 && iGoldValue <= iLevel_2) return 2;
if(iGoldValue > iLevel_2 && iGoldValue <= iLevel_3) return 3;
if(iGoldValue > iLevel_3 && iGoldValue <= iLevel_4) return 4;
if(iGoldValue > iLevel_4 && iGoldValue <= iLevel_5) return 5;
if(iGoldValue > iLevel_5 && iGoldValue <= iLevel_6) return 6;
if(iGoldValue > iLevel_6 && iGoldValue <= iLevel_7) return 7;
if(iGoldValue > iLevel_7 && iGoldValue <= iLevel_8) return 8;
if(iGoldValue > iLevel_8 && iGoldValue <= iLevel_9) return 9;
if(iGoldValue > iLevel_9 && iGoldValue <= iLevel_10) return 10;
if(iGoldValue > iLevel_10 && iGoldValue <= iLevel_11) return 11;
if(iGoldValue > iLevel_11 && iGoldValue <= iLevel_12) return 12;
if(iGoldValue > iLevel_12 && iGoldValue <= iLevel_13) return 13;
if(iGoldValue > iLevel_13 && iGoldValue <= iLevel_14) return 14;
if(iGoldValue > iLevel_14 && iGoldValue <= iLevel_15) return 15;
if(iGoldValue > iLevel_15 && iGoldValue <= iLevel_16) return 16;
if(iGoldValue > iLevel_16 && iGoldValue <= iLevel_17) return 17;
if(iGoldValue > iLevel_17 && iGoldValue <= iLevel_18) return 18;
if(iGoldValue > iLevel_18 && iGoldValue <= iLevel_19) return 19;
if(iGoldValue > iLevel_19 && iGoldValue <= iLevel_20) return 20;
if(iGoldValue > iLevel_20)
{
iGoldValue=iGoldValue-iLevel_20;
iGoldValue=iGoldValue/iLevel_Plus;
iGoldValue+=20;
return iGoldValue;
}
}
return 0;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name Open MICS Store 1
//:: FileName asg_openstore01
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 04/27/03
//:://////////////////////////////////////////////
void main()
{
object oPC = GetPCSpeaker();
object oStore = GetObjectByTag("ASG_MICS_BOOKSHOP");
OpenStore(oStore,oPC);
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name Open MICS Store 2
//:: FileName asg_openstore01
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 04/27/03
//:://////////////////////////////////////////////
void main()
{
object oPC = GetPCSpeaker();
object oStore = GetObjectByTag("ASG_MICS_BASICMAGICSUPPLYSHOP");
OpenStore(oStore,oPC);
}

View File

@@ -0,0 +1,39 @@
//::///////////////////////////////////////////////
//:: Name Random Arcane Book Generator
//:: FileName asg_racanebk
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used to create a single random arcane book.
used:
ExecuteScript("asg_racanebk",oContianer);
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/27/03
//:://////////////////////////////////////////////
void main()
{
object oPC = OBJECT_SELF;
object oArcaneBooks = GetObjectByTag("ASG_ACCHEST");
int iCount = 0;
int iRandom;
int iK;
object oBook = GetFirstItemInInventory(oArcaneBooks);
while (GetIsObjectValid(oBook))
{
iCount++;
oBook = GetNextItemInInventory(oArcaneBooks);
}
iRandom = Random(iCount);
oBook = GetFirstItemInInventory(oArcaneBooks);
for (iK=0;iK<=iRandom;iK++)
{
oBook = GetNextItemInInventory(oArcaneBooks);
}
object oNewBook = CopyObject(oBook,GetLocation(oPC),oPC);
SetIdentified(oNewBook,TRUE);
}

View File

@@ -0,0 +1,42 @@
//::///////////////////////////////////////////////
//:: Store Open Script
//:: asg_radvopen
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Recommend keeping this Merchant his own store, books only.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/27/03
//:://////////////////////////////////////////////
void main()
{
object oStore = OBJECT_SELF;
int iNow = (10000*GetCalendarYear())+(1000*GetCalendarMonth())+(100*GetCalendarDay())+GetTimeHour();
int iLast = GetLocalInt(oStore,"ASG_LASTOPENED");
if (iNow>=iLast)
{
SetLocalInt(oStore,"ASG_LASTOPENED",iNow+24);
int iK;
// Clean out Book Store
object oItem = GetFirstItemInInventory(oStore);
while (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oStore);
}
// Add 5 Books from Arcane, Add 5 Books from the Divine.
// Add Arcane Books
for (iK=0;iK<=4;iK++)
{
ExecuteScript("asg_racanebk",oStore);
}
// Add Divine Books
for (iK=0;iK<=4;iK++)
{
ExecuteScript("asg_rdivinebk",oStore);
}
}
}

View File

@@ -0,0 +1,23 @@
//::///////////////////////////////////////////////
//:: Name OnOpen Create Random Arcane Book Once/Day
//:: FileName asg_rdivopen
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
to be placed on a Contaiers - On Open scropt.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/28/03
//:://////////////////////////////////////////////
void main()
{
int iNow = (10000*GetCalendarYear())+(1000*GetCalendarMonth())+(100*GetCalendarDay())+GetTimeHour();
int iLast = GetLocalInt(OBJECT_SELF,"ASG_LASTOPENED");
if (iNow>=iLast)
{
SetLocalInt(OBJECT_SELF,"ASG_LASTOPENED",iNow+24);
ExecuteScript("asg_racanebk",OBJECT_SELF);
}
}

View File

@@ -0,0 +1,39 @@
//::///////////////////////////////////////////////
//:: Name Random Divine Book Generator
//:: FileName asg_racanebk
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used to create a single random arcane book.
used:
ExecuteScript("asg_rdivinebk",oContianer);
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/27/03
//:://////////////////////////////////////////////
void main()
{
object oPC = OBJECT_SELF;
object oArcaneBooks = GetObjectByTag("ASG_DVCHEST");
int iCount = 0;
int iRandom;
int iK;
object oBook = GetFirstItemInInventory(oArcaneBooks);
while (GetIsObjectValid(oBook))
{
iCount++;
oBook = GetNextItemInInventory(oArcaneBooks);
}
iRandom = Random(iCount);
oBook = GetFirstItemInInventory(oArcaneBooks);
for (iK=0;iK<=iRandom;iK++)
{
oBook = GetNextItemInInventory(oArcaneBooks);
}
object oNewBook = CopyObject(oBook,GetLocation(oPC),oPC);
SetIdentified(oNewBook,TRUE);
}

View File

@@ -0,0 +1,23 @@
//::///////////////////////////////////////////////
//:: Name OnOpen Create Random Divine Book Once/Day
//:: FileName asg_rdivopen
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
to be placed on a Contaiers - On Open scropt.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 4/28/03
//:://////////////////////////////////////////////
void main()
{
int iNow = (10000*GetCalendarYear())+(1000*GetCalendarMonth())+(100*GetCalendarDay())+GetTimeHour();
int iLast = GetLocalInt(OBJECT_SELF,"ASG_LASTOPENED");
if (iNow>=iLast)
{
SetLocalInt(OBJECT_SELF,"ASG_LASTOPENED",iNow+24);
ExecuteScript("asg_rdivinebk",OBJECT_SELF);
}
}

View File

@@ -0,0 +1,129 @@
#include "nw_o0_itemmaker"
int DEBUG = FALSE;
string sMid(string sString, int iStart,int iChars)
{
string sCut1;
string sCut2;
string sReturn;
int iCut = iStart+iChars;
sCut1 = GetStringLeft(sString,iCut);
sCut2 = GetStringRight(sCut1,iChars);
sReturn = sCut2;
// ** No checks on this one
return sReturn;
}
string sEnd(string sString, int iStart)
{
string sCut1;
string sCut2;
string sReturn;
int iLength = GetStringLength(sString);
int iChars = iLength-iStart;
int iCut = iStart+iChars;
sCut1 = GetStringLeft(sString,iCut);
sCut2 = GetStringRight(sCut1,iChars);
sReturn = sCut2;
// ** No checks on this one
return sReturn;
}
void main()
{
// ASG_ArcaneBookofBelts
object oLecturn =GetNearestObjectByTag("ASG_LECTURN");
object oSelf = OBJECT_SELF;
object oPC = GetPCSpeaker();
string sToken = "DEBUG: ERROR";
object oChest;
int iContinue = FALSE;
if (GetIsObjectValid(oLecturn))
{
object oItem = GetFirstItemInInventory(oLecturn);
// ASG_ArcaneBookofBelts
if (GetIsObjectValid(oItem))
{
string sTag = GetTag(oItem);
string sLeft3 = GetStringLeft(sTag,3);
string sArDiv;
if (sLeft3=="RBK")
{
sLeft3 = sEnd(sTag,4);
sArDiv = sMid(sLeft3,4,3);
if (DEBUG==TRUE)
{
SendMessageToPC(oPC,"DEBUG: sLeft3 = "+sLeft3);
SendMessageToPC(oPC,"DEBUG: sArDiv = "+sArDiv);
}
sTag = sLeft3;
oChest = GetObjectByTag(sTag);
sToken = GetName(oItem);
if (sArDiv=="ARC") SetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE","A");
else SetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE","D");
}
// Check if Object is now valid
if (GetIsObjectValid(oChest))
{
if (GetIsObjectValid(oChest))
{
// Create List
int iIndex = 0;
object oItem = GetFirstItemInInventory(oChest);
while (GetIsObjectValid(oItem))
{
// Check to make sure the item is ID
int iID = GetIdentified(oItem); if (iID!=TRUE) SetIdentified(oItem,TRUE);
SetLocalArrayString(OBJECT_SELF,"ASG_MIC_ITEMNAME",iIndex,GetName(oItem));
SetLocalArrayString(OBJECT_SELF,"ASG_MIC_ITEMTAG",iIndex,GetTag(oItem));
iIndex++;
oItem = GetNextItemInInventory(oChest);
}
SetLocalObject(OBJECT_SELF,"ASG_MIC_CHEST",oChest);
SetLocalInt(OBJECT_SELF,"ASG_MIC_TOTALLIST",iIndex);
SetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT",0);
// Research Type Strings
// (A) Any Arcane Caster
// ( D) Any Divine Caster
}
else
{
SendMessageToPC(oPC,"ERROR - Magic Item Storage Chest Not Valid");
}
}
}
}
SetCustomToken(1970001,sToken);
int iBonus = 0;
object oLibrary = GetNearestObjectByTag("ASG_BOOKSHELF",OBJECT_SELF);
if (GetIsObjectValid(oLibrary))
{
float fDist = GetDistanceBetween(OBJECT_SELF,oLibrary);
if (fDist<10.0)
{
object oBooks = GetFirstItemInInventory(oLibrary);
int iType;
string sLeft3;
while (GetIsObjectValid(oBooks))
{
iType = GetBaseItemType(oBooks);
if (iType == BASE_ITEM_BOOK)
{
if (GetStringLeft(GetTag(oBooks),3)=="RBK")
{
iBonus=iBonus+1;
}
iBonus++;
}
oBooks = GetNextItemInInventory(oLibrary);
}
}
}
// SetLocalInt(OBJECT_SELF,"ASG_MIC_RESEARCHBONUS",iBonus);
SendMessageToPC(oPC,"*******************************");
// SendMessageToPC(oPC,"Enchanted Forge/Alter Level Bonus : "+IntToString(iBonus));
}

View File

@@ -0,0 +1,77 @@
//::///////////////////////////////////////////////
//:: Name(ASG) Test Lecturn out
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
string sMid(string sString, int iStart,int iChars)
{
string sCut1;
string sCut2;
string sReturn;
int iCut = iStart+iChars;
sCut1 = GetStringLeft(sString,iCut);
sCut2 = GetStringRight(sCut1,iChars);
sReturn = sCut2;
// ** No checks on this one
return sReturn;
}
string sEnd(string sString, int iStart)
{
string sCut1;
string sCut2;
string sReturn;
int iLength = GetStringLength(sString);
int iChars = iLength-iStart;
int iCut = iStart+iChars;
sCut1 = GetStringLeft(sString,iCut);
sCut2 = GetStringRight(sCut1,iChars);
sReturn = sCut2;
// ** No checks on this one
return sReturn;
}
int StartingConditional()
{
int iResult = FALSE;
object oLecturn =GetNearestObjectByTag("ASG_LECTURN");
object oSelf = OBJECT_SELF;
object oPC = GetPCSpeaker();
if (GetIsObjectValid(oLecturn))
{
object oItem = GetFirstItemInInventory(oLecturn);
// ASG_ArcaneBookofBelts
if (GetIsObjectValid(oItem))
{
string sTag = GetTag(oItem);
string sLeft3 = GetStringLeft(sTag,3);
if (sLeft3=="RBK")
{
sLeft3 = sEnd(sTag,4);
string sArDiv = sMid(sLeft3,4,3);
sTag = sLeft3;
if (sArDiv=="ARC")
{
int iSorC = 1;
int iWizC = 1;
if (iSorC>0 || iWizC>0) iResult = TRUE;
}
else if (sArDiv=="DIV")
{
int iClrC = 1;
int iDrdC = 1;
if (iClrC>0 || iDrdC>0) iResult = TRUE;
}
SetLocalString(OBJECT_SELF,"RBK_ARDIV",sArDiv);
}
}
}
return iResult;
}

View File

@@ -0,0 +1,7 @@
void main()
{
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
iCurListPoint=iCurListPoint-6;
if (iCurListPoint<0) iCurListPoint = 0;
SetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT",iCurListPoint);
}

View File

@@ -0,0 +1,8 @@
void main()
{
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
iCurListPoint=iCurListPoint-1;
int iMaxArray = GetLocalInt(OBJECT_SELF,"ASG_MIC_TOTALLIST");
if (iCurListPoint>iMaxArray) iCurListPoint = iMaxArray;
SetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT",iCurListPoint);
}

View File

@@ -0,0 +1,16 @@
int StartingConditional()
{
int iResult = TRUE; // ASG_CCHEST
object oCChest =GetNearestObjectByTag("ASG_CCHEST");
object oSelf = OBJECT_SELF;
if (GetIsObjectValid(oCChest))
{
object oItem = GetItemPossessedBy(oCChest,"Parchment");
// Parchement
if (GetIsObjectValid(oItem))
{
iResult = FALSE;
}
}
return iResult;
}

View File

@@ -0,0 +1,14 @@
int StartingConditional()
{
int iResult = TRUE;
object oPC = GetPCSpeaker();
int iNow = (GetCalendarMonth()*1000) + (GetCalendarDay()*100) + GetTimeHour();
int iLast = GetLocalInt(oPC,"ASG_RESEARCHAGAININ");
if (iNow>iLast-1) iResult = FALSE;
else
{
int iDif = iLast - iNow;
SetCustomToken(1970001,IntToString(iDif));
}
return iResult;
}

View File

@@ -0,0 +1,38 @@
//::///////////////////////////////////////////////
//:: FileName resref
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 2/18/03 2:54:15 AM
//:://////////////////////////////////////////////
int StartingConditional()
{
/*
// Restrict based on the player's class
int iPassed = 0;
if((iPassed == 0) && (GetLevelByClass(CLASS_TYPE_CLERIC, GetPCSpeaker()) >= 1))
iPassed = 1;
if((iPassed == 0) && (GetLevelByClass(CLASS_TYPE_SORCERER, GetPCSpeaker()) >= 1))
iPassed = 1;
if((iPassed == 0) && (GetLevelByClass(CLASS_TYPE_DRUID, GetPCSpeaker()) >= 1))
iPassed = 1;
if((iPassed == 0) && (GetLevelByClass(CLASS_TYPE_WIZARD, GetPCSpeaker()) >= 1))
iPassed = 1;
if(iPassed == 0)
return FALSE;
*/
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);
ExecuteScript("asg_rul_micscfx",oTarget);
return TRUE;
}

View File

@@ -0,0 +1,6 @@
void main()
{
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
iCurListPoint=iCurListPoint-11; if (iCurListPoint<1) iCurListPoint=0;
SetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT",iCurListPoint);
}

View File

@@ -0,0 +1,8 @@
int StartingConditional()
{
int iResult = FALSE;
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
int iMaxArray = GetLocalInt(OBJECT_SELF,"ASG_MIC_TOTALLIST");
if (iCurListPoint<iMaxArray) iResult = TRUE;
return iResult;
}

View File

@@ -0,0 +1,8 @@
int StartingConditional()
{
int iResult = FALSE;
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
int iK = iCurListPoint; if (iK>=7) iResult = TRUE;
return iResult;
}

View File

@@ -0,0 +1,214 @@
object oMod = GetModule();
int DEBUG = FALSE;
void main()
{
// *** Objects
object oCChest;
object oItem;
object oNewItem;
object oDest;
object oArea;
// *** Ints
int iIndex = 0;
int iMaxIndex;
int iTemp;
int iK;
int iCount;
int iRandom;
int iPass;
// ************************
// ** < Scripters Edge >
// ** If you don't have 19 differant catagories of placeables you can cut this
// ** down.
// *************************
int iMaxContainer = 19;
// *** Strings
string sIndexTag;
string sTemp;
string sTag;
string sBase;
string sText;
// ************************
// ** < Scripters Edge >
// ** If you want to place your own containers in here instead of the generic
// ** Neverwinter Objects. Change out the sTag in the Switch Statment to the
// ** one you want.
// *************************
// Step One Create Temporay Index of Avaible Containers
// Create List of Items inside of Material Chest;
for (iK=1;iK<=iMaxContainer;iK++)
{
switch(iK)
{
case(1): sTag = "Armoire"; break;
case(2): sTag = "Barrel"; break;
case(3): sTag = "BookPiles"; break;
case(4): sTag = "Bookshelf"; break;
case(5): sTag = "Cabinet"; break;
case(6): sTag = "Chest1"; break;
case(7): sTag = "Chest2"; break;
case(8): sTag = "Chest3"; break;
case(9): sTag = "Chest4"; break;
case(10): sTag = "ChestofDrawers"; break;
case(11): sTag = "NW_VAMPIRE_SHAD"; break;
case(12): sTag = "BoxCrate1"; break;
case(13): sTag = "BoxCrate2"; break;
case(14): sTag = "BoxCrate3"; break;
case(15): sTag = "BoxCrate4"; break;
case(16): sTag = "Desk"; break;
case(17): sTag = "SarcophagusEgyptian"; break;
case(18): sTag = "arcophagusEvil"; break;
case(19): sTag = "SarcophagusGood"; break;
}
iCount = 0;
oDest = GetObjectByTag(sTag,iCount);
while (GetIsObjectValid(oDest))
{
iTemp = GetLocalInt(oMod,sTag);
if (iTemp==0)
{
// Update iIndex
iIndex++;
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
SetLocalString(oMod,"INDEX_"+sTemp+IntToString(iIndex),sTag);
SetLocalInt(oMod,sTag,1);
iMaxIndex++;
}
else
{
SetLocalInt(oMod,sTag,iTemp+1);
}
iCount++;oDest = GetObjectByTag(sTag,iCount);
}
}
// Index of Possible Locations Created - Now Scatter the Items into
// these containers.
//
// ** Arcane Books
//
oCChest = GetObjectByTag("ASG_ACCHEST");
if (GetIsObjectValid(oCChest))
{
// Works One Book at a time...
oItem = GetFirstItemInInventory(oCChest);
while (GetIsObjectValid(oItem))
{
iPass = FALSE;
while (iPass == FALSE)
{
iIndex = Random(iMaxIndex)+1;
sBase = "INDEX_";
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
sBase+=sTemp+IntToString(iIndex);
sTemp = GetLocalString(oMod,sBase);
iTemp = GetLocalInt(oMod,sTemp);
iIndex = Random(iTemp)+1;
oDest = GetObjectByTag(sTemp,iIndex);
if (GetIsObjectValid(oDest))
{
iTemp = GetUseableFlag(oDest);
if (iTemp==TRUE)
{
// Attempt to Copy Object to Dest.
oNewItem = CopyObject(oItem,GetLocation(oDest),oDest);
if (GetIsObjectValid(oNewItem))
{
iPass = TRUE;
oArea = GetArea(oDest);
sText = "ASG MICS DEBUG: Placed "+GetName(oItem)+" in Container "+GetName(oDest)+" in Area "+GetName(oArea);
if (DEBUG==TRUE) PrintString(sText); // Print to Log Locations - for debug purpose.
}
}
// If not possible continue in Loop until it is..
}
}
oItem = GetNextItemInInventory(oCChest);
}
}
// ** Divine Books .....
oCChest = GetObjectByTag("ASG_DVCHEST");
if (GetIsObjectValid(oCChest))
{
// Works One Book at a time...
oItem = GetFirstItemInInventory(oCChest);
while (GetIsObjectValid(oItem))
{
iPass = FALSE;
while (iPass == FALSE)
{
iIndex = Random(iMaxIndex)+1;
sBase = "INDEX_";
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
sBase+=sTemp+IntToString(iIndex);
sTemp = GetLocalString(oMod,sBase);
iTemp = GetLocalInt(oMod,sTemp);
iIndex = Random(iTemp)+1;
oDest = GetObjectByTag(sTemp,iIndex);
if (GetIsObjectValid(oDest))
{
iTemp = GetUseableFlag(oDest);
if (iTemp==TRUE)
{
// Attempt to Copy Object to Dest.
oNewItem = CopyObject(oItem,GetLocation(oDest),oDest);
if (GetIsObjectValid(oNewItem))
{
iPass = TRUE;
oArea = GetArea(oDest);
sText = "ASG MICS DEBUG: Placed "+GetName(oItem)+" in Container "+GetName(oDest)+" in Area "+GetName(oArea);
PrintString(sText);
}
}
// If not possible continue in Loop until it is..
}
}
oItem = GetNextItemInInventory(oCChest);
}
}
// Delete Array
for (iK=1;iK<=iMaxIndex;iK++)
{
iIndex = iK;
sBase = "INDEX_";
if (iIndex<100)
{
sTemp = "0";
}
if (iIndex<10)
{
sTemp = "00";
}
sBase+=sTemp+IntToString(iIndex);
sTemp = GetLocalString(oMod,sBase);
DeleteLocalString(oMod,sBase);
DeleteLocalInt(oMod,sTemp);
}
}

View File

@@ -0,0 +1,163 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Build Item Routine
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
script version 1.1 - 12/17/02
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 08/02/02
//:://////////////////////////////////////////////
#include "nw_i0_plot"
void Asg_TakeItems(object oPC,string sREQ,int vNUM)
{
// Take items from player
int vK=1;
string sTag = sREQ;
int vSP = FALSE;
if (sTag=="EXP")
{
vSP=TRUE;
int vPCXP = GetXP(oPC);
int vNEWXP = vPCXP - vNUM;
SetXP(oPC,vNEWXP);
}
if (sTag=="GOLD")
{
vSP=TRUE;
TakeGold(vNUM,oPC,TRUE);
}
if (vSP == FALSE)
{
object oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (vK<=vNUM)
{
sTag=GetTag(oItem);
// DEBUG : SendMessageToPC(GetFirstPC(),"DEBUG: fOUND "+sTag+".");
if (sTag==sREQ)
{
DestroyObject(oItem);
// DEBUG: SendMessageToPC(GetFirstPC(),"DEBUG: fOUND "+sREQ+" # "+IntToString(vNUM));
vK++;
}
}
oItem = GetNextItemInInventory(oPC);
}
// DEBUG: SendMessageToPC(GetFirstPC(),"DEBUG: "+sREQ+" # "+IntToString(vNUM));
}
}
//
void main()
{
object oPC = GetPCSpeaker();
object oItem;
object oCreature;
int vITEMTOBUILD = GetLocalInt(oPC,"ITEMTOBUILD");
int vNUMBERGIVEN = GetLocalInt(oPC,"NUMBERGIVEN");
string sREQ1 = GetLocalString(oPC,"REQ1");
string sREQ2 = GetLocalString(oPC,"REQ2");
string sREQ3 = GetLocalString(oPC,"REQ3");
string sREQ4 = GetLocalString(oPC,"REQ4");
int vNUM1 = GetLocalInt(oPC,"NUM1");
int vNUM2 = GetLocalInt(oPC,"NUM2");
int vNUM3 = GetLocalInt(oPC,"NUM3");
int vNUM4 = GetLocalInt(oPC,"NUM4");
int vPLACE = GetLocalInt(oPC,"PLACE");
string sDIST_WHAT= GetLocalString(oPC,"PLACE");
float vDIST = GetLocalFloat(oPC,"DIST");
object oSummoningPoint = GetNearestObjectByTag(sDIST_WHAT,oPC);
// **
// ** Search and Destroy Componants.
// **
string sBluePrint = GetLocalString(oPC,"BLUEPRINT");
if (vNUM1>=1) Asg_TakeItems(oPC,sREQ1,vNUM1);
if (vNUM2>=1) Asg_TakeItems(oPC,sREQ2,vNUM2);
if (vNUM3>=1) Asg_TakeItems(oPC,sREQ3,vNUM3);
if (vNUM4>=1) Asg_TakeItems(oPC,sREQ4,vNUM4);
// **
// ** Create Item or Placeable at Location or on Person.
// **
switch (vPLACE)
{
case(1):
{
oItem = CreateItemOnObject(sBluePrint,oPC,vNUMBERGIVEN);
}
break;
case(2):
{
oItem = CreateObject(OBJECT_TYPE_PLACEABLE,sBluePrint,GetLocation(oPC),TRUE);
}
break;
case(3):
{
oItem = CreateObject(OBJECT_TYPE_PLACEABLE,sBluePrint,GetLocation(oSummoningPoint),TRUE);
}
break;
case(4):
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE,sBluePrint,GetLocation(oSummoningPoint),TRUE);
}
break;
case(5):
{
oItem = CreateItemOnObject(sBluePrint,oPC,vNUMBERGIVEN);
}
break;
default:
// ActionSpeakString("ERROR: Failure to Create item ["+sBluePrint+"] in asg_rul_bulditem.");
}
if (GetIsObjectValid(oItem))
{
SetLocalObject(oPC,"ASG_SPECIAL_ITEM_CONSTRUCTION_FLAG",oItem);
SetIdentified(oItem,TRUE);
}
// **
// ** Specail Propeties that need to be assigned - assign them here.
// **
string sTag; sTag=GetTag(oItem);
if (sTag=="ASG_BEDROLL")
{
SetLocalInt(oItem,"BEDROLL_CHARGES",50);
}
//
SetLocalObject(oPC,"ASG_SPECIAL_ITEM_CONSTRUCTION_FLAG",oItem);
// ** Clean up old varibles
SetLocalInt(oPC,"ITEMTOBUILD",0);
SetLocalString(oPC,"ITEMNAME","none");
SetLocalString(oPC,"BLUEPRINT","none");
SetLocalInt(oPC,"NUMBERGIVEN",0);
SetLocalString(oPC,"REQ1","empty");
SetLocalString(oPC,"REQ2","empty");
SetLocalString(oPC,"REQ3","empty");
SetLocalString(oPC,"REQ4","empty");
SetLocalInt(oPC,"NUM1",0);
SetLocalInt(oPC,"NUM2",0);
SetLocalInt(oPC,"NUM3",0);
SetLocalInt(oPC,"NUM4",0);
SetLocalInt(oPC,"PLACE",1);
SetLocalString(oPC,"DIST_WHAT","none");
if (GetIsObjectValid(oItem))
{
// Setup it's religon...
string sDName = GetLocalString(oPC,"INGAMEDEITY");
if (sDName=="")
{
sDName="Baccob";
SetLocalString(oPC,"INGAMEDEITY","Baccob");
SetLocalInt(oPC,"GoodEvil",ALIGNMENT_NEUTRAL);
SetLocalInt(oPC,"LawChaos",ALIGNMENT_NEUTRAL);
}
int vGoodEvil = GetLocalInt(oPC,"GoodEvil");
int vLawChaos = GetLocalInt(oPC,"LawChaos");
SetLocalString(oItem,"INGAMEDEITY",sDName);
SetLocalInt(oItem,"GoodEvil",vGoodEvil);
SetLocalInt(oItem,"LawChaos",vLawChaos);
}
}

View File

@@ -0,0 +1,65 @@
#include "nw_i0_plot"
string sBluePrint = GetLocalString(OBJECT_SELF,"ASG_BUILDITEM_BLUEPRINT");
int rMISC_COPYOBJECT = GetLocalInt(GetModule(),"ASG_MICS_COPYOBJECT");
int rMISC_TIME = GetLocalInt(GetModule(),"ASG_MICS_BUILDTIME");
//
void main()
{
object oPC = GetPCSpeaker();
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
if (GetIsObjectValid(oCChest))
{
string sTag;
int iGPTotal = 0;
object oItem = GetFirstItemInInventory(oCChest);
while (GetIsObjectValid(oItem))
{
// if (GetLocalInt(oItem,"ASG_SETTODESTROY")==TRUE)
// {
DelayCommand(0.25,DestroyObject(oItem));
// }
oItem = GetNextItemInInventory(oCChest);
}
}
int iNum = 1;
object oNewItem;
if (rMISC_COPYOBJECT==TRUE)
{
oNewItem = CopyObject(oNewItem,GetLocation(oPC),oPC);
}
else
{
oNewItem = CreateItemOnObject(sBluePrint,oPC,iNum);
// Check to see if worked if not Try & Copy the item..
if (GetIsObjectValid(oNewItem)==FALSE)
{
oNewItem = CopyObject(oNewItem,GetLocation(oPC),oPC);
if (GetIsObjectValid(oNewItem)==FALSE)
{
SendMessageToPC(oPC,"ERROR: Was unable to create item via ResRef & Unable to CopyObject - Please Contact Module Builder.");
return;
}
}
SetIdentified(oNewItem,TRUE);
int iType = GetBaseItemType(oNewItem);
SetIdentified(oNewItem,TRUE);
if (iType == BASE_ITEM_ARROW || iType==BASE_ITEM_BOLT || iType == BASE_ITEM_DART || iType ==BASE_ITEM_BULLET )
{
iNum = 49;
oNewItem = CreateItemOnObject(sBluePrint,oPC,iNum);
SetIdentified(oNewItem,TRUE);
}
}
SetIdentified(oNewItem,TRUE);
ExecuteScript("asg_rul_micscfx",OBJECT_SELF);
if (rMISC_TIME>0)
{
int iNow = (GetCalendarYear()*10000) + (GetCalendarMonth() * 1000) + (GetCalendarDay() * 100) + GetTimeHour();
SetLocalInt(OBJECT_SELF,"ASG_ALTARANVILTIME",iNow+rMISC_TIME);
}
}

View File

@@ -0,0 +1,239 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Build Research
//:: FileName asg_rul_buldresr
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
#include "nw_i0_plot"
#include "asg_include_mics"
object oChest = GetLocalObject(OBJECT_SELF,"ASG_MIC_CHEST");
int GetFocus()
{
int iFmod = 0;
object oFocusLevel = GetNearestObjectByTag("asg_magicfocus_1",OBJECT_SELF);
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;
}
}
}
}
}
// **
return iFmod;
}
string AsgBaseType(object oItem)
{
int iBT = GetBaseItemType(oItem);
string sBaseT = "INVALID";
switch(iBT)
{
case(BASE_ITEM_AMULET): sBaseT = "Amulet";break;
case(BASE_ITEM_ARMOR): sBaseT = "Armor";break;
case(BASE_ITEM_ARROW): sBaseT = "Arrow";break;
case(BASE_ITEM_BASTARDSWORD): sBaseT = "Bastard Sword"; break;
case(BASE_ITEM_BATTLEAXE): sBaseT = "Battleaxe"; break;
case(BASE_ITEM_BELT): sBaseT = "Belt"; break;
case(BASE_ITEM_BOLT): sBaseT = "Bolt"; break;
case(BASE_ITEM_BOOK): sBaseT = "Book"; break;
case(BASE_ITEM_BOOTS): sBaseT = "Boots"; break;
case(BASE_ITEM_BRACER): sBaseT = "Bracer"; break;
case(BASE_ITEM_CLOAK): sBaseT = "Cloak"; break;
case(BASE_ITEM_CLUB): sBaseT = "Club"; break;
case(BASE_ITEM_DAGGER): sBaseT = "Dagger"; break;
case(BASE_ITEM_DART): sBaseT = "Dart";break;
case(BASE_ITEM_DIREMACE): sBaseT = "Dire Mace";break;
case(BASE_ITEM_DOUBLEAXE): sBaseT = "Double Axe";break;
case(BASE_ITEM_GLOVES): sBaseT = "Gloves"; break;
case(BASE_ITEM_GREATAXE): sBaseT = "Greataxe"; break;
case(BASE_ITEM_GREATSWORD): sBaseT = "Greatsword"; break;
case(BASE_ITEM_HALBERD): sBaseT = "Halberd"; break;
case(BASE_ITEM_HANDAXE): sBaseT = "Handaxe"; break;
case(BASE_ITEM_HEALERSKIT): sBaseT = "Healers Kit";break;
case(BASE_ITEM_HEAVYCROSSBOW): sBaseT = "Heavy Crossbow"; break;
case(BASE_ITEM_HEAVYFLAIL): sBaseT = "Heavy Flail"; break;
case(BASE_ITEM_HELMET): sBaseT = "Helmet"; break;
case(BASE_ITEM_KAMA): sBaseT = "Kama"; break;
case(BASE_ITEM_KATANA): sBaseT = "Katana"; break;
case(BASE_ITEM_KUKRI): sBaseT = "Kurkri"; break;
case(BASE_ITEM_LARGEBOX): sBaseT = "Large Box"; break;
case(BASE_ITEM_LARGESHIELD): sBaseT = "Large Sheild"; break;
case(BASE_ITEM_LIGHTCROSSBOW): sBaseT = "Light Crossbow"; break;
case(BASE_ITEM_LIGHTFLAIL): sBaseT = "Light Flail"; break;
case(BASE_ITEM_LIGHTHAMMER): sBaseT = "Light Hammer"; break;
case(BASE_ITEM_LIGHTMACE): sBaseT = "Light Mace"; break;
case(BASE_ITEM_LONGBOW): sBaseT = "Long Bow"; break;
case(BASE_ITEM_LONGSWORD): sBaseT = "Longsword"; break;
case(BASE_ITEM_MAGICROD): sBaseT = "Magic Rod"; break;
case(BASE_ITEM_MAGICSTAFF): sBaseT = "Magic Staff"; break;
case(BASE_ITEM_MAGICWAND): sBaseT = "Magic Wand"; break;
case(BASE_ITEM_MISCLARGE): sBaseT = "Misc Large"; break;
case(BASE_ITEM_MISCMEDIUM): sBaseT = "Misc Medium"; break;
case(BASE_ITEM_MISCSMALL): sBaseT = "Misc Small"; break;
case(BASE_ITEM_MISCTALL): sBaseT = "Misc Tall"; break;
case(BASE_ITEM_MISCWIDE): sBaseT = "Misc Wide"; break;
case(BASE_ITEM_MISCTHIN): sBaseT = "Misc Thin"; break;
case(BASE_ITEM_MORNINGSTAR): sBaseT = "Morningstar"; break;
case(BASE_ITEM_POTIONS): sBaseT = "Potions"; break;
case(BASE_ITEM_QUARTERSTAFF): sBaseT = "Quarter Staff"; break;
case(BASE_ITEM_RAPIER): sBaseT = "Rapier"; break;
case(BASE_ITEM_RING): sBaseT = "Ring"; break;
case(BASE_ITEM_SCIMITAR): sBaseT = "Scimitar"; break;
case(BASE_ITEM_SCROLL): sBaseT = "Scroll"; break;
case(BASE_ITEM_SCYTHE): sBaseT = "Scythe"; break;
case(BASE_ITEM_SHORTBOW): sBaseT = "Short Bow"; break;
case(BASE_ITEM_SHORTSPEAR): sBaseT = "Short Spear"; break;
case(BASE_ITEM_SHORTSWORD): sBaseT = "Short Sword"; break;
case(BASE_ITEM_SHURIKEN): sBaseT = "Shuriken"; break;
case(BASE_ITEM_SICKLE): sBaseT = "Sickle"; break;
case(BASE_ITEM_SLING): sBaseT = "Sling"; break;
case(BASE_ITEM_SMALLSHIELD): sBaseT = "Small Shield";break;
case(BASE_ITEM_SPELLSCROLL): sBaseT = "Spell Scroll";break;
case(BASE_ITEM_THIEVESTOOLS): sBaseT = "Theives Tools";break;
case(BASE_ITEM_THROWINGAXE):sBaseT = "Throwing Axe";break;
case(BASE_ITEM_TORCH):sBaseT = "Torch";break;
case(BASE_ITEM_TOWERSHIELD):sBaseT = "Tower Sheild";break;
case(BASE_ITEM_TRAPKIT):sBaseT = "Trap Kit"; break;
case(BASE_ITEM_TWOBLADEDSWORD): sBaseT = "Two Bladedsword";break;
case(BASE_ITEM_WARHAMMER): sBaseT = "Warhammer"; break;
}
return sBaseT;
}
int StartingConditional()
{
// asgmagicitemdesi
int iResult = FALSE;
float rMatCost = GetLocalFloat(GetModule(),"ASG_MICS_MATERIALCOST");
int iXpCost = GetLocalInt(GetModule(),"ASG_MICS_XPCOST");
object oCChest = GetObjectByTag("ASG_MIC_MIS_COMPONANTS");
object oCCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
int vOption = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION");
int iGPValue;
string sBluePrint = GetLocalString(OBJECT_SELF,"ASG_BLUEPRINT");
string sItemName;
int iBonus = GetLocalInt(OBJECT_SELF,"ASG_MIC_RESEARCHBONUS");
object oPC = GetPCSpeaker();
int iHD;
// Set up Temporay item
string sChestTag = "ASG_TTEMPSTORAGECHEST";
object oChest = GetObjectByTag(sChestTag);
string sArDiv = GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE");
if (sArDiv=="A")
{
iHD = GetHitDice(oPC);
}else
{
iHD = GetHitDice(oPC);
}
int iPass = FALSE;
object oItem;
if (GetIsObjectValid(oChest))
{
oItem = GetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM");
string sText;
if (GetIsObjectValid(oItem))
{
int iMlevel = FindItemLevel(oItem);
int iFmod = GetFocus();
if (iFmod<0) iMlevel = iMlevel + iFmod; else iMlevel = iMlevel - iFmod;
if (iMlevel<0) iMlevel = 1;
int iBT = GetBaseItemType(oItem);
iGPValue = GetGoldPieceValue(oItem);
SetIdentified(oItem,TRUE);
sItemName = GetName(oItem);
int iType = GetBaseItemType(oItem);
// Check for Scrolls and Potions
if (iHD>=iMlevel)
{
iPass = TRUE;
}
string sBaseType = AsgBaseType(oItem);
string sLevel;
float fTemp;
sText = "The books pages detail plans to build a "+sItemName+" by a ";
if (sArDiv == "A") sText = sText + "Arcane"; else sText = sText +"Divine";
sLevel = IntToString(iMlevel);
sText = sText + " caster who has reached level "+sLevel+" in their art.";
fTemp = IntToFloat(iGPValue)*rMatCost;
iGPValue=FloatToInt(fTemp);
string sGold = IntToString(iGPValue);
sText = sText +" The project will require atleast "+sGold+" gold in Magic Powder.";
sText = sText +" The construction will require a "+sBaseType+" along with the Magic Powder.";
int iXPloss = iGPValue/iXpCost;if (iXPloss<1) iXPloss = 1;
string sXPloss = IntToString(iXPloss);
sText = sText +" Estimated Essences (XP) loss should be around "+sXPloss+" Shards of Life.";
}
if (iPass == TRUE) SetCustomToken(197000,sText);
else SendMessageToPC(oPC,"You realise that this project is beyound your current ability.");
ActionSpeakString(GetName(oPC)+" reads the book to himself.");
}
if (iPass == TRUE)
{
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);
if (GetIsObjectValid(oTarget)==FALSE)
{
iPass = FALSE;
FloatingTextStringOnCreature("No Altar or Enchanted Alar.",oPC,FALSE);
}
}
if (iPass==TRUE)
{
iResult = TRUE;
}
return iResult;
}

View File

@@ -0,0 +1,112 @@
#include "nw_i0_plot"
void Asg_TakeItems(object oPC,string sREQ,int vNUM)
{
// Take items from player
TakeNumItems(oPC,sREQ,vNUM);
}
//
void main()
{
object oPC = GetPCSpeaker();
object oItem;
object oCreature;
int vITEMTOBUILD = GetLocalInt(oPC,"ITEMTOBUILD");
int vNUMBERGIVEN = GetLocalInt(oPC,"NUMBERGIVEN");
string sREQ1 = GetLocalString(oPC,"REQ1");
string sREQ2 = GetLocalString(oPC,"REQ2");
string sREQ3 = GetLocalString(oPC,"REQ3");
string sREQ4 = GetLocalString(oPC,"REQ4");
int vNUM1 = GetLocalInt(oPC,"NUM1");
int vNUM2 = GetLocalInt(oPC,"NUM2");
int vNUM3 = GetLocalInt(oPC,"NUM3");
int vNUM4 = GetLocalInt(oPC,"NUM4");
int vPLACE = GetLocalInt(oPC,"PLACE");
string sDIST_WHAT= GetLocalString(oPC,"PLACE");
float vDIST = GetLocalFloat(oPC,"DIST");
object oCChest = GetNearestObjectByTag("ASG_CCHEST",OBJECT_SELF);
effect eEffect;
// **
// ** Search and Destroy Componants.
// **
string sBluePrint = GetLocalString(oPC,"BLUEPRINT");
{
int vK;
for (vK=1;vK<=4;vK++)
{
switch(vK)
{
case(1):
{
if (vNUM1>0) Asg_TakeItems(oPC,sREQ1,vNUM1);
}
break;
case(2):
{
if (vNUM2>0) Asg_TakeItems(oPC,sREQ2,vNUM2);
}
break;
case(3):
{
if (vNUM3>0) Asg_TakeItems(oPC,sREQ3,vNUM3);
}
break;
case(4):
{
if (vNUM4>0) Asg_TakeItems(oPC,sREQ4,vNUM4);
}
break;
}
}
}
// **
// ** Create Item or Placeable at Location or on Person.
// **
switch (vPLACE)
{
case(1):
{
oItem = CreateItemOnObject(sBluePrint,oPC,vNUMBERGIVEN);
}
break;
case(2):
{
oItem = CreateObject(OBJECT_TYPE_PLACEABLE,sBluePrint,GetLocation(oPC),TRUE);
}
break;
case(3):
{
oItem = CreateObject(OBJECT_TYPE_PLACEABLE,sBluePrint,GetLocation(oPC),TRUE);
}
break;
case(4):
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE,sBluePrint,GetLocation(oPC),TRUE);
}
break;
case(5):
{
oItem = CreateItemOnObject(sBluePrint,oPC,vNUMBERGIVEN);
}
break;
case(6):
{
eEffect = EffectVisualEffect(VFX_IMP_FLAME_M,FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oPC,6.0);
}
break;
default:
ActionSpeakString("ERROR: Failure to Create item ["+sBluePrint+"] in asg_rul_bulditem.");
}
// **
// ** Specail Propeties that need to be assigned - assign them here.
// **
switch(vITEMTOBUILD)
{
case(001):
{
SetLocalObject(oPC,"ASG_SUMMONCIRCLE_ATTUNED_TO",OBJECT_SELF);
}
break;
}
}

View File

@@ -0,0 +1,26 @@
void main()
{
int vDestroy = TRUE;
object oItem = GetFirstItemInInventory(OBJECT_SELF);
if (GetIsObjectValid(oItem)) vDestroy=FALSE;
int vTREE = GetLocalInt(OBJECT_SELF,"ASG_TREEDEATH");
if (vDestroy==TRUE)
{
location lLoc = GetLocation(OBJECT_SELF);
int iNow = (GetCalendarMonth()*10000) + (GetCalendarDay()*100) + GetTimeHour();
// specail for trees
if (vTREE==TRUE)
{
string BLUEPRINT = GetLocalString(OBJECT_SELF,"BLUEPRINT");
oItem = CreateObject(OBJECT_TYPE_PLACEABLE,BLUEPRINT,lLoc,TRUE);
SetLocalInt(oItem,"BIRTHEDAT",iNow);
string s2ndBluePrint = GetLocalString(OBJECT_SELF,"2ndBLUEPRINT");
SetLocalString(oItem,"2ndBLUEPRINT",s2ndBluePrint);
DelayCommand(1.0,DestroyObject(OBJECT_SELF));
}
DestroyObject(OBJECT_SELF);
}
}

View File

@@ -0,0 +1,24 @@
// Cleanup FX script for MICS.
void main()
{
object oTarget = OBJECT_SELF;
object oItem = GetLocalObject(oTarget,"ASG_BUILDITEM_ITEM");
object oFour = GetLocalObject(oTarget,"MICS_FX4");
object oThree = GetLocalObject(oTarget,"MICS_FX3");
object oTwo = GetLocalObject(oTarget,"MICS_FX2");
object oOne = GetLocalObject(oTarget,"MICS_FX1");
object oZero = GetLocalObject(oTarget,"MICS_FX0");
if (GetIsObjectValid(oFour)) DestroyObject(oFour);
if (GetIsObjectValid(oThree)) DestroyObject(oThree);
if (GetIsObjectValid(oTwo)) DestroyObject(oTwo);
if (GetIsObjectValid(oOne)) DestroyObject(oOne);
if (GetIsObjectValid(oZero)) DestroyObject(oZero);
if (GetIsObjectValid(oItem)) DeleteLocalObject(oTarget,"ASG_BUILDITEM_ITEM");
PlaySound("as_mg_frstmagic1");
}

View File

@@ -0,0 +1,29 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Open Store
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This is a important script for it handles all of the stores
functions. You must get the full name of the Vender (the
person you are talking to) and the name of the shop he opens.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 06/30/02
//:://////////////////////////////////////////////
void main()
{
object oStore = GetObjectByTag("ASG_DEMOMAGICSUPPLYSHOP");
if (GetIsObjectValid(oStore))
{
OpenStore(oStore, GetLastUsedBy());
}
//
}

View File

@@ -0,0 +1,109 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Open Store
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This is a important script for it handles all of the stores
functions. You must get the full name of the Vender (the
person you are talking to) and the name of the shop he opens.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 06/30/02
//:://////////////////////////////////////////////
/*
void main()
{
object oStore = GetObjectByTag("STORE_TAG_HERE");
if (GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELF)
{
OpenStore(oStore, GetPCSpeaker(), 100);
}
else OpenStore(oStore, GetPCSpeaker());
}
*/
void main()
{
// going to make one script to open ALL stores
// get name of Object (this will be unique to each shop keeper
// compare name and then open store accordingly.
string sNPCname = GetName(OBJECT_SELF);
// DBug code - speak NPC's name on screen.
object oPC = GetPCSpeaker();
ActionSpeakString(sNPCname);
// Got NPC name, then compare and open up the shop
int vSellPrice; // These two are for the BUY & Sell fucntions
int vBuyPrice; //
object oStore; // Store object
object oStore_Watcher; // Ivisible Store Ghost - used to monitor the cash flow.
float vDist;
int vSTORELIMITS = GetLocalInt(GetModule(),"ASGC_STORELIMITS");
// ** Shop Located In South Side.
if (sNPCname =="William" )
{
oStore = GetObjectByTag("MOD_SHOP_WILLIAMSARCANE");
if (GetIsObjectValid(oStore)&& vSTORELIMITS==TRUE)
{
vSellPrice = 0; SetLocalInt(oStore,"SHOP_SELLPRICE",vSellPrice);
vBuyPrice = 35; SetLocalInt(oStore,"SHOP_BUYPRICE",vBuyPrice);
OpenStore(oStore, GetPCSpeaker(),vSellPrice,vBuyPrice);
SetLocalInt(oStore,"SHOP_MAXGOLD",2000);
SetLocalObject(oStore,"StoreOwner",OBJECT_SELF);
// the store ghost collects extra money - spill over from sold items.
}
}
//
// ** Shop Located In South Side.
if (sNPCname =="Beldizar")
{
oStore = GetObjectByTag("MOD_SHOP_BELDIZARGENERALSTORE");
if (GetIsObjectValid(oStore)&& vSTORELIMITS==TRUE)
{
vSellPrice = 40; SetLocalInt(oStore,"SHOP_SELLPRICE",vSellPrice);
vBuyPrice = 40; SetLocalInt(oStore,"SHOP_BUYPRICE",vBuyPrice);
OpenStore(oStore, GetPCSpeaker(),vSellPrice,vBuyPrice);
SetLocalInt(oStore,"SHOP_MAXGOLD",300);
SetLocalObject(oStore,"StoreOwner",OBJECT_SELF);
// the store ghost collects extra money - spill over from sold items.
}
}//MOD_SHOP_BACCOBTEMPLE1
if (sNPCname =="Grathus")
{
oStore = GetObjectByTag("MOD_SHOP_BACCOBTEMPLE1");
if (GetIsObjectValid(oStore)&& vSTORELIMITS==TRUE)
{
vSellPrice = 40; SetLocalInt(oStore,"SHOP_SELLPRICE",vSellPrice);
vBuyPrice = 40; SetLocalInt(oStore,"SHOP_BUYPRICE",vBuyPrice);
OpenStore(oStore, GetPCSpeaker(),vSellPrice,vBuyPrice);
SetLocalInt(oStore,"SHOP_MAXGOLD",500);
SetLocalObject(oStore,"StoreOwner",OBJECT_SELF);
// the store ghost collects extra money - spill over from sold items.
}
}
if (sNPCname =="Vellian")
{
oStore = GetObjectByTag("MOD_SHOP_MASTERBOYWER");
if (GetIsObjectValid(oStore)&& vSTORELIMITS==TRUE)
{
vSellPrice = 40; SetLocalInt(oStore,"SHOP_SELLPRICE",vSellPrice);
vBuyPrice = 40; SetLocalInt(oStore,"SHOP_BUYPRICE",vBuyPrice);
OpenStore(oStore, GetPCSpeaker(),vSellPrice,vBuyPrice);
SetLocalInt(oStore,"SHOP_MAXGOLD",500);
SetLocalObject(oStore,"StoreOwner",OBJECT_SELF);
// the store ghost collects extra money - spill over from sold items.
}
}
if (GetIsObjectValid(oStore))
{
OpenStore(oStore, GetPCSpeaker());
}
//
}

View 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();
}

View File

@@ -0,0 +1,389 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Setup Magic Items
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Used for assembiling magic items Vol 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
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(1000): // The Pandora's Box (unlit).
{
sItem = "Pandora's Box";
sBluePrint = "pandorasbox";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 10; // 1 Units of Magic Powder
// Items required.
sREQ2="NW_IT_CONTAIN001";
vNUM2 = 1;
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 20;
// tells the true/false that there are "x" number of trues
}
break;
// pandorasretuner
case(1001): // Add On (unlit).
{
sItem = "Pandora's Box";
sBluePrint = "pandorasretuner";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 1; // 1 Units of Magic Powder.
// Items required.
sREQ2="ASG_PUZZELBOX";
vNUM2 = 1;
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 20;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(1002): // Add On (unlit).
{
sItem = "Pandora's Stableizer";
sBluePrint = "pandorasstabalis";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 1; // 1 Units of Magic Powder
// Items required.
sREQ2="ASG_PUZZELBOX";
vNUM2 = 1;
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 2;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(1003): // Build Returner (unlit).
{
sItem = "Pandora's Returner";
sBluePrint = "pandorasretuner";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 1; // 1 Units of Magic Powder.
// Items required.
sREQ2="ASG_PUZZELBOX";
vNUM2 = 1;
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 7;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(1004): // Build Locaalizer (unlit).
{
sItem = "Pandora's Localiser";
sBluePrint = "pandorasloclaise";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 1; // 1 Units of Fairy Dust
// Items required.
sREQ2="ASG_PUZZELBOX";
vNUM2 = 1;
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 10;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(1010): // Dhopper
{
sItem = "Dhopper";
sBluePrint = "dhopper001";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 10; // 1 Units of Fairy Dust
// Items required.
sREQ2="ASG_EARTHGEM";
vNUM2 = 1;
//
sREQ3="MetalRod";
vNUM3 = 1;
// Xp Requirement
sREQ4="XP";
vNUM4 = 100;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(1011): // Secyre Shelter
{
sItem = "Secure Shelter";
sBluePrint = "secureshelter";
vPLACE = 1;
// Items Required.
sREQ1="MagicPowder";
vNUM1 = 10; // 1 Units of Fairy Dust
// Items required.
sREQ2="SmallHouseModel";
vNUM2 = 1;
// Xp Requirement
sREQ4="XP";
vNUM4 = 100;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
// ******* Cleric Stuff ****
case(2000): // Potion of Cure Light Wounds (unlit).
{
sItem = "Potion of Cure Light Wounds";
sBluePrint = "nw_it_mpotion001";
vPLACE = 1;
// Items Required.
sREQ1="ASG_HOLYWATER";
vNUM1 = 1; // 1 Units of Fairy Dust
// Items required.
sREQ2="NW_IT_THNMISC001";
vNUM2 = 1; // 1 unit to build club
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 1;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(2001): // Potion of Moderate Light Wounds (unlit).
{
sItem = "Potion of Moderate Wounds";
sBluePrint = "nw_it_mpotion020";
vPLACE = 1;
// Items Required.
sREQ1="ASG_HOLYWATER";
vNUM1 = 2; // 1 Units of Fairy Dust
// Items required.
sREQ2="NW_IT_THNMISC001";
vNUM2 = 1; // 1 unit to build club
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 1;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(2002): // Potion of Serious Wounds (unlit).
{
sItem = "Potion of Serious Wounds";
sBluePrint = "nw_it_mpotion002";
vPLACE = 1;
// Items Required.
sREQ1="ASG_HOLYWATER";
vNUM1 = 3; // 1 Units of Fairy Dust
// Items required.
sREQ2="NW_IT_THNMISC001";
vNUM2 = 1; // 1 unit to build club
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 2;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(2003): // Potion of Critical Wounds (unlit).
{
sItem = "Potion of Critical Wounds";
sBluePrint = "nw_it_mpotion003";
vPLACE = 1;
// Items Required.
sREQ1="ASG_HOLYWATER";
vNUM1 = 4; // 1 Units of Fairy Dust
// Items required.
sREQ2="NW_IT_THNMISC001";
vNUM2 = 1; // 1 unit to build club
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 11;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
break;
case(2004): // Potion of Serious Wounds (unlit).
{
sItem = "Potion of Heal";
sBluePrint = "nw_it_mpotion012";
vPLACE = 1;
// Items Required.
sREQ1="ASG_HOLYWATER";
vNUM1 = 5; // 1 Units of Fairy Dust
// Items required.
sREQ2="NW_IT_THNMISC001";
vNUM2 = 1; // 1 unit to build club
// Items Requried - Last is always XP.
sREQ4="XP";
vNUM4 = 52;
// tells the true/false that there are "x" number of trues pandorasstabalis
}
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(oCChest,sREQ1,vNUM1);
vNEEDED++;
}
if (vTRUE==TRUE) vREQUIRED++;
vTRUE=FALSE;
if (vNUM2>0)
{
vTRUE = asg_REQ1(oCChest,sREQ2,vNUM2);
vNEEDED++;
}
if (vTRUE==TRUE) vREQUIRED++;
vTRUE=FALSE;
if (vNUM3>0)
{
vTRUE = asg_REQ1(oCChest,sREQ3,vNUM3);
vNEEDED++;
}
if (vTRUE==TRUE) vREQUIRED++;
vTRUE=FALSE;
if (vNUM4>0)
{
// Specail
int vXP = GetXP(oPC);
if (vXP>=vNUM4)vTRUE=TRUE;
vNEEDED++;
}
if (vTRUE==TRUE) vREQUIRED++;
vTRUE=FALSE;
}
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;
}

View File

@@ -0,0 +1,927 @@
// 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
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)
{
break;
case(3001): // Chest.
{
sItem = "Wooden Chest";
sBluePrint="chest005";
vPLACE = 2;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 2; // 1 unit to build club
// tells the true/false that there are "x" number of trues
}
break;
case(3002): // Candelobra.
{
sItem = "Candelabra";
sBluePrint="candelabra001";
vPLACE = 2;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1; // 1 unit to build club
// tells the true/false that there are "x" number of trues
// Item #2
sREQ2="CANDEL";
vNUM2=4;
}
break;
case(3003): // Forge.
{
sItem = "Forge/Oven";
sBluePrint="forge";
vPLACE = 2;
// item 2
sREQ2="StoneBlock";
vNUM2 = 4;
// item 3
sREQ3="NW_IT_MMIDMISC06";
vNUM3 = 1;
}
break;
case(3004): // Large Back Pack (Normal).
{
sItem = "Leather Back Pack";
sBluePrint="it_contain007";
vPLACE = 1;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(3005): // Small Torch
{
sItem = "Wooden Torch";
sBluePrint="nw_it_torch001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(3006): // Basic Leather Barbarian outfit.
{
sItem = "Barbarian Outfit";
sBluePrint="nw_cloth015";
vPLACE = 1;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 2;
}
break;
case(3007): // Anvil
{
sItem = "Anvil";
sBluePrint="anvil";
vPLACE = 2;
// Item #1
sREQ1="StoneBlock";
vNUM1 = 2;
}
break;
// ***
// *** Resources
// ***
case(4001): // Iron Ingit
{
sItem = "Iron Ingit";
sBluePrint="ironingit";
vPLACE = 1;
// Item #1
sREQ1="IronOre";
vNUM1 = 10;
}
break;
case(4002): // Empty Bottle
{
sItem = "Empty Bottle";
sBluePrint="it_thnmisc002";
vPLACE = 1;
// Item #1
sREQ1="Glass";
vNUM1 = 1;
}
break;
case(4003): // Unit of Sand
{
sItem = "Bag of Sand";
sBluePrint="sand";
vPLACE = 1;
vNUMBERGIVEN = 5;
// Item #1
sREQ1="StoneBlock";
vNUM1 = 1;
}
break;
case(4004): // Unit of Glass
{
sItem = "Unit of Glasst";
sBluePrint="glass";
vPLACE = 1;
// Item #1
sREQ1="Sand";
vNUM1 = 5;
}
break;
case(4005): // Magic Powder
{
sItem = "Magic Powder";
sBluePrint="magicpowder";
vPLACE = 1;
// Items Required
sREQ1="NW_IT_MSMLMISC19";
vNUM1 = 5;
}
break;
case(4006): // Metal Rod
{
sItem = "Metal Rod";
sBluePrint="metalrod";
vPLACE = 1;
// Items Required
sREQ1="IronIngit";
vNUM1 = 1;
}
break;
// *****
// ** Arms & Armor - Normal
// *****
case(5001): // Daggers
{
sItem = "Dagger";
sBluePrint="nw_wswdg001";
vPLACE = 1;
// Item #1
sREQ1="IronIngit";
vNUM1 = 1;
}
break;
case(5002): // Kama - Exotic
{
sItem = "Kama";
sBluePrint="nw_wspka001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
case(5003): // Shuriken - Exoitic
{
sItem = "Shuriken";
sBluePrint="nw_wthsh001";
vPLACE = 1;
vNUMBERGIVEN = 99;
// Item #1
sREQ1="IronIngit";
vNUM1 = 1;
}
break;
case(5004): // Throwing Hand Axe
{
sItem = "Throwing Axe";
sBluePrint="nw_wthax001";
vPLACE = 1;
vNUMBERGIVEN = 50;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5005): // Lt Crossbow
{
sItem = "Lt. Crossbow";
sBluePrint="nw_wbwxl001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5006): // Darts
{
sItem = "Darts";
sBluePrint="nw_wthdt001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5007): // Hammer, light
{
sItem = "Hammer, Light";
sBluePrint="nw_wblhl001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5008): // Handaxe
{
sItem = "Handaxe";
sBluePrint="nw_waxhn001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5009): // Mace
{
sItem = "Mace";
sBluePrint="nw_wblml001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5010): // Sickle - Exotic
{
sItem = "Sickle";
sBluePrint="nw_wspsc001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5011): // Spear
{
sItem = "Spear";
sBluePrint="nw_wplss001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5012): // ShortSword
{
sItem = "Short Sword";
sBluePrint="nw_wswss001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5013): // Battle Axe
{
sItem = "Battle Axe";
sBluePrint="nw_waxbt001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5014): // Crossbow, Heavy
{
sItem = "Crossbow, Heavy";
sBluePrint="nw_wbwxh001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 2;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5015): // Flail, Light
{
sItem = "Flail, Light";
sBluePrint="nw_wblfl001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5016): // Katana
{
sItem = "Katana";
sBluePrint="nw_wswka001";
vPLACE = 1;
// Item #1
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5017): // LongSword
{
sItem = "Long Sword";
sBluePrint="nw_wswls001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5018): // Morning Star
{
sItem = "Morning Star";
sBluePrint="nw_wblms001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
}
break;
case(5019): // Rapeir
{
sItem = "Rapeir";
sBluePrint="nw_wswrp001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5020): // Warhammer.
{
sItem = "WarHammer";
sBluePrint="nw_wblhw001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5060): // Scimitar.
{
sItem = "Scimitar";
sBluePrint="nw_wswsc001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
// *** Large Weapons
case(5021): // Bastard Sword
{
sItem = "Bastard Sword";
sBluePrint="nw_wswbs001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
case(5022): // Dire Mace.
{
sItem = "Dire Mace";
sBluePrint="nw_wdbma001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 3;
}
break;
case(5023): // Two Bladed.
{
sItem = "Two Bladed";
sBluePrint="nw_wdbsw001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 3;
}
break;
case(5024): // Double Axe.
{
sItem = "Double Axe";
sBluePrint="nw_wdbax001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 4;
}
break;
case(5025): // Flial, Heavy.
{
sItem = "Flail, Heavy";
sBluePrint="nw_wblfh001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 3;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5026): // Great Axe.
{
sItem = "Great Axe";
sBluePrint="nw_waxgr001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 3;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5027): // Greate Sword.
{
sItem = "Great Sword";
sBluePrint="nw_wswgs001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 3;
}
break;
case(5028): // Halbred.
{
sItem = "Halbred";
sBluePrint="nw_wplhb001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 2;
}
break;
case(5029): // LongBow
{
sItem = "Long Bow";
sBluePrint="nw_wbwln001";
vPLACE = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5030): // Scythe
{
sItem = "Scythe";
sBluePrint="nw_wplsc001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5031): // Leahter Armor
{
sItem = "Leather Armor";
sBluePrint="nw_aarcl001";
vPLACE = 1;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 4;
}
break;
case(5032): // Studded Leather
{
sItem = "Studded Leather";
sBluePrint="nw_aarcl002";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 4;
}
break;
case(5033): // Chain Shirt
{
sItem = "Chain Shirt";
sBluePrint="nw_aarcl012";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 5;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5034): // Scale
{
sItem = "Scalemail";
sBluePrint="nw_aarcl003";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 5;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5035): // Chainmail
{
sItem = "Chainmail";
sBluePrint="nw_aarcl004";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 8;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5036): // Breast Plate
{
sItem = "Breast Plate";
sBluePrint="nw_aarcl010";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 8;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5037): // Splintmail
{
sItem = "Splintmail";
sBluePrint="nw_aarcl005";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 9;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5038): // Bandedmail
{
sItem = "Bandedmail";
sBluePrint="nw_aarcl011";
vPLACE = 9;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5039): // Halfplate
{
sItem = "Half Plate";
sBluePrint="nw_aarcl006";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 10;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5040): // Full Plate
{
sItem = "Full Plate";
sBluePrint="nw_aarcl007";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 15;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 1;
}
break;
case(5041): // Large Shield
{
sItem = "Large Sheild";
sBluePrint="nw_ashlw001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5042): // Tower Sheild.
{
sItem = "Tower Shield";
sBluePrint="nw_ashto001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5044): // Helm.
{
sItem = "Helm";
sBluePrint="nw_arhe001";
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5043): // Hide Armor
{
sItem = "Hide Armor";
sBluePrint="nw_aarcl008";
vPLACE = 1;
// Item #1
sREQ1="NW_IT_MMIDMISC06";
vNUM1 = 4;
}
break;
case(5050): // Arrow
{
sItem = "Arrows";
sBluePrint="nw_wamar001";
vNUMBERGIVEN = 99;
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5051): // Bolts
{
sItem = "Bolts";
sBluePrint="nw_wambo001";
vNUMBERGIVEN=99;
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 1;
// Item #1
sREQ1="ASG_FIREWOOD";
vNUM1 = 1;
}
break;
case(5052): // Sling Bullets.
{
sItem = "Sling Bullets";
sBluePrint="nw_wambu001";
vNUMBERGIVEN = 99;
vPLACE = 1;
// Item #2
sREQ2="IronIngit";
vNUM2 = 2;
}
break;
default:;
ActionSpeakString("ERROR in ''asg_rul_testbsel'' script on finding item:"+IntToString(vITEMTOBUILD));
}
vNEEDED=0;
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++;
vTRUE=FALSE;
}
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;
}

View File

@@ -0,0 +1,117 @@
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;
}

View File

@@ -0,0 +1,44 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch: Book in Lecuturn?
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
checks to see if lecturn is within 15m, and if a book is in it.
It does not care wich book at this time.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
#include "nw_i0_plot"
int StartingConditional()
{
int iResult = FALSE;
object oLecturn =GetNearestObjectByTag("ASG_LECTURN");
object oSelf = OBJECT_SELF;
object oPC = GetPCSpeaker();
float fDist = GetDistanceBetween(oLecturn,oSelf);
int vCurrentDay = GetCalendarDay();
int vResearched = GetLocalInt(oPC,"ASG_RESEARCHEDTODAY");
if (fDist <=15.0)
{
object oItem = GetFirstItemInInventory(oLecturn);
if (GetIsObjectValid(oItem))
{
string sTag = GetTag(oItem);
string sLtag = GetStringLeft(sTag,4);
if (sLtag=="BOOK") iResult=TRUE;
}
}
// if (vCurrentDay==vResearched) iResult=FALSE;
// Check for Parchemnt
int vCount = GetNumItems(oPC,"Parchment");
if (vCount<1)
{
iResult=FALSE;
ActionSpeakString("You will need a Peice of Parchment to write your DESIGN down.");
}
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #1 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_01");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #2 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_02");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #3 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_03");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #4 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_04");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #5 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_05");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,19 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch Option #6 Check.
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
int StartingConditional()
{
int iResult = FALSE;
int iResearch = GetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_06");
if (iResearch==TRUE) iResult=TRUE;
return iResult;
}

View File

@@ -0,0 +1,177 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Reaearch: Book in Lecuturn?
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This works with the any Lecturn desigend for research
checks to see if lecturn is within 15m, and if a book is in it.
It does not care wich book at this time.
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
#include "nw_o0_itemmaker"
#include "asg_include_mics"
void main()
{
int iResult = FALSE;
object oLecturn =GetNearestObjectByTag("ASG_LECTURN");
object oSelf = OBJECT_SELF;
object oPC = GetPCSpeaker();
object oItem = GetFirstItemInInventory(oLecturn);
object oChest = GetLocalObject(OBJECT_SELF,"ASG_MIC_CHEST");
// Make sure all old ones have been cleared
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_01",FALSE);
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_02",FALSE);
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_03",FALSE);
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_04",FALSE);
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_05",FALSE);
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_06",FALSE);
// Test to make sure object is valid
// Load Array information
int iMaxArray = GetLocalInt(OBJECT_SELF,"ASG_MIC_TOTALLIST");
string asItemName = "ASG_MIC_ITEMNAME";
string asItemTag = "ASG_MIC_ITEMTAG";
int iContinue = TRUE;
// ** 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;
}
}
}
}
}
// **
if (iContinue==TRUE)
{
int iCurListPoint = GetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT");
if (iCurListPoint<1) iCurListPoint = 0;
int iK = iCurListPoint; if (iK>iMaxArray) iK = iMaxArray;
int iGPValue;
int iSkill_SpellCraft;
int iDC;
int iSlot = 0;
string sSlotBase = "ASG_RESEARCH_OPTION_0";
string sSlotBPBase = "ASG_BLUEPRINT_0";
string sSlot;
string sSlotBP;
string sItemName;
string sItemTag;
int iToken;
int iMlevel;
int iHD;
string sArDiv = GetLocalString(OBJECT_SELF,"ASG_MIC_MAGICTYPE");
if (sArDiv=="A")
{
iHD = GetHitDice(oPC);
}else
{
iHD = GetHitDice(oPC);
}
while (iContinue == TRUE)
{
sItemName = GetLocalArrayString(OBJECT_SELF,asItemName,iK);
sItemTag = GetLocalArrayString(OBJECT_SELF,asItemTag,iK);
object oItem = GetItemPossessedBy(oChest,sItemTag);
if (GetIsObjectValid(oItem))
{
SetIdentified(oItem,TRUE);
iGPValue = GetGoldPieceValue(oItem);
iMlevel = 1;
iMlevel = FindItemLevel(oItem);
if (iFmod<0) iMlevel = iMlevel + iFmod; else iMlevel = iMlevel - iFmod;
if (iMlevel<0) iMlevel = 1;
// FindItemLevel(object oItem)
/*
if (iGPValue>0 && iGPValue<500) iMlevel = 1;
else if (iGPValue>499 && iGPValue<750) iMlevel = 2;
else if (iGPValue>749 && iGPValue<1750) iMlevel = 3;
else if (iGPValue>1749 && iGPValue<2500) iMlevel = 4;
else if (iGPValue>2549 && iGPValue<5000) iMlevel = 5;
else if (iGPValue>4999 && iGPValue<7500) iMlevel = 6;
else if (iGPValue>7499 && iGPValue<10000) iMlevel = 7;
else if (iGPValue>9999 && iGPValue<13500) iMlevel = 8;
else if (iGPValue>13499 && iGPValue<17000) iMlevel = 9;
else if (iGPValue>16999 && iGPValue<20000) iMlevel = 10;
else if (iGPValue>19999)
{
iMlevel = 10+((iGPValue-20000)/8000);
if (iGPValue>99999) iMlevel = iGPValue/5000;
}
*/
iDC = iMlevel;
/*
int iType = GetBaseItemType(oItem);
// Check for Scrolls and Potions
if (iType == BASE_ITEM_POTIONS || iType == BASE_ITEM_SCROLL)
{
iDC = iDC * 3;
}
if (iFmod<0) iDC = iDC + (iFmod*-1);
else
{ iDC = iDC - iFmod; }
*/
iSlot++;
if (iDC<0) iDC = 1;
sSlotBP = sSlotBPBase + IntToString(iSlot);
sSlot = sSlotBase + IntToString(iSlot);
SetLocalInt(OBJECT_SELF,sSlot,TRUE);
SetLocalString(OBJECT_SELF,sSlotBP,sItemTag);
iToken = 197010+iSlot;
SetLocalInt(OBJECT_SELF,"ASG_MIC_ITEMRESEARCHCD_"+IntToString(iSlot)+"_",iDC);
SetLocalObject(OBJECT_SELF,"ASG_MIC_ITEMTOBUILD_ITEM_0"+IntToString(iSlot),oItem);
if (iHD>=iDC)
{
SetCustomToken(iToken,"[B] "+sItemName+" LV ("+IntToString(iDC)+")");
}
else
{
SetCustomToken(iToken,"[X] "+sItemName+" LV ("+IntToString(iDC)+")");
}
}
iK++; if (iSlot>5 || iK>iMaxArray) iContinue = FALSE;
}
SetLocalInt(OBJECT_SELF,"ASG_MIC_CURRENTLISTPOINT",iK);
}
// Send Player Message - Bonus
}

View 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;
}

View File

@@ -0,0 +1,23 @@
//::///////////////////////////////////////////////
//:: Name SetUp Make Magic Powder
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
desined so that I can ready what item to build, it just sucks that
to desinate this a script has to be wrote for each item I want. - err.
This script flags a varible called ITEMTOBUILD on the character. It will
be used for everything for building stuff wise. The next script will be the
inventory check & purchase. (Generic) and the last one will be the placement
or giving of the item.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void main()
{
object oPC = GetPCSpeaker();
SetLocalInt(oPC,"ITEMTOBUILD",4005);
}

View File

@@ -0,0 +1,32 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Research Option Selection # 1
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This Set's the Flag on which option to research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
void main()
{
// tell game that only one is still active, the option we want.
// also clean up old varibles.
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_01");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_02");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_03");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_04");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_05");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_06");
SetLocalString(OBJECT_SELF,"ASG_BLUEPRINT",GetLocalString(OBJECT_SELF,"ASG_BLUEPRINT_01"));
SetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM",GetLocalObject(OBJECT_SELF,"ASG_MIC_ITEMTOBUILD_ITEM_01"));
object oItem = GetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OPTION_01");
if (GetIsObjectValid(oItem))
{
SetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OBJECT",GetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OPTION_01"));
}
DeleteLocalString(OBJECT_SELF,"ASG_BLUEPRINT_01");
}

View File

@@ -0,0 +1,33 @@
//::///////////////////////////////////////////////
//:: Name(ASG_RULE) Research Option Selection # 3
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This Set's the Flag on which option to research
*/
//:://////////////////////////////////////////////
//:: Created By: Donny Wilbanks
//:: Created On: 09/07/02
//:://////////////////////////////////////////////
void main()
{
// tell game that only one is still active, the option we want.
// also clean up old varibles.
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_01");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_02");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_03");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_04");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_05");
DeleteLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION_06");
SetLocalInt(OBJECT_SELF,"ASG_RESEARCH_OPTION",2);
SetLocalString(OBJECT_SELF,"ASG_BLUEPRINT",GetLocalString(OBJECT_SELF,"ASG_BLUEPRINT_02"));
DeleteLocalString(OBJECT_SELF,"ASG_BLUEPRINT_02");
SetLocalObject(OBJECT_SELF,"ASG_BUILDITEM_ITEM",GetLocalObject(OBJECT_SELF,"ASG_MIC_ITEMTOBUILD_ITEM_02"));
object oItem = GetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OPTION_02");
if (GetIsObjectValid(oItem))
{
SetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OBJECT",GetLocalObject(OBJECT_SELF,"ASG_RESEARCH_OPTION_02"));
}
}

Some files were not shown because too many files have changed in this diff Show More