Last active
March 3, 2016 01:35
-
-
Save DarkLotus/38a492618a5a3ce2a40c to your computer and use it in GitHub Desktop.
craftedSkillJewels.scp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright James Kidd 2016 | |
| // Changes Licensed under MIT license. | |
| // Based on original code by Lux | |
| [ITEMDEF i_crafted_skill_ring_gold] | |
| defname = i_crafted_skill_ring_gold | |
| ID=i_ring_gold | |
| Name=Magical Crafted Ring | |
| VALUE=200 | |
| WEIGHT=10 | |
| LAYER=8 | |
| TYPE=t_eq_script | |
| resources=100 i_ingot_gold,100 i_ingot_silver | |
| skillmake=tinkering 99.0, magery 95.0,EvaluatingIntel 95.0, t_tinker_tools | |
| ON=@DCLICK | |
| if ( <CONT.UID> != <SRC.FINDLAYER(21).UID> ) | |
| src.sysmessage This item must be in your backpack! | |
| return 1 | |
| endif | |
| IF ((<ATTR>==010) || (<ATTR>==04)) | |
| SRC.SYSMESSAGE The jewelry is not willing... | |
| ELSE | |
| EQUIP | |
| ENDIF | |
| RETURN 1 | |
| ON=@CREATE | |
| MORE1={1 48} | |
| //MORE2={ {1 5} 40 {6 10} 30 {11 15} 20 {16 20} 15 {21 25} 5} | |
| TAG.SKILLMOD = <EVAL <SRC.Tinkering>> - 1000 | |
| //Timer would not work like in the original, replaced with a ON=@CLICK | |
| ON=@CLICK | |
| IF (<TAG.INIT> != 1) | |
| setWeights | |
| setSkillTag | |
| setJewelName Ring | |
| setColor | |
| TAG.INIT = 1 | |
| ENDIF | |
| ON=@EQUIP | |
| IF (<TAG.INIT> != 1) | |
| setWeights | |
| setSkillTag | |
| setJewelName Ring | |
| setColor | |
| TAG.INIT = 1 | |
| ENDIF | |
| IF (<TAG.USESLEFT> == 0) | |
| src.sysmessage The Magic Fades.... <TAG.USESLEFT> | |
| MORE2 = 0; | |
| NAME=Faded Magical Ring of <VAR.RingVar> | |
| RETURN 0 | |
| ENDIF | |
| IF (<TAG.INIT> == 1) | |
| TRYP 0 SRC.<TAG.Skill>=<SRC.<Tag.skill>> + <EVAL <MORE2>> | |
| TAG.EQUIP = 1 | |
| TAG.USESLEFT = <EVAL <TAG.USESLEFT>> - 1 | |
| src.sysmessage The Magical Ring has <TAG.USESLEFT> charges left | |
| ELSE | |
| RETURN 1 | |
| ENDIF | |
| ON=@UNEQUIP | |
| IF (<TAG.EQUIP> == 1) | |
| TRYP 0 SRC.<TAG.Skill>=<SRC.<Tag.skill>> + -<EVAL <MORE2>> | |
| TAG.EQUIP = 0 | |
| ELSE | |
| RETURN 1 | |
| ENDIF | |
| [FUNCTION setWeights] | |
| TAG.USESLEFT = {5 10} | |
| IF (<EVAL <TAG.SKILLMOD>> > 100) | |
| MORE2={ {1 5} 30 {6 10} 26 {11 15} 22 {16 20} 18 {21 25} 15 {26 30} 12 {31 35} 9} | |
| TAG.USESLEFT = <EVAL <EVAL <TAG.USESLEFT>> + {1 10}> | |
| ELSEIF(<EVAL <TAG.SKILLMOD>> > 200) | |
| MORE2={ {1 5} 30 {6 10} 26 {11 15} 22 {16 20} 18 {21 25} 15 {26 30} 12 {31 35} 9 {36 40} 6} | |
| TAG.USESLEFT = <EVAL <TAG.USESLEFT>> + {3 15} | |
| ELSEIF(<EVAL <TAG.SKILLMOD>> > 300) | |
| MORE2={ {1 5} 5 {6 10} 10 {11 15} 15 {16 20} 15 {21 25} 20 {26 30} 20 {31 35} 15 {36 40} 10 {41 45} 5} | |
| TAG.USESLEFT = <EVAL <TAG.USESLEFT>> + {5 20} | |
| ELSEIF(<EVAL <TAG.SKILLMOD>> > 400) | |
| MORE2={ {6 10} 15 {11 15} 20 {16 20} 25 {21 25} 30 {26 30} 25 {31 35} 20 {36 40} 15 {41 45} 10 {46 50} 5} | |
| TAG.USESLEFT = <EVAL <EVAL <TAG.USESLEFT>> + {7 25}> | |
| ENDIF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment