Difference between revisions of "User:Trang Oul/Sandbox/Template:Property"

From Basin Wiki
Jump to navigation Jump to search
Line 11: Line 11:
  
 
=== Usage ===
 
=== Usage ===
−
<code><nowiki>{{Item property|<property key>|[param]|[min value]|[max value]}}</nowiki></code><br/>
+
<code><nowiki>{{Property|<property key>|[param]|[min value]|[max value]}}</nowiki></code><br/>
 
To use, simply copy the property 4-tuple from the data file and replace tabs with <code>|</code>.
 
To use, simply copy the property 4-tuple from the data file and replace tabs with <code>|</code>.
  
Line 23: Line 23:
 
No param, min and max value ignored:<br/>
 
No param, min and max value ignored:<br/>
 
<code><nowiki>{{Property|indestruct||1|1}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|indestruct||1|1}}<br/>
 
<code><nowiki>{{Property|indestruct||1|1}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|indestruct||1|1}}<br/>
 +
As above, just with no min and max values:<br/>
 +
<code><nowiki>{{Property|indestruct|||}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|indestruct|||}}<br/>
 +
Different positive/negative labels, both positive:<br/>
 +
<code><nowiki>{{Property|regen||1|2}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|regen||1|2}}<br/>
 +
Different positive/negative labels, both negative:<br/>
 +
<code><nowiki>{{Property|regen||-2|-1}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|regen||-2|-1}}<br/>
 +
Different positive/negative labels, mixed:<br/>
 +
<code><nowiki>{{Property|regen||-1|2}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|regen||-1|2}}<br/>
 
As above, just with no min and max values:<br/>
 
As above, just with no min and max values:<br/>
 
<code><nowiki>{{Property|indestruct|||}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|indestruct|||}}<br/>
 
<code><nowiki>{{Property|indestruct|||}}</nowiki></code> &rarr; {{User:Trang Oul/Sandbox/Template:Property|indestruct|||}}<br/>
Line 50: Line 58:
 
| abs-cold%              = Cold Absorb {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}|signed=1}}%
 
| abs-cold%              = Cold Absorb {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}|signed=1}}%
 
| abs-cold              = {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}|signed=1}} Cold Absorb
 
| abs-cold              = {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}|signed=1}} Cold Absorb
 +
| red-dmg                = Damage Reduced by {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}}}
 +
