Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Ultimate Weapon 10 Gem Slots

One word! Im Fawkin Pro!
Loyal Member
Joined
Jul 1, 2010
Messages
1,254
Reaction score
359
Hello!

This is a release from the development thread:
https://forum.ragezone.com/f484/ultimate-weapon-gem-slots-1204719/

This release will change amount of Gem Slots an Ultimate Weapon have. (From 5 Gem Slots to 10).
Some pointers;
This release is for +10 Ultimate Weapons.
It will create a Gem Slot from +1 to +10 (10 slots)

If there are any bugs after you have carefully followed the tutorial, feel free to mention it.

I am using the following source:
https://forum.ragezone.com/f457/vs22-v18-2-a-1203918/
I am using v15 Theme. If you use V19 Theme, you will have to change it accordingly.

If you are using another source and something does not work, please mention that with some awesome information to get the best assistance possible.

Files in source that will be changed:
kCommon.h (Or Versioncommon.h in Neuz & WorldServer)
UltimateWeapon.cpp
tooltip.cpp
tooltip.h
WndField.cpp (APP_SMELT_JEWEL, APP_SMELT_REMOVE_JEWEL)
WndField.h
WndManager.cpp
cmnhdr.h

Files in resource that will be changed:
resdata.h
resdata.inc (v19)
resdata.txt.txt
Ultimate_GemAbility.txt

