<?php

require_once __DIR__ . '/../ryzom_extra.php';
$result = ryzom_vs_sheet(1, 1);
var_dump($result);
$result = ryzom_vs_index(1, 'icfahv.sitem');
var_dump($result);
Esempio n. 2
0
 /**
  * @param int $slot
  * @param int $index
  *
  * @return array
  */
 private function lookupSlotItem($slot, $index)
 {
     $sheet = ryzom_vs_sheet($slot, $index);
     if ($sheet === false) {
         // invalid item for slot, use default
     }
     if (!$sheet) {
         var_dump($slot, $index, $sheet);
         die;
     }
     $sheet = substr($sheet, 0, -6);
     $grade = self::$sheetArray[$sheet]['grade'];
     if ($this->gender == 'f') {
         $shape = self::$sheetArray[$sheet]['femaleShape'];
     } else {
         $shape = self::$sheetArray[$sheet]['maleShape'];
     }
     return ['sheet' => $sheet, 'shape' => $shape, 'grade' => $grade];
 }
Esempio n. 3
0
 /**
  * Expand visual prop values into $args
  *
  * @param array $args
  *
  * @return array
  */
 private function decodeVisualProps(array $args)
 {
     $vpa = new SPropVisualA();
     $vpa->setValue($this->getUnsigned64bit($args['vpa']));
     $vpb = new SPropVisualB();
     $vpb->setValue($this->getUnsigned64bit($args['vpb']));
     $vpc = new SPropVisualC();
     $vpc->setValue($this->getUnsigned64bit($args['vpc']));
     unset($args['vpa'], $args['vpb'], $args['vpc']);
     $hat = ryzom_vs_sheet(EVisualSlot::HEAD_SLOT, $vpa->HatModel);
     if ($hat) {
         $args['race'] = substr($hat, 0, 2);
         // map any haircut to hair so that race check can be done later
         if (strstr($hat, '_hair_') !== false || strstr($hat, '_cheveux_') !== false) {
             // uses vs index
             $args['hair'] = $vpa->HatModel . '/' . $vpa->HatColor;
             unset($args['head']);
         } else {
             unset($args['hair']);
             // uses sheetid
             $args['head'] = $hat . '/' . $vpa->HatColor;
         }
     } elseif (!isset($args['race'])) {
         // fallback - unknown haircut and url does not have race set
         $args['race'] = TPeople::FYROS;
     }
     $args['gender'] = strtolower(EGender::toString($vpa->Sex));
     $args['race'] = strtolower(TPeople::toString($this->normalizeRace($args['race'])));
     // its fine if we fail items
     $s = ryzom_vs_sheet(EVisualSlot::ARMS_SLOT, $vpa->ArmModel);
     if ($s) {
         $args['arms'] = $s . '/' . $vpa->ArmColor;
     }
     $s = ryzom_vs_sheet(EVisualSlot::LEGS_SLOT, $vpa->TrouserModel);
     if ($s) {
         $args['legs'] = $s . '/' . $vpa->TrouserColor;
     }
     $s = ryzom_vs_sheet(EVisualSlot::HANDS_SLOT, $vpb->HandsModel);
     if ($s) {
         $args['hands'] = $s . '/' . $vpb->HandsColor;
     }
     $s = ryzom_vs_sheet(EVisualSlot::FEET_SLOT, $vpb->FeetModel);
     if ($s) {
         $args['feet'] = $s . '/' . $vpb->FeetColor;
     }
     $s = ryzom_vs_sheet(EVisualSlot::CHEST_SLOT, $vpa->JacketModel);
     if ($s) {
         $args['chest'] = $s . '/' . $vpa->JacketColor;
     }
     $args['tattoo'] = $vpc->Tattoo;
     $args['eyes'] = $vpc->EyesColor;
     $handr = ryzom_vs_sheet(EVisualSlot::RIGHT_HAND_SLOT, $vpa->WeaponRightHand);
     if ($handr) {
         $args['handr'] = $handr;
     }
     $handl = ryzom_vs_sheet(EVisualSlot::LEFT_HAND_SLOT, $vpa->WeaponLeftHand);
     if ($handl) {
         $args['handl'] = $handl;
     }
     $args['morph'] = join(',', [$vpc->MorphTarget1, $vpc->MorphTarget2, $vpc->MorphTarget3, $vpc->MorphTarget4, $vpc->MorphTarget5, $vpc->MorphTarget6, $vpc->MorphTarget7, $vpc->MorphTarget8]);
     $args['gabarit'] = join(',', [$vpc->CharacterHeight, $vpc->TorsoWidth, $vpc->ArmsWidth, $vpc->LegsWidth, $vpc->BreastSize]);
     return $args;
 }