The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP WITH sphere.ini
Author Message
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #21
RE: HELP WITH sphere.ini
Code:
[function f_isitem]
if !<isitem>
do blablabla...
else
return 0
endif

[event e_check_item]
f_isitem
05-27-2014 07:27 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #22
RE: HELP WITH sphere.ini
(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.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
05-27-2014 07:38 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #23
RE: HELP WITH sphere.ini
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
(This post was last modified: 05-27-2014 11:05 AM by kn4tseb.)
05-27-2014 11:02 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #24
RE: HELP WITH sphere.ini
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

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
05-27-2014 01:49 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #25
RE: HELP WITH sphere.ini
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.
(This post was last modified: 05-27-2014 02:21 PM by kn4tseb.)
05-27-2014 02:16 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #26
RE: HELP WITH sphere.ini
What sphere build are you using? Lastest versions?

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
05-28-2014 01:09 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #27
RE: HELP WITH sphere.ini
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.
(This post was last modified: 05-28-2014 01:30 AM by kn4tseb.)
05-28-2014 01:19 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #28
RE: HELP WITH sphere.ini
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.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
05-28-2014 02:04 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #29
RE: HELP WITH sphere.ini
Wait until tomorrow's build, I did not apply the same changes for items than for characters when using events for the @Create trigger.
05-28-2014 02:08 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #30
RE: HELP WITH sphere.ini
Okey, thank you both, i will wait ^^
05-28-2014 03:37 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 8 Guest(s)