Jump to content
MakeWebGames

Recommended Posts

Posted

I looked a little on here and did not see this on here.

so i thought i would try my hand at it.

what i have done is add a bar called fatigue to the game.

the uses fatigue goes up with each fight.

they have to buy items to lower it to be able to fight more.

while trying to attack they have to have a certain amount of it to be able to go through with the attack.

anyone interested in this mod?

Posted
ooh ooh oh..no i got that :P
lol yeah yeah yeah, just because you made me feel dumb when i had that question about it. thx tho i just did not see that. not sure how i missed it but oh well. thats what i get for staying up for so long i guess. but i will post it what i have of it either way.
Posted

starting with the sqls needed for this

[mysql]ALTER TABLE `users` ADD `fatigue` INT(11) NOT NULL DEFAULT '0'

ALTER TABLE `users` ADD `maxfatigue` INT(11) NOT NULL DEFAULT '100'

[/mysql]

open you header.php and find

[mysql]$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);[/mysql]

after it add

[mysql]$faterc=(int) ($ir['fatigue']/$ir['maxfatigue']*100);[/mysql]

then while still in header.php find

[mysql]$enopp=100-$enperc;[/mysql]

 

and after it add

[mysql]$fiopp=100-$faterc;[/mysql]

still in the header file find

[mysql]Energy: {$enperc}%

<img src=greenbar.png width=$enperc height=10><img src=bluebar.png width=$enopp height=10>

<hr />

[/mysql]

and add below it

[mysql]Fatigue: {$faterc}%

<img src=redbar.png width=$faterc height=10><img src=greenbar.png width=$fiopp height=10>

<hr />[/mysql]

save header.php and close.

now open attack.php and add

[mysql]$db->querry("UPDATE users SET fatigue=fatigue+(maxfatigue/10) WHERE userid=$userid");

[/mysql]

save attack.php and close.

open global_func.php and find

[mysql]$ir['level']+=1;

$ir['exp']=$expu;

$ir['energy']+=2;

$ir['brave']+=2;

$ir['maxenergy']+=2;

$ir['maxbrave']+=2;

$ir['hp']+=50;

$ir['maxhp']+=50;[/mysql]

replace it with

[mysql]$ir['level']+=1;

$ir['exp']=$expu;

$ir['energy']+=2;

$ir['fatigue']+=2;

$ir['brave']+=2;

$ir['maxenergy']+=2;

$ir['maxfatigue']+=2;

$ir['maxbrave']+=2;

$ir['hp']+=50;

$ir['maxhp']+=50;

[/mysql]

then just below find

[mysql]$db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2, brave=brave+2, maxenergy=maxenergy+2,maxbrave=maxbrave+2,

hp=hp+50,maxhp=maxhp+50 where userid=$userid");

}[/mysql]

and replace with this query

[mysql]$db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,fatigue=fatigue+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2,maxfatigue=maxfatigue+2,hp=hp+50,maxhp=maxhp+50 where userid=$userid");

}[/mysql]

save and close global_func.php

open up staff_items.php and find

[mysql]Usage Form<hr />

<u>Effect 1</u>

On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No

Stat: <select name='effect1stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

</select> Direction: <select name='effect1dir' type='dropdown'>

<option value='pos'>Increase</option>

<option value='neg'>Decrease</option>

</select>

Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'>

<option value='figure'>Value</option>

<option value='percent'>Percent</option>

</select><hr />

<u>Effect 2</u>

On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No

Stat: <select name='effect2stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

</select> Direction: <select name='effect2dir' type='dropdown'>

<option value='pos'>Increase</option>

<option value='neg'>Decrease</option>

</select>

Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'>

<option value='figure'>Value</option>

<option value='percent'>Percent</option>

</select><hr />

<u>Effect 3</u>

On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No

Stat: <select name='effect3stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

[/mysql]

and replace it with

[mysql]Usage Form<hr />

<u>Effect 1</u>

On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No

Stat: <select name='effect1stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

<option value='fatigue'>Fatigue</option>

</select> Direction: <select name='effect1dir' type='dropdown'>

<option value='pos'>Increase</option>

<option value='neg'>Decrease</option>

</select>

Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'>

<option value='figure'>Value</option>

<option value='percent'>Percent</option>

</select><hr />

<u>Effect 2</u>

On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No

Stat: <select name='effect2stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

<option value='fatigue'>Fatigue</option>

</select> Direction: <select name='effect2dir' type='dropdown'>

<option value='pos'>Increase</option>

