• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Przerobienie funkcji itemek w Nicaw

trasaklasa

New Member
Joined
Mar 2, 2012
Messages
95
Reaction score
0
config.inc
Code:
################# Knight #########################
$id = 4;

$cfg['vocations'][$id]['equipment'][1] = 2480;
$cfg['vocations'][$id]['equipment'][2] = 2172;
$cfg['vocations'][$id]['equipment'][3] = 2000;
$cfg['vocations'][$id]['equipment'][4] = 2464;
$cfg['vocations'][$id]['equipment'][6] = 2530;
$cfg['vocations'][$id]['equipment'][7] = 2468;
$cfg['vocations'][$id]['equipment'][8] = 2643;

tak wyglądaja funkcje w nicaw
a o to plik

player.php (fragment tworzenia item)
Code:
  //make items
  $sid = 100;
  while ($item = current($cfg['vocations'][$vocation]['equipment'])) {
  $sid++;
  $d['player_id']   = $pid;
  $d['pid']     = key($cfg['vocations'][$vocation]['equipment']);
  $d['sid']     = $sid;
  $d['id']   = $item;
  $d['attributes']= '';

  $SQL->myInsert('player_items',$d);
  unset($d);
  next($cfg['vocations'][$vocation]['equipment']);
  }

Jest to poprostu funkcja do avesty a ja uzywam innego silnika :p

Chciałbym aby były wykonywane takie zapytania:

Code:
INSERT INTO `player_items` (`player_id`, `slot`, `sid`, `pid`, `id`, `count`, `actionid`, `charges`, `time`, `uniqueid`, `text`, `writer`, `special_description`) VALUES(". $player->getId(). ", 1, 1, 0, 2490, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 3, 2, 0, 2004, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 4, 3, 0, 2463, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 7, 4, 0, 2647, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 8, 5, 0, 2643, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 0, 6, 2, 2160, 3, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 0, 7, 2, 2525, 0, 0, 0, 0, 0, '', '', ''),
(". $player->getId(). ", 0, 8, 2, 2423, 0, 0, 0, 0, 0, '', '', ''),

Probowałem pierwsze co zrobic to config w odpowiedni sposób czyli: np przerobic
Code:
$cfg['vocations'][$id]['equipment'][1] = 2480
;
na:
Code:
$cfg['vocations'][$id][slot][sid-jest tam automatycznie w skrypcie czyli bez sida w configu][pid][id][count][actionid[charges][time][uniqueid][text][writer][special_description]

i wtedy np.
Code:
$cfg['vocations'][$id][pid=1][id=2][coun=100]itd...

oczywiscie probowalem to innym sposobem niz takim jak wyzej, tylko chodzi mi o to aby te wszystkie rzeczy jak wyzej byly zawarte i pobierane z configu.
 
Back
Top