Newbie (blessed) items problem on player death

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Newbie (blessed) items problem on player death

Post by Ciechu » Fri Nov 30, 2018 8:13 am

Hi,

If player move newbie item (for example robe), to main backpack and die, It will be no problem - after ressurect this robe still will be in backpack, BUT

If player move this robe to another container (example bag in main backpack), these robe is in corpse after player die.

Can you help me for script a function that every newbie items move to main backpack after character die?

I know how to do it, but my script need optimalization..

Thank you, Ciechu
"Live Fast, Die Fast"
- GG Allin

guialtran
Grandmaster Poster
Posts: 112
Joined: Wed Jul 30, 2008 12:42 pm

Re: Newbie (blessed) items problem on player death

Post by guialtran » Fri Nov 30, 2018 9:22 am

misc/chrdeath.src

Code: Select all

program chrdeath(corpse,ghost)
	var backpack := ghost.backpack;
	MoveNewbieItemsFromTheBodyToBackpack(corpse,backpack);
endprogram

function MoveNewbieItemsFromTheBodyToBackpack(corpse,backpack)
	foreach item in (EnumerateItemsInContainer(corpse))
		SleepMS(10);
		if(item.newbie)
			MoveItemToContainer( item, backpack );
		endif
	endforeach
endfunction
You'll have to be careful.
if the player has backpacks of newbie items :deadhorse:
you'll have to get around this problem by creating backpacks and moving the newbie items in.
@CronosKing
Image ZuluHotel Forgotten Realms
www.zuluhotel.com.br

User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Re: Newbie (blessed) items problem on player death

Post by Ciechu » Fri Nov 30, 2018 11:33 am

Ok, thank you.

That is what I wrote also. I think there was anything better than foreach.

Thank you!
"Live Fast, Die Fast"
- GG Allin

Post Reply