Page 1 of 1

Make effects persist through death?

Posted: Fri Dec 09, 2016 8:20 am
by Brierre
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?

Re: Make effects persist through death?

Posted: Fri Dec 09, 2016 9:12 am
by whasf
You just named two things that do, perhaps look to see how those work? :)

Re: Make effects persist through death?

Posted: Fri Dec 09, 2016 1:02 pm
by demolish
https://github.com/DarkstarProject/dark ... s_effect.h
unset the flags in status_effects table

Re: Make effects persist through death?

Posted: Fri Dec 09, 2016 4:19 pm
by Avatarati
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.

Re: Make effects persist through death?

Posted: Fri Dec 09, 2016 4:26 pm
by Avatarati
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

Re: Make effects persist through death?

Posted: Mon Dec 12, 2016 9:16 pm
by Brierre
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 :)