@@ -22,18 +22,22 @@ extern "C" float GetGearScaling(cube::Item * item, cube::Creature* creature, int
2222
2323 int effective_rarity = item->GetEffectiveRarity (®ion);
2424 float base_res = ((base * 0 .5f ) / (float )0x20 );
25- float mod_modifier = (mod3 / 0x10624DD3 ) / 7 .0f ;
25+ float mod_modifier = (mod3 / 0x10624DD3 ) / 8 .0f ;
2626
2727 float X = 1.4 ;
28- float Y = base_res + effective_rarity + mod_modifier;
2928
30- float result = std::powf (X, Y) ;
29+ float result = X + base_res + mod_modifier ;
3130
3231 cube::Game* game = cube::GetGame ();
3332 if (game && creature->entity_data .hostility_type == cube::Creature::EntityBehaviour::Player)
3433 {
35- result *= 0.5 * std::pow (2.7183 , 0.2 * GetItemLevel (item)) / 1.21 * std::pow (0.99 , 1 + 0.07 * GetItemLevel (item) * GetItemLevel (item));
34+ result *= 1 + log2f ((GetItemLevel (item) + 0 .5f * effective_rarity + 1001 .0f ) / 1000 .0f ) * 1000 .0f ;
35+ }
36+ else if (creature->entity_data .hostility_type == cube::Creature::EntityBehaviour::Hostile)
37+ {
38+ result *= 0 .1f * (effective_rarity + 1 );
3639 }
40+
3741 return result;
3842}
3943
@@ -64,37 +68,50 @@ extern "C" float GetOtherStatsRe(cube::Item * item, cube::Creature * creature)
6468
6569 float result = std::powf (X, Y);
6670
67-
68- result *= 0 .01f + 0 .0016f * GetItemLevel (item);
69- if (result > 0 .2f ) {
70- result = std::log2f (result/0 .2f )*0 .2f + 0 .2f ;
71- result *= randomizer;
71+ cube::Game* game = cube::GetGame ();
72+ if (game && creature->entity_data .hostility_type == cube::Creature::EntityBehaviour::Player)
73+ {
74+ result *= 0 .01f + 0 .0016f * GetItemLevel (item);
75+ if (result > 0 .2f ) {
76+ result = std::log2f (result / 0 .2f ) * 0 .2f + 0 .2f ;
77+ result *= randomizer;
78+ }
7279 }
80+ return result;
81+ }
7382
7483
75-
84+ extern " C " float GetHasteRe (cube::Item * item, cube::Creature * creature) {
7685 int category = item->category ;
7786
7887 if (category < 3 || category > 9 )
7988 {
80- result *= 0 ;
89+ return 0 ;
8190 }
8291
83-
84- return result;
92+ return GetOtherStatsRe (item, creature) * (PyroRand (item->modifier ) / 32768 .0f );
8593}
8694
95+ extern " C" float GetRegenRe (cube::Item * item, cube::Creature * creature) {
96+ int category = item->category ;
8797
88- extern " C" float GetHasteRe (cube::Item * item, cube::Creature * creature) {
89- return GetOtherStatsRe (item, creature) * PyroRand (item->modifier + 0x157 ) / 32768 ;
90- }
98+ if ((category < 4 || category > 9 ) && category != 26 )
99+ {
100+ return 0 ;
101+ }
91102
92- extern " C" float GetRegenRe (cube::Item * item, cube::Creature * creature) {
93- return GetOtherStatsRe (item, creature) * PyroRand (item->GetSellingPrice () + 0x159 ) / 32768 ;
103+ return GetOtherStatsRe (item, creature) * (PyroRand (item->modifier + 0x157 ) / 32768 .0f );
94104}
95105
96106extern " C" float GetCritRe (cube::Item * item, cube::Creature * creature) {
97- return GetOtherStatsRe (item, creature) * PyroRand (item->GetBuyingPrice () + 0x161 ) / 32768 ;
107+ int category = item->category ;
108+
109+ if (category < 3 || category > 10 )
110+ {
111+ return 0 ;
112+ }
113+
114+ return GetOtherStatsRe (item, creature) * (PyroRand (item->modifier + 0x99 ) / 32768 .0f );
98115}
99116
100117extern " C" float GearScaling (float x, float y, cube::Item* item)
0 commit comments