34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
// rts_it_pmag1
|
|
// Talisman of Changing
|
|
void main()
|
|
{
|
|
object oPC=GetItemActivator();
|
|
object oItem=GetItemActivatedTarget();
|
|
object oNew;
|
|
object oHeld;
|
|
effect eBeam=EffectBeam(VFX_BEAM_BLACK,oPC,BODY_NODE_HAND);
|
|
if (GetObjectType(oItem)==OBJECT_TYPE_ITEM)
|
|
{ // valid target
|
|
oHeld=GetItemPossessor(oItem);
|
|
if (oHeld==oPC)
|
|
{ // PC did it to an item in their inventory
|
|
oNew=CopyObject(oItem,GetLocation(oPC),oPC,"rts_it_imag");
|
|
SetPlotFlag(oNew,TRUE);
|
|
DestroyObject(oItem);
|
|
SendMessageToPC(oPC,"The item has been changed.");
|
|
} // PC did it to an item in their inventory
|
|
else
|
|
{ // PC did it to an item on the ground
|
|
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eBeam,GetLocation(oItem),3.0);
|
|
oNew=CopyObject(oItem,GetLocation(oItem),OBJECT_INVALID,"rts_it_imag");
|
|
SetPlotFlag(oNew,TRUE);
|
|
DestroyObject(oItem);
|
|
SendMessageToPC(oPC,"The item has been changed.");
|
|
} // pc did it to an item on the ground
|
|
} // valid target
|
|
else
|
|
{
|
|
SendMessageToPC(oPC,"Some of the power of the talisman is wasted. That was not a valid target.");
|
|
}
|
|
}
|