RPG tool - Battle MOD
-: ! ! ! , () ! !!! .

: Download (Gotovi Failove Ot Foruma phpBB2) 4- !!!


##############################################################
## MOD : RPG Battle MOD
## MOD : 1.0.1
##
## :
## : 20 .
##
## : 14
## common.php
## includes/constants.php
## includes/functions.php
## includes/functions_post.php
## includes/page_header.php
## includes/page_tail.php
## index.php
## posting.php
## templates/subSilver/overall_footer.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/posting_body.tpl
## templates/subSilver/viewtopic_body.tpl
## viewforum.php
## viewtopic.php
##
## :
## admin/admin_rpg_tools.php
## admin/admin_rpg_weather.php
## images/rpg_balken.jpg
## language/lang_german/lang_cback_rpg.php
## language/lang_english/lang_cback_rpg.php
## templates/subSilver/char_settings.tpl
## templates/subSilver/rpg_watch_char.tpl
## templates/subSilver/admin/rpg_tools_body.tpl
## templates/subSilver/admin/rpg_weather_body.tpl
## char_settings.php
## rpg_watch_char.php
## update.php
##############################################################
## - !!!
##############################################################
#
#-----[ ]------------------------------------------
#

includes/constants.php

#
#-----[ ]------------------------------------------
#

define('CONFIG_TABLE', $table_prefix.'config');

#
#-----[ ]------------------------------------------
#

define('RPG_TABLE', $table_prefix.'cback_rpgsys');

#
#-----[ ]------------------------------------------
#

common.php

#
#-----[ ]------------------------------------------
#

//
// Show 'Board is disabled' message if needed.
//

#
#-----[ ]------------------------------------------
#

//
// The RPG Settings Table is small and we need it into the Board and ACP, so we load it in common.php
//
$sql = "SELECT *
FROM " . RPG_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query rpg information", "", __LINE__, __FILE__,

$sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
$rpg_config[$row['name'> = $row['value'];
}

#
#-----[ ]------------------------------------------
#

includes/functions.php

#
#-----[ ]------------------------------------------
#

include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);

#
#-----[ ]------------------------------------------
#

include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_cback_rpg.' . $phpEx);

#
#-----[ ]------------------------------------------
# ( )
#

?>

#
#-----[ ]------------------------------------------
#

function rpgweather($eingang, $art)
{
global $lang;
$rueckgabe = '';

if($art == 'generate')
{
$w_val1 = 0;
$w_val2 = 0;

srand((double)microtime()*1000000);
$w_val1 = rand(1,6);
$w_val2 = rand(1,5);

$vwc[1] = 'a';
$vwc[2] = 'b';
$vwc[3] = 'c';
$vwc[4] = 'd';
$vwc[5] = 'e';

$rueckgabe = $w_val1 . $vwc[$w_val2];
}
else if($art == 'process')
{
$w_val1 = '';
$w_val2 = '';

$w_val1 = substr($eingang, 0, 1);
$w_val2 = substr($eingang, 1, 2);

// Wetterarray
$vwc[1] = $lang['rpg_wetter_1'];
$vwc[2] = $lang['rpg_wetter_2'];
$vwc[3] = $lang['rpg_wetter_3'];
$vwc[4] = $lang['rpg_wetter_4'];
$vwc[5] = $lang['rpg_wetter_5'];
$vwc[6] = $lang['rpg_wetter_6'];

$vwc['a'] = $lang['rpg_wetter_a'];
$vwc['b'] = $lang['rpg_wetter_b'];
$vwc['c'] = $lang['rpg_wetter_c'];
$vwc['d'] = $lang['rpg_wetter_d'];
$vwc['e'] = $lang['rpg_wetter_e'];

$rueckgabe = '<br><br><b>' . $lang['rpg_wetter'] . ':</b> ' . $vwc[$w_val1] . ', ' . $vwc["$w_val2"];
}

return $rueckgabe;
}

#
#-----[ ]------------------------------------------
#

posting.php

#
#-----[ ]------------------------------------------
#

case 'reply':
$username = ( !empty($HTTP_POST_VARS['username']) ) ?

