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
+9 dagger
Author Message
Coruja
Sphere Developer
*****

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

Dimension Shard

Post: #14
RE: +9 dagger
it's not wrong get the bonus value based on static MOREY values (10, 250, 500, ...) but you can replace this with an dynamic formula (same formula used intenally) which can return any value (+1, +2, +3, +4, +5, ...) instead only these pre-defined values (+1, +3, +5, ...)

Code:
[EVENTS e_magicwpn]
ON=@ItemAfterClick
IF (<ACT.ATTR> & attr_magic)
  IF (<ACT.ISWEAPON>)
    LOCAL.Bonus=<GetOldMagicBonus <ACT.MOREY>>
    LOCAL.ClickMsgText="+<dLOCAL.Bonus> <LOCAL.ClickMsgText>"
    LOCAL.ClickMsgHue=<DEF0.WeaponMagicColor.<dLOCAL.Bonus>>
  ELIF (<ACT.ISARMOR>)
    LOCAL.Bonus=<GetOldMagicBonus <ACT.MOREY>>
    LOCAL.ClickMsgText="+<dLOCAL.Bonus> <LOCAL.ClickMsgText>"
  ENDIF
ENDIF

[FUNCTION GetOldMagicBonus]
ARGS=<SERV.SPELL.s_enchant.EFFECT>
return <eval <ARGV0> + (((<ARGV1> - <ARGV0>) * <MOREY>) / 1000)>

[DEFNAME WeaponMagicColor]
WeaponMagicColor.1  0a37
WeaponMagicColor.2
WeaponMagicColor.3  07be
WeaponMagicColor.4
WeaponMagicColor.5  067a
WeaponMagicColor.6
WeaponMagicColor.7  09de
WeaponMagicColor.8
WeaponMagicColor.9  04e9

PS: note that the bonus value is based on EFFECT value of s_enchant spell (by default is EFFECT=1,9) and the weapon MOREY will indicate which value between 1,9 should be returned. So you must make sure that EFFECT value on s_enchant is properly set, and also make sure that armors/weapons have MOREY between 0.0 ~ 100.0 (which is the same as 0% ~ 100%). If you want go over > 100.0 you must increase EFFECT value on s_enchant spell instead set MOREY > 100.0 on the weapon

(05-21-2019 09:02 PM)x77x Wrote:  example?

also... anyway you can get the message stationary?

when you click on the item, then move the item, the text stays in the original spot...

(because it is using message)

using SAY/MESSAGE will make sphere send an say/message packet, so using
Code:
ON=@Click
MESSAGE something
return 1
it will drop the internal packet (return 1) and create another one to do the same thing, which doesn't make much sense. So you can replace this code with
Code:
ON=@AfterClick
LOCAL.ClickMsgText="something"
//LOCAL.ClickMsgHue=123
which will use the same internal packet and just override its text/color
(This post was last modified: 05-26-2019 06:30 AM by Coruja.)
05-26-2019 06:17 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
+9 dagger - x77x - 04-09-2018, 06:42 AM
RE: +9 dagger - ShiryuX - 04-09-2018, 01:42 PM
RE: +9 dagger - Coruja - 04-12-2018, 04:41 AM
RE: +9 dagger - x77x - 04-12-2018, 08:42 AM
RE: +9 dagger - Coruja - 04-12-2018, 03:06 PM
RE: +9 dagger - Mad Gunther - 03-02-2019, 05:32 AM
RE: +9 dagger - Coruja - 03-10-2019, 08:12 AM
RE: +9 dagger - Mad Gunther - 04-21-2019, 05:40 AM
RE: +9 dagger - x77x - 04-22-2019, 11:07 AM
RE: +9 dagger - Mad Gunther - 04-26-2019, 07:14 AM
RE: +9 dagger - Coruja - 05-26-2019 06:17 AM
RE: +9 dagger - x77x - 04-26-2019, 09:13 AM
RE: +9 dagger - ShiryuX - 05-20-2019, 03:01 AM
RE: +9 dagger - x77x - 05-21-2019, 09:02 PM
RE: +9 dagger - ShiryuX - 05-28-2019, 08:19 PM

Forum Jump:


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