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
Item to be identified
Author Message
Osirirs
Journeyman
*

Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2



Post: #11
RE: Item to be identified
Perfect! now it works fine! thanks john!
So if I get it well, src.tag.bs means you just set a tag named "bs" to the item,
and then <src.blacksmithing> means the tag saves the source (the player)'s Blacksmithing skill.
if (<eval <src blacksmithing> - 1000> == <src.tag0.bs>) means it evaluates that the player's blacksmithing skill hasn't been
increased, it's still equal to to the saved tag (the player' skill)
And this works because the tag is set before the if (<attr>&(attr_identified)), otherwise I would have the same problem
cause the tag would act with the attr_identified value.. right? explained quite weirdly but I'm pretty sure I get it!



Now this is just a minor detail, since you already helped so much but since my item is supposed to look normal
before being identified, I'm trying to set the item color to change once it is identified:

ON=@Create
Attr=attr_magic
Hitpoints=9000
if (<attr>&(attr_identified))
Color=0b86
endif

I guess it isn't as simple as that xD I tried several things but doesn't seem to work o.o
Anyways it's not that important, just if you feel like shooting some more hints Tongue Thanks again ^^
03-04-2014 02:30 AM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #12
RE: Item to be identified
(03-04-2014 02:30 AM)Osirirs Wrote:  1-) ...So if I get it well, src.tag.bs means you just set a tag named "bs" to the item...


2-) if (<eval <src blacksmithing> - 1000> == <src.tag0.bs>) means it evaluates that the player's blacksmithing skill hasn't been
increased, it's still equal to to the saved tag (the player' skill)
And this works because the tag is set before the if (<attr>&(attr_identified)), otherwise I would have the same problem
cause the tag would act with the attr_identified value.. right? explained quite weirdly but I'm pretty sure I get it!



3-) Now this is just a minor detail, since you already helped so much but since my item is supposed to look normal
before being identified, I'm trying to set the item color to change once it is identified:

ON=@Create
Attr=attr_magic
Hitpoints=9000
if (<attr>&(attr_identified))
Color=0b86
endif

1-) We set a custom tag named bs, you're right till here but we save it to the player instead to save item.

2-) That means; after players bs skill, unequip the hammer, is equal to the first place. Since i've already told you this will work only if you have 100.0 skillcap. Otherwise you have to use another method. ( I've already explained that too ^.^ ) Basicly we save player's bs skill when player equip that hammer. There's no condition for that it just save it, hammer got itemid or not. I put that saving action before check identify, as i already told, if player equips the hammer before it got identified and then he identify it while equiping and when he unequip hammer he will loose 100.0 bs. This tag is protect's it. If player got 50.0 bs, and he use that hammer before identify it. And as fit to the situation he identify it while equiping. Here's our script work line. When he unqeuip the hammer, if currently bs skill ( boosted +100.0 or not ) isnt equal with first place, he will not loose any bs skill. Since he can't gain more skill than 100.0 and hammer provides +100.0 it will not cause a problem in the future.


3-) Try this one;

on=@click
if (<attr>&(attr_identified))
Color=0b86
src.sysmessage @026 Item Rank: Artifact
src.sysmessage @026 Skill: Blacksmithing +100.0
message @026 The Golden Hammer
Return 1 // <- here is the right place.
endif
03-04-2014 04:56 AM
Find all posts by this user Like Post Quote this message in a reply
Osirirs
Journeyman
*

Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2



Post: #13
RE: Item to be identified
Nice!! everything is working fine now ^^ of course I'll have to keep using these tag thing to fully understand them, thanks for all your help! Smile
03-05-2014 01:08 AM
Find all posts by this user Like Post Quote this message in a reply
Osirirs
Journeyman
*

Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2



Post: #14
RE: Item to be identified
OKay hummm.. I thought everything was good but of course I can equip my item and gain all the right damage and stats even tho it is still unidentified, so any way I could add something so player can't equip unless it is identified??

ON=@Create
Attr=attr_magic
Hitpoints={500 600}
Color=0

