]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Stats.cpp
fixed property names of BattleResources
[l2e.git] / src / battle / Stats.cpp
index c35a14ad339e54c34490e2771a94c451df4d7082..cdf321036db0ab7941628371858983a63041fb93 100644 (file)
@@ -7,6 +7,11 @@
 
 #include "Stats.h"
 
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
 namespace battle {
 
 Stats::Stats()
@@ -31,4 +36,22 @@ Stats::Stats(Uint16 attack, Uint16 defense, Uint16 strength, Uint16 agility, Uin
 
 }
 
+
+void Stats::CreateTypeDescription() {
+       Stats s;
+
+       int numberId(TypeDescription::GetTypeId("Number"));
+
+       TypeDescription &td(TypeDescription::CreateOrGet("Stats"));
+       td.SetSize(sizeof(Stats));
+
+       td.AddField("atp", FieldDescription(((char *)&s.attack) - ((char *)&s), numberId, false));
+       td.AddField("dfp", FieldDescription(((char *)&s.defense) - ((char *)&s), numberId, false));
+       td.AddField("str", FieldDescription(((char *)&s.strength) - ((char *)&s), numberId, false));
+       td.AddField("agl", FieldDescription(((char *)&s.agility) - ((char *)&s), numberId, false));
+       td.AddField("int", FieldDescription(((char *)&s.intelligence) - ((char *)&s), numberId, false));
+       td.AddField("gut", FieldDescription(((char *)&s.gut) - ((char *)&s), numberId, false));
+       td.AddField("mgr", FieldDescription(((char *)&s.magicResistance) - ((char *)&s), numberId, false));
+}
+
 }