Endless Tower Instance with Difficulties

Louis T Steinhil

New member
Messages
172
Points
0
Age
35
Discord
Louis T Steinhil#8600
Emulator
Hercules







View File

Endless Tower Instance with Difficulties



A small tweak on Endless Tower Instance.

Increases Monsters HP, Attack, Def/Mdef, Flee and Hit per difficulty.

Rewards Instance Points Easy, Vet, Nightmare, Hell & Torment.

Generates Alias to monsters if you're on different difficulty.

Added Emistry's Currency Shop

Note: You are going to experience this since there's a limit on setunitdata.
View attachment 7778

The workaround to this is:

find this in setunitdata (src/map/script.c)
 

case UDT_STR:
case UDT_AGI:
case UDT_VIT:
case UDT_INT:
case UDT_DEX:
case UDT_LUK:
case UDT_STATPOINT:
case UDT_ATKRANGE:
case UDT_ATKMIN:
case UDT_ATKMAX:
case UDT_MATKMIN:
case UDT_MATKMAX:
case UDT_AMOTION:
case UDT_ADELAY:
case UDT_DMOTION:
//setunitdata_check_bounds(4, 0, USHRT_MAX); <---comment out then add
setunitdata_check_min(4, 0);
break;
case UDT_DEF:





View attachment 7790







 
Hello, I think you have uploaded the wrong file here :) it is a card collector.txt, not endless tower.

On a side note, doing this change in setunitdata:

case UDT_DMOTION:
//setunitdata_check_bounds(4, 0, USHRT_MAX); <---comment out then add
setunitdata_check_min(4, 0);
break;




is not increasing the limit. You just disabled the safety check and is letting the compiler set whatever value it wants (there is a logic to what is setting but this is a bit level and I don't know 100% how to expain/whether it is consistent on all compilers).

These variables are not big enough to support values higher than ~65000 (USHRT_MAX). It doesn't error out because the code is doing a cast, and it will simply ignore part of the value and go ahead with whatever the casting resolves to. (Which will be between 0 and ~65000).

From an online compiler, 96,000 will actually become 30,464 and 120,000 will actually be 54,464.

Try doing a getunitdata after you set it and you will see the real value.

To go over 65k at least the variables needs to be changed from short to int, I am not sure if this would be enough or this would cause issues in other parts, but unless this is done, you can't set a value higher than 65k (and that's why you see this error in vanilla herc)

 
Back
Top