34 lines
685 B
Plaintext
34 lines
685 B
Plaintext
//Created by Genisys / Guile 5/20/08
|
|
#include "x2_inc_switches"
|
|
void main()
|
|
{
|
|
object oPC;
|
|
oPC = GetPCItemLastEquippedBy();
|
|
object oItem;
|
|
int nSlot;
|
|
|
|
//If not level 20, unequip the item!
|
|
if(GetHitDice(oPC)<=20)
|
|
{
|
|
for (nSlot=0; nSlot<NUM_INVENTORY_SLOTS; nSlot++)
|
|
{
|
|
oItem=GetItemInSlot(nSlot, oPC);
|
|
|
|
if (GetIsObjectValid(oItem))
|
|
{
|
|
//Unequip all items tag named "legend"
|
|
if(GetTag(oItem) == "legend")
|
|
{
|
|
AssignCommand(oPC, ActionUnequipItem(oItem));
|
|
|
|
FloatingTextStringOnCreature
|
|
("You are not level 21 and cannot use this item!", oPC);
|
|
}
|
|
else
|
|
{ }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|