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 - amonvangrell - 05-27-2014 07:27 AM

Code:
[function f_isitem]
if !<isitem>
do blablabla...
else
return 0
endif

[event e_check_item]
f_isitem



RE: HELP WITH sphere.ini - Extreme - 05-27-2014 07:38 AM

(05-27-2014 07:11 AM)kn4tseb Wrote:  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?

What? Sorry, I didn't understand.


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

it works fine when i set it for an item, but i must do this this for several items and i'd like to make some kind of event checking <durability> and setting the value instead doing this for every single item.


PD: im asking this because if i put the code at the tooltip events or equipitem event, hitpoints are increased everytime i pick an item with <durability>

iam really sorry about this newbie questions, im a begginer and im studing the tutorials


RE: HELP WITH sphere.ini - Extreme - 05-27-2014 01:49 PM

First create your item event (e_events_item for example)
Set it on sphere.ini and test if it will apply the bonus

[EVENTS E_EVENTS_ITEM]
ON=@CREATE
IF <DURABILITY>
MAXHITS += <EVAL (<DURABILITY>*<MAXHITS>)/100>
HITS <MAXHITS>
ENDIF


RE: HELP WITH sphere.ini - kn4tseb - 05-27-2014 02:16 PM

Didnt work Confused

added the event into a new file... then added the name of event to sphere.ini file at EventsItem=
but nothing happened :/

when item is created it doesnt get the bonus.


RE: HELP WITH sphere.ini - Extreme - 05-28-2014 01:09 AM

What sphere build are you using? Lastest versions?


RE: HELP WITH sphere.ini - kn4tseb - 05-28-2014 01:19 AM

may 22th nightly

Sphere Version 0.56c-Nightly [WIN32] by http://www.spherecommunity.net, compiled at May 22 2014 (00:05:19), internal build #1935

this is an example for a working durability bonus:
PHP Code:
[ITEMDEF i_DULL_COPPER_PLATEMAIL_CHEST]
NAME=Dull Copper Platemail
TYPE
=t_armor
ID
=i_platemail_chest
REQSTR
=60
WEIGHT
=10
CATEGORY
=Provisions Armor Colored
SUBSECTION
=Dull Copper
DESCRIPTION
=Platemail
RESOURCES
=25 i_ingot_dull_copper
SKILLMAKE
=BLACKSMITHING 66.3,Armslore 25.0
CanUse
=can_u_human|can_u_elf|can_u_male
TEVENTS
=t_equipitem

ON
=@Create
    COLOR
=color_o_dullcopper
      HITPOINTS
={48 60}
       
RESCOLD=2
       RESENERGY
=2
       RESFIRE
=3
       RESPHYSICAL
=11
       RESPOISON
=3
    DURABILITY
=50
    LOWERREQ
=20

IF <DURABILITY>
MAXHITS += <EVAL (<DURABILITY>*<MAXHITS>)/100>
HITS <MAXHITS>
ENDIF 


But as you know i dont want to have to add it everytime an item has durability bonus, so i tried with the event but nothing happens Confused
and if i add it to other events it works but everytime i pick up the item it gets the bonus over and over again.


RE: HELP WITH sphere.ini - Extreme - 05-28-2014 02:04 AM

Alright, it SHOULD be working. It's not here too.
Do this: in your player events, in @itempick_up, make it check about durability. If it has, apply the bonus and SET the durability 0 in the item. It will prevent apply again.

This is not the best way, since @create in eventsitem had to work.


RE: HELP WITH sphere.ini - XuN - 05-28-2014 02:08 AM

Wait until tomorrow's build, I did not apply the same changes for items than for characters when using events for the @Create trigger.


RE: HELP WITH sphere.ini - kn4tseb - 05-28-2014 03:37 AM

Okey, thank you both, i will wait ^^