ON=@Click
if (<attr>&(attr_identified))
Color=02cb
src.sysmessage @041 Item Category: Common
src.sysmessage @041 Rarity: 60
src.sysmessage @041 Weapon Speed: 56
message @041 Swift Pitchfork of Ruin
Return 1
endif

ON=@Equip
?????
(This post was last modified: 03-06-2014 01:46 AM by Osirirs.)
03-06-2014 01:45 AM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #15
RE: Item to be identified
ON=@Equip
if !(<attr>&(attr_identified))
src.sysmessage No you cant do it bro...
return 1
endif.
03-06-2014 02:35 AM
Find all posts by this user Like Post Quote this message in a reply
Osirirs
Journeyman
*

Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2



Post: #16
RE: Item to be identified
ooooh! so the "!" tells sphere that if it's not identified yet, the following actions happens! Great thanks again John! works great Smile
03-06-2014 02:45 AM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #17
RE: Item to be identified
You're welcome dude. ! checks the negativity like " if it identified " before !, " if it isnt identified " after ! symbol. Have Fun Wink
03-06-2014 03:17 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #18
RE: Item to be identified
03-06-2014 03:25 AM
Find all posts by this user Like Post Quote this message in a reply
Osirirs
Journeyman
*

Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2



Post: #19
RE: Item to be identified
oooooh that's gold! thanks alaric! Smile
03-06-2014 04:41 AM
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: #20
RE: Item to be identified
to remove "Magic" from name just enable this line on sphere_msgs.scp and set a empty text
Code:
//itemtitle_magic        "Magic "
and then just use your code on item
Code:
[ITEMDEF i_magic_katana]
ID=i_katana
...

ON=@Create
ATTR=attr_magic
HITPOINTS={500 600}
//COLOR=0 //this doesn't need to be set, all items are already created without color

ON=@AfterClick
LOCAL.ClickMsgHue=<COLOR>
IF (<ATTR> & attr_identified)
  COLOR=02cb
  SRC.SYSMESSAGE @041 Item Category: Common
  SRC.SYSMESSAGE @041 Rarity: 60
  SRC.SYSMESSAGE @041 Weapon Speed: <SPEED>
ENDIF

but to make it even better, here's a improved code
Code:
[ITEMDEF i_magic_katana]
ID=i_katana
...
TEVENTS=e_magic_item
TAG.Category=Common
TAG.Rarity=60
TAG.SkillBonus.0=Blacksmithing,1000
TAG.SkillBonus.1=Tactics,1000

ON=@Create
ATTR=attr_magic
HITPOINTS={500 600}


[EVENTS e_magic_item]
ON=@AfterClick
LOCAL.ClickMsgHue=<COLOR>
IF (<ATTR> & attr_identified)
  COLOR=02cb
  SRC.SYSMESSAGE @041 Item Category: <TAG.Category>
  SRC.SYSMESSAGE @041 Rarity: <TAG0.Rarity>
  SRC.SYSMESSAGE @041 Weapon Speed: <SPEED>
  WHILE !(<isempty <TAG.SkillBonus.<dLOCAL._WHILE>>>)
    ARGS=<TAG.SkillBonus.<dLOCAL._WHILE>>
    SRC.SYSMESSAGE @041 Skill Bonus: +<FVAL <ARGV1>> <ARGV0>
  ENDWHILE
ENDIF

ON=@Equip
WHILE !(<isempty <TAG.SkillBonus.<dLOCAL._WHILE>>>)
  ARGS=<TAG.SkillBonus.<dLOCAL._WHILE>>
  SRC.<ARGV0> += <ARGV1>
ENDWHILE

ON=@Unequip
WHILE !(<isempty <TAG.SkillBonus.<dLOCAL._WHILE>>>)
  ARGS=<TAG.SkillBonus.<dLOCAL._WHILE>>
  SRC.<ARGV0> -= <ARGV1>
ENDWHILE
using this code you doesnt need to copy/paste the same thing on every item, all you need to do is set the TEVENT=e_magic_item and use tags to control the magic properties
(This post was last modified: 03-11-2014 08:52 AM by Coruja.)
03-11-2014 08:48 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Post Reply 


Forum Jump:


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