Aller au contenu

Photo

Auto Resurrect *SOLVED... Short of !*


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 651 messages
Maybe the title says nothing, but here is what I want, if it is possible of course.

How can I make a creature like a lich for example, to fall dead, stay dead and lootable for some rounds, but get up if the phylactery is not destroyed, which phylactery will be some of the loot?

Modifié par andysks, 19 novembre 2013 - 09:43 .


#2
Morbane

Morbane
  • Members
  • 1 883 messages
you could make him have the knockdown effect with a paralysis effect to keep him down then - um - maybe in a AOE with only the HB script - remove those effects when the phylactery is destroyed..

just winging it here but maybe some ideas for ya?

#3
andysks

andysks
  • Members
  • 1 651 messages
If I remember correctly the effects have params for duration right? I could add a knockdown and paralysis when he gets to less than a 5% or something, because if he actually dies, the OnDeath fires. I remember using something like that for surrendering, maybe I can modify it somehow. And then when the item is destroyed, I actually kill him, not just remove the effects.
Sounds possible?

#4
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Check 'no permanent death', 'raisable', 'lootable corpse' and a high decay time (>50000) on the lich's properties tab, and then have some other script apply a resurrection effect to him.

The simplest way would be to have a seperate script that resurrects OBJECT_SELF (conditional on the phylactery being intact), and then have the lich's on-death script execute the script on a delay.

For plot reasons, though, I'm sure you'd want to do it differently. First, it seems you want to make sure the PC has a chance to loot the corpse, and then you want the lich to pop back up while the PC is still in the room (if the PC isn't there to see it, it didn't happen). So you might want to call the resurrect script from either a nice piece of loot from the Lich, so that it fires when the PC picks it up, or maybe from the on-exit event from a trigger around the encounter area, so that the lich rises just as the PC is trying to leave.

#5
andysks

andysks
  • Members
  • 1 651 messages
So if I got this right, I could check these properties on the creature. Then put a script on it's OnDeath event, to maybe spawn an ipoint with a heartbeat, which will resurrect it on the 2nd heartbeat or so, and a tag script for the phylactery, to destroy the ipoint when the item is destroyed.
Or if the destruction is occuring through a convo, just a ga_destroy.

#6
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
There is another option.

You could destroy the dead lich and spawn a new one, with some special effects. Then you don't have to worry about using one lich.

The setup would be basically the same (HB and tag scripts, using an iPoint). When a certain amount of turns elapses and the phylactery is not destroyed, you call DestroyObject on the corpse and you spawn a new Lich (I'd probably use a copied blueprint here). You can cause some kind of special effect to play at the same time - a visual effect - so it's a bit more dramatic.

#7
andysks

andysks
  • Members
  • 1 651 messages
But the general thing is that in theory, the HB should work.
Colors, a copied lich, means another blueprint for everytime it dies? What happens if the player doesn't get the pattern and tries to kill him just enough times until you run out of blueprints :D ?
Or I got the meaning wrong about the copied blueprint?

#8
andysks

andysks
  • Members
  • 1 651 messages
Another issue is, I have only heard about these ipoint HBs. I know that a HB is 6 secs in general. But how do you command it to take actions on the 3rd or 4th etc HB from the time it gets spawned?

Is it something like that?

Script starts, you delay the next commands for 6 secs, after that you delay the next, and then you fire what you want?
Or is this nonsense?

Modifié par andysks, 19 novembre 2013 - 06:00 .


#9
ColorsFade

ColorsFade
  • Members
  • 1 270 messages

andysks wrote...

But the general thing is that in theory, the HB should work.


Yes, you need a HB for this since you're wanting him to ressurect after time elapses. Kind of like how Trolls work. I don't know exactly how trolls work in the OC and I haven't looked at their scripts, but if I were going to start somewhere, that might be a place to check. That said, I think you can build this yourself just fine. 

andysks wrote...
Colors, a copied lich, means another blueprint for everytime it dies?


No, just one other copy. I was thinking more about the 2nd copy not having any loot on it, so you don't get duplicate items. But that's going to be an issue, so my whole idea of spawning a 2nd copy is probably a bad one. 

What you probably want to do, instead of spawning a new copy, is do as someone suggested above, and apply ressurrection effect to the creature. He'll pop right back up and any items that didn't get looted should still be on it. Then your party is free to hack away again. 

What I wonder now is... if the creature is dead, does the HB script stil fire? Becuase if it does, then you wouldn't necessarily need an iPoint. Just a HB on the creature. 

I want to try this out now... 

#10
ColorsFade

ColorsFade
  • Members
  • 1 270 messages

andysks wrote...

Another issue is, I have only heard about these ipoint HBs. I know that a HB is 6 secs in general. But how do you command it to take actions on the 3rd or 4th etc HB from the time it gets spawned?

Is it something like that?

Script starts, you delay the next commands for 6 secs, after that you delay the next, and then you fire what you want?
Or is this nonsense?


You do it like this: 

First, you need a couple variables. The first variable is something like IS_DEAD. It's set to false by default. When the creature dies, you set this to TRUE. 

Now, in the HB script, you're constantly monitoring this variable. Once it is true, and you know the lich is dead, then you fetch a second variable. Something like HB_COUNTER. The value of that variable to start defaults to zero. Great. 

HB happens. You fetch that variable and increment it, and then re-store it. Now it's 1. 

A couple more HB turns happen. Same deal. 

Your HB script checks the value of that variable. When it reaches 6? 10? Whatever number you want, when it's greater than that number, the ressurection happens and the creature is alive. 

At that point, you need to reset the IS_DEAD variable to FALSE, and reset the HB_COUNTER to zero. Then it's ready for when he dies again. 

You need one other variable to check: IS_PHYLACTERY_DESTROYED. A tag-based script would set that to TRUE when it is destroyed (or if you're doing a cut-scene, it would be a ga_script). So the HB script is running, right? First variable the HB script checks is the IS_PHYLACTERY_DESTROYED variable. if that's true then the HB script just calls "return" and exits. There's no reason for it to check the counter or the lich death variable. The phylactery is destroyed, we're done. 

#11
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
Well, I just tried this a number of ways and can't get it to work, so best of luck to you Andy.

I tried an iPoint with a HB script. Monitors the variables just fine, but I can't get it to resurrect the creature. And what you're really doing is not a resurrection, but max HP, like this)

ClearAllActions(TRUE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints()),OBJECT_SELF);

