.freeze & .thaw

Post your Custom Scripts or Packages.

Moderator: POL Developer

Post Reply
kwandobe
New User
Posts: 22
Joined: Wed Dec 17, 2008 10:24 pm

.freeze & .thaw

Post by kwandobe »

I just wrote these because it was annoying typing .setprop frozen 1.

freeze.src

Code: Select all

use uo;
use os;

program freeze(who)

  SendSysMessage(who, "Target the creature or person to render immobile.");
  
  var targ := Target(who, TGTOPT_NOCHECK_LOS );
  
  if(!targ)
  
    SendSysMessage(who, "Cancelled.");
    return;
    
  endif
  
  if(targ.ip)
  
    if(targ.cmdlevel < who.cmdlevel)
    
      targ.frozen := 1;
      SendSysMessage(who, "Player has been frozen!");
      return;
      
    else
    
        SendSysMessage(who, "Player has a higher command level, cannot freeze!");
        return;
        
    endif
    
  elseif(!targ.npctemplate)
  
    SendSysMessage(who, "You cannot freeze an object!");
    return;
    
  else
  
    targ.frozen := 1;
    SendSysMessage(who, "Creature has been frozen!");
    return;
    
  endif

endprogram
&

thaw.src

Code: Select all

use uo;
use os;

program thaw(who)

  SendSysMessage(who, "Target the creature or person to mobilize.");
  
  var targ := Target(who, TGTOPT_NOCHECK_LOS );
  
  if(!targ)
  
    SendSysMessage(who, "Cancelled.");
    return;
    
  endif
  
  if(targ.ip)
  
    if(targ.cmdlevel <= who.cmdlevel)
    
      targ.frozen := 0;
      SendSysMessage(who, "Player has been thawed!");
      return;
      
    else
    
        SendSysMessage(who, "Player has a higher command level, cannot thaw!");
        return;
        
    endif
    
  elseif(!targ.npctemplate)
  
    SendSysMessage(who, "You cannot thaw an object!");
    return;
    
  else
  
    targ.frozen := 0;
    SendSysMessage(who, "Creature has been thawed!");
    return;
    
  endif

endprogram
Post Reply