| red-dmg%              = {{User:Trang Oul/Sandbox/Template:Property/Signed
 +
| {{#if: {{{2|}}} | {{{2}}} | {{{3}}} }}
 +
| {{#if: {{{2|}}} | {{{2}}} | {{{4}}} }}
 +
| Physical Damage Received Reduced by
 +
| Physical Damage Received Increased by
 +
| Physical Damage Received Reduced/Increased by
 +
}} {{User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}}}%
 +
| regen                  = {{User:Trang Oul/Sandbox/Template:Property/Signed
 +
| {{#if: {{{2|}}} | {{{2}}} | {{{3}}} }}
 +
| {{#if: {{{2|}}} | {{{2}}} | {{{4}}} }}
 +
| ReplenishLife
 +
| Drain Life
 +
| Replenish/Drain Life
 +
}} {User:Trang Oul/Sandbox/Template:Range|{{{3|}}}|{{{4|}}}|signed=1}}
 
| indestruct            = Indestructible
 
| indestruct            = Indestructible
 
| att-skill              = {{{3|}}}% [[Chance to cast]] level {{{4|}}} {{User:Trang Oul/Sandbox/Template:Skill name|{{{2|}}}}} [[on attack]]
 
| att-skill              = {{{3|}}}% [[Chance to cast]] level {{{4|}}} {{User:Trang Oul/Sandbox/Template:Skill name|{{{2|}}}}} [[on attack]]

Revision as of 15:18, 3 November 2026

Formats a property defines as a 4-tuple like in data files (magicprefix.txt, magicsuffix.txt, automagic.txt, setitems.txt, sets.txt, uniqueitems.txt, runes.txt, gems.txt, propertygroups.txt and others)

Sources

Built by hand from:

  • properties.txt (cols: code - property code, func<X> - how the stat is used, stat<X> - corresponding stat from itemstatcost.txt)
  • itemstatcost.txt (cols: Stat - stat code (matched with stat<X> from properties.txt), descstrpos, descstrneg - keys for string labels)
  • data\local\lng\strings (string table labels for property text)

Labels are slightly modified to display value ranges and to include links.

Usage

{{Property|<property key>|[param]|[min value]|[max value]}}
To use, simply copy the property 4-tuple from the data file and replace tabs with |.

Examples

No param, min and max values equal:
{{Property|ac||60|60}} → +60 Defense | indestruct = Indestructible | att-skill = 60% Chance to cast level 60 on attack | hit-skill = 60% Chance to cast level 60 on striking | gethit-skill = 60% Chance to cast level 60 when struck | Gethit-skill = 60% Chance to cast level 60 when struck | kill-skill = 60% Chance to cast level 60 when you Kill an Enemy | death-skill = 60% Chance to cast level 60 when you Die | levelup-skill = 60% Chance to cast level 60 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
No param, min and max values not equal:
{{Property|abs-fire||5|11}} → +5 Fire Absorb | indestruct = Indestructible | att-skill = 5% Chance to cast level 11 on attack | hit-skill = 5% Chance to cast level 11 on striking | gethit-skill = 5% Chance to cast level 11 when struck | Gethit-skill = 5% Chance to cast level 11 when struck | kill-skill = 5% Chance to cast level 11 when you Kill an Enemy | death-skill = 5% Chance to cast level 11 when you Die | levelup-skill = 5% Chance to cast level 11 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Param, min value, max value (latter two re-used for a different purpose):
{{Property|Gethit-skill|235|1|25}} → | indestruct = Indestructible | att-skill = 1% Chance to cast level 25 Cyclone Armor on attack | hit-skill = 1% Chance to cast level 25 Cyclone Armor on striking | gethit-skill = 1% Chance to cast level 25 Cyclone Armor when struck | Gethit-skill = 1% Chance to cast level 25 Cyclone Armor when struck | kill-skill = 1% Chance to cast level 25 Cyclone Armor when you Kill an Enemy | death-skill = 1% Chance to cast level 25 Cyclone Armor when you Die | levelup-skill = 1% Chance to cast level 25 Cyclone Armor when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
No param, min and max value ignored:
{{Property|indestruct||1|1}} → | indestruct = Indestructible | att-skill = 1% Chance to cast level 1 on attack | hit-skill = 1% Chance to cast level 1 on striking | gethit-skill = 1% Chance to cast level 1 when struck | Gethit-skill = 1% Chance to cast level 1 when struck | kill-skill = 1% Chance to cast level 1 when you Kill an Enemy | death-skill = 1% Chance to cast level 1 when you Die | levelup-skill = 1% Chance to cast level 1 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
As above, just with no min and max values:
{{Property|indestruct|||}} → | indestruct = Indestructible | att-skill = % Chance to cast level on attack | hit-skill = % Chance to cast level on striking | gethit-skill = % Chance to cast level when struck | Gethit-skill = % Chance to cast level when struck | kill-skill = % Chance to cast level when you Kill an Enemy | death-skill = % Chance to cast level when you Die | levelup-skill = % Chance to cast level when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Different positive/negative labels, both positive:
{{Property|regen||1|2}} → ReplenishLife {User:Trang Oul/Sandbox/Template:Range | indestruct = Indestructible | att-skill = 1% Chance to cast level 2 on attack | hit-skill = 1% Chance to cast level 2 on striking | gethit-skill = 1% Chance to cast level 2 when struck | Gethit-skill = 1% Chance to cast level 2 when struck | kill-skill = 1% Chance to cast level 2 when you Kill an Enemy | death-skill = 1% Chance to cast level 2 when you Die | levelup-skill = 1% Chance to cast level 2 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Different positive/negative labels, both negative:
{{Property|regen||-2|-1}} → Drain Life {User:Trang Oul/Sandbox/Template:Range | indestruct = Indestructible | att-skill = -2% Chance to cast level -1 on attack | hit-skill = -2% Chance to cast level -1 on striking | gethit-skill = -2% Chance to cast level -1 when struck | Gethit-skill = -2% Chance to cast level -1 when struck | kill-skill = -2% Chance to cast level -1 when you Kill an Enemy | death-skill = -2% Chance to cast level -1 when you Die | levelup-skill = -2% Chance to cast level -1 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Different positive/negative labels, mixed:
{{Property|regen||-1|2}} → Replenish/Drain Life {User:Trang Oul/Sandbox/Template:Range | indestruct = Indestructible | att-skill = -1% Chance to cast level 2 on attack | hit-skill = -1% Chance to cast level 2 on striking | gethit-skill = -1% Chance to cast level 2 when struck | Gethit-skill = -1% Chance to cast level 2 when struck | kill-skill = -1% Chance to cast level 2 when you Kill an Enemy | death-skill = -1% Chance to cast level 2 when you Die | levelup-skill = -1% Chance to cast level 2 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
As above, just with no min and max values:
{{Property|indestruct|||}} → | indestruct = Indestructible | att-skill = % Chance to cast level on attack | hit-skill = % Chance to cast level on striking | gethit-skill = % Chance to cast level when struck | Gethit-skill = % Chance to cast level when struck | kill-skill = % Chance to cast level when you Kill an Enemy | death-skill = % Chance to cast level when you Die | levelup-skill = % Chance to cast level when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Calculated value - param:
{{Property|ac/lvl|30||}} → | indestruct = Indestructible | att-skill = % Chance to cast level Fend on attack | hit-skill = % Chance to cast level Fend on striking | gethit-skill = % Chance to cast level Fend when struck | Gethit-skill = % Chance to cast level Fend when struck | kill-skill = % Chance to cast level Fend when you Kill an Enemy | death-skill = % Chance to cast level Fend when you Die | levelup-skill = % Chance to cast level Fend when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}
Calculated value - min and max values:
{{Property|hp/lvl||8|12}} → | indestruct = Indestructible | att-skill = 8% Chance to cast level 12 on attack | hit-skill = 8% Chance to cast level 12 on striking | gethit-skill = 8% Chance to cast level 12 when struck | Gethit-skill = 8% Chance to cast level 12 when struck | kill-skill = 8% Chance to cast level 12 when you Kill an Enemy | death-skill = 8% Chance to cast level 12 when you Die | levelup-skill = 8% Chance to cast level 12 when you Level-Up | noheal = Prevent Monster Heal | half-freeze = Half Freeze Duration | nofreeze = Cannot Be Frozen | knock = Knockback }}