jat63 Wanderer
Joined: 22 Sep 2003 Posts: 53 Location: United Kingdom
|
Posted: Sun Aug 28, 2005 8:27 am
TDP caluclator for Dragonrealms |
The following script will produce a window showing the TDPs required to advance stats by between 1 and 6 points. Currently it is setup as an Elothian but if you change the values in tdpFactor and run tdpMakeLists it is easy to make it work with any race. If tdpType is set to 0 you will get a cumulative count of values required, anything else and it will provide absolute values.
This is my first post of a finished script so please let me know if you found it useful and I will look at positing some of the other 100 or so I have.
Code: |
#CLASS {Tdp}
#ALIAS tdpCalc2 {#LOOPDB @tdpStats {tmpp=%key;#VARIABLE tdpList {};tdpList=%additem(@tdpCalc(%val,@{tdpFactor.@tmpp}),@tdpList);#LOOP %eval(%val+1),%eval(%val+5) {tdpList=%additem(@tdpCalc(%eval(%i),@{tdpFactor.@tmpp}),@tdpList)};tdpText=%additem(%format("&12s &2.0f &5.0f &5.0f &5.0f &5.0f &5.0f &5.0f",%key,%val,%item(@tdpList,1),%item(@tdpList,2),%item(@tdpList,3),%item(@tdpList,4),%item(@tdpList,5),%item(@tdpList,6)),@tdpText)}}
#ALIAS dotdp {#VARIABLE tdpText {};tdpT on;info}
#ALIAS tdpdone {tdpT off;#IF (@tdpType=1) {tdpCalc2} {tdpCalc};#IF (%window(TDP)=0) {#MAKEWINDOW TDP};:TDP:#CLR;:TDP:#SHOW %ansi(green)" Attribute 1 2 3 4 5 6";:TDP:#SHOW %ansi(yellow)%item(@tdpText, 1);:TDP:#SHOW %ansi(green)%item(@tdpText, 2);:TDP:#SHOW %ansi(yellow)%item(@tdpText, 3);:TDP:#SHOW %ansi(green)%item(@tdpText, 4);:TDP:#SHOW %ansi(yellow)%item(@tdpText, 5);:TDP:#SHOW %ansi(green)%item(@tdpText, 6);:TDP:#SHOW %ansi(yellow)%item(@tdpText, 7);:TDP:#SHOW %ansi(green)%item(@tdpText, 8)}
#ALIAS tdpT {#IF (%1=on) {#T+ tdpT1} {#T- tdpT1}}
#ALIAS tdpCalc {#LOOPDB @tdpStats {tmpp=%key;#VARIABLE tdpList {};tdpList=%additem(@tdpCalc(%val,@{tdpFactor.@tmpp}),@tdpList);#LOOP %eval(%val+1),%eval(%val+5) {tdpList=%additem(%eval(@tdpCalc(%eval(%i),@{tdpFactor.@tmpp})+%item(@tdpList,%eval(%i-%val))),@tdpList)};tdpText=%additem(%format("&12s &2.0f &5.0f &5.0f &5.0f &5.0f &5.0f &5.0f",%key,%val,%item(@tdpList,1),%item(@tdpList,2),%item(@tdpList,3),%item(@tdpList,4),%item(@tdpList,5),%item(@tdpList,6)),@tdpText)}}
#VAR tdpCalc {%eval((%1*3)+(%2*%1/2))}
#VAR tdpList {}
#VAR tdpText {}
#VAR tdpType {0}
#TRIGGER "tdpT1" {Strength : (%d)%sReflex : (%d)} {tdpStats.Strength=%1;tdpStats.Reflex=%2} "" {disable}
#COND {Agility : (%d)%sCharisma : (%d)} {tdpStats.Agility=%1;tdpStats.Charisma=%2} {disable}
#COND {Discipline : (%d)%sWisdom : (%d)} {tdpStats.Discipline=%1;tdpStats.Wisdom=%2} {disable}
#COND {Intelligence : (%d)%sStamina : (%d)} {tdpStats.Intelligence=%1;tdpStats.Stamina=%2} {disable}
#COND {} {tdpdone} {wait|param=500|disable}
#CLASS 0
#CLASS {Tdp|tdpLists}
#ALIAS tdpMakeLists {#ADDKEY tdpStats {Strength=0|Reflex=0|Agility=0|Charisma=0|Discipline=0|Wisdom=0|Intelligence=0|Stamina=0};#ADDKEY tdpFactor {Strength=1|Reflex=-1|Agility=0|Charisma=0|Discipline=0|Wisdom=-1|Intelligence=-1|Stamina=2}}
#CLASS 0 |
|
|