Initial upload
Initial upload
This commit is contained in:
76
_module/nss/trashem.nss
Normal file
76
_module/nss/trashem.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
//This script completely prevents lagg in many ways and prevents duping exploits
|
||||
//PROTOTYPE
|
||||
int GetTrueValue(object oItem)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
//Get the state of the item before altering
|
||||
int n = GetIdentified(oItem);
|
||||
|
||||
if(n==FALSE)
|
||||
{ SetIdentified(oItem, TRUE); }
|
||||
|
||||
i = GetGoldPieceValue(oItem);
|
||||
|
||||
SetIdentified(oItem, n);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = (GetModuleItemLostBy());
|
||||
object oItem = (GetModuleItemLost());
|
||||
object oArea = GetArea(oItem);
|
||||
int nType = GetBaseItemType(oItem);
|
||||
|
||||
//Give gold for plot items too
|
||||
SetPlotFlag(oItem, FALSE);
|
||||
|
||||
int n = GetTrueValue(oItem);
|
||||
int b, c;
|
||||
int nGP;
|
||||
|
||||
if(n>=100)
|
||||
{
|
||||
b = n/100;
|
||||
c = b * 50; //The % used..
|
||||
nGP = c;
|
||||
}
|
||||
else
|
||||
{ nGP = 500; }
|
||||
|
||||
//Do not purchase ammunition!
|
||||
if(nType == BASE_ITEM_ARROW || nType == BASE_ITEM_BOLT ||
|
||||
nType == BASE_ITEM_BULLET || nType == BASE_ITEM_DART ||
|
||||
nType == BASE_ITEM_SHURIKEN || nType == BASE_ITEM_THROWINGAXE)
|
||||
{ nGP = 500; }
|
||||
else
|
||||
{
|
||||
//cap the gold @ 400,000 Gold
|
||||
if(nGP >=400000)
|
||||
{ nGP = 400000; }
|
||||
}
|
||||
|
||||
if (!GetIsPC(oPC))
|
||||
return;//so that npc dropped items won't be destroyed.
|
||||
{
|
||||
if (oArea != GetArea(oPC))
|
||||
return;
|
||||
|
||||
if (GetIsInCombat(oPC))
|
||||
return;
|
||||
|
||||
if (oItem != OBJECT_INVALID)
|
||||
{
|
||||
|
||||
GiveGoldToCreature(oPC, nGP);
|
||||
DestroyObject(oItem);
|
||||
FloatingTextStringOnCreature("The item you dropped was destroyed!!!", oPC);
|
||||
DelayCommand(1.2, FloatingTextStringOnCreature
|
||||
(IntToString(nGP) + " - Gold (50%) was given to you for the item!!", oPC));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user