Page 1 of 1

Warn Command

Posted: Sun Aug 03, 2008 3:44 am
by runtest
I just thought it would be nice, this if for the Pol96 distro.

Code: Select all

use uo;
use os;

include "include/attributes";

program textcmd_warn( who )	
	var trgt := Target( who );
	var t_health := GetHp(trgt);
	var t_minus := t_health - 1;

	SendSysMessage(who, "Who do you wish to warn?", color := 65);

	//Just for general sillyness.
	if(trgt.Name == "Runtest" || trgt.Name == "The Duke of Yew")
		SendSysMessage(who, "You can not target this!", color := 65);
		SendSysMessage(trgt, trgt.Name + ", you have been targeted for warn.", color := 65);
		return;
	endif

	//Actual effect and reduction.
	SendSysMessage( who, "They have been warned.", color := 65 );
	PlayLightningBoltEffect(trgt);
	PlaySoundEffect( trgt, 0x0207 );
	PlayLightningBoltEffect(trgt);
	PlaySoundEffect( trgt, 0x0207 );
	SendSysMessage( trgt, "YOU ARE BEING WARNED!", color := 480, font := 3 );
	//Leave one hp.
	ApplyRawDamage( trgt, t_minus );
      sleep(2);
      PlayLightningBoltEffect(trgt);
      PlaySoundEffect( trgt, 0x0029 );

endprogram