SphereCommunity
HELP WITH sphere.ini - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: HELP WITH sphere.ini (/Thread-HELP-WITH-sphere-ini)

Pages: 1 2 3 4


RE: HELP WITH sphere.ini - Extreme - 05-26-2014 06:11 AM

(05-26-2014 04:56 AM)kn4tseb Wrote:  Xun, looking at the new variable list posted by Khaos i see "DURABILITY <INT>% DURABILITY INCREASE" included, but it seems not to be hardcoded yet...
so, if i had the actual durability as a "HitPoints,MaxHitPoints" how could i code something like "extra Durability in porcent"... so if i set on the Create Trigger a value like: Durability 100
i get the actual Maxpoints + extra durability%

Example:
ON=@Create
HITPOINTS={100}

if "Durability = 50
hitpoints would be 100 + (100*50)/100) and that would be 100 hitpoints plus a 50% of its maxhitpoints

so tooltips should be showing when you click at the item, the "Extradurability" that would be 50 in this case and the maxhitpoints shall make the sum of both variables...

Puedes ayudarme con ésto?
If I did understand, the 'durability' property is the bonus in durability (hitpoints in that case)

Example:
If you have something with hitpoints 100 and durability 50, when it is created, its hitpoints will be 150.

Tooltips are showed only if you mouse over the item and you have the tooltips things enabled.
It will not show if you simple click on item. You can use a trigger to do that.

Code:
ON=@ItemClick
ACT.MESSAGE <ACT.HITS>/<ACT.MAXHITS>



RE: HELP WITH sphere.ini - kn4tseb - 05-26-2014 06:25 AM

yes but this bonus should be in porcentages, so, if you have 50 of hitpoints and 50 of durability it would be the 50% of 50 and thats 25, so 50 + 25 = 75, thats what i understood from the variables.

but in any case i will do as you say and change it depending on my needs, thank you so very much.


RE: HELP WITH sphere.ini - Extreme - 05-26-2014 06:31 AM

Yeah, you're right BUT you have to create something to apply the durability bonus.

If you do nothing, it will show only hitpoints (value) and durability (%).

Create and event for items and on @create, check if have durability property and increase the hitpoints.
Something like:

PHP Code:
ON=@CREATE
IF <DURABILITY>
 
MAXHITS += <EVAL (<DURABILITY>*<MAXHITS>)/100>
 
HITS <MAXHITS>
ENDIF 



RE: HELP WITH sphere.ini - kn4tseb - 05-26-2014 07:47 AM

Will check if <DURABILITY> property exists Wink ty


RE: HELP WITH sphere.ini - Extreme - 05-26-2014 08:41 AM

Yes, there is.


RE: HELP WITH sphere.ini - kn4tseb - 05-27-2014 02:57 AM

Worked perfectly, i just need one more thing, i need to add a clicloc, would you help me? this is what i have
SRC.ADDCLILOC 1151780,<Durability> //ExtraDurability "dunnowhatvaluetoset" %

Thanks ;>


RE: HELP WITH sphere.ini - Extreme - 05-27-2014 04:59 AM

(05-27-2014 02:57 AM)kn4tseb Wrote:  Worked perfectly, i just need one more thing, i need to add a clicloc, would you help me? this is what i have
SRC.ADDCLILOC 1151780,<Durability> //ExtraDurability "dunnowhatvaluetoset" %

Thanks ;>
Try this one:
SRC.ADDCLILOC 1060410,<Durability>


RE: HELP WITH sphere.ini - kn4tseb - 05-27-2014 05:53 AM

Perfect, thank you!


RE: HELP WITH sphere.ini - Extreme - 05-27-2014 06:45 AM

You're welcome!


RE: HELP WITH sphere.ini - kn4tseb - 05-27-2014 07:11 AM

Last question Big Grin ... if i dont want to set the code for each itemdef and i want it to check for all at once, similar to an event... how can i do it?