public function create_object($data) { return Weapon::create($data); }
$weapon->isAttack = 1; $weapon->weaponCount = $amount; $weapon->weaponStrength = $conf['weapon' . $wId . 'strength']; if ($amount and $weapon->create()) { $t->saWeapons[] = $weapon; } } foreach ($tobuy[0] as $wId => $amount) { $weapon = new Weapon(); $weapon->userId = $user->id; $weapon->weaponId = $wId; $weapon->isAttack = 0; $weapon->weaponCount = $amount; $weapon->weaponStrength = $conf['weapon' . $wId . 'strength']; if ($amount and $weapon->create()) { $t->daWeapons[] = $weapon; } } $user->cacheStats(); } else { $t->err = 'Not enough Gold'; } } $t->user = $user; if (!$t->saWeapons and !$t->daWeapons) {