SphereCommunity
About flags... Warmode or Dead. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: About flags... Warmode or Dead. (/Thread-About-flags-Warmode-or-Dead)



About flags... Warmode or Dead. - Jonaleth - 05-27-2015 05:43 AM

Hello again!

I'll go a head a post another question. I'll be using sphereserver 56b and I have encountered a problem that I cannot solve.

I have custom made abilities and custom class/race traits. These particular ones are depending on what state the character is in.

For example, I want mana to regenerate by 1 every 5 seconds, when he is in warmode, and drop 1 every 3 seconds when he isn't.

This is how I tried to solve it;

For some reason, no matter what I do it seems like the character is in warmode at all times. I've tried to reset the flags but it doesn't work.

Also some abilities (which acually are items that they use by dclicking it) shouldn't be able to be used when character is dead.



This one is also not working. Nomatter what it believes I am already dead, by giving me the message; You cannot use this ability when you are dead.

What am I doing wrong?


RE: About flags... Warmode or Dead. - XuN - 05-27-2015 06:34 AM

if (<src.flags> && statf_dead) this means if (src has some flags AND statf_dead), since src will surely have any flag and statf_Dead exists because it's defined in the sphere_defs.scp ... this will be surely return 1 always (This apply to the @Timer too).

what you need is to check if <src.flags> HAS statf_dead INSIDE -> if (<src.flags>&statf_dead), there are differences between one & and two &&, same for = and ==, and so much more operators.


RE: About flags... Warmode or Dead. - Jonaleth - 05-27-2015 06:58 AM

thank you!