Compare commits
8 Commits
cc3aaf44de
...
c980a907a7
Author | SHA1 | Date | |
---|---|---|---|
c980a907a7 | |||
|
81561e556c | ||
|
eaf8c39163 | ||
|
202ea60421 | ||
|
96544d50ea | ||
|
d2dd113338 | ||
|
f11e9ba454 | ||
|
2f977fab00 |
@ -5,6 +5,9 @@
|
||||
* Time: 22:41
|
||||
*/
|
||||
namespace Battles;
|
||||
use db;
|
||||
use Krugozor\Database\Mysql\Exception;
|
||||
|
||||
class DressedItems
|
||||
{
|
||||
private $DB;
|
||||
@ -25,15 +28,20 @@ class DressedItems
|
||||
private function getDressedItems()
|
||||
{
|
||||
try {
|
||||
$this->DB = \db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
|
||||
$this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
|
||||
} catch (\Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (*) для класса DressedItems.</div>';
|
||||
}
|
||||
}
|
||||
|
||||
private function getDressedItemById($item_id)
|
||||
private static function getDressedItemById($item_id)
|
||||
{
|
||||
return \db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
|
||||
return db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
|
||||
}
|
||||
|
||||
public static function getDressedItemBySlot($itemSlot, $ownerId)
|
||||
{
|
||||
return db::c()->query('SELECT * FROM battles.inventory WHERE owner_id = ?i AND dressed_slot = ?i', $ownerId, $itemSlot)->fetch_assoc();
|
||||
}
|
||||
|
||||
private function getBonusesFromDressedItems()
|
||||
@ -53,7 +61,7 @@ SELECT SUM(add_strength) as sum_strength,
|
||||
SUM(add_max_physical_damage) as sum_max_phys_damage
|
||||
FROM inventory WHERE owner_id = ?i AND dressed_slot > 0
|
||||
SQL;
|
||||
$this->DBSUM = \db::c()->query($query, $this->USERID)->fetch_assoc();
|
||||
$this->DBSUM = db::c()->query($query, $this->USERID)->fetch_assoc();
|
||||
} catch (\Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (SUM) для класса DressedItems:' . $e . '</div>';
|
||||
}
|
||||
@ -127,14 +135,14 @@ SQL;
|
||||
* Снимает с предмета статус одетого на персонажа в определённом слоте персонажа.
|
||||
* @param $slot_id - номер слота.
|
||||
*
|
||||
* @throws \Krugozor\Database\Mysql\Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function undressItem($slot_id)
|
||||
{
|
||||
self::getItemsInSlots();
|
||||
// Проверяем, что используется один из 12 слотов и наличие предмета в слоте.
|
||||
if (in_array($slot_id, Item::ITEM_TYPES_ALLOWED_IN_SLOTS) && $this->dressedItem[$slot_id]) {
|
||||
\db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
|
||||
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,15 +29,15 @@ abstract class Item
|
||||
public const ITEM_TYPES_ALLOWED_IN_SLOTS = [1,2,3,4,5,6,7,8,9,10,11,12];
|
||||
public const ITEM_TYPE_HELMET = 1;
|
||||
public const ITEM_TYPE_ARMOR = 2;
|
||||
const ITEM_TYPE_LEGS = 3;
|
||||
const ITEM_TYPE_BOOTS = 4;
|
||||
const ITEM_TYPE_GLOVES = 5;
|
||||
const ITEM_TYPE_WEAPON = 6;
|
||||
const ITEM_TYPE_SHIELD = 7;
|
||||
const ITEM_TYPE_BELT = 8;
|
||||
public const ITEM_TYPE_LEGS = 3;
|
||||
public const ITEM_TYPE_BOOTS = 4;
|
||||
public const ITEM_TYPE_GLOVES = 5;
|
||||
public const ITEM_TYPE_WEAPON = 6;
|
||||
public const ITEM_TYPE_SHIELD = 7;
|
||||
public const ITEM_TYPE_BELT = 8;
|
||||
public const ITEM_TYPE_RING = 9;
|
||||
const ITEM_TYPE_AMULET = 10;
|
||||
const ITEM_TYPE_CONSUMABLE = 20;
|
||||
public const ITEM_TYPE_AMULET = 10;
|
||||
public const ITEM_TYPE_CONSUMABLE = 20;
|
||||
const ITEM_TYPE_OTHER = 50;
|
||||
const ITEM_TYPE_TRASH = 100;
|
||||
|
||||
|
@ -4,8 +4,10 @@
|
||||
namespace Battles\Magic;
|
||||
use Battles\UserEffects;
|
||||
use Battles\User;
|
||||
use db;
|
||||
use Krugozor\Database\Mysql\Exception;
|
||||
|
||||
class CureInjury extends magic
|
||||
class CureInjury extends Magic
|
||||
{
|
||||
private $target;
|
||||
use UserEffects;
|
||||
@ -14,16 +16,16 @@ class CureInjury extends magic
|
||||
* Магия лечения травм. Если у персонажа несколько травм, лечится самая тяжёлая.
|
||||
* @param $target - кого лечим.
|
||||
* @param $injuryType - тип травмы, которую лечим. 11 лёгкая, 12 средняя, 13 тяжёлая, 14 неизлечимая.
|
||||
* @throws \Krugozor\Database\Mysql\Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct($target, $injuryType)
|
||||
{
|
||||
$this->target = $target;
|
||||
if ($target && $this->isUsable()) {
|
||||
$injury = \db::c()->query('SELECT effect_id, type, name FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i ORDER BY type DESC LIMIT 1', $target)->fetch_object();
|
||||
$injury = db::c()->query('SELECT effect_id, type, name FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i ORDER BY type DESC LIMIT 1', $target)->fetch_object();
|
||||
$targetName = $this->target->login;
|
||||
if (in_array($injury->effect_id, [11, 12, 13, 14]) && $injuryType >= $injury->type) {
|
||||
\db::c()->query('DELETE FROM users_effects WHERE effect_id = ?i', $injury->effect_id);
|
||||
db::c()->query('DELETE FROM users_effects WHERE effect_id = ?i', $injury->effect_id);
|
||||
if (empty($injury->name) || $injury->name == 'Неизвестный эффект') {
|
||||
$injuryName = self::$effectName[$injury->type];
|
||||
} else {
|
||||
@ -31,7 +33,7 @@ class CureInjury extends magic
|
||||
}
|
||||
return "Вы вылечили повреждение ${injuryName} персонажу ${targetName}.";
|
||||
} elseif ($injury->effect_id && $injuryType == 15) {
|
||||
\db::c()->query('DELETE FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i', $target);
|
||||
db::c()->query('DELETE FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i', $target);
|
||||
return "Вы вылечили все повреждения персонажу ${targetName}.";
|
||||
} else {
|
||||
return false;
|
||||
|
@ -5,7 +5,7 @@ class Magic
|
||||
{
|
||||
protected $status;
|
||||
|
||||
protected function isVisible($caster, $target)
|
||||
protected function isVisible($caster, $target):bool
|
||||
{
|
||||
if ($caster->battle != $target->battle || $caster->room != $target->room) {
|
||||
$this->status = 'Вы не видите цель!';
|
||||
@ -15,7 +15,7 @@ class Magic
|
||||
}
|
||||
}
|
||||
|
||||
protected function isNotDead($caster)
|
||||
protected function isNotDead($caster):bool
|
||||
{
|
||||
if ($caster->health < 1) {
|
||||
$this->status = 'Вы мертвы!';
|
||||
@ -25,7 +25,7 @@ class Magic
|
||||
}
|
||||
}
|
||||
|
||||
protected function enoughMana($caster)
|
||||
protected function enoughMana($caster):bool
|
||||
{
|
||||
if ($caster->mana < 1) {
|
||||
$this->status = 'Недостаточно пыли!';
|
||||
@ -35,7 +35,7 @@ class Magic
|
||||
}
|
||||
}
|
||||
|
||||
protected function isNotInBattle($caster)
|
||||
protected function isNotInBattle($caster):bool
|
||||
{
|
||||
if ($caster->battle) {
|
||||
$this->status = 'Невозможно применить в поединке!';
|
||||
@ -44,4 +44,20 @@ class Magic
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверка на успех заклинания. Чем выше интеллект, тем выше шанс успеха.
|
||||
* @param $caster - заклинатель (массив значений из базы).
|
||||
* @param int $difficulty - сложность произнесения заклинания. Чем выше значение, тем сложнее проверка. 40 - самая сложная проверка.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function skillCheck($caster, int $difficulty = 40):bool
|
||||
{
|
||||
# 40 - потолок стата.
|
||||
if ($difficulty > 40) {
|
||||
$difficulty = 40;
|
||||
}
|
||||
return mt_rand(1,$difficulty) < $caster->intelligence;
|
||||
}
|
||||
}
|
49
classes/Battles/Magic/Sharpen.php
Normal file
49
classes/Battles/Magic/Sharpen.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Battles\Magic;
|
||||
|
||||
|
||||
use Battles\DressedItems;
|
||||
use Battles\Item;
|
||||
use Battles\User;
|
||||
use Krugozor\Database\Mysql\Exception;
|
||||
use db;
|
||||
|
||||
class Sharpen extends Magic
|
||||
{
|
||||
private $magicDifficulty;
|
||||
|
||||
/**
|
||||
* Sharpen constructor.
|
||||
*
|
||||
* @param int $sharpenStrength
|
||||
* @param int $magicDifficulty
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(int $sharpenStrength, int $magicDifficulty)
|
||||
{
|
||||
$this->magicDifficulty = $magicDifficulty;
|
||||
if ($this->isUsable()) {
|
||||
$item = DressedItems::getDressedItemBySlot(Item::ITEM_TYPE_WEAPON, $_SESSION['uid']);
|
||||
// Проверяем, что в названии предмета нет цифр и плюсов.
|
||||
if (preg_match('/[\W\S]+\+\[?[\d]]?/', $item['name'])) {
|
||||
return 'Этот предмет точить нельзя!';
|
||||
}
|
||||
$newMinPhysicalDamage = $item['add_min_physical_damage'] + $sharpenStrength;
|
||||
$newMaxPhysicalDamage = $item['add_max_physical_damage'] + $sharpenStrength;
|
||||
$newItemName = $item['name'] . " [+$sharpenStrength]";
|
||||
|
||||
db::c()->query('UPDATE battles.inventory WHERE item_id = ?i SET name = "?s", add_min_physical_damage = "?s", add_max_physical_damage = "?s"', $item['item_id'], $newItemName, $newMinPhysicalDamage, $newMaxPhysicalDamage);
|
||||
return "У вас получилось изготовить предмет $newItemName!";
|
||||
} else {
|
||||
return $this->status;
|
||||
}
|
||||
}
|
||||
private function isUsable():bool
|
||||
{
|
||||
$caster = new User($_SESSION['uid']);
|
||||
return $this->isNotInBattle($caster) && $this->skillCheck($caster, $this->magicDifficulty);
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
// Магия восстагновления здоровья
|
||||
use Battles\Magic\Magic;
|
||||
use Battles\User;
|
||||
class Healing extends \Battles\Magic\Magic
|
||||
class Healing extends Magic
|
||||
{
|
||||
private $target;
|
||||
private $magicPower;
|
||||
@ -45,6 +46,6 @@ class Healing extends \Battles\Magic\Magic
|
||||
} else {
|
||||
$this->target = new User($this->target);
|
||||
}
|
||||
return ($this->isVisible($caster, $this->target) && $this->isNotDead($caster) && $this->enoughMana($caster));
|
||||
return $this->isVisible($caster, $this->target) && $this->isNotDead($caster) && $this->enoughMana($caster) && $this->skillCheck($caster);
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ndubina` = `ndubina`+1, `nlovk` = `nlovk`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ndubina` = `ndubina`+11, `nlovk` = `nlovk`+11 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ndubina` = `ndubina`+2, `nlovk` = `nlovk`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ndubina` = `ndubina`+3, `nlovk` = `nlovk`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ndubina` = `ndubina`+4, `nlovk` = `nlovk`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ndubina` = `ndubina`+5, `nlovk` = `nlovk`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `nmech` = `nmech`+1, `cost` = `cost`+6, `nvinos` = `nvinos`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `nmech` = `nmech`+11, `cost` = `cost`+72, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `minu` = `minu`+2, `maxu`=`maxu`+2, `nmech` = `nmech`+2, `cost` = `cost`+12, `nvinos` = `nvinos`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `cost` = `cost`+18,`name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `nmech` = `nmech`+3, `nvinos` = `nvinos`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nmech` = `nmech`+4, `nvinos` = `nvinos`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `nmech` = `nmech`+5, `cost` = `cost`+30, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `nnoj` = `nnoj`+1, `ninta` = `ninta`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `nnoj` = `nnoj`+1, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `nnoj` = `nnoj`+2, `ninta` = `ninta`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `nnoj` = `nnoj`+3, `ninta` = `ninta`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nnoj` = `nnoj`+4, `ninta` = `ninta`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `nnoj` = `nnoj`+5, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ntopor` = `ntopor`+1, `nsila` = `nsila`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ntopor` = `ntopor`+1, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ntopor` = `ntopor`+2, `nsila` = `nsila`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ntopor` = `ntopor`+3, `nsila` = `nsila`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ntopor` = `ntopor`+4, `nsila` = `nsila`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ntopor` = `ntopor`+5, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user