$HTTP_POST_VARS['username'] : '';
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ?

trim($HTTP_POST_VARS['subject']) : '';

#
#-----[ ]------------------------------------------
#

if($rpg_config['allowbatt'] == 1 && $HTTP_POST_VARS['ibattle'] == 'on')
{
$battlemode = 1;
}
else
{
$battlemode = 0;
}

#
#-----[ ]------------------------------------------
#

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id,

$topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''",

$username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title),

$poll_options, $poll_length);

#
#-----[ ]------------------------------------------
#

$mode,

#
#-----[ ]------------------------------------------
#

$battlemode,

#
#-----[ ]------------------------------------------
#

//
// Output the data to the template
//

#
#-----[ ]------------------------------------------
#

if($rpg_config['allowbatt'] == 1 && $mode == 'reply' || $mode == 'newtopic')
{
$template->assign_block_vars('cback_rpg', array(
'BATTLE' => $lang['rpg_battle'],
'BDESCR' => $lang['rpg_battle_descript']));
}

#
#-----[ ]------------------------------------------
#

templates//posting_body.tpl

#
#-----[ ]------------------------------------------
#

<!-- BEGIN switch_html_checkbox -->
<tr>
<td>
<input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
</td>
<td><span class="gen">{L_DISABLE_HTML}</span></td>
</tr>
<!-- END switch_html_checkbox -->

#
#-----[ ]------------------------------------------
#

<!-- BEGIN cback_rpg -->
<tr>
<td valign="top">
<input type="checkbox" name="ibattle" />
</td>
<td><span class="gen">{cback_rpg.BATTLE}</span><br>
<span class="gensmall">{cback_rpg.BDESCR}</span><br><br></td>
</tr>
<!-- END cback_rpg -->

#
#-----[ ]------------------------------------------
#

includes/functions_post.php

#
#-----[ ]------------------------------------------
#

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id,

&$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid,

$post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)

#
#-----[ ]------------------------------------------
#

$mode,

#
#-----[ ]------------------------------------------
#

$battlemode,


#
#-----[ ]------------------------------------------
#

global $board_config, $lang, $db, $phpbb_root_path, $phpEx;

#
#-----[ ]------------------------------------------
#

, $phpEx

#
#-----[ ]------------------------------------------
#

, $rpg_config

#
#-----[ ]------------------------------------------
#

$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" .

POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
$message = $lang['Stored'] . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' .

append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br

/>' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" .

POST_FORUM_URL . "=$forum_id") . '">', '</a>');

return false;

#
#-----[ ]------------------------------------------
#

//
// CBACK RPG Tools (Battle Mode)
//
if(($mode == 'reply' || $mode == 'newtopic') and ($battlemode == 1))
{
// Reset der bentigten Variablen
$crt_damage = 0;
$crt_bat = 0;

srand((double)microtime()*1000000);
$crt_bat = rand(1,7);

if($crt_bat == 7 || $crt_bat == 6)
{
$crt_damage = 0;
}
else
{
$crt_damage = rand($rpg_config['mindamg'],$rpg_config['maxdamg']);
}

$sql = "UPDATE " . POSTS_TABLE . " SET rpg_bat = '" . $crt_bat . "', rpg_damage = '" . $crt_damage . "'

WHERE post_id = $post_id;";
$db->sql_query($sql);
}
//
// END CBACK RPG Tools
//

#
#-----[ ]------------------------------------------
#

viewtopic.php

#
#-----[ ]------------------------------------------
#

$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,

#
#-----[ ]------------------------------------------
#

//
// BEGIN CBACK RPG Tools
//
$rpg_output = '';
$battledamage = '';

