Jump to content
MakeWebGames

Advanced Attack and Inventory Mod--One Click.


Joshua

Recommended Posts

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Hospital Reason when losing.

I'm trying to add hospreason for when the attacker loses against a defender. I'm doing something wrong.

Error Message is this:

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''hospreason' = 'Lost to TestPlayer', WHERE (`userid`=1)' at line 1"

Here's the code I'm trying:

 

You're unable to view this code.

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

 

Having trouble figuring out what I'm doing wrong here.

Link to comment
Share on other sites

well for a small hint on people that are having errors in staff_items.php items table, and users table dont remove the armor from either of them....

Overwrite inventory with this one.

You're unable to view this code.

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

 

And overwrite staff_items.php with this one..

 

You're unable to view this code.

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

 

now everyone shouldnt be getting any errors with the script if you are let me know what errors and ill try and help to my best of abilitys

Link to comment
Share on other sites

Did I forget to delete the "armor" query into the database?

I will go look at my online copy and compare..

Being as the attack script doesnt use equip_armor

I found it null and void, thought i removed all the sql bits but perhaps i missed one

Link to comment
Share on other sites

it might of worked for you but i had to play with the scripts awhile as i was getting the same errors everyone else was getting so i just left the armor rows in the 2 tables which removed most of the errors other then the create items which was picking up special, ring, and etc and gave a error there so i went through the staff_items and inventory and fixed the few errors i did recieve, as of right now the mod is working great since i fixed the errors so im not sure where they were comming from untill i do find out i just suggest everyone to leave the equip_armor in the tables till these errors are sorted out.

Link to comment
Share on other sites

  • 3 weeks later...

Ok. I found a small bug I'm trying to figure out how to fix.

I'm getting a printed output like this when I win a fight:

"You are in a fight with BuckShotBot.

You hit BuckShotBot for 315 damage using your Axe Handle and their Shotgun."

Actually, it's my shotgun. And I'd think even though I won, they should be doing some sort of damage to me.

I'm pretty sure the error is in here, but not exactly sure how to fix this, as I am novice level, and this is beyond my grasp:

Begins around line 190 for most folks.

 

You're unable to view this code.

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

 

Been trying to figure it out on my own for quite a while now. Time to ask for help over here.

Thanks!

Link to comment
Share on other sites

Kinda a challenge. Too much for me to handle. But I'd like to challenge those of you with advanced ability to get this mod working great.

Things to consider:

1. Compatible with battle bots.(should be pretty easy, I'm working on this one)(Times owned not counting)

2. Compatible with the free ammunition mod. (this one is kinda difficult with a one click attack)

3. Attack outcomes (I think I got this one figured out)

4. An explanation of how to adjust or take into consideration all stats in a fight. I see strength, guard, and agility. But maybe also consider IQ, will, and brave.

5. Battle Stats

I know this is all time consuming. Doing my best to pitch in and participate. This is already a great mod, but could become a very very great mod. And I am also happy it is available to the public and free.

Also, I'd like to share my version with different attack outcomes. It's compatible with the free attack outcomes mod out there.

attack.php

 

You're unable to view this code.

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

Link to comment
Share on other sites

Not a bad few ideas there agon.

I got bored awhile back and noticed there were NO 1 click attacks for McCodes that were worth a flip so i grabbed the GRPG and modified/added to it to make it work with McC.

Then i got carried away and added the extra item slots into the equation for a bit more fun

 

If i get some spare time I may just add what you suggested :)

Glad you enjoy

Link to comment
Share on other sites

error

i think im the only one getting this error because it hasnt been posted yet but i didnt edit anything in the code.

 

i get this error when i try to make a new item

QUERY ERROR: Column count doesn't match value count at row 1

Query was INSERT INTO items VALUES('',17,'test','test',1,1,1, '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', 0, 0, 10000, 0, 0, 0)

this is my new_item_submit function

 

function new_item_submit()

{

global $db,$ir,$c,$h;

if($ir['user_level'] > 2)

{

die("403");

}

if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice']))

{

print "You missed one or more of the fields. Please go back and try again.

> Back";

$h->endpage();

exit;

}

$itmname=$db->escape($_POST['itmname']);

$itmdesc=$db->escape($_POST['itmdesc']);

$weapon=abs((int) $_POST['weapon']);

$helmet=abs((int) $_POST['helmet']);

$boots=abs((int) $_POST['boots']);

$amulet=abs((int) $_POST['amulet']);

$braclet=abs((int) $_POST['braclet']);

$ring=abs((int) $_POST['ring']);

$special=abs((int) $_POST['special']);

if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; }

$efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount']))));

$efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount']))));

$efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount']))));

$m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $boots, $helmet, $amulet, $braclet, $ring)");

print "The {$_POST['itmname']} Item was added to the game.";

stafflog_add("Created item {$_POST['itmname']}");

}

 

and i dont know if this is needed but this is my sql dump for the items table, maybe its missing something that i cant figure out

 

CREATE TABLE IF NOT EXISTS `items` (

`itmid` int(11) NOT NULL auto_increment,

`itmtype` int(11) NOT NULL default '0',

`itmname` varchar(255) NOT NULL default '',

`itmdesc` text NOT NULL,

`itmbuyprice` int(11) NOT NULL default '0',

`itmsellprice` int(11) NOT NULL default '0',

`itmbuyable` int(11) NOT NULL default '0',

`effect1_on` tinyint(4) NOT NULL default '0',

`effect1` text NOT NULL,

`effect2_on` tinyint(4) NOT NULL default '0',

`effect2` text NOT NULL,

`effect3_on` tinyint(4) NOT NULL default '0',

`effect3` text NOT NULL,

`weapon` int(11) NOT NULL default '0',

`itmpic` varchar(255) NOT NULL,

`boots` int(11) NOT NULL default '0',

`helmet` int(11) NOT NULL default '0',

`breastplate` int(11) NOT NULL default '0',

`leggings` int(11) NOT NULL default '0',

`gloves` int(11) NOT NULL default '0',

PRIMARY KEY (`itmid`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=99 ;

Link to comment
Share on other sites

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...