ID:148234
 
Attack_Up(mob/M)
if(M.attup >> 0)
if(M.mp >= 50)
var
attd = M.attack / M.attup
M << "<font color = blue><b>You summon a burst of attack power!"
if(M.attackdoubled == 0)
M << "<font color = blue><b>Your attack increases!"
attd = round(attd)
M.attack += attd
M.attackdoubled = 1
M.mp -= 50
NPCDeathCheck(M)
else if(M.attackdoubled == 1)
M << "<font color = blue><b>The energy combinding in you suddenly bursts away!"
M.mp -= 50
NPCDeathCheck(M)
else
M << "<font color = blue><b>You don't have enouph MP!"
Battle(M)
else
M << "<font color = blue><b>You don't know this skill!"
Battle(M)

Run(mob/M)
chancetorun = M.agility - src.agility + rand(-20,20)
if(M.diseased == 1)
M << "<font color = blue><b>You are too weak to run!"
Battle(M)
if(chancetorun >> 0)
M << "<b><font color = blue>You start to flee..."
sleep(10)
M << "<b><font color = blue>You successfully run away!"
M.islocked = 0
src.islocked = 0
M.lib = 0
M.battle = 0
if(M.attup >> 0)
attd = M.attack / M.attup
if(M.defup >> 0)
defd = M.defense / M.defup
if(M.lukup >> 0)
lukd = M.luck / M.lukup
if(M.aglup >> 0)
agld = M.agility / M.aglup
if(M.intup >> 0)
intd = M.intelligence / M.intup
if(M.attackdoubled == 1)
M.attackdoubled = 0
M.attack -= attd
if(M.defensedoubled == 1)
M.defensedoubled = 0
M.defense -= defd
if(M.intelligencedoubled == 1)
M.intelligencedoubled = 0
M.intelligence -= intd
if(M.luckdoubled == 1)
M.luckdoubled = 0
M.luck -= lukd
if(M.agilitydoubled == 1)
M.agilitydoubled = 0
M.agility -= agld
else
M << "<b><font color = blue>You start to flee..."
sleep(10)
M << "<b><font color = blue>The enemy cuts off your escape route!"
NPCDeathCheck(M)

First of all, when attup is 1 on the Attack_Up(mob/M) proc, it doubles my attack. Then when it gets to Run(mob/M) or any other of my procs that end combat, it doesn't - my attack from the attd, It /s it by 2/3s. Whats wrong?
Don't know about your other problems, but you shouldn't be using >>. It's > if you want to check if a > b . >> is used for a variety of other stuff, but not sanity checks. As far as I know, anyhoo.
In response to Alathon
Yep. To clarify, >> is usually a shift operator, and if(value >> 0) is the same as saying if(round(value)). That should be true for every number from 0 to just under 1.

What you really wanted, I think, was > because that's the greater-than operator.

Lummox JR
In response to Lummox JR
But if i do that, i get a bug in an if command. and if i put it (if usr.attup >= 0) that will mess everything up, and besides i dont think that has to do with the problem at hand.
In response to Metroid
Metroid wrote:
But if i do that, i get a bug in an if command. and if i put it (if usr.attup >= 0) that will mess everything up, and besides i dont think that has to do with the problem at hand.

That should be M, not usr, in the proc where you had it. But >> is not correct, and > is.

Lummox JR
In response to Lummox JR
sry, if(M.attup >> 0) lol X_X and ill try it

I still dont get errors, but it dont fix the problem, i still have it. It still doubles my attack in the Attack_Up proc and divides my attack but 2/3s in the Run proc.
In response to Metroid
Metroid wrote:
sry, if(M.attup >> 0) lol X_X and ill try it

Right, like I said, >> is the wrong operator here because it will do a bit shift. > is the comparison operator you wanted.

Lummox JR
In response to Lummox JR
Thats what i meant, sry, i fixed it though and the bug is still goin on.