Beispiel #1
0
 /**
  * @param MemStream $s
  */
 public function serial(MemStream $s)
 {
     $s->serial_sint8($this->version);
     $this->Continents = array();
     $s->serial_uint32($nbCont);
     for ($i = 0; $i < $nbCont; $i++) {
         $this->serialContinent($s);
     }
 }
Beispiel #2
0
 /**
  * @param MemStream $s
  */
 public function serial(MemStream $s)
 {
     $s->serial_string($this->MaleShape);
     $s->serial_string($this->FemaleShape);
     $s->serial_uint64($this->SlotBF);
     $s->serial_uint32($this->MapVariant);
     $s->serial_uint32($this->Family);
     $s->serial_uint32($this->ItemType);
     $s->serial_string($this->Icon, 4);
     $s->serial_sint32($this->IconColor, 4);
     $s->serial_string($this->IconText);
     $s->serial_string($this->AnimSet);
     $s->serial_sint8($this->Color);
     $s->serial_byte($this->HasFx);
     $s->serial_byte($this->DropOrSell);
     $s->serial_byte($this->IsItemNoRent);
     $s->serial_byte($this->NeverHideWhenEquiped);
     $s->serial_uint32($this->Stackable);
     $s->serial_byte($this->IsConsumable);
     $s->serial_float($this->Bulk);
     $s->serial_uint32($this->EquipTime);
     $this->FX = new CFX();
     $this->FX->serial($s);
     $s->serial_uint32($nbItems);
     $this->StaticFXs = array();
     for ($fx = 0; $fx < $nbItems; $fx++) {
         $sfx = new CStaticFX();
         $sfx->serial($s);
         $this->StaticFXs[] = $sfx;
     }
     $s->serial_string($this->Effect, 4);
     $s->serial_uint32($nbItems);
     $this->MpItemParts = array();
     for ($mp = 0; $mp < $nbItems; $mp++) {
         $row = new CMpItemPart();
         $row->serial($s);
         $this->MpItemParts[] = $row;
     }
     $s->serial_uint32($this->CraftPlan);
     $s->serial_uint32($this->RequiredCharac);
     $s->serial_short($this->RequiredCharacLevel);
     $s->serial_uint32($this->RequiredSkill);
     $s->serial_short($this->RequiredSkillLevel);
     $s->serial_uint32($this->ItemOrigin);
     switch ($this->Family) {
         case EItemFamily::ARMOR:
             $this->Armor = new CArmor();
             $this->Armor->serial($s);
             break;
         case EItemFamily::MELEE_WEAPON:
             $this->MeleeWeapon = new CMeleeWeapon();
             $this->MeleeWeapon->serial($s);
             break;
         case EItemFamily::RANGE_WEAPON:
             $this->RangeWeapon = new CRangeWeapon();
             $this->RangeWeapon->serial($s);
             break;
         case EItemFamily::AMMO:
             $this->Ammo = new CAmmo();
             $this->Ammo->serial($s);
             break;
         case EItemFamily::RAW_MATERIAL:
             $this->Mp = new CMp();
             $this->Mp->serial($s);
             break;
         case EItemFamily::SHIELD:
             $this->Shield = new CShield();
             $this->Shield->serial($s);
             break;
         case EItemFamily::CRAFTING_TOOL:
         case EItemFamily::HARVEST_TOOL:
         case EItemFamily::TAMING_TOOL:
             $this->Tool = new CTool();
             $this->Tool->serial($s);
             break;
         case EItemFamily::TELEPORT:
             $this->Teleport = new CTeleport();
             $this->Teleport->serial($s);
             break;
         case EItemFamily::PET_ANIMAL_TICKET:
             $this->Pet = new CPet();
             $this->Pet->serial($s);
             break;
         case EItemFamily::GUILD_OPTION:
             $this->GuildOption = new CGuildOption();
             $this->GuildOption->serial($s);
             break;
         case EItemFamily::COSMETIC:
             $this->Cosmetic = new CCosmetic();
             $this->Cosmetic->serial($s);
             break;
         case EItemFamily::CONSUMABLE:
             $this->Consumable = new CConsumable();
             $this->Consumable->serial($s);
             break;
         case EItemFamily::SCROLL:
             $this->Scroll = new CScroll();
             $this->Scroll->serial($s);
             break;
     }
 }