46 lines
967 B
Plaintext
46 lines
967 B
Plaintext
object oItem;
|
|
|
|
//Created by Guile 3/27/07
|
|
//This script strips the pc of all shards should they be trying to reloot!
|
|
//Put this script OnUsed of an altar or placable
|
|
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetLastUsedBy();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
|
|
|
|
if (DoOnce==TRUE) return;
|
|
|
|
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
|
|
|
|
if (GetItemPossessedBy(oPC, "thecrystalshard")!= OBJECT_INVALID)
|
|
{
|
|
oItem = GetFirstItemInInventory(oPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="thecrystalshard") DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
|
|
FloatingTextStringOnCreature("Your Crystal Shard has turned to dust!!!!!", oPC);
|
|
|
|
}
|
|
else
|
|
{
|
|
if (GetItemPossessedBy(oPC, "thecrystalshard")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("thecrystalshard", oPC);
|
|
|
|
FloatingTextStringOnCreature("You have found an ancient artifact!!!", oPC);
|
|
|
|
}
|
|
}
|
|
|
|
}
|