Quote:
Originally Posted by stinka123
what is type and typeID of hamer?
Ex: Type = 25, TypeID = 204, ReqLuc = 25204-65536=-40332
So -40332 is reqluc 
|
hmm ....
25204 is in the range of a signed 16-bits value, it must be stored in DB as 25204.
a few history: computers don't care about signedness of numbers and never compute in base 10.
a 16-bit value (the ReqLuc column is defined as "smallint" meaning 16-bit value) can contain any number ranging 0000000000000000b up to 1111111111111111b or 0000h up to FFFFh
human use to compute in base 10 (not 2 or 16) so we use to say that the range is 0 up to 65535; and because human activities (not computer ones) do require negative values, we split that range to define numbers in -32768 up to 32767.
because SQL server is stupid and doesn't support unsigned int, a value greater than 32767 (in base 10!) can not be written in a smallint field and we have to provide a negative value obtained with a "signed modular shift" ... a substract of 65536, but if and only if the figure is bigger than 32767; and 25204 wasn't a good example.
so to properly enter ReqLuc figures:
- look if they are or aren't bigger than 32676
- or, type-in an Hex value
update Items set Reqluc=0xAC1D where ItemID=1116
does work since "computer uses hexa and doesn't care about signedness"
- or, use shStudio (with the advantage to do the change of sdata & DB from a single place and let you change the description to let the player know which item he/she must use)