SphereCommunity

Full Version: Added: support for some human/elf racial traits
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Added: support for some human/elf racial traits (only used if FeatureML is enabled on sphere.ini)

Now elfs have +20mana, i would like to remove this features keeping FeatureML enabled, how can i?
[Function f_onchar_create]
if (<argn3>==2)
MaxMana -=20
endif
But in this way if I buff myself (s_bless or other spells), INT will raise but MANA will not follow the INT value.
Then remove the '-=20'. When reseted to NULL, all stats follow 'default' rules.

EDIT:
Anyway there is a workaround if you want to keep this change, or made some other similars: Any stat changes will fire @Statchange so you can 'catch' the gains and losses from str,dex and int and 'transfer' them to their respective secondary stats:

Code:
ON=@StatChange
if (<argn1>< 3) //Str = 0, Int = 1, Dex = 2
local.gain=<eval <argn3>-<argn2>> // Gain is the difference between argn3 (new value) and argn2 (current value)
doswitch <argn1> // so we 'transfer' here the values to their respective secondary stats.
  MaxHits =<eval <MaxHits>+<local.gain>>// I use this method instead of MaxHits +=<local.gain> because of possible negative values (losses), sphere won't interpret 'MaxHits +=-15' for example.
  MaxMana = <eval <MaxMana>+<local.gain>>
  MaxStam = <eval <MaxStam>+<local.gain>>
enddo
endif
Thx for the code , I will try to use it.
Anyway I think FEATURE_ML_racetraits should be something to add in the sphere.ini to choose if enable this features or not.
Otherwise everyone that are using now race needs to use code to stop cancel this feature (you cannot set maxmana to 0 to remove the effect, you have to set at -20...).
I've checked it in the source and this is working if FeatureML has 01 value in the ini (so the code I posted here won't make this change), just disable this feature in the ini and you are done Smile
(05-07-2015 10:26 PM)XuN Wrote: [ -> ]I've checked it in the source and this is working if FeatureML has 01 value in the ini (so the code I posted here won't make this change), just disable this feature in the ini and you are done Smile

Mmm but if I disable that option will I disable something else?
The elf character creation Tongue ( u can still choose the elf body in the character creation, but you can't go to the next section)
I would like to keep that elf creation bcuz I use.

Even:
Added weight tooltip on all movable items if FEATURE_ML_UPDATE feature is enabled on sphere.ini (although it's not a ML feature, OSI started using this tooltip only on ML)


I think would be better have an option in the .ini for this:
22-11-2014, Coruja
- Added: Wisdom racial trait on elves (they always have +20 max mana). It works only if FEATURE_ML_UPDATE is enabled on sphere.ini

Otherwise everyone that uses ML features needs to deal with this troublesome feature: how can I deal with an automatic +20 mana?
I have to set a -20 mana, use a code to update correctly the maxmana with the INT value, use another code to check everytime I clean the MAX* value to add again a -20 mana, use another code to check if the -20mana is present and correctly added.

Is not simple to manage.

Who request this feature lol?
Reference URL's