Res?

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.
Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Res?

Post by Poi »

Hey i was wondering a few things:

1. For resing a character, would i use res.src or res.inc?

2. How would i change either res.src(modified):

Code: Select all

use uo;
use os;

include "include/res2";
include "include/resPenalty";
include "include/client";

program res(who, mobile)
 if((mobile.dead) && (CheckLineOfSight(who, mobile)))
    set_critical(1);
  	if(GetObjProperty(mobile, "#ResMenu"))
  	  return;
  	endif
	SetObjProperty(mobile, "#ResMenu", 1);
	set_critical(0);
	if(ResNow(mobile)==1)
      Resurrect(mobile);
      ResPenalties(mobile);
    endif
    EraseObjProperty(mobile, "#ResMenu");
   endif
endprogram
to something that when it res's them they get everything that was on theyre body back onto them(If they are standing on it)


OR
res2.inc(modified):

Code: Select all

use uo;
function ResNow(who)
  var x := who.x;
  var y := who.y;
  var z := who.z;
  if(MoveCharacterToLocation(who, x, y, z, MOVECHAR_FORCELOCATION))
    return ret[0];
  else
    return 0;
  endif
endfunction
To the same thing i asked above
Shinigami
Former Developer
Posts: 308
Joined: Mon Jan 30, 2006 9:28 am

Post by Shinigami »

there is one function only u need:

Code: Select all

Resurrect(mobile);
Shinigami
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

No shit, to res. It does not put all thr tiems on they're body abck on them.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

Code: Select all

foreach item in ListRootItemsInContainer( corpse )
	if( !EquipItem( ghost, item ) )
		MoveItemToContainer( item, ghost.backpack );
	endif
endforeach
This is only a snippet of what you will need but will cover everything that is on the corpse and if possible equip it on the resurrected player.

The function ListRootItemsInContainer is this.

Code: Select all

//returns all the 'top-level' items in container
function ListRootItemsInContainer (byref container)

	var ret := { };
        foreach item in enumerateitemsincontainer(container)
		if ( item.container == container )
			ret.append(item);
		endif
	endforeach

	return ret;

endfunction
This function will not search bags or chests the player had on them. It only returns things that are in the main pack.

Hope it helps some.
Post Reply