Since this question is still technically unanswered: take the "%"s out of the equation. You don't need them, and in this case they are doing more harm than good; they cause the variables in question to be expanded to nothing if they are not defined. If you use only the variable names, they will be expanded to '0' if they are not defined.
set /a temp2=(hp*lvl+exp*exptill+wepprice+power*weppower)/(gold+pots*powergain)
When you check the values of temp1 and temp2, make sure they are defined by adding 0 to them before the check (this takes care of cases where the arithmetic fails with a "divide by zero" error):
set /a temp1+=0&set /a temp2+=0
You may also want to make sure that temp3 is defined in the last line as well:
if defined temp3 if not %temp1% equ %temp2% set "%temp3%=1"
This arithmetic style will work for Windows 2000 and later.