aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


server/omni_pol_armor_test.go (776B)


      1 package main
      2 
      3 import "testing"
      4 
      5 func TestOmniPolIntermediateQualityCanBeWorn(t *testing.T) {
      6 	world, _ := newEquipmentWorld(t)
      7 	player, client := world.characters[1], world.clients[1]
      8 	player.appearance = 0x515
      9 	player.stats.Abilities.Stamina, player.stats.Abilities.Strength = 13, 12
     10 	if err := world.saveUser(player); err != nil {
     11 		t.Fatal(err)
     12 	}
     13 	if granted, err := world.grantItem(player, 85591); err != nil || !granted {
     14 		t.Fatal(granted, err)
     15 	}
     16 	player.inventory.Items[1].Quality = 2
     17 	if err := world.saveInventory(player, player.inventory); err != nil {
     18 		t.Fatal(err)
     19 	}
     20 
     21 	err := world.handleInventory(client, inventoryMovePacket(1, 65, 24)[20:])
     22 
     23 	if err != nil || client.equipment == nil {
     24 		t.Fatal("qualified Omni-Pol QL2 gloves did not start wear", err)
     25 	}
     26 }