Make effects persist through death?

Post Reply
Brierre
Posts: 20
Joined: Mon Jul 18, 2016 7:36 pm

Make effects persist through death?

Post by Brierre » Fri Dec 09, 2016 8:20 am

I'm trying to make an effect that does not normally persist through death (similar to dedication and reraise) do exactly that. Can anyone please help me out with how and where I'd do that?

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Make effects persist through death?

Post by whasf » Fri Dec 09, 2016 9:12 am

You just named two things that do, perhaps look to see how those work? :)
-- Whasf

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Make effects persist through death?

Post by demolish » Fri Dec 09, 2016 1:02 pm

https://github.com/DarkstarProject/dark ... s_effect.h
unset the flags in status_effects table
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Avatarati
Posts: 53
Joined: Mon Jun 30, 2014 2:51 pm

Re: Make effects persist through death?

Post by Avatarati » Fri Dec 09, 2016 4:19 pm

I made a custom quest that had players retrieve something in a time limit with all sorts of status effects applied. Just added various conditions to each individual status effect lua file. This way, it persisted through death, zone, you name it, as long as variable for quest was true and timer remained. Even disabled manual removal via spell/item.

Can get pretty creative with many other things as well.

Avatarati
Posts: 53
Joined: Mon Jun 30, 2014 2:51 pm

Re: Make effects persist through death?

Post by Avatarati » Fri Dec 09, 2016 4:26 pm

Found an example:

Keep in mind, this is specific to my quest. I add Confrontation to the player and use that as a control check for my reapplication of poison. In your case, you'd use a different method.

File Location: scripts/globals/effects

Code: Select all

-----------------------------------
--
--     EFFECT_POISON
--
-----------------------------------

require("scripts/globals/status")

-----------------------------------
-- onEffectGain Action
-----------------------------------

function onEffectGain(target,effect)
    target:addMod(MOD_REGEN_DOWN, effect:getPower())
end

-----------------------------------
-- onEffectTick Action
-----------------------------------

function onEffectTick(target,effect)
end


-----------------------------------
-- onEffectLose Action
-----------------------------------

function onEffectLose(target,effect)

	target:delMod(MOD_REGEN_DOWN, effect:getPower())
	
	local status = player:getVar("Quest_Cure_Ails_You")

	if (status >= 8 and status <= 16) then
		local timeRemain = player:remainingEffect(EFFECT_CONFRONTATION)
		if (timeRemain > 0) then
			player:addStatusEffect(EFFECT_POISON,3,0,timeRemain)
		end
	end
	
end

Brierre
Posts: 20
Joined: Mon Jul 18, 2016 7:36 pm

Re: Make effects persist through death?

Post by Brierre » Mon Dec 12, 2016 9:16 pm

whasf wrote:You just named two things that do, perhaps look to see how those work? :)

I did have them both open and was looking, for the record!!!

The flag in the sql file is what I needed. Thanks guys :)

Post Reply