We will start with the Resource files.
resdata.h
Add the following under WIDC_JEWEL_SLOT5:
Code:
#define WIDC_JEWEL_SLOT6             1356
#define WIDC_JEWEL_SLOT7             1357
#define WIDC_JEWEL_SLOT8             1358
#define WIDC_JEWEL_SLOT9             1359
#define WIDC_JEWEL_SLOT10             1360
Add the following under WIDC_JEWEL_SLOT_INFO5:
Code:
#define WIDC_JEWEL_SLOT_INFO6             1361
#define WIDC_JEWEL_SLOT_INFO7             1362
#define WIDC_JEWEL_SLOT_INFO8             1363
#define WIDC_JEWEL_SLOT_INFO9             1364
#define WIDC_JEWEL_SLOT_INFO10             1365
resdata.inc
Replace APP_SMELT_REMOVE_JEWEL with:
Code:
APP_SMELT_REMOVE_JEWEL "WndTile00.tga" "" 1 496 432 0x2410000 26
{
// Title String
IDS_RESDATA_INC_005738
}
{
// ToolTip
IDS_RESDATA_INC_005739
}
{
    WTYPE_STATIC WIDC_PIC_SLOT "WndChgElemItem.bmp" 0 224 18 256 50 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005082
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005083
    }
    WTYPE_TEXT WIDC_TEXT1 "WndEditTile00.tga" 1 10 282 463 358 0x20020000 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005084
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005085
    }
    WTYPE_BUTTON WIDC_START "ButtStart.bmp" 0 197 364 261 384 0x220010 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005086
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005087
    }
    WTYPE_STATIC WIDC_PIC_SLOT1 "WndChgElemItem.bmp" 0 224 56 256 88 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005740
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005741
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT1 "WndChgElemItem.bmp" 0 22 100 54 132 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005742
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005743
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO1 "Window02.bmp" 0 68 100 236 132 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005744
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005745
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT2 "WndChgElemItem.bmp" 0 22 136 54 168 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005746
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005747
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT3 "WndChgElemItem.bmp" 0 22 172 54 204 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005748
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005749
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT4 "WndChgElemItem.bmp" 0 22 208 54 240 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005750
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005751
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT5 "WndChgElemItem.bmp" 0 22 244 54 276 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005752
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005753
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO2 "Window02.bmp" 0 68 136 236 168 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005754
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005755
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO3 "Window02.bmp" 0 68 172 236 204 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005756
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005757
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO4 "Window02.bmp" 0 68 208 236 240 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005758
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005759
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO5 "Window02.bmp" 0 68 244 236 276 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_005760
    }
    {
    // ToolTip
    IDS_RESDATA_INC_005761
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT6 "WndChgElemItem.bmp" 0 242 100 274 132 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009641
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009642
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT7 "WndChgElemItem.bmp" 0 242 136 274 168 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009643
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009644
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT8 "WndChgElemItem.bmp" 0 242 172 274 204 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009645
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009646
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT9 "WndChgElemItem.bmp" 0 242 208 274 240 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009647
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009648
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT10 "WndChgElemItem.bmp" 0 242 244 274 276 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009649
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009650
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO6 "Window02.bmp" 0 288 100 456 132 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009651
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009652
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO7 "Window02.bmp" 0 288 136 456 168 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009653
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009654
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO8 "Window02.bmp" 0 288 172 456 204 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009655
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009656
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO9 "Window02.bmp" 0 288 208 456 240 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009657
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009658
    }
    WTYPE_STATIC WIDC_JEWEL_SLOT_INFO10 "Window02.bmp" 0 288 244 456 276 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009659
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009660
    }

}
Replace APP_SMELT_JEWEL with:
Code:
APP_SMELT_JEWEL "WndTile00.tga" "" 1 304 432 0x2410000 26
{
// Title String
IDS_RESDATA_INC_004730
}
{
// ToolTip
IDS_RESDATA_INC_004731
}
{
    WTYPE_CUSTOM WIDC_CUSTOM1 "" 0 16 16 176 246 0x260000 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004732
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004733
    }
    WTYPE_TEXT WIDC_TEXT1 "WndEditTile00.tga" 1 12 260 275 358 0x20020000 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004734
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004735
    }
    WTYPE_STATIC WIDC_STATIC1 "WndChgElemItem.bmp" 0 192 32 224 64 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004736
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004737
    }
    WTYPE_STATIC WIDC_STATIC2 "WndChgElemItem.bmp" 0 192 74 224 106 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004738
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004739
    }
    WTYPE_STATIC WIDC_STATIC3 "WndChgElemItem.bmp" 0 192 116 224 148 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004740
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004741
    }
    WTYPE_STATIC WIDC_STATIC4 "WndChgElemItem.bmp" 0 192 158 224 190 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004742
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004743
    }
    WTYPE_STATIC WIDC_STATIC5 "WndChgElemItem.bmp" 0 192 200 224 232 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004744
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004745
    }
    WTYPE_STATIC WIDC_STATIC11 "Window01.bmp" 0 16 16 176 246 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004746
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004747
    }
    WTYPE_BUTTON WIDC_START "ButtStart.bmp" 0 116 370 180 390 0x220010 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_004748
    }
    {
    // ToolTip
    IDS_RESDATA_INC_004749
    }
    WTYPE_STATIC WIDC_STATIC6 "WndChgElemItem.bmp" 0 234 32 266 64 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009631
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009632
    }
    WTYPE_STATIC WIDC_STATIC7 "WndChgElemItem.bmp" 0 234 74 266 106 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009633
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009634
    }
    WTYPE_STATIC WIDC_STATIC8 "WndChgElemItem.bmp" 0 234 116 266 148 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009635
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009636
    }
    WTYPE_STATIC WIDC_STATIC9 "WndChgElemItem.bmp" 0 234 158 266 190 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009637
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009638
    }
    WTYPE_STATIC WIDC_STATIC10 "WndChgElemItem.bmp" 0 234 200 266 232 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_009639
    }
    {
    // ToolTip
    IDS_RESDATA_INC_009640
    }

}
resdata.txt.txt
Add whatever IDS_** you don't have, with empty string
Ultimate_GemAbility.txt
RED NUMBERS = Added
Feel free to change all of this to whatever you like, there should be 10 numbers on each item
Code:
ABILITY	DST_HP_MAX
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ01	228	455	683	910	1136	[COLOR="#B22222"][B]1365	1590	1817	2044	2498[/B][/COLOR]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY01	455	910	1365	1820	2275	[COLOR="#B22222"][B]2730	3185	3640	4095	5005	[/B][/COLOR]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE01	683	1365	2048	2730	3411	[COLOR="#B22222"][B]4095	4775	5457	6139	7503[/B][/COLOR]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD01	910	1820	2730	3640	4550	[COLOR="#B22222"][B]5460	6370	7280	8190	10010[/B][/COLOR]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND01	1138	2275	3413	4550	5690	[COLOR="#B22222"][B]6825	7966	9104	10242	12518[/B][/COLOR]
}