if(!empty($postrow[$i]['rpg_bat']))
{
if($postrow[$i]['rpg_bat'] == 7)
{
$battledamage = $lang['rpg_attack_0'];
}
else if($postrow[$i]['rpg_bat'] == 1)
{
$battledamage = $lang['rpg_attack_1'];
}
else if($postrow[$i]['rpg_bat'] == 2)
{
$battledamage = $lang['rpg_attack_2'];
}
else if($postrow[$i]['rpg_bat'] == 3)
{
$battledamage = $lang['rpg_attack_3'];
}
else if($postrow[$i]['rpg_bat'] == 4)
{
$battledamage = $lang['rpg_attack_4'];
}
else if($postrow[$i]['rpg_bat'] == 5)
{
$battledamage = $lang['rpg_attack_5'];
}
else
{
$battledamage = $lang['rpg_attack_6'];
}

$rpg_output = '<br /><br /><hr><center><table border="0" width="50%" cellspacing="0"

cellpadding="4">';
$rpg_output .= '<tr height="40px"><td valign="center" align="center" colspan="2"><span

class="gen"><b>' . $lang['rpg_bat_head'] . '</b></span><br><span class="gensmall">' .

$lang['rpg_bat_desc'] . '</span><br><br></td></tr>';
$rpg_output .= '<tr><td valign="top" align="right"><span class="gensmall"><b>' . $lang['rpg_bat_dmg'] .

':</b></span></td>';
$rpg_output .= '<td valign="top" align="left"><span class="gensmall">' . $battledamage .

'</span></td></tr>';
$rpg_output .= '<tr><td valign="top" width="30%" align="right"><span class="gensmall"><b>' .

$lang['rpg_bat_caw'] . ':</b></span></td>';
$rpg_output .= '<td valign="top" align="left"><table border="0" cellpadding="0" cellspacing="0"><tr><td

valign="top" align="left" rowspan="2"><span class="gensmall">' . $postrow[$i]['rpg_damage'] .

'%</span></td><td align="left" width="' . ($postrow[$i]['rpg_damage'] * 2) .

'px" style=\"vertical-align:top;background:url(images/rpg_balken.jpg);\"><font size="1"

face="Arial"></font></td></tr><tr><td></td></tr></table></td></tr></table></center><br />';
}

$rpg_templink = '';
$rpg_templink = $phpbb_root_path . 'rpg_watch_char.' . $phpEx . '?u=' . $poster_id;
//
// END CBACK RPG Tools
//

#
#-----[ ]------------------------------------------
#

$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'POSTER_NAME' => $poster,
'POSTER_RANK' => $poster_rank,


#
#-----[ ]------------------------------------------
#

'U_RPG_INFO' => $rpg_templink,
'L_RPG_INFO' => $lang['rpg_char_info'],
'RPG_MODE' => $rpg_output,

#
#-----[ ]------------------------------------------
#

templates//viewtopic_body.tpl

#
#-----[ ]------------------------------------------
#

<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a

name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span

class="postdetails">{postrow.POSTER_RANK}<br

/>{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br

/>{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>


#
#-----[ ]------------------------------------------
#

<br />{postrow.POSTER_FROM}

#
#-----[ ]------------------------------------------
#

<br /><br />[ <a href="{postrow.U_RPG_INFO}" onclick="window.open('{postrow.U_RPG_INFO}',

'_phpbbsmilies', 'HEIGHT=340,resizable=yes,scrollbars=yes,WIDTH=400');return false;"

target="_phpbbsmilies" class="nav">{postrow.L_RPG_INFO}</a> ]<br /><br />

#
#-----[ ]------------------------------------------
#

<td colspan="2"><span

class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span

class="gensmall">{postrow.EDITED_MESSAGE}</span></td>

#
#-----[ ]------------------------------------------
#

<span class="gensmall">{postrow.EDITED_MESSAGE}</span>

#
#-----[ ]------------------------------------------
#

<span class="gensmall">{postrow.RPG_MODE}</span>

#
#-----[ ]------------------------------------------
#

includes/page_header.php

#
#-----[ ]------------------------------------------
#

'L_MEMBERLIST' => $lang['Memberlist'],
'L_FAQ' => $lang['FAQ'],

#
#-----[ ]------------------------------------------
#

'L_CBACK_RPG' => $lang['rpg_cprofile'],

#
#-----[ ]------------------------------------------
#

'U_MODCP' => append_sid('modcp.'.$phpEx),
'U_FAQ' => append_sid('faq.'.$phpEx),

#
#-----[ ]------------------------------------------
#

'U_CBACK_RPG' => append_sid('char_settings.'.$phpEx),

#
#-----[ ]------------------------------------------
#

templates//overall_header.tpl

#
#-----[ ]------------------------------------------
# !!!

<td height="25" align="center" valign="top"

nowrap="nowrap"><span class="mainmenu"><a href="{U_PROFILE}" class="mainmenu"><img

src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0"

alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a> <a href="{U_PRIVATEMSGS}"

class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12"

height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3"

/>{PRIVATE_MESSAGE_INFO}</a> <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img

src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0"

alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a></span></td>
#
#-----[ ]------------------------------------------
#

<a href="{U_PRIVATEMSGS}" class="mainmenu"><img

src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0"

alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>

#
#-----[ ]------------------------------------------
#

<a href="{U_CBACK_RPG}" class="mainmenu"><img

src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0"

alt="{L_CBACK_RPG}" hspace="3" />{L_CBACK_RPG}</a>

#
#-----[ ]------------------------------------------
#
includes/page_tail.php


#
#-----[ ]------------------------------------------
#

'ADMIN_LINK' => $admin_link)

