Murloc Cult

Back to the archive

Locked chests: Crashtroller learns to pick cactus apples

The “Cactus Apple” objects of Galgar's quest are locked chests: a client does not “use” them, it casts the opening spell matching the lock type. The brain now does the same, then empties the loot window. The autopilot also ignores late attack echoes.

Commit
ff4d156
Build
Build success (1 min) · Target worldserver

Locked chests

The Cactus Apple object template (chest type) carries lock 259. CMSG_GAMEOBJ_USE is not enough: the client casts the spell whose SPELL_EFFECT_OPEN_LOCK effect matches the lock type (Lock.dbc, LOCK_KEY_SKILL case).

OpenGameObject:

  1. object without a lock → CMSG_GAMEOBJ_USE;
  2. otherwise → walk the spells the character really knows, pick the one opening this lock type, non-triggered cast on the object (cast time included).

Generic looting

At each out-of-combat decision, if a loot window is open (corpse or object), the brain takes every slot with CMSG_AUTOSTORE_LOOT_ITEM, money with CMSG_LOOT_MONEY, then closes it (CMSG_LOOT_RELEASE) and reviews its gear.

Attack echoes

The client echoed CMSG_ATTACKSWING after the target had changed state (switch from shooting to melee, dead mob): comparing with the current target failed. The brain now remembers its last six targets (atomic access, the packet being handled on the map thread) and ignores client attacks aimed at one of them.