ABILITY	DST_ATKPOWER
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ02	13	25	38	50	62	[COLOR="#B22222"][B]75	85	97	109	133	[/B][/COLOR]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY02	25	50	75	100	125	[COLOR="#B22222"][B]150	175	200	225	275[/B][/COLOR]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE02	38	76	114	152 190	[COLOR="#B22222"][B]228	266	304	342	418[/B][/COLOR]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD02	50	100	150	200	250	[COLOR="#B22222"][B]300	350	400	450	550[/B][/COLOR]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND02	63	126	189	252	315	[B][COLOR="#B22222"]378	441	504	567	693[/COLOR][/B]
}		


ABILITY	DST_ADJDEF
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ03	10	20	30	40	50	[COLOR="#B22222"][B]60	70	80	90	110[/B][/COLOR]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY03	20	40	60	80	100	[COLOR="#B22222"][B]120	140	160	180	220[/B][/COLOR]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE03	30	60	90	120	150	[B][COLOR="#B22222"]180	210	240	270	330[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD03	40	80	120	160	200	[B][COLOR="#B22222"]240	280	320	360	440[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND03	50	100	150	200	250	[B][COLOR="#B22222"]300	350	400	450	550[/COLOR][/B]
}


ABILITY	DST_MELEE_STEALHP
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ04	1	2	3	4	5	[B][COLOR="#B22222"]6	7	8	9	11[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY04	2	3	5	6	8	[B][COLOR="#B22222"]9	11	12	14	16[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE04	2	4	6	8	10	[B][COLOR="#B22222"]12	14	16	18	22[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD04	3	5	8	10	13	[B][COLOR="#B22222"]15	18	20	22	26[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND04	3	6	9	12	18	[B][COLOR="#B22222"]21	24	27	30	36[/COLOR][/B]
}


ABILITY	DST_PVP_DMG
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ05	2	4	6	8	10	[B][COLOR="#B22222"]12	14	16	18	22[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY05	3	6	9	12	18	[B][COLOR="#B22222"]21	24	27	30	36[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE05	4	8	12	16	20	[B][COLOR="#B22222"]24	28	32	36	44[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD05	5	10	15	20	25	[B][COLOR="#B22222"]30	35	40	45	55[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND05	6	12	18	24	30	[B][COLOR="#B22222"]36	42	48	54	66[/COLOR][/B]
}

ABILITY	DST_STR
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ06	3	5	8	10	13	[B][COLOR="#B22222"]15	18	20	22	26[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY06	5	10	15	20	25	[B][COLOR="#B22222"]30	35	40	45	55[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE06	8	16	24	32	40	[B][COLOR="#B22222"]48	56	64	72	88[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD06	10	20	30	40	50	[B][COLOR="#B22222"]60	70	80	90	110[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND06	13	26	39	52	65	[B][COLOR="#B22222"]78	91	104	117	143[/COLOR][/B]
}

ABILITY	DST_STA
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ07	3	5	8	10	13	[B][COLOR="#B22222"]15	18	20	22	26[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY07	5	10	15	20	25	[B][COLOR="#B22222"]30	35	40	45	55[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE07	8	16	24	32	40	[B][COLOR="#B22222"]48	56	64	72	88[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD07	10	20	30	40	50	[B][COLOR="#B22222"]60	70	80	90	110[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND07	13	26	39	52	65	[B][COLOR="#B22222"]78	91	104	117	143[/COLOR][/B]
}
	
ABILITY	DST_DEX
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ08	3	5	8	10	13	[B][COLOR="#B22222"]15	18	20	22	26[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY08	5	10	15	20	25	[B][COLOR="#B22222"]30	35	40	45	55[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE08	8	16	24	32	40	[B][COLOR="#B22222"]48	56	64	72	88[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD08	10	20	30	40	50	[B][COLOR="#B22222"]60	70	80	90	110[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND08	13	26	39	52	65	[B][COLOR="#B22222"]78	91	104	117	143[/COLOR][/B]
}
	
ABILITY	DST_INT
{
	II_GEN_MAT_TOPAZ	II_GEN_MAT_TOPAZ09	3	5	8	10	13	[B][COLOR="#B22222"]15	18	20	22	26[/COLOR][/B]
	II_GEN_MAT_RUBY		II_GEN_MAT_RUBY09	5	10	15	20	25	[B][COLOR="#B22222"]30	35	40	45	55[/COLOR][/B]
	II_GEN_MAT_SAPPHIRE	II_GEN_MAT_SAPPHIRE09	8	16	24	32	40	[B][COLOR="#B22222"]48	56	64	72	88[/COLOR][/B]
	II_GEN_MAT_EMERALD	II_GEN_MAT_EMERALD09	10	20	30	40	50	[B][COLOR="#B22222"]60	70	80	90	110[/COLOR][/B]
	II_GEN_MAT_DIAMOND	II_GEN_MAT_DIAMOND09	13	26	39	52	65	[COLOR="#B22222"][B]78	91	104	117	143[/B][/COLOR]
}
That's everything you need for the Resource.

Now let's jump over to Source files
kCommon.h (Or if you are using another source, Versioncommon.h (Neuz & Worldserver)
Add the following:
Code:
#define __ULTIMATE_GEMSLOT_UPGRADE
UltimateWeapon.cpp
In BOOL CUltimateWeapon::Load_GemAbility()
look for for (int i = 0; i < 5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
				for (int i = 0; i < 10; i++)
#else
				for (int i = 0; i < 5; i++)
#endif
In int CUltimateWeapon::MakeItem( CUser* pUser, OBJID* objItemId )
look for for (int i = 0; i < 5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	for (int i = 0; i < 10; i++)
#else
	for (int i = 0; i < 5; i++)
#endif
look for it = &mapObjId2.find(objItemId[i + 5]); and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		it = &mapObjId2.find(objItemId[i + 10]);
#else
		it = &mapObjId2.find(objItemId[i + 5]);
#endif
look for mapObjId2.insert(map<OBJID, int>::value_type(objItemId[i + 5], 1)); and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			mapObjId2.insert(map<OBJID, int>::value_type(objItemId[i + 10], 1));
#else
			mapObjId2.insert(map<OBJID, int>::value_type(objItemId[i + 5], 1));
#endif
look for if (nItemCount != 5) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	if (nItemCount != 10)
#else
	if (nItemCount != 5)
#endif
look for if (nItemCount != 5) again and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	if (nItemCount != 10)
#else
	if (nItemCount != 5)
#endif
In int CUltimateWeapon::EnchantWeapon( CUser* pUser, OBJID objItem, OBJID objItemGem )
look for if (pAbilityOpt > 5) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		if (pAbilityOpt > 0)
#else
		if (pAbilityOpt > 5)
#endif
look for pUser->UpdateItem((BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - 5); and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			pUser->UpdateItem((BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - 0);
#else
			pUser->UpdateItem((BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - 5);
#endif
In BYTE CUltimateWeapon::SmeltSafetyUltimate( CUser* pUser, CItemElem* pItemMain, CItemElem* pItemMaterial, CItemElem* pItemProtScr )
look for if( pItemMain->GetAbilityOption() > 5 )
pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pItemMain->GetAbilityOption() - 5 );
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		if (pItemMain->GetAbilityOption() > 0)
			pUser->UpdateItem((BYTE)pItemMain->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pItemMain->GetAbilityOption() - 0);
#else
		if( pItemMain->GetAbilityOption() > 5 )
			pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pItemMain->GetAbilityOption() - 5 );
#endif
tooltip.cpp(the code here could probably be better, but hey, if it works it works.)
In void CToolTip::paint(C2DRender* p2DRender)
look for rect.SetRect(pt.x, pt.y - (36), pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height());
if (rect.top < p2DRender->m_clipRect.top)
{
pt.y = p2DRender->m_clipRect.top + 8;
rect.SetRect(pt.x, pt.y, pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height() + (36));
}
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			if (m_nSlot > 5) {
				rect.SetRect(pt.x, pt.y - (72), pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height());
				if (rect.top < p2DRender->m_clipRect.top)
				{
					pt.y = p2DRender->m_clipRect.top + 8;
					rect.SetRect(pt.x, pt.y, pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height() + (72));
				}
			}
			else
			{
				rect.SetRect(pt.x, pt.y - (36), pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height());
				if (rect.top < p2DRender->m_clipRect.top)
				{
					pt.y = p2DRender->m_clipRect.top + 8;
					rect.SetRect(pt.x, pt.y, pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height() + (36));
				}
			}
#else
			rect.SetRect(pt.x, pt.y - (36), pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height());
			if (rect.top < p2DRender->m_clipRect.top)
			{
				pt.y = p2DRender->m_clipRect.top + 8;
				rect.SetRect(pt.x, pt.y, pt.x + m_rectRender.Width(), pt.y + m_rectRender.Height() + (36));
			}
#endif
look for point.x = PlusRect.left + 14 + ((PlusRect.Width() - 194) / 2);
point.y = PlusRect.bottom - 24;

for (int i = 0; i < m_nSlot; i++)
{
if (m_pJewelBgTexture != NULL)
m_pJewelBgTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);

//Jewel Render
if (m_nAddedJewel != 0)
{
ItemProp* pItemProp;
pItemProp = prj.GetItemProp(m_nAddedJewel);
if (pItemProp != NULL)
{
pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, pItemProp->szIcon), 0xffff00ff);
if (pTexture != NULL)
pTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);
}
}

point.x += 38;
}
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			if (m_nSlot <= 5) {
				point.x = PlusRect.left + 14 + ((PlusRect.Width() - 194) / 2);
				point.y = PlusRect.bottom - 24;


				for (int i = 0; i < m_nSlot; i++)
				{
					if (m_pJewelBgTexture != NULL)
						m_pJewelBgTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);

					//Jewel Render
					if (m_nAddedJewel[i] != 0)
					{
						ItemProp* pItemProp;
						pItemProp = prj.GetItemProp(m_nAddedJewel[i]);
						if (pItemProp != NULL)
						{
							pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, pItemProp->szIcon), 0xffff00ff);
							if (pTexture != NULL)
								pTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);
						}
					}

					point.x += 38;
				}
			}
			if (m_nSlot > 5)
			{
				point.x = PlusRect.left + 14 + ((PlusRect.Width() - 194) / 2);
				point.y = PlusRect.bottom - 62;

				for (int i = 0; i < 5; i++)
				{
					if (m_pJewelBgTexture != NULL)
						m_pJewelBgTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);

					//Jewel Render
					if (m_nAddedJewel[i] != 0)
					{
						ItemProp* pItemProp;
						pItemProp = prj.GetItemProp(m_nAddedJewel[i]);
						if (pItemProp != NULL)
						{
							pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, pItemProp->szIcon), 0xffff00ff);
							if (pTexture != NULL)
								pTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);
						}
					}

					point.x += 38;
				}

				point.x = PlusRect.left + 14 + ((PlusRect.Width() - 194) / 2);

				for (int i = 5; i < m_nSlot; i++)
				{
					point.y = PlusRect.bottom - 24;
					if (m_pJewelBgTexture != NULL)
						m_pJewelBgTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);

					if (m_nAddedJewel[i] != 0)
					{
						ItemProp* pItemProp;
						pItemProp = prj.GetItemProp(m_nAddedJewel[i]);
						if (pItemProp != NULL)
						{
							pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, pItemProp->szIcon), 0xffff00ff);
							if (pTexture != NULL)
								pTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);
						}
					}

					point.x += 38;
				}
			}
#else
			point.x = PlusRect.left + 14 + ((PlusRect.Width() - 194) / 2);
			point.y = PlusRect.bottom - 24;

			for (int i = 0; i < m_nSlot; i++)
			{
				if (m_pJewelBgTexture != NULL)
					m_pJewelBgTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);

				//Jewel Render
				if (m_nAddedJewel[i] != 0)
				{
					ItemProp* pItemProp;
					pItemProp = prj.GetItemProp(m_nAddedJewel[i]);
					if (pItemProp != NULL)
					{
						pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, pItemProp->szIcon), 0xffff00ff);
						if (pTexture != NULL)
							pTexture->RenderScal(p2DRender, point, 255, 1.0f, 1.0f);
					}
				}

				point.x += 38;
			}
#endif
tooltip.h
look for int m_nAddedJewel[5]; and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	int			m_nAddedJewel[10];
#else
	int			m_nAddedJewel[5];
#endif
WndField.cpp
In void CWndInventory::RunUpgrade( CItemBase* pItem )
look for for (int i = 0; i < 5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
				for (int i = 0; i < 10; i++)
#else
				for (int i = 0; i < 5; i++)
#endif
In CWndSmeltJewel::CWndSmeltJewel()
look for for(int i=0; i<5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	for(int i=0; i<10; i++)
#else
	for(int i=0; i<5; i++)
#endif
In void CWndSmeltJewel::OnInitialUpdate()
look for m_nJewelSlot[4] = WIDC_STATIC5; and under it add
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	m_nJewelSlot[5] = WIDC_STATIC6;
	m_nJewelSlot[6] = WIDC_STATIC7;
	m_nJewelSlot[7] = WIDC_STATIC8;
	m_nJewelSlot[8] = WIDC_STATIC9;
	m_nJewelSlot[9] = WIDC_STATIC10;
#endif
look for for(int i=0; i<5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	for(int i=0; i<10; i++)
#else
	for(int i=0; i<5; i++)
#endif
In BOOL CWndSmeltJewel::process()
look for if( (m_nUsableSlot >= 0 && m_nUsableSlot < 5) && m_dwJewel[m_nUsableSlot] != -1) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			if ((m_nUsableSlot >= 0 && m_nUsableSlot < 10) && m_dwJewel[m_nUsableSlot] != -1)
#else
			if( (m_nUsableSlot >= 0 && m_nUsableSlot < 5) && m_dwJewel[m_nUsableSlot] != -1)
#endif
In void CWndSmeltJewel::OnDraw( C2DRender* p2DRender )
look for for(int i=0; i<5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		for(int i=0; i<10; i++)
#else
		for(int i=0; i<5; i++)
#endif
In BOOL CWndSmeltJewel::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
look for for(int i=0; i<5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			for(int i=0; i<10; i++)
#else
			for(int i=0; i<5; i++)
#endif
look for i = 5; and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
					i = 10;
#else
					i = 5;
#endif
In void CWndSmeltJewel::InitializeJewel(CItemElem* pItemElem)
look for for(int i=0; i<5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	for(int i=0; i<10; i++)
#else
	for(int i=0; i<5; i++)
#endif
In void CWndRemoveJewel::OnDraw( C2DRender* p2DRender )
look for if(m_nJewelCount > 5) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
			if (m_nJewelCount > 10)
#else
			if(m_nJewelCount > 5)
#endif
In void CWndRemoveJewel::OnInitialUpdate()
look for m_nJewelSlot[4] = WIDC_JEWEL_SLOT5; and under it add
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	m_nJewelSlot[5] = WIDC_JEWEL_SLOT6;
	m_nJewelSlot[6] = WIDC_JEWEL_SLOT7;
	m_nJewelSlot[7] = WIDC_JEWEL_SLOT8;
	m_nJewelSlot[8] = WIDC_JEWEL_SLOT9;
	m_nJewelSlot[9] = WIDC_JEWEL_SLOT10;
#endif
look for m_nInfoSlot[4] = WIDC_JEWEL_SLOT_INFO5; and under it add
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	m_nInfoSlot[5] = WIDC_JEWEL_SLOT_INFO6;
	m_nInfoSlot[6] = WIDC_JEWEL_SLOT_INFO7;
	m_nInfoSlot[7] = WIDC_JEWEL_SLOT_INFO8;
	m_nInfoSlot[8] = WIDC_JEWEL_SLOT_INFO9;
	m_nInfoSlot[9] = WIDC_JEWEL_SLOT_INFO10;
#endif
In void CWndRemoveJewel::OnMouseWndSurface(CPoint point)
look for wndCtrl = GetWndCtrl(WIDC_JEWEL_SLOT_INFO5); and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	wndCtrl = GetWndCtrl(WIDC_JEWEL_SLOT_INFO10);
#else
	wndCtrl = GetWndCtrl(WIDC_JEWEL_SLOT_INFO5);
#endif
WndField.h
look for DWORD m_dwJewel[5];
int m_nJewelSlot[5];
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	DWORD m_dwJewel[10];
	int m_nJewelSlot[10];
#else
	DWORD m_dwJewel[5];
	int m_nJewelSlot[5];
#endif
look for int m_nJewelID[5];
int m_nJewelSlot[5];
CTexture* m_pJewelTex[5];
int m_nInfoSlot[5];
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	int			m_nJewelID[10];
	int			m_nJewelSlot[10];
	CTexture*	m_pJewelTex[10];
	int			m_nInfoSlot[10];
#else
	int			m_nJewelID[5];
	int			m_nJewelSlot[5];
	CTexture*	m_pJewelTex[5];
	int			m_nInfoSlot[5];
#endif
WndManager.cpp
In void CWndMgr::putAddedOpt( CItemElem* pItemElem, CEditString* pEdit )
look for int nAddedOpt[5];
int nAddedValue[5];
and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	int nAddedOpt[10];
	int nAddedValue[10];
#else
	int nAddedOpt[5];
	int nAddedValue[5];
#endif
look for for (i = 0; i < 5; i++) and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
	for (i = 0; i < 10; i++)
#else
	for (i = 0; i < 5; i++)
#endif
CmnHdr.h
look for #define MAX_PIERCING_ULTIMATE 5 and replace it with
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
#define MAX_PIERCING_ULTIMATE	10
#else
#define MAX_PIERCING_ULTIMATE	5
#endif


I will add on how to make 10 gem slots on a +20 ultimate weapon in the future, where as it will give a slot every 2 upgrade (+2, +4, +6, +8... etc) if there are any requests for it.
 
Last edited:
Newbie Spellweaver
Joined
Sep 8, 2011
Messages
67
Reaction score
252
Nice release. Although, there are a few things I'd personally do differently. For instance, you can swap some hard-coded numbers with MAX_ULTIMATE_PIERCING and also implement MAX_ULTIMATE_AAO for math regarding where the jewels start happening.

Cmnhdr.h
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
constexpr unsigned long MAX_PIERCING_ULTIMATE = 10;
constexpr unsigned long MAX_ULTIMATE_AAO = 10;
#else
#define	MAX_PIERCING_ULTIMATE	5
#endif
(use define if on older c++)

Then, you're also able to change a few of the for loops to
Code:
for (int i = 0; i < MAX_PIERCING_ULTIMATE; ++i)

For parts when setting the WIDC like
Code:
m_nJewelSlot[5] = WIDC_STATIC6;
You could change the defines used to something that is incremental so you could loop define them with WIDC_STATIC1 + the loop counter. However, it's not possible using those statics because their define numbers are all over the place. This would also let the user define their own amount up till 10 unless they add more to the window themselves.

Then in: CUltimateWeapon::EnchantWeapon
You'd be able to set it like so
Code:
	int pAbilityOpt = pItemElemWeapon->GetAbilityOption();
	if( (pAbilityOpt+1) > MAX_ULTIMATE_AAO )


This code is potentially useless and you could use ifndef instead
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		if (pAbilityOpt > 0)
#else
		if (pAbilityOpt > 5)
#endif

But, if the user wants less than 10, and the using MAX_ULTIMATE_AAO
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		if (pAbilityOpt > MAX_ULTIMATE_AAO - MAX_PIERCING_ULTIMATE)
			pUser->UpdateItem( (BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - (MAX_ULTIMATE_AAO - MAX_PIERCING_ULTIMATE) );
#else
		if (pAbilityOpt > 5)
			pUser->UpdateItem( (BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - 5 );
#endif
And if you use C++17
Code:
		if (const unsinged long jewelStart = MAX_ULTIMATE_AAO - MAX_PIERCING_ULTIMATE; pAbilityOpt > JewelStart) 
			pUser->UpdateItem( (BYTE)pItemElemWeapon->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, pAbilityOpt - jewelStart);
Would work as it would do the math.

Although, this is all just personal preference.
 
One word! Im Fawkin Pro!
Loyal Member
Joined
Jul 1, 2010
Messages
1,254
Reaction score
359
That is some great points. I was doing a lot of changes at first since the whole thing is pretty stupidly coded to begin with.
But then I couldnt really be arsed to continue so just went with the ”simple” changes. Haha

Also about this part;

This code is potentially useless and you could use ifndef instead
Code:
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
		if (pAbilityOpt > 0)
#else
		if (pAbilityOpt > 5)
#endif

As I know it is not really needed, I left it like this because this decides when the Gem Slots will appear, one might want to Edit this in the future ??????

But yeah, so much could be better with this code ??????
 
Junior Spellweaver
Joined
Aug 5, 2011
Messages
169
Reaction score
7
Awesome guide, Xakzi!
To make the ResistItem command to apply the 10 slots:
FuncTextCmd.cpp:
change
Code:
if( nAbilityOption > 5 && pItemElem0->GetProp()->dwReferStat1 == WEAPON_ULTIMATE )
#if __VER >= 12 // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, nAbilityOption -5 );
#else // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_PIERCING_SIZE, nAbilityOption -5 );
#endif // __EXT_PIERCING

to something like:
Code:
#ifdef __ULTIMATE_GEMSLOT_UPGRADE
if( nAbilityOption > 0 && pItemElem0->GetProp()->dwReferStat1 == WEAPON_ULTIMATE )
#if __VER >= 12 // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, nAbilityOption );
#else // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_PIERCING_SIZE, nAbilityOption );
#endif // __EXT_PIERCING
#else
if( nAbilityOption > 5 && pItemElem0->GetProp()->dwReferStat1 == WEAPON_ULTIMATE )
#if __VER >= 12 // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_ULTIMATE_PIERCING_SIZE, nAbilityOption -5 );
#else // __EXT_PIERCING
		pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_PIERCING_SIZE, nAbilityOption -5 );
#endif // __EXT_PIERCING
#endif
 
Back
Top