SanninStory
https://www.twitch.tv/sdrn
- Joined
- Oct 13, 2012
- Messages
- 1,778
- Reaction score
- 119
Witam.
Chcia?bym wam przedstawi? skrypt Autorstwa: z otlandu.
Skrypt zawiera:
- SMS Shop,
- Character Shop,
- EQ Shower,
- Health, Mana Bar,
- Inny wygl?da Characters,
- Nowy Skin
Download:
Instalacja:
1. Ilo?? PP w Koncie:
a. Dodaj w account.php pod:
to:
b. W class/account.php dodajemy przed:
to:
2. Pacc i darmowe PP:
a. w class/account.php dodajemy pod:
to:
b. W configu dodajemy:
3. EQ Shower, HP, MANA w podgl?dzie postaci:
a. W configu dodajemy:
b. Dodajemy folder items z Paczki
c. Podmieniamy Characters.php
d. W class/player.php zmieniamy to:
na to:
d2. Pod tym:
dodajemy:
pod tym:
dodajemy:
pod tym:
dajemy to:
4. Shop System:
a. W bazie danych wykonujemy zapytanie:
b. Do configu dodajemy:
c. Z paczki dodajemy pliki:
d. W admin.php dodajemy pod tym:
to:
e.W account.php dodajemy pod tym:
to:
f. Przed tym:
dajemy to:
5. W navigation.xml dodajemy to:
GOTOWE.
Screeny:
Download:
Pozdrawiam i je?li mo?na Rep+.
Chcia?bym wam przedstawi? skrypt Autorstwa: z otlandu.
Skrypt zawiera:
- SMS Shop,
- Character Shop,
- EQ Shower,
- Health, Mana Bar,
- Inny wygl?da Characters,
- Nowy Skin
Download:
Instalacja:
1. Ilo?? PP w Koncie:
a. Dodaj w account.php pod:
PHP:
<?php
if(isset($account->attrs['premend']) && $account->attrs['premend'] > time()) {
echo '<b>Premium status:</b> You have ';
$days = ceil(($account->attrs['premend'] - time())/(3600*24));
if($days <= 5) echo '<b style="color: red">';
else echo '<b>';
echo $days.'</b> day(s) left';
}
?>
PHP:
</br>
<?php
//points system dodany do strony gracza, dodana funkcja "$this->attrs['points'] = (int) $acc['points'];" w class/account.php punkty odczytywane z accounts, nie z players
if ($account->attrs['points']) {
echo '<b>Shop points status:</b> You have ';
$points = ceil(($account->attrs['points']));
if($points <= 5) echo '<b style="color: red">';
else echo '<b>';
echo $points.'</b> point(s)';
}
?>
PHP:
$this->attrs['accno'] = (int) $acc['id'];
PHP:
$this->attrs['points'] = (int) $acc['points'];
2. Pacc i darmowe PP:
a. w class/account.php dodajemy pod:
PHP:
unset($d);
$d['id'] = $accno;
$d['password'] = Account::encodePassword($password);
PHP:
//pacc for new account configure
{global $cfg;
$pacday = ($cfg['pac_day']);
$pa = ceil((time()) + (86400 * $pacday));
$d['premend'] = $pa;
}
//premium points for new account configure
{global $cfg;
$pr_points = ($cfg['pr_points']);
$d['points'] = $pr_points;
}
PHP:
#Pacc for new acc:
$cfg['pac_day'] = 46;
#Free premium points for new acc
$cfg['pr_points'] = 50;
3. EQ Shower, HP, MANA w podgl?dzie postaci:
a. W configu dodajemy:
PHP:
//specx edited
# Whether to SHOW EQ in character search eq, hp, mana, exp /made by specx
$cfg['show_items'] = true;
# Show soul points. Use it for ot > 7.4
$cfg['show_soul'] = false;
c. Podmieniamy Characters.php
d. W class/player.php zmieniamy to:
PHP:
class Player {
private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql;
PHP:
class Player {
private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql, $items;
PHP:
private function load_skills() {
if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
$this->sql->myQuery('SELECT * FROM `player_skills` WHERE `player_id` = '.$this->sql->quote($this->attrs['id']));
while($a = $this->sql->fetch_array()) {
$this->skills[$a['skillid']]['skill'] = (int)$a['value'];
$this->skills[$a['skillid']]['tries'] = (int)$a['count'];
}
return true;
}
PHP:
/// SHOW EQ
private function load_items() {
if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
$this->sql->myQuery ("SELECT * FROM `player_items` WHERE (`player_id` = '".$this->sql->quote($this->attrs['id'])."') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC");
//$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` <=10 AND `player_id` = '.$this->sql->quote($this->attrs['id']).') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC';
//$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` = 2 AND `player_id` = '.$this->sql->quote($this->attrs['id']));
while($a = $this->sql->fetch_array())
{
//org $this->items[$a['pid']]['item'] = (int)$a['itemtype'];
$this->items[$a['pid']]['item'] = (int)$a['itemtype'];
}
return true;
}
///
PHP:
$this->attrs['guildnick'] = (string) $player['guildnick'];
PHP:
///SHOW EQ
$this->attrs['cap'] = (int) $player['cap'];
$this->attrs['soul'] = (int) $player['soul'];
$this->attrs['health'] = (int) $player['health'];
$this->attrs['healthmax'] = (int) $player['healthmax'];
$this->attrs['mana'] = (int) $player['mana'];
$this->attrs['manamax'] = (int) $player['manamax'];
$this->attrs['experience'] = (int) $player['experience'];
PHP:
}elseif($attr == 'skills') {
if(empty($this->skills)) $this->load_skills();
return $this->skills;
PHP:
///SHOW EQ
}elseif($attr == 'items') {
if(empty($this->items)) $this->load_items();
return $this->items;
///
4. Shop System:
a. W bazie danych wykonujemy zapytanie:
PHP:
ALTER TABLE `accounts` ADD `points` int(11) NOT NULL;
ALTER TABLE `accounts` ADD `points_history` int(11) NOT NULL;
ALTER TABLE `players` ADD `shop` int(11) NOT NULL;
ALTER TABLE `players` ADD `price` int(11) NOT NULL;
CREATE TABLE IF NOT EXISTS `shop` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`info` text NOT NULL,
`price` int(11) NOT NULL,
`image` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
PHP:
#Whether to Sell Player panel in account
$cfg['show_sell_player_panel'] = true;
# Level at which player can be sold in shop
$cfg['player_lvl_sell'] = 5;
Code:
shop_history.php
shopadd.php
add_points.php
add_sms_points.php
add_sms_points_paygol.php
paygol.php
add_player.php
remove_player.php
shop_player2.php
buy_player.php
shop.php
buy.php
PHP:
<li onclick="self.window.location.href='tools/php_info.php'" style=" background-image: url(resource/information.png);">PHP Info</li>
PHP:
</br>
<li onclick="self.window.location.href='shop_history.php'" style=" background-image: url(resource/book_open.png);">Shop History</li>
<li onclick="self.window.location.href='shopadd.php'" style=" background-image: url(resource/add.png);">Add item to shop</li>
PHP:
<li onclick="ajax('ajax','modules/character_create.php','',true)" style="background-image: url(resource/user_add.png);">Create Character</li>
PHP:
<li onclick="self.window.location.href='add_player.php'" style=" background-image: url(resource/add.png);">Add Character to shop</li>
<li onclick="self.window.location.href='remove_player.php'" style=" background-image: url(resource/cross.png);">Remove Character from shop</li>
PHP:
?>
<div id="ajax"></div>
</div>
<div class="bot"></div>
</div>
<?php
include ("footer.inc.php");
?>
PHP:
///SHOW CHARACTER IN SHOP
$acc = $account->attrs['accno'];
echo '<h3>Characters in Shop</h3>'."\n";
$wynik44 = mysql_query("SELECT id, name, level, vocation, price FROM players WHERE shop = 1 AND account_id = $acc")
or die('query error');
if(mysql_num_rows($wynik44) > 0) {
echo "<table class=color2 bordercolor=#FFFFFF width=100% cellpadding=4 cellspacing=0 border=1>";
echo "<th class=color0>Name:</th> <th class=color0>Level:</th> <th class=color0>Vocation:</th> <th class=color0>Points:</th></th>";
echo "<tr>";
while($r = mysql_fetch_assoc($wynik44))
{
$id_player = $r['id'];
echo ' <td><center><a href="characters.php?player_name='.($r['name']).'">'.$r['name'].'</a></center></td>';
echo "<td><center> ".$r['level']."</center></td>";
if ($r['vocation'] == 1)
{
echo "<td><center> Sorcerer</center></td>";
}
elseif ($r['vocation'] == 2)
{
echo "<td><center> Druid</center></td>";
}
elseif ($r['vocation'] == 3)
{
echo "<td><center> Paladin</center></td>";
}
elseif ($r['vocation'] == 4)
{
echo "<td><center> Knight</center></td>";
}
elseif ($r['vocation'] == 5)
{
echo "<td><center> Master Sorcerer</center></td>";
}
elseif ($r['vocation'] == 6)
{
echo "<td><center> Elder Druid</center></td>";
}
elseif ($r['vocation'] == 7)
{
echo "<td><center> Royal Paladin</center></td>";
}
elseif ($r['vocation'] == 8)
{
echo "<td><center> Elite Knight</center></td>";
}
echo "<td><center>".$r['price']."</center></td>";
echo "</tr>";
}
echo "</table>";
}
else
{
echo '<img src="resource/user_red.png"/>';
echo " You don't have player in shop";
}
//end character in shop
PHP:
<category name="SHOP">
<item href="shop.php">Buy item</item>
<item href="shop_player2.php">Buy Player</item>
<item href="add_points.php">Add points</item>
</category>
GOTOWE.
Screeny:
Download:
Pozdrawiam i je?li mo?na Rep+.