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: #1
Item to be identified
(Version 56b)
Hey guys, I'm trying to make items to be Identified with ItemID(obviously xD) which only have a basic name like Magic Hammer (example) and when identified, the real name is revealed, but thing is that when I add it ingame or loot it on a specific monster it's called Magic The Golden Hammer -.- and when I click on it I can already see the stats where the sysmessage are displayed without identifying it first, so here's my script:

[ITEMDEF i_golden_hammer]
ID=i_hammer_smith
Name=The Golden Hammer
Resources=1000 i_ingot_iron
Skillmake=Blacksmithing 200.0
Type=t_weapon_mace_smith
Dam=2,10

Category=
Subsection=Crafting Items
Description=The Golden Hammer

ON=@Create
Attr=attr_magic
Hitpoints=9000
Color=0b86

ON=@Click
src.sysmessage @026 Item Rank: Artifact
src.sysmessage @026 Skill: Blacksmithing +100.0
message @026 The Golden Hammer
Return 1

ON=@Equip
src.blacksmithing = (<src.blacksmithing>+1000)

ON=@Unequip
src.blacksmithing = (<src.blacksmithing>-1000)


Ideally I'm trying to make it look like a normal weapon until it is identified Shock Any thoughts? Thanks! Smile
So people are like: SURPRISE!!! and they fall off their chairs cause they just got that super crazy item o.o Tongue
(This post was last modified: 03-02-2014 03:28 AM by Osirirs.)
03-02-2014 03:26 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: #2
RE: Item to be identified
on=@click
if (<attr>&(attr_magic))
message <name> // normal one
if (<attr>&(attr_identified))
src.sysmessage @026 Item Rank: Artifact
src.sysmessage @026 Skill: Blacksmithing +100.0
message @026 The Golden Hammer
Return 1
endif
endif

Here you go.


Edit: After i read entire post, i have an extra idea for that; check item attr under equip trigger, if it identified then give +100.0 bs otherwise nothing Wink
(This post was last modified: 03-02-2014 03:39 AM by JohnVeritas.)
03-02-2014 03: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: #3
RE: Item to be identified
Wooaah o.o you guys know how to deal with these scripts! I'm starting to get the hang of it! Thanks John! Big Grin

Ooooh but when it's not identified it's called smith's hammer and also Magic The Golden Hammer, and when Identified
it works but still also called smith's hammer.. kinda tricky Shock
(This post was last modified: 03-02-2014 03:49 AM by Osirirs.)
03-02-2014 03:39 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: #4
RE: Item to be identified
Okay so I did all that, it does works better! Smile tho looks like it's better if the return 1 goes under the Endif, this way the item name is not written twice before being identified.

Tho I still have that problem, now that I Identified it, it shows both the "magic smith's hammer" and "The Golden Hammer" names.

Here's what I've done so far:

[ITEMDEF i_golden_hammer]

ON=@Create
Attr=attr_magic
Hitpoints=9000
Color=0b86

ON=@Click
if (<attr>&(attr_magic))
message magic smith's hammer // normal one
endif
if (<attr>&(attr_identified))
src.sysmessage @026 Item Rank: Artifact
src.sysmessage @026 Skill: Blacksmithing +100.0
message @026 The Golden Hammer
endif
Return 1

ON=@Equip
if (<attr>&(attr_identified))
src.blacksmithing = (<src.blacksmithing>+1000)
endif

ON=@Unequip
if (<attr>&(attr_identified))
src.blacksmithing = (<src.blacksmithing>-1000)
endif

Thank you again for your help ^^
(This post was last modified: 03-02-2014 07:45 AM by Osirirs.)
03-02-2014 07:44 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: #5
RE: Item to be identified
(03-02-2014 07:44 AM)Osirirs Wrote:  ....

ON=@Click
if (<attr>&(attr_magic))
message magic smith's hammer // normal one
endif
if (<attr>&(attr_identified))
src.sysmessage @026 Item Rank: Artifact
src.sysmessage @026 Skill: Blacksmithing +100.0
message @026 The Golden Hammer
endif
Return 1

....

You put that "return 1" to wrong place Smile


Code:
ON=@Click
if (<attr>&(attr_magic))
message magic smith's hammer // normal one
return 1 // and secondary return 1 that i forgot the put :)
endif
if (<attr>&(attr_identified))
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

And i forgot put first return 1 sorry about that Wink
03-02-2014 09:38 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes JohnVeritas's post
Osirirs
Journeyman
*

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



Post: #6
RE: Item to be identified
oh it makes very much sense but surprisingly, my item is now only named "magic smith's hammer" o.o
weird Shock
03-02-2014 12:42 PM
Find all posts by this user Like Post Quote this message in a reply
Runcuks
Journeyman
*

Posts: 179
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Nov 2012
Reputation: 0



Post: #7
RE: Item to be identified
After indentification remove attr_magic or swith with places to this ->
ON=@Click
if (<attr>&(attr_identified))
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
if (<attr>&(attr_magic))
message magic smith's hammer // normal one
return 1 // and secondary return 1 that i forgot the put Smile
endif
03-02-2014 04:26 PM
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: #8
RE: Item to be identified
You need to say what do you prefer when the item have attr_magic and attr_identified, you can show both messages or prefer one above the other.

However, I see a problem with your script in the @UnEquip trigger: If you have this item equiped already when you use ItemID on it and, after it, you UnEquip it you will loose your 100.0 points of skill when you never got them increased. You should play with the ItemID skill and the @Success trigger to: Don't allow to identify Equiped items or fire the @Equip trigger after the skill succeed.
03-02-2014 07:28 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Osirirs
Journeyman
*

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



Post: #9
RE: Item to be identified
damn... didn't think about that >.<
well the idea was to have a normal item (magic smith's hammer) until it is identified. When identified it becomes The Golden Hammer,
until then, it can't be equiped, it's absolutely useless.
And of course I wanted to set a required level of the ItemID skill.

It works now, it is only named the Golden Hammer after being identified Smile

tho now I'm still stuck with the 100.0 skillpoints lost :/
And I even tried to do something with the color but doesn't seem to work

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

and for the @success trigger I never used it o.o
I thought about making the item so it can't be equipped until it is identified, that would work wouldn't it?

ON=@Equip
if (<attr>&(attr_magic))
??????? <-----with something here...?
if (<attr>&(attr_identified))
src.blacksmithing = (<src.blacksmithing>+1000)
endif

Unless the item would still have the magic attr even after being identified? o.o
Thanks for all your help again guys!
03-03-2014 02:00 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: #10
RE: Item to be identified
on=@click
if (<attr>&(attr_identified))
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

if it got att identified it will show thoose informations otherwise it will show only normal name. You dont need to check attr magic. It's still got that magic attr after identify.


ON=@Equip
if (<attr>&(attr_identified))
src.blacksmithing = (<src.blacksmithing>+1000)
endif

And same unequip. If item is identified, it gives bs on @equip and take back bs if only identified. But still it cause a major bug, if player use that hammer before identify and if he use itemid while using hammer, he will loose 100.0 bs when he unequip it cuz while equip that item wasnt identified and then he identified item and unequip it. Puff a bug Smile You can solve this problem with two ways, 1st save players blacksmithy skill with tags, while unequip check that varies ( <<skillcurently> - 1000> != <skillbeforehammer> ) like this. And 2nd way do not allow use that hammer before it got identified. But i think you more like 1st way.

on @equip
src.tag.bs <src.blacksmithy> // <- it must be in here before you give player to more skill.
if (<attr>&(attr_identified))
src.blacksmithing = (<src.blacksmithing>+1000)
endif

on @unequip
if (<attr>&(attr_identified))
if (<eval <src.blacksmithy> - 1000> == <src.tag0.bs> ) // <- I choose check equality but if your skill cap is higher than 100.0 use "<" this one.
src.blacksmithing = (<src.blacksmithing>+1000)
endif
endif
src.cleartags bs //<- clearing tag.


With this way you save players bs at first time. And while unequip if current bs -1000 is equal with before using hammer, it will drop bs otherwise it will not. And it will works only if you have 100.0 skillcap otherwise you have to check ( if (<eval <src.blacksmithy> - 1000> < <src.tag0.bs> ) like this. Grts.
(This post was last modified: 03-03-2014 10:07 PM by JohnVeritas.)
03-03-2014 10:03 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes JohnVeritas's post
Post Reply 


Forum Jump:


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