im new can some1 help please
Posted: Thu May 04, 2006 4:01 pm
Ya im kinda new at this.. and i dont know how to me a .heal me script.. that like clicks the bandies and targets you.. automaticly Can somebody help me? :?
https://www.forums.polserver.com/
Code: Select all
use uo;
use os;
include "/scripts/include/attributes";
program healme(who)
//sets the player's (who's) HP to the maximum he can have
SetHp( who,GetMaxHp( who ));
//feedback for the player:
Sendsysmessage(who,"you've been healed");
endprogram
Code: Select all
const VITALID_LIFE := "Life";
function GetMaxHp( who )
return GetVitalMaximumValue( who, VITALID_LIFE ) / 100;
endfunction
function SetHp( who, hp )
return SetVital( who, VITALID_LIFE, hp * 100 ) && RecalcVitals( who );
endfunction
Umm.. all respect, and all, Firedancer, but the original poster's question was:Firedancer wrote:I agree with Yukiko... and maybe someone might want to answer this real simple question? Just one line of code after all!
kylee wrote:a .heal me script.. that like clicks the bandies and targets you.. automaticly
Hmm maybe I understood him wrong, but does this not mean, that he wants a .command that does the same as some bandages applied to himself would do? Ahh ok, maybe he wants it to consume bandages from the players backpack then....Marilla wrote: Umm.. all respect, and all, Firedancer, but the original poster's question was:
kylee wrote:a .heal me script.. that like clicks the bandies and targets you.. automaticly
Code: Select all
use uo;
use os;
include "/scripts/include/attributes";
const BANDAGE_OBJTYPE:=0xe20;
const HP_HEALED_BY_BANDAGES:=25;
program healme(who)
//look for bandages -> search backpack
foreach item in (EnumerateItemsInContainer( who.backpack))
//is it a bandage?
if(item.objtype==BANDAGE_OBJTYPE);
//yes? -> consume one
if(item.amount>1)
SubtractAmount(item,1);
else
destroyitem(item);
endif
//now heal the player
if((GetHP(who)+HP_HEALED_BY_BANDAGES)>GetMaxHp( who ))
SetHp( who,GetMaxHp( who ));
else
SetHP(who,GetHP(who)+HP_HEALED_BY_BANDAGES);
endif
//report success
Sendsysmessage(who,"you've been healed");
return; //healed & done -> abort script
endif
endforeach
//---------------------------------------
//still here? then no bandages were found!
Sendsysmessage(who,"you donot have any bandages");
endprogram
Code: Select all
const VITALID_LIFE := "Life";
function GetMaxHp( who )
return GetVitalMaximumValue( who, VITALID_LIFE ) / 100;
endfunction
function GetHp( who )
return GetVital( who, VITALID_LIFE ) / 100;
endfunction
function SetHp( who, hp )
return SetVital( who, VITALID_LIFE, hp * 100 ) && RecalcVitals( who );
endfunction