Status Effect Power

Post Reply
Shinzaku
Posts: 3
Joined: Thu Jul 11, 2013 2:07 pm

Status Effect Power

Post by Shinzaku » Wed Feb 08, 2017 9:47 am

Hey all,

I've been noticing in a lot of the scripts for status effects, there are functions for getPower and getSubpower. I am confused as to where exactly it is pulling these values from in order to modify them.

Could anyone provide a hint? Thanks!

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

Re: Status Effect Power

Post by whasf » Wed Feb 08, 2017 9:49 am

The database. I'm not in front of my machine right now so I can't tell you exactly which table, but you should be able to figure it out by looking at those functions in the core.
-- Whasf

Shinzaku
Posts: 3
Joined: Thu Jul 11, 2013 2:07 pm

Re: Status Effect Power

Post by Shinzaku » Wed Feb 08, 2017 7:20 pm

I'm a little bad with code.
It looks like in the core when it calls setPower to set that value, it's gathering it from a LUA value. However I cannot find any tables of data in the LUA relating to status effect power.

Under the database, there seems to be no columns indicating power or subpower. @_@; I apologize for the ignorance.

Edit: I found that it saves status effects with their current power and subpower under char_effects. Still searching for the origin of the values.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Status Effect Power

Post by TeoTwawki » Wed Feb 08, 2017 9:14 pm

Their origin is whatever a scritp told the effect to get "born" with. The whole point of that existing is so it can be differnet things. It it were always the same we'd just have a static number and never need to "get" it.

Code: Select all

someEntity:addStatusEffect(EffectHere, PowerHere, TickIntervalHere, DurationHere, SubPowerHere, TierHere);

Code: Select all

player:addStatusEffect(EFFECT_STR_BOOST, 12, 0, 60);
I didn't use subpower or tier for that str boost effect. They can be omitted when nto used. Tick however, had to be set. If I just said "12,60" and left out that zero it would error.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Shinzaku
Posts: 3
Joined: Thu Jul 11, 2013 2:07 pm

Re: Status Effect Power

Post by Shinzaku » Wed Feb 08, 2017 9:43 pm

Ah that makes sense.

I'm particularly curious about looking at modifying Dia values to make the def down a little stronger. Looks like the subpower parameter is setting a flag, whereas the tier is the power of the def down.

target:addStatusEffect(EFFECT_DIA,3+dotBonus,3,duration,FLAG_ERASABLE, 15);



Thanks guys! I'll start to figure out more effects and spells from here.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Status Effect Power

Post by TeoTwawki » Wed Feb 08, 2017 10:09 pm

Now I'm wondering where FLAG_ERASABLE gets defined before those scripts use it, because I only see

Code: Select all

EFFECTFLAG_ERASABLE        = 0x0002
in status.lua and status_effect.h
..hmm...
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply