Skip to content

Commit 70bf662

Browse files
Change starting gear to lvl 1 plus gear
1 parent 8eb450e commit 70bf662

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

main.cpp

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ class Mod : GenericMod {
9898
}
9999
}
100100

101+
if (!player)
102+
{
103+
return;
104+
}
105+
101106
// Show and move xp bar and level info
102107
plasma::Node* node = game->gui.levelinfo_node;
103108
node->SetVisibility(true);
@@ -119,6 +124,26 @@ class Mod : GenericMod {
119124
{
120125
storage->modifier = 1;
121126
storage->region = entity_data->current_region;
127+
128+
const int modifier = 0;
129+
130+
entity_data->equipment.weapon_right.modifier = modifier;
131+
entity_data->equipment.weapon_left.modifier = modifier;
132+
entity_data->equipment.chest.modifier = modifier;
133+
entity_data->equipment.feet.modifier = modifier;
134+
entity_data->equipment.hands.modifier = modifier;
135+
entity_data->equipment.neck.modifier = modifier;
136+
entity_data->equipment.shoulder.modifier = modifier;
137+
entity_data->equipment.ring_left.modifier = modifier;
138+
entity_data->equipment.ring_right.modifier = modifier;
139+
140+
if (player->inventory_tabs.size() > 1)
141+
{
142+
for (cube::ItemStack& itemstack : player->inventory_tabs.at(0))
143+
{
144+
itemstack.item.modifier = modifier;
145+
}
146+
}
122147
}
123148

124149
return;
@@ -214,6 +239,11 @@ class Mod : GenericMod {
214239
return;
215240
}
216241

242+
if (item->category < 3 || item->category > 9)
243+
{
244+
return;
245+
}
246+
217247
if (creature->entity_data.level + LEVEL_EQUIPMENT_CAP >= GetItemLevel(item))
218248
{
219249
return;
@@ -231,11 +261,6 @@ class Mod : GenericMod {
231261
return;
232262
}
233263

234-
if (item->category < 3 || item->category > 9)
235-
{
236-
return;
237-
}
238-
239264
this->OnCreatureCanEquipItem(game->GetPlayer(), item, wearable);
240265
}
241266

src/XPOverwrite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
extern "C" int XP_Overwrite(int level)
66
{
77
//return (1050 * level - 50) / (level + 19);
8-
return 10 * std::powf(level + 1, 1.3f);
8+
return 50 * std::powf(level + 1, 1.3f);
99
}
1010

1111
__attribute__((naked)) void ASM_XP_Overwrite() {

src/utility.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
#include "cwsdk.h"
33

4-
#define LEVELS_PER_REGION 20
5-
#define LEVEL_EQUIPMENT_CAP 20
4+
#define LEVELS_PER_REGION 10
5+
#define LEVEL_EQUIPMENT_CAP 5
66

77
int GetRegionDistance(IntVector2 region);
88
int GetItemLevel(cube::Item* item);

0 commit comments

Comments
 (0)