Index: src/map/packet_system.cpp =================================================================== --- src/map/packet_system.cpp (revision 2525) +++ src/map/packet_system.cpp (working copy) @@ -3810,28 +3810,47 @@ uint8 spellToAdd = RBUFB(data,(0x04)); // this is non-zero if client wants to add. uint8 spellInQuestion = 0; uint8 spellIndex = -1; - // loop all 20 slots and find which index they are playing with - for (uint8 i = 0x0C; i <= 0x1F; i++) { - if ( RBUFB(data,i) > 0 ) { - spellInQuestion = RBUFB(data,i); - spellIndex = i - 0x0C; - break; + + if (spellToAdd == 0x00) { + for (uint8 i = 0x0C; i <= 0x1F; i++) { + if ( RBUFB(data,i) > 0 ) { + spellInQuestion = RBUFB(data,i); + spellIndex = i - 0x0C; + CSpell* spell = spell::GetSpell(spellInQuestion + 0x200); // the spells in this packet are offsetted by 0x200 from their spell IDs. + + if (spell != NULL) { + blueutils::SetBlueSpell(PChar, spell, spellIndex, (spellToAdd > 0)); + } + else { + ShowDebug("Cannot resolve spell id \n"); + } + } } - } + } + else { + // loop all 20 slots and find which index they are playing with + for (uint8 i = 0x0C; i <= 0x1F; i++) { + if ( RBUFB(data,i) > 0 ) { + spellInQuestion = RBUFB(data,i); + spellIndex = i - 0x0C; + break; + } + } - if (spellIndex != -1 && spellInQuestion != 0) { - CSpell* spell = spell::GetSpell(spellInQuestion + 0x200); // the spells in this packet are offsetted by 0x200 from their spell IDs. + if (spellIndex != -1 && spellInQuestion != 0) { + CSpell* spell = spell::GetSpell(spellInQuestion + 0x200); // the spells in this packet are offsetted by 0x200 from their spell IDs. - if (spell != NULL) { - blueutils::SetBlueSpell(PChar, spell, spellIndex, (spellToAdd > 0)); + if (spell != NULL) { + blueutils::SetBlueSpell(PChar, spell, spellIndex, (spellToAdd > 0)); + } + else { + ShowDebug("Cannot resolve spell id \n"); + } } else { - ShowDebug("Cannot resolve spell id \n"); + ShowDebug("No match found. \n"); } } - else { - ShowDebug("No match found. \n"); - } } else { ShowDebug("Got 0x102 but it's not for JOB_BLU.");