Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
+9 dagger
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #11
RE: +9 dagger
this seems to work for me...

Code:
ON=@ItemClick
if <act.amount> > 1
   return 0
endif

local.message = <act.name>
if <act.tag0.rare> == 1
    local.hue = 042//045 < -2 TO GET THE COLOR I WANT
  elseif <act.tag0.rare> == 2
    local.hue = 060//062
  elseif <act.tag0.rare> == 3
    local.hue = 06f//071
  elseif <act.tag0.rare> == 4
    local.hue = 029//02b
endif

if <act.attr>&attr_magic
  if <act.isweapon>
   local.message = +<ddef.wpn_magic_morey_<act.morey>> <act.name>
  elseif <act.isarmor>
    local.message = +<ddef.arm_magic_morey_<act.morey>> <act.name>
  endif
endif

  if !<local.hue>
   act.message <local.message>
  elseif <local.hue>>0
   local.hue = (<local.hue>+3)//TO MATCH COLORS
   act.message @<local.hue> <local.message>
   else
     act.message @<local.hue> <local.message>
  endif

  IF <act.attr>&attr_newbie
    act.message @035 [newbied]
  ENDIF

  IF (<EVAL <ACT.TAG0.MILITARY>>==1)
    act.message @07d6 [military property]
  ENDIF

RETURN 1

Dragons of Time 2000-2020
http://dragonsoftime.com
04-26-2019 09:13 AM
Find all posts by this user Like Post Quote this message in a reply
ShiryuX
Journeyman
*

Posts: 249
Likes Given: 1
Likes Received: 19 in 14 posts
Joined: Mar 2010
Reputation: 4



Post: #12
RE: +9 dagger
I would recommend using @AfterClick. Or use MESSAGEUA instead of MESSAGE, with 6 as message type. This way, the message will display as "You see:" on the journal, instead of a normal message from the item (which would look like if someone was speaking).
05-20-2019 03:01 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #13
RE: +9 dagger
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)

Dragons of Time 2000-2020
http://dragonsoftime.com
05-21-2019 09:02 PM
Find all posts by this user Like Post Quote this message in a reply
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
ShiryuX
Journeyman
*

Posts: 249
Likes Given: 1
Likes Received: 19 in 14 posts
Joined: Mar 2010
Reputation: 4



Post: #15
RE: +9 dagger
The locals are good if you only have to send ONE message.
Otherwise, as I said, you can use MESSAGEUA.

Code:
[TYPEDEF t_Enhanced_Item]
ON=@AfterClick
local.color = <qval <color> ? <color> : 944>
if !(<attr>&attr_identified)
    messageua <local.color>,6,3,esp <name>
    messageua 946,6,3,esp [Magica]
    return 1
endif

The message will follow the item (as you will see in the journal "You see: name, You see: [Magica]")
05-28-2019 08:19 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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