SphereServer BugTracker - SphereServer
View Issue Details
0001866SphereServerexecutable - genericpublic14-12-10 05:3324-03-13 19:44
Coruja 
RanXerox 
normalminoralways
resolvedfixed 
 
 
09-09-2008
None
None
0001866: Sphere setting random MORE2 for t_potion on worldsave
When you create an custom potion without MORE2, sphere will set a random MORE2 for this potion if it using t_potion typedef. This random value get stored on the item after any worldsave.
This thing makes potions unable to stack because of different MORE2
PART 1 (creating the potion)
-Create the potion with .add i_potion_mana
-Type ".xshow dMORE2" and it will return 0
-Type ".save" (for worldsave, lol)
-Type ".xshow dMORE2" again and now it will return a new value from 0~1000

PART 2 (stacking the potion)
-Create a new i_potion_mana
-It will come with MORE2=0 and will not stack on any another mana potion with random MORE2 set by sphere
Itemdef used to reproduce the bug

[ITEMDEF i_potion_Mana]
ID=0f0e
NAME=Mana Refresh
TYPE=t_potion
TDATA1=i_bottle_empty
RESOURCES=i_reag_eye_of_newt 3, i_bottle_empty
SKILLMAKE=ALCHEMY 40.0
VALUE=19

ON=@DClick
SRC.MANA += 50
IF (<SRC.MANA> > <SRC.MAXMANA>)
 SRC.MANA=<SRC.MAXMANA>
ENDIF
No tags attached.
Issue History
14-12-10 05:33CorujaNew Issue
18-12-10 21:32ShiryuXNote Added: 0000782
19-12-10 07:14CorujaNote Added: 0000783
21-12-10 02:23MrSugarCubeSeveritymajor => minor
24-03-13 19:44RanXeroxNote Added: 0001523
24-03-13 19:44RanXeroxStatusnew => resolved
24-03-13 19:44RanXeroxResolutionopen => fixed
24-03-13 19:44RanXeroxAssigned To => RanXerox

Notes
(0000782)
ShiryuX   
18-12-10 21:32   
You have to remember that potion are spells inside items. Now, these spells must have a strength, or else it will be an invalid item.

So I recommend you to set MORE2=1 below @Create in your script.
(0000783)
Coruja   
19-12-10 07:14   
I already do it, but it's not a good idea when you have 409356209483562340975632094652370984563420987563428709 potions on the server, because every potion stack will raise another "MORE2=1" line on save files
thats why I used it without MORE2 :D
(0001523)
RanXerox   
24-03-13 19:44   
As ShiryuX said, the server adds a random MORE2 value on any t_potion object that is missing one because potions are essentially spells, and a spell needs to have strength...

If you want to make stack-able custom potions that are not related to spells, use a custom type, or set the MORE2 value to a positive number in @Create (extra lines in the save file don't make that much difference...)