#
#-----[ ]------------------------------------------
#

'RPG_CREDITS' => $lang['rpg_credits'],

#
#-----[ ]------------------------------------------
#

templates//overall_footer.tpl

#
#-----[ ]------------------------------------------
# powered by:...

2001, 2005 phpBB Group

#
#-----[ ]------------------------------------------
#

<br />{RPG_CREDITS}

#
#-----[ ]------------------------------------------
#

index.php

#
#-----[ ]------------------------------------------
#

//
// End session management
//

#
#-----[ ]------------------------------------------
#

if($rpg_config['wchange'] <= time() && $rpg_config['allowweath'] == '1')
{

$nwtime = 0;
$nwtime = time() + 86400;
$sql = "UPDATE " . RPG_TABLE . " SET value = '" . $nwtime . "' WHERE name='wchange';";
if(!$result = $db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not query forum information", "", __LINE__, __FILE__,

$sql);
}


$sql = "SELECT *
FROM " . FORUMS_TABLE;
if(!$result = $db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not query forum information", "", __LINE__, __FILE__,

$sql);
}
else
{
while( $row = $db->sql_fetchrow($result) )
{
$config_name_w = '';
$config_name_w = $row['forum_id'];
$neueswetter = rpgweather('','generate');
$sql = "UPDATE " . FORUMS_TABLE . " SET
rpg_sweather = '" . str_replace("\'", "''", $neueswetter) . "'
WHERE forum_id = '$config_name_w'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to update forum configuration for $config_name",

"", __LINE__, __FILE__, $sql);
}
}
}
}


#
#-----[ ]------------------------------------------
#


$template->assign_block_vars('catrow.forumrow', array(
'ROW_COLOR' => '#' .

$row_color,

#
#-----[ ]------------------------------------------
#

if($forum_data[$j]['rpg_weather'] == 1 && $rpg_config['allowweath'] == 1)
{
$wetterbericht = rpgweather($forum_data[$j]['rpg_sweather'], 'process');
}
else
{
$wetterbericht = '';
}

#
#-----[ ]------------------------------------------
#

'FORUM_DESC' => $forum_data[$j]['forum_desc'],

#
#-----[ ]------------------------------------------
#

$forum_data[$j]['forum_desc']

#
#-----[ ]------------------------------------------
#

. $wetterbericht

#
#-----[ ]------------------------------------------
#

viewforum.php

#
#-----[ ]------------------------------------------
#

$template->assign_vars(array(
'FORUM_ID' => $forum_id,

#
#-----[ ]------------------------------------------
#

if($forum_row['rpg_weather'] == 1 && $rpg_config['allowweath'] == 1)
{
$wetterbericht = rpgweather($forum_row['rpg_sweather'], 'process');
}
else
{
$wetterbericht = '';
}

#
#-----[ ]------------------------------------------
#

'MODERATORS' => $forum_moderators,

#
#-----[ ]------------------------------------------
#

$forum_moderators

#
#-----[ ]------------------------------------------
#

. '<br><br>' . $wetterbericht

#
#-----[ / ]------------------------------------------











/ /