[RC1] RPG+

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Uchiha Nick
Registered User
Posts: 424
Joined: Wed Jul 14, 2004 12:13 pm
Contact:

Post by Uchiha Nick »

well, i wrote it kinda fast, so someone might want to take a look at it :

Code: Select all

<?php
/////////////////////////////////////////////////////////////////
//	RGPLUS Item script
/////////////////////////////////////////////////////////////////
// NAME: Death
// DESC: Instantly kills opponent
// AUTHOR: Uchiha Nick - sepirothonfire@hotmail.com 
// WEB: http://silvermain.cdreamer.com
// NOTES: This simply subtracts all life points, so it should kill the victim 
// BEGAN: 22 may 2005
/////////////////////////////////////////////////////////////////

//////////////////// CONFIG /////////////////////////////////////
$lang['desc'] = 'Instantly destroys victim.;
$lang['Log'] = 'used a Death spell;
/////////////////////////////////////////////////////////////////

//note, i dont really know how to display everything, but ill show the core code.
	$sql = "SELECT user_max_hp, user_hp
		FROM " . USERS_TABLE . "
		WHERE user_id = '$this->opponent'";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't query User table", "", __LINE__, __FILE__, $sql);
	}
	while ( $row = $db->sql_fetchrow($result) )
	{
		$hp = $row['user_hp'];
		$max_hp = $row['user_max_hp'];
	}
	$type = 'pvsp';
}
// Well, now we got the user info. Max hp, and normal hp.
// The following function will simply substract max hp from current hp, kinda lame huh?
function death($user_hp, user_max_hp)
{
return $user_hp - $user_max_hp;

sql = "UPDATE `user_hp`
FROM " . USERS_TABLE . " 
SET `user_hp` = '$hp' 
WHERE user_id = '$this->opponent'";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Couldn't update User table", "", __LINE__, __FILE__, $sql);
}

	// End by printing Message
	$this->update_logs($this->arena['b_id'], sprintf($lang['Log'], $userdata['user_rpgname'], $amount . " $opponent));

?>
save it as death.php , i dont know if it works guys! just made this quickly and havent had the time to either test or look for syntax error.

basicly it takes user_hp and user_max_hp, and well it does this :
user_hp - user_max_hp , kinda lame but it should work :)

darkassasin93
Registered User
Posts: 414
Joined: Sun Nov 28, 2004 3:45 pm

Post by darkassasin93 »

Aside from the many errors (I know you wrote it fast), it only subtracts the hp, It doesn't actually let you win the battle.

darkassasin93
Registered User
Posts: 414
Joined: Sun Nov 28, 2004 3:45 pm

Post by darkassasin93 »

I have found code from a function in battle.php. That code will act as the death script.

Download it here:

http://downloads.mgbowen.com/files/phpB ... script.zip

Uchiha Nick
Registered User
Posts: 424
Joined: Wed Jul 14, 2004 12:13 pm
Contact:

Post by Uchiha Nick »

darkassasin93 wrote: Aside from the many errors (I know you wrote it fast), it only subtracts the hp, It doesn't actually let you win the battle.


actually it should. the turn your opponent gets he'll get the message hes dead. ( 0 hp is dead, there is no user_alive you see )

tho im glad you figured it out :)

Fooruman
Registered User
Posts: 11
Joined: Wed May 18, 2005 3:01 am

Post by Fooruman »

There is a problem in the command to enter it into the log. However, after I removed that it works fine (you can't view the log when you use it anyway because it instantly ends the battle). Thanks for making this!

darkassasin93
Registered User
Posts: 414
Joined: Sun Nov 28, 2004 3:45 pm

Post by darkassasin93 »

Well, obviously. I didn't include it. Theres absolutly no point.

Yam2
Registered User
Posts: 1
Joined: Thu May 26, 2005 10:33 pm

Post by Yam2 »

Hi, I speak french so I haven't read all the messages in this topic... ^^'

I would like to know how I can do to edit the inventory of the users, is it possible currently or do I have to find an add-on for this?

And is it possible to prevent the users to modify some informations like the job, race, etc...?

Thank you :)