<option value='neg'>Decrease</option>

</select>

Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'>

<option value='figure'>Value</option>

<option value='percent'>Percent</option>

</select><hr />

<u>Effect 3</u>

On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No

Stat: <select name='effect3stat' type='dropdown'>

<option value='energy'>Energy</option>

<option value='will'>Will</option>

<option value='brave'>Brave</option>

<option value='hp'>Health</option>

<option value='strength'>Strength</option>

<option value='agility'>Agility</option>

<option value='guard'>Guard</option>

<option value='labour'>Labour</option>

<option value='IQ'>IQ</option>

<option value='hospital'>Hospital Time</option>

<option value='jail'>Jail Time</option>

<option value='money'>Money</option>

<option value='crystals'>Crystals</option>

<option value='cdays'>Education Days Left</option>

<option value='bankmoney'>Bank money</option>

<option value='cybermoney'>Cyber money</option>

<option value='crimexp'>Crime XP</option>

<option value='fatigue'>Fatigue</option>

[/mysql]

still in staff_items.php find

[mysql]$stats=array(

"energy" => "Energy",

"will" => "Will",

"brave" => "Brave",

"hp" => "Health",

"strength" => "Strength",

"agility" => "Agility",

"guard" => "Guard",

"labour" => "Labour",

"IQ" => "IQ",

"hospital" => "Hospital Time",

"jail" => "Jail Time",

"money" => "Money",

"crystals" => "Crystals",

"cdays" => "Education Days Left",

"bankmoney" => "Bank money",

"cybermoney" => "Cyber money",

"crimexp" => "Crime XP");[/mysql]

and replace it with

[mysql]$stats=array(

"energy" => "Energy",

"will" => "Will",

"brave" => "Brave",

"hp" => "Health",

"strength" => "Strength",

"agility" => "Agility",

"guard" => "Guard",

"labour" => "Labour",

"IQ" => "IQ",

"hospital" => "Hospital Time",

"jail" => "Jail Time",

"money" => "Money",

"crystals" => "Crystals",

"cdays" => "Education Days Left",

"bankmoney" => "Bank money",

"cybermoney" => "Cyber money",

"crimexp" => "Crime XP",

"fatigue" => "Fatigue");[/mysql]

save and close and your done.

and yes i know i left out the if statment for the attack.php

thats the last thing i have to do. feel free to post one.

(updated)

Posted

still not sure on this part of it all, the above is fully tested and works great not.

something like this should work in the attack.php just above where it updates and checks the energy needed. (this part i have not tested)

im off to work now, and will test this after i get off in 12 hours.

[mysql]if ($youdata['fatigue'] >= $youdata['maxfatigue']/10)

{

$youdata['fatigue']-= floor($youdata['maxfatigue']/10);

$me=floor($youdata['maxfatigue']/10);

$db->query("UPDATE users SET fatigue=fatigue- {$me} WHERE userid=$userid");

$_SESSION['attackdmg']=0;

}

else

{

print "Your to fatigued to fight now go> Back.";

$h->endpage();

exit;[/mysql]

Posted
Its a paid mod, and

[mysql]ALTER TABLE `users` ADD `maxfatigue` VARCHAR( 255 ) NOT NULL DEFAULT '100'[/mysql]

why is it a VARCHAR??, use INT(11) so its a number

lmao thx danny for pointing that out, thats what i get for trying to hurry before work. (original post updated)
Posted

you should have told me that the other day bro, i did not know that.

i would never had posted this if i knew you had it as a paid mod.

really thought since i figured it out after only doing this for such a short time that it was rather simple.

never thought about someone paying for it.

you can have an admin take this down if i stepped on your toes bro.

Posted

Na it's alright man. Wasn't a big issue, i actually made the mod on accident and just stuck it up there to see if maybe "off chance" i'd make a dollar or two off it.

No biggy, Good mod man :)

Posted

okay then i wont worry bout it, but still thx for showing me the two dang words i forgot to change in this. lol i knew i had to be close.

imma try that jobs mod again now, hope i can get it.

Posted

I am new to php so this is probably a stupid question lol but

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

why did you put "fatigue" => "Fatigue", twice?

Why is the last one like this "fatigue" => "Fatigue");? shouldnt it be a , instead pf ;

Posted
shouldnt it be a , instead pf ;
the ; is to close the array :)

[mysql]"fatigue" => "Fatigue");[/mysql]

is the closing line in the array. or am i missing what your getting at here?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...