I tried that from the iPoint using the dead creature as the target - no luck.

So, I tried Lugaid's suggestion of using a delay on the DeathScript. That didn't work either.

So... I'm not sure what the secret is. There has to be a way to do it though.

Maybe spawning a copy will be the easiest way after all....

#12
andysks

andysks
  • Members
  • 1 651 messages
I'll try to do the copy later today, and let you know how it went. Thanks for testing this, today didnt have much time to work on the toolset :).

#13
PJ156

PJ156
  • Members
  • 2 985 messages
Why not just let the dead lich be dead. If the phylactery is not destroyed within the time set when the lich dies (on death script) then destroy the corpse and spawn a new blueprint with the same on death script as lich no 1.

PJ

#14
andysks

andysks
  • Members
  • 1 651 messages
Is an option as well of course. Only the second one shouldn't have a phylactery, IF the first one got looted. This is one of the problem with spawning a new one and not using the same. I am looking now at some troll scripts and akachi to see if I can trace something.

#15
andysks

andysks
  • Members
  • 1 651 messages
Forget the thing about Akachi. The MotB scripts are so complicated for me, what with the spirit eater etc. I haven't played the IWD version for NNW2, but I guess they did Terikan properly. Maybe I take a look over there to see the method.

#16
andysks

andysks
  • Members
  • 1 651 messages
Well, I think I got the method they use for Terikan in IWD.
They actually don't let the Lich die at all. They just have his phylactery stored on another spot, and the creature is plot, and get's destroyed through a convo.
Doable.

I think my thought was a bit more sophisticated,
Actually both ways are not totally lore correct. Correct is that the Lich appears again after 1d10 days after it's apparent destruction. So if it was killed in my case, it shouldn't come back immediately, and in the other case it shouldn't be plot.
But hey, we can sacrifice some lore for the purpose :).

Does anyone know how I can ask the people who made IWD for a modification/borrowing of this script? slowdive_fan in particular.

#17
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
Yeah, the problem is, if the phylactery is actually ON the lich, then there's the issue... That makes it complicated.

I think, what I would do is this:

Two blueprints for the lich. One with the phylactery, one without. The one WITH the phylactery is the one that gets spawned first.

An iPoint with a HB script.

A tag-based script for the phylactery that triggers when you acquire it.

So the lich dies. You can prevent the corpse from rotting. No problem. It will stay there even after it's looted if it's decay is set long enough.

Nothing happens until the phylactery is looted.

The second the phylactery is looted, it's on-acquire tag-based script fires. That script sets a variable to TRUE (put it on the PC or the iPoint, either way).

The HB script reads this variable. As soon as it's true, the HB starts its counter.

If the phylactery isn't destroyed in a certain amount of time, the HB script destroys the corpse and spawns the 2nd version of the lich. This version is identical except it has no phylactery on it. It can be killed and respawned as many times as necessary.

The HB script only ever spawns the duplicate blueprint, never the original lich, so there's no issue there with it's tag being different. You have lich and lich2 or whatever your naming convention is.

It's fairly clean. Nothing happens until the phylactery is looted, so you're good there.

The only question is how you're going to handle "destroying" the phylactery, which I assume you'll do in a cut-scene. When that happens, another flag has to be set that the HB script can read, so it doesn't spawn the duplicate lich once the phylactery is destroyed.

#18
andysks

andysks
  • Members
  • 1 651 messages
Actually I don't need any script. It will happen through convo, so I can just have the Lich immortal and the phylactery stored in some other location, ga_destroying it from the convo afterwards.

Case closed. I will probably continue researching the method I was initially searching, for resurrecting enemies can make interesting encounters. But for now, this will do.