/** &bYou performed a charm spell on the %s! Minex just performed a charm spell on the kobold! */ protected void handleSingleTarget(Entity target) { // Can't charm arena mobs. if (RoomFlags.SAFE.isSet(_room.getRoomFlags()) || RoomFlags.ARENA.isSet(_room.getRoomFlags())) { _entity.print(TaMessageManager.NCSHER.getMessage()); return; } // Can't charm players, though that would be cool. if (target.getEntityType().equals(EntityType.PLAYER)) { _entity.print(TaMessageManager.NOCHCH.getMessage()); return; } // Random failure chance. if (!WorldManager.getGameMechanics().isCharmSpellSuccess(_entity, (Mob) target, _spell)) { handleUnsuccessfulSpell(); return; } String messageToPlayer = MessageFormat.format(TaMessageManager.SPLCHM.getMessage(), target.getName()); String messageToRoom = MessageFormat.format( TaMessageManager.CHMOTH.getMessage(), _entity.getName(), _spell.getMessage(), target.getName()); _entity.print(messageToPlayer); _room.print(_entity, messageToRoom, false); // TODO - modify the mobs behavior here. // Place the summoned mob into the group. Entity groupLeader = _entity.getGroupLeader(); if (groupLeader.equals(_entity)) { _entity.getGroupList().add(target); target.setGroupLeader(_entity); } else { groupLeader.getGroupList().add(target); target.setGroupLeader(groupLeader); } handleSpellSuccess(); }