Yam

Coliver
Registered User
Posts: 94
Joined: Fri Aug 22, 2003 8:16 am

Post by Coliver »

Excuse my ignorance, but is there any way for this RPG hack to intergrate with the Cash MOD?

Thanks.

mickeyfmann
Registered User
Posts: 12
Joined: Thu Mar 24, 2005 8:19 pm

solutions

Post by mickeyfmann »

I'm not sure if this has been posted or not but i'm sure that many of you are aware of the issue with editing jobs, no matter what you do you get a sorry but you did not fill out all the required fields message. After a little bit of code searching i found the error causing this and have a solution for you.

1. Open the admin_jobs.php in any text editor.
2. In the saving function at about line 304 you should see the following lines of code.

Code: Select all

	$rpgjob = htmlspecialchars($HTTP_POST_VARS['rpgjob']);
	$job_name =  htmlspecialchars($$HTTP_POST_VARS['job_name']);
	$job_image =  htmlspecialchars($$HTTP_POST_VARS['job_image']);
	$job_desc =  htmlspecialchars($$HTTP_POST_VARS['job_desc']);
	$job_gender =  htmlspecialchars($$HTTP_POST_VARS['job_gender']);
	$job_lvl_need  = intval($HTTP_POST_VARS['job_lvl_needed']);
	$job_salary = intval($HTTP_POST_VARS['job_salary']);
3. Simply replace the above code with the following code so solve the problem.

Code: Select all

	$rpgjob = htmlspecialchars($HTTP_POST_VARS['rpgjob']);
	$job_name =  htmlspecialchars($HTTP_POST_VARS['job_name']);
	$job_image =  htmlspecialchars($HTTP_POST_VARS['job_image']);
	$job_desc =  htmlspecialchars($HTTP_POST_VARS['job_desc']);
	$job_gender =  htmlspecialchars($HTTP_POST_VARS['job_gender']);
	$job_lvl_need  = intval($HTTP_POST_VARS['job_lvl_needed']);
	$job_salary = intval($HTTP_POST_VARS['job_salary']);
There ya have i've implemented and tested this solution and it works great!

mickeyfmann
Registered User
Posts: 12
Joined: Thu Mar 24, 2005 8:19 pm

Post by mickeyfmann »

Excuse my double post but i seem to be having another problem, dealing with editing users via the admincp, when i attempt to edit some one it loads the profile fine i make the changes then submit it then loads the next page, but the failed or completed message does not display and the update does not happen. I've tried several things and i can't seem to crack this one.

Maseki
Registered User
Posts: 15
Joined: Tue May 31, 2005 12:03 am

Post by Maseki »

I just installed the RPG+ mod and when i go to my forum i get a white screen with the following:

Parse error: parse error, unexpected T_CASE in /home/animec35/public_html/forum/includes/functions.php on line 90

here is line 90-96 of functions.php:

Code: Select all


      case 'postcount':
			return $row['post_total'];
			break;
		case 'topiccount':
			return $row['topic_total'];
			break;
	}
Any idea how to solve this?

Thanks..

The Nic
Registered User
Posts: 16
Joined: Tue Dec 21, 2004 11:33 am

Post by The Nic »

Um link is broken now.
The Nic

darkassasin93
Registered User
Posts: 414
Joined: Sun Nov 28, 2004 3:45 pm

Post by darkassasin93 »

Which, the death script? No, its not. Try again.

emericklaw
Registered User
Posts: 13
Joined: Wed Apr 06, 2005 10:22 pm

Post by emericklaw »

I have tried for about 12 hours now to get the AI working properly and I am having no luck at all!

I either get it so i die in one hit or the AI dies with one hit.

Could someone send me an export of their phpbb_rpg_ai table so I can have a look at what kind of figures you are using? Email: emericklaw AT gmail DOT com

Thanks

darkassasin93
Registered User
Posts: 414
Joined: Sun Nov 28, 2004 3:45 pm

Post by darkassasin93 »

Make them rather small numbers. Remember, the figures are PER LEVEL!

Locked

Return to “[2.0.x] MODs in Development”