Here is Enemy/Player Display hp. The format is a little different because I made this for the program I'm working on. You guys should be able to figure out what goes where.
hpDisplay.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<rotmg version="1.0">
<mod id="Enemy/Player Display HP">
<code file2mod="com/company/assembleegameclient/objects/GameObject.class.asasm"
line="5283">
hpDisplay_1.txt
</code>
<code file2mod="com/company/assembleegameclient/objects/GameObject.class.asasm"
line="5290">
hpDisplay_2.txt
</code>
<code file2mod="com/company/assembleegameclient/objects/GameObject.class.asasm"
line="5299">
hpDisplay_3.txt
</code>
<code file2mod="com/company/assembleegameclient/objects/GameObject.class.asasm"
line="5311">
hpDisplay_4.txt
</code>
<code file2mod="com/company/assembleegameclient/net/_-03v.class.asasm"
line="8131">
hpDisplay_5.txt
</code>
</mod>
</rotmg>
hpDisplay_1.txt
Code:
getlocal0
getlex QName(PackageNamespace(""), "_-d7")
getlocal2
subtract
dup
setlocal 13
convert_d
getlex QName(PackageNamespace(""), "_-Kj")
convert_d
divide
callproperty QName(PackageNamespace(""), "g2r_color"), 1
setlocal 14
hpDisplay_2.txt
hpDisplay_3.txt
hpDisplay_4.txt
Code:
trait method QName(PackageNamespace(""), "g2r_color")
method
refid "com.company.assembleegameclient.objects:GameObject/g2r_color"
param QName(PackageNamespace(""), "Number")
returns QName(PackageNamespace(""), "int")
body
maxstack 7
localcount 2
initscopedepth 1
maxscopedepth 1
code
getlocal1
pushdouble .5
ifgt OVER_50
pushint 16776960 ; yellow
pushint 1280
findpropstrict QName(PackageNamespace(""), "int")
pushbyte 50
getlocal1
pushbyte 100
multiply
subtract
callproperty QName(PackageNamespace(""), "int"), 1
multiply
subtract
returnvalue
OVER_50:
pushint 65280 ; green
pushint 327680
findpropstrict QName(PackageNamespace(""), "int")
pushbyte 100
getlocal1
pushbyte 100
multiply
subtract
callproperty QName(PackageNamespace(""), "int"), 1
multiply
add
returnvalue
end ; code
end ; body
end ; method
end ; trait
hpDisplay_5.txt
Code:
getlocal1
getproperty QName(PackageNamespace(""), "color_")
pushint 65280
ifne NOT_HP
getlocal1
getproperty QName(PackageNamespace(""), "text_")
pushbyte 0
pushbyte 1
callproperty QName(Namespace("http://adobe.com/AS3/2006/builtin"), "slice"), 2
pushstring "+"
ifne NOT_HP
findpropstrict QName(PackageNamespace(""), "int")
getlocal1
getproperty QName(PackageNamespace(""), "text_")
callproperty QName(PackageNamespace(""), "int"), 1
getlocal2
getproperty QName(PackageNamespace(""), "_-d7")
add
dup
getlocal1
swap
pushstring " ["
add
getlocal1
getproperty QName(PackageNamespace(""), "text_")
add
pushstring "]"
add
setproperty QName(PackageNamespace(""), "text_")
getlocal2
swap
getlocal2
getproperty QName(PackageNamespace(""), "_-Kj")
convert_d
divide
callproperty QName(PackageNamespace(""), "g2r_color"), 1
getlocal1
swap
setproperty QName(PackageNamespace(""), "color_")
NOT_HP:
The .xml file (code for hpDisplay.xml here) says where to place everything. file2mod is the file to modify and line is a line number reference of where to place the code in file2mod (in an unmodified state). The .txt file reference is where to find the code to insert. Place code in the .txt below the instruction found on reference line number.