healing crystal effect in an item

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

healing crystal effect in an item

Post by bongobeat »

Good evening,

is that possible to script an item that resurrect (like the healing crystal) but only for one champion?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: healing crystal effect in an item

Post by Isaac »

bongobeat wrote:Good evening,

is that possible to script an item that resurrect (like the healing crystal) but only for one champion?
Yes.

There is such an item in my ORRR2 room for those that discovered it.
(Not many did I bet. :| )
But that item is not exactly what you mean, or would want really.

I seem to recall crafting a healing spell a while ago...
(Can't find it just yet though... I will update this post when I do.)

*Update: Found it... but it's not polished work.

https://www.dropbox.com/s/z7zja9mw8jv3m ... _Alpha.avi

Code: Select all

defineSpell{
name = "resurrect_spell",
uiName = "Holy Resurrect Spell",
skill =  "fire_magic", --"earth_magic",  --{changed for simplicity sake; would change it back later.}
level = 1, --25,
runes = "ABCD",
manaCost = 1, --150,
onCast = function (champion, spell)
	setMouseItem(spawn('healing_hand'))
	hudPrint(champion:getName().." Pulls magic arcane forces to resurrect the dead.")
	end,
}

defineObject{
	name = 'healing_hand',
	class = 'Item',
	model = 'mod_assets/models/empty.fbx',
	gfxAtlas = "mod_assets/textures/gui/healing_hand.tga",
	gfxIndex = 1,
	stackable = false,
	weight = 0.1,
	uiName = "Click on a party member\nto resurrect them to full health",
	throwingWeapon = false,
	onUnequipItem = function()setMouseItem()end,
	onEquipItem = function (champion,slot)
						champion:removeItem(slot)
						--{this loop is to destroy these items just in case the player dropped them on the ground.}
						for instance in allEntities(getMaxLevels()) do
						if instance.name == 'healing_hand' then
						instance:destroy()
						end
					end
					if not champion:isAlive() then
						spawn("fx", party.level, party.x, party.y, party.facing, "fade")
						fade:translate(0, 1.5, 0)
						fade:setParticleSystem("fade_white_spell")
						playSound("vocal_harmony")
						champion:setStat("health", champion:getStatMax('health'))
						champion:setCondition("shock_shield", 5)  --{This is useless to them, but gives a visible 'healing' effect}
						else hudPrint('The spell fizzles, '..champion:getName()..' is already alive!' )
					end
					return false
					end,
	}
This spell is flawed; it needs work before being used in a mod, but it does show how it works.
This was a spell, but it uses a temporary object. This could be re-made into a talisman or something. When placed in the hand, it resurrects the corpse.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: healing crystal effect in an item

Post by bongobeat »

this is great! thanks :)

I ve tried some but was not successful. Can this item be used as drinking potion? Or even be stored in inventory?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: healing crystal effect in an item

Post by Isaac »

bongobeat wrote:this is great! thanks :)

I ve tried some but was not successful. Can this item be used as drinking potion? Or even be stored in inventory?
I think that it could be made into a charm of some kind... I don't think that you can right-click items in a corpse' inventory. I know that in 'Eye of the Beholder' (for instance), potions would [logically] only work on conscious characters; it makes sense; a potion is not something a dead body would drink.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: healing crystal effect in an item

Post by bongobeat »

well it's ok
I wanted one item that resurrect a champion, now I got a spell and the item, it's perfect.
the problem with the item (crafted in a mortar), can't be stored in the inventory because it is used when it is put in the hands, or the inventory, except if you put it in a bag or chest.

I will add some description that it can't be stored and has to be used directly or lost, and that will be fine :)
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: healing crystal effect in an item

Post by Isaac »

bongobeat wrote:well it's ok
I wanted one item that resurrect a champion, now I got a spell and the item, it's perfect.
the problem with the item (crafted in a mortar), can't be stored in the inventory because it is used when it is put in the hands, or the inventory, except if you put it in a bag or chest.

I will add some description that it can't be stored and has to be used directly or lost, and that will be fine :)
It's not perfect. The spell does not yet account for clicking on the PC's portrait; doing so puts the hand in the inventory ~not what's intended. The better thing to do is convert the hand to a magic object that resurrects when placed in the hand of a corpse... Perhaps make it an item with charges. The spell is really only half-baked as it is currently.
Post Reply