How can make a charm with durability?

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
huohuowu2
Junior Member
Paladin
Posts: 144
Joined: Sat Feb 28, 2015 4:20 am
China

How can make a charm with durability?

Post by huohuowu2 » Mon Oct 23, 2017 1:51 am

I want to make some charms like equipments can broken.
How to do that?

User avatar
devurandom
Forum Regular
Angel
Posts: 793
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: How can make a charm with durability?

Post by devurandom » Mon Oct 23, 2017 7:55 am

There are examples on the keep how to do this softcoded, no code editing required. True Mage posted info.

Use the site search function ... or search google ->
site:d2mods.info search terms
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
HarvestWombs
Senior Moderator
Angel
Posts: 972
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: How can make a charm with durability?

Post by HarvestWombs » Tue Oct 24, 2017 2:21 am

Not entirely, IIRC the durability check is for equipped items only, and charms don't fall under that category.

Plus the only example I could find about charms with durability were for an unrepairable charged scroll like effect.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

User avatar
devurandom
Forum Regular
Angel
Posts: 793
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: How can make a charm with durability?

Post by devurandom » Tue Oct 24, 2017 7:17 am

Black_Eternity" wrote: Plus the only example I could find about charms with durability were for an unrepairable charged scroll like effect.
Yes, but the example was for ethereal charms.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
HarvestWombs
Senior Moderator
Angel
Posts: 972
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: How can make a charm with durability?

Post by HarvestWombs » Tue Oct 24, 2017 8:44 pm

Which is done by giving the charm an itype such as armor.
Doable to give the charm durability, but still does not diminish the durability over time, which is the goal in question.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

User avatar
Necrolis
Site Admin
Throne
Posts: 9016
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: How can make a charm with durability?

Post by Necrolis » Tue Oct 24, 2017 9:09 pm

Giving a charm durability is easy, but the question is really related to how you want it to lose durability. Standard D2 rolls a chance to diminish durability during the attack/defense routines, but charms are really used there, but can be easily added.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
HarvestWombs
Senior Moderator
Angel
Posts: 972
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: How can make a charm with durability?

Post by HarvestWombs » Tue Oct 24, 2017 10:40 pm

Well that's a different answer than what Nefarius stated, but hey thats cool. I'll be testing that soon to see how it goes.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

User avatar
huohuowu2
Junior Member
Paladin
Posts: 144
Joined: Sat Feb 28, 2015 4:20 am
China

Re: How can make a charm with durability?

Post by huohuowu2 » Wed Oct 25, 2017 1:16 am

Someone has succeeded in making it.
His mod use death to lose durability for charms.
But i know i can't get the answer from him.

User avatar
Necrolis
Site Admin
Throne
Posts: 9016
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: How can make a charm with durability?

Post by Necrolis » Wed Oct 25, 2017 11:26 am

Black_Eternity" wrote:Well that's a different answer than what Nefarius stated, but hey thats cool. I'll be testing that soon to see how it goes.
Durability is nothing but a stat, and when the durability check reduces it to 0, it sets the ITEM_BROKEN flag, which tells the item requirements handler that you can't use the item. We are talking CE here, so easy is a relative term.
huohuowu2" wrote:Someone has succeeded in making it.
His mod use death to lose durability for charms.
But i know i can't get the answer from him.
In this case, all you do is hook the player death routine (the same one that spawns corpses, costs you exp and gold), iterate the inventory items, check for itemtype of charm, its identified and if its durability is >0 (or that it isn't broken already, the latter is faster), then you can roll your chance to decrement the durability, if it reaches 0, you set the ITEM_BROKEN flag.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

mjhdk
Posts: 6
Joined: Tue Nov 21, 2017 9:05 am

Re: How can make a charm with durability?

Post by mjhdk » Thu Jun 27, 2019 8:47 am

is still unsolved? @huohuowu2 ?

Post Reply

Return to “Code Editing”