35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
// Script for the XP-rod - It allows DMs to deal out a small amount of XP
|
|
// to the target player
|
|
// 4th of August 2005, Alangara, made by -Seeker-
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetItemActivator();
|
|
object oRod = GetItemActivated();
|
|
if (GetIsDM(oPC) || GetIsDMPossessed(oPC))
|
|
{
|
|
object oTarget = GetItemActivatedTarget();
|
|
|
|
if ( oTarget == OBJECT_INVALID || !GetIsPC( oTarget ))
|
|
{
|
|
FloatingTextStringOnCreature( "This rod can only target PCs", oPC, FALSE );
|
|
}
|
|
else
|
|
{
|
|
DeleteLocalInt( oPC, "MN_GRANTXP" );
|
|
SetLocalObject( oPC, "MN_XPTARGET", oTarget );
|
|
|
|
AssignCommand(oPC, ClearAllActions());
|
|
AssignCommand(oPC, ActionStartConversation(OBJECT_SELF, "mn_conv_xpwand", TRUE, FALSE));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
string PCname = GetName( oPC );
|
|
SendMessageToAllDMs( "Player "+PCname+" has attempted to activate XP-rod!" );
|
|
FloatingTextStringOnCreature( "Only DMs can use the XP-rod!", oPC, FALSE );
|
|
SetPlotFlag( oRod, FALSE );
|
|
DestroyObject( oRod );
|
|
}
|
|
}
|