Проверки при одевании предметов. fix #8
This commit is contained in:
@@ -217,5 +217,18 @@ class UserStats extends User
|
||||
return $this->legArmor;
|
||||
}
|
||||
|
||||
public function getFullStats()
|
||||
{
|
||||
$query = "
|
||||
select
|
||||
sum(greatest(strength + (ifnull((select sum(add_strength) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allStrength,
|
||||
sum(greatest(dexterity + (ifnull((select sum(add_dexterity) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allDexterity,
|
||||
sum(greatest(intuition + (ifnull((select sum(add_intuition) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allIntuition,
|
||||
sum(greatest(endurance + (ifnull((select sum(add_endurance) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allEndurance,
|
||||
sum(greatest(intelligence + (ifnull((select sum(add_intelligence) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allIntelligence,
|
||||
sum(greatest(wisdom + (ifnull((select sum(add_wisdom) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as allWisdom
|
||||
from users where id = $this->id";
|
||||
return self::$db->ofetch($query);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user