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-nmm7 (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-nmm7 (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-nmm7 (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
Exp System - Doesn't work from 0.56b to 0.56d
Author Message
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #10
RE: Exp System - Doesn't work from 0.56b to 0.56d
The internal engine just have the basics, like internal <EXP> and <LEVEL> properties and some basic actions like raise EXP when kill monsters, gain messages, etc. But you can customize almost everything using scripts

1st step is set the EXP/LEVEL settings on sphere.ini

Next you must add EXP on all NPCs based on their status
Code:
[EVENTS e_exp_npcs] // don't forget to set e_exp_npcs on EventsPet (sphere.ini) to add this event automatically on all NPCs
ON=@Create
EXP=<eval (<STR>+<DEX>+<INT>) / 2> // or any other custom formula

To do custom actions on exp/level gain you just need to do the same thing using @ExpChange / @ExpLevelChange triggers
Code:
[EVENTS e_exp_players] // don't forget to set e_exp_players on EventsPlayers (sphere.ini) to add this event automatically on all players
ON=@ExpChange
// ARGO = the character that was killed (if the experience change originated from a kill)
// ARGN1 = amount of exp being changed (can be negative)
// ARGN2 = boolean (0/1) to show/hide default gain messages

ON=@ExpLevelChange
// ARGN1 = amount of level being changed (can be negative)
STR += 5

To view your current EXP/LEVEL you just need to use <EXP> or <LEVEL> on any dialog or create an simple function to show it as message
Code:
[PLEVEL 1]
showexp

[FUNCTION showexp] //don't use 'exp' or 'level' names on the function, it will conflict with internal <EXP> and <LEVEL> functions
SRC.SYSMESSAGE You're on level <LEVEL> (<EXP> exp)

And to customize default messages you just need to edit these messages on sphere_msgs.scp, or use the event above to disable these default messages and show your own custom message
09-12-2019 12:05 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Post Reply 


Messages In This Thread
RE: Exp System - Doesn't work from 0.56b to 0.56d - Coruja - 09-12-2019 12:05 PM

Forum Jump:


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