generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
112
_module/nss/b2_act_wfbuybox.nss
Normal file
112
_module/nss/b2_act_wfbuybox.nss
Normal file
@@ -0,0 +1,112 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name (B2) Auction Box
|
||||
//:: FileName
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Ideal:
|
||||
* Okay this is From here the Player Puts the item into the chest to be
|
||||
sold at the auction. There is ONE requirement for this to work. It must be
|
||||
a item that exsits inside the MODULE as the item is destroyed & rebuilt.
|
||||
|
||||
Varibles:
|
||||
|
||||
MaxPR - This is the Maximum price the item can be worth to sell..
|
||||
MinPR - This is the minimum the item should be worht to consider to auction.
|
||||
Set to 0 to sell anything.
|
||||
|
||||
Special Thanks:
|
||||
SpitNyerEye - for the rectreat items in store script witch part of this
|
||||
is made from.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Donny Wilbanks
|
||||
//:: Created On: 10/10/02
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_plot"
|
||||
|
||||
// Auction Buy Config
|
||||
int vMaxPR = 15000000; // Set Your Maxium that can be sold
|
||||
int vMinPR = 500; // Set Your Minimum that can be sold
|
||||
|
||||
void main()
|
||||
{
|
||||
int iResult=FALSE;
|
||||
object oAuctioneer = GetNearestObjectByTag("DMrGAuctioneer");
|
||||
if(GetIsObjectValid(oAuctioneer))
|
||||
{
|
||||
int vAStarted = GetLocalInt(oAuctioneer,"B2_AUCTIONSTATUS");
|
||||
if (vAStarted == TRUE) iResult=TRUE;
|
||||
}
|
||||
if (iResult==FALSE)
|
||||
{
|
||||
object oStore=GetNearestObjectByTag("ASG_CCHEST"); ; // Gets closest merchant store
|
||||
object oPC = GetLastClosedBy();
|
||||
float vGPValue;
|
||||
|
||||
float vModPrice;
|
||||
float vMod = 0.90;
|
||||
float vAMod = 0.35;
|
||||
object oSelf = OBJECT_SELF;
|
||||
effect eSmokePuff = EffectVisualEffect(VFX_FNF_SMOKE_PUFF,FALSE);
|
||||
location lLoc = GetLocation(oSelf);
|
||||
string sTag;
|
||||
string sBluePrint;
|
||||
object oItem = GetFirstItemInInventory(OBJECT_SELF) ; // Gets first item in inventory
|
||||
int vPlot;
|
||||
int vBaseType;
|
||||
int iID = FALSE;
|
||||
while(GetIsObjectValid(oItem)) // while there is a valid item
|
||||
{
|
||||
vPlot = GetPlotFlag(oItem);
|
||||
vBaseType = GetBaseItemType(oItem);
|
||||
iID = FALSE;
|
||||
|
||||
if (vPlot==TRUE)
|
||||
{
|
||||
ActionSpeakString("No arrows, Unique(Plot) Items or any items from Antocks Shop.");
|
||||
}
|
||||
else
|
||||
{
|
||||
iID = GetIdentified(oItem);
|
||||
if (iID==TRUE)
|
||||
{
|
||||
int vGPValue = GetGoldPieceValue(oItem);
|
||||
if (vGPValue>=vMinPR && vGPValue<=vMaxPR)
|
||||
{
|
||||
sTag = GetTag(oItem);
|
||||
sBluePrint = GetStringLowerCase(sTag);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eSmokePuff,lLoc,6.0);
|
||||
DelayCommand(0.25,DestroyObject(oItem,0.0)) ; // destroys item immediately
|
||||
int vNum = GetNumStackedItems(oItem);
|
||||
if (vNum<1) vNum = 1;
|
||||
object oNewItem = CreateItemOnObject(sBluePrint,oStore,vNum) ; // Creates YOUR RESULT ITEM in the merchant store's inventory. If you want to make more than one of the item change the 1 to the desired amount.
|
||||
SetLocalObject(oNewItem,"B2_AuctionOwner",oPC);
|
||||
}
|
||||
else
|
||||
{
|
||||
string sItemName = GetName(oItem);
|
||||
ActionSpeakString ("Can't sell "+sItemName+" not worth or valued at to much to sell.");
|
||||
SendMessageToPC(oPC,"***** Auction ********");
|
||||
SendMessageToPC(oPC,"Min GP: "+IntToString(vMinPR));
|
||||
SendMessageToPC(oPC,"Max GP: "+IntToString(vMinPR));
|
||||
SendMessageToPC(oPC,"***** ******* ********");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString ("A Item, can not be sold untill it has been identified.");
|
||||
}
|
||||
}
|
||||
oItem = GetNextItemInInventory(OBJECT_SELF) ; // and gets next item
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSpeakString("Auction in progress.You must wait till the auction has eneded